A few years ago I wrote a simple 3D engine from first principles in 80486 assembler (having been inspired by the game 'Underworld'). It ran under DOS, and built up an image in 1024*768 pixel mode (256 colour). In order to get acceptable speed it output direct to the SVGA graphics card ports, using bank switching to output 64Kb at a time (under DOS the VGA graphics buffer is only 64Kb, so to output a 768Kb image you have to build it in expanded memory, then map the expanded memory to the VGA graphics buffer 64Kb at a time, and output this to successive 64Kb banks of memory on the graphics card). See the bottom of this post for a code sample.
Unfortunately, since all SVGA graphics cards use different ports, etc, I only got it working with 2 types - Cirrus Logic and Video 7/HT. The instructions to do so (i.e. to enable bank switching and then switch banks in order to output a 768Kb image) are detailed in Richard F Ferraro's book 'Programmer's Guide to the ... SVGA cards'.
Now I have a son who I'd like to show this program to. But the old PCs using those old SVGA graphics cards are long gone. My PC (itself an ageing Gateway) uses an STB Velocity 4400 graphics card, based on the Riva TNT chipset. I have tried EVERYTHING to obtain the instructions to get bank switching working with this graphics card, even down to trying to write a Windows-based disassembler to disassemble the driver to get the instructions!!!!!
However, I am defeated. The suppliers are no use. I cannot do it. Does anyone out there know the answers to ANY of the following questions:
1. How can I get hold of the instructions to output a 768Kb image from 48 pages of expanded memory (48 * 16Kb = 768Kb) to an STB Velocity 4400?
i.e. how do I enable bank switching, and how do I switch banks?
2. Is there an easier way than bank switching? DMA?
3. Am I just a sad old programmer who should convert his grotty little program to C#, use the 3D libraries like everyone else, and get a life?
Really, I'd like question 1 answered most. Thank you for reading this far.
PS. As an example of what I'm after, the following instructions work fine with the Cirrus Logic family of graphics cards:
To enable bank switching...
;For Cirrus Logic enable single bank switching by clearing bit 0 of the
;graphics controller mode extension register (GC index 0Bh).
mov al,0Bh ;Point GC data port at register 0Bh
mov dx,3CEh ;GC address port
inc dx ;GC data port
in al,dx ;Read mode extension register
and al,0FEh ;Apply mask to set reg 0Bh=0
out dx,al ;Write back mode extension register
...and to switch banks...
mov es,ax ;es = dest. segment = video mem.
;Set graphics card up to receive required bank number.
mov al,9 ;Point GC data port at Offset reg 0
mov dx,3CEh ;GC address port
mov ax,0 ;Start with SVGA bank 0
mov dx,0 ;Start with EMM bank 0
d10: mov si,0 ;ds:si = start of page-frame segment
mov di,0 ;es:di = A000:0000
;Map in required 64k bank of graphics card memory.
mov dx,3CFh ;Cirrus Logic GC data port
call mpembnk ;Map in required EMM bank
pop ds ;ds = source seg = EMM page frame
push ds ;Push back on the stack (es)
mov cx,16384 ;16384*4=64Kb
rep movsd ;Move from ds:si to es:di
mov ds,bx ;Restore ds for 'mpembnk'
inc dl ;Next EMM bank
cmp dl,12 ;Check whether we've finished
add al,16 ;Next SVGA bank*16 (64K granularity)
...er, that's it.
Anyone know the equivalent for the STB Velocity 4400???????????