]> 4ch.mooo.com Git - 16.git/commitdiff
save/restore AX/BX when calling BIOS to get ROM font.
authorJonathan Campbell <jonathan@castus.tv>
Thu, 21 Apr 2016 13:59:46 +0000 (06:59 -0700)
committerJonathan Campbell <jonathan@castus.tv>
Thu, 21 Apr 2016 13:59:46 +0000 (06:59 -0700)
src/lib/16text.c

index 95b307ef972ea4dd817de28b719cae089459360f..81b71d98cc40594656ef25aed90a63cdca353779 100755 (executable)
@@ -31,6 +31,8 @@ static void getRomFontAddr(char fontNum, int index) {
     word fontOff;\r
 \r
     __asm {\r
+               PUSH AX\r
+               PUSH BX\r
                PUSH BP\r
                MOV AX, 0x1130          ;I can haz font info plz?\r
                MOV BH, fontNum         ;  where ur fontNum\r
@@ -40,6 +42,8 @@ static void getRomFontAddr(char fontNum, int index) {
                POP BP                  ;u can haz ur frame back!\r
                MOV fontSeg, AX         ;Storage\r
                MOV fontOff, BX         ;Storage\r
+               POP BX\r
+               POP AX\r
     }\r
     romFonts[index].seg = fontSeg;\r
     romFonts[index].off = fontOff;\r