Image Map Image Map
Page 1 of 8 12345 ... LastLast
Results 1 to 10 of 73

Thread: MDA, Hercules and other clones, what's the frequency, Kenneth?

  1. #1
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    2,024

    Default MDA, Hercules and other clones, what's the frequency, Kenneth?

    I am currently playing around with Hercules graphics programming.
    I don't have a real Hercules card. I do however have two clones. One is an ATi Small Wonder, the other is a Paradise PVC4 (two very similar cards, perhaps even a shared design?).
    What I noticed is that these cards use a 16.257 MHz crystal. This is the same frequency as the crystal on an IBM MDA card (and on an EGA card).
    However, on actual Hercules cards, you find a 16.000 MHz crystal instead.
    Studying the CRTC registers for Hercules, it appears that it uses the exact same settings as IBM's MDA card in textmode. This would imply that the refresh rate of a real Hercules is slightly lower than MDA in textmode.

    However, for the graphics mode, the CRTC registers appear to be programmed to the same number of scanlines, but a slightly narrower horizontal width.
    That would mean that the graphics mode on a real Hercules card would be closer to the 50 Hz of textmode on a real MDA card.
    For completeness, here are the values I distilled from the INIT.ASM file that comes on the Hercules Graphics Plus disks (http://minuszerodegrees.net/software/hercplus.zip):
    Code:
    /* 6485 controller mode data */
    char hgcdat[2][12] = {
    {
    	/* Text mode (MDA) */
    	// Each character is 9 pixels
    	// Each row is 14 scanlines
    	0x61,	// Horizontal total: 97 characters ('minus one', 98*9 = 882 pixels)
    	0x50,	// Horizontal displayed: 80 characters (80*9 = 720 pixels)
    	0x52,	// Horizontal sync position: 82 characters (82*9 = 738 pixels)
    	0x0f,	// Horizontal sync width: 15 characters (15*9 = 135 pixels)
    	0x19,	// Vertical total: 25 rows ('minus one': 26*14 = 364 scanlines)
    	0x06,	// Vertical total adjust: 6 scanlines (364+6 = 370)
    	0x19,	// Vertical displayed: 25 rows (25*14 = 350 scanlines)
    	0x19,	// Vertical sync position: 25 rows (25*14 = 350 scanlines)
    	0x02,	// Interlace mode: 2
    	0x0d,	// Maximum scan line address: 13 scanlines ('minus one', set character height to 14)
    	0x0b,	// Cursor start: 11 scanlines
    	0x0c	// Cursor end: 12 scanlines
    },
    {
    	/* Graphics mode (HGC) */
    	// Each character is 2 bytes, each byte is 8 pixels
    	// Each row is 4 scanlines
    	0x35,	// Horizontal total: 53 characters ('minus one': 54*2*8 = 864 pixels)
    	0x2d,	// Horizontal displayed: 45 characters (45*2*8 = 720 pixels)
    	0x2e,	// Horizontal sync position: 46 characters (46*2*8 = 736 pixels)
    	0x07,	// Horizontal sync width: 7 characters (7*2*8 = 112 pixels)
    	0x5b,	// Vertical total: 91 rows ('minus one': 92*4 = 368 scanlines)
    	0x02,	// Vertical total adjust: 2 scanlines (368+2 = 370)
    	0x57,	// Vertical displayed: 87 rows (87*4 = 348 scanlines)
    	0x57,	// Vertical sync position: 87 rows (87*4 = 348 scanlines)
    	0x02,	// Interlace mode: 2
    	0x03,	// Maximum scan line address: 3 scanlines ('minus one', set 'character' height to 4, to get 4-way interleaved graphics mode)
    	0x00,	// Cursor start: 0 scanlines
    	0x00	// Cursor end: 0 scanlines
    }
    };
    So my first question is:
    Could people with Hercules cards or other clones with MDA-compatible output check what kind of crystal is on there?
    Even better would be if someone could measure the frame timings with an actual scope, both for text and graphics modes.

    Second question is:
    If anyone has any additional resources for programming Hercules, or anything related, I'm all ears (original manuals/reference documents etc would be very welcome).
    Last edited by Scali; April 25th, 2016 at 03:49 AM.

  2. Default

    My IBM MDA card also has a 16.257kHz crystal.

  3. #3
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    29,945
    Blog Entries
    20

    Default

    The manuals that came with a real Hercules had a nice section on programming details.

  4. #4
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    2,024

    Default

    Quote Originally Posted by Chuck(G) View Post
    The manuals that came with a real Hercules had a nice section on programming details.
    Sadly I have not been able to locate the manuals in PDF format so far.

  5. #5
    Join Date
    Jan 2007
    Location
    Pacific Northwest, USA
    Posts
    29,945
    Blog Entries
    20

    Default

    If you can't find one, I can probably scan the one from the Herc Graphics Plus, which, other than the font ram area, operates the same way. I may well have other paper--I haven't looked yet.
    Last edited by Chuck(G); April 25th, 2016 at 10:48 AM.

  6. #6
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    2,024

    Default

    I have made a simple program to check the timings by polling for the vblank signal, and recording times between two vblank signals in PIT ticks.
    And indeed, in graphics mode I recorded less ticks than in text mode, which confirms that the refresh rate is slightly higher in graphics mode.
    Hercules-rates.jpg

    For people who want to try it on their Hercules or clone, here is the binary:
    https://www.dropbox.com/s/lo7p9ravnq...CTIME.zip?dl=0

  7. #7

    Default

    This Amdek card uses a 16.000 MHz crystal:

    http://www.ebay.com/itm/262385276343

  8. #8
    Join Date
    Dec 2014
    Location
    The Netherlands
    Posts
    2,024

    Default

    Quote Originally Posted by Scali View Post
    I have made a simple program to check the timings by polling for the vblank signal, and recording times between two vblank signals in PIT ticks.
    And indeed, in graphics mode I recorded less ticks than in text mode, which confirms that the refresh rate is slightly higher in graphics mode.
    I did the maths, and it seems to check out:
    Measured (ATi Small Wonder, 16.257 MHz crystal):
    Graphics: ~23440 ticks
    Text: ~23923 ticks

    Total pixels:
    Graphics: 864*370 = 319680
    Text: 882*370 = 326340

    319680/326340 = 0.97959183673469387755102040816327
    23440/23923 = 0.97981022447017514525770179325335

    So indeed, there appears to be about a 2% difference in number of pixels between the modes, translating in about 2% difference in framerate.
    The only thing left to check is to see the number of ticks on a card with a 16.000 MHz crystal. We would expect the same 2% difference between modes, but overall the frametime will be slightly longer than on my card.

  9. #9

    Default

    Just had a look on a bunch of cards, and the XTALs are:

    original HGC (GB102) - 16 MHz
    HGC+ (GB112) - 16MHz
    EPSON Q205A (Hercules/CGA "dual") - 16M7C
    MGP-6A, based on W86855AF - 16.000
    3088D, based on TD 3088 A2 - 16.000
    DT-5138, based on TD3088A - 16257
    noname based on MS61C88 - 16.000
    JET-MGP 3088-A2, based on TD3088A - 16.000
    HI RES 4/4WPP, based on PVC4 (Hercules/CGA "dual") - 16.2570
    Last edited by Xacalite; April 26th, 2016 at 09:50 AM. Reason: one more card

  10. #10

    Default

    As for the programming resources, have a look at the undocumented stuff as well:
    http://ftp.freenet.de/pub/ftp.simtel...n/herkules.zip - 720x360 mode
    http://ftp.freenet.de/pub/ftp.simtel...een/hi-hgc.zip - 640x400 interlaced mode, fails to work on some cards!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •