add reminder that it might be faster for modexDrawChar to point
directly at ROM font char.
the reason for replacing the inline assembly is that the original
code acted without saving/restoring CPU registers that the C compiler
optimization stage assumes holds results from previous C compiler
generated code. corruptiong the optimizer's expectations is the reason
why all code using modex (and assuming things about DS and ES) is the
reason all game code was blowing up. this fix makes things stable again.
y += 8;\r
continue;\r
}\r
y += 8;\r
continue;\r
}\r
- //load the letter 'A'\r
- __asm {\r
- MOV DI, addr\r
- MOV SI, o\r
- MOV ES, s\r
- SUB AH, AH\r
- MOV AL, c ; the letter\r
- MOV CX, w\r
- MUL CX\r
- ADD SI, AX ;the address of charcter\r
- L1: MOV AX, ES:SI\r
- MOV DS:DI, AX\r
- INC SI\r
- INC DI\r
- DEC CX\r
- JNZ L1\r
- }\r
+\r
+ // load the character into romFontsData.l\r
+ // no need for inline assembly!\r
+ // NTS: It might even be faster to just let the modexDrawChar point directly at ROM font than to copy per char! --J.C.\r
+ _fmemcpy(romFontsData.l,MK_FP(s,o)/*ROM font location*/,w/*char size*/);\r
modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr);\r
x_draw += 8; /* track X for edge of screen */\r
addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */\r
modexDrawChar(page, x_draw/*for mode X planar use*/, t, col, bgcol, addrr);\r
x_draw += 8; /* track X for edge of screen */\r
addrr += 2; /* move 8 pixels over (2 x 4 planar pixels per byte) */\r