X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Flib%2Fmodex16.c;h=2d4c00242676ffd4401578c3fb6f024599199c21;hb=e3b220f5349f8282bd426fdca00c64c8c7e831cd;hp=a32bd964393616e9d0e793f73e871bdef95979af;hpb=c60a37b1fcd07f11b76d699e20c5d203e6636bd0;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index a32bd964..2d4c0024 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -92,6 +92,9 @@ void modexEnter(sword vq, boolean cmem, global_game_variables_t *gv) { case 1: //CRTParmCount = sizeof(ModeX_320x240regs) / sizeof(ModeX_320x240regs[0]); + /*for(i=0; ivideo.page[0].sw = vga_state.vga_width = 320; // VGA lib currently does not update this gv->video.page[0].sh = vga_state.vga_height = 240; // VGA lib currently does not update this @@ -291,21 +294,18 @@ modexShowPage(page_t *page) { outp(AC_INDEX, (page->dx & 0x03) << 1); } - void modexPanPage(page_t *page, int dx, int dy) { page->dx = dx; page->dy = dy; } - void modexSelectPlane(byte plane) { outp(SC_INDEX, MAP_MASK); /* select plane */ outp(SC_DATA, plane); } - void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { word pageOff = (word) page->data; @@ -324,6 +324,14 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { } __asm { + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI MOV AX, SCREEN_SEG ; go to the VGA memory MOV ES, AX MOV DI, poffset ; go to the first pixel @@ -357,6 +365,14 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { ADD DI, nextRow ; go to the next row DEC h JNZ SCAN_START + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF } } @@ -383,6 +399,15 @@ modexCopyPageRegion(page_t *dest, page_t *src, byte right = rclip[(sx+width)&0x03]; __asm { + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + MOV AX, SCREEN_SEG ; work in the vga space MOV ES, AX ; MOV DI, doffset ; @@ -431,6 +456,15 @@ modexCopyPageRegion(page_t *dest, page_t *src, MOV DX, GC_INDEX+1 ; go back to CPU data MOV AL, 0ffh ; none from latches OUT DX, AL ; + + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF } } @@ -992,6 +1026,15 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c } //load the letter 'A' __asm { + PUSHF + PUSH ES + PUSH AX + PUSH BX + PUSH CX + PUSH DX + PUSH SI + PUSH DI + MOV DI, addr MOV SI, o MOV ES, s @@ -1006,6 +1049,15 @@ void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, c INC DI DEC CX JNZ L1 + + POP DI + POP SI + POP DX + POP CX + POP BX + POP AX + POP ES + POPF } for(i=0; i