Example #1
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i, j;

            pgm_tx_videoram  = reader.ReadBytes(0x2000);
            pgm_bg_videoram  = reader.ReadBytes(0x4000);
            pgm_rowscrollram = reader.ReadBytes(0x800);
            pgm_videoregs    = reader.ReadBytes(0x10000);
            CalVal           = reader.ReadByte();
            CalMask          = reader.ReadByte();
            CalCom           = reader.ReadByte();
            CalCnt           = reader.ReadByte();
            asic3_reg        = reader.ReadByte();
            asic3_x          = reader.ReadByte();
            for (i = 0; i < 3; i++)
            {
                asic3_latch[i] = reader.ReadByte();
            }
            asic3_hold         = reader.ReadUInt16();
            asic3_hilo         = reader.ReadUInt16();
            Video.paletteram16 = reader.ReadBytes(0x1200);
            for (i = 0; i < 0x901; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x20000);
            MC68000.m1.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x10000);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds                   = reader.ReadInt32();
            Timer.global_basetime.attoseconds               = reader.ReadInt64();
            Video.screenstate.vblank_start_time.seconds     = reader.ReadInt32();
            Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number                  = reader.ReadInt64();
            Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            ICS2115.LoadStateBinary(reader);
            for (i = 0; i < 3; i++)
            {
                Sound.latched_value[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 3; i++)
            {
                Sound.utempdata[i] = reader.ReadUInt16();
            }
            Sound.ics2115stream.output_sampindex      = reader.ReadInt32();
            Sound.ics2115stream.output_base_sampindex = reader.ReadInt32();
            Sound.mixerstream.output_sampindex        = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex   = reader.ReadInt32();
        }
Example #2
0
        public static void LoadStateBinaryC(BinaryReader reader)
        {
            int i, i1, n1, n2;

            dswa        = reader.ReadByte();
            dswb        = reader.ReadByte();
            dswc        = reader.ReadByte();
            basebanksnd = reader.ReadInt32();
            for (i = 0; i < 0x20; i++)
            {
                cps_a_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x20; i++)
            {
                cps_b_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0xc00; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x10000);
            gfxram         = reader.ReadBytes(0x30000);
            MC68000.m1.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x800);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds     = reader.ReadInt32();
            Timer.global_basetime.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number    = reader.ReadInt64();
            Sound.last_update_second          = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x800);
            YM2151.LoadStateBinary(reader);
            OKI6295.LoadStateBinary(reader);
            for (i = 0; i < 2; i++)
            {
                Sound.latched_value[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 2; i++)
            {
                Sound.utempdata[i] = reader.ReadUInt16();
            }
            Sound.ym2151stream.output_sampindex      = reader.ReadInt32();
            Sound.ym2151stream.output_base_sampindex = reader.ReadInt32();
            Sound.okistream.output_sampindex         = reader.ReadInt32();
            Sound.okistream.output_base_sampindex    = reader.ReadInt32();
            Sound.mixerstream.output_sampindex       = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex  = reader.ReadInt32();
        }
Example #3
0
        public static void LoadStateBinaryQ(BinaryReader reader)
        {
            int i;

            dswa        = reader.ReadByte();
            dswb        = reader.ReadByte();
            dswc        = reader.ReadByte();
            basebanksnd = reader.ReadInt32();
            for (i = 0; i < 0x20; i++)
            {
                cps_a_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x20; i++)
            {
                cps_b_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0xc00; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x10000);
            gfxram         = reader.ReadBytes(0x30000);
            MC68000.m1.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x800);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds     = reader.ReadInt32();
            Timer.global_basetime.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number    = reader.ReadInt64();
            //Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            qsound_sharedram1 = reader.ReadBytes(0x1000);
            qsound_sharedram2 = reader.ReadBytes(0x1000);
            //QSound.LoadStateBinary(reader);
            //Sound.qsoundstream.output_sampindex = reader.ReadInt32();
            //Sound.qsoundstream.output_base_sampindex = reader.ReadInt32();
            //Sound.mixerstream.output_sampindex = reader.ReadInt32();
            //Sound.mixerstream.output_base_sampindex = reader.ReadInt32();
            Eeprom.eeprom_data      = reader.ReadBytes(0x80);
            Eeprom.serial_buffer    = reader.ReadBytes(40);
            Eeprom.clock_line       = (LineState)reader.ReadInt32();
            Eeprom.reset_line       = (LineState)reader.ReadInt32();
            Eeprom.locked           = reader.ReadInt32();
            Eeprom.serial_count     = reader.ReadInt32();
            Eeprom.latch            = reader.ReadInt32();
            Eeprom.sending          = reader.ReadInt32();
            Eeprom.eeprom_data_bits = reader.ReadInt32();
        }
Example #4
0
        public static void LoadStateBinaryC(BinaryReader reader)
        {
            int i;

            dswa        = reader.ReadByte();
            dswb        = reader.ReadByte();
            dswc        = reader.ReadByte();
            basebanksnd = reader.ReadInt32();
            for (i = 0; i < 0x20; i++)
            {
                cps_a_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x20; i++)
            {
                cps_b_regs[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0xc00; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x10000);
            gfxram         = reader.ReadBytes(0x30000);
            MC68000.m1.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x800);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds     = reader.ReadInt32();
            Timer.global_basetime.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number    = reader.ReadInt64();
            //Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            //YM2151.LoadStateBinary(reader);
            //OKI6295.LoadStateBinary(reader);
            for (i = 0; i < 2; i++)
            {
                //Sound.latched_value[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 2; i++)
            {
                //Sound.utempdata[i] = reader.ReadUInt16();
            }
            //Sound.ym2151stream.output_sampindex = reader.ReadInt32();
            //Sound.ym2151stream.output_base_sampindex = reader.ReadInt32();
            //Sound.okistream.output_sampindex = reader.ReadInt32();
            //Sound.okistream.output_base_sampindex = reader.ReadInt32();
            //Sound.mixerstream.output_sampindex = reader.ReadInt32();
            //Sound.mixerstream.output_base_sampindex = reader.ReadInt32();
            switch (RomInfo.Rom.Name)
            {
            case "forgottn":
            case "forgottna":
            case "forgottnu":
            case "forgottnue":
            case "forgottnuc":
            case "forgottnua":
            case "forgottnuaa":
            case "lostwrld":
            case "lostwrldo":
                //Inptport.portdata.last_delta_nsec = reader.ReadInt64();
                break;
            }
        }
Example #5
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i, j;

            dipsw = reader.ReadByte();
            for (i = 0; i < 0x2000; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            bank_ram20                = reader.ReadBytes(0x2000);
            bank_ram30                = reader.ReadBytes(0x80);
            namcos1_videoram          = reader.ReadBytes(0x8000);
            namcos1_cus116            = reader.ReadBytes(0x10);
            namcos1_spriteram         = reader.ReadBytes(0x1000);
            namcos1_playfield_control = reader.ReadBytes(0x20);
            copy_sprites              = reader.ReadInt32();
            s1ram              = reader.ReadBytes(0x8000);
            namcos1_triram     = reader.ReadBytes(0x800);
            namcos1_paletteram = reader.ReadBytes(0x8000);
            key = reader.ReadBytes(8);
            audiocpurom_offset = reader.ReadInt32();
            mcu_patch_data     = reader.ReadInt32();
            mcurom_offset      = reader.ReadInt32();
            namcos1_reset      = reader.ReadInt32();
            wdog                  = reader.ReadInt32();
            dac0_value            = reader.ReadInt32();
            dac1_value            = reader.ReadInt32();
            dac0_gain             = reader.ReadInt32();
            dac1_gain             = reader.ReadInt32();
            Generic.generic_nvram = reader.ReadBytes(0x800);
            for (i = 0; i < 2; i++)
            {
                for (j = 0; j < 8; j++)
                {
                    cus117_offset[i, j] = reader.ReadInt32();
                }
            }
            for (i = 0; i < 2; i++)
            {
                for (j = 0; j < 8; j++)
                {
                    user1rom_offset[i, j] = reader.ReadInt32();
                }
            }
            for (i = 0; i < 3; i++)
            {
                M6809.mm1[i].PC.LowWord   = reader.ReadUInt16();
                M6809.mm1[i].PPC.LowWord  = reader.ReadUInt16();
                M6809.mm1[i].D.LowWord    = reader.ReadUInt16();
                M6809.mm1[i].DP.LowWord   = reader.ReadUInt16();
                M6809.mm1[i].U.LowWord    = reader.ReadUInt16();
                M6809.mm1[i].S.LowWord    = reader.ReadUInt16();
                M6809.mm1[i].X.LowWord    = reader.ReadUInt16();
                M6809.mm1[i].Y.LowWord    = reader.ReadUInt16();
                M6809.mm1[i].CC           = reader.ReadByte();
                M6809.mm1[i].irq_state[0] = (LineState)reader.ReadByte();
                M6809.mm1[i].irq_state[1] = (LineState)reader.ReadByte();
                M6809.mm1[i].int_state    = reader.ReadByte();
                M6809.mm1[i].nmi_state    = (LineState)reader.ReadByte();
            }
            M6800.m1.PPC.LowWord      = reader.ReadUInt16();
            M6800.m1.PC.LowWord       = reader.ReadUInt16();
            M6800.m1.S.LowWord        = reader.ReadUInt16();
            M6800.m1.X.LowWord        = reader.ReadUInt16();
            M6800.m1.D.LowWord        = reader.ReadUInt16();
            M6800.m1.cc               = reader.ReadByte();
            M6800.m1.wai_state        = reader.ReadByte();
            M6800.m1.nmi_state        = (LineState)reader.ReadByte();
            M6800.m1.irq_state[0]     = (LineState)reader.ReadByte();
            M6800.m1.irq_state[1]     = (LineState)reader.ReadByte();
            M6800.m1.ic_eddge         = reader.ReadByte();
            M6800.m1.port1_ddr        = reader.ReadByte();
            M6800.m1.port2_ddr        = reader.ReadByte();
            M6800.m1.port3_ddr        = reader.ReadByte();
            M6800.m1.port4_ddr        = reader.ReadByte();
            M6800.m1.port1_data       = reader.ReadByte();
            M6800.m1.port2_data       = reader.ReadByte();
            M6800.m1.port3_data       = reader.ReadByte();
            M6800.m1.port4_data       = reader.ReadByte();
            M6800.m1.tcsr             = reader.ReadByte();
            M6800.m1.pending_tcsr     = reader.ReadByte();
            M6800.m1.irq2             = reader.ReadByte();
            M6800.m1.ram_ctrl         = reader.ReadByte();
            M6800.m1.counter.d        = reader.ReadUInt32();
            M6800.m1.output_compare.d = reader.ReadUInt32();
            M6800.m1.input_capture    = reader.ReadUInt16();
            M6800.m1.timer_over.d     = reader.ReadUInt32();
            M6800.m1.clock            = reader.ReadInt32();
            M6800.m1.trcsr            = reader.ReadByte();
            M6800.m1.rmcr             = reader.ReadByte();
            M6800.m1.rdr              = reader.ReadByte();
            M6800.m1.tdr              = reader.ReadByte();
            M6800.m1.rsr              = reader.ReadByte();
            M6800.m1.tsr              = reader.ReadByte();
            M6800.m1.rxbits           = reader.ReadInt32();
            M6800.m1.txbits           = reader.ReadInt32();
            M6800.m1.txstate          = (M6800.M6800_TX_STATE)reader.ReadInt32();
            M6800.m1.trcsr_read       = reader.ReadInt32();
            M6800.m1.tx               = reader.ReadInt32();
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds                   = reader.ReadInt32();
            Timer.global_basetime.attoseconds               = reader.ReadInt64();
            Video.screenstate.vblank_start_time.seconds     = reader.ReadInt32();
            Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number                  = reader.ReadInt64();
            Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 4; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
                Cpuexec.cpu[i].TotalExecutedCycles   = reader.ReadUInt64();
                Cpuexec.cpu[i].PendingCycles         = reader.ReadInt32();
            }
            Timer.LoadStateBinary(reader);
            YM2151.LoadStateBinary(reader);
            Namco.nam1.num_voices   = reader.ReadInt32();
            Namco.nam1.sound_enable = reader.ReadInt32();
            for (i = 0; i < 16; i++)
            {
                for (j = 0; j < 32 * 16; j++)
                {
                    Namco.nam1.waveform[i][j] = reader.ReadInt16();
                }
            }
            for (i = 0; i < 8; i++)
            {
                Namco.nam1.channel_list[i].frequency       = reader.ReadInt32();
                Namco.nam1.channel_list[i].counter         = reader.ReadInt32();
                Namco.nam1.channel_list[i].volume[0]       = reader.ReadInt32();
                Namco.nam1.channel_list[i].volume[1]       = reader.ReadInt32();
                Namco.nam1.channel_list[i].noise_sw        = reader.ReadInt32();
                Namco.nam1.channel_list[i].noise_state     = reader.ReadInt32();
                Namco.nam1.channel_list[i].noise_seed      = reader.ReadInt32();
                Namco.nam1.channel_list[i].noise_hold      = reader.ReadInt32();
                Namco.nam1.channel_list[i].noise_counter   = reader.ReadInt32();
                Namco.nam1.channel_list[i].waveform_select = reader.ReadInt32();
            }
            Namco.namco_wavedata = reader.ReadBytes(0x400);
            DAC.dac1.output      = reader.ReadInt16();
            Sound.ym2151stream.output_sampindex      = reader.ReadInt32();
            Sound.ym2151stream.output_base_sampindex = reader.ReadInt32();
            Sound.namcostream.output_sampindex       = reader.ReadInt32();
            Sound.namcostream.output_base_sampindex  = reader.ReadInt32();
            Sound.dacstream.output_sampindex         = reader.ReadInt32();
            Sound.dacstream.output_base_sampindex    = reader.ReadInt32();
            Sound.mixerstream.output_sampindex       = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex  = reader.ReadInt32();
        }
Example #6
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i,j;

            for (i = 0; i < 0x800; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Generic.generic_nvram = reader.ReadBytes(0x4000);
            for (i = 0; i < 0x800; i++)
            {
                priority_ram[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x1000; i++)
            {
                paletteram16[i] = reader.ReadUInt16();
            }
            prot1      = reader.ReadByte();
            prot2      = reader.ReadByte();
            prot1_swap = reader.ReadByte();
            prot1_addr = reader.ReadUInt32();
            for (i = 0; i < 2; i++)
            {
                igs003_reg[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 2; i++)
            {
                vbowl_trackball[i] = reader.ReadUInt16();
            }
            priority         = reader.ReadUInt16();
            igs_dips_sel     = reader.ReadUInt16();
            igs_input_sel    = reader.ReadUInt16();
            lhb_irq_enable   = reader.ReadUInt16();
            igs012_prot      = reader.ReadByte();
            igs012_prot_swap = reader.ReadByte();
            igs012_prot_mode = reader.ReadBoolean();
            for (i = 0; i < 8; i++)
            {
                for (j = 0; j < 0x20000; j++)
                {
                    layer[i][j] = reader.ReadByte();
                }
            }
            lhb2_pen_hi    = reader.ReadByte();
            blitter.x      = reader.ReadUInt16();
            blitter.y      = reader.ReadUInt16();
            blitter.w      = reader.ReadUInt16();
            blitter.h      = reader.ReadUInt16();
            blitter.gfx_lo = reader.ReadUInt16();
            blitter.gfx_hi = reader.ReadUInt16();
            blitter.depth  = reader.ReadUInt16();
            blitter.pen    = reader.ReadUInt16();
            blitter.flags  = reader.ReadUInt16();
            MC68000.m1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds        = reader.ReadInt32();
            Timer.global_basetime.attoseconds    = reader.ReadInt64();
            Video.screenstate.frame_number       = reader.ReadInt64();
            Sound.last_update_second             = reader.ReadInt32();
            Cpuexec.cpu[0].localtime.seconds     = reader.ReadInt32();
            Cpuexec.cpu[0].localtime.attoseconds = reader.ReadInt64();
            Timer.LoadStateBinary(reader);
            OKI6295.LoadStateBinary(reader);
            for (i = 0; i < 9; i++)
            {
                FMOpl.OPL.P_CH[i].block_fnum = reader.ReadUInt32();
                FMOpl.OPL.P_CH[i].kcode      = reader.ReadByte();
                for (j = 0; j < 2; j++)
                {
                    FMOpl.OPL.P_CH[i].SLOT[j].ar         = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].dr         = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].rr         = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].KSR        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].ksl        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].ksr        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].mul        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].Cnt        = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].FB         = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].op1_out[0] = reader.ReadInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].op1_out[1] = reader.ReadInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].CON        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].eg_type    = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].state      = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].TL         = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].volume     = reader.ReadInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].sl         = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].key        = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].AMmask     = reader.ReadUInt32();
                    FMOpl.OPL.P_CH[i].SLOT[j].vib        = reader.ReadByte();
                    FMOpl.OPL.P_CH[i].SLOT[j].wavetable  = reader.ReadUInt16();
                }
            }
            FMOpl.OPL.eg_cnt             = reader.ReadUInt32();
            FMOpl.OPL.eg_timer           = reader.ReadUInt32();
            FMOpl.OPL.rhythm             = reader.ReadByte();
            FMOpl.OPL.lfo_am_depth       = reader.ReadByte();
            FMOpl.OPL.lfo_pm_depth_range = reader.ReadByte();
            FMOpl.OPL.lfo_am_cnt         = reader.ReadUInt32();
            FMOpl.OPL.lfo_pm_cnt         = reader.ReadUInt32();
            FMOpl.OPL.noise_rng          = reader.ReadUInt32();
            FMOpl.OPL.noise_p            = reader.ReadUInt32();
            FMOpl.OPL.wavesel            = reader.ReadByte();
            for (i = 0; i < 2; i++)
            {
                FMOpl.OPL.T[i] = reader.ReadUInt32();
            }
            for (i = 0; i < 2; i++)
            {
                FMOpl.OPL.st[i] = reader.ReadByte();
            }
            FMOpl.OPL.address                        = reader.ReadByte();
            FMOpl.OPL.status                         = reader.ReadByte();
            FMOpl.OPL.statusmask                     = reader.ReadByte();
            FMOpl.OPL.mode                           = reader.ReadByte();
            Sound.okistream.output_sampindex         = reader.ReadInt32();
            Sound.okistream.output_base_sampindex    = reader.ReadInt32();
            Sound.ym3812stream.output_sampindex      = reader.ReadInt32();
            Sound.ym3812stream.output_base_sampindex = reader.ReadInt32();
            Sound.mixerstream.output_sampindex       = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex  = reader.ReadInt32();
        }
Example #7
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i;

            dsw                = reader.ReadUInt16();
            setvector_param    = reader.ReadInt32();
            irqvector          = reader.ReadByte();
            sample_addr        = reader.ReadInt32();
            protection_ram     = reader.ReadBytes(0x1000);
            m72_irq_base       = reader.ReadByte();
            m72_scanline_param = reader.ReadInt32();
            for (i = 0; i < 0x600; i++)
            {
                Generic.paletteram16[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x600; i++)
            {
                Generic.paletteram16_2[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x200; i++)
            {
                Generic.spriteram16[i] = reader.ReadUInt16();
            }
            m72_videoram1           = reader.ReadBytes(0x4000);
            m72_videoram2           = reader.ReadBytes(0x4000);
            m72_raster_irq_position = reader.ReadInt32();
            video_off = reader.ReadInt32();
            scrollx1  = reader.ReadInt32();
            scrolly1  = reader.ReadInt32();
            scrollx2  = reader.ReadInt32();
            scrolly2  = reader.ReadInt32();
            for (i = 0; i < 0x200; i++)
            {
                m72_spriteram[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x201; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x4000);
            Nec.nn1[0].LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x10000);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds     = reader.ReadInt32();
            Timer.global_basetime.attoseconds = reader.ReadInt64();
            Video.LoadStateBinary(reader);
            Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            YM2151.LoadStateBinary(reader);
            DAC.dac1.output        = reader.ReadInt16();
            Sound.latched_value[0] = reader.ReadUInt16();
            Sound.utempdata[0]     = reader.ReadUInt16();
            Sound.ym2151stream.output_sampindex      = reader.ReadInt32();
            Sound.ym2151stream.output_base_sampindex = reader.ReadInt32();
            Sound.dacstream.output_sampindex         = reader.ReadInt32();
            Sound.dacstream.output_base_sampindex    = reader.ReadInt32();
            Sound.mixerstream.output_sampindex       = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex  = reader.ReadInt32();
        }
Example #8
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i,j;

            dsw = reader.ReadByte();
            display_position_interrupt_control = reader.ReadByte();
            display_counter                    = reader.ReadUInt32();
            vblank_interrupt_pending           = reader.ReadInt32();
            display_position_interrupt_pending = reader.ReadInt32();
            irq3_pending                 = reader.ReadInt32();
            controller_select            = reader.ReadByte();
            main_cpu_bank_address        = reader.ReadInt32();
            main_cpu_vector_table_source = reader.ReadByte();
            audio_cpu_banks              = reader.ReadBytes(4);
            save_ram_unlocked            = reader.ReadByte();
            audio_cpu_nmi_enabled        = reader.ReadBoolean();
            audio_cpu_nmi_pending        = reader.ReadBoolean();
            mainram2          = reader.ReadBytes(0x10000);
            pvc_cartridge_ram = reader.ReadBytes(0x2000);
            for (i = 0; i < 2; i++)
            {
                for (j = 0; j < 0x1000; j++)
                {
                    palettes[i,j] = reader.ReadUInt16();
                }
            }
            for (i = 0; i < 0x10000; i++)
            {
                neogeo_videoram[i] = reader.ReadUInt16();
            }
            videoram_read_buffer         = reader.ReadUInt16();
            videoram_modulo              = reader.ReadUInt16();
            videoram_offset              = reader.ReadUInt16();
            fixed_layer_source           = reader.ReadByte();
            screen_dark                  = reader.ReadByte();
            palette_bank                 = reader.ReadByte();
            auto_animation_speed         = reader.ReadByte();
            auto_animation_disabled      = reader.ReadByte();
            auto_animation_counter       = reader.ReadInt32();
            auto_animation_frame_counter = reader.ReadInt32();
            Memory.mainram               = reader.ReadBytes(0x10000);
            MC68000.m1.LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x800);
            Z80A.z1.LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds                   = reader.ReadInt32();
            Timer.global_basetime.attoseconds               = reader.ReadInt64();
            Video.screenstate.vblank_start_time.seconds     = reader.ReadInt32();
            Video.screenstate.vblank_start_time.attoseconds = reader.ReadInt64();
            Video.screenstate.frame_number                  = reader.ReadInt64();
            Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            AY8910.ay8910info.register_latch = reader.ReadInt32();
            AY8910.ay8910info.regs           = reader.ReadBytes(16);
            for (i = 0; i < 3; i++)
            {
                AY8910.ay8910info.count[i] = reader.ReadInt32();
            }
            AY8910.ay8910info.output       = reader.ReadBytes(3);
            AY8910.ay8910info.output_noise = reader.ReadByte();
            AY8910.ay8910info.count_noise  = reader.ReadInt32();
            AY8910.ay8910info.count_env    = reader.ReadInt32();
            AY8910.ay8910info.env_step     = reader.ReadSByte();
            AY8910.ay8910info.env_volume   = reader.ReadInt32();
            AY8910.ay8910info.hold         = reader.ReadByte();
            AY8910.ay8910info.alternate    = reader.ReadByte();
            AY8910.ay8910info.attack       = reader.ReadByte();
            AY8910.ay8910info.holding      = reader.ReadByte();
            AY8910.ay8910info.rng          = reader.ReadInt32();
            AY8910.ay8910info.vol_enabled  = reader.ReadBytes(3);
            FM.F2610.REGS     = reader.ReadBytes(512);
            FM.F2610.addr_A1  = reader.ReadByte();
            FM.F2610.adpcmTL  = reader.ReadByte();
            FM.F2610.adpcmreg = reader.ReadBytes(0x30);
            FM.F2610.adpcm_arrivedEndAddress = reader.ReadByte();
            FM.ST.freqbase                     = reader.ReadDouble();
            FM.ST.timer_prescaler              = reader.ReadInt32();
            FM.ST.busy_expiry_time.seconds     = reader.ReadInt32();
            FM.ST.busy_expiry_time.attoseconds = reader.ReadInt64();
            FM.ST.address       = reader.ReadByte();
            FM.ST.irq           = reader.ReadByte();
            FM.ST.irqmask       = reader.ReadByte();
            FM.ST.status        = reader.ReadByte();
            FM.ST.mode          = reader.ReadByte();
            FM.ST.prescaler_sel = reader.ReadByte();
            FM.ST.fn_h          = reader.ReadByte();
            FM.ST.TA            = reader.ReadInt32();
            FM.ST.TAC           = reader.ReadInt32();
            FM.ST.TB            = reader.ReadByte();
            FM.ST.TBC           = reader.ReadInt32();
            for (i = 0; i < 12; i++)
            {
                FM.OPN.pan[i] = reader.ReadUInt32();
            }
            FM.OPN.eg_cnt            = reader.ReadUInt32();
            FM.OPN.eg_timer          = reader.ReadUInt32();
            FM.OPN.eg_timer_add      = reader.ReadUInt32();
            FM.OPN.eg_timer_overflow = reader.ReadUInt32();
            FM.OPN.lfo_cnt           = reader.ReadInt32();
            FM.OPN.lfo_inc           = reader.ReadInt32();
            for (i = 0; i < 8; i++)
            {
                FM.OPN.lfo_freq[i] = reader.ReadInt32();
            }
            for (i = 0; i < 6; i++)
            {
                for (j = 0; j < 4; j++)
                {
                    FM.SLOT[i,j].KSR        = reader.ReadByte();
                    FM.SLOT[i,j].ar         = reader.ReadInt32();
                    FM.SLOT[i,j].d1r        = reader.ReadInt32();
                    FM.SLOT[i,j].d2r        = reader.ReadInt32();
                    FM.SLOT[i,j].rr         = reader.ReadInt32();
                    FM.SLOT[i,j].ksr        = reader.ReadByte();
                    FM.SLOT[i,j].mul        = reader.ReadInt32();
                    FM.SLOT[i,j].phase      = reader.ReadUInt32();
                    FM.SLOT[i,j].Incr       = reader.ReadInt32();
                    FM.SLOT[i,j].state      = reader.ReadByte();
                    FM.SLOT[i,j].tl         = reader.ReadInt32();
                    FM.SLOT[i,j].volume     = reader.ReadInt32();
                    FM.SLOT[i,j].sl         = reader.ReadInt32();
                    FM.SLOT[i,j].vol_out    = reader.ReadUInt32();
                    FM.SLOT[i,j].eg_sh_ar   = reader.ReadByte();
                    FM.SLOT[i,j].eg_sel_ar  = reader.ReadByte();
                    FM.SLOT[i,j].eg_sh_d1r  = reader.ReadByte();
                    FM.SLOT[i,j].eg_sel_d1r = reader.ReadByte();
                    FM.SLOT[i,j].eg_sh_d2r  = reader.ReadByte();
                    FM.SLOT[i,j].eg_sel_d2r = reader.ReadByte();
                    FM.SLOT[i,j].eg_sh_rr   = reader.ReadByte();
                    FM.SLOT[i,j].eg_sel_rr  = reader.ReadByte();
                    FM.SLOT[i,j].ssg        = reader.ReadByte();
                    FM.SLOT[i,j].ssgn       = reader.ReadByte();
                    FM.SLOT[i,j].key        = reader.ReadUInt32();
                    FM.SLOT[i,j].AMmask     = reader.ReadUInt32();
                }
            }
            for (i = 0; i < 6; i++)
            {
                FM.adpcm[i].flag       = reader.ReadByte();
                FM.adpcm[i].flagMask   = reader.ReadByte();
                FM.adpcm[i].now_data   = reader.ReadByte();
                FM.adpcm[i].now_addr   = reader.ReadUInt32();
                FM.adpcm[i].now_step   = reader.ReadUInt32();
                FM.adpcm[i].step       = reader.ReadUInt32();
                FM.adpcm[i].start      = reader.ReadUInt32();
                FM.adpcm[i].end        = reader.ReadUInt32();
                FM.adpcm[i].IL         = reader.ReadByte();
                FM.adpcm[i].adpcm_acc  = reader.ReadInt32();
                FM.adpcm[i].adpcm_step = reader.ReadInt32();
                FM.adpcm[i].adpcm_out  = reader.ReadInt32();
                FM.adpcm[i].vol_mul    = reader.ReadSByte();
                FM.adpcm[i].vol_shift  = reader.ReadByte();
            }
            for (i = 0; i < 6; i++)
            {
                FM.CH[i].ALGO       = reader.ReadByte();
                FM.CH[i].FB         = reader.ReadByte();
                FM.CH[i].op1_out0   = reader.ReadInt32();
                FM.CH[i].op1_out1   = reader.ReadInt32();
                FM.CH[i].mem_value  = reader.ReadInt32();
                FM.CH[i].pms        = reader.ReadInt32();
                FM.CH[i].ams        = reader.ReadByte();
                FM.CH[i].fc         = reader.ReadUInt32();
                FM.CH[i].kcode      = reader.ReadByte();
                FM.CH[i].block_fnum = reader.ReadUInt32();
            }
            for (i = 0; i < 3; i++)
            {
                FM.SL3.fc[i] = reader.ReadUInt32();
            }
            FM.SL3.fn_h  = reader.ReadByte();
            FM.SL3.kcode = reader.ReadBytes(3);
            for (i = 0; i < 3; i++)
            {
                FM.SL3.block_fnum[i] = reader.ReadUInt32();
            }
            YMDeltat.DELTAT.portstate = reader.ReadByte();
            YMDeltat.DELTAT.now_addr  = reader.ReadInt32();
            YMDeltat.DELTAT.now_step  = reader.ReadInt32();
            YMDeltat.DELTAT.acc       = reader.ReadInt32();
            YMDeltat.DELTAT.prev_acc  = reader.ReadInt32();
            YMDeltat.DELTAT.adpcmd    = reader.ReadInt32();
            YMDeltat.DELTAT.adpcml    = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Sound.latched_value[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 2; i++)
            {
                Sound.utempdata[i] = reader.ReadUInt16();
            }
            Sound.ay8910stream.output_sampindex      = reader.ReadInt32();
            Sound.ay8910stream.output_base_sampindex = reader.ReadInt32();
            Sound.ym2610stream.output_sampindex      = reader.ReadInt32();
            Sound.ym2610stream.output_base_sampindex = reader.ReadInt32();
            Sound.mixerstream.output_sampindex       = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex  = reader.ReadInt32();
            Pd4900a.pd4990a.seconds = reader.ReadInt32();
            Pd4900a.pd4990a.minutes = reader.ReadInt32();
            Pd4900a.pd4990a.hours   = reader.ReadInt32();
            Pd4900a.pd4990a.days    = reader.ReadInt32();
            Pd4900a.pd4990a.month   = reader.ReadInt32();
            Pd4900a.pd4990a.year    = reader.ReadInt32();
            Pd4900a.pd4990a.weekday = reader.ReadInt32();
            Pd4900a.shiftlo         = reader.ReadUInt32();
            Pd4900a.shifthi         = reader.ReadUInt32();
            Pd4900a.retraces        = reader.ReadInt32();
            Pd4900a.testwaits       = reader.ReadInt32();
            Pd4900a.maxwaits        = reader.ReadInt32();
            Pd4900a.testbit         = reader.ReadInt32();
            Pd4900a.outputbit       = reader.ReadInt32();
            Pd4900a.bitno           = reader.ReadInt32();
            Pd4900a.reading         = reader.ReadByte();
            Pd4900a.writting        = reader.ReadByte();
            Pd4900a.clock_line      = reader.ReadInt32();
            Pd4900a.command_line    = reader.ReadInt32();
        }
Example #9
0
        public static void LoadStateBinary(BinaryReader reader)
        {
            int i, j;

            dsw                     = reader.ReadUInt16();
            irqvector               = reader.ReadByte();
            sound_status            = reader.ReadUInt16();
            bankaddress             = reader.ReadInt32();
            m92_irq_vectorbase      = reader.ReadByte();
            m92_raster_irq_position = reader.ReadInt32();
            m92_scanline_param      = reader.ReadInt32();
            setvector_param         = reader.ReadInt32();
            m92_sprite_buffer_busy  = reader.ReadByte();
            for (i = 0; i < 4; i++)
            {
                pf_master_control[i] = reader.ReadUInt16();
            }
            m92_sprite_list   = reader.ReadInt32();
            m92_vram_data     = reader.ReadBytes(0x10000);
            m92_spritecontrol = reader.ReadBytes(0x10);
            m92_game_kludge   = reader.ReadInt32();
            m92_palette_bank  = reader.ReadInt32();
            for (i = 0; i < 3; i++)
            {
                pf_layer[i].vram_base = reader.ReadUInt16();
            }
            for (i = 0; i < 3; i++)
            {
                for (j = 0; j < 4; j++)
                {
                    pf_layer[i].control[j] = reader.ReadUInt16();
                }
            }
            for (i = 0; i < 0x800; i++)
            {
                Generic.paletteram16[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x400; i++)
            {
                Generic.spriteram16[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x400; i++)
            {
                Generic.buffered_spriteram16[i] = reader.ReadUInt16();
            }
            for (i = 0; i < 0x801; i++)
            {
                Palette.entry_color[i] = reader.ReadUInt32();
            }
            Memory.mainram = reader.ReadBytes(0x10000);
            Nec.nn1[0].LoadStateBinary(reader);
            Memory.audioram = reader.ReadBytes(0x4000);
            Nec.nn1[1].LoadStateBinary(reader);
            Cpuint.LoadStateBinary(reader);
            Timer.global_basetime.seconds     = reader.ReadInt32();
            Timer.global_basetime.attoseconds = reader.ReadInt64();
            Video.LoadStateBinary(reader);
            Sound.last_update_second = reader.ReadInt32();
            for (i = 0; i < 2; i++)
            {
                Cpuexec.cpu[i].suspend               = reader.ReadByte();
                Cpuexec.cpu[i].nextsuspend           = reader.ReadByte();
                Cpuexec.cpu[i].eatcycles             = reader.ReadByte();
                Cpuexec.cpu[i].nexteatcycles         = reader.ReadByte();
                Cpuexec.cpu[i].localtime.seconds     = reader.ReadInt32();
                Cpuexec.cpu[i].localtime.attoseconds = reader.ReadInt64();
            }
            Timer.LoadStateBinary(reader);
            YM2151.LoadStateBinary(reader);
            Iremga20.LoadStateBinary(reader);
            Sound.latched_value[0] = reader.ReadUInt16();
            Sound.utempdata[0]     = reader.ReadUInt16();
            Sound.ym2151stream.output_sampindex        = reader.ReadInt32();
            Sound.ym2151stream.output_base_sampindex   = reader.ReadInt32();
            Sound.iremga20stream.output_sampindex      = reader.ReadInt32();
            Sound.iremga20stream.output_base_sampindex = reader.ReadInt32();
            Sound.mixerstream.output_sampindex         = reader.ReadInt32();
            Sound.mixerstream.output_base_sampindex    = reader.ReadInt32();
        }