--- np2/bios/bios.c 2004/03/22 05:38:47 1.61 +++ np2/bios/bios.c 2004/06/18 07:42:13 1.68 @@ -20,8 +20,6 @@ #define BIOS_SIMULATE - BOOL biosrom = FALSE; - static const char neccheck[] = "Copyright (C) 1983 by NEC Corporation"; typedef struct { @@ -149,6 +147,7 @@ static void bios_reinitbyswitch(void) { fddbios_equip(0, TRUE); mem[MEMB_BIOS_FLAG0] &= ~0x02; } + mem[MEMB_F2HD_MODE] = 0xff; mem[MEMB_F2DD_MODE] = 0xff; #if defined(SUPPORT_CRT31KHZ) @@ -195,6 +194,7 @@ static void bios_screeninit(void) { void bios_initialize(void) { + BOOL biosrom; char path[MAX_PATH]; FILEH fh; UINT i; @@ -210,6 +210,7 @@ void bios_initialize(void) { } if (biosrom) { TRACEOUT(("load bios.rom")); + pccore.rom |= PCROM_BIOS; // PnP BIOSを潰す for (i=0; i<0x10000; i+=0x10) { tmp = LOADINTELDWORD(mem + 0xf0000 + i); @@ -262,7 +263,7 @@ void bios_initialize(void) { CopyMemory(mem + 0xf538e, itfrom + pos, 0x27); } - CopyMemory(mem + 0x0fde00, keytable[0], 0x300); + CopyMemory(mem + 0x0fd800 + 0x0e00, keytable[0], 0x300); CopyMemory(mem + ITF_ADRS, itfrom, sizeof(itfrom)); mem[ITF_ADRS + 0x7ff0] = 0xea; @@ -300,7 +301,7 @@ static void bios_itfcall(void) { if (!np2cfg.ITF_WORK) { for (i=0; i<8; i++) { - mem[MEMB_MSW + (i*4)] = msw_default[i]; + mem[MEMX_MSW + (i*4)] = msw_default[i]; } CPU_FLAGL |= C_FLAG; } @@ -350,6 +351,13 @@ UINT MEMCALL biosfunc(UINT32 adrs) { return(1); case BIOS_BASE + BIOSOFST_INIT: // ブート +#if 1 // for RanceII + bios_memclear(); +#endif + bios_vectorset(); +#if 1 + bios0x09_init(); +#endif bios_reinitbyswitch(); bios_vectorset(); bios_screeninit(); @@ -361,7 +369,7 @@ UINT MEMCALL biosfunc(UINT32 adrs) { return(1); case BIOS_BASE + BIOSOFST_09: - CPU_REMCLOCK -= 300; + CPU_REMCLOCK -= 500; bios0x09(); return(1); @@ -393,7 +401,7 @@ UINT MEMCALL biosfunc(UINT32 adrs) { case BIOS_BASE + BIOSOFST_CMT: CPU_REMCLOCK -= 200; bios0x1a_cmt(); - return(1); + return(0); // return(1); case BIOS_BASE + BIOSOFST_PRT: CPU_REMCLOCK -= 200; @@ -418,25 +426,29 @@ UINT MEMCALL biosfunc(UINT32 adrs) { case BIOS_BASE + BIOSOFST_WAIT: CPU_STI; +#if 1 + return(bios0x1b_wait()); // ver0.78 +#else if (fddmtr.busy) { CPU_IP--; CPU_REMCLOCK = -1; } else { if (fdc.chgreg & 1) { - if (!(mem[0x0055e] & (0x01 << fdc.us))) { + if (!(mem[MEMB_DISK_INTL] & (0x01 << fdc.us))) { CPU_IP--; CPU_REMCLOCK -= 1000; } } else { - if (!(mem[0x0055f] & (0x10 << fdc.us))) { + if (!(mem[MEMB_DISK_INTH] & (0x10 << fdc.us))) { CPU_IP--; CPU_REMCLOCK -= 1000; } } } return(1); +#endif case 0xfffe8: // ブートストラップロード CPU_REMCLOCK -= 2000; @@ -455,19 +467,16 @@ UINT MEMCALL biosfunc(UINT32 adrs) { return(0); } - if ((adrs >= 0xf9a00) && (adrs < 0x0f9a44)) { - if (!(adrs & 3)) { - CPU_REMCLOCK -= 500; - bios_lio((REG8)((adrs - 0xf9a00) >> 2)); - } - else { - if (nevent_iswork(NEVENT_GDCSLAVE)) { - CPU_IP--; - CPU_REMCLOCK = -1; - return(1); - } + if ((adrs >= 0xf9950) && (adrs <= 0x0f9990) && (!(adrs & 3))) { + CPU_REMCLOCK -= 500; + bios_lio((REG8)((adrs - 0xf9950) >> 2)); + } + else if (adrs == 0xf9994) { + if (nevent_iswork(NEVENT_GDCSLAVE)) { + CPU_IP--; + CPU_REMCLOCK = -1; + return(1); } - return(0); } return(0); }