Beispiel #1
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();
        }
Beispiel #2
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();
        }