|
|
| version 1.29, 2004/01/23 06:03:40 | version 1.34, 2004/01/29 09:41:49 |
|---|---|
| Line 6 | Line 6 |
| #include "bios.h" | #include "bios.h" |
| #include "biosmem.h" | #include "biosmem.h" |
| #include "sxsibios.h" | #include "sxsibios.h" |
| #include "sound.h" | |
| #include "fmboard.h" | |
| #include "lio.h" | #include "lio.h" |
| #include "fddfile.h" | #include "fddfile.h" |
| #include "fdd_mtr.h" | #include "fdd_mtr.h" |
| Line 35 static void bios_reinitbyswitch(void) { | Line 33 static void bios_reinitbyswitch(void) { |
| BYTE prxcrt; | BYTE prxcrt; |
| BYTE prxdupd; | BYTE prxdupd; |
| BYTE biosflag; | BYTE biosflag; |
| BYTE ext_mem; | |
| UINT8 boot; | UINT8 boot; |
| #if defined(CPUCORE_IA32) | #if defined(CPUCORE_IA32) |
| Line 50 static void bios_reinitbyswitch(void) { | Line 47 static void bios_reinitbyswitch(void) { |
| SETBIOSMEM16(0x00486, CPU_DX); | SETBIOSMEM16(0x00486, CPU_DX); |
| #endif | #endif |
| if (!(np2cfg.dipsw[2] & 0x80)) { | |
| #if defined(CPUCORE_IA32) | |
| mem[MEMB_SYS_TYPE] = 0x03; // 80386〜 | |
| #else | |
| mem[MEMB_SYS_TYPE] = 0x01; // 80286 | |
| #endif | |
| } | |
| else { | |
| mem[MEMB_SYS_TYPE] = 0x00; // V30 | |
| } | |
| mem[MEMB_BIOS_FLAG0] = 0x01; | mem[MEMB_BIOS_FLAG0] = 0x01; |
| CPU_TYPE = 0; | |
| prxcrt = 0x48; // ver0.74 | prxcrt = 0x48; // ver0.74 |
| if (gdc.display & 2) { | if (gdc.display & 2) { |
| prxcrt |= 0x04; // color16 | prxcrt |= 0x04; // color16 |
| Line 78 static void bios_reinitbyswitch(void) { | Line 85 static void bios_reinitbyswitch(void) { |
| biosflag |= 0x80; | biosflag |= 0x80; |
| } | } |
| biosflag |= mem[0xa3fea] & 7; | biosflag |= mem[0xa3fea] & 7; |
| if (!(np2cfg.dipsw[2] & 0x80)) { | if (np2cfg.dipsw[2] & 0x80) { |
| ext_mem = np2cfg.EXTMEM; // ver0.28 | |
| } | |
| else { | |
| CPU_TYPE = CPUTYPE_V30; | |
| ext_mem = 0; | |
| biosflag |= 0x40; | biosflag |= 0x40; |
| } | } |
| if (extmem_init(ext_mem)) { // ver0.28 | |
| ext_mem = 0; // メモリ確保に失敗 | |
| } | |
| mem[MEMB_BIOS_FLAG1] = biosflag; | mem[MEMB_BIOS_FLAG1] = biosflag; |
| mem[MEMB_EXPMMSZ] = (BYTE)(ext_mem << 3); | mem[MEMB_EXPMMSZ] = (BYTE)(pccore.extmem << 3); |
| mem[MEMB_CRT_RASTER] = 0x0f; | mem[MEMB_CRT_RASTER] = 0x0f; |
| gdc.display &= ~4; | gdc.display &= ~4; |
| Line 99 static void bios_reinitbyswitch(void) { | Line 98 static void bios_reinitbyswitch(void) { |
| } | } |
| gdcs.textdisp |= GDCSCRN_EXT; | gdcs.textdisp |= GDCSCRN_EXT; |
| if (((pccore.model & PCMODELMASK) >= PCMODEL_VX) && (usesound & 0x7e)) { | |
| iocore_out8(0x188, 0x27); | |
| iocore_out8(0x18a, 0x3f); | |
| } | |
| // FDD initialize | // FDD initialize |
| SETBIOSMEM32(MEMD_F2DD_POINTER, 0xfd801ad7); | SETBIOSMEM32(MEMD_F2DD_POINTER, 0xfd801ad7); |
| SETBIOSMEM32(MEMD_F2HD_POINTER, 0xfd801aaf); | SETBIOSMEM32(MEMD_F2HD_POINTER, 0xfd801aaf); |
| boot = mem[MEMB_MSW5] & 0xf0; | boot = mem[MEMB_MSW5] & 0xf0; |
| if (boot != 0x20) { // 1MB | if (boot != 0x20) { // 1MB |
| fddbios_equip(DISKTYPE_2HD, TRUE); | fddbios_equip(3, TRUE); |
| mem[MEMB_BIOS_FLAG0] |= 0x02; | mem[MEMB_BIOS_FLAG0] |= 0x02; |
| } | } |
| else { // 640KB | else { // 640KB |
| fddbios_equip(DISKTYPE_2DD, TRUE); | fddbios_equip(0, TRUE); |
| mem[MEMB_BIOS_FLAG0] &= ~0x02; | mem[MEMB_BIOS_FLAG0] &= ~0x02; |
| } | } |
| mem[MEMB_F2DD_MODE] = 0xff; | mem[MEMB_F2DD_MODE] = 0xff; |
| // IDE initialize | // IDE initialize |
| if (pccore.hddif & PCHDD_IDE) { | if (pccore.hddif & PCHDD_IDE) { |
| mem[MEMB_SYS_TYPE] |= 0x80; // IDE | |
| CPU_AX = 0x8300; | CPU_AX = 0x8300; |
| sasibios_operate(); | sasibios_operate(); |
| } | } |
| Line 257 void bios_init(void) { | Line 252 void bios_init(void) { |
| file_close(fh); | file_close(fh); |
| TRACEOUT(("load itf.rom")); | TRACEOUT(("load itf.rom")); |
| } | } |
| extmem_init(np2cfg.EXTMEM); | |
| #endif | #endif |
| CopyMemory(mem + 0x1c0000, mem + ITF_ADRS, 0x08000); | CopyMemory(mem + 0x1c0000, mem + ITF_ADRS, 0x08000); |
| Line 407 UINT MEMCALL biosfunc(UINT32 adrs) { | Line 401 UINT MEMCALL biosfunc(UINT32 adrs) { |
| bios_reinitbyswitch(); | bios_reinitbyswitch(); |
| bios_vectorset(); | bios_vectorset(); |
| bios_screeninit(); | bios_screeninit(); |
| if (((pccore.model & PCMODELMASK) >= PCMODEL_VX) && | |
| (pccore.sound & 0x7e)) { | |
| iocore_out8(0x188, 0x27); | |
| iocore_out8(0x18a, 0x3f); | |
| } | |
| #if 1 // ver0.73 | #if 1 // ver0.73 |
| CPU_CS = 0xfd80; // SASI/SCSIリセット | CPU_CS = 0xfd80; // SASI/SCSIリセット |
| CPU_IP = 0x2400; | CPU_IP = 0x2400; |