--- np2/bios/bios18.c 2004/03/07 23:04:50 1.32 +++ np2/bios/bios18.c 2004/06/02 11:02:53 1.36 @@ -8,8 +8,6 @@ #include "font.h" -static int sti_waiting = 0; - typedef struct { BYTE GBON_PTN; BYTE GBBCC; @@ -41,10 +39,10 @@ typedef struct { static const UINT8 modenum[4] = {3, 1, 0, 2}; static const CRTDATA crtdata[7] = { - {0x07, 0x00, 0x07, 0x08}, // 200-20 - {0x09, 0x1f, 0x08, 0x08}, // 200-25 - {0x0f, 0x00, 0x0f, 0x10}, // 400-20 - {0x13, 0x1e, 0x11, 0x10}, // 400-25 + {0x09, 0x1f, 0x08, 0x08}, // 200-20 + {0x07, 0x00, 0x07, 0x08}, // 200-25 + {0x13, 0x1e, 0x11, 0x10}, // 400-20 + {0x0f, 0x00, 0x0f, 0x10}, // 400-25 {0x17, 0x1c, 0x13, 0x10}, // 480-20 {0x12, 0x1f, 0x11, 0x10}, // 480-25 {0x0f, 0x00, 0x0f, 0x10}}; // 480-30 @@ -114,8 +112,8 @@ const CRTDATA *crt; gdc.mode1 |= 0x08; crt += 2; } - if (mode & 0x01) { - crt += 1; // 20行 + if (!(mode & 0x01)) { + crt += 1; // 25行 } if (mode & 0x02) { gdc.mode1 |= 0x04; // 40桁 @@ -135,6 +133,14 @@ const CRTDATA *crt; bios0x18_10(0); } +void bios0x18_0c(void) { + + if (!(gdcs.textdisp & GDCSCRN_ENABLE)) { + gdcs.textdisp |= GDCSCRN_ENABLE; + screenupdate |= 2; + } +} + static void bios0x18_0f(UINT seg, UINT off, REG8 num, REG8 cnt) { BYTE *p; @@ -468,7 +474,7 @@ void bios0x18_42(REG8 mode) { scrn = bios0x18_31bh(); if ((mem[MEMB_CRT_BIOS] & 0x80) && (((scrn & 0x30) == 0x30) || (crtmode == 3))) { - bios0x18_30(rate, (crtmode << 4) + 1); + bios0x18_30(rate, (REG8)((crtmode << 4) + 1)); } else { #endif @@ -620,7 +626,8 @@ static void bios0x18_47(void) { vect.ope = 0x20 + (ucw.GBDSP & 7); vect.DC[0] = ucw.GBLNG1[0]; vect.DC[1] = ucw.GBLNG1[1]; - data = LOADINTELWORD(ucw.GBLNG2) - 1; +// data = LOADINTELWORD(ucw.GBLNG2) - 1; + data = LOADINTELWORD(ucw.GBCIR) - 1; STOREINTELWORD(vect.D, data); data >>= 1; STOREINTELWORD(vect.D2, data); @@ -760,17 +767,6 @@ void bios0x18(void) { MEML_READ16(CPU_SS, CPU_SP))); #endif - sti_waiting ^= 1; - if (sti_waiting) { // 割込み許可の遊び - CPU_STI; - if (PICEXISTINTR) { - CPU_IP--; - nevent_forceexit(); - return; - } - } - sti_waiting = 0; - switch(CPU_AH) { case 0x00: // キー・データの読みだし if (mem[MEMB_KB_COUNT]) { @@ -825,10 +821,7 @@ void bios0x18(void) { break; case 0x0c: // テキスト画面の表示開始 - if (!(gdcs.textdisp & GDCSCRN_ENABLE)) { - gdcs.textdisp |= GDCSCRN_ENABLE; - screenupdate |= 2; - } + bios0x18_0c(); break; case 0x0d: // テキスト画面の表示終了 @@ -940,12 +933,10 @@ void bios0x18(void) { if (tmp.r8 == 0x05) { CPU_AL = 0; CPU_BH = 0; - TRACEOUT(("success")); } else { CPU_AL = 1; CPU_BH = 1; - TRACEOUT(("failure")); } } break;