• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revision8f4ac58afa1c1f07a811b42246c8917db3dcb7df (tree)
Time2018-07-06 21:46:55
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM][PC2001][PCENGINE] Apply new state framework to VMs.

Change Summary

Incremental Difference

--- a/source/src/vm/pc2001/io.cpp
+++ b/source/src/vm/pc2001/io.cpp
@@ -275,33 +275,59 @@ bool IO::key_hit(int code)
275275
276276 #define STATE_VERSION 2
277277
278+#include "../../statesub.h"
279+
280+void IO::decl_state()
281+{
282+ enter_decl_state(STATE_VERSION);
283+
284+ DECL_STATE_ENTRY_UINT8(port_a);
285+ DECL_STATE_ENTRY_UINT8(port_b);
286+ DECL_STATE_ENTRY_UINT8(port_s);
287+ DECL_STATE_ENTRY_BOOL(drec_in);
288+ DECL_STATE_ENTRY_BOOL(rtc_in);
289+ DECL_STATE_ENTRY_UINT16(key_strobe);
290+
291+ leave_decl_state();
292+}
293+
278294 void IO::save_state(FILEIO* state_fio)
279295 {
280- state_fio->FputUint32(STATE_VERSION);
281- state_fio->FputInt32(this_device_id);
296+ if(state_entry != NULL) {
297+ state_entry->save_state(state_fio);
298+ }
299+// state_fio->FputUint32(STATE_VERSION);
300+// state_fio->FputInt32(this_device_id);
282301
283- state_fio->FputUint8(port_a);
284- state_fio->FputUint8(port_b);
285- state_fio->FputUint8(port_s);
286- state_fio->FputBool(drec_in);
287- state_fio->FputBool(rtc_in);
288- state_fio->FputUint16(key_strobe);
302+// state_fio->FputUint8(port_a);
303+// state_fio->FputUint8(port_b);
304+// state_fio->FputUint8(port_s);
305+// state_fio->FputBool(drec_in);
306+// state_fio->FputBool(rtc_in);
307+// state_fio->FputUint16(key_strobe);
289308 }
290309
291310 bool IO::load_state(FILEIO* state_fio)
292311 {
293- if(state_fio->FgetUint32() != STATE_VERSION) {
294- return false;
312+ bool mb = false;
313+ if(state_entry != NULL) {
314+ mb = state_entry->load_state(state_fio);
295315 }
296- if(state_fio->FgetInt32() != this_device_id) {
316+ if(!mb) {
297317 return false;
298318 }
299- port_a = state_fio->FgetUint8();
300- port_b = state_fio->FgetUint8();
301- port_s = state_fio->FgetUint8();
302- drec_in = state_fio->FgetBool();
303- rtc_in = state_fio->FgetBool();
304- key_strobe = state_fio->FgetUint16();
319+// if(state_fio->FgetUint32() != STATE_VERSION) {
320+// return false;
321+// }
322+// if(state_fio->FgetInt32() != this_device_id) {
323+// return false;
324+// }
325+// port_a = state_fio->FgetUint8();
326+// port_b = state_fio->FgetUint8();
327+// port_s = state_fio->FgetUint8();
328+// drec_in = state_fio->FgetBool();
329+// rtc_in = state_fio->FgetBool();
330+// key_strobe = state_fio->FgetUint16();
305331 return true;
306332 }
307333
--- a/source/src/vm/pc2001/io.h
+++ b/source/src/vm/pc2001/io.h
@@ -52,6 +52,7 @@ public:
5252 void write_io16(uint32_t addr, uint32_t data);
5353 void write_signal(int id, uint32_t data, uint32_t mask);
5454 void event_callback(int event_id, int err);
55+ void decl_state();
5556 void save_state(FILEIO* state_fio);
5657 bool load_state(FILEIO* state_fio);
5758
--- a/source/src/vm/pcengine/pce.cpp
+++ b/source/src/vm/pcengine/pce.cpp
@@ -2447,130 +2447,254 @@ void PCE::event_callback(int event_id, int err)
24472447 }
24482448 #endif
24492449
2450-#define STATE_VERSION 4
2450+#define STATE_VERSION 5
24512451
2452+#include "../../statesub.h"
2453+
2454+void PCE::decl_state()
2455+{
2456+ enter_decl_state(STATE_VERSION);
2457+
2458+ DECL_STATE_ENTRY_BOOL(support_6btn_pad);
2459+ DECL_STATE_ENTRY_BOOL(support_multi_tap);
2460+#ifdef SUPPORT_SUPER_GFX
2461+ DECL_STATE_ENTRY_BOOL(support_sgfx);
2462+#endif
2463+#ifdef SUPPORT_CDROM
2464+ DECL_STATE_ENTRY_BOOL(support_cdrom);
2465+#endif
2466+ DECL_STATE_ENTRY_1D_ARRAY(ram, sizeof(ram));
2467+// DECL_STATE_ENTRY_1D_ARRAY(cart + 0x80000, 0x80000);
2468+ DECL_STATE_ENTRY_1D_ARRAY(cart, sizeof(cart)); // Does correct this?
2469+#ifdef SUPPORT_BACKUP_RAM
2470+ DECL_STATE_ENTRY_1D_ARRAY(backup, sizeof(backup));
2471+ DECL_STATE_ENTRY_UINT32(backup_crc32);
2472+#endif
2473+ DECL_STATE_ENTRY_UINT32(bank);
2474+ DECL_STATE_ENTRY_UINT8(buffer);
2475+ DECL_STATE_ENTRY_INT32(prev_width);
2476+ DECL_STATE_ENTRY_BOOL(inserted);
2477+ // vdc
2478+ for(int i = 0; i < 2; i++) {
2479+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].dvssr_write), i); /* Set when the DVSSR register has been written to */
2480+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].physical_width), i); /* Width of the display */
2481+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].physical_height), i); /* Height of the display */
2482+ DECL_STATE_ENTRY_1D_ARRAY_MEMBER((vdc[i].sprite_ram), 64*4, i); /* Sprite RAM */
2483+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].curline), i); /* the current scanline we're on */
2484+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].current_segment), i); /* current segment of display */
2485+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].current_segment_line), i); /* current line inside a segment of display */
2486+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].vblank_triggered), i); /* to indicate whether vblank has been triggered */
2487+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].raster_count), i); /* counter to compare RCR against */
2488+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].satb_countdown), i); /* scanlines to wait to trigger the SATB irq */
2489+ DECL_STATE_ENTRY_1D_ARRAY_MEMBER((vdc[i].vram), 0x10000, i);
2490+ DECL_STATE_ENTRY_UINT8_MEMBER((vdc[i].inc), i);
2491+ DECL_STATE_ENTRY_UINT8_MEMBER((vdc[i].vdc_register), i);
2492+ DECL_STATE_ENTRY_UINT8_MEMBER((vdc[i].vdc_latch), i);
2493+ DECL_STATE_ENTRY_PAIR_ARRAY((vdc[i].vdc_data), 32);
2494+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].status), i);
2495+ DECL_STATE_ENTRY_INT32_MEMBER((vdc[i].y_scroll), i);
2496+ }
2497+ // vce
2498+ {
2499+ DECL_STATE_ENTRY_UINT8((vce.vce_control)); /* VCE control register */
2500+ DECL_STATE_ENTRY_PAIR((vce.vce_address)); /* Current address in the palette */
2501+ DECL_STATE_ENTRY_PAIR_ARRAY((vce.vce_data), 512); /* Palette data */
2502+ DECL_STATE_ENTRY_INT32((vce.current_bitmap_line)); /* The current line in the display we are on */
2503+ //bitmap_ind16 *bmp;
2504+ DECL_STATE_ENTRY_SCRNTYPE_T_2D_ARRAY((vce.bmp), VDC_LPF, VDC_WPF);
2505+ DECL_STATE_ENTRY_SCRNTYPE_T_1D_ARRAY((vce.palette), 1024);
2506+ }
2507+ // vpc
2508+ {
2509+ for(int i = 0; i < 4; i++) {
2510+ DECL_STATE_ENTRY_UINT8_MEMBER((vpc.vpc_prio[i].prio), i);
2511+ DECL_STATE_ENTRY_UINT8_MEMBER((vpc.vpc_prio[i].vdc0_enabled), i);
2512+ DECL_STATE_ENTRY_UINT8_MEMBER((vpc.vpc_prio[i].vdc1_enabled), i);
2513+ }
2514+ DECL_STATE_ENTRY_1D_ARRAY((vpc.prio_map), 512);
2515+ DECL_STATE_ENTRY_PAIR((vpc.priority));
2516+ DECL_STATE_ENTRY_PAIR((vpc.window1));
2517+ DECL_STATE_ENTRY_PAIR((vpc.window2));
2518+ DECL_STATE_ENTRY_UINT8((vpc.vdc_select));
2519+ }
2520+ // psg
2521+ {
2522+ for(int i = 0; i < 8; i++ ){
2523+ DECL_STATE_ENTRY_1D_ARRAY_MEMBER((psg[i].regs), 8, i);
2524+ DECL_STATE_ENTRY_1D_ARRAY_MEMBER((psg[i].wav), 32, i);
2525+ DECL_STATE_ENTRY_UINT8_MEMBER((psg[i].wavptr), i);
2526+ DECL_STATE_ENTRY_UINT32_MEMBER((psg[i].genptr), i);
2527+ DECL_STATE_ENTRY_UINT32_MEMBER((psg[i].remain), i);
2528+ DECL_STATE_ENTRY_BOOL_MEMBER((psg[i].noise), i);
2529+ DECL_STATE_ENTRY_UINT32_MEMBER((psg[i].randval), i);
2530+ }
2531+ }
2532+ DECL_STATE_ENTRY_UINT8(psg_ch);
2533+ DECL_STATE_ENTRY_UINT8(psg_vol);
2534+ DECL_STATE_ENTRY_UINT8(psg_lfo_freq);
2535+ DECL_STATE_ENTRY_UINT8(psg_lfo_ctrl);
2536+ DECL_STATE_ENTRY_UINT8(joy_counter);
2537+ DECL_STATE_ENTRY_BOOL(joy_high_nibble);
2538+ DECL_STATE_ENTRY_BOOL(joy_second_byte);
2539+#ifdef SUPPORT_CDROM
2540+ DECL_STATE_ENTRY_1D_ARRAY(cdrom_ram, sizeof(cdrom_ram));
2541+ DECL_STATE_ENTRY_1D_ARRAY(cdrom_regs, sizeof(cdrom_regs));
2542+ DECL_STATE_ENTRY_BOOL(backup_locked);
2543+ DECL_STATE_ENTRY_BOOL(irq_status);
2544+ DECL_STATE_ENTRY_BOOL(drq_status);
2545+ DECL_STATE_ENTRY_1D_ARRAY(adpcm_ram, sizeof(adpcm_ram));
2546+ DECL_STATE_ENTRY_INT32(adpcm_read_ptr);
2547+ DECL_STATE_ENTRY_INT32(adpcm_write_ptr);
2548+ DECL_STATE_ENTRY_INT32(adpcm_written);
2549+ DECL_STATE_ENTRY_INT32(adpcm_length);
2550+ DECL_STATE_ENTRY_INT32(adpcm_clock_divider);
2551+ DECL_STATE_ENTRY_UINT8(adpcm_read_buf);
2552+ DECL_STATE_ENTRY_UINT8(adpcm_write_buf);
2553+ DECL_STATE_ENTRY_BOOL(adpcm_dma_enabled);
2554+ DECL_STATE_ENTRY_INT32(msm_start_addr);
2555+ DECL_STATE_ENTRY_INT32(msm_end_addr);
2556+ DECL_STATE_ENTRY_INT32(msm_half_addr);
2557+ DECL_STATE_ENTRY_UINT8(msm_nibble);
2558+ DECL_STATE_ENTRY_UINT8(msm_idle);
2559+ DECL_STATE_ENTRY_DOUBLE(cdda_volume);
2560+ DECL_STATE_ENTRY_DOUBLE(adpcm_volume);
2561+ DECL_STATE_ENTRY_INT32(event_cdda_fader);
2562+ DECL_STATE_ENTRY_INT32(event_adpcm_fader);
2563+#endif
2564+ leave_decl_state();
2565+}
24522566 void PCE::save_state(FILEIO* state_fio)
24532567 {
2454- state_fio->FputUint32(STATE_VERSION);
2455- state_fio->FputInt32(this_device_id);
2456-
2457- state_fio->FputBool(support_6btn_pad);
2458- state_fio->FputBool(support_multi_tap);
2568+ if(state_entry != NULL) {
2569+ state_entry->save_state(state_fio);
2570+ }
2571+// state_fio->FputUint32(STATE_VERSION);
2572+// state_fio->FputInt32(this_device_id);
2573+//
2574+// state_fio->FputBool(support_6btn_pad);
2575+// state_fio->FputBool(support_multi_tap);
24592576 #ifdef SUPPORT_SUPER_GFX
2460- state_fio->FputBool(support_sgfx);
2577+// state_fio->FputBool(support_sgfx);
24612578 #endif
24622579 #ifdef SUPPORT_CDROM
2463- state_fio->FputBool(support_cdrom);
2580+// state_fio->FputBool(support_cdrom);
24642581 #endif
2465- state_fio->Fwrite(ram, sizeof(ram), 1);
2466- state_fio->Fwrite(cart + 0x80000, 0x80000, 1);
2582+// state_fio->Fwrite(ram, sizeof(ram), 1);
2583+// state_fio->Fwrite(cart + 0x80000, 0x80000, 1);
24672584 #ifdef SUPPORT_BACKUP_RAM
2468- state_fio->Fwrite(backup, sizeof(backup), 1);
2469- state_fio->FputUint32(backup_crc32);
2585+// state_fio->Fwrite(backup, sizeof(backup), 1);
2586+// state_fio->FputUint32(backup_crc32);
24702587 #endif
2471- state_fio->FputUint32(bank);
2472- state_fio->FputUint8(buffer);
2473- state_fio->FputInt32(prev_width);
2474- state_fio->FputBool(inserted);
2475- state_fio->Fwrite(vdc, sizeof(vdc), 1);
2476- state_fio->Fwrite(&vce, sizeof(vce), 1);
2477- state_fio->Fwrite(&vpc, sizeof(vpc), 1);
2478- state_fio->Fwrite(psg, sizeof(psg), 1);
2479- state_fio->FputUint8(psg_ch);
2480- state_fio->FputUint8(psg_vol);
2481- state_fio->FputUint8(psg_lfo_freq);
2482- state_fio->FputUint8(psg_lfo_ctrl);
2483- state_fio->FputUint8(joy_counter);
2484- state_fio->FputBool(joy_high_nibble);
2485- state_fio->FputBool(joy_second_byte);
2588+// state_fio->FputUint32(bank);
2589+// state_fio->FputUint8(buffer);
2590+// state_fio->FputInt32(prev_width);
2591+// state_fio->FputBool(inserted);
2592+// state_fio->Fwrite(vdc, sizeof(vdc), 1);
2593+// state_fio->Fwrite(&vce, sizeof(vce), 1);
2594+// state_fio->Fwrite(&vpc, sizeof(vpc), 1);
2595+// state_fio->Fwrite(psg, sizeof(psg), 1);
2596+// state_fio->FputUint8(psg_ch);
2597+// state_fio->FputUint8(psg_vol);
2598+// state_fio->FputUint8(psg_lfo_freq);
2599+// state_fio->FputUint8(psg_lfo_ctrl);
2600+// state_fio->FputUint8(joy_counter);
2601+// state_fio->FputBool(joy_high_nibble);
2602+// state_fio->FputBool(joy_second_byte);
24862603 #ifdef SUPPORT_CDROM
2487- state_fio->Fwrite(cdrom_ram, sizeof(cdrom_ram), 1);
2488- state_fio->Fwrite(cdrom_regs, sizeof(cdrom_regs), 1);
2489- state_fio->FputBool(backup_locked);
2490- state_fio->FputBool(irq_status);
2491- state_fio->FputBool(drq_status);
2492- state_fio->Fwrite(adpcm_ram, sizeof(adpcm_ram), 1);
2493- state_fio->FputInt32(adpcm_read_ptr);
2494- state_fio->FputInt32(adpcm_write_ptr);
2495- state_fio->FputInt32(adpcm_written);
2496- state_fio->FputInt32(adpcm_length);
2497- state_fio->FputInt32(adpcm_clock_divider);
2498- state_fio->FputUint8(adpcm_read_buf);
2499- state_fio->FputUint8(adpcm_write_buf);
2500- state_fio->FputBool(adpcm_dma_enabled);
2501- state_fio->FputInt32(msm_start_addr);
2502- state_fio->FputInt32(msm_end_addr);
2503- state_fio->FputInt32(msm_half_addr);
2504- state_fio->FputUint8(msm_nibble);
2505- state_fio->FputUint8(msm_idle);
2506- state_fio->FputDouble(cdda_volume);
2507- state_fio->FputDouble(adpcm_volume);
2508- state_fio->FputInt32(event_cdda_fader);
2509- state_fio->FputInt32(event_adpcm_fader);
2604+// state_fio->Fwrite(cdrom_ram, sizeof(cdrom_ram), 1);
2605+// state_fio->Fwrite(cdrom_regs, sizeof(cdrom_regs), 1);
2606+// state_fio->FputBool(backup_locked);
2607+// state_fio->FputBool(irq_status);
2608+// state_fio->FputBool(drq_status);
2609+// state_fio->Fwrite(adpcm_ram, sizeof(adpcm_ram), 1);
2610+// state_fio->FputInt32(adpcm_read_ptr);
2611+// state_fio->FputInt32(adpcm_write_ptr);
2612+// state_fio->FputInt32(adpcm_written);
2613+// state_fio->FputInt32(adpcm_length);
2614+// state_fio->FputInt32(adpcm_clock_divider);
2615+// state_fio->FputUint8(adpcm_read_buf);
2616+// state_fio->FputUint8(adpcm_write_buf);
2617+// state_fio->FputBool(adpcm_dma_enabled);
2618+// state_fio->FputInt32(msm_start_addr);
2619+// state_fio->FputInt32(msm_end_addr);
2620+// state_fio->FputInt32(msm_half_addr);
2621+// state_fio->FputUint8(msm_nibble);
2622+// state_fio->FputUint8(msm_idle);
2623+// state_fio->FputDouble(cdda_volume);
2624+// state_fio->FputDouble(adpcm_volume);
2625+// state_fio->FputInt32(event_cdda_fader);
2626+// state_fio->FputInt32(event_adpcm_fader);
25102627 #endif
25112628 }
25122629
25132630 bool PCE::load_state(FILEIO* state_fio)
25142631 {
2515- if(state_fio->FgetUint32() != STATE_VERSION) {
2516- return false;
2632+ bool mb = false;
2633+ if(state_entry != NULL) {
2634+ mb = state_entry->load_state(state_fio);
25172635 }
2518- if(state_fio->FgetInt32() != this_device_id) {
2636+ if(!mb) {
25192637 return false;
25202638 }
2521- support_6btn_pad = state_fio->FgetBool();
2522- support_multi_tap = state_fio->FgetBool();
2639+// if(state_fio->FgetUint32() != STATE_VERSION) {
2640+// // return false;
2641+// }
2642+// if(state_fio->FgetInt32() != this_device_id) {
2643+// // return false;
2644+// }
2645+// support_6btn_pad = state_fio->FgetBool();
2646+// support_multi_tap = state_fio->FgetBool();
25232647 #ifdef SUPPORT_SUPER_GFX
2524- support_sgfx = state_fio->FgetBool();
2648+// support_sgfx = state_fio->FgetBool();
25252649 #endif
25262650 #ifdef SUPPORT_CDROM
2527- support_cdrom = state_fio->FgetBool();
2651+// support_cdrom = state_fio->FgetBool();
25282652 #endif
2529- state_fio->Fread(ram, sizeof(ram), 1);
2530- state_fio->Fread(cart + 0x80000, 0x80000, 1);
2653+// state_fio->Fread(ram, sizeof(ram), 1);
2654+// state_fio->Fread(cart + 0x80000, 0x80000, 1);
25312655 #ifdef SUPPORT_BACKUP_RAM
2532- state_fio->Fread(backup, sizeof(backup), 1);
2533- backup_crc32 = state_fio->FgetUint32();
2656+// state_fio->Fread(backup, sizeof(backup), 1);
2657+// backup_crc32 = state_fio->FgetUint32();
25342658 #endif
2535- bank = state_fio->FgetUint32();
2536- buffer = state_fio->FgetUint8();
2537- prev_width = state_fio->FgetInt32();
2538- inserted = state_fio->FgetBool();
2539- state_fio->Fread(vdc, sizeof(vdc), 1);
2540- state_fio->Fread(&vce, sizeof(vce), 1);
2541- state_fio->Fread(&vpc, sizeof(vpc), 1);
2542- state_fio->Fread(psg, sizeof(psg), 1);
2543- psg_ch = state_fio->FgetUint8();
2544- psg_vol = state_fio->FgetUint8();
2545- psg_lfo_freq = state_fio->FgetUint8();
2546- psg_lfo_ctrl = state_fio->FgetUint8();
2547- joy_counter = state_fio->FgetUint8();
2548- joy_high_nibble = state_fio->FgetBool();
2549- joy_second_byte = state_fio->FgetBool();
2659+// bank = state_fio->FgetUint32();
2660+// buffer = state_fio->FgetUint8();
2661+// prev_width = state_fio->FgetInt32();
2662+// inserted = state_fio->FgetBool();
2663+// state_fio->Fread(vdc, sizeof(vdc), 1);
2664+// state_fio->Fread(&vce, sizeof(vce), 1);
2665+// state_fio->Fread(&vpc, sizeof(vpc), 1);
2666+// state_fio->Fread(psg, sizeof(psg), 1);
2667+// psg_ch = state_fio->FgetUint8();
2668+// psg_vol = state_fio->FgetUint8();
2669+// psg_lfo_freq = state_fio->FgetUint8();
2670+// psg_lfo_ctrl = state_fio->FgetUint8();
2671+// joy_counter = state_fio->FgetUint8();
2672+// joy_high_nibble = state_fio->FgetBool();
2673+// joy_second_byte = state_fio->FgetBool();
25502674 #ifdef SUPPORT_CDROM
2551- state_fio->Fread(cdrom_ram, sizeof(cdrom_ram), 1);
2552- state_fio->Fread(cdrom_regs, sizeof(cdrom_regs), 1);
2553- backup_locked = state_fio->FgetBool();
2554- irq_status = state_fio->FgetBool();
2555- drq_status = state_fio->FgetBool();
2556- state_fio->Fread(adpcm_ram, sizeof(adpcm_ram), 1);
2557- adpcm_read_ptr = state_fio->FgetInt32();
2558- adpcm_write_ptr = state_fio->FgetInt32();
2559- adpcm_written = state_fio->FgetInt32();
2560- adpcm_length = state_fio->FgetInt32();
2561- adpcm_clock_divider = state_fio->FgetInt32();
2562- adpcm_read_buf = state_fio->FgetUint8();
2563- adpcm_write_buf = state_fio->FgetUint8();
2564- adpcm_dma_enabled = state_fio->FgetBool();
2565- msm_start_addr = state_fio->FgetInt32();
2566- msm_end_addr = state_fio->FgetInt32();
2567- msm_half_addr = state_fio->FgetInt32();
2568- msm_nibble = state_fio->FgetUint8();
2569- msm_idle = state_fio->FgetUint8();
2570- cdda_volume = state_fio->FgetDouble();
2571- adpcm_volume = state_fio->FgetDouble();
2572- event_cdda_fader = state_fio->FgetInt32();
2573- event_adpcm_fader = state_fio->FgetInt32();
2675+// state_fio->Fread(cdrom_ram, sizeof(cdrom_ram), 1);
2676+// state_fio->Fread(cdrom_regs, sizeof(cdrom_regs), 1);
2677+// backup_locked = state_fio->FgetBool();
2678+// irq_status = state_fio->FgetBool();
2679+// drq_status = state_fio->FgetBool();
2680+// state_fio->Fread(adpcm_ram, sizeof(adpcm_ram), 1);
2681+// adpcm_read_ptr = state_fio->FgetInt32();
2682+// adpcm_write_ptr = state_fio->FgetInt32();
2683+// adpcm_written = state_fio->FgetInt32();
2684+// adpcm_length = state_fio->FgetInt32();
2685+// adpcm_clock_divider = state_fio->FgetInt32();
2686+// adpcm_read_buf = state_fio->FgetUint8();
2687+// adpcm_write_buf = state_fio->FgetUint8();
2688+// adpcm_dma_enabled = state_fio->FgetBool();
2689+// msm_start_addr = state_fio->FgetInt32();
2690+// msm_end_addr = state_fio->FgetInt32();
2691+// msm_half_addr = state_fio->FgetInt32();
2692+// msm_nibble = state_fio->FgetUint8();
2693+// msm_idle = state_fio->FgetUint8();
2694+// cdda_volume = state_fio->FgetDouble();
2695+// adpcm_volume = state_fio->FgetDouble();
2696+// event_cdda_fader = state_fio->FgetInt32();
2697+// event_adpcm_fader = state_fio->FgetInt32();
25742698 #endif
25752699 return true;
25762700 }
--- a/source/src/vm/pcengine/pce.h
+++ b/source/src/vm/pcengine/pce.h
@@ -244,6 +244,7 @@ public:
244244 #endif
245245 void mix(int32_t* buffer, int cnt);
246246 void set_volume(int ch, int decibel_l, int decibel_r);
247+ void decl_state();
247248 void save_state(FILEIO* state_fio);
248249 bool load_state(FILEIO* state_fio);
249250
Show on old repository browser