|
|
| version 1.28, 2004/01/22 01:10:03 | version 1.32, 2004/01/25 05:41:28 |
|---|---|
| Line 9 | Line 9 |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "cbuscore.h" | #include "cbuscore.h" |
| #include "sasiio.h" | |
| #include "scsiio.h" | |
| #include "pc9861k.h" | #include "pc9861k.h" |
| #include "mpu98ii.h" | #include "mpu98ii.h" |
| #include "board14.h" | #include "board14.h" |
| Line 24 | Line 26 |
| #include "fddfile.h" | #include "fddfile.h" |
| #include "fdd_mtr.h" | #include "fdd_mtr.h" |
| #include "sxsi.h" | #include "sxsi.h" |
| #include "calendar.h" | |
| #include "keydisp.h" | #include "keydisp.h" |
| #include "sasiio.h" | |
| #include "scsiio.h" | |
| #include "hostdrv.h" | #include "hostdrv.h" |
| #include "calendar.h" | |
| #if defined(MACOS) | #if defined(MACOS) |
| #define CRCONST str_cr | #define CRCONST str_cr |
| Line 588 static int flagload_mem(STFLAGH sfh, con | Line 587 static int flagload_mem(STFLAGH sfh, con |
| } | } |
| // ---- ext memory | |
| static int flagsave_ext(STFLAGH sfh, const SFENTRY *tbl) { | |
| int ret; | |
| ret = statflag_write(sfh, &extmem, sizeof(extmem)); | |
| if (CPU_EXTMEM) { | |
| ret = statflag_write(sfh, CPU_EXTMEM, CPU_EXTMEMSIZE); | |
| } | |
| (void)tbl; | |
| return(ret); | |
| } | |
| static int flagload_ext(STFLAGH sfh, const SFENTRY *tbl) { | |
| int ret; | |
| int i; | |
| UINT pagemax = 0; | |
| ret = statflag_read(sfh, &extmem, sizeof(extmem)); | |
| if (extmem.maxmem) { | |
| if (extmem.maxmem > (13+1)) { | |
| extmem.maxmem = (13+1); | |
| } | |
| if (!extmemmng_realloc(extmem.maxmem - 1)) { | |
| pagemax = (extmem.maxmem - 1) << 8; | |
| if (CPU_EXTMEM) { | |
| ret |= statflag_read(sfh, CPU_EXTMEM, CPU_EXTMEMSIZE); | |
| } | |
| } | |
| else { | |
| extmem.maxmem = 0; | |
| } | |
| } | |
| for (i=0; i<4; i++) { | |
| if (extmem.page[i] < pagemax) { | |
| extmem.pageptr[i] = CPU_EXTMEM + (extmem.page[i] << 12); | |
| } | |
| else { | |
| extmem.pageptr[i] = mem + 0xc0000 + (i << 14); | |
| } | |
| } | |
| (void)tbl; | |
| return(ret); | |
| } | |
| // ---- cg window | // ---- cg window |
| #if defined(CGWND_FONTPTR) | #if defined(CGWND_FONTPTR) |
| Line 665 static int flagload_cgwnd(STFLAGH sfh, c | Line 616 static int flagload_cgwnd(STFLAGH sfh, c |
| // ---- dma | // ---- dma |
| static int flagsave_dma(STFLAGH sfh, const SFENTRY *t) { | static int flagsave_dma(STFLAGH sfh, const SFENTRY *tbl) { |
| int i; | int i; |
| _DMAC dmabak; | _DMAC dmabak; |
| Line 678 static int flagsave_dma(STFLAGH sfh, con | Line 629 static int flagsave_dma(STFLAGH sfh, con |
| return(STATFLAG_FAILURE); | return(STATFLAG_FAILURE); |
| } | } |
| } | } |
| (void)tbl; | |
| return(statflag_write(sfh, &dmabak, sizeof(dmabak))); | return(statflag_write(sfh, &dmabak, sizeof(dmabak))); |
| } | } |
| Line 870 static int flagload_evt(STFLAGH sfh, con | Line 822 static int flagload_evt(STFLAGH sfh, con |
| } | } |
| // ---- extmem | |
| static int flagsave_ext(STFLAGH sfh, const SFENTRY *tbl) { | |
| int ret; | |
| ret = STATFLAG_SUCCESS; | |
| if (CPU_EXTMEM) { | |
| ret = statflag_write(sfh, CPU_EXTMEM, CPU_EXTMEMSIZE); | |
| } | |
| (void)tbl; | |
| return(ret); | |
| } | |
| static int flagload_ext(STFLAGH sfh, const SFENTRY *tbl) { | |
| int ret; | |
| ret = STATFLAG_SUCCESS; | |
| if (CPU_EXTMEM) { | |
| ret = statflag_read(sfh, CPU_EXTMEM, CPU_EXTMEMSIZE); | |
| } | |
| (void)tbl; | |
| return(ret); | |
| } | |
| // ---- gaiji | // ---- gaiji |
| static int flagsave_gij(STFLAGH sfh, const SFENTRY *tbl) { | static int flagsave_gij(STFLAGH sfh, const SFENTRY *tbl) { |
| Line 1019 static int flagsave_fm(STFLAGH sfh, cons | Line 998 static int flagsave_fm(STFLAGH sfh, cons |
| if (saveflg & FLAG_CS4231) { | if (saveflg & FLAG_CS4231) { |
| ret |= statflag_write(sfh, &cs4231, sizeof(cs4231)); | ret |= statflag_write(sfh, &cs4231, sizeof(cs4231)); |
| } | } |
| (void)tbl; | |
| return(ret); | return(ret); |
| } | } |
| Line 1068 static int flagload_fm(STFLAGH sfh, cons | Line 1048 static int flagload_fm(STFLAGH sfh, cons |
| cs4231_reset(); | cs4231_reset(); |
| ret = statflag_read(sfh, &usesound, sizeof(usesound)); | ret = statflag_read(sfh, &usesound, sizeof(usesound)); |
| fmboard_reset((BYTE)usesound); | fmboard_reset(usesound); |
| fmreg1a = 0x000; | fmreg1a = 0x000; |
| fmreg1b = 0x100; | fmreg1b = 0x100; |
| Line 1573 const SFENTRY *tblterm; | Line 1553 const SFENTRY *tblterm; |
| case STATFLAG_EGC: | case STATFLAG_EGC: |
| case STATFLAG_EPSON: | case STATFLAG_EPSON: |
| case STATFLAG_EVT: | case STATFLAG_EVT: |
| case STATFLAG_EXT: | |
| case STATFLAG_GIJ: | case STATFLAG_GIJ: |
| case STATFLAG_FM: | case STATFLAG_FM: |
| #if defined(SUPPORT_HOSTDRV) | #if defined(SUPPORT_HOSTDRV) |
| Line 1612 const SFENTRY *tblterm; | Line 1591 const SFENTRY *tblterm; |
| return(STATFLAG_FAILURE); | return(STATFLAG_FAILURE); |
| } | } |
| // PCCORE read! | |
| ret = statflag_readsection(sffh); | |
| if ((ret != STATFLAG_SUCCESS) || | |
| (memcmp(sffh->sfh.hdr.index, np2tbl[0].index, 10))) { | |
| statflag_close(sffh); | |
| return(STATFLAG_FAILURE); | |
| } | |
| soundmng_stop(); | soundmng_stop(); |
| rs232c_midipanic(); | rs232c_midipanic(); |
| mpu98ii_midipanic(); | mpu98ii_midipanic(); |
| pc9861k_midipanic(); | pc9861k_midipanic(); |
| ret |= flagload_common(&sffh->sfh, np2tbl); | |
| nevent_init(); | |
| CPU_RESET(); | |
| CPU_SETEXTSIZE((UINT32)pccore.extmem); | |
| sound_changeclock(); | |
| beep_changeclock(); | |
| sound_reset(); | sound_reset(); |
| #if defined(SUPPORT_WAVEMIX) | #if defined(SUPPORT_WAVEMIX) |
| wavemix_bind(); | wavemix_bind(); |
| #endif | #endif |
| fmboard_reset(0); | |
| iocore_reset(); // サウンドでpicを呼ぶので… | |
| cbuscore_reset(); | |
| fmboard_reset(pccore.sound); | |
| done = FALSE; | done = FALSE; |
| ret = STATFLAG_SUCCESS; | |
| while((!done) && (ret != STATFLAG_FAILURE)) { | while((!done) && (ret != STATFLAG_FAILURE)) { |
| ret |= statflag_readsection(sffh); | ret |= statflag_readsection(sffh); |
| tbl = np2tbl; | tbl = np2tbl + 1; |
| tblterm = tbl + (sizeof(np2tbl)/sizeof(SFENTRY)); | tblterm = np2tbl + (sizeof(np2tbl)/sizeof(SFENTRY)); |
| while(tbl < tblterm) { | while(tbl < tblterm) { |
| if (!memcmp(sffh->sfh.hdr.index, tbl->index, 10)) { | if (!memcmp(sffh->sfh.hdr.index, tbl->index, 10)) { |
| break; | break; |