Example #1
0
 public void serialize(Serializer s)
 {
     //rather than save ~512KB worth of cached tiledata, invalidate it all
     tilevalid[0].Initialize();
     tilevalid[1].Initialize();
     tilevalid[2].Initialize();
 }
Example #2
0
        public void core_serialize(Serializer s)
        {
            s.integer(regs.pc.d, "regs.pc.d");

            s.integer(regs.a.w, "regs.a.w");
            s.integer(regs.x.w, "regs.x.w");
            s.integer(regs.y.w, "regs.y.w");
            s.integer(regs.z.w, "regs.z.w");
            s.integer(regs.s.w, "regs.s.w");
            s.integer(regs.d.w, "regs.d.w");

            s.integer(regs.p.n, "regs.p.n");
            s.integer(regs.p.v, "regs.p.v");
            s.integer(regs.p.m, "regs.p.m");
            s.integer(regs.p.x, "regs.p.x");
            s.integer(regs.p.d, "regs.p.d");
            s.integer(regs.p.i, "regs.p.i");
            s.integer(regs.p.z, "regs.p.z");
            s.integer(regs.p.c, "regs.p.c");

            s.integer(regs.db, "regs.db");
            s.integer(regs.e, "regs.e");
            s.integer(regs.irq, "regs.irq");
            s.integer(regs.wai, "regs.wai");
            s.integer(regs.mdr, "regs.mdr");

            s.integer(aa.d, "aa.d");
            s.integer(rd.d, "rd.d");
            s.integer(sp, "sp");
            s.integer(dp, "dp");

            update_table();
        }
Example #3
0
        public void core_serialize(Serializer s)
        {
            s.integer(regs.pc, "regs.pc");
            s.integer(regs.a.Array[regs.a.Offset], "regs.a");
            s.integer(regs.x.Array[regs.x.Offset], "regs.x");
            s.integer(regs.y.Array[regs.y.Offset], "regs.y");
            s.integer(regs.sp.Array[regs.sp.Offset], "regs.sp");
            s.integer(regs.p.n, "regs.p.n");
            s.integer(regs.p.v, "regs.p.v");
            s.integer(regs.p.p, "regs.p.p");
            s.integer(regs.p.b, "regs.p.b");
            s.integer(regs.p.h, "regs.p.h");
            s.integer(regs.p.i, "regs.p.i");
            s.integer(regs.p.z, "regs.p.z");
            s.integer(regs.p.c, "regs.p.c");

            s.integer(dp, "dp");
            s.integer(sp, "sp");
            s.integer(rd, "rd");
            s.integer(wr, "wr");
            s.integer(bit, "bit");
            s.integer(ya, "ya");
        }
Example #4
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            s.array(samplebuffer, "samplebuffer");

            byte[] state = new byte[5000];
            MemoryStream p = new MemoryStream();
            if (s.mode() == Serializer.Mode.Save)
            {
                spc_dsp.copy_state(p, dsp_state_save);
                p.Position = 0;
                p.Read(state, 0, (int)p.Length);
                s.array(state, (uint)p.Length, "state");
            }
            else if (s.mode() == Serializer.Mode.Load)
            {
                s.array(state, "state");
                p.Write(state, 0, state.Length);
                p.Position = 0;
                spc_dsp.copy_state(p, dsp_state_load);
            }
            else
            {
                s.array(state, "state");
            }
        }
Example #5
0
 public void serialize(Serializer s)
 {
     throw new NotImplementedException();
 }
Example #6
0
            public void serialize(Serializer s)
            {
                s.integer(id, "id");

                s.integer(regs.tiledata_addr, "regs.tiledata_addr");
                s.integer(regs.screen_addr, "regs.screen_addr");
                s.integer(regs.screen_size, "regs.screen_size");
                s.integer(regs.mosaic, "regs.mosaic");
                s.integer(regs.tile_size, "regs.tile_size");

                s.integer(regs.mode, "regs.mode");
                s.integer(regs.priority0, "regs.priority0");
                s.integer(regs.priority1, "regs.priority1");

                s.integer(regs.main_enable, "regs.main_enabled");
                s.integer(regs.sub_enable, "regs.sub_enabled");

                s.integer(regs.hoffset, "regs.hoffset");
                s.integer(regs.voffset, "regs.voffset");

                s.integer(output.main.priority, "output.main.priority");
                s.integer(output.main.palette, "output.main.palette");
                s.integer(output.main.tile, "output.main.tile");

                s.integer(output.sub.priority, "output.sub.priority");
                s.integer(output.sub.palette, "output.sub.palette");
                s.integer(output.sub.tile, "output.sub.tile");

                s.integer(x, "x");
                s.integer(y, "y");

                s.integer(mosaic_vcounter, "mosaic_vcounter");
                s.integer(mosaic_voffset, "mosaic_voffset");
                s.integer(mosaic_hcounter, "mosaic_hcounter");
                s.integer(mosaic_hoffset, "mosaic_hoffset");

                s.integer(mosaic_priority, "mosaic_priority");
                s.integer(mosaic_palette, "mosaic_palette");
                s.integer(mosaic_tile, "mosaic_tile");

                s.integer(tile_counter, "tile_counter");
                s.integer(tile, "tile");
                s.integer(priority, "priority");
                s.integer(palette_number, "palette_number");
                s.integer(palette_index, "palette_index");
                s.array(data, "data");
            }
Example #7
0
 public Serializer(Serializer s)
 {
     Copy(s);
 }
Example #8
0
        private void serialize_all(Serializer s)
        {
            Bus.bus.serialize(s);
            Cartridge.cartridge.serialize(s);
            System.system.serialize(s);
            CPU.cpu.serialize(s);
            SMP.smp.serialize(s);
            PPU.ppu.serialize(s);
            DSP.dsp.serialize(s);

            if (Cartridge.cartridge.mode == Cartridge.Mode.SuperGameBoy)
            {
                SuperGameBoy.supergameboy.serialize(s);
            }
            if (Cartridge.cartridge.has_superfx)
            {
                SuperFX.superfx.serialize(s);
            }
            if (Cartridge.cartridge.has_sa1)
            {
                SA1.sa1.serialize(s);
            }
            if (Cartridge.cartridge.has_srtc)
            {
                SRTC.srtc.serialize(s);
            }
            if (Cartridge.cartridge.has_sdd1)
            {
                SDD1.sdd1.serialize(s);
            }
            if (Cartridge.cartridge.has_spc7110)
            {
                SPC7110.spc7110.serialize(s);
            }
            if (Cartridge.cartridge.has_cx4)
            {
                CX4.cx4.serialize(s);
            }
            if (Cartridge.cartridge.has_dsp1)
            {
                DSP1.dsp1.serialize(s);
            }
            if (Cartridge.cartridge.has_dsp2)
            {
                DSP2.dsp2.serialize(s);
            }
            if (Cartridge.cartridge.has_obc1)
            {
                OBC1.obc1.serialize(s);
            }
            if (Cartridge.cartridge.has_st0010)
            {
                ST0010.st0010.serialize(s);
            }
            if (Cartridge.cartridge.has_msu1)
            {
                MSU1.msu1.serialize(s);
            }
            if (Cartridge.cartridge.has_serial)
            {
                Serial.serial.serialize(s);
            }
        }
Example #9
0
            public void serialize(Serializer s)
            {
                s.integer(regs.addsub_mode, "regs.addsub_mode");
                s.integer(regs.direct_color, "regs.direct_color");

                s.integer(regs.color_mode, "regs.color_mode");
                s.integer(regs.color_halve, "regs.color_halve");
                s.array(regs.color_enable, "regs.color_enable");

                s.integer(regs.color_b, "regs.color_b");
                s.integer(regs.color_g, "regs.color_g");
                s.integer(regs.color_r, "regs.color_r");
                s.integer(regs.color, "regs.color");

                for (uint i = 0; i < 256; i++)
                {
                    s.integer(output.main[i].color, "output.main[i].color");
                    s.integer(output.main[i].priority, "output.main[i].priority");
                    s.integer(output.main[i].source, "output.main[i].source");

                    s.integer(output.sub[i].color, "output.sub[i].color");
                    s.integer(output.sub[i].priority, "output.sub[i].priority");
                    s.integer(output.sub[i].source, "output.sub[i].source");
                }

                window.serialize(s);
            }
Example #10
0
        public bool unserialize(Serializer s)
        {
            uint signature = 0, version = 0, crc32 = 0;
            byte[] profile = new byte[16], description = new byte[512];

            s.integer(signature, "signature");
            s.integer(version, "version");
            s.integer(crc32, "crc32");
            s.array(profile, "profile");
            s.array(description, "description");

            if (signature != 0x31545342)
            {
                return false;
            }
            if (version != Info.SerializerVersion)
            {
                return false;
            }
            if (new UTF8Encoding().GetString(profile, 0, profile.Length) != Info.Profile)
            {
                return false;
            }

            reset();
            serialize_all(s);
            return true;
        }
Example #11
0
 private void serialize(Serializer s)
 {
     s.integer((uint)region, "(unsigned&)region");
     s.integer((uint)expansion, "(unsigned&)expansion");
 }
Example #12
0
        //called once upon cartridge load event: perform dry-run state save.
        //determines exactly how many bytes are needed to save state for this cartridge,
        //as amount varies per game (eg different RAM sizes, special chips, etc.)
        public void serialize_init()
        {
            Serializer s = new Serializer();

            uint signature = 0, version = 0, crc32 = 0;
            byte[] profile = new byte[16], description = new byte[512];

            s.integer(signature, "signature");
            s.integer(version, "version");
            s.integer(crc32, "crc32");
            s.array(profile, "profile");
            s.array(description, "description");

            serialize_all(s);
            serialize_size = s.size();
        }
Example #13
0
        public Serializer serialize()
        {
            Serializer s = new Serializer(serialize_size);

            uint signature = 0x31545342, version = Info.SerializerVersion, crc32 = Cartridge.cartridge.crc32;
            byte[] profile = new byte[16], description = new byte[512];
            new UTF8Encoding().GetBytes(Info.Profile).CopyTo(profile, 0);

            s.integer(signature, "signature");
            s.integer(version, "version");
            s.integer(crc32, "crc32");
            s.array(profile, "profile");
            s.array(description, "description");

            serialize_all(s);
            return s;
        }
Example #14
0
 public void serialize(Serializer s)
 {
     s.integer(basecounter, "basecounter");
     s.integer(heapsize, "heapsize");
     for (uint n = 0; n < heapcapacity; n++)
     {
         s.integer(heap[n].counter, "heap[n].counter");
         s.integer(heap[n].Event, "heap[n].event");
     }
 }
Example #15
0
 public void serialize(Serializer s)
 {
     s.integer(frequency, "frequency");
     s.integer(clock, "clock");
 }
Example #16
0
        public void serialize(Serializer s)
        {
            if (MappedRAM.cartram.size() != 0 && MappedRAM.cartram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.cartram.data(), MappedRAM.cartram.size(), "memory::cartram.data()");
            }

            if (MappedRAM.cartrtc.size() != 0 && MappedRAM.cartrtc.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.cartrtc.data(), MappedRAM.cartrtc.size(), "memory::cartrtc.data()");
            }

            if (MappedRAM.bsxram.size() != 0 && MappedRAM.bsxram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.bsxram.data(), MappedRAM.bsxram.size(), "memory::bsxram.data()");
            }

            if (MappedRAM.bsxpram.size() != 0 && MappedRAM.bsxpram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.bsxpram.data(), MappedRAM.bsxpram.size(), "memory::bsxpram.data()");
            }

            if (MappedRAM.stAram.size() != 0 && MappedRAM.stAram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.stAram.data(), MappedRAM.stAram.size(), "memory::stAram.data()");
            }

            if (MappedRAM.stBram.size() != 0 && MappedRAM.stBram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.stBram.data(), MappedRAM.stBram.size(), "memory::stBram.data()");
            }

            if (MappedRAM.gbram.size() != 0 && MappedRAM.gbram.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.gbram.data(), MappedRAM.gbram.size(), "memory::gbram.data()");
            }

            if (MappedRAM.gbrtc.size() != 0 && MappedRAM.gbrtc.size() != Bit.ToUint32(~0))
            {
                s.array(MappedRAM.gbrtc.data(), MappedRAM.gbrtc.size(), "MappedRAM.gbrtc.data()");
            }
        }
Example #17
0
        public void serialize(Serializer s)
        {
            s.integer(status.interlace, "status.interlace");
            s.integer(status.field, "status.field");
            s.integer(status.vcounter, "status.vcounter");
            s.integer(status.hcounter, "status.hcounter");

            s.array(history.field, "history.field");
            s.array(history.vcounter, "history.vcounter");
            s.array(history.hcounter, "history.hcounter");
            s.integer(history.index, "history.index");
        }
Example #18
0
 public void serialize(Serializer s)
 {
     s.array(StaticRAM.wram.data(), StaticRAM.wram.size(), "memory::wram.data()");
     s.array(StaticRAM.apuram.data(), StaticRAM.apuram.size(), "memory::apuram.data()");
     s.array(StaticRAM.vram.data(), StaticRAM.vram.size(), "memory::vram.data()");
     s.array(StaticRAM.oam.data(), StaticRAM.oam.size(), "memory::oam.data()");
     s.array(StaticRAM.cgram.data(), StaticRAM.cgram.size(), "memory::cgram.data()");
 }
Example #19
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            base.core_serialize(s);
            PPUCounter.serialize(s);
            s.integer(cpu_version, "cpu_version");

            s.integer(status.interrupt_pending, "status.interrupt_pending");
            s.integer(status.interrupt_vector, "status.interrupt_vector");

            s.integer(status.clock_count, "status.clock_count");
            s.integer(status.line_clocks, "status.line_clocks");

            s.integer(status.irq_lock, "status.irq_lock");

            s.integer(status.dram_refresh_position, "status.dram_refresh_position");
            s.integer(status.dram_refreshed, "status.dram_refreshed");

            s.integer(status.hdma_init_position, "status.hdma_init_position");
            s.integer(status.hdma_init_triggered, "status.hdma_init_triggered");

            s.integer(status.hdma_position, "status.hdma_position");
            s.integer(status.hdma_triggered, "status.hdma_triggered");

            s.integer(status.nmi_valid, "status.nmi_valid");
            s.integer(status.nmi_line, "status.nmi_line");
            s.integer(status.nmi_transition, "status.nmi_transition");
            s.integer(status.nmi_pending, "status.nmi_pending");
            s.integer(status.nmi_hold, "status.nmi_hold");

            s.integer(status.irq_valid, "status.irq_valid");
            s.integer(status.irq_line, "status.irq_line");
            s.integer(status.irq_transition, "status.irq_transition");
            s.integer(status.irq_pending, "status.irq_pending");
            s.integer(status.irq_hold, "status.irq_hold");

            s.integer(status.reset_pending, "status.reset_pending");

            s.integer(status.dma_active, "status.dma_active");
            s.integer(status.dma_counter, "status.dma_counter");
            s.integer(status.dma_clocks, "status.dma_clocks");
            s.integer(status.dma_pending, "status.dma_pending");
            s.integer(status.hdma_pending, "status.hdma_pending");
            s.integer(status.hdma_mode, "status.hdma_mode");

            s.array(status.port, "status.port");

            s.integer((uint)status.wram_addr, "status.wram_addr");

            s.integer(status.joypad_strobe_latch, "status.joypad_strobe_latch");
            s.integer(status.joypad1_bits, "status.joypad1_bits");
            s.integer(status.joypad2_bits, "status.joypad2_bits");

            s.integer(status.nmi_enabled, "status.nmi_enabled");
            s.integer(status.hirq_enabled, "status.hirq_enabled");
            s.integer(status.virq_enabled, "status.virq_enabled");
            s.integer(status.auto_joypad_poll, "status.auto_joypad_poll");

            s.integer(status.pio, "status.pio");

            s.integer(status.wrmpya, "status.wrmpya");
            s.integer(status.wrmpyb, "status.wrmpyb");

            s.integer(status.wrdiva, "status.wrdiva");
            s.integer(status.wrdivb, "status.wrdivb");

            s.integer((uint)status.hirq_pos, "status.hirq_pos");
            s.integer((uint)status.virq_pos, "status.virq_pos");

            s.integer(status.rom_speed, "status.rom_speed");

            s.integer(status.rddiv, "status.rddiv");
            s.integer(status.rdmpy, "status.rdmpy");

            s.integer(status.joy1l, "status.joy1l");
            s.integer(status.joy1h, "status.joy1h");
            s.integer(status.joy2l, "status.joy2l");
            s.integer(status.joy2h, "status.joy2h");
            s.integer(status.joy3l, "status.joy3l");
            s.integer(status.joy3h, "status.joy3h");
            s.integer(status.joy4l, "status.joy4l");
            s.integer(status.joy4h, "status.joy4h");

            s.integer(alu.mpyctr, "alu.mpyctr");
            s.integer(alu.divctr, "alu.divctr");
            s.integer(alu.shift, "alu.shift");

            for (uint i = 0; i < 8; i++)
            {
                s.integer(channel[i].dma_enabled, "channel[i].dma_enabled");
                s.integer(channel[i].hdma_enabled, "channel[i].hdma_enabled");
                s.integer(channel[i].direction, "channel[i].direction");
                s.integer(channel[i].indirect, "channel[i].indirect");
                s.integer(channel[i].unused, "channel[i].unused");
                s.integer(channel[i].reverse_transfer, "channel[i].reverse_transfer");
                s.integer(channel[i].fixed_transfer, "channel[i].fixed_transfer");
                s.integer((uint)channel[i].transfer_mode, "channel[i].transfer_mode");
                s.integer(channel[i].dest_addr, "channel[i].dest_addr");
                s.integer(channel[i].source_addr, "channel[i].source_addr");
                s.integer(channel[i].source_bank, "channel[i].source_bank");
                s.integer(channel[i].union.transfer_size, "channel[i].transfer_size");
                s.integer(channel[i].indirect_bank, "channel[i].indirect_bank");
                s.integer(channel[i].hdma_addr, "channel[i].hdma_addr");
                s.integer(channel[i].line_counter, "channel[i].line_counter");
                s.integer(channel[i].unknown, "channel[i].unknown");
                s.integer(channel[i].hdma_completed, "channel[i].hdma_completed");
                s.integer(channel[i].hdma_do_transfer, "channel[i].hdma_do_transfer");
            }

            s.integer(pipe.valid, "pipe.valid");
            s.integer(pipe.addr, "pipe.addr");
            s.integer(pipe.data, "pipe.data");
        }
Example #20
0
            public void serialize(Serializer s)
            {
                for (uint i = 0; i < 128; i++)
                {
                    s.integer(list[i].x, "list[i].x");
                    s.integer(list[i].y, "list[i].y");
                    s.integer(list[i].character, "list[i].character");
                    s.integer(list[i].nameselect, "list[i].nameselect");
                    s.integer(list[i].vflip, "list[i].vflip");
                    s.integer(list[i].hflip, "list[i].hflip");
                    s.integer(list[i].priority, "list[i].priority");
                    s.integer(list[i].palette, "list[i].palette");
                    s.integer(list[i].size, "list[i].size");
                }

                s.integer(t.x, "t.x");
                s.integer(t.y, "t.y");

                s.integer(t.item_count, "t.item_count");
                s.integer(t.tile_count, "t.tile_count");

                s.integer(t.active, "t.active");
                for (uint n = 0; n < 2; n++)
                {
                    s.array(t.item[n], "t.item[n]");
                    for (uint i = 0; i < 34; i++)
                    {
                        s.integer(t.tile[n][i].x, "t.tile[n][i].x");
                        s.integer(t.tile[n][i].priority, "t.tile[n][i].priority");
                        s.integer(t.tile[n][i].palette, "t.tile[n][i].palette");
                        s.integer(t.tile[n][i].hflip, "t.tile[n][i].hflip");
                        s.integer(t.tile[n][i].d0, "t.tile[n][i].d0");
                        s.integer(t.tile[n][i].d1, "t.tile[n][i].d1");
                        s.integer(t.tile[n][i].d2, "t.tile[n][i].d2");
                        s.integer(t.tile[n][i].d3, "t.tile[n][i].d3");
                    }
                }

                s.integer(regs.main_enable, "regs.main_enabled");
                s.integer(regs.sub_enable, "regs.sub_enabled");
                s.integer(regs.interlace, "regs.interlace");

                s.integer(regs.base_size, "regs.base_size");
                s.integer(regs.nameselect, "regs.nameselect");
                s.integer(regs.tiledata_addr, "regs.tiledata_addr");
                s.integer(regs.first_sprite, "regs.first_sprite");

                s.integer(regs.priority0, "regs.priority0");
                s.integer(regs.priority1, "regs.priority1");
                s.integer(regs.priority2, "regs.priority2");
                s.integer(regs.priority3, "regs.priority3");

                s.integer(regs.time_over, "regs.time_over");
                s.integer(regs.range_over, "regs.range_over");

                s.integer(output.main.priority, "output.main.priority");
                s.integer(output.main.palette, "output.main.palette");

                s.integer(output.sub.priority, "output.sub.priority");
                s.integer(output.sub.palette, "output.sub.palette");
            }
Example #21
0
        //copy
        public Serializer Copy(Serializer s)
        {
            imode = s.imode;
            idata = new byte[s.icapacity];
            isize = s.isize;
            icapacity = s.icapacity;

            Array.Copy(s.idata, idata, (int)s.icapacity);
            return this;
        }
Example #22
0
            public void serialize(Serializer s)
            {
                s.integer(regs.priority0, "regs.priority0");
                s.integer(regs.priority1, "regs.priority1");
                s.integer(regs.priority2, "regs.priority2");
                s.integer(regs.priority3, "regs.priority3");

                s.integer(regs.base_size, "regs.base_size");
                s.integer(regs.nameselect, "regs.nameselect");
                s.integer(regs.tiledata_addr, "regs.tiledata_addr");
                s.integer(regs.first_sprite, "regs.first_sprite");

                s.integer(regs.main_enable, "regs.main_enable");
                s.integer(regs.sub_enable, "regs.sub_enable");

                s.integer(regs.interlace, "regs.interlace");

                s.integer(regs.time_over, "regs.time_over");
                s.integer(regs.range_over, "regs.range_over");

                for (uint i = 0; i < 128; i++)
                {
                    s.integer(list[i].width, "list[i].width");
                    s.integer(list[i].height, "list[i].height");
                    s.integer(list[i].x, "list[i].x");
                    s.integer(list[i].y, "list[i].y");
                    s.integer(list[i].character, "list[i].character");
                    s.integer(list[i].use_nameselect, "list[i].use_nameselect");
                    s.integer(list[i].vflip, "list[i].vflip");
                    s.integer(list[i].hflip, "list[i].hflip");
                    s.integer(list[i].palette, "list[i].palette");
                    s.integer(list[i].priority, "list[i].priority");
                    s.integer(list[i].size, "list[i].size");
                }
                s.integer(list_valid, "list_valid");

                s.array(itemlist, "itemlist");
                for (uint i = 0; i < 34; i++)
                {
                    s.integer(tilelist[i].x, "tilelist[i].x");
                    s.integer(tilelist[i].y, "tilelist[i].y");
                    s.integer(tilelist[i].priority, "tilelist[i].priority");
                    s.integer(tilelist[i].palette, "tilelist[i].palette");
                    s.integer(tilelist[i].tile, "tilelist[i].tile");
                    s.integer(tilelist[i].hflip, "tilelist[i].hflip");
                }

                s.array(output.palette, "output.palette");
                s.array(output.priority, "output.priority");

                window.serialize(s);
            }
Example #23
0
            public void serialize(Serializer s)
            {
                s.integer(regs.addsub_mode, "regs.addsub_mode");
                s.integer(regs.direct_color, "regs.direct_color");

                s.integer(regs.color_mode, "regs.color_mode");
                s.integer(regs.color_halve, "regs.color_halve");
                s.integer(regs.bg1_color_enable, "regs.bg1_color_enable");
                s.integer(regs.bg2_color_enable, "regs.bg2_color_enable");
                s.integer(regs.bg3_color_enable, "regs.bg3_color_enable");
                s.integer(regs.bg4_color_enable, "regs.bg4_color_enable");
                s.integer(regs.oam_color_enable, "regs.oam_color_enable");
                s.integer(regs.back_color_enable, "regs.back_color_enable");

                s.integer(regs.color_b, "regs.color_b");
                s.integer(regs.color_g, "regs.color_g");
                s.integer(regs.color_r, "regs.color_r");
            }
Example #24
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);

            s.array(state.regs, 128, "state.regs");
            state.echo_hist[0].serialize(s);
            state.echo_hist[1].serialize(s);
            s.integer(state.echo_hist_pos, "state.echo_hist_pos");

            s.integer(state.every_other_sample, "state.every_other_sample");
            s.integer(state.kon, "state.kon");
            s.integer(state.noise, "state.noise");
            s.integer(state.counter, "state.counter");
            s.integer(state.echo_offset, "state.echo_offset");
            s.integer(state.echo_length, "state.echo_length");

            s.integer(state.new_kon, "state.new_kon");
            s.integer(state.endx_buf, "state.endx_buf");
            s.integer(state.envx_buf, "state.envx_buf");
            s.integer(state.outx_buf, "state.outx_buf");

            s.integer(state.t_pmon, "state.t_pmon");
            s.integer(state.t_non, "state.t_non");
            s.integer(state.t_eon, "state.t_eon");
            s.integer(state.t_dir, "state.t_dir");
            s.integer(state.t_koff, "state.t_koff");

            s.integer(state.t_brr_next_addr, "state.t_brr_next_addr");
            s.integer(state.t_adsr0, "state.t_adsr0");
            s.integer(state.t_brr_header, "state.t_brr_header");
            s.integer(state.t_brr_byte, "state.t_brr_byte");
            s.integer(state.t_srcn, "state.t_srcn");
            s.integer(state.t_esa, "state.t_esa");
            s.integer(state.t_echo_disabled, "state.t_echo_disabled");

            s.integer(state.t_dir_addr, "state.t_dir_addr");
            s.integer(state.t_pitch, "state.t_pitch");
            s.integer(state.t_output, "state.t_output");
            s.integer(state.t_looped, "state.t_looped");
            s.integer(state.t_echo_ptr, "state.t_echo_ptr");

            s.integer(state.t_main_out[0], "state.t_main_out[0]");
            s.integer(state.t_main_out[1], "state.t_main_out[1]");
            s.integer(state.t_echo_out[0], "state.t_echo_out[0]");
            s.integer(state.t_echo_out[1], "state.t_echo_out[1]");
            s.integer(state.t_echo_in[0], "state.t_echo_in [0]");
            s.integer(state.t_echo_in[1], "state.t_echo_in [1]");

            for (uint n = 0; n < 8; n++)
            {
                voice[n].buffer.serialize(s);
                s.integer(voice[n].buf_pos, "voice[n].buf_pos");
                s.integer(voice[n].interp_pos, "voice[n].interp_pos");
                s.integer(voice[n].brr_addr, "voice[n].brr_addr");
                s.integer(voice[n].brr_offset, "voice[n].brr_offset");
                s.integer(voice[n].vbit, "voice[n].vbit");
                s.integer(voice[n].vidx, "voice[n].vidx");
                s.integer(voice[n].kon_delay, "voice[n].kon_delay");
                s.integer(voice[n].env_mode, "voice[n].env_mode");
                s.integer(voice[n].env, "voice[n].env");
                s.integer(voice[n].t_envx_out, "voice[n].t_envx_out");
                s.integer(voice[n].hidden_env, "voice[n].hidden_env");
            }
        }
Example #25
0
            public void serialize(Serializer s)
            {
                s.integer(one_enable, "one_enable");
                s.integer(one_invert, "one_invert");
                s.integer(two_enable, "two_enable");
                s.integer(two_invert, "two_invert");

                s.integer(mask, "mask");

                s.integer(main_mask, "main_mask");
                s.integer(sub_mask, "sub_mask");

                s.array(main, "main");
                s.array(sub, "sub");
            }
Example #26
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            PPUCounter.serialize(s);

            cache.serialize(s);
            bg1.serialize(s);
            bg2.serialize(s);
            bg3.serialize(s);
            bg4.serialize(s);
            oam.serialize(s);
            screen.serialize(s);

            s.integer(display.interlace, "display.interlace");
            s.integer(display.overscan, "display.overscan");
            s.integer(display.width, "display.width");
            s.integer(display.height, "display.height");

            s.integer(regs.ppu1_mdr, "regs.ppu1_mdr");
            s.integer(regs.ppu2_mdr, "regs.ppu2_mdr");

            s.integer(regs.vram_readbuffer, "regs.vram_readbuffer");
            s.integer(regs.oam_latchdata, "regs.oam_latchdata");
            s.integer(regs.cgram_latchdata, "regs.cgram_latchdata");
            s.integer(regs.bgofs_latchdata, "regs.bgofs_latchdata");
            s.integer(regs.mode7_latchdata, "regs.mode7_latchdata");

            s.integer(regs.counters_latched, "regs.counters_latched");
            s.integer(regs.latch_hcounter, "regs.latch_hcounter");
            s.integer(regs.latch_vcounter, "regs.latch_vcounter");

            s.integer(regs.display_disable, "regs.display_disable");
            s.integer(regs.display_brightness, "regs.display_brightness");

            s.integer(regs.oam_baseaddr, "regs.oam_baseaddr");
            s.integer(regs.oam_addr, "regs.oam_addr");
            s.integer(regs.oam_priority, "regs.oam_priority");

            s.integer(regs.bg3_priority, "regs.bg3_priority");
            s.integer(regs.bgmode, "regs.bgmode");

            s.integer(regs.mode7_hoffset, "regs.mode7_hoffset");

            s.integer(regs.mode7_voffset, "regs.mode7_voffset");

            s.integer(regs.vram_incmode, "regs.vram_incmode");
            s.integer(regs.vram_mapping, "regs.vram_mapping");
            s.integer(regs.vram_incsize, "regs.vram_incsize");

            s.integer(regs.vram_addr, "regs.vram_addr");

            s.integer(regs.mode7_repeat, "regs.mode7_repeat");
            s.integer(regs.mode7_vflip, "regs.mode7_vflip");
            s.integer(regs.mode7_hflip, "regs.mode7_hflip");

            s.integer(regs.m7a, "regs.m7a");
            s.integer(regs.m7b, "regs.m7b");
            s.integer(regs.m7c, "regs.m7c");
            s.integer(regs.m7d, "regs.m7d");
            s.integer(regs.m7x, "regs.m7x");
            s.integer(regs.m7y, "regs.m7y");

            s.integer(regs.cgram_addr, "regs.cgram_addr");

            s.integer(regs.window_one_left, "regs.window_one_left");
            s.integer(regs.window_one_right, "regs.window_one_right");
            s.integer(regs.window_two_left, "regs.window_two_left");
            s.integer(regs.window_two_right, "regs.window_two_right");

            s.integer(regs.mode7_extbg, "regs.mode7_extbg");
            s.integer(regs.pseudo_hires, "regs.pseudo_hires");
            s.integer(regs.overscan, "regs.overscan");
            s.integer(regs.interlace, "regs.interlace");

            s.integer(regs.hcounter, "regs.hcounter");

            s.integer(regs.vcounter, "regs.vcounter");
        }
Example #27
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            base.core_serialize(s);
            PPUCounter.serialize(s);

            queue.serialize(s);
            s.array(port_data, "port_data");

            for (uint i = 0; i < 8; i++)
            {
                s.integer(channel[i].dma_enabled, "channel[i].dma_enabled");
                s.integer(channel[i].hdma_enabled, "channel[i].hdma_enabled");

                s.integer(channel[i].direction, "channel[i].direction");
                s.integer(channel[i].indirect, "channel[i].indirect");
                s.integer(channel[i].unused, "channel[i].unused");
                s.integer(channel[i].reverse_transfer, "channel[i].reverse_transfer");
                s.integer(channel[i].fixed_transfer, "channel[i].fixed_transfer");
                s.integer(channel[i].transfer_mode, "channel[i].transfer_mode");

                s.integer(channel[i].dest_addr, "channel[i].dest_addr");
                s.integer(channel[i].source_addr, "channel[i].source_addr");
                s.integer(channel[i].source_bank, "channel[i].source_bank");

                s.integer(channel[i].union.transfer_size, "channel[i].transfer_size");

                s.integer(channel[i].indirect_bank, "channel[i].indirect_bank");
                s.integer(channel[i].hdma_addr, "channel[i].hdma_addr");
                s.integer(channel[i].line_counter, "channel[i].line_counter");
                s.integer(channel[i].unknown, "channel[i].unknown");

                s.integer(channel[i].hdma_completed, "channel[i].hdma_completed");
                s.integer(channel[i].hdma_do_transfer, "channel[i].hdma_do_transfer");
            }

            s.integer(status.nmi_valid, "status.nmi_valid");
            s.integer(status.nmi_line, "status.nmi_line");
            s.integer(status.nmi_transition, "status.nmi_transition");
            s.integer(status.nmi_pending, "status.nmi_pending");

            s.integer(status.irq_valid, "status.irq_valid");
            s.integer(status.irq_line, "status.irq_line");
            s.integer(status.irq_transition, "status.irq_transition");
            s.integer(status.irq_pending, "status.irq_pending");

            s.integer(status.irq_lock, "status.irq_lock");
            s.integer(status.hdma_pending, "status.hdma_pending");

            s.integer(status.wram_addr, "status.wram_addr");

            s.integer(status.joypad_strobe_latch, "status.joypad_strobe_latch");

            s.integer(status.nmi_enabled, "status.nmi_enabled");
            s.integer(status.virq_enabled, "status.virq_enabled");
            s.integer(status.hirq_enabled, "status.hirq_enabled");
            s.integer(status.auto_joypad_poll_enabled, "status.auto_joypad_poll_enabled");

            s.integer(status.pio, "status.pio");

            s.integer(status.wrmpya, "status.wrmpya");
            s.integer(status.wrmpyb, "status.wrmpyb");
            s.integer(status.wrdiva, "status.wrdiva");
            s.integer(status.wrdivb, "status.wrdivb");

            s.integer(status.htime, "status.htime");
            s.integer(status.vtime, "status.vtime");

            s.integer(status.rom_speed, "status.rom_speed");

            s.integer(status.rddiv, "status.rddiv");
            s.integer(status.rdmpy, "status.rdmpy");

            s.integer(status.joy1l, "status.joy1l");
            s.integer(status.joy1h, "status.joy1h");
            s.integer(status.joy2l, "status.joy2l");
            s.integer(status.joy2h, "status.joy2h");
            s.integer(status.joy3l, "status.joy3l");
            s.integer(status.joy3h, "status.joy3h");
            s.integer(status.joy4l, "status.joy4l");
            s.integer(status.joy4h, "status.joy4h");
        }
Example #28
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            base.core_serialize(s);

            s.integer(status.clock_counter, "status.clock_counter");
            s.integer(status.dsp_counter, "status.dsp_counter");
            s.integer(status.timer_step, "status.timer_step");

            s.integer(status.clock_speed, "status.clock_speed");
            s.integer(status.timer_speed, "status.timer_speed");
            s.integer(status.timers_enabled, "status.timers_enabled");
            s.integer(status.ram_disabled, "status.ram_disabled");
            s.integer(status.ram_writable, "status.ram_writable");
            s.integer(status.timers_disabled, "status.timers_disabled");

            s.integer(status.iplrom_enabled, "status.iplrom_enabled");

            s.integer(status.dsp_addr, "status.dsp_addr");

            s.integer(status.ram0, "status.ram0");
            s.integer(status.ram1, "status.ram1");

            s.integer(t0.stage0_ticks, "t0.stage0_ticks");
            s.integer(t0.stage1_ticks, "t0.stage1_ticks");
            s.integer(t0.stage2_ticks, "t0.stage2_ticks");
            s.integer(t0.stage3_ticks, "t0.stage3_ticks");
            s.integer(t0.current_line, "t0.current_line");
            s.integer(t0.enabled, "t0.enabled");
            s.integer(t0.target, "t0.target");

            s.integer(t1.stage0_ticks, "t1.stage0_ticks");
            s.integer(t1.stage1_ticks, "t1.stage1_ticks");
            s.integer(t1.stage2_ticks, "t1.stage2_ticks");
            s.integer(t1.stage3_ticks, "t1.stage3_ticks");
            s.integer(t1.current_line, "t1.current_line");
            s.integer(t1.enabled, "t1.enabled");
            s.integer(t1.target, "t1.target");

            s.integer(t2.stage0_ticks, "t2.stage0_ticks");
            s.integer(t2.stage1_ticks, "t2.stage1_ticks");
            s.integer(t2.stage2_ticks, "t2.stage2_ticks");
            s.integer(t2.stage3_ticks, "t2.stage3_ticks");
            s.integer(t2.current_line, "t2.current_line");
            s.integer(t2.enabled, "t2.enabled");
            s.integer(t2.target, "t2.target");
        }
Example #29
0
        public void serialize(Serializer s)
        {
            Processor.serialize(s);
            PPUCounter.serialize(s);

            s.integer(ppu1_version, "ppu1_version");
            s.integer(ppu2_version, "ppu2_version");

            s.integer(region, "region");
            s.integer(line, "line");

            s.integer(display.interlace, "display.interlace");
            s.integer(display.overscan, "display.overscan");

            s.integer(cache.oam_basesize, "cache.oam_basesize");
            s.integer(cache.oam_nameselect, "cache.oam_nameselect");
            s.integer(cache.oam_tdaddr, "cache.oam_tdaddr");

            s.integer(regs.ppu1_mdr, "regs.ppu1_mdr");
            s.integer(regs.ppu2_mdr, "regs.ppu2_mdr");
            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_y[n], "regs.bg_y[n]");
            }

            s.integer(regs.oam_iaddr, "regs.ioamaddr");
            s.integer(regs.cgram_iaddr, "regs.icgramaddr");

            s.integer(regs.display_disable, "regs.display_disabled");
            s.integer(regs.display_brightness, "regs.display_brightness");

            s.integer(regs.oam_basesize, "regs.oam_basesize");
            s.integer(regs.oam_nameselect, "regs.oam_nameselect");
            s.integer(regs.oam_tdaddr, "regs.oam_tdaddr");

            s.integer(regs.oam_baseaddr, "regs.oam_baseaddr");
            s.integer(regs.oam_addr, "regs.oam_addr");
            s.integer(regs.oam_priority, "regs.oam_priority");
            s.integer(regs.oam_firstsprite, "regs.oam_firstsprite");

            s.integer(regs.oam_latchdata, "regs.oam_latchdata");

            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_tilesize[n], "regs.bg_tilesize[n]");
            }
            s.integer(regs.bg3_priority, "regs.bg3_priority");
            s.integer(regs.bg_mode, "regs.bg_mode");

            s.integer(regs.mosaic_size, "regs.mosaic_size");
            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.mosaic_enabled[n], "regs.mosaic_enabled[n]");
            }
            s.integer(regs.mosaic_countdown, "regs.mosaic_countdown");

            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_scaddr[n], "regs.bg_scaddr[n]");
            }
            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_scsize[n], "regs.bg_scsize[n]");
            }

            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_tdaddr[n], "regs.bg_tdaddr[n]");
            }

            s.integer(regs.bg_ofslatch, "regs.bg_ofslatch");
            s.integer(regs.m7_hofs, "regs.m7_hofs");
            s.integer(regs.m7_vofs, "regs.m7_vofs");
            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_hofs[n], "regs.bg_hofs[n]");
            }
            for (uint n = 0; n < 4; n++)
            {
                s.integer(regs.bg_vofs[n], "regs.bg_vofs[n]");
            }

            s.integer(regs.vram_incmode, "regs.vram_incmode");
            s.integer(regs.vram_mapping, "regs.vram_mapping");
            s.integer(regs.vram_incsize, "regs.vram_incsize");

            s.integer(regs.vram_addr, "regs.vram_addr");

            s.integer(regs.mode7_repeat, "regs.mode7_repeat");
            s.integer(regs.mode7_vflip, "regs.mode7_vflip");
            s.integer(regs.mode7_hflip, "regs.mode7_hflip");

            s.integer(regs.m7_latch, "regs.m7_latch");
            s.integer(regs.m7a, "regs.m7a");
            s.integer(regs.m7b, "regs.m7b");
            s.integer(regs.m7c, "regs.m7c");
            s.integer(regs.m7d, "regs.m7d");
            s.integer(regs.m7x, "regs.m7x");
            s.integer(regs.m7y, "regs.m7y");

            s.integer(regs.cgram_addr, "regs.cgram_addr");

            s.integer(regs.cgram_latchdata, "regs.cgram_latchdata");

            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.window1_enabled[n], "regs.window1_enabled[n]");
            }
            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.window1_invert[n], "regs.window1_invert [n]");
            }
            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.window2_enabled[n], "regs.window2_enabled[n]");
            }
            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.window2_invert[n], "regs.window2_invert [n]");
            }

            s.integer(regs.window1_left, "regs.window1_left");
            s.integer(regs.window1_right, "regs.window1_right");
            s.integer(regs.window2_left, "regs.window2_left");
            s.integer(regs.window2_right, "regs.window2_right");

            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.window_mask[n], "regs.window_mask[n]");
            }
            for (uint n = 0; n < 5; n++)
            {
                s.integer(regs.bg_enabled[n], "regs.bg_enabled[n]");
            }
            for (uint n = 0; n < 5; n++)
            {
                s.integer(regs.bgsub_enabled[n], "regs.bgsub_enabled[n]");
            }
            for (uint n = 0; n < 5; n++)
            {
                s.integer(regs.window_enabled[n], "regs.window_enabled[n]");
            }
            for (uint n = 0; n < 5; n++)
            {
                s.integer(regs.sub_window_enabled[n], "regs.sub_window_enabled[n]");
            }

            s.integer(regs.color_mask, "regs.color_mask");
            s.integer(regs.colorsub_mask, "regs.colorsub_mask");
            s.integer(regs.addsub_mode, "regs.addsub_mode");
            s.integer(regs.direct_color, "regs.direct_color");

            s.integer(regs.color_mode, "regs.color_mode");
            s.integer(regs.color_halve, "regs.color_halve");
            for (uint n = 0; n < 6; n++)
            {
                s.integer(regs.color_enabled[n], "regs.color_enabled[n]");
            }

            s.integer(regs.color_r, "regs.color_r");
            s.integer(regs.color_g, "regs.color_g");
            s.integer(regs.color_b, "regs.color_b");
            s.integer(regs.color_rgb, "regs.color_rgb");

            s.integer(regs.mode7_extbg, "regs.mode7_extbg");
            s.integer(regs.pseudo_hires, "regs.pseudo_hires");
            s.integer(regs.overscan, "regs.overscan");
            s.integer(regs.scanlines, "regs.scanlines");
            s.integer(regs.oam_interlace, "regs.oam_interlace");
            s.integer(regs.interlace, "regs.interlace");

            s.integer(regs.hcounter, "regs.hcounter");
            s.integer(regs.vcounter, "regs.vcounter");
            s.integer(regs.latch_hcounter, "regs.latch_hcounter");
            s.integer(regs.latch_vcounter, "regs.latch_vcounter");
            s.integer(regs.counters_latched, "regs.counters_latched");

            s.integer(regs.vram_readbuffer, "regs.vram_readbuffer");

            s.integer(regs.time_over, "regs.time_over");
            s.integer(regs.range_over, "regs.range_over");
            s.integer(regs.oam_itemcount, "regs.oam_itemcount");
            s.integer(regs.oam_tilecount, "regs.oam_tilecount");

            for (uint n = 0; n < 256; n++)
            {
                s.integer(pixel_cache[n].src_main, "pixel_cache[n].src_main");
                s.integer(pixel_cache[n].src_sub, "pixel_cache[n].src_sub");
                s.integer(pixel_cache[n].bg_main, "pixel_cache[n].bg_main");
                s.integer(pixel_cache[n].bg_sub, "pixel_cache[n].bg_sub");
                s.integer(pixel_cache[n].ce_main, "pixel_cache[n].ce_main");
                s.integer(pixel_cache[n].ce_sub, "pixel_cache[n].ce_sub");
                s.integer(pixel_cache[n].pri_main, "pixel_cache[n].pri_main");
                s.integer(pixel_cache[n].pri_sub, "pixel_cache[n].pri_sub");
            }

            //better to just take a small speed hit than store all of bg_tiledata[3][] ...
            flush_tiledata_cache();

            for (uint n = 0; n < 6; n++)
            {
                s.array(window[n].main, 256, "window[n].main");
                s.array(window[n].sub, 256, "window[n].sub");
            }

            for (uint n = 0; n < 4; n++)
            {
                s.integer(bg_info[n].tw, "bg_info[n].tw");
                s.integer(bg_info[n].th, "bg_info[n].th");
                s.integer(bg_info[n].mx, "bg_info[n].mx");
                s.integer(bg_info[n].my, "bg_info[n].my");
                s.integer(bg_info[n].scx, "bg_info[n].scx");
                s.integer(bg_info[n].scy, "bg_info[n].scy");
            }

            for (uint n = 0; n < 128; n++)
            {
                s.integer(sprite_list[n].width, "sprite_list[n].width");
                s.integer(sprite_list[n].height, "sprite_list[n].height");
                s.integer(sprite_list[n].x, "sprite_list[n].x");
                s.integer(sprite_list[n].y, "sprite_list[n].y");
                s.integer(sprite_list[n].character, "sprite_list[n].character");
                s.integer(sprite_list[n].use_nameselect, "sprite_list[n].use_nameselect");
                s.integer(sprite_list[n].vflip, "sprite_list[n].vflip");
                s.integer(sprite_list[n].hflip, "sprite_list[n].hflip");
                s.integer(sprite_list[n].palette, "sprite_list[n].palette");
                s.integer(sprite_list[n].priority, "sprite_list[n].priority");
                s.integer(sprite_list[n].size, "sprite_list[n].size");
            }
            s.integer(sprite_list_valid, "sprite_list_valid");
            s.integer(active_sprite, "active_sprite");

            s.array(oam_itemlist, 32, "oam_itemlist");

            for (uint n = 0; n < 34; n++)
            {
                s.integer(oam_tilelist[n].x, "oam_tilelist[n].x");
                s.integer(oam_tilelist[n].y, "oam_tilelist[n].y");
                s.integer(oam_tilelist[n].pri, "oam_tilelist[n].pri");
                s.integer(oam_tilelist[n].pal, "oam_tilelist[n].pal");
                s.integer(oam_tilelist[n].tile, "oam_tilelist[n].tile");
                s.integer(oam_tilelist[n].hflip, "oam_tilelist[n].hflip");
            }

            s.array(oam_line_pal, 256, "oam_line_pal");
            s.array(oam_line_pri, 256, "oam_line_pri");
        }
Example #30
0
            public void serialize(Serializer s)
            {
                s.integer(regs.bg1_one_enable, "regs.bg1_one_enable");
                s.integer(regs.bg1_one_invert, "regs.bg1_one_invert");
                s.integer(regs.bg1_two_enable, "regs.bg1_two_enable");
                s.integer(regs.bg1_two_invert, "regs.bg1_two_invert");

                s.integer(regs.bg2_one_enable, "regs.bg2_one_enable");
                s.integer(regs.bg2_one_invert, "regs.bg2_one_invert");
                s.integer(regs.bg2_two_enable, "regs.bg2_two_enable");
                s.integer(regs.bg2_two_invert, "regs.bg2_two_invert");

                s.integer(regs.bg3_one_enable, "regs.bg3_one_enable");
                s.integer(regs.bg3_one_invert, "regs.bg3_one_invert");
                s.integer(regs.bg3_two_enable, "regs.bg3_two_enable");
                s.integer(regs.bg3_two_invert, "regs.bg3_two_invert");

                s.integer(regs.bg4_one_enable, "regs.bg4_one_enable");
                s.integer(regs.bg4_one_invert, "regs.bg4_one_invert");
                s.integer(regs.bg4_two_enable, "regs.bg4_two_enable");
                s.integer(regs.bg4_two_invert, "regs.bg4_two_invert");

                s.integer(regs.oam_one_enable, "regs.oam_one_enable");
                s.integer(regs.oam_one_invert, "regs.oam_one_invert");
                s.integer(regs.oam_two_enable, "regs.oam_two_enable");
                s.integer(regs.oam_two_invert, "regs.oam_two_invert");

                s.integer(regs.col_one_enable, "regs.col_one_enable");
                s.integer(regs.col_one_invert, "regs.col_one_invert");
                s.integer(regs.col_two_enable, "regs.col_two_enable");
                s.integer(regs.col_two_invert, "regs.col_two_invert");

                s.integer(regs.one_left, "regs.one_left");
                s.integer(regs.one_right, "regs.one_right");
                s.integer(regs.two_left, "regs.two_left");
                s.integer(regs.two_right, "regs.two_right");

                s.integer(regs.bg1_mask, "regs.bg1_mask");
                s.integer(regs.bg2_mask, "regs.bg2_mask");
                s.integer(regs.bg3_mask, "regs.bg3_mask");
                s.integer(regs.bg4_mask, "regs.bg4_mask");
                s.integer(regs.oam_mask, "regs.oam_mask");
                s.integer(regs.col_mask, "regs.col_mask");

                s.integer(regs.bg1_main_enable, "regs.bg1_main_enable");
                s.integer(regs.bg1_sub_enable, "regs.bg1_sub_enable");
                s.integer(regs.bg2_main_enable, "regs.bg2_main_enable");
                s.integer(regs.bg2_sub_enable, "regs.bg2_sub_enable");
                s.integer(regs.bg3_main_enable, "regs.bg3_main_enable");
                s.integer(regs.bg3_sub_enable, "regs.bg3_sub_enable");
                s.integer(regs.bg4_main_enable, "regs.bg4_main_enable");
                s.integer(regs.bg4_sub_enable, "regs.bg4_sub_enable");
                s.integer(regs.oam_main_enable, "regs.oam_main_enable");
                s.integer(regs.oam_sub_enable, "regs.oam_sub_enable");

                s.integer(regs.col_main_mask, "regs.col_main_mask");
                s.integer(regs.col_sub_mask, "regs.col_sub_mask");

                s.integer(output.main.color_enable, "output.main.color_enable");
                s.integer(output.sub.color_enable, "output.sub.color_enable");

                s.integer(x, "x");
                s.integer(one, "one");
                s.integer(two, "two");
            }