Hi, sorry for the assembler but I would really appreciate it if someone has
the opcodes (or a lovely example) for using the FS / GS registers in Borland
Pascal assembler.
The high-colour mode of my graphics unit allows 256 colour virtual palettes.
For speed, the actual high-colour (normally 5bit, 6bit, 5bit) values are
precalculated when the colour is set. The problem comes when implementing a
+ACI-putimage+ACI- command, because I need to use three selectors. ES holds the
screen memory, DS holds the +ACI-image+ACI- information (corresponding to the
virtual palette index), but I also need to hold the selector of the virtual
palette lookup table. So at the moment, by core loop for each pixel consists
of:
(+ACo-Get the index value in bx+ACo-)
push ds +AHs-Preserve the image selector+AH0-
mov ds,DataSeg +AHs-Get the VPal selector+AH0-
mov ax,WORD PTR VirtualTrue+AFs-bx+AF0- +AHs-copy the highcolour into ax+AH0-
mov es:+AFs-di+AF0-,ax +AHs-move it to the screen+AH0-
pop ds +AHs-reload the image selector+AH0-
This works okay, but the problem is loading ds all the time is very slow. As
you may be able to visualise, utilising fs or gs to store the virtual
palette selector in would speed things up incredibly. But BP's assembler
won't let me use them. If someone could give me the opcodes or an example it
would be much appreciated.
(I have thought of using an external +ACo-.OBJ file, but I can't get procedures
with parameters working correctly. If anyone could give me an example that
works with NASM I would also be very happy)
--
Lors, Paradice Software
Christchurch, New Zealand
paradice+AEA-thevortex.com
http://surf.to/paradice
--