VOGONS


First post, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

I've added support in CAPE for multi adapter. This means you can have a EGA card and a MDA card in the system now. I do not have anything interesting to show (does anyone know of any app that would use 2 adapters at once?) but here it is. It display 2 windows one for each virtual monitor. The monitor on the left is EGA and on the right is MDA in this case. I am adding Hercules support and that is where things can get interesting.

The windows are independent and not stuck to each other, you can move them around.

Screen Shot 2017-03-15 at 12.46.19 PM.png
Filename
Screen Shot 2017-03-15 at 12.46.19 PM.png
File size
183.94 KiB
Views
642 views
File comment
EGA + MDA on a IBM PC XT
File license
Fair use/fair dealing exception

The launching GUI also has now multi adapter support as well.

Screen Shot 2017-03-15 at 12.51.58 PM.png
Filename
Screen Shot 2017-03-15 at 12.51.58 PM.png
File size
99.25 KiB
Views
642 views
File comment
GUI
File license
Fair use/fair dealing exception

Things will get a bit slow because cycle emulating 2 adapter+CPU is not fast 🙁

EDIT: the reason it is running slow in the screenshot (2.4Mhz) is because that was a debug build. It can run XT at full speeds, even with 2 adapters.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 2 of 10, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie
crazyc wrote:

Turbo debugger for windows
and SoftICE too. Not sure what is available that works on an XT though.

Thank you! If Turbo Debugger works on a 286 I can try it.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 3 of 10, by Scali

User metadata
Rank l33t
Rank
l33t

If you can emulate VGA+MDA as well (and a 386/486), try the demo Stars by NoooN: http://www.pouet.net/prod.php?which=301
You'll see 😀

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 4 of 10, by Scali

User metadata
Rank l33t
Rank
l33t
vladstamate wrote:

Thank you! If Turbo Debugger works on a 286 I can try it.

Yes, Turbo Debugger even works on 8088.
I believe there's a TD286.EXE binary for 286+.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 5 of 10, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

Thank you for both pointers Scali. Unfortunately I do not yet emulate VGA or a 386 🙁

Here is another screenshot of a XT with an EGA and a Hercules this time around playing Simcity Demo on the second card (the Hercules). I am not sure why it thinks it did not detect a Hercules but it runs fine.

Attachments

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 6 of 10, by Scali

User metadata
Rank l33t
Rank
l33t

Well, the only way I've ever heard of to 'detect' a Hercules is to try and switch it to graphics mode, and measure the time between vbls.
If the game is doing that, then perhaps the timing is not what it expects (on real Hercules, you have slightly less pixels per scanline in graphics mode than in text mode, but the pixel clock is the same, so the framerate is slightly higher, enough that you can measure it).

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 7 of 10, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie
Scali wrote:

Well, the only way I've ever heard of to 'detect' a Hercules is to try and switch it to graphics mode, and measure the time between vbls.
If the game is doing that, then perhaps the timing is not what it expects (on real Hercules, you have slightly less pixels per scanline in graphics mode than in text mode, but the pixel clock is the same, so the framerate is slightly higher, enough that you can measure it).

You mean the fact that it has 348 scanlines instead of 350? (graphics vs text) That would make the vblank shorter yes. I'm missing proper timing for Hercules emulation so I will need to add that. The original Hercules also has some other quirks as opposed to clones (or an MDA) and I want to add support for that too, for completness sake.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 8 of 10, by Scali

User metadata
Rank l33t
Rank
l33t
vladstamate wrote:

You mean the fact that it has 348 scanlines instead of 350? (graphics vs text) That would make the vblank shorter yes.

No, that's not it.
It has 348 *visible* scanlines in graphics mode. However, there are 2 more invisible scanlines (vertical total (adjust)), so in both text and graphics mode, you have 370 scanlines in total.
I mean the length of a scanline is different.
Namely, in text mode, you have characters of 9 bits wide. The total width is set to 98 characters, so 98*9 = 882 pixels.
In graphics mode, the layout is 'characters' of 16 bits wide (the 6845 can only address in terms of characters in width and height).
You can't match 882 pixels exactly with that. You could use 55 characters, so you'd get 55*16 = 880.
For some reason however, Hercules programs them to 54 characters, so 54*16 = 864 pixels.

The pixel clock is the same in both modes. But in text mode you have 370*882 = 326340 pixels per frame, while in graphics mode you only have 370*864 = 319680 pixels per frame.
So that is a difference of a few percent, enough to measure.

See here the macros I made to reprogram the 6845 registers for both Hercules modes, which I took from example code taken from an original Hercules floppy:

SET_HERC_GRAPHICS	MACRO
; Disable video
mov dx, HERC_MODE_CTRL
mov al, HERC_MC_GFX_MODE
out dx, al

; Graphics mode (HGC)
; Each character is 2 bytes, each byte is 8 pixels
; Each row is 4 scanlines

; Set up 6845 parameters
mov dx, HERC_CRTC_INDEX
mov ax, 3500h ; 35h: Horizontal total: 53 characters ('minus one': 54*2*8 = 864 pixels)
out dx, ax
mov ax, 2d01h ; 2dh: Horizontal displayed: 45 characters (45*2*8 = 720 pixels)
out dx, ax
mov ax, 2e02h ; 2eh: Horizontal sync position: 46 characters (46*2*8 = 736 pixels)
out dx, ax
mov ax, 0703h ; 07h: Horizontal sync width: 7 characters (7*2*8 = 112 pixels)
out dx, ax
mov ax, 5b04h ; 5bh: Vertical total: 91 rows ('minus one': 92*4 = 368 scanlines)
out dx, ax
mov ax, 0205h ; 02h: Vertical total adjust: 2 scanlines (368+2 = 370)
out dx, ax
mov ax, 5706h ; 57h: Vertical displayed: 87 rows (87*4 = 348 scanlines)
out dx, ax
mov ax, 5707h ; 57h: Vertical sync position: 87 rows (87*4 = 348 scanlines)
out dx, ax
mov ax, 0208h ; 02h: Interlace mode: 2
out dx, ax
mov ax, 0309h ; 03h: Maximum scan line address: 3 scanlines ('minus one', set 'character' height to 4, to get 4-way interleaved graphics mode)
out dx, ax
mov ax, 000Ah ; 00h: Cursor start: 0 scanlines
out dx, ax
mov ax, 000Bh ; 00h: Cursor end: 0 scanlines
out dx, ax

; Enable video
mov dx, HERC_MODE_CTRL
mov al, (HERC_MC_GFX_MODE or HERC_MC_VIDEO_ENABLE)
out dx, al
ENDM

SET_HERC_TEXT MACRO
; Disable video
mov dx, HERC_MODE_CTRL
mov al, HERC_MC_BLINK
out dx, al

; Text mode (MDA)
; Each character is 9 pixels
; Each row is 14 scanlines

; Set up 6845 parameters
mov dx, HERC_CRTC_INDEX
mov ax, 6100h ; 61h: Horizontal total: 97 characters ('minus one', 98*9 = 882 pixels)
out dx, ax
mov ax, 5001h ; 50h: Horizontal displayed: 80 characters (80*9 = 720 pixels)
out dx, ax
mov ax, 5202h ; 52h: Horizontal sync position: 82 characters (82*9 = 738 pixels)
Show last 25 lines
	out dx, ax
mov ax, 0f03h ; 0fh: Horizontal sync width: 15 characters (15*9 = 135 pixels)
out dx, ax
mov ax, 1904h ; 19h: Vertical total: 25 rows ('minus one': 26*14 = 364 scanlines)
out dx, ax
mov ax, 0605h ; 06h: Vertical total adjust: 6 scanlines (364+6 = 370)
out dx, ax
mov ax, 1906h ; 19h: Vertical displayed: 25 rows (25*14 = 350 scanlines)
out dx, ax
mov ax, 1907h ; 19h: Vertical sync position: 25 rows (25*14 = 350 scanlines)
out dx, ax
mov ax, 0208h ; 02h: Interlace mode: 2
out dx, ax
mov ax, 0d09h ; 0dh: Maximum scan line address: 13 scanlines ('minus one', set character height to 14)
out dx, ax
mov ax, 0b0Ah ; 0bh: Cursor start: 11 scanlines
out dx, ax
mov ax, 0c0Bh ; 0ch: Cursor end: 12 scanlines
out dx, ax

; Enable video
mov dx, HERC_MODE_CTRL
mov al, (HERC_MC_BLINK or HERC_MC_VIDEO_ENABLE)
out dx, al
ENDM

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 9 of 10, by vladstamate

User metadata
Rank Oldbie
Rank
Oldbie

Thank you Scali, this is very good information.

YouTube channel: https://www.youtube.com/channel/UC7HbC_nq8t1S9l7qGYL0mTA
Collection: http://www.digiloguemuseum.com/index.html
Emulator: https://sites.google.com/site/capex86/
Raytracer: https://sites.google.com/site/opaqueraytracer/

Reply 10 of 10, by Scali

User metadata
Rank l33t
Rank
l33t
vladstamate wrote:

Thank you Scali, this is very good information.

Let me know if there's anything you want me to test/measure on real hardware. I have an original Hercules GB-102 card (the first model) in one of my 8088 machines.
One thing that leaps to mind by the way is that Hercules has 64k of memory, divided into 2 pages of 32k each.
The first 32k is mapped to B000h, like MDA, so it goes all the way up to B800h.
The second 32k is disabled by default, and can be enabled by toggling a bit in one of the control registers on the Hercules. It will map to B800h. The reason why this is disabled by default is because if you have a CGA card installed, it will map its memory there. So it's for backward-compatibility with MDA/CGA dual-monitor.
A lot of Hercules software will enable this second page, because it allows double-buffering.
It will also be used for CGA emulation like SIMCGA (since CGA software will write to B800h anyway).

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/