diff --git a/QtCore4.dll b/QtCore4.dll new file mode 100644 index 00000000..1cbd0974 Binary files /dev/null and b/QtCore4.dll differ diff --git a/QtGui4.dll b/QtGui4.dll new file mode 100644 index 00000000..dd3d7c13 Binary files /dev/null and b/QtGui4.dll differ diff --git a/bsnes-debugger.exe b/bsnes-debugger.exe new file mode 100644 index 00000000..273b7fcb Binary files /dev/null and b/bsnes-debugger.exe differ diff --git a/bsnes.exe b/bsnes.exe new file mode 100644 index 00000000..d887ed94 Binary files /dev/null and b/bsnes.exe differ diff --git a/src/Makefile b/bsnes/Makefile similarity index 92% rename from src/Makefile rename to bsnes/Makefile index 25f28053..816299b2 100644 --- a/src/Makefile +++ b/bsnes/Makefile @@ -8,8 +8,8 @@ include lib/nall/qt/Makefile ### compiler ### ################ -c := $(compiler) -cpp := $(subst cc,++,$(compiler)) +c := $(compiler) --std=gnu99 +cpp := $(subst cc,++,$(compiler)) -std=gnu++0x flags := -O3 -fomit-frame-pointer -Ilib link := @@ -25,7 +25,7 @@ link := ################ ifeq ($(platform),x) - link += -s + link += -s -ldl -lX11 -lXext ruby := video.glx video.xv video.qtraster video.sdl ruby += audio.alsa audio.openal audio.oss audio.pulseaudio audio.pulseaudiosimple audio.ao @@ -70,7 +70,8 @@ link += $(if $(findstring video.xv,$(ruby)),-lXv) link += $(if $(findstring audio.alsa,$(ruby)),-lasound) link += $(if $(findstring audio.ao,$(ruby)),-lao) link += $(if $(findstring audio.directsound,$(ruby)),-ldsound) -link += $(if $(findstring audio.pulseaudio,$(ruby)),-lpulse-simple) +link += $(if $(findstring audio.pulseaudio,$(ruby)),-lpulse) +link += $(if $(findstring audio.pulseaudiosimple,$(ruby)),-lpulse-simple) link += $(if $(findstring input.directinput,$(ruby)),-ldinput8 -ldxguid) link += $(if $(findstring input.rawinput,$(ruby)),-ldinput8 -ldxguid) @@ -82,8 +83,8 @@ objects := libco ruby objects += system cartridge cheat objects += memory smemory cpu cpucore scpu smp smpcore ssmp dsp sdsp ppu bppu objects += supergameboy superfx sa1 -objects += bsx srtc sdd1 spc7110 cx4 dsp1 dsp2 dsp3 dsp4 obc1 st010 st011 st018 -objects += msu +objects += bsx srtc sdd1 spc7110 cx4 dsp1 dsp2 dsp3 dsp4 obc1 st0010 st0011 st0018 +objects += msu1 ###################### ### implicit rules ### @@ -183,10 +184,10 @@ obj/dsp2.o : chip/dsp2/dsp2.cpp chip/dsp2/* obj/dsp3.o : chip/dsp3/dsp3.cpp chip/dsp3/* obj/dsp4.o : chip/dsp4/dsp4.cpp chip/dsp4/* obj/obc1.o : chip/obc1/obc1.cpp chip/obc1/* -obj/st010.o : chip/st010/st010.cpp chip/st010/* -obj/st011.o : chip/st011/st011.cpp chip/st011/* -obj/st018.o : chip/st018/st018.cpp chip/st018/* -obj/msu.o : chip/msu/msu.cpp chip/msu/* +obj/st0010.o : chip/st0010/st0010.cpp chip/st0010/* +obj/st0011.o : chip/st0011/st0011.cpp chip/st0011/* +obj/st0018.o : chip/st0018/st0018.cpp chip/st0018/* +obj/msu1.o : chip/msu1/msu1.cpp chip/msu1/* ############### ### targets ### diff --git a/src/base.hpp b/bsnes/base.hpp similarity index 90% rename from src/base.hpp rename to bsnes/base.hpp index 6e841e23..3784c2b2 100644 --- a/src/base.hpp +++ b/bsnes/base.hpp @@ -1,6 +1,6 @@ -static const char bsnesVersion[] = "060"; +static const char bsnesVersion[] = "061"; static const char bsnesTitle[] = "bsnes"; -static const unsigned bsnesSerializerVersion = 4; +static const unsigned bsnesSerializerVersion = 5; //S-DSP can be encapsulated into a state machine using #define magic //this avoids ~2.048m co_switch() calls per second (~5% speedup) @@ -22,6 +22,7 @@ static const unsigned bsnesSerializerVersion = 4; #include #include #include +#include #include #include #include diff --git a/src/cartridge/cartridge.cpp b/bsnes/cartridge/cartridge.cpp similarity index 57% rename from src/cartridge/cartridge.cpp rename to bsnes/cartridge/cartridge.cpp index c0bbb0cc..d55045df 100644 --- a/src/cartridge/cartridge.cpp +++ b/bsnes/cartridge/cartridge.cpp @@ -5,8 +5,7 @@ #define CARTRIDGE_CPP namespace SNES { -#include "header.cpp" -#include "gameboyheader.cpp" +#include "xml.cpp" #include "serialization.cpp" namespace memory { @@ -19,9 +18,32 @@ namespace memory { Cartridge cartridge; -void Cartridge::load(Mode cartridge_mode) { +void Cartridge::load(Mode cartridge_mode, const lstring &xml_list) { + spc7110_data_rom_offset = 0x100000; + supergameboy_version = SuperGameBoyVersion::Version1; + supergameboy_ram_size = 0; + supergameboy_rtc_size = 0; + + has_bsx_slot = false; + has_superfx = false; + has_sa1 = false; + has_srtc = false; + has_sdd1 = false; + has_spc7110 = false; + has_spc7110rtc = false; + has_cx4 = false; + has_dsp1 = false; + has_dsp2 = false; + has_dsp3 = false; + has_dsp4 = false; + has_obc1 = false; + has_st0010 = false; + has_st0011 = false; + has_st0018 = false; + has_msu1 = false; + mode = cartridge_mode; - read_header(memory::cartrom.data(), memory::cartrom.size()); + parse_xml(xml_list); if(ram_size > 0) { memory::cartram.map(allocate(ram_size, 0xff), ram_size); @@ -31,23 +53,20 @@ void Cartridge::load(Mode cartridge_mode) { memory::cartrtc.map(allocate(20, 0xff), 20); } - if(mode == ModeBsx) { + if(mode == Mode::Bsx) { memory::bsxram.map (allocate( 32 * 1024, 0xff), 32 * 1024); memory::bsxpram.map(allocate(512 * 1024, 0xff), 512 * 1024); } - if(mode == ModeSufamiTurbo) { + if(mode == Mode::SufamiTurbo) { if(memory::stArom.data()) memory::stAram.map(allocate(128 * 1024, 0xff), 128 * 1024); if(memory::stBrom.data()) memory::stBram.map(allocate(128 * 1024, 0xff), 128 * 1024); } - if(mode == ModeSuperGameBoy) { + if(mode == Mode::SuperGameBoy) { if(memory::gbrom.data()) { - unsigned ram_size = gameboy_ram_size(); - unsigned rtc_size = gameboy_rtc_size(); - - if(ram_size) memory::gbram.map(allocate(ram_size, 0xff), ram_size); - if(rtc_size) memory::gbrtc.map(allocate(rtc_size, 0x00), rtc_size); + if(supergameboy_ram_size) memory::gbram.map(allocate(supergameboy_ram_size, 0xff), supergameboy_ram_size); + if(supergameboy_rtc_size) memory::gbrtc.map(allocate(supergameboy_rtc_size, 0x00), supergameboy_rtc_size); } } @@ -65,21 +84,13 @@ void Cartridge::load(Mode cartridge_mode) { memory::gbram.write_protect(false); memory::gbrtc.write_protect(false); - unsigned checksum = ~0; - for(unsigned n = 0; n < memory::cartrom.size(); n++) checksum = crc32_adjust(checksum, memory::cartrom[n]); - if(memory::bsxflash.size() != 0 && memory::bsxflash.size() != ~0) - for(unsigned n = 0; n < memory::bsxflash.size(); n++) checksum = crc32_adjust(checksum, memory::bsxflash[n]); - if(memory::stArom.size() != 0 && memory::stArom.size() != ~0) - for(unsigned n = 0; n < memory::stArom.size(); n++) checksum = crc32_adjust(checksum, memory::stArom[n]); - if(memory::stBrom.size() != 0 && memory::stBrom.size() != ~0) - for(unsigned n = 0; n < memory::stBrom.size(); n++) checksum = crc32_adjust(checksum, memory::stBrom[n]); - if(memory::gbrom.size() != 0 && memory::gbrom.size() != ~0) - for(unsigned n = 0; n < memory::gbrom.size(); n++) checksum = crc32_adjust(checksum, memory::gbrom[n]); + unsigned checksum = ~0; foreach(n, memory::cartrom ) checksum = crc32_adjust(checksum, n); + if(memory::bsxflash.size() != 0 && memory::bsxflash.size() != ~0) foreach(n, memory::bsxflash) checksum = crc32_adjust(checksum, n); + if(memory::stArom.size() != 0 && memory::stArom.size() != ~0) foreach(n, memory::stArom ) checksum = crc32_adjust(checksum, n); + if(memory::stBrom.size() != 0 && memory::stBrom.size() != ~0) foreach(n, memory::stBrom ) checksum = crc32_adjust(checksum, n); + if(memory::gbrom.size() != 0 && memory::gbrom.size() != ~0) foreach(n, memory::gbrom ) checksum = crc32_adjust(checksum, n); crc32 = ~checksum; -#if 0 - fprintf(stdout, "crc32 = %.8x\n", (unsigned)crc32); - sha256_ctx sha; uint8_t shahash[32]; sha256_init(&sha); @@ -87,10 +98,9 @@ void Cartridge::load(Mode cartridge_mode) { sha256_final(&sha); sha256_hash(&sha, shahash); - fprintf(stdout, "sha256 = "); - for(unsigned i = 0; i < 32; i++) fprintf(stdout, "%.2x", shahash[i]); - fprintf(stdout, "\n"); -#endif + string hash; + foreach(n, shahash) hash << strhex<2>(n); + sha256 = hash; bus.load_cart(); system.serialize_init(); @@ -117,10 +127,6 @@ void Cartridge::unload() { loaded = false; } -bool Cartridge::has_msu() const { - return msu.exists(); -} - Cartridge::Cartridge() { loaded = false; unload(); diff --git a/bsnes/cartridge/cartridge.hpp b/bsnes/cartridge/cartridge.hpp new file mode 100644 index 00000000..063f9680 --- /dev/null +++ b/bsnes/cartridge/cartridge.hpp @@ -0,0 +1,111 @@ +class Cartridge : property { +public: + enum class Mode : unsigned { + Normal, + BsxSlotted, + Bsx, + SufamiTurbo, + SuperGameBoy, + }; + + enum class Region : unsigned { + NTSC, + PAL, + }; + + enum class SuperGameBoyVersion : unsigned { + Version1, + Version2, + }; + + readonly loaded; + readonly crc32; + readonly sha256; + + readonly mode; + readonly region; + readonly ram_size; + readonly spc7110_data_rom_offset; + readonly supergameboy_version; + readonly supergameboy_ram_size; + readonly supergameboy_rtc_size; + + readonly has_bsx_slot; + readonly has_superfx; + readonly has_sa1; + readonly has_srtc; + readonly has_sdd1; + readonly has_spc7110; + readonly has_spc7110rtc; + readonly has_cx4; + readonly has_dsp1; + readonly has_dsp2; + readonly has_dsp3; + readonly has_dsp4; + readonly has_obc1; + readonly has_st0010; + readonly has_st0011; + readonly has_st0018; + readonly has_msu1; + + struct Mapping { + Memory *memory; + MMIO *mmio; + Bus::MapMode mode; + unsigned banklo; + unsigned bankhi; + unsigned addrlo; + unsigned addrhi; + unsigned offset; + unsigned size; + + Mapping(); + Mapping(Memory&); + Mapping(MMIO&); + }; + array mapping; + + void load(Mode, const lstring&); + void unload(); + + void serialize(serializer&); + Cartridge(); + ~Cartridge(); + +private: + void parse_xml(const lstring&); + void parse_xml_cartridge(const char*); + void parse_xml_bsx(const char*); + void parse_xml_sufami_turbo(const char*, bool); + void parse_xml_gameboy(const char*); + + void xml_parse_rom(xml_element*); + void xml_parse_ram(xml_element*); + void xml_parse_superfx(xml_element*); + void xml_parse_sa1(xml_element*); + void xml_parse_bsx(xml_element*); + void xml_parse_sufamiturbo(xml_element*); + void xml_parse_supergameboy(xml_element*); + void xml_parse_srtc(xml_element*); + void xml_parse_sdd1(xml_element*); + void xml_parse_spc7110(xml_element*); + void xml_parse_cx4(xml_element*); + void xml_parse_necdsp(xml_element*); + void xml_parse_obc1(xml_element*); + void xml_parse_setadsp(xml_element*); + void xml_parse_setarisc(xml_element*); + void xml_parse_msu1(xml_element*); + + void xml_parse_address(Mapping&, const string&); + void xml_parse_mode(Mapping&, const string&); +}; + +namespace memory { + extern MappedRAM cartrom, cartram, cartrtc; + extern MappedRAM bsxflash, bsxram, bsxpram; + extern MappedRAM stArom, stAram; + extern MappedRAM stBrom, stBram; + extern MappedRAM gbrom, gbram, gbrtc; +}; + +extern Cartridge cartridge; diff --git a/src/cartridge/serialization.cpp b/bsnes/cartridge/serialization.cpp similarity index 100% rename from src/cartridge/serialization.cpp rename to bsnes/cartridge/serialization.cpp diff --git a/bsnes/cartridge/xml.cpp b/bsnes/cartridge/xml.cpp new file mode 100644 index 00000000..46e30101 --- /dev/null +++ b/bsnes/cartridge/xml.cpp @@ -0,0 +1,655 @@ +#ifdef CARTRIDGE_CPP + +void Cartridge::parse_xml(const lstring &list) { + parse_xml_cartridge(list[0]); + + if(mode == Mode::BsxSlotted) { + parse_xml_bsx(list[1]); + } else if(mode == Mode::Bsx) { + parse_xml_bsx(list[1]); + } else if(mode == Mode::SufamiTurbo) { + parse_xml_sufami_turbo(list[1], 0); + parse_xml_sufami_turbo(list[2], 1); + } else if(mode == Mode::SuperGameBoy) { + parse_xml_gameboy(list[1]); + } +} + +void Cartridge::parse_xml_cartridge(const char *data) { + xml_element *document = xml_parse(data); + if(document == 0) return; + + foreach(head, document->element) { + if(head->name == "cartridge") { + foreach(attr, head->attribute) { + if(attr->name == "region") { + if(attr->content == "NTSC") region = Region::NTSC; + if(attr->content == "PAL") region = Region::PAL; + } + } + + foreach(node, head->element) { + if(node->name == "rom") xml_parse_rom(node); + if(node->name == "ram") xml_parse_ram(node); + if(node->name == "superfx") xml_parse_superfx(node); + if(node->name == "sa1") xml_parse_sa1(node); + if(node->name == "bsx") xml_parse_bsx(node); + if(node->name == "sufamiturbo") xml_parse_sufamiturbo(node); + if(node->name == "supergameboy") xml_parse_supergameboy(node); + if(node->name == "srtc") xml_parse_srtc(node); + if(node->name == "sdd1") xml_parse_sdd1(node); + if(node->name == "spc7110") xml_parse_spc7110(node); + if(node->name == "cx4") xml_parse_cx4(node); + if(node->name == "necdsp") xml_parse_necdsp(node); + if(node->name == "obc1") xml_parse_obc1(node); + if(node->name == "setadsp") xml_parse_setadsp(node); + if(node->name == "setarisc") xml_parse_setarisc(node); + if(node->name == "msu1") xml_parse_msu1(node); + } + } + } +} + +void Cartridge::parse_xml_bsx(const char *data) { +} + +void Cartridge::parse_xml_sufami_turbo(const char *data, bool slot) { +} + +void Cartridge::parse_xml_gameboy(const char *data) { + xml_element *document = xml_parse(data); + if(document == 0) return; + + foreach(head, document->element) { + if(head->name == "cartridge") { + foreach(attr, head->attribute) { + if(attr->name == "rtc") { + supergameboy_rtc_size = (attr->content == "true") ? 4 : 0; + } + } + + foreach(leaf, head->element) { + if(leaf->name == "ram") { + foreach(attr, leaf->attribute) { + if(attr->name == "size") { + supergameboy_ram_size = strhex(attr->content); + } + } + } + } + } + } + + delete document; +} + +void Cartridge::xml_parse_rom(xml_element *root) { + foreach(leaf, root->element) { + if(leaf->name == "map") { + Mapping m(memory::cartrom); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } +} + +void Cartridge::xml_parse_ram(xml_element *root) { + foreach(attr, root->attribute) { + if(attr->name == "size") ram_size = strhex(attr->content); + } + + foreach(leaf, root->element) { + if(leaf->name == "map") { + Mapping m(memory::cartram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } +} + +void Cartridge::xml_parse_superfx(xml_element *root) { + has_superfx = true; + + foreach(node, root->element) { + if(node->name == "rom") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::fxrom); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "ram") { + foreach(attr, node->attribute) { + if(attr->name == "size") ram_size = strhex(attr->content); + } + + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::fxram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(superfx); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_sa1(xml_element *root) { + has_sa1 = true; + + foreach(node, root->element) { + if(node->name == "rom") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::vsprom); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "iram") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::cpuiram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "bwram") { + foreach(attr, node->attribute) { + if(attr->name == "size") ram_size = strhex(attr->content); + } + + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::cc1bwram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(sa1); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_bsx(xml_element *root) { + foreach(node, root->element) { + if(node->name == "slot") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(memory::bsxflash); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(bsxcart); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_sufamiturbo(xml_element *root) { + foreach(node, root->element) { + if(node->name == "slot") { + bool slotid = 0; + foreach(attr, node->attribute) { + if(attr->name == "id") { + if(attr->content == "A") slotid = 0; + if(attr->content == "B") slotid = 1; + } + } + + foreach(slot, node->element) { + if(slot->name == "rom") { + foreach(leaf, slot->element) { + if(leaf->name == "map") { + Mapping m(slotid == 0 ? memory::stArom : memory::stBrom); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + if(m.memory->size() > 0) mapping.add(m); + } + } + } else if(slot->name == "ram") { + foreach(leaf, slot->element) { + if(leaf->name == "map") { + Mapping m(slotid == 0 ? memory::stAram : memory::stBram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + if(m.memory->size() > 0) mapping.add(m); + } + } + } + } + } + } +} + +void Cartridge::xml_parse_supergameboy(xml_element *root) { + foreach(attr, root->attribute) { + if(attr->name == "revision") { + if(attr->content == "1") supergameboy_version = SuperGameBoyVersion::Version1; + if(attr->content == "2") supergameboy_version = SuperGameBoyVersion::Version2; + } + } + + foreach(node, root->element) { + if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m((Memory&)supergameboy); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_srtc(xml_element *root) { + has_srtc = true; + + foreach(node, root->element) { + if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(srtc); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_sdd1(xml_element *root) { + has_sdd1 = true; + + foreach(node, root->element) { + if(node->name == "mcu") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m((Memory&)sdd1); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m((MMIO&)sdd1); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_spc7110(xml_element *root) { + has_spc7110 = true; + + foreach(node, root->element) { + if(node->name == "dcu") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(spc7110dcu); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mcu") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(spc7110mcu); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "offset") spc7110_data_rom_offset = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(spc7110); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "ram") { + foreach(attr, node->attribute) { + if(attr->name == "size") ram_size = strhex(attr->content); + } + + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(spc7110ram); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + if(attr->name == "mode") xml_parse_mode(m, attr->content); + if(attr->name == "offset") m.offset = strhex(attr->content); + if(attr->name == "size") m.size = strhex(attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "rtc") { + has_spc7110rtc = true; + + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(spc7110); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_cx4(xml_element *root) { + has_cx4 = true; + + foreach(node, root->element) { + if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(cx4); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_necdsp(xml_element *root) { + unsigned program = 0; + + foreach(attr, root->attribute) { + if(attr->name == "program") { + if(attr->content == "DSP-1" || attr->content == "DSP-1A" || attr->content == "DSP-1B") { + program = 1; + has_dsp1 = true; + } else if(attr->content == "DSP-2") { + program = 2; + has_dsp2 = true; + } else if(attr->content == "DSP-3") { + program = 3; + has_dsp3 = true; + } else if(attr->content == "DSP-4") { + program = 4; + has_dsp4 = true; + } + } + } + + Memory *dr[5] = { 0, &dsp1dr, &dsp2, &dsp3, &dsp4 }; + Memory *sr[5] = { 0, &dsp1sr, &dsp2, &dsp3, &dsp4 }; + + foreach(node, root->element) { + if(node->name == "dr" && dr[program]) { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(*dr[program]); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } else if(node->name == "sr" && sr[program]) { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(*sr[program]); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_obc1(xml_element *root) { + has_obc1 = true; + + foreach(node, root->element) { + if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(obc1); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_setadsp(xml_element *root) { + unsigned program = 0; + + foreach(attr, root->attribute) { + if(attr->name == "program") { + if(attr->content == "ST-0010") { + program = 1; + has_st0010 = true; + } else if(attr->content == "ST-0011") { + program = 2; + has_st0011 = true; + } + } + } + + Memory *map[3] = { 0, &st0010, 0 }; + + foreach(node, root->element) { + if(node->name == "mmio" && map[program]) { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(*map[program]); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_setarisc(xml_element *root) { + unsigned program = 0; + + foreach(attr, root->attribute) { + if(attr->name == "program") { + if(attr->content == "ST-0018") { + program = 1; + has_st0018 = true; + } + } + } + + MMIO *map[2] = { 0, &st0018 }; + + foreach(node, root->element) { + if(node->name == "mmio" && map[program]) { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(*map[program]); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_msu1(xml_element *root) { + has_msu1 = true; + + foreach(node, root->element) { + if(node->name == "mmio") { + foreach(leaf, node->element) { + if(leaf->name == "map") { + Mapping m(msu1); + foreach(attr, leaf->attribute) { + if(attr->name == "address") xml_parse_address(m, attr->content); + } + mapping.add(m); + } + } + } + } +} + +void Cartridge::xml_parse_address(Mapping &m, const string &data) { + lstring part; + part.split(":", data); + if(part.size() != 2) return; + + lstring subpart; + subpart.split("-", part[0]); + if(subpart.size() == 1) { + m.banklo = strhex(subpart[0]); + m.bankhi = m.banklo; + } else if(subpart.size() == 2) { + m.banklo = strhex(subpart[0]); + m.bankhi = strhex(subpart[1]); + } + + subpart.split("-", part[1]); + if(subpart.size() == 1) { + m.addrlo = strhex(subpart[0]); + m.addrhi = m.addrlo; + } else if(subpart.size() == 2) { + m.addrlo = strhex(subpart[0]); + m.addrhi = strhex(subpart[1]); + } +} + +void Cartridge::xml_parse_mode(Mapping &m, const string& data) { + if(data == "direct") m.mode = Bus::MapMode::Direct; + else if(data == "linear") m.mode = Bus::MapMode::Linear; + else if(data == "shadow") m.mode = Bus::MapMode::Shadow; +} + +Cartridge::Mapping::Mapping() { + memory = 0; + mmio = 0; + mode = Bus::MapMode::Direct; + banklo = bankhi = addrlo = addrhi = offset = size = 0; +} + +Cartridge::Mapping::Mapping(Memory &memory_) { + memory = &memory_; + mmio = 0; + mode = Bus::MapMode::Direct; + banklo = bankhi = addrlo = addrhi = offset = size = 0; +} + +Cartridge::Mapping::Mapping(MMIO &mmio_) { + memory = 0; + mmio = &mmio_; + mode = Bus::MapMode::Direct; + banklo = bankhi = addrlo = addrhi = offset = size = 0; +} + +#endif diff --git a/src/cc.bat b/bsnes/cc.bat similarity index 100% rename from src/cc.bat rename to bsnes/cc.bat diff --git a/src/cheat/cheat-inline.hpp b/bsnes/cheat/cheat-inline.hpp similarity index 100% rename from src/cheat/cheat-inline.hpp rename to bsnes/cheat/cheat-inline.hpp diff --git a/src/cheat/cheat.cpp b/bsnes/cheat/cheat.cpp similarity index 93% rename from src/cheat/cheat.cpp rename to bsnes/cheat/cheat.cpp index 381f6e21..a182ebbd 100644 --- a/src/cheat/cheat.cpp +++ b/bsnes/cheat/cheat.cpp @@ -83,7 +83,7 @@ bool Cheat::decode(const char *s, unsigned &addr, uint8 &data, Type &type) { //validate input for(unsigned i = 0; i < 8; i++) if(!ischr(t[i])) return false; - type = ProActionReplay; + type = Type::ProActionReplay; unsigned r = strhex((const char*)t); addr = r >> 8; data = r & 0xff; @@ -94,7 +94,7 @@ bool Cheat::decode(const char *s, unsigned &addr, uint8 &data, Type &type) { //validate input for(unsigned i = 0; i < 8; i++) if(!ischr(t[i])) return false; - type = GameGenie; + type = Type::GameGenie; strtr(t, "df4709156bc8a23e", "0123456789abcdef"); unsigned r = strhex((const char*)t); //8421 8421 8421 8421 8421 8421 @@ -124,11 +124,10 @@ bool Cheat::decode(const char *s, unsigned &addr, uint8 &data, Type &type) { bool Cheat::encode(string &s, unsigned addr, uint8 data, Type type) { char t[16]; - if(type == ProActionReplay) { - sprintf(t, "%.6x%.2x", addr, data); - s = t; + if(type == Type::ProActionReplay) { + s = sprint("$$", strhex<6>(addr), strhex<2>(data)); return true; - } else if(type == GameGenie) { + } else if(type == Type::GameGenie) { unsigned r = addr; addr = (!!(r & 0x008000) << 23) | (!!(r & 0x004000) << 22) | (!!(r & 0x002000) << 21) | (!!(r & 0x001000) << 20) @@ -142,9 +141,8 @@ bool Cheat::encode(string &s, unsigned addr, uint8 data, Type type) { | (!!(r & 0x080000) << 5) | (!!(r & 0x040000) << 4) | (!!(r & 0x020000) << 3) | (!!(r & 0x010000) << 2) | (!!(r & 0x000800) << 1) | (!!(r & 0x000400) << 0); - sprintf(t, "%.2x%.2x-%.4x", data, addr >> 16, addr & 0xffff); - strtr(t, "0123456789abcdef", "df4709156bc8a23e"); - s = t; + s = sprint("$$-$", strhex<2>(data), strhex<2>(addr >> 16), strhex<4>(addr & 0xffff)); + strtr(s, "0123456789abcdef", "df4709156bc8a23e"); return true; } else { return false; diff --git a/src/cheat/cheat.hpp b/bsnes/cheat/cheat.hpp similarity index 84% rename from src/cheat/cheat.hpp rename to bsnes/cheat/cheat.hpp index 388085c8..ac4b43ec 100644 --- a/src/cheat/cheat.hpp +++ b/bsnes/cheat/cheat.hpp @@ -7,9 +7,9 @@ struct CheatCode { CheatCode(); }; -class Cheat : public vector { +class Cheat : public linear_vector { public: - enum Type { ProActionReplay, GameGenie }; + enum class Type : unsigned { ProActionReplay, GameGenie }; bool enabled() const; void enable(bool); diff --git a/src/chip/bsx/bsx.cpp b/bsnes/chip/bsx/bsx.cpp similarity index 100% rename from src/chip/bsx/bsx.cpp rename to bsnes/chip/bsx/bsx.cpp diff --git a/src/chip/bsx/bsx.hpp b/bsnes/chip/bsx/bsx.hpp similarity index 100% rename from src/chip/bsx/bsx.hpp rename to bsnes/chip/bsx/bsx.hpp diff --git a/src/chip/bsx/bsx_base.cpp b/bsnes/chip/bsx/bsx_base.cpp similarity index 100% rename from src/chip/bsx/bsx_base.cpp rename to bsnes/chip/bsx/bsx_base.cpp diff --git a/src/chip/bsx/bsx_cart.cpp b/bsnes/chip/bsx/bsx_cart.cpp similarity index 58% rename from src/chip/bsx/bsx_cart.cpp rename to bsnes/chip/bsx/bsx_cart.cpp index 92d6ead6..6bd67269 100644 --- a/src/chip/bsx/bsx_cart.cpp +++ b/bsnes/chip/bsx/bsx_cart.cpp @@ -6,7 +6,6 @@ void BSXCart::init() { } void BSXCart::enable() { - for(uint16 i = 0x5000; i <= 0x5fff; i++) memory::mmio.map(i, *this); } void BSXCart::power() { @@ -26,39 +25,39 @@ void BSXCart::update_memory_map() { if((regs.r[0x02] & 0x80) == 0x00) { //LoROM mapping - bus.map(Bus::MapLinear, 0x00, 0x7d, 0x8000, 0xffff, cart); - bus.map(Bus::MapLinear, 0x80, 0xff, 0x8000, 0xffff, cart); + bus.map(Bus::MapMode::Linear, 0x00, 0x7d, 0x8000, 0xffff, cart); + bus.map(Bus::MapMode::Linear, 0x80, 0xff, 0x8000, 0xffff, cart); } else { //HiROM mapping - bus.map(Bus::MapShadow, 0x00, 0x3f, 0x8000, 0xffff, cart); - bus.map(Bus::MapLinear, 0x40, 0x7d, 0x0000, 0xffff, cart); - bus.map(Bus::MapShadow, 0x80, 0xbf, 0x8000, 0xffff, cart); - bus.map(Bus::MapLinear, 0xc0, 0xff, 0x0000, 0xffff, cart); + bus.map(Bus::MapMode::Shadow, 0x00, 0x3f, 0x8000, 0xffff, cart); + bus.map(Bus::MapMode::Linear, 0x40, 0x7d, 0x0000, 0xffff, cart); + bus.map(Bus::MapMode::Shadow, 0x80, 0xbf, 0x8000, 0xffff, cart); + bus.map(Bus::MapMode::Linear, 0xc0, 0xff, 0x0000, 0xffff, cart); } if(regs.r[0x03] & 0x80) { - bus.map(Bus::MapLinear, 0x60, 0x6f, 0x0000, 0xffff, memory::bsxpram); - //bus.map(Bus::MapLinear, 0x70, 0x77, 0x0000, 0xffff, memory::bsxpram); + bus.map(Bus::MapMode::Linear, 0x60, 0x6f, 0x0000, 0xffff, memory::bsxpram); + //bus.map(Bus::MapMode::Linear, 0x70, 0x77, 0x0000, 0xffff, memory::bsxpram); } if((regs.r[0x05] & 0x80) == 0x00) { - bus.map(Bus::MapLinear, 0x40, 0x4f, 0x0000, 0xffff, memory::bsxpram); + bus.map(Bus::MapMode::Linear, 0x40, 0x4f, 0x0000, 0xffff, memory::bsxpram); } if((regs.r[0x06] & 0x80) == 0x00) { - bus.map(Bus::MapLinear, 0x50, 0x5f, 0x0000, 0xffff, memory::bsxpram); + bus.map(Bus::MapMode::Linear, 0x50, 0x5f, 0x0000, 0xffff, memory::bsxpram); } if(regs.r[0x07] & 0x80) { - bus.map(Bus::MapLinear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom); + bus.map(Bus::MapMode::Linear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom); } if(regs.r[0x08] & 0x80) { - bus.map(Bus::MapLinear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom); + bus.map(Bus::MapMode::Linear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom); } - bus.map(Bus::MapShadow, 0x20, 0x3f, 0x6000, 0x7fff, memory::bsxpram); - bus.map(Bus::MapLinear, 0x70, 0x77, 0x0000, 0xffff, memory::bsxpram); + bus.map(Bus::MapMode::Shadow, 0x20, 0x3f, 0x6000, 0x7fff, memory::bsxpram); + bus.map(Bus::MapMode::Linear, 0x70, 0x77, 0x0000, 0xffff, memory::bsxpram); } uint8 BSXCart::mmio_read(unsigned addr) { diff --git a/src/chip/bsx/bsx_flash.cpp b/bsnes/chip/bsx/bsx_flash.cpp similarity index 97% rename from src/chip/bsx/bsx_flash.cpp rename to bsnes/chip/bsx/bsx_flash.cpp index dfd7eadf..a4297a2b 100644 --- a/src/chip/bsx/bsx_flash.cpp +++ b/bsnes/chip/bsx/bsx_flash.cpp @@ -60,7 +60,7 @@ void BSXFlash::write(unsigned addr, uint8 data) { //use read-write flashcarts, and HiROM-mapped BS-X carts always use //read-only flashcarts. //below is an unfortunately necessary workaround to this problem. - if(cartridge.mapper() == Cartridge::BSCHiROM) return; + //if(cartridge.mapper() == Cartridge::BSCHiROM) return; if((addr & 0xff0000) == 0) { regs.write_old = regs.write_new; diff --git a/src/chip/chip.hpp b/bsnes/chip/chip.hpp similarity index 75% rename from src/chip/chip.hpp rename to bsnes/chip/chip.hpp index 1afe4fe6..aa4b9095 100644 --- a/src/chip/chip.hpp +++ b/bsnes/chip/chip.hpp @@ -11,7 +11,7 @@ #include "dsp3/dsp3.hpp" #include "dsp4/dsp4.hpp" #include "obc1/obc1.hpp" -#include "st010/st010.hpp" -#include "st011/st011.hpp" -#include "st018/st018.hpp" -#include "msu/msu.hpp" +#include "st0010/st0010.hpp" +#include "st0011/st0011.hpp" +#include "st0018/st0018.hpp" +#include "msu1/msu1.hpp" diff --git a/src/chip/cx4/cx4.cpp b/bsnes/chip/cx4/cx4.cpp similarity index 97% rename from src/chip/cx4/cx4.cpp rename to bsnes/chip/cx4/cx4.cpp index e26b1887..1ea422b7 100644 --- a/src/chip/cx4/cx4.cpp +++ b/bsnes/chip/cx4/cx4.cpp @@ -21,8 +21,6 @@ void Cx4::init() { } void Cx4::enable() { - bus.map(Bus::MapDirect, 0x00, 0x3f, 0x6000, 0x7fff, *this); - bus.map(Bus::MapDirect, 0x80, 0xbf, 0x6000, 0x7fff, *this); } uint32 Cx4::ldr(uint8 r) { diff --git a/src/chip/cx4/cx4.hpp b/bsnes/chip/cx4/cx4.hpp similarity index 100% rename from src/chip/cx4/cx4.hpp rename to bsnes/chip/cx4/cx4.hpp diff --git a/src/chip/cx4/data.cpp b/bsnes/chip/cx4/data.cpp similarity index 100% rename from src/chip/cx4/data.cpp rename to bsnes/chip/cx4/data.cpp diff --git a/src/chip/cx4/functions.cpp b/bsnes/chip/cx4/functions.cpp similarity index 100% rename from src/chip/cx4/functions.cpp rename to bsnes/chip/cx4/functions.cpp diff --git a/src/chip/cx4/oam.cpp b/bsnes/chip/cx4/oam.cpp similarity index 100% rename from src/chip/cx4/oam.cpp rename to bsnes/chip/cx4/oam.cpp diff --git a/src/chip/cx4/opcodes.cpp b/bsnes/chip/cx4/opcodes.cpp similarity index 100% rename from src/chip/cx4/opcodes.cpp rename to bsnes/chip/cx4/opcodes.cpp diff --git a/src/chip/cx4/serialization.cpp b/bsnes/chip/cx4/serialization.cpp similarity index 100% rename from src/chip/cx4/serialization.cpp rename to bsnes/chip/cx4/serialization.cpp diff --git a/bsnes/chip/dsp1/dsp1.cpp b/bsnes/chip/dsp1/dsp1.cpp new file mode 100644 index 00000000..c65762b3 --- /dev/null +++ b/bsnes/chip/dsp1/dsp1.cpp @@ -0,0 +1,33 @@ +#include <../base.hpp> + +#define DSP1_CPP +namespace SNES { + +DSP1 dsp1; +DSP1DR dsp1dr; +DSP1SR dsp1sr; + +#include "serialization.cpp" +#include "dsp1emu.cpp" + +void DSP1::init() { +} + +void DSP1::enable() { +} + +void DSP1::power() { + reset(); +} + +void DSP1::reset() { + dsp1.reset(); +} + +uint8 DSP1DR::read(unsigned addr) { return dsp1.dsp1.getDr(); } +void DSP1DR::write(unsigned addr, uint8 data) { dsp1.dsp1.setDr(data); } + +uint8 DSP1SR::read(unsigned addr) { return dsp1.dsp1.getSr(); } +void DSP1SR::write(unsigned addr, uint8 data) {} + +}; diff --git a/src/chip/dsp1/dsp1.hpp b/bsnes/chip/dsp1/dsp1.hpp similarity index 50% rename from src/chip/dsp1/dsp1.hpp rename to bsnes/chip/dsp1/dsp1.hpp index 474c098c..5e373be2 100644 --- a/src/chip/dsp1/dsp1.hpp +++ b/bsnes/chip/dsp1/dsp1.hpp @@ -1,20 +1,30 @@ #include "dsp1emu.hpp" -class DSP1 : public Memory { +class DSP1 { public: void init(); void enable(); void power(); void reset(); - uint8 read(unsigned addr); - void write(unsigned addr, uint8 data); - void serialize(serializer&); private: Dsp1 dsp1; - bool addr_decode(uint16 addr); + friend class DSP1DR; + friend class DSP1SR; +}; + +class DSP1DR : public Memory { + uint8 read(unsigned addr); + void write(unsigned addr, uint8 data); +}; + +class DSP1SR : public Memory { + uint8 read(unsigned addr); + void write(unsigned addr, uint8 data); }; extern DSP1 dsp1; +extern DSP1DR dsp1dr; +extern DSP1SR dsp1sr; diff --git a/src/chip/dsp1/dsp1emu.cpp b/bsnes/chip/dsp1/dsp1emu.cpp similarity index 100% rename from src/chip/dsp1/dsp1emu.cpp rename to bsnes/chip/dsp1/dsp1emu.cpp diff --git a/src/chip/dsp1/dsp1emu.hpp b/bsnes/chip/dsp1/dsp1emu.hpp similarity index 100% rename from src/chip/dsp1/dsp1emu.hpp rename to bsnes/chip/dsp1/dsp1emu.hpp diff --git a/src/chip/dsp1/serialization.cpp b/bsnes/chip/dsp1/serialization.cpp similarity index 100% rename from src/chip/dsp1/serialization.cpp rename to bsnes/chip/dsp1/serialization.cpp diff --git a/src/chip/dsp2/dsp2.cpp b/bsnes/chip/dsp2/dsp2.cpp similarity index 92% rename from src/chip/dsp2/dsp2.cpp rename to bsnes/chip/dsp2/dsp2.cpp index c44d03ea..146e4fee 100644 --- a/src/chip/dsp2/dsp2.cpp +++ b/bsnes/chip/dsp2/dsp2.cpp @@ -12,10 +12,6 @@ void DSP2::init() { } void DSP2::enable() { - bus.map(Bus::MapDirect, 0x20, 0x3f, 0x6000, 0x6fff, *this); - bus.map(Bus::MapDirect, 0x20, 0x3f, 0x8000, 0xbfff, *this); - bus.map(Bus::MapDirect, 0xa0, 0xbf, 0x6000, 0x6fff, *this); - bus.map(Bus::MapDirect, 0xa0, 0xbf, 0x8000, 0xbfff, *this); } void DSP2::power() { diff --git a/src/chip/dsp2/dsp2.hpp b/bsnes/chip/dsp2/dsp2.hpp similarity index 100% rename from src/chip/dsp2/dsp2.hpp rename to bsnes/chip/dsp2/dsp2.hpp diff --git a/src/chip/dsp2/opcodes.cpp b/bsnes/chip/dsp2/opcodes.cpp similarity index 100% rename from src/chip/dsp2/opcodes.cpp rename to bsnes/chip/dsp2/opcodes.cpp diff --git a/src/chip/dsp2/serialization.cpp b/bsnes/chip/dsp2/serialization.cpp similarity index 100% rename from src/chip/dsp2/serialization.cpp rename to bsnes/chip/dsp2/serialization.cpp diff --git a/src/chip/dsp3/dsp3.cpp b/bsnes/chip/dsp3/dsp3.cpp similarity index 81% rename from src/chip/dsp3/dsp3.cpp rename to bsnes/chip/dsp3/dsp3.cpp index b2e6b3d5..a337cf9e 100644 --- a/src/chip/dsp3/dsp3.cpp +++ b/bsnes/chip/dsp3/dsp3.cpp @@ -15,8 +15,6 @@ void DSP3::init() { } void DSP3::enable() { - bus.map(Bus::MapDirect, 0x20, 0x3f, 0x8000, 0xffff, *this); - bus.map(Bus::MapDirect, 0xa0, 0xbf, 0x8000, 0xffff, *this); } void DSP3::power() { diff --git a/src/chip/dsp3/dsp3.hpp b/bsnes/chip/dsp3/dsp3.hpp similarity index 100% rename from src/chip/dsp3/dsp3.hpp rename to bsnes/chip/dsp3/dsp3.hpp diff --git a/src/chip/dsp3/dsp3emu.c b/bsnes/chip/dsp3/dsp3emu.c similarity index 100% rename from src/chip/dsp3/dsp3emu.c rename to bsnes/chip/dsp3/dsp3emu.c diff --git a/src/chip/dsp4/dsp4.cpp b/bsnes/chip/dsp4/dsp4.cpp similarity index 88% rename from src/chip/dsp4/dsp4.cpp rename to bsnes/chip/dsp4/dsp4.cpp index c885dd7e..bb24f839 100644 --- a/src/chip/dsp4/dsp4.cpp +++ b/bsnes/chip/dsp4/dsp4.cpp @@ -9,8 +9,6 @@ void DSP4::init() { } void DSP4::enable() { - bus.map(Bus::MapDirect, 0x30, 0x3f, 0x8000, 0xffff, *this); - bus.map(Bus::MapDirect, 0xb0, 0xbf, 0x8000, 0xffff, *this); } namespace DSP4i { diff --git a/src/chip/dsp4/dsp4.hpp b/bsnes/chip/dsp4/dsp4.hpp similarity index 100% rename from src/chip/dsp4/dsp4.hpp rename to bsnes/chip/dsp4/dsp4.hpp diff --git a/src/chip/dsp4/dsp4emu.c b/bsnes/chip/dsp4/dsp4emu.c similarity index 100% rename from src/chip/dsp4/dsp4emu.c rename to bsnes/chip/dsp4/dsp4emu.c diff --git a/src/chip/dsp4/dsp4emu.h b/bsnes/chip/dsp4/dsp4emu.h similarity index 100% rename from src/chip/dsp4/dsp4emu.h rename to bsnes/chip/dsp4/dsp4emu.h diff --git a/src/chip/msu/msu.cpp b/bsnes/chip/msu1/msu1.cpp similarity index 85% rename from src/chip/msu/msu.cpp rename to bsnes/chip/msu1/msu1.cpp index 02fe3390..dcc95ac2 100644 --- a/src/chip/msu/msu.cpp +++ b/bsnes/chip/msu1/msu1.cpp @@ -1,18 +1,18 @@ #include <../base.hpp> -#define MSU_CPP +#define MSU1_CPP namespace SNES { -MSU msu; +MSU1 msu1; #include "serialization.cpp" -void MSU::enter() { +void MSU1::enter() { scheduler.clock.cop_freq = 44100; while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } int16 left = 0, right = 0; @@ -41,26 +41,22 @@ void MSU::enter() { } } -void MSU::init() { +void MSU1::init() { } -void MSU::enable() { +void MSU1::enable() { audio.coprocessor_enable(true); audio.coprocessor_frequency(44100.0); - for(unsigned i = 0x2000; i <= 0x2007; i++) { - memory::mmio.map(i, *this); - } - if(datafile.open()) datafile.close(); datafile.open(string() << basename << ".msu", file::mode_read); } -void MSU::power() { +void MSU1::power() { reset(); } -void MSU::reset() { +void MSU1::reset() { mmio.data_offset = 0; mmio.audio_offset = 0; mmio.audio_track = 0; @@ -71,7 +67,7 @@ void MSU::reset() { mmio.audio_play = false; } -uint8 MSU::mmio_read(unsigned addr) { +uint8 MSU1::mmio_read(unsigned addr) { addr &= 0xffff; if(addr == 0x2000) { @@ -99,7 +95,7 @@ uint8 MSU::mmio_read(unsigned addr) { return 0x00; } -void MSU::mmio_write(unsigned addr, uint8 data) { +void MSU1::mmio_write(unsigned addr, uint8 data) { addr &= 0xffff; if(addr == 0x2000) { @@ -147,12 +143,8 @@ void MSU::mmio_write(unsigned addr, uint8 data) { } } -void MSU::base(const string& name) { +void MSU1::base(const string& name) { basename = name; } -bool MSU::exists() { - return file::exists(string() << basename << ".msu"); -} - } diff --git a/src/chip/msu/msu.hpp b/bsnes/chip/msu1/msu1.hpp similarity index 91% rename from src/chip/msu/msu.hpp rename to bsnes/chip/msu1/msu1.hpp index d16d07c1..d986f396 100644 --- a/src/chip/msu/msu.hpp +++ b/bsnes/chip/msu1/msu1.hpp @@ -1,4 +1,4 @@ -class MSU : public MMIO { +class MSU1 : public MMIO { public: void enter(); @@ -11,8 +11,6 @@ public: void mmio_write(unsigned addr, uint8 data); void base(const string &name); - bool exists(); - void serialize(serializer&); private: @@ -40,4 +38,4 @@ private: } mmio; }; -extern MSU msu; +extern MSU1 msu1; diff --git a/src/chip/msu/serialization.cpp b/bsnes/chip/msu1/serialization.cpp similarity index 92% rename from src/chip/msu/serialization.cpp rename to bsnes/chip/msu1/serialization.cpp index dbdcb183..89e36fbe 100644 --- a/src/chip/msu/serialization.cpp +++ b/bsnes/chip/msu1/serialization.cpp @@ -1,6 +1,6 @@ -#ifdef MSU_CPP +#ifdef MSU1_CPP -void MSU::serialize(serializer &s) { +void MSU1::serialize(serializer &s) { s.integer(mmio.data_offset); s.integer(mmio.audio_offset); s.integer(mmio.audio_track); diff --git a/src/chip/obc1/obc1.cpp b/bsnes/chip/obc1/obc1.cpp similarity index 94% rename from src/chip/obc1/obc1.cpp rename to bsnes/chip/obc1/obc1.cpp index 39b22cf1..ff53be61 100644 --- a/src/chip/obc1/obc1.cpp +++ b/bsnes/chip/obc1/obc1.cpp @@ -11,8 +11,6 @@ void OBC1::init() { } void OBC1::enable() { - bus.map(Bus::MapDirect, 0x00, 0x3f, 0x6000, 0x7fff, *this); - bus.map(Bus::MapDirect, 0x80, 0xbf, 0x6000, 0x7fff, *this); } void OBC1::power() { diff --git a/src/chip/obc1/obc1.hpp b/bsnes/chip/obc1/obc1.hpp similarity index 100% rename from src/chip/obc1/obc1.hpp rename to bsnes/chip/obc1/obc1.hpp diff --git a/src/chip/obc1/serialization.cpp b/bsnes/chip/obc1/serialization.cpp similarity index 100% rename from src/chip/obc1/serialization.cpp rename to bsnes/chip/obc1/serialization.cpp diff --git a/src/chip/sa1/bus/bus.cpp b/bsnes/chip/sa1/bus/bus.cpp similarity index 53% rename from src/chip/sa1/bus/bus.cpp rename to bsnes/chip/sa1/bus/bus.cpp index 062328d0..6cbba596 100644 --- a/src/chip/sa1/bus/bus.cpp +++ b/bsnes/chip/sa1/bus/bus.cpp @@ -5,13 +5,13 @@ SA1Bus sa1bus; namespace memory { StaticRAM iram(2048); - //accessed by: - VectorSelectionPage vectorsp; //S-CPU + SA-1 - CPUIRAM cpuiram; //S-CPU - SA1IRAM sa1iram; //SA-1 - SA1BWRAM sa1bwram; //SA-1 - CC1BWRAM cc1bwram; //S-CPU - BitmapRAM bitmapram; //SA-1 + //accessed by: + VSPROM vsprom; //S-CPU + SA-1 + CPUIRAM cpuiram; //S-CPU + SA1IRAM sa1iram; //SA-1 + SA1BWRAM sa1bwram; //SA-1 + CC1BWRAM cc1bwram; //S-CPU + BitmapRAM bitmapram; //SA-1 } //$230c (VDPL), $230d (VDPH) use this bus to read variable-length data. @@ -20,53 +20,41 @@ namespace memory { //these ports. //(* eg, memory::cartram is used directly, as memory::sa1bwram syncs to the S-CPU) void VBRBus::init() { - map(MapDirect, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); + map(MapMode::Direct, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); - map(MapLinear, 0x00, 0x3f, 0x0000, 0x07ff, memory::iram); - map(MapLinear, 0x00, 0x3f, 0x3000, 0x37ff, memory::iram); - map(MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::cartram); - map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x40, 0x4f, 0x0000, 0xffff, memory::cartram); - map(MapLinear, 0x80, 0xbf, 0x0000, 0x07ff, memory::iram); - map(MapLinear, 0x80, 0xbf, 0x3000, 0x37ff, memory::iram); - map(MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::cartram); - map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom); + map(MapMode::Linear, 0x00, 0x3f, 0x0000, 0x07ff, memory::iram); + map(MapMode::Linear, 0x00, 0x3f, 0x3000, 0x37ff, memory::iram); + map(MapMode::Linear, 0x00, 0x3f, 0x6000, 0x7fff, memory::cartram); + map(MapMode::Linear, 0x00, 0x3f, 0x8000, 0xffff, memory::vsprom); + map(MapMode::Linear, 0x40, 0x4f, 0x0000, 0xffff, memory::cartram); + map(MapMode::Linear, 0x80, 0xbf, 0x0000, 0x07ff, memory::iram); + map(MapMode::Linear, 0x80, 0xbf, 0x3000, 0x37ff, memory::iram); + map(MapMode::Linear, 0x80, 0xbf, 0x6000, 0x7fff, memory::cartram); + map(MapMode::Linear, 0x80, 0xbf, 0x8000, 0xffff, memory::vsprom); + map(MapMode::Linear, 0xc0, 0xff, 0x0000, 0xffff, memory::vsprom); } void SA1Bus::init() { - map(MapDirect, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); - for(unsigned i = 0x2200; i <= 0x23ff; i++) memory::mmio.map(i, sa1); + map(MapMode::Direct, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); - map(MapLinear, 0x00, 0x3f, 0x0000, 0x07ff, memory::sa1iram); - map(MapDirect, 0x00, 0x3f, 0x2200, 0x23ff, memory::mmio); - map(MapLinear, 0x00, 0x3f, 0x3000, 0x37ff, memory::sa1iram); - map(MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::sa1bwram); - map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x40, 0x4f, 0x0000, 0xffff, memory::sa1bwram); - map(MapLinear, 0x60, 0x6f, 0x0000, 0xffff, memory::bitmapram); - map(MapLinear, 0x80, 0xbf, 0x0000, 0x07ff, memory::sa1iram); - map(MapDirect, 0x80, 0xbf, 0x2200, 0x23ff, memory::mmio); - map(MapLinear, 0x80, 0xbf, 0x3000, 0x37ff, memory::sa1iram); - map(MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::sa1bwram); - map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom); - - bus.map(MapLinear, 0x00, 0x3f, 0x3000, 0x37ff, memory::cpuiram); - bus.map(MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::cc1bwram); - bus.map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - bus.map(MapLinear, 0x40, 0x4f, 0x0000, 0xffff, memory::cc1bwram); - bus.map(MapLinear, 0x80, 0xbf, 0x3000, 0x37ff, memory::cpuiram); - bus.map(MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::cc1bwram); - bus.map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - bus.map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom); - - memory::vectorsp.sync(); + map(MapMode::Linear, 0x00, 0x3f, 0x0000, 0x07ff, memory::sa1iram); + map(MapMode::Direct, 0x00, 0x3f, 0x2200, 0x23ff, memory::mmio); + map(MapMode::Linear, 0x00, 0x3f, 0x3000, 0x37ff, memory::sa1iram); + map(MapMode::Linear, 0x00, 0x3f, 0x6000, 0x7fff, memory::sa1bwram); + map(MapMode::Linear, 0x00, 0x3f, 0x8000, 0xffff, memory::vsprom); + map(MapMode::Linear, 0x40, 0x4f, 0x0000, 0xffff, memory::sa1bwram); + map(MapMode::Linear, 0x60, 0x6f, 0x0000, 0xffff, memory::bitmapram); + map(MapMode::Linear, 0x80, 0xbf, 0x0000, 0x07ff, memory::sa1iram); + map(MapMode::Direct, 0x80, 0xbf, 0x2200, 0x23ff, memory::mmio); + map(MapMode::Linear, 0x80, 0xbf, 0x3000, 0x37ff, memory::sa1iram); + map(MapMode::Linear, 0x80, 0xbf, 0x6000, 0x7fff, memory::sa1bwram); + map(MapMode::Linear, 0x80, 0xbf, 0x8000, 0xffff, memory::vsprom); + map(MapMode::Linear, 0xc0, 0xff, 0x0000, 0xffff, memory::vsprom); } -//=================== -//VectorSelectionPage -//=================== +//====== +//VSPROM +//====== //this class maps $00:[ff00-ffff] for the purpose of supporting: //$2209.d6 IVSW (S-CPU IRQ vector selection) (0 = cart, 1 = SA-1) @@ -78,35 +66,22 @@ void SA1Bus::init() { //$00:[ffea-ffeb|ffee-ffef] are special cased on read; //all other addresses return original mapped data. -uint8 VectorSelectionPage::read(unsigned addr) { - switch(0xff00 | (addr & 0xff)) { - case 0xffea: case 0xffeb: { - if(sa1.mmio.cpu_nvsw == true) return (sa1.mmio.snv >> ((addr & 1) << 3)); - } break; - - case 0xffee: case 0xffef: { - if(sa1.mmio.cpu_ivsw == true) return (sa1.mmio.siv >> ((addr & 1) << 3)); - } break; - } - - return access->read(addr); +unsigned VSPROM::size() const { + return memory::cartrom.size(); } -void VectorSelectionPage::write(unsigned addr, uint8 data) { - return access->write(addr, data); +uint8 VSPROM::read(unsigned addr) { + //use $7fex instead of $ffex due to linear mapping of 32k granularity ROM data + if((addr & 0xffffe0) == 0x007fe0) { + if(addr == 0x7fea && sa1.mmio.cpu_nvsw) return sa1.mmio.snv >> 0; + if(addr == 0x7feb && sa1.mmio.cpu_nvsw) return sa1.mmio.snv >> 8; + if(addr == 0x7fee && sa1.mmio.cpu_ivsw) return sa1.mmio.siv >> 0; + if(addr == 0x7fef && sa1.mmio.cpu_ivsw) return sa1.mmio.siv >> 8; + } + return memory::cartrom.read(addr); } -//call this whenever bus is remapped. -//note: S-CPU and SA-1 bus always share $00:[ff00-ffff] as cartridge ROM data; -//the SA-1 MMC does not allow mapping these independently between processors. -//this allows this class to be shared for both, caching only ones' access class. -void VectorSelectionPage::sync() { - if(bus.page[0x00ff00 >> 8].access != this) { - //bus was re-mapped, hook access routine - access = bus.page[0x00ff00 >> 8].access; - bus.page[0x00ff00 >> 8].access = this; - sa1bus.page[0x00ff00 >> 8].access = this; - } +void VSPROM::write(unsigned addr, uint8 data) { } //======= diff --git a/src/chip/sa1/bus/bus.hpp b/bsnes/chip/sa1/bus/bus.hpp similarity index 90% rename from src/chip/sa1/bus/bus.hpp rename to bsnes/chip/sa1/bus/bus.hpp index bec2f82d..2aeb11de 100644 --- a/src/chip/sa1/bus/bus.hpp +++ b/bsnes/chip/sa1/bus/bus.hpp @@ -6,11 +6,10 @@ struct SA1Bus : Bus { void init(); }; -struct VectorSelectionPage : Memory { +struct VSPROM : Memory { + unsigned size() const; alwaysinline uint8 read(unsigned); alwaysinline void write(unsigned, uint8); - void sync(); - Memory *access; }; struct CPUIRAM : Memory { @@ -47,7 +46,7 @@ struct BitmapRAM : Memory { namespace memory { extern StaticRAM iram; - extern VectorSelectionPage vectorsp; + extern VSPROM vsprom; extern CPUIRAM cpuiram; extern SA1IRAM sa1iram; extern SA1BWRAM sa1bwram; diff --git a/src/chip/sa1/dma/dma.cpp b/bsnes/chip/sa1/dma/dma.cpp similarity index 100% rename from src/chip/sa1/dma/dma.cpp rename to bsnes/chip/sa1/dma/dma.cpp diff --git a/src/chip/sa1/dma/dma.hpp b/bsnes/chip/sa1/dma/dma.hpp similarity index 100% rename from src/chip/sa1/dma/dma.hpp rename to bsnes/chip/sa1/dma/dma.hpp diff --git a/src/chip/sa1/memory/memory.cpp b/bsnes/chip/sa1/memory/memory.cpp similarity index 100% rename from src/chip/sa1/memory/memory.cpp rename to bsnes/chip/sa1/memory/memory.cpp diff --git a/src/chip/sa1/memory/memory.hpp b/bsnes/chip/sa1/memory/memory.hpp similarity index 100% rename from src/chip/sa1/memory/memory.hpp rename to bsnes/chip/sa1/memory/memory.hpp diff --git a/src/chip/sa1/mmio/mmio.cpp b/bsnes/chip/sa1/mmio/mmio.cpp similarity index 85% rename from src/chip/sa1/mmio/mmio.cpp rename to bsnes/chip/sa1/mmio/mmio.cpp index eb6832ed..0bf79742 100644 --- a/src/chip/sa1/mmio/mmio.cpp +++ b/bsnes/chip/sa1/mmio/mmio.cpp @@ -2,8 +2,8 @@ //BS-X flash carts, when present, are mapped to 0x400000+ Memory& SA1::mmio_access(unsigned &addr) { - if(!memory::bsxflash.data()) return memory::cartrom; - if(addr < 0x400000) return memory::cartrom; + if(!memory::bsxflash.data()) return memory::vsprom; + if(addr < 0x400000) return memory::vsprom; addr &= 0x3fffff; return bsxflash; } @@ -156,17 +156,15 @@ void SA1::mmio_w2220(uint8 data) { Memory &access = mmio_access(addr); if(mmio.cbmode == 0) { - bus.map(Bus::MapLinear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom, 0x000000); - sa1bus.map(Bus::MapLinear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom, 0x000000); + bus.map(Bus::MapMode::Linear, 0x00, 0x1f, 0x8000, 0xffff, memory::vsprom, 0x000000); + sa1bus.map(Bus::MapMode::Linear, 0x00, 0x1f, 0x8000, 0xffff, memory::vsprom, 0x000000); } else { - bus.map(Bus::MapLinear, 0x00, 0x1f, 0x8000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0x00, 0x1f, 0x8000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0x00, 0x1f, 0x8000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0x00, 0x1f, 0x8000, 0xffff, access, addr); } - bus.map(Bus::MapLinear, 0xc0, 0xcf, 0x0000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0xc0, 0xcf, 0x0000, 0xffff, access, addr); - - memory::vectorsp.sync(); + bus.map(Bus::MapMode::Linear, 0xc0, 0xcf, 0x0000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0xc0, 0xcf, 0x0000, 0xffff, access, addr); } //(DXB) Super MMC bank D @@ -178,15 +176,15 @@ void SA1::mmio_w2221(uint8 data) { Memory &access = mmio_access(addr); if(mmio.dbmode == 0) { - bus.map(Bus::MapLinear, 0x20, 0x3f, 0x8000, 0xffff, memory::cartrom, 0x100000); - sa1bus.map(Bus::MapLinear, 0x20, 0x3f, 0x8000, 0xffff, memory::cartrom, 0x100000); + bus.map(Bus::MapMode::Linear, 0x20, 0x3f, 0x8000, 0xffff, memory::vsprom, 0x100000); + sa1bus.map(Bus::MapMode::Linear, 0x20, 0x3f, 0x8000, 0xffff, memory::vsprom, 0x100000); } else { - bus.map(Bus::MapLinear, 0x20, 0x3f, 0x8000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0x20, 0x3f, 0x8000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0x20, 0x3f, 0x8000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0x20, 0x3f, 0x8000, 0xffff, access, addr); } - bus.map(Bus::MapLinear, 0xd0, 0xdf, 0x0000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0xd0, 0xdf, 0x0000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0xd0, 0xdf, 0x0000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0xd0, 0xdf, 0x0000, 0xffff, access, addr); } //(EXB) Super MMC bank E @@ -198,15 +196,15 @@ void SA1::mmio_w2222(uint8 data) { Memory &access = mmio_access(addr); if(mmio.ebmode == 0) { - bus.map(Bus::MapLinear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom, 0x200000); - sa1bus.map(Bus::MapLinear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom, 0x200000); + bus.map(Bus::MapMode::Linear, 0x80, 0x9f, 0x8000, 0xffff, memory::vsprom, 0x200000); + sa1bus.map(Bus::MapMode::Linear, 0x80, 0x9f, 0x8000, 0xffff, memory::vsprom, 0x200000); } else { - bus.map(Bus::MapLinear, 0x80, 0x9f, 0x8000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0x80, 0x9f, 0x8000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0x80, 0x9f, 0x8000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0x80, 0x9f, 0x8000, 0xffff, access, addr); } - bus.map(Bus::MapLinear, 0xe0, 0xef, 0x0000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0xe0, 0xef, 0x0000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0xe0, 0xef, 0x0000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0xe0, 0xef, 0x0000, 0xffff, access, addr); } //(FXB) Super MMC bank F @@ -218,23 +216,23 @@ void SA1::mmio_w2223(uint8 data) { Memory &access = mmio_access(addr); if(mmio.fbmode == 0) { - bus.map(Bus::MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, memory::cartrom, 0x300000); - sa1bus.map(Bus::MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, memory::cartrom, 0x300000); + bus.map(Bus::MapMode::Linear, 0xa0, 0xbf, 0x8000, 0xffff, memory::vsprom, 0x300000); + sa1bus.map(Bus::MapMode::Linear, 0xa0, 0xbf, 0x8000, 0xffff, memory::vsprom, 0x300000); } else { - bus.map(Bus::MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0xa0, 0xbf, 0x8000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0xa0, 0xbf, 0x8000, 0xffff, access, addr); } - bus.map(Bus::MapLinear, 0xf0, 0xff, 0x0000, 0xffff, access, addr); - sa1bus.map(Bus::MapLinear, 0xf0, 0xff, 0x0000, 0xffff, access, addr); + bus.map(Bus::MapMode::Linear, 0xf0, 0xff, 0x0000, 0xffff, access, addr); + sa1bus.map(Bus::MapMode::Linear, 0xf0, 0xff, 0x0000, 0xffff, access, addr); } //(BMAPS) S-CPU BW-RAM address mapping void SA1::mmio_w2224(uint8 data) { mmio.sbm = (data & 0x1f); - bus.map(Bus::MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::cc1bwram, mmio.sbm * 0x2000, 0x2000); - bus.map(Bus::MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::cc1bwram, mmio.sbm * 0x2000, 0x2000); + bus.map(Bus::MapMode::Linear, 0x00, 0x3f, 0x6000, 0x7fff, memory::cc1bwram, mmio.sbm * 0x2000, 0x2000); + bus.map(Bus::MapMode::Linear, 0x80, 0xbf, 0x6000, 0x7fff, memory::cc1bwram, mmio.sbm * 0x2000, 0x2000); } //(BMAP) SA-1 BW-RAM address mapping @@ -244,12 +242,12 @@ void SA1::mmio_w2225(uint8 data) { if(mmio.sw46 == 0) { //$[40-43]:[0000-ffff] x 32 projection - sa1bus.map(Bus::MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::sa1bwram, (mmio.cbm & 0x1f) * 0x2000, 0x2000); - sa1bus.map(Bus::MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::sa1bwram, (mmio.cbm & 0x1f) * 0x2000, 0x2000); + sa1bus.map(Bus::MapMode::Linear, 0x00, 0x3f, 0x6000, 0x7fff, memory::sa1bwram, (mmio.cbm & 0x1f) * 0x2000, 0x2000); + sa1bus.map(Bus::MapMode::Linear, 0x80, 0xbf, 0x6000, 0x7fff, memory::sa1bwram, (mmio.cbm & 0x1f) * 0x2000, 0x2000); } else { //$[60-6f]:[0000-ffff] x 128 projection - sa1bus.map(Bus::MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::bitmapram, mmio.cbm * 0x2000, 0x2000); - sa1bus.map(Bus::MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::bitmapram, mmio.cbm * 0x2000, 0x2000); + sa1bus.map(Bus::MapMode::Linear, 0x00, 0x3f, 0x6000, 0x7fff, memory::bitmapram, mmio.cbm * 0x2000, 0x2000); + sa1bus.map(Bus::MapMode::Linear, 0x80, 0xbf, 0x6000, 0x7fff, memory::bitmapram, mmio.cbm * 0x2000, 0x2000); } } diff --git a/src/chip/sa1/mmio/mmio.hpp b/bsnes/chip/sa1/mmio/mmio.hpp similarity index 100% rename from src/chip/sa1/mmio/mmio.hpp rename to bsnes/chip/sa1/mmio/mmio.hpp diff --git a/src/chip/sa1/sa1.cpp b/bsnes/chip/sa1/sa1.cpp similarity index 96% rename from src/chip/sa1/sa1.cpp rename to bsnes/chip/sa1/sa1.cpp index 82470a44..e9321e9d 100644 --- a/src/chip/sa1/sa1.cpp +++ b/bsnes/chip/sa1/sa1.cpp @@ -13,8 +13,8 @@ SA1 sa1; void SA1::enter() { while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(mmio.sa1_rdyb || mmio.sa1_resb) { @@ -127,7 +127,6 @@ void SA1::power() { } void SA1::reset() { - memory::vectorsp.access = 0; memory::cc1bwram.dma = false; for(unsigned addr = 0; addr < memory::iram.size(); addr++) { memory::iram.write(addr, 0x00); @@ -152,7 +151,7 @@ void SA1::reset() { status.interrupt_pending = false; status.interrupt_vector = 0x0000; - status.scanlines = (system.region() == System::NTSC ? 262 : 312); + status.scanlines = (system.region() == System::Region::NTSC ? 262 : 312); status.vcounter = 0; status.hcounter = 0; diff --git a/src/chip/sa1/sa1.hpp b/bsnes/chip/sa1/sa1.hpp similarity index 100% rename from src/chip/sa1/sa1.hpp rename to bsnes/chip/sa1/sa1.hpp diff --git a/src/chip/sa1/serialization.cpp b/bsnes/chip/sa1/serialization.cpp similarity index 98% rename from src/chip/sa1/serialization.cpp rename to bsnes/chip/sa1/serialization.cpp index 9d599c1c..aa67e4e3 100644 --- a/src/chip/sa1/serialization.cpp +++ b/bsnes/chip/sa1/serialization.cpp @@ -16,8 +16,6 @@ void SA1::serialize(serializer &s) { //bus/bus.hpp s.array(memory::iram.data(), memory::iram.size()); - memory::vectorsp.sync(); - s.integer(memory::cc1bwram.dma); //dma/dma.hpp diff --git a/src/chip/sdd1/sdd1.cpp b/bsnes/chip/sdd1/sdd1.cpp similarity index 96% rename from src/chip/sdd1/sdd1.cpp rename to bsnes/chip/sdd1/sdd1.cpp index 171a8eca..e3f48943 100644 --- a/src/chip/sdd1/sdd1.cpp +++ b/bsnes/chip/sdd1/sdd1.cpp @@ -17,11 +17,6 @@ void SDD1::enable() { cpu_mmio[i & 0x7f] = memory::mmio.mmio[i - 0x2000]; memory::mmio.map(i, *this); } - - //hook S-DD1 MMIO registers - for(unsigned i = 0x4800; i <= 0x4807; i++) { - memory::mmio.map(i, *this); - } } void SDD1::power() { @@ -43,8 +38,6 @@ void SDD1::reset() { } buffer.ready = false; - - bus.map(Bus::MapDirect, 0xc0, 0xff, 0x0000, 0xffff, *this); } uint8 SDD1::mmio_read(unsigned addr) { diff --git a/src/chip/sdd1/sdd1.hpp b/bsnes/chip/sdd1/sdd1.hpp similarity index 100% rename from src/chip/sdd1/sdd1.hpp rename to bsnes/chip/sdd1/sdd1.hpp diff --git a/src/chip/sdd1/sdd1emu.cpp b/bsnes/chip/sdd1/sdd1emu.cpp similarity index 100% rename from src/chip/sdd1/sdd1emu.cpp rename to bsnes/chip/sdd1/sdd1emu.cpp diff --git a/src/chip/sdd1/sdd1emu.hpp b/bsnes/chip/sdd1/sdd1emu.hpp similarity index 100% rename from src/chip/sdd1/sdd1emu.hpp rename to bsnes/chip/sdd1/sdd1emu.hpp diff --git a/src/chip/sdd1/serialization.cpp b/bsnes/chip/sdd1/serialization.cpp similarity index 100% rename from src/chip/sdd1/serialization.cpp rename to bsnes/chip/sdd1/serialization.cpp diff --git a/src/chip/spc7110/decomp.cpp b/bsnes/chip/spc7110/decomp.cpp similarity index 98% rename from src/chip/spc7110/decomp.cpp rename to bsnes/chip/spc7110/decomp.cpp index 99d4e1b5..212fb0af 100644 --- a/src/chip/spc7110/decomp.cpp +++ b/bsnes/chip/spc7110/decomp.cpp @@ -24,9 +24,9 @@ void SPC7110Decomp::write(uint8 data) { } uint8 SPC7110Decomp::dataread() { - unsigned size = memory::cartrom.size() - 0x100000; + unsigned size = memory::cartrom.size() - cartridge.spc7110_data_rom_offset(); while(decomp_offset >= size) decomp_offset -= size; - return memory::cartrom.read(0x100000 + decomp_offset++); + return memory::cartrom.read(cartridge.spc7110_data_rom_offset() + decomp_offset++); } void SPC7110Decomp::init(unsigned mode, unsigned offset, unsigned index) { diff --git a/src/chip/spc7110/decomp.hpp b/bsnes/chip/spc7110/decomp.hpp similarity index 100% rename from src/chip/spc7110/decomp.hpp rename to bsnes/chip/spc7110/decomp.hpp diff --git a/src/chip/spc7110/serialization.cpp b/bsnes/chip/spc7110/serialization.cpp similarity index 100% rename from src/chip/spc7110/serialization.cpp rename to bsnes/chip/spc7110/serialization.cpp diff --git a/src/chip/spc7110/spc7110.cpp b/bsnes/chip/spc7110/spc7110.cpp similarity index 93% rename from src/chip/spc7110/spc7110.cpp rename to bsnes/chip/spc7110/spc7110.cpp index 15f50403..54935077 100644 --- a/src/chip/spc7110/spc7110.cpp +++ b/bsnes/chip/spc7110/spc7110.cpp @@ -4,6 +4,9 @@ namespace SNES { SPC7110 spc7110; +SPC7110MCU spc7110mcu; +SPC7110DCU spc7110dcu; +SPC7110RAM spc7110ram; #include "serialization.cpp" #include "decomp.cpp" @@ -11,11 +14,7 @@ SPC7110 spc7110; const unsigned SPC7110::months[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; void SPC7110::init() {} - -void SPC7110::enable() { - uint16_t limit = (cartridge.has_spc7110rtc() ? 0x4842 : 0x483f); - for(uint16_t i = 0x4800; i <= limit; i++) memory::mmio.map(i, *this); -} +void SPC7110::enable() {} void SPC7110::power() { reset(); @@ -85,9 +84,9 @@ void SPC7110::reset() { } unsigned SPC7110::datarom_addr(unsigned addr) { - unsigned size = memory::cartrom.size() - 0x100000; + unsigned size = memory::cartrom.size() - cartridge.spc7110_data_rom_offset(); while(addr >= size) addr -= size; - return addr + 0x100000; + return cartridge.spc7110_data_rom_offset() + addr; } unsigned SPC7110::data_pointer() { return r4811 + (r4812 << 8) + (r4813 << 16); } @@ -632,46 +631,52 @@ void SPC7110::mmio_write(unsigned addr, uint8 data) { } } -uint8 SPC7110::read(unsigned addr) { - //$[00-0f|80-8f]:[8000-ffff], $[c0-cf]:[0000-ffff] mapped directly to memory::cartrom - - if((addr & 0xffe000) == 0x006000 || (addr & 0xffe000) == 0x306000) { - //$[00|30]:[6000-7fff] - return memory::cartram.read(addr & 0x1fff); - } - - if((addr & 0xff0000) == 0x500000) { - //$[50]:[0000-ffff] - return mmio_read(0x4800); - } - - if((addr & 0xf00000) == 0xd00000) { - //$[d0-df]:[0000-ffff] - return memory::cartrom.read(dx_offset + (addr & 0x0fffff)); - } - - if((addr & 0xf00000) == 0xe00000) { - //$[e0-ef]:[0000-ffff] - return memory::cartrom.read(ex_offset + (addr & 0x0fffff)); - } - - if((addr & 0xf00000) == 0xf00000) { - //$[f0-ff]:[0000-ffff] - return memory::cartrom.read(fx_offset + (addr & 0x0fffff)); - } - - return cpu.regs.mdr; -} - -void SPC7110::write(unsigned addr, uint8 data) { - if((addr & 0xffe000) == 0x006000 || (addr & 0xffe000) == 0x306000) { - //$[00|30]:[6000-7fff] - if(r4830 & 0x80) memory::cartram.write(addr & 0x1fff, data); - return; - } -} - SPC7110::SPC7110() { } +//========== +//SPC7110MCU +//========== + +unsigned SPC7110MCU::size() const { + return 0x300000; +} + +uint8 SPC7110MCU::read(unsigned addr) { + if(addr <= 0xdfffff) return memory::cartrom.read(spc7110.dx_offset + (addr & 0x0fffff)); + if(addr <= 0xefffff) return memory::cartrom.read(spc7110.ex_offset + (addr & 0x0fffff)); + if(addr <= 0xffffff) return memory::cartrom.read(spc7110.fx_offset + (addr & 0x0fffff)); + return cpu.regs.mdr; +} + +void SPC7110MCU::write(unsigned addr, uint8 data) { +} + +//========== +//SPC7110DCU +//========== + +uint8 SPC7110DCU::read(unsigned) { + return spc7110.mmio_read(0x4800); +} + +void SPC7110DCU::write(unsigned, uint8) { +} + +//========== +//SPC7110RAM +//========== + +unsigned SPC7110RAM::size() const { + return 0x2000; +} + +uint8 SPC7110RAM::read(unsigned addr) { + return memory::cartram.read(addr & 0x1fff); +} + +void SPC7110RAM::write(unsigned addr, uint8 data) { + if(spc7110.r4830 & 0x80) memory::cartram.write(addr & 0x1fff, data); +} + }; diff --git a/src/chip/spc7110/spc7110.hpp b/bsnes/chip/spc7110/spc7110.hpp similarity index 86% rename from src/chip/spc7110/spc7110.hpp rename to bsnes/chip/spc7110/spc7110.hpp index fa6770f0..4d8b43c3 100644 --- a/src/chip/spc7110/spc7110.hpp +++ b/bsnes/chip/spc7110/spc7110.hpp @@ -1,6 +1,6 @@ /***** - * SPC7110 emulator - version 0.03 (2008-08-10) - * Copyright (c) 2008, byuu and neviksti + * SPC7110 emulator - version 0.04 (2010-02-14) + * Copyright (c) 2008-2010, byuu and neviksti * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -17,7 +17,7 @@ #include "decomp.hpp" -class SPC7110 : public MMIO, public Memory { +class SPC7110 : public MMIO { public: void init(); void enable(); @@ -38,9 +38,6 @@ public: uint8 mmio_read(unsigned addr); void mmio_write(unsigned addr, uint8 data); - uint8 read(unsigned addr); - void write(unsigned addr, uint8 data); - //spc7110decomp void decomp_init(); uint8 decomp_read(); @@ -131,6 +128,32 @@ private: unsigned rtc_index; static const unsigned months[12]; + friend class SPC7110MCU; + friend class SPC7110DCU; + friend class SPC7110RAM; +}; + +class SPC7110MCU : public Memory { +public: + unsigned size() const; + uint8 read(unsigned addr); + void write(unsigned addr, uint8 data); +}; + +class SPC7110DCU : public Memory { +public: + uint8 read(unsigned addr); + void write(unsigned addr, uint8 data); +}; + +class SPC7110RAM : public Memory { +public: + unsigned size() const; + uint8 read(unsigned addr); + void write(unsigned addr, uint8 data); }; extern SPC7110 spc7110; +extern SPC7110MCU spc7110mcu; +extern SPC7110DCU spc7110dcu; +extern SPC7110RAM spc7110ram; diff --git a/src/chip/srtc/serialization.cpp b/bsnes/chip/srtc/serialization.cpp similarity index 100% rename from src/chip/srtc/serialization.cpp rename to bsnes/chip/srtc/serialization.cpp diff --git a/src/chip/srtc/srtc.cpp b/bsnes/chip/srtc/srtc.cpp similarity index 98% rename from src/chip/srtc/srtc.cpp rename to bsnes/chip/srtc/srtc.cpp index 3ba3fd6e..fe4668f4 100644 --- a/src/chip/srtc/srtc.cpp +++ b/bsnes/chip/srtc/srtc.cpp @@ -13,8 +13,6 @@ void SRTC::init() { } void SRTC::enable() { - memory::mmio.map(0x2800, *this); - memory::mmio.map(0x2801, *this); } void SRTC::power() { diff --git a/src/chip/srtc/srtc.hpp b/bsnes/chip/srtc/srtc.hpp similarity index 100% rename from src/chip/srtc/srtc.hpp rename to bsnes/chip/srtc/srtc.hpp diff --git a/src/chip/st010/st010_data.hpp b/bsnes/chip/st0010/data.hpp similarity index 98% rename from src/chip/st010/st010_data.hpp rename to bsnes/chip/st0010/data.hpp index 53f816fc..52b251f9 100644 --- a/src/chip/st010/st010_data.hpp +++ b/bsnes/chip/st0010/data.hpp @@ -1,4 +1,6 @@ -const int16 ST010::sin_table[256] = { +#ifdef ST0010_CPP + +const int16 ST0010::sin_table[256] = { 0x0000, 0x0324, 0x0648, 0x096a, 0x0c8c, 0x0fab, 0x12c8, 0x15e2, 0x18f9, 0x1c0b, 0x1f1a, 0x2223, 0x2528, 0x2826, 0x2b1f, 0x2e11, 0x30fb, 0x33df, 0x36ba, 0x398c, 0x3c56, 0x3f17, 0x41ce, 0x447a, @@ -33,7 +35,7 @@ const int16 ST010::sin_table[256] = { -0x18f8, -0x15e2, -0x12c8, -0x0fab, -0x0c8b, -0x096a, -0x0647, -0x0324 }; -const int16 ST010::mode7_scale[176] = { +const int16 ST0010::mode7_scale[176] = { 0x0380, 0x0325, 0x02da, 0x029c, 0x0268, 0x023b, 0x0215, 0x01f3, 0x01d5, 0x01bb, 0x01a3, 0x018e, 0x017b, 0x016a, 0x015a, 0x014b, 0x013e, 0x0132, 0x0126, 0x011c, 0x0112, 0x0109, 0x0100, 0x00f8, @@ -58,7 +60,7 @@ const int16 ST010::mode7_scale[176] = { 0x002d, 0x002c, 0x002c, 0x002c, 0x002c, 0x002b, 0x002b, 0x002b }; -const uint8 ST010::arctan[32][32] = { +const uint8 ST0010::arctan[32][32] = { { 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 }, { 0x80, 0xa0, 0xad, 0xb3, 0xb6, 0xb8, 0xb9, 0xba, 0xbb, 0xbb, 0xbc, 0xbc, 0xbd, 0xbd, 0xbd, 0xbd, @@ -124,3 +126,5 @@ const uint8 ST010::arctan[32][32] = { { 0x80, 0x81, 0x83, 0x84, 0x85, 0x87, 0x88, 0x89, 0x8a, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9c, 0x9d, 0x9e, 0x9f, 0x9f, 0xa0 } }; + +#endif diff --git a/src/chip/st010/st010_op.cpp b/bsnes/chip/st0010/opcodes.cpp similarity index 93% rename from src/chip/st010/st010_op.cpp rename to bsnes/chip/st0010/opcodes.cpp index b22a861c..e6aa5419 100644 --- a/src/chip/st010/st010_op.cpp +++ b/bsnes/chip/st0010/opcodes.cpp @@ -1,9 +1,9 @@ -#ifdef ST010_CPP +#ifdef ST0010_CPP -//ST-010 emulation code - Copyright (C) 2003 The Dumper, Matthew Kendora, Overload, Feather +//ST-0010 emulation code - Copyright (C) 2003 The Dumper, Matthew Kendora, Overload, Feather //bsnes port - Copyright (C) 2007 byuu -void ST010::op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta) { +void ST0010::op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta) { if((x0 < 0) && (y0 < 0)) { x1 = -x0; y1 = -y0; @@ -34,7 +34,7 @@ void ST010::op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int // -void ST010::op_01() { +void ST0010::op_01() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 x1, y1, quadrant, theta; @@ -48,7 +48,7 @@ void ST010::op_01() { writew(0x0010, theta); } -void ST010::op_02() { +void ST0010::op_02() { int16 positions = readw(0x0024); uint16 *places = (uint16*)(ram + 0x0040); uint16 *drivers = (uint16*)(ram + 0x0080); @@ -76,7 +76,7 @@ void ST010::op_02() { } } -void ST010::op_03() { +void ST0010::op_03() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 multiplier = readw(0x0004); @@ -89,7 +89,7 @@ void ST010::op_03() { writed(0x0014, y1); } -void ST010::op_04() { +void ST0010::op_04() { int16 x = readw(0x0000); int16 y = readw(0x0002); int16 square; @@ -99,7 +99,7 @@ void ST010::op_04() { writew(0x0010, square); } -void ST010::op_05() { +void ST0010::op_05() { int32 dx, dy; int16 a1, b1, c1; uint16 o1; @@ -217,7 +217,7 @@ void ST010::op_05() { writew(0x00dc, flags); } -void ST010::op_06() { +void ST0010::op_06() { int16 multiplicand = readw(0x0000); int16 multiplier = readw(0x0002); int32 product; @@ -227,7 +227,7 @@ void ST010::op_06() { writed(0x0010, product); } -void ST010::op_07() { +void ST0010::op_07() { int16 theta = readw(0x0000); int16 data; @@ -245,7 +245,7 @@ void ST010::op_07() { } } -void ST010::op_08() { +void ST0010::op_08() { int16 x0 = readw(0x0000); int16 y0 = readw(0x0002); int16 theta = readw(0x0004); diff --git a/bsnes/chip/st0010/serialization.cpp b/bsnes/chip/st0010/serialization.cpp new file mode 100644 index 00000000..5c21f644 --- /dev/null +++ b/bsnes/chip/st0010/serialization.cpp @@ -0,0 +1,7 @@ +#ifdef ST0010_CPP + +void ST0010::serialize(serializer &s) { + s.array(ram); +} + +#endif diff --git a/src/chip/st010/st010.cpp b/bsnes/chip/st0010/st0010.cpp similarity index 62% rename from src/chip/st010/st010.cpp rename to bsnes/chip/st0010/st0010.cpp index 20726ab9..4519886b 100644 --- a/src/chip/st010/st010.cpp +++ b/bsnes/chip/st0010/st0010.cpp @@ -1,56 +1,54 @@ #include <../base.hpp> -#define ST010_CPP +#define ST0010_CPP namespace SNES { -ST010 st010; +ST0010 st0010; -#include "st010_data.hpp" +#include "data.hpp" +#include "opcodes.cpp" #include "serialization.cpp" -#include "st010_op.cpp" -void ST010::init() { +void ST0010::init() { } -void ST010::enable() { - bus.map(Bus::MapDirect, 0x68, 0x6f, 0x0000, 0x0fff, *this); - bus.map(Bus::MapDirect, 0xe8, 0xef, 0x0000, 0x0fff, *this); +void ST0010::enable() { } -int16 ST010::sin(int16 theta) { +int16 ST0010::sin(int16 theta) { return sin_table[(theta >> 8) & 0xff]; } -int16 ST010::cos(int16 theta) { +int16 ST0010::cos(int16 theta) { return sin_table[((theta + 0x4000) >> 8) & 0xff]; } -uint8 ST010::readb(uint16 addr) { +uint8 ST0010::readb(uint16 addr) { return ram[addr & 0xfff]; } -uint16 ST010::readw(uint16 addr) { +uint16 ST0010::readw(uint16 addr) { return (readb(addr + 0) << 0) | (readb(addr + 1) << 8); } -uint32 ST010::readd(uint16 addr) { +uint32 ST0010::readd(uint16 addr) { return (readb(addr + 0) << 0) | (readb(addr + 1) << 8) | (readb(addr + 2) << 16) | (readb(addr + 3) << 24); } -void ST010::writeb(uint16 addr, uint8 data) { +void ST0010::writeb(uint16 addr, uint8 data) { ram[addr & 0xfff] = data; } -void ST010::writew(uint16 addr, uint16 data) { +void ST0010::writew(uint16 addr, uint16 data) { writeb(addr + 0, data >> 0); writeb(addr + 1, data >> 8); } -void ST010::writed(uint16 addr, uint32 data) { +void ST0010::writed(uint16 addr, uint32 data) { writeb(addr + 0, data >> 0); writeb(addr + 1, data >> 8); writeb(addr + 2, data >> 16); @@ -59,21 +57,21 @@ void ST010::writed(uint16 addr, uint32 data) { // -void ST010::power() { +void ST0010::power() { reset(); } -void ST010::reset() { +void ST0010::reset() { memset(ram, 0x00, sizeof ram); } // -uint8 ST010::read(unsigned addr) { +uint8 ST0010::read(unsigned addr) { return readb(addr); } -void ST010::write(unsigned addr, uint8 data) { +void ST0010::write(unsigned addr, uint8 data) { writeb(addr, data); if((addr & 0xfff) == 0x0021 && (data & 0x80)) { diff --git a/src/chip/st010/st010.hpp b/bsnes/chip/st0010/st0010.hpp similarity index 94% rename from src/chip/st010/st010.hpp rename to bsnes/chip/st0010/st0010.hpp index ab837ca1..cceb0666 100644 --- a/src/chip/st010/st010.hpp +++ b/bsnes/chip/st0010/st0010.hpp @@ -1,4 +1,4 @@ -class ST010 : public Memory { +class ST0010 : public Memory { public: void init(); void enable(); @@ -41,4 +41,4 @@ private: void op_01(int16 x0, int16 y0, int16 &x1, int16 &y1, int16 &quadrant, int16 &theta); }; -extern ST010 st010; +extern ST0010 st0010; diff --git a/bsnes/chip/st0011/st0011.cpp b/bsnes/chip/st0011/st0011.cpp new file mode 100644 index 00000000..8a83d82f --- /dev/null +++ b/bsnes/chip/st0011/st0011.cpp @@ -0,0 +1,20 @@ +#include <../base.hpp> + +#define ST0011_CPP +namespace SNES { + +ST0011 st0011; + +void ST0011::init() { +} + +void ST0011::enable() { +} + +void ST0011::power() { +} + +void ST0011::reset() { +} + +}; diff --git a/src/chip/st011/st011.hpp b/bsnes/chip/st0011/st0011.hpp similarity index 67% rename from src/chip/st011/st011.hpp rename to bsnes/chip/st0011/st0011.hpp index ddc510dd..c605c075 100644 --- a/src/chip/st011/st011.hpp +++ b/bsnes/chip/st0011/st0011.hpp @@ -1,4 +1,4 @@ -class ST011 { +class ST0011 { public: void init(); void enable(); @@ -6,4 +6,4 @@ public: void reset(); }; -extern ST011 st011; +extern ST0011 st0011; diff --git a/src/chip/st018/st018.cpp b/bsnes/chip/st0018/st0018.cpp similarity index 79% rename from src/chip/st018/st018.cpp rename to bsnes/chip/st0018/st0018.cpp index c3c34b86..9ce7872c 100644 --- a/src/chip/st018/st018.cpp +++ b/bsnes/chip/st0018/st0018.cpp @@ -1,18 +1,18 @@ #include <../base.hpp> -#define ST018_CPP +#define ST0018_CPP namespace SNES { -ST018 st018; +ST0018 st0018; -uint8 ST018::mmio_read(unsigned addr) { +uint8 ST0018::mmio_read(unsigned addr) { addr &= 0xffff; if(addr == 0x3800) return regs.r3800; if(addr == 0x3804) return regs.r3804; return cpu.regs.mdr; } -void ST018::mmio_write(unsigned addr, uint8 data) { +void ST0018::mmio_write(unsigned addr, uint8 data) { addr &= 0xffff; if(addr == 0x3802) { @@ -45,18 +45,17 @@ void ST018::mmio_write(unsigned addr, uint8 data) { } } -void ST018::init() { +void ST0018::init() { } -void ST018::enable() { - for(unsigned i = 0x3800; i <= 0x38ff; i++) memory::mmio.map(i, *this); +void ST0018::enable() { } -void ST018::power() { +void ST0018::power() { reset(); } -void ST018::reset() { +void ST0018::reset() { regs.mode = Waiting; regs.r3800 = 0x00; regs.r3804 = 0x85; @@ -64,17 +63,17 @@ void ST018::reset() { for(unsigned i = 0; i < 97; i++) board[i] = 0; } -//============= -//ST018 opcodes -//============= +//=============== +//ST-0018 opcodes +//=============== -void ST018::op_board_upload() { +void ST0018::op_board_upload() { regs.mode = BoardUpload; regs.counter = 0; regs.r3800 = 0xe0; } -void ST018::op_board_upload(uint8 data) { +void ST0018::op_board_upload(uint8 data) { board[regs.counter] = data; regs.r3800 = 96 - regs.counter; regs.counter++; @@ -93,31 +92,31 @@ void ST018::op_board_upload(uint8 data) { } } -void ST018::op_b2() { +void ST0018::op_b2() { fprintf(stdout, "* ST018 w3802::b2\n"); regs.r3800 = 0xe0; regs.r3800_01 = 0; //unknown } -void ST018::op_b3() { +void ST0018::op_b3() { fprintf(stdout, "* ST018 w3802::b3\n"); regs.r3800 = 0xe0; regs.r3800_01 = 1; //0 = player lost? } -void ST018::op_b4() { +void ST0018::op_b4() { fprintf(stdout, "* ST018 w3802::b4\n"); regs.r3800 = 0xe0; regs.r3800_01 = 1; //0 = player won? } -void ST018::op_b5() { +void ST0018::op_b5() { fprintf(stdout, "* ST018 w3802::b5\n"); regs.r3800 = 0xe0; regs.r3800_01 = 0; //1 = move will result in checkmate? } -void ST018::op_query_chip() { +void ST0018::op_query_chip() { regs.r3800 = 0x00; } diff --git a/src/chip/st018/st018.hpp b/bsnes/chip/st0018/st0018.hpp similarity index 94% rename from src/chip/st018/st018.hpp rename to bsnes/chip/st0018/st0018.hpp index d64be4e3..8a92e934 100644 --- a/src/chip/st018/st018.hpp +++ b/bsnes/chip/st0018/st0018.hpp @@ -1,4 +1,4 @@ -class ST018 : public MMIO { +class ST0018 : public MMIO { public: void init(); void enable(); @@ -48,4 +48,4 @@ private: void op_query_chip(); }; -extern ST018 st018; +extern ST0018 st0018; diff --git a/src/chip/superfx/bus/bus.cpp b/bsnes/chip/superfx/bus/bus.cpp similarity index 69% rename from src/chip/superfx/bus/bus.cpp rename to bsnes/chip/superfx/bus/bus.cpp index ac932ac4..e8f598d6 100644 --- a/src/chip/superfx/bus/bus.cpp +++ b/bsnes/chip/superfx/bus/bus.cpp @@ -10,21 +10,12 @@ namespace memory { } void SuperFXBus::init() { - map(MapDirect, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); + map(MapMode::Direct, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); - map(MapLinear, 0x00, 0x3f, 0x0000, 0x7fff, memory::gsurom); - map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::gsurom); - map(MapLinear, 0x40, 0x5f, 0x0000, 0xffff, memory::gsurom); - map(MapLinear, 0x60, 0x7f, 0x0000, 0xffff, memory::gsuram); - - bus.map(MapLinear, 0x00, 0x3f, 0x6000, 0x7fff, memory::fxram, 0x0000, 0x2000); - bus.map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::fxrom); - bus.map(MapLinear, 0x40, 0x5f, 0x0000, 0xffff, memory::fxrom); - bus.map(MapLinear, 0x60, 0x7d, 0x0000, 0xffff, memory::fxram); - bus.map(MapLinear, 0x80, 0xbf, 0x6000, 0x7fff, memory::fxram, 0x0000, 0x2000); - bus.map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::fxrom); - bus.map(MapLinear, 0xc0, 0xdf, 0x0000, 0xffff, memory::fxrom); - bus.map(MapLinear, 0xe0, 0xff, 0x0000, 0xffff, memory::fxram); + map(MapMode::Linear, 0x00, 0x3f, 0x0000, 0x7fff, memory::gsurom); + map(MapMode::Linear, 0x00, 0x3f, 0x8000, 0xffff, memory::gsurom); + map(MapMode::Linear, 0x40, 0x5f, 0x0000, 0xffff, memory::gsurom); + map(MapMode::Linear, 0x60, 0x7f, 0x0000, 0xffff, memory::gsuram); } //ROM / RAM access from the SuperFX CPU @@ -34,7 +25,7 @@ unsigned SuperFXGSUROM::size() const { } uint8 SuperFXGSUROM::read(unsigned addr) { - while(!superfx.regs.scmr.ron && scheduler.sync != Scheduler::SyncAll) { + while(!superfx.regs.scmr.ron && scheduler.sync != Scheduler::SynchronizeMode::All) { superfx.add_clocks(6); scheduler.sync_copcpu(); } @@ -42,7 +33,7 @@ uint8 SuperFXGSUROM::read(unsigned addr) { } void SuperFXGSUROM::write(unsigned addr, uint8 data) { - while(!superfx.regs.scmr.ron && scheduler.sync != Scheduler::SyncAll) { + while(!superfx.regs.scmr.ron && scheduler.sync != Scheduler::SynchronizeMode::All) { superfx.add_clocks(6); scheduler.sync_copcpu(); } @@ -54,7 +45,7 @@ unsigned SuperFXGSURAM::size() const { } uint8 SuperFXGSURAM::read(unsigned addr) { - while(!superfx.regs.scmr.ran && scheduler.sync != Scheduler::SyncAll) { + while(!superfx.regs.scmr.ran && scheduler.sync != Scheduler::SynchronizeMode::All) { superfx.add_clocks(6); scheduler.sync_copcpu(); } @@ -62,7 +53,7 @@ uint8 SuperFXGSURAM::read(unsigned addr) { } void SuperFXGSURAM::write(unsigned addr, uint8 data) { - while(!superfx.regs.scmr.ran && scheduler.sync != Scheduler::SyncAll) { + while(!superfx.regs.scmr.ran && scheduler.sync != Scheduler::SynchronizeMode::All) { superfx.add_clocks(6); scheduler.sync_copcpu(); } diff --git a/src/chip/superfx/bus/bus.hpp b/bsnes/chip/superfx/bus/bus.hpp similarity index 100% rename from src/chip/superfx/bus/bus.hpp rename to bsnes/chip/superfx/bus/bus.hpp diff --git a/src/chip/superfx/core/core.cpp b/bsnes/chip/superfx/core/core.cpp similarity index 100% rename from src/chip/superfx/core/core.cpp rename to bsnes/chip/superfx/core/core.cpp diff --git a/src/chip/superfx/core/core.hpp b/bsnes/chip/superfx/core/core.hpp similarity index 100% rename from src/chip/superfx/core/core.hpp rename to bsnes/chip/superfx/core/core.hpp diff --git a/src/chip/superfx/core/opcode_table.cpp b/bsnes/chip/superfx/core/opcode_table.cpp similarity index 100% rename from src/chip/superfx/core/opcode_table.cpp rename to bsnes/chip/superfx/core/opcode_table.cpp diff --git a/src/chip/superfx/core/opcodes.cpp b/bsnes/chip/superfx/core/opcodes.cpp similarity index 100% rename from src/chip/superfx/core/opcodes.cpp rename to bsnes/chip/superfx/core/opcodes.cpp diff --git a/src/chip/superfx/core/registers.hpp b/bsnes/chip/superfx/core/registers.hpp similarity index 98% rename from src/chip/superfx/core/registers.hpp rename to bsnes/chip/superfx/core/registers.hpp index 7346f631..ac193a8a 100644 --- a/src/chip/superfx/core/registers.hpp +++ b/bsnes/chip/superfx/core/registers.hpp @@ -1,5 +1,5 @@ //accepts a callback binding so r14 writes can trigger ROM buffering transparently -struct reg16_t : noncopyable { +struct reg16_t { uint16 data; function on_modify; @@ -29,6 +29,7 @@ struct reg16_t : noncopyable { inline unsigned operator = (const reg16_t& i) { return assign(i); } reg16_t() : data(0) {} + reg16_t(const reg16_t&) = delete; }; struct sfr_t { diff --git a/src/chip/superfx/disasm/disasm.cpp b/bsnes/chip/superfx/disasm/disasm.cpp similarity index 100% rename from src/chip/superfx/disasm/disasm.cpp rename to bsnes/chip/superfx/disasm/disasm.cpp diff --git a/src/chip/superfx/disasm/disasm.hpp b/bsnes/chip/superfx/disasm/disasm.hpp similarity index 100% rename from src/chip/superfx/disasm/disasm.hpp rename to bsnes/chip/superfx/disasm/disasm.hpp diff --git a/src/chip/superfx/memory/memory.cpp b/bsnes/chip/superfx/memory/memory.cpp similarity index 100% rename from src/chip/superfx/memory/memory.cpp rename to bsnes/chip/superfx/memory/memory.cpp diff --git a/src/chip/superfx/memory/memory.hpp b/bsnes/chip/superfx/memory/memory.hpp similarity index 100% rename from src/chip/superfx/memory/memory.hpp rename to bsnes/chip/superfx/memory/memory.hpp diff --git a/src/chip/superfx/mmio/mmio.cpp b/bsnes/chip/superfx/mmio/mmio.cpp similarity index 100% rename from src/chip/superfx/mmio/mmio.cpp rename to bsnes/chip/superfx/mmio/mmio.cpp diff --git a/src/chip/superfx/mmio/mmio.hpp b/bsnes/chip/superfx/mmio/mmio.hpp similarity index 100% rename from src/chip/superfx/mmio/mmio.hpp rename to bsnes/chip/superfx/mmio/mmio.hpp diff --git a/src/chip/superfx/serialization.cpp b/bsnes/chip/superfx/serialization.cpp similarity index 100% rename from src/chip/superfx/serialization.cpp rename to bsnes/chip/superfx/serialization.cpp diff --git a/src/chip/superfx/superfx.cpp b/bsnes/chip/superfx/superfx.cpp similarity index 89% rename from src/chip/superfx/superfx.cpp rename to bsnes/chip/superfx/superfx.cpp index 8040f999..7971fcee 100644 --- a/src/chip/superfx/superfx.cpp +++ b/bsnes/chip/superfx/superfx.cpp @@ -15,8 +15,8 @@ SuperFX superfx; void SuperFX::enter() { while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(regs.sfr.g == 0) { @@ -42,7 +42,6 @@ void SuperFX::init() { } void SuperFX::enable() { - for(unsigned i = 0x3000; i <= 0x32ff; i++) memory::mmio.map(i, *this); } void SuperFX::power() { diff --git a/src/chip/superfx/superfx.hpp b/bsnes/chip/superfx/superfx.hpp similarity index 100% rename from src/chip/superfx/superfx.hpp rename to bsnes/chip/superfx/superfx.hpp diff --git a/src/chip/superfx/timing/timing.cpp b/bsnes/chip/superfx/timing/timing.cpp similarity index 100% rename from src/chip/superfx/timing/timing.cpp rename to bsnes/chip/superfx/timing/timing.cpp diff --git a/src/chip/superfx/timing/timing.hpp b/bsnes/chip/superfx/timing/timing.hpp similarity index 100% rename from src/chip/superfx/timing/timing.hpp rename to bsnes/chip/superfx/timing/timing.hpp diff --git a/bsnes/chip/supergameboy/serialization.cpp b/bsnes/chip/supergameboy/serialization.cpp new file mode 100644 index 00000000..bc377dae --- /dev/null +++ b/bsnes/chip/supergameboy/serialization.cpp @@ -0,0 +1,8 @@ +#ifdef SUPERGAMEBOY_CPP + +void SuperGameBoy::serialize(serializer &s) { + s.integer(row); + if(sgb_serialize) sgb_serialize(s); +} + +#endif diff --git a/src/chip/supergameboy/supergameboy.cpp b/bsnes/chip/supergameboy/supergameboy.cpp similarity index 81% rename from src/chip/supergameboy/supergameboy.cpp rename to bsnes/chip/supergameboy/supergameboy.cpp index c53d8557..97db363c 100644 --- a/src/chip/supergameboy/supergameboy.cpp +++ b/bsnes/chip/supergameboy/supergameboy.cpp @@ -5,12 +5,14 @@ namespace SNES { SuperGameBoy supergameboy; +#include "serialization.cpp" + void SuperGameBoy::enter() { - scheduler.clock.cop_freq = (version == SuperGameBoy1 ? 2147727 : 2097152); + scheduler.clock.cop_freq = (cartridge.supergameboy_version() == Cartridge::SuperGameBoyVersion::Version1 ? 2147727 : 2097152); if(!sgb_run) while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } audio.coprocessor_sample(0, 0); @@ -19,8 +21,8 @@ void SuperGameBoy::enter() { } while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } unsigned samples = sgb_run(samplebuffer, 16); @@ -107,18 +109,16 @@ void SuperGameBoy::enable() { } void SuperGameBoy::power() { - version = (cartridge.type() == Cartridge::TypeSuperGameBoy1Bios ? SuperGameBoy1 : SuperGameBoy2); + printf("version = %u\n", cartridge.supergameboy_version()); audio.coprocessor_enable(true); - audio.coprocessor_frequency(version == SuperGameBoy1 ? 2147727.0 : 2097152.0); - - bus.map(Bus::MapDirect, 0x00, 0x3f, 0x6000, 0x7fff, *this); - bus.map(Bus::MapDirect, 0x80, 0xbf, 0x6000, 0x7fff, *this); + audio.coprocessor_frequency(cartridge.supergameboy_version() == Cartridge::SuperGameBoyVersion::Version1 ? 2147727.0 : 2097152.0); sgb_rom(memory::gbrom.data(), memory::gbrom.size() == -1U ? 0 : memory::gbrom.size()); sgb_ram(memory::gbram.data(), memory::gbram.size() == -1U ? 0 : memory::gbram.size()); sgb_rtc(memory::gbrtc.data(), memory::gbrtc.size() == -1U ? 0 : memory::gbrtc.size()); + bool version = (cartridge.supergameboy_version() == Cartridge::SuperGameBoyVersion::Version1) ? 0 : 1; if(sgb_init) sgb_init(version); if(sgb_power) sgb_power(); } @@ -131,10 +131,4 @@ void SuperGameBoy::unload() { if(sgb_term) sgb_term(); } -void SuperGameBoy::serialize(serializer &s) { - s.integer(row); - s.integer(version); - if(sgb_serialize) sgb_serialize(s); -} - } diff --git a/src/chip/supergameboy/supergameboy.hpp b/bsnes/chip/supergameboy/supergameboy.hpp similarity index 93% rename from src/chip/supergameboy/supergameboy.hpp rename to bsnes/chip/supergameboy/supergameboy.hpp index f132b956..ed63c01f 100644 --- a/src/chip/supergameboy/supergameboy.hpp +++ b/bsnes/chip/supergameboy/supergameboy.hpp @@ -20,9 +20,7 @@ public: private: uint32_t samplebuffer[4096]; unsigned row; - bool version; - enum { SuperGameBoy1 = 0, SuperGameBoy2 = 1 }; function sgb_rom; function sgb_ram; function sgb_rtc; @@ -36,6 +34,8 @@ private: function sgb_run; function sgb_save; function sgb_serialize; + + friend class Cartridge; }; extern SuperGameBoy supergameboy; diff --git a/src/clean.bat b/bsnes/clean.bat similarity index 100% rename from src/clean.bat rename to bsnes/clean.bat diff --git a/src/cpu/core/algorithms.cpp b/bsnes/cpu/core/algorithms.cpp similarity index 100% rename from src/cpu/core/algorithms.cpp rename to bsnes/cpu/core/algorithms.cpp diff --git a/src/cpu/core/core.cpp b/bsnes/cpu/core/core.cpp similarity index 100% rename from src/cpu/core/core.cpp rename to bsnes/cpu/core/core.cpp diff --git a/src/cpu/core/core.hpp b/bsnes/cpu/core/core.hpp similarity index 100% rename from src/cpu/core/core.hpp rename to bsnes/cpu/core/core.hpp diff --git a/src/cpu/core/disassembler/disassembler.cpp b/bsnes/cpu/core/disassembler/disassembler.cpp similarity index 100% rename from src/cpu/core/disassembler/disassembler.cpp rename to bsnes/cpu/core/disassembler/disassembler.cpp diff --git a/src/cpu/core/disassembler/disassembler.hpp b/bsnes/cpu/core/disassembler/disassembler.hpp similarity index 100% rename from src/cpu/core/disassembler/disassembler.hpp rename to bsnes/cpu/core/disassembler/disassembler.hpp diff --git a/src/cpu/core/memory.hpp b/bsnes/cpu/core/memory.hpp similarity index 100% rename from src/cpu/core/memory.hpp rename to bsnes/cpu/core/memory.hpp diff --git a/src/cpu/core/opcode_misc.cpp b/bsnes/cpu/core/opcode_misc.cpp similarity index 100% rename from src/cpu/core/opcode_misc.cpp rename to bsnes/cpu/core/opcode_misc.cpp diff --git a/src/cpu/core/opcode_pc.cpp b/bsnes/cpu/core/opcode_pc.cpp similarity index 100% rename from src/cpu/core/opcode_pc.cpp rename to bsnes/cpu/core/opcode_pc.cpp diff --git a/src/cpu/core/opcode_read.cpp b/bsnes/cpu/core/opcode_read.cpp similarity index 98% rename from src/cpu/core/opcode_read.cpp rename to bsnes/cpu/core/opcode_read.cpp index d539dbc5..61a7feb3 100644 --- a/src/cpu/core/opcode_read.cpp +++ b/bsnes/cpu/core/opcode_read.cpp @@ -132,8 +132,8 @@ template void CPUcore::op_read_dpr_w() { dp = op_readpc(); op_io_cond2(); op_io(); -L rd.l = op_readdp(dp + regs.r[n].w + 0); - rd.h = op_readdp(dp + regs.r[n].w + 1); + rd.l = op_readdp(dp + regs.r[n].w + 0); +L rd.h = op_readdp(dp + regs.r[n].w + 1); call(op); } diff --git a/src/cpu/core/opcode_rmw.cpp b/bsnes/cpu/core/opcode_rmw.cpp similarity index 100% rename from src/cpu/core/opcode_rmw.cpp rename to bsnes/cpu/core/opcode_rmw.cpp diff --git a/src/cpu/core/opcode_write.cpp b/bsnes/cpu/core/opcode_write.cpp similarity index 100% rename from src/cpu/core/opcode_write.cpp rename to bsnes/cpu/core/opcode_write.cpp diff --git a/src/cpu/core/registers.hpp b/bsnes/cpu/core/registers.hpp similarity index 100% rename from src/cpu/core/registers.hpp rename to bsnes/cpu/core/registers.hpp diff --git a/src/cpu/core/serialization.cpp b/bsnes/cpu/core/serialization.cpp similarity index 100% rename from src/cpu/core/serialization.cpp rename to bsnes/cpu/core/serialization.cpp diff --git a/src/cpu/core/table.cpp b/bsnes/cpu/core/table.cpp similarity index 100% rename from src/cpu/core/table.cpp rename to bsnes/cpu/core/table.cpp diff --git a/src/cpu/cpu-debugger.cpp b/bsnes/cpu/cpu-debugger.cpp similarity index 56% rename from src/cpu/cpu-debugger.cpp rename to bsnes/cpu/cpu-debugger.cpp index 738bf812..1736ebbf 100644 --- a/src/cpu/cpu-debugger.cpp +++ b/bsnes/cpu/cpu-debugger.cpp @@ -4,11 +4,11 @@ bool CPUDebugger::property(unsigned id, string &name, string &value) { unsigned n = 0; //internal - if(id == n++) { name = "S-CPU MDR"; value = string::printf("0x%.2x", mdr()); return true; } + if(id == n++) { name = "S-CPU MDR"; value = sprint("0x$", strhex<2>(mdr())); return true; } //$2181-2183 if(id == n++) { name = "$2181-$2183"; value = ""; return true; } - if(id == n++) { name = "WRAM Address"; value = string::printf("0x%.6x", wram_address()); return true; } + if(id == n++) { name = "WRAM Address"; value = sprint("0x$", strhex<6>(wram_address())); return true; } //$4016 if(id == n++) { name = "$4016"; value = ""; return true; } @@ -23,39 +23,39 @@ bool CPUDebugger::property(unsigned id, string &name, string &value) { //$4201 if(id == n++) { name = "$4201"; value = ""; return true; } - if(id == n++) { name = "PIO"; value = string::printf("0x%.2x", pio_bits()); return true; } + if(id == n++) { name = "PIO"; value = sprint("0x$", strhex<2>(pio_bits())); return true; } //$4202 if(id == n++) { name = "$4202"; value = ""; return true; } - if(id == n++) { name = "Multiplicand"; value = string::printf("0x%.2x", multiplicand()); return true; } + if(id == n++) { name = "Multiplicand"; value = sprint("0x$", strhex<2>(multiplicand())); return true; } //$4203 if(id == n++) { name = "$4203"; value = ""; return true; } - if(id == n++) { name = "Multiplier"; value = string::printf("0x%.2x", multiplier()); return true; } + if(id == n++) { name = "Multiplier"; value = sprint("0x$", strhex<2>(multiplier())); return true; } //$4204-$4205 if(id == n++) { name = "$4204-$4205"; value = ""; return true; } - if(id == n++) { name = "Dividend"; value = string::printf("0x%.4x", dividend()); return true; } + if(id == n++) { name = "Dividend"; value = sprint("0x$", strhex<4>(dividend())); return true; } //$4206 if(id == n++) { name = "$4206"; value = ""; return true; } - if(id == n++) { name = "Divisor"; value = string::printf("0x%.2x", divisor()); return true; } + if(id == n++) { name = "Divisor"; value = sprint("0x$", strhex<2>(divisor())); return true; } //$4207-$4208 if(id == n++) { name = "$4207-$4208"; value = ""; return true; } - if(id == n++) { name = "H-Time"; value = string::printf("0x%.4x", htime()); return true; } + if(id == n++) { name = "H-Time"; value = sprint("0x$", strhex<4>(htime())); return true; } //$4209-$420a if(id == n++) { name = "$4209-$420a"; value = ""; return true; } - if(id == n++) { name = "V-Time"; value = string::printf("0x%.4x", vtime()); return true; } + if(id == n++) { name = "V-Time"; value = sprint("0x$", strhex<4>(vtime())); return true; } //$420b if(id == n++) { name = "$420b"; value = ""; return true; } - if(id == n++) { name = "DMA Enable"; value = string::printf("0x%.2x", dma_enable()); return true; } + if(id == n++) { name = "DMA Enable"; value = sprint("0x$", strhex<2>(dma_enable())); return true; } //$420c if(id == n++) { name = "$420c"; value = ""; return true; } - if(id == n++) { name = "HDMA Enable"; value = string::printf("0x%.2x", hdma_enable()); return true; } + if(id == n++) { name = "HDMA Enable"; value = sprint("0x$", strhex<2>(hdma_enable())); return true; } //$420d if(id == n++) { name = "$420d"; value = ""; return true; } @@ -72,25 +72,25 @@ bool CPUDebugger::property(unsigned id, string &name, string &value) { if(id == n++) { name = "Transfer Mode"; value = dma_transfer_mode(i); return true; } //$43x1 - if(id == n++) { name = "B-Bus Address"; value = string::printf("0x%.4x", dma_bbus_address(i)); return true; } + if(id == n++) { name = "B-Bus Address"; value = sprint("0x$", strhex<4>(dma_bbus_address(i))); return true; } //$43x2-$43x3 - if(id == n++) { name = "A-Bus Address"; value = string::printf("0x%.4x", dma_abus_address(i)); return true; } + if(id == n++) { name = "A-Bus Address"; value = sprint("0x$", strhex<4>(dma_abus_address(i))); return true; } //$43x4 - if(id == n++) { name = "A-Bus Bank"; value = string::printf("0x%.2x", dma_abus_bank(i)); return true; } + if(id == n++) { name = "A-Bus Bank"; value = sprint("0x$", strhex<2>(dma_abus_bank(i))); return true; } //$43x5-$43x6 - if(id == n++) { name = "Transfer Size / Indirect Address"; value = string::printf("0x%.4x", dma_transfer_size(i)); return true; } + if(id == n++) { name = "Transfer Size / Indirect Address"; value = sprint("0x$", strhex<4>(dma_transfer_size(i))); return true; } //$43x7 - if(id == n++) { name = "Indirect Bank"; value = string::printf("0x%.2x", dma_indirect_bank(i)); return true; } + if(id == n++) { name = "Indirect Bank"; value = sprint("0x$", strhex<2>(dma_indirect_bank(i))); return true; } //$43x8-$43x9 - if(id == n++) { name = "Table Address"; value = string::printf("0x%.4x", dma_table_address(i)); return true; } + if(id == n++) { name = "Table Address"; value = sprint("0x$", strhex<4>(dma_table_address(i))); return true; } //$43xa - if(id == n++) { name = "Line Counter"; value = string::printf("0x%.2x", dma_line_counter(i)); return true; } + if(id == n++) { name = "Line Counter"; value = sprint("0x$", strhex<2>(dma_line_counter(i))); return true; } } return false; diff --git a/src/cpu/cpu-debugger.hpp b/bsnes/cpu/cpu-debugger.hpp similarity index 100% rename from src/cpu/cpu-debugger.hpp rename to bsnes/cpu/cpu-debugger.hpp diff --git a/src/cpu/cpu.cpp b/bsnes/cpu/cpu.cpp similarity index 100% rename from src/cpu/cpu.cpp rename to bsnes/cpu/cpu.cpp diff --git a/src/cpu/cpu.hpp b/bsnes/cpu/cpu.hpp similarity index 100% rename from src/cpu/cpu.hpp rename to bsnes/cpu/cpu.hpp diff --git a/src/cpu/scpu/debugger/debugger.cpp b/bsnes/cpu/scpu/debugger/debugger.cpp similarity index 87% rename from src/cpu/scpu/debugger/debugger.cpp rename to bsnes/cpu/scpu/debugger/debugger.cpp index 5209a7b2..a7b305f9 100644 --- a/src/cpu/scpu/debugger/debugger.cpp +++ b/bsnes/cpu/scpu/debugger/debugger.cpp @@ -8,10 +8,10 @@ void sCPUDebugger::op_step() { opcode_pc = regs.pc; if(debugger.step_cpu) { - debugger.break_event = Debugger::CPUStep; - scheduler.exit(Scheduler::DebuggerEvent); + debugger.break_event = Debugger::BreakEvent::CPUStep; + scheduler.exit(Scheduler::ExitReason::DebuggerEvent); } else { - debugger.breakpoint_test(Debugger::Breakpoint::CPUBus, Debugger::Breakpoint::Exec, regs.pc, 0x00); + debugger.breakpoint_test(Debugger::Breakpoint::Source::CPUBus, Debugger::Breakpoint::Mode::Exec, regs.pc, 0x00); } if(step_event) step_event(); @@ -22,7 +22,7 @@ void sCPUDebugger::op_step() { uint8 sCPUDebugger::op_read(uint32 addr) { uint8 data = sCPU::op_read(addr); usage[addr] |= UsageRead; - debugger.breakpoint_test(Debugger::Breakpoint::CPUBus, Debugger::Breakpoint::Read, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::CPUBus, Debugger::Breakpoint::Mode::Read, addr, data); return data; } @@ -30,7 +30,7 @@ void sCPUDebugger::op_write(uint32 addr, uint8 data) { sCPU::op_write(addr, data); usage[addr] |= UsageWrite; usage[addr] &= ~UsageExec; - debugger.breakpoint_test(Debugger::Breakpoint::CPUBus, Debugger::Breakpoint::Write, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::CPUBus, Debugger::Breakpoint::Mode::Write, addr, data); } sCPUDebugger::sCPUDebugger() { diff --git a/src/cpu/scpu/debugger/debugger.hpp b/bsnes/cpu/scpu/debugger/debugger.hpp similarity index 100% rename from src/cpu/scpu/debugger/debugger.hpp rename to bsnes/cpu/scpu/debugger/debugger.hpp diff --git a/src/cpu/scpu/dma/dma.cpp b/bsnes/cpu/scpu/dma/dma.cpp similarity index 100% rename from src/cpu/scpu/dma/dma.cpp rename to bsnes/cpu/scpu/dma/dma.cpp diff --git a/src/cpu/scpu/dma/dma.hpp b/bsnes/cpu/scpu/dma/dma.hpp similarity index 100% rename from src/cpu/scpu/dma/dma.hpp rename to bsnes/cpu/scpu/dma/dma.hpp diff --git a/src/cpu/scpu/memory/memory.cpp b/bsnes/cpu/scpu/memory/memory.cpp similarity index 100% rename from src/cpu/scpu/memory/memory.cpp rename to bsnes/cpu/scpu/memory/memory.cpp diff --git a/src/cpu/scpu/memory/memory.hpp b/bsnes/cpu/scpu/memory/memory.hpp similarity index 100% rename from src/cpu/scpu/memory/memory.hpp rename to bsnes/cpu/scpu/memory/memory.hpp diff --git a/src/cpu/scpu/mmio/mmio.cpp b/bsnes/cpu/scpu/mmio/mmio.cpp similarity index 100% rename from src/cpu/scpu/mmio/mmio.cpp rename to bsnes/cpu/scpu/mmio/mmio.cpp diff --git a/src/cpu/scpu/mmio/mmio.hpp b/bsnes/cpu/scpu/mmio/mmio.hpp similarity index 100% rename from src/cpu/scpu/mmio/mmio.hpp rename to bsnes/cpu/scpu/mmio/mmio.hpp diff --git a/src/cpu/scpu/scpu.cpp b/bsnes/cpu/scpu/scpu.cpp similarity index 92% rename from src/cpu/scpu/scpu.cpp rename to bsnes/cpu/scpu/scpu.cpp index 33953b4e..6dddc340 100644 --- a/src/cpu/scpu/scpu.cpp +++ b/bsnes/cpu/scpu/scpu.cpp @@ -18,9 +18,9 @@ namespace SNES { void sCPU::enter() { while(true) { - if(scheduler.sync == Scheduler::SyncCpu) { - scheduler.sync = Scheduler::SyncAll; - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::CPU) { + scheduler.sync = Scheduler::SynchronizeMode::All; + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } if(status.interrupt_pending) { diff --git a/src/cpu/scpu/scpu.hpp b/bsnes/cpu/scpu/scpu.hpp similarity index 100% rename from src/cpu/scpu/scpu.hpp rename to bsnes/cpu/scpu/scpu.hpp diff --git a/src/cpu/scpu/serialization.cpp b/bsnes/cpu/scpu/serialization.cpp similarity index 100% rename from src/cpu/scpu/serialization.cpp rename to bsnes/cpu/scpu/serialization.cpp diff --git a/src/cpu/scpu/timing/event.cpp b/bsnes/cpu/scpu/timing/event.cpp similarity index 100% rename from src/cpu/scpu/timing/event.cpp rename to bsnes/cpu/scpu/timing/event.cpp diff --git a/src/cpu/scpu/timing/irq.cpp b/bsnes/cpu/scpu/timing/irq.cpp similarity index 100% rename from src/cpu/scpu/timing/irq.cpp rename to bsnes/cpu/scpu/timing/irq.cpp diff --git a/src/cpu/scpu/timing/joypad.cpp b/bsnes/cpu/scpu/timing/joypad.cpp similarity index 100% rename from src/cpu/scpu/timing/joypad.cpp rename to bsnes/cpu/scpu/timing/joypad.cpp diff --git a/src/cpu/scpu/timing/timing.cpp b/bsnes/cpu/scpu/timing/timing.cpp similarity index 100% rename from src/cpu/scpu/timing/timing.cpp rename to bsnes/cpu/scpu/timing/timing.cpp diff --git a/src/cpu/scpu/timing/timing.hpp b/bsnes/cpu/scpu/timing/timing.hpp similarity index 100% rename from src/cpu/scpu/timing/timing.hpp rename to bsnes/cpu/scpu/timing/timing.hpp diff --git a/src/data/bsnes.Manifest b/bsnes/data/bsnes.Manifest similarity index 100% rename from src/data/bsnes.Manifest rename to bsnes/data/bsnes.Manifest diff --git a/src/data/bsnes.desktop b/bsnes/data/bsnes.desktop similarity index 100% rename from src/data/bsnes.desktop rename to bsnes/data/bsnes.desktop diff --git a/src/data/bsnes.ico b/bsnes/data/bsnes.ico similarity index 100% rename from src/data/bsnes.ico rename to bsnes/data/bsnes.ico diff --git a/src/data/bsnes.png b/bsnes/data/bsnes.png similarity index 100% rename from src/data/bsnes.png rename to bsnes/data/bsnes.png diff --git a/bsnes/data/cheats.xml b/bsnes/data/cheats.xml new file mode 100644 index 00000000..b1245109 --- /dev/null +++ b/bsnes/data/cheats.xml @@ -0,0 +1,48702 @@ + + + 3 Ninjas Kick Back (USA) + + Invincibility + EDEA-1F6B + 2DBF-4F6F + + + Infinite health + 7E0A2A06 + + + Infinite lives + C235-C768 + + + Infinite lives (alt) + 7E1E5114 + + + Infinite time + 7E1E6B14 + + + Infinite Bombs + 7E1E6314 + 7E1E6514 + + + Max coins + 7E1E5B14 + 7E1E5914 + + + Have throwing weapon + 7E0A0909 + + + + 7th Saga, The (USA) + + Human fighter has 50 HP + 7417-87AD + + + Human fighter has 100 HP + 1017-87AD + + + Human fighter has 200 HP + A617-87AD + + + Tetujin has 50 HP + 7416-8FAD + + + Tetujin has 100 HP + 1016-8FAD + + + Tetujin has 200 HP + A616-8FAD + + + Dwarf has 50 HP + 7419-8D0D + + + Dwarf has 100 HP + 1019-8D0D + + + Dwarf has 200 HP + A619-8D0D + + + Human mage has 50 HP + 741B-840D + + + Human mage has 100 HP + 101B-840D + + + Human mage has 200 HP + A61B-840D + + + Elf has 50 HP + 7411-8DAD + + + Elf has 100 HP + 1011-8DAD + + + Elf has 200 HP + A611-8DAD + + + Demon has 50 HP + 741C-84AD + + + Demon has 100 HP + 101C-84AD + + + Demon has 200 HP + A61C-84AD + + + Alien has 50 HP + 7415-8F0D + + + Alien has 100 HP + 1015-8F0D + + + Alien has 200 HP + A615-8F0D + + + Human fighter has 20 power + F010-8DAD + + + Tetujin has 20 power + F016-84AD + + + Dwarf has 20 power + F019-8F0D + + + Human mage has 20 power + F01B-870D + + + Elf has 20 power + F011-8FAD + + + Demon has 20 power + F01C-87AD + + + Alien has 20 power + F015-840D + + + Human fighter has 30 MP + F310-8D0D + + + Tetujin has 30 MP + F316-840D + + + Dwarf has 30 MP + F319-8DAD + + + Human mage has 30 MP + F31B-84AD + + + Elf has 30 MP + F311-8F0D + + + Demon has 30 MP + F31C-870D + + + Alien has 30 MP + F315-8FAD + + + Human fighter has 20 speed + F010-8F6D + + + Tetujin has 20 speed + F016-876D + + + Dwarf has 20 speed + F019-84DD + + + Human mage has 20 speed + F01C-8DDD + + + Elf has 20 speed + F011-846D + + + Demon has 20 speed + F018-8D6D + + + Alien has 20 speed + F015-87DD + + + Start with 297 gold + 4ABD-84AD + DFBD-87DD + + + Start with 62,708 gold + E0BD-84AD + DFBD-87DD + + + Start with 2,000 gold + 2DBD-84AD + D5BD-87DD + + + Human fighter starts with Sword of Anger + 1B10-870D + + + Human fighter starts with Sword of Courage + 1A10-870D + + + Human fighter starts with Sword of Fire + 1E10-870D + + + Dwarf starts with Sword of Nature + 1C19-87AD + + + Dwarf starts with Sword of Courage + 1A19-87AD + + + Dwarf starts with Sword of Fire + 1E19-87AD + + + Human mage starts with petrified staff + 631C-8FAD + + + Human mage starts with Rod of Tide + 6E1C-8FAD + + + Elf starts with petrified staff + 6315-8D0D + + + Elf starts with Staff of Brilliance + BF15-8D0D + + + Demon starts with Sword of Anger + 1B18-840D + + + Demon starts with Sword of Despair + 1218-840D + + + Demon starts with Sword of Fire + 1E18-840D + + + Enemies aren't generated + 18F6-EDDF + + + Touching an enemy doesn't cause a battle + 18F7-EF67 + + + Sell an item for maximum gold + 6D87-540D + + + Get 999 Max HP when you use a 'V Seed' + DDC1-7FBD + + + Get 999 Max MP when you use an 'M Seed' + DDC2-7F2D + + + Get 999 Power when you use a 'P Seed' + DDC0-54FD + + + Get 999 Guard when you use a 'Pr Seed' + DDC8-549D + + + Get 255 Magic when you use an 'I Seed' + DDC4-8FBD + + + + Aaahh!!! Real Monsters (USA) + + Invincibility + 62BE-0767 + + + Infinite health + C282-04A7 + + + Infinite health (alt) + 7E0B7A0D + + + Infinite Fish + C28E-DD67 + + + Infinite Books + 82AA-0F04 + + + Infinite Garbage + DD8E-4DD7 + + + Infinite Scares + DDAA-1464 + + + Get nothing for each Trash Bag + DDC8-0FAF + + + Get 20 for each Trash Bag + 4DC8-0FAF + + + Get 100 for each Trash Bag + 88C8-0FAF + + + Infinite lives + DDC0-3FDF + + + 1-ups worth nothing + DDCE-6F6D + + + 1-ups worth 3 + D7CE-6F6D + + + 1-ups worth 5 + D9CE-6F6D + + + Infinite lives + 7E13C809 + + + Start with 1 life + DFC7-17FC + + + Start with 10 lives + DBC7-17FC + + + Start with 50 lives + 0BC7-17FC + + + Start with 0 special scares + DD69-37BF + + + Start with 10 special scares + FD69-37BF + + + Start with 20 special scares + 4D69-37BF + + + Monster books are worth nothing + DDCA-AF0D + + + Monster books are worth 2 + D4CA-AF0D + + + Monster books are worth 10 + FDCA-AF0D + + + Most health power-ups worth nothing + DDCB-A7DD + + + Most health power-ups worth more + D4CB-A7DD + + + + Acrobat Mission (Japan) + + Infinite lives + 82C2-64DB + + + Invincibility + 3CC2-A766 + + + + Action Pachio (Japan) + + Invincibility + ED60-1FC9 + + + Infinite health + C96B-30DD + + + Infinite health (alt) + 7E00CC0A + + + Infinite time + C922-CFF3 + + + Infinite time (alt) + 7E00C063 + 7E00C163 + + + Infinite lives + C963-4D9A + + + Infinite lives (alt) + 7E00C809 + + + Infinite Coins + 7E00C299 + + + Infinite continue time + 7E1E1209 + + + Max score + 7E00C499 + 7E00C599 + 7E00C699 + 7E00C799 + + + + ActRaiser 2 (USA) + + Invincibility (blinking) + 7F205E18 + + + Infinite health from most enemies + C2B0-CF07 + + + Infinite health from some ground hazards + C2B2-C7D3 + + + Infinite health (alt) + 7E091D16 + + + Infinite time + DD33-476F + + + Infinite time (alt) (disable at end of level) + 7E094D63 + + + One hit kills + DDB3-C764 + + + Infinite MP (must have one to cast) + 3C65-CFA8 + + + Infinite lives + DD67-4468 + + + Start with 3 lives on Easy + D727-4DD1 + + + Start with 10 lives on Easy + FD27-4DD1 + + + Start with 50 lives on Easy + 9D27-4DD1 + + + Start with 1 life on Normal + DF27-4D61 + + + Start with 5 lives on Normal + D927-4D61 + + + Start with 10 lives on Normal + FD27-4D61 + + + Start with 50 lives on Normal + 9D27-4D61 + + + Start with 1 life on Hard + DF27-4FD1 + + + Start with 5 lives on Hard + D927-4FD1 + + + Start with 10 lives on Hard + FD27-4FD1 + + + Start with 50 lives on Hard + 9D27-4FD1 + + + Start with 2 MP on Easy + D484-1F66 + + + Start with 7 MP on Easy + D584-1F66 + + + Start with 9 MP on Easy + DB84-1F66 + + + Start with 1 MP on Normal or Hard + DF8F-1766 + + + Start with 5 MP on Normal or Hard + D98F-1766 + + + Start with 7 MP on Normal or Hard + D58F-1766 + + + Start with 9 MP on Normal or Hard + DB8F-1766 + + + Start with 1/2 health + DC8F-1F06 + + + Start with 3/4 health + DE8F-1F06 + + + Small magic power-up adds 3 instead of 1 + D7C0-37A7 + + + Small magic power-up adds 5 + D9C0-37A7 + + + Small magic power-up adds 9 + DBC0-37A7 + + + Large magic power-up adds 1 instead of 3 + DFC9-3407 + + + Large magic power-up adds 5 + D9C9-3407 + + + Large magic power-up adds 9 + DBC9-3407 + + + Small health power-ups add 1 instead of 2 + DFC7-3D67 + + + Small health power-ups add 4 + D0C7-3D67 + + + Small health power-ups add 15 + F9C7-3D67 + + + Small health power-ups heal completely + F0C7-3D67 + + + Medium health power-ups add 2 instead of 5 + D4C9-3FD7 + + + Medium health power-ups add 8 + D6C9-3FD7 + + + Medium health power-ups add 15 + F9C9-3FD7 + + + Medium health power-ups heal completely + F0C9-3FD7 + + + Large health power-ups add 2 instead of 10 + D4C7-3FA7 + + + Large health power-ups add 5 + D0C7-3FA7 + + + Large health power-ups add 15 + F9C7-3FA7 + + + + ActRaiser (USA) + + Invincibility after one hit + 1DBB-D4D7 + + + Almost invincible in action sequences + 2264-6FD4 + + + Infinite health in action sequences + 7E001D08 + + + Infinite health in sim mode + 7E028608 + + + Infinite magic in action sequences + 7E002105 + + + Infinite MP (Magic Points) + C9BD-6467 + + + Infinite SP (Spell Points) + CEA5-6DA3 + + + Start with 1/2 health (first game only) + D081-6DD8 + + + Infinite time + C98B-D468 + + + Infinite time (alt) + DD8B-D4D8 + + + Infinite time (alt 2) + 02BC9800 + + + Faster timer + FD86-D4A8 + + + Slower timer + 9D86-D4A8 + + + Have Sword Shot + 7E00E480 + + + One hit kills on bosses + 7E0BCC00 + + + Unlock professional mode + DD67-D7AD + + + Monster lairs are always empty + B38B-07D3 + + + Towns always able to grow + DD60-07A2 + + + Level 99 + 7E029163 + + + Have Fire magic and 24 MP in professional mode + 69C4-AF6C + 62C4-A7DC + CBC4-A46C + DFC4-A4AC + + + Have Stardust and 24 MP in professional mode + 69C4-AF6C + 62C4-A7DC + CBC4-A46C + D4C4-A4AC + + + Have Aura magic and 24 MP in professional mode + 69C4-AF6C + 62C4-A7DC + CBC4-A46C + D7C4-A4AC + + + Have Fire magic + 7E02AC01 + + + Have Stardust magic + 7E02AC02 + + + Have Aura magic + 7E02AC03 + + + Have Light magic + 7E02AC04 + + + Slot 1 - Source of Life + 7E02A205 + + + Slot 1 - Source of Magic + 7E02A206 + + + Slot 1 - Loaf of Bread + 7E02A207 + + + Slot 1 - Wheat + 7E02A208 + + + Slot 1 - Herb + 7E02A209 + + + Slot 1 - Bridge + 7E02A20A + + + Slot 1 - Harmonious Music + 7E02A20B + + + Slot 1 - Ancient Tablet + 7E02A20C + + + Slot 1 - Magic Skull + 7E02A20E + + + Slot 1 - Sheep's Fleece + 7E02A20F + + + Slot 1 - Bomb + 7E02A210 + + + Slot 1 - Compass + 7E02A213 + + + Slot 1 - Strength of Angel + 7E02A214 + + + Slot 2 - Source of Life + 7E02A305 + + + Slot 2 - Source of Magic + 7E02A306 + + + Slot 2 - Loaf of Bread + 7E02A307 + + + Slot 2 - Wheat + 7E02A308 + + + Slot 2 - Herb + 7E02A309 + + + Slot 2 - Bridge + 7E02A30A + + + Slot 2 - Harmonious Music + 7E02A30B + + + Slot 2 - Ancient Tablet + 7E02A30C + + + Slot 2 - Magic Skull + 7E02A30E + + + Slot 2 - Sheep's Fleece + 7E02A30F + + + Slot 2 - Bomb + 7E02A310 + + + Slot 2 - Compass + 7E02A313 + + + Slot 2 - Strength of Angel + 7E02A314 + + + Slot 3 - Source of Life + 7E02A405 + + + Slot 3 - Source of Magic + 7E02A406 + + + Slot 3 - Loaf of Bread + 7E02A407 + + + Slot 3 - Wheat + 7E02A408 + + + Slot 3 - Herb + 7E02A409 + + + Slot 3 - Bridge + 7E02A40A + + + Slot 3 - Harmonious Music + 7E02A40B + + + Slot 3 - Ancient Tablet + 7E02A40C + + + Slot 3 - Magic Skull + 7E02A40E + + + Slot 3 - Sheep's Fleece + 7E02A40F + + + Slot 3 - Bomb + 7E02A410 + + + Slot 3 - Compass + 7E02A413 + + + Slot 3 - Strength of Angel + 7E02A414 + + + Slot 4 - Source of Life + 7E02A505 + + + Slot 4 - Source of Magic + 7E02A506 + + + Slot 4 - Loaf of Bread + 7E02A507 + + + Slot 4 - Wheat + 7E02A508 + + + Slot 4 - Herb + 7E02A509 + + + Slot 4 - Bridge + 7E02A50A + + + Slot 4 - Harmonious Music + 7E02A50B + + + Slot 4 - Ancient Tablet + 7E02A50C + + + Slot 4 - Magic Skull + 7E02A50E + + + Slot 4 - Sheep's Fleece + 7E02A50F + + + Slot 4 - Bomb + 7E02A510 + + + Slot 4 - Compass + 7E02A513 + + + Slot 4 - Strength of Angel + 7E02A514 + + + Slot 5 - Source of Life + 7E02A605 + + + Slot 5 - Source of Magic + 7E02A606 + + + Slot 5 - Loaf of Bread + 7E02A607 + + + Slot 5 - Wheat + 7E02A608 + + + Slot 5 - Herb + 7E02A609 + + + Slot 5 - Bridge + 7E02A60A + + + Slot 5 - Harmonious Music + 7E02A60B + + + Slot 5 - Ancient Tablet + 7E02A60C + + + Slot 5 - Magic Skull + 7E02A60E + + + Slot 5 - Sheep's Fleece + 7E02A60F + + + Slot 5 - Bomb + 7E02A610 + + + Slot 5 - Compass + 7E02A613 + + + Slot 5 - Strength of Angel + 7E02A614 + + + Slot 6 - Source of Life + 7E02A705 + + + Slot 6 - Source of Magic + 7E02A706 + + + Slot 6 - Loaf of Bread + 7E02A707 + + + Slot 6 - Wheat + 7E02A708 + + + Slot 6 - Herb + 7E02A709 + + + Slot 6 - Bridge + 7E02A70A + + + Slot 6 - Harmonious Music + 7E02A70B + + + Slot 6 - Ancient Tablet + 7E02A70C + + + Slot 6 - Magic Skull + 7E02A70E + + + Slot 6 - Sheep's Fleece + 7E02A70F + + + Slot 6 - Bomb + 7E02A710 + + + Slot 6 - Compass + 7E02A713 + + + Slot 6 - Strength of Angel + 7E02A714 + + + Slot 7 - Source of Life + 7E02A805 + + + Slot 7 - Source of Magic + 7E02A806 + + + Slot 7 - Loaf of Bread + 7E02A807 + + + Slot 7 - Wheat + 7E02A808 + + + Slot 7 - Herb + 7E02A809 + + + Slot 7 - Bridge + 7E02A80A + + + Slot 7 - Harmonious Music + 7E02A80B + + + Slot 7 - Ancient Tablet + 7E02A80C + + + Slot 7 - Magic Skull + 7E02A80E + + + Slot 7 - Sheep's Fleece + 7E02A80F + + + Slot 7 - Bomb + 7E02A810 + + + Slot 7 - Compass + 7E02A813 + + + Slot 7 - Strength of Angel + 7E02A814 + + + Slot 8 - Source of Life + 7E02A905 + + + Slot 8 - Source of Magic + 7E02A906 + + + Slot 8 - Loaf of Bread + 7E02A907 + + + Slot 8 - Wheat + 7E02A908 + + + Slot 8 - Herb + 7E02A909 + + + Slot 8 - Bridge + 7E02A90A + + + Slot 8 - Harmonious Music + 7E02A90B + + + Slot 8 - Ancient Tablet + 7E02A90C + + + Slot 8 - Magic Skull + 7E02A90E + + + Slot 8 - Sheep's Fleece + 7E02A90F + + + Slot 8 - Bomb + 7E02A910 + + + Slot 8 - Compass + 7E02A913 + + + Slot 8 - Strength of Angel + 7E02A914 + + + + Addams Family, The - Pugsley's Scavenger Hunt (USA) + + Infinite health + 3CCC-446D + + + Infinite health (alt) + 7E009503 + + + Infinite hearts + 3CCC-446D + + + Infinite lives + DDB6-1FA7 + + + Infinite lives (alt) + 7E004D09 + + + Infinite Cash + 7E004E99 + + + Start with 1 heart (don't edit hearts in options menu) + DDED-D76D + + + Start with 2 hearts (don't edit hearts in options menu) + DFED-D76D + + + Start with 5 hearts (don't edit hearts in options menu) + D0ED-D76D + + + Start with 4 lives (don't edit lives in options menu) + DDED-D40D + + + Start with 16 lives (don't edit lives in options menu) + DBED-D40D + + + Start with 64 lives (don't edit lives in options menu) + 7DED-D40D + + + Each $ worth 5 + D9C9-476D + + + Each $ worth 25 + 49C9-476D + + + Get 0 lives for each $100 and 1-Up + DDB0-C767 + + + Get 2 lives for each $100 and 1-Up + D4B0-C767 + + + Higher jump + 3BA5-37D4 + D9A5-3704 + + + Super-jump + 3BA5-37D4 + D5A5-3704 + + + Mega-jump + 3BA5-37D4 + DBA5-3704 + + + Longer invulnerability time after being hit + 5EC8-4DDD + + + Shorter invulnerability time after being hit + D6C8-4DDD + + + + Addams Family, The (USA) + + Invincibility + 2DA7-670D + + + Infinite health and max hearts + 7E00C305 + + + Infinite health + 3CA7-A467 + + + Infinite health (alt) + 1DA7-A4A7 + + + Infinite health (alt 2) + C9A7-A4A7 + + + Infinite lives + DDA1-A4A7 + + + Infinite lives (alt) + C9A1-A7D7 + + + Start with 1 life + DFB8-6F04 + + + Start with 3 lives + D7B8-6F04 + + + Start with 9 lives + DBB8-6F04 + + + Start with 20 lives + 4DB8-6F04 + + + Start with 50 lives + 9DB8-6F04 + + + Start with 99 lives + BBB8-6F04 + + + Double-jump + DD87-0FA7 + + + Each $ worth 5 + D9CF-DDAF + + + Each $ worth 10 + FDCF-DDAF + + + Each $ worth 25 + 49CF-DDAF + + + Start with 1 heart + DF61-0F0D + DF61-0F6D + + + Start with 3 hearts + D761-0F0D + D761-0F6D + + + Start with 4 hearts + D061-0F0D + D061-0F6D + + + Start with 5 hearts + D961-0F0D + D961-0F6D + + + Start with and keep Fezi-copter (disable after defeating a boss, land before password screen) + 3CAD-A46D + 60BA-6704 + + + Always throw Balls + 7E00EF01 + + + Have Fezi-copter + 7E0064FF + + + + Addams Family Values (USA) (En,Fr,De) + + Infinite health against enemies + FFBD-C767 + + + Infinite health against everything + 3C8F-C40D + + + Infinite Small Rocks + DD24-3D0F + + + Infinite Blue Marbles + DD2C-C7AF + + + Infinite Magic Seeds + DD22-CF0F + + + Infinite Swamp Slime + DD2E-C4AF + + + Infinite cookies + 8E2A-1D6D + + + Start new game with full skull meter + FA62-3F0D + + + Start a new game with all items + EE6C-320D + + + Have Amulet of True Sight + 7EE9FCFF + + + Have Big Book of Bisquits + 7EE9F0FF + + + Have Black Beetle Cookies + 7EE9E0FF + 7EE9E4FF + + + Have Black Egg + 7EEA05FF + + + Have Black Rose + 7EE9FAFF + + + Have Bone Spoon + 7EE9F7FF + + + Have Book of Flying + 7EE9F9FF + + + Have Candle + 7EE9F6FF + + + Have Clyde's Cookie Compendium + 7EE9EFFF + + + Have Crumble Cookies + 7EE9E2FF + 7EE9E6FF + + + Have Crusty Cookies + 7EE9E1FF + 7EE9E5FF + + + Have Dragon Belch Cookies + 7EE9DFFF + 7EE9E3FF + + + Have Firefly + 7EEA03FF + + + Have Gold Coin + 7EEA06FF + + + Have Green Key + 7EE9D8FF + + + Have Greenhouse Key + 7EE9D7FF + + + Have Headless Teddy + 7EE9F4FF + + + Have Iron Key + 7EE9DEFF + + + Have Jewelled Key + 7EE9DBFF + + + Have Journal + 7EE9F2FF + + + Have Large Vine + 7EEA02FF + + + Have Lurch's Bowling Ball + 7EEA04FF + + + Have Magnet + 7EE9FFFF + + + Have Max's Munch Manual + 7EE9F1FF + + + Have Money + 7E004E63 + + + Have Musical Box + 7EE9FBFF + + + Have Plant Food + 7EE9EAFF + + + Have Portal Potion + 7EE9E8FF + + + Have Pumpkin + 7EE9F3FF + + + Have Red Potion + 7EE9E7FF + + + Have Sack of Gold + 7EE9F5FF + + + Have Slimming Potion + 7EE9E9FF + + + Have Shockwave + 7EE9FDFF + + + Have Skull Rattle + 7EE9F8FF + + + Have Skull Key + 7EE9D9FF + + + Have Spider Key + 7EE9DDFF + + + Have Spider's Eye + 7EE9FEFF + + + Have Stone Button + 7EEA01FF + + + Have Stone Key + 7EE9DCFF + + + Have Stone Twig Key + 7EE9DAFF + + + + Adventures of Batman & Robin, The (USA) + + Invincibility (except after being grabbed) + 2DC7-1DAD + + + Infinite health + C982-4F0D + + + Infinite health (alt) + DD8A-4D6D + + + Infinite health (alt 2) + 7E009828 + + + Get full health from hearts + 466B-4494 + + + Infinite Stars + C9A1-34AF + + + Infinite Spray Gun ammo + C9A5-34DF + + + Infinite Plastic Explosives + C9AB-3D6F + + + Infinite Smoke Bombs + C9A6-3F0F + + + Infinite Missiles + DDA1-34AF + + + Infinite Bombs + DDAB-3D6F + + + Infinite item #3 + 7E00A009 + + + Infinite item #4 + 7E00A209 + + + Infinite item #5 + 7E00A409 + + + Infinite item #6 + 7E00A609 + + + Infinite lives + C988-340D + + + Start with 9 lives - not on easy mode + DB86-4FC9 + + + Start with 6 lives - not on easy mode + D186-4FC9 + + + Start with 1 life - not on easy mode + DD86-4FC9 + + + Start with 9 credits + DB86-4D19 + + + Start with 6 credits + D186-4D19 + + + No credits + DD86-4D19 + + + Don't start with any Stars and Spray Gun ammo + DDB3-376F + + + Start with 25 Stars and Spray Gun ammo + FBB3-376F + + + Start with 50 Stars and Spray Gun ammo + 77B3-376F + + + Don't start with any Explosives and Smoke Bomb ammo + DDBE-3F0F + + + Start with 25 Explosives and Smoke Bomb ammo + FBBE-3F0F + + + Start with 50 Explosives and Smoke Bomb ammo + 77BE-3F0F + + + Moon-jump + 4DAF-14DF + + + Super-jump + E6C7-34DF + + + Move slower + DD8D-C765 + EE8F-CDD5 + + + Move faster + D08D-C765 + E88F-CDD5 + + + Move even faster + D58D-C765 + E68F-CDD5 + + + Moon-walk + E38D-C765 + DF8F-CDD5 + + + Moon-walk faster + E88D-C765 + D08F-CDD5 + + + Moon-walk even faster + E68D-C765 + E58F-CDD5 + + + + Adventures of Dr. Franken, The (USA) + + Invincibility + 3CBB-CDD7 + + + Health power-ups give a full health bar + D3A0-1404 + 62A5-1464 + + + Infinite time + C220-C7A4 + + + Infinite lives + C2B9-C4AD + + + Infinite Power Balls + 3CB5-14AF + + + Infinite Freeze + 3CBB-1F0F + + + Infinite Fire + 3CBB-1D0F + + + Infinite Lightning + 3CB5-1FAF + + + + Adventures of Kid Kleets, The (USA) (En,Fr,Es) + + Invincibility + 1DA6-14A0 + + + Infinite time + C26A-3709 + + + Infinite health + C2A6-1700 + + + Infinite lives + C282-34A1 + + + + Adventures of Rocky and Bullwinkle and Friends, The (USA) + + Invincibility + 2DCA-19E4 + EDCA-1554 + + + Infinite chances + C28C-1F44 + + + Infinite lives + C2CE-CF61 + + + Infinite ammo + C2CF-CF01 + + + Infinite health + C2CF-308D + + + Infinite continues + C2E3-47C6 + + + Don't lose ammo when you die + C2C9-35ED + + + Don't lose collected flags when you die + C2C7-C18D + + + 1-Up with every flag collected + DFCA-1761 + + + + Adventures of Yogi Bear (USA) + + Infinite health + C2CD-1404 + + + Infinite lives + C269-47DD + + + + Aerobiz (USA) + + In scenario 1, Tokyo starts with $649,280,000 + DDA6-0DFD + + + In scenario 1, Tokyo starts with $7,202,880,000 + D9A6-0DFD + + + In scenario 1, Beijing starts with $420,160,000 + 94A6-0D2D + + + In scenario 1, Beijing starts with $7,393,600,000 + D9A6-0FFD + + + In scenario 1, Hong Kong starts with $449,440,000 + 95A6-0F2D + + + In scenario 1, Hong Kong starts with $7,453,600,000 + D9A6-04FD + + + In scenario 1, Singapore starts with $400,640,000 + 03A6-042D + + + In scenario 1, Singapore starts with $7,353,600,000 + D9A6-07FD + + + In scenario 1, Sydney starts with $297,920,000 + 7CA6-072D + + + In scenario 1, Sydney starts with $7,153,600,000 + D9AB-0DFD + + + In scenario 1, Delhi starts with $317,440,000 + 73AB-0D2D + + + In scenario 1, Delhi starts with $7,193,600,000 + D9AB-0FFD + + + In scenario 1, Tehran starts with $239,360,000 + 43AB-0F2D + + + In scenario 1, Tehran starts with $7,033,600,000 + D9AB-04FD + + + In scenario 1, Cairo starts with $249,120,000 + 7DAB-042D + + + In scenario 1, Cairo starts with $7,053,600,000 + D9AB-07FD + + + In scenario 1, Nairobi starts with $200,320,000 + 45AB-072D + + + In scenario 1, Nairobi starts with $6,953,600,000 + D9AC-0DFD + + + In scenario 1, Lagos starts with $229,600,000 + 4AAC-0D2D + + + In scenario 1, Lagos starts with $7,013,600,000 + D9AC-0FFD + + + In scenario 1, Moscow starts with $289,280,000 + DDAC-04FD + + + In scenario 1, Moscow starts with $6,842,880,000 + D9AC-04FD + + + In scenario 1, London starts with $949,280,000 + DDAC-07FD + + + In scenario 1, London starts with $7,502,880,000 + D9AC-07FD + + + In scenario 1, Paris starts with $289,280,000 + DDA8-0DFD + + + In scenario 1, Paris starts with $6,842,880,000 + D9A8-0DFD + + + In scenario 1, Rome starts with $371,360,000 + 06A8-0D2D + + + In scenario 1, Rome starts with $7,293,600,000 + D9A8-0FFD + + + In scenario 1, New York starts with $189,280,000 + DDA8-04FD + + + In scenario 1, New York starts with $6,742,880,000 + D9A8-04FD + + + In scenario 1, Vancouver starts with $258,880,000 + 74A8-042D + + + In scenario 1, Vancouver starts with $7,073,600,000 + D9A8-07FD + + + In scenario 1, Los Angeles starts with $649,280,000 + DDAA-0DFD + + + In scenario 1, Los Angeles starts with $7,202,880,000 + D9AA-0DFD + + + In scenario 1, Honolulu starts with $268,640,000 + 70AA-0D2D + + + In scenario 1, Honolulu starts with $7,093,600,000 + D9AA-0FFD + + + In scenario 1, Mexico City starts with $258,880,000 + 74AA-0F2D + + + In scenario 1, Mexico City starts with $7,073,600,000 + D9AA-04FD + + + In scenario 1, Lima starts with $180,800,000 + 47AA-042D + + + In scenario 1, Lima starts with $6,913,600,000 + D9AA-07FD + + + In scenario 1, Rio de Janeiro starts with $317,440,000 + 73AA-072D + + + In scenario 1, Rio de Janeiro starts with $7,193,600,000 + D9A2-0DFD + + + In scenario 1, Buenos Aires starts with $210,080,000 + 4BA2-0D2D + + + In scenario 1, Buenos Aires starts with $6,973,600,000 + D9A2-0FFD + + + In scenario 2, Tokyo starts with $1,149,280,000 + DDA2-04FD + + + In scenario 2, Tokyo starts with $7,702,880,000 + D9A2-04FD + + + In scenario 2, Beijing starts with $498,240,000 + 1FA2-042D + + + In scenario 2, Beijing starts with $7,553,600,000 + D9A2-07FD + + + In scenario 2, Hong Kong starts with $649,760,000 + 53A2-072D + + + In scenario 2, Hong Kong starts with $7,853,600,000 + D9A3-0DFD + + + In scenario 2, Singapore starts with $552,160,000 + 18A3-0D2D + + + In scenario 2, Singapore starts with $7,653,600,000 + D9A3-0FFD + + + In scenario 2, Sydney starts with $581,440,000 + 5FA3-0F2D + + + In scenario 2, Sydney starts with $7,713,600,000 + D9A3-04FD + + + In scenario 2, Delhi starts with $517,760,000 + 19A3-042D + + + In scenario 2, Delhi starts with $7,593,600,000 + D9A3-07FD + + + In scenario 2, Tehran starts with $297,920,000 + 7CA3-072D + + + In scenario 2, Tehran starts with $7,153,600,000 + D9AE-0DFD + + + In scenario 2, Cairo starts with $390,880,000 + 0AAE-0D2D + + + In scenario 2, Cairo starts with $7,333,600,000 + D9AE-0FFD + + + In scenario 2, Nairobi starts with $249,120,000 + 7DAE-0F2D + + + In scenario 2, Nairobi starts with $7,053,600,000 + D9AE-04FD + + + In scenario 2, Lagos starts with $299,040,000 + 7CAE-042D + + + In scenario 2, Lagos starts with $7,149,600,000 + D9AE-07FD + + + In scenario 2, Moscow starts with $689,280,000 + DDAD-6DFD + + + In scenario 2, Moscow starts with $7,242,880,000 + D9AD-6DFD + + + In scenario 2, London starts with $38,560,000 + DDAD-6FFD + + + In scenario 2, London starts with $6,592,160,000 + D9AD-6FFD + + + In scenario 2, Paris starts with $909,280,000 + DDAD-64FD + + + In scenario 2, Paris starts with $7,462,880,000 + D9AD-64FD + + + In scenario 2, Rome starts with $571,680,000 + 1EAD-642D + + + In scenario 2, Rome starts with $7,693,600,000 + D9AD-67FD + + + In scenario 2, New York starts with $829,280,000 + DDAF-6DFD + + + In scenario 2, New York starts with $7,382,880,000 + D9AF-6DFD + + + In scenario 2, Vancouver starts with $420,160,000 + 94AF-6D2D + + + In scenario 2, Vancouver starts with $7,393,600,000 + D9AF-6FFD + + + In scenario 2, Los Angeles starts with $1,109,280,000 + DDAF-64FD + + + In scenario 2, Los Angeles starts with $7,662,880,000 + D9AF-64FD + + + In scenario 2, Honolulu starts with $381,120,000 + 0CAF-642D + + + In scenario 2, Honolulu starts with $7,313,600,000 + D9AF-67FD + + + In scenario 2, Mexico City starts with $468,960,000 + 98AF-672D + + + In scenario 2, Mexico City starts with $7,493,600,000 + D9A4-6DFD + + + In scenario 2, Lima starts with $258,880,000 + 74A4-6D2D + + + In scenario 2, Lima starts with $7,073,600,000 + D9A4-6FFD + + + In scenario 2, Rio de Janeiro starts with $630,240,000 + 58A4-6F2D + + + In scenario 2, Rio de Janeiro starts with $7,813,600,000 + D9A4-64FD + + + In scenario 2, Buenos Aires starts with $361,600,000 + 01A4-642D + + + In scenario 2, Buenos Aires starts with $7,273,600,000 + D9A4-67FD + + + + Aero Fighters (USA) + + Invincibility + 82C2-4D64 + + + Infinite lives - both players + 8229-37A0 + + + Don't lose power-ups when you die - both players + 8229-37D0 + + + Infinite Bombs for American F-18 - P1 + 8237-47A1 + + + Infinite Bombs for Japanese FSX - P1 + 8237-47A9 + + + Infinite Bombs for Swedish AJ-37 - P1 + 8237-1D09 + + + Infinite Bombs for British AV-8 - P1 + 8237-17A9 + + + Infinite Bombs for American F-15 - P2 + 823E-3D60 + + + Infinite Bombs for Japanese F-15 - P2 + 823A-4D09 + + + Infinite Bombs for Swedish JAS-39 - P2 + 8239-1FD9 + + + Infinite Bombs for British IDS - P2 + 823D-C769 + + + Infinite lives (alt) + 7FB78C02 + + + Max Cannon power + 7FB79403 + + + + Aero the Acro-Bat 2 (USA) + + Invincibility + 2DB0-4D6D + + + Infinite health + A287-CFAE + + + Almost infinite health + C287-CFAE + + + Infinite lives + C26C-4D0F + + + Infinite Stars + C227-4DDE + + + Infinite Shots + DD24-476E + + + Stars worth 3 + D7C8-17D3 + + + Stars worth 5 + D9C8-17D3 + + + Stars worth 7 + D5C8-17D3 + + + Double Drill icon lasts 99 seconds + BBC2-C463 + + + Double Drill icon lets you drill 4 times instead of 2 + D0C2-CD03 + + + Double Drill icon lets you drill 9 times instead of 2 + DBC2-CD03 + + + Can drill 5 times in the air until you pick-up a drill icon + D936-4DF1 + + + Can drill 9 times in the air until you pick-up a drill icon + DB36-4DF1 + + + Drill as many times as you want without hitting the ground + C26E-4F03 + + + Move faster + D468-CDAA + E26A-CD0A + + + Move even faster + D768-CDAA + EA6A-CD0A + + + Jump higher + FD67-3DD2 + + + Super-jump when standing still + E66E-4F62 + E661-C762 + + + Flying icon worth 99 seconds of flight time + BBC3-3D63 + + + Start each life with max health + D939-14F1 + + + + Aero the Acro-Bat (USA) + + Infinite health from most enemies + 3CED-3DDC + + + Start with more health + 1A27-4D03 + + + Infinite time + DDEC-146A + + + Infinite lives + DD6B-37AF + + + Start with 19 lives + 5D68-4FDD + + + Infinite continues + C26E-3724 + + + Each star platform is worth 4 + D034-C7AD + + + + Air Cavalry (USA) + + Infinite lives + 3DE8-AD64 + + + Infinite 7.62mm rounds + 82B7-D7A7 + + + + Aladdin (USA) + + Invincibility + 2D3A-4D01 + + + Invincibility (alt) + 7E034704 + + + Almost invincible + C267-4D0A + + + Infinite health + A267-4D0A + + + Infinite lives + A221-4FA5 + C221-4FA5 + + + Infinite Apples + C2A9-C7D5 + 3CA9-C4A5 + + + Infinite Apples (alt) + 7E036999 + + + Moon-jump + 7E08FB16 + + + Start with 1 life + DF64-1DD0 + + + Start with 5 lives + D964-1DD0 + + + Start with 20 lives + F064-1DD0 + + + Start with 1 continue + DFB8-3F07 + + + Start with 5 continues + D9B8-3F07 + + + Start with 9 continues + DCB8-3F07 + + + Infinite continues + C283-37DD + + + Start with 2 health + D464-14A0 + + + Start with 5 health + D964-14A0 + + + Start with 7 health + D564-14A0 + + + Emeralds worth 2 instead of 1 + FA80-44AE + + + Emeralds worth 3 (don't use with Rubies worth 1 code) + FB80-44AE + + + Rubies worth 1 instead of 3 + A381-4F0E + + + Rubies worth 2 + C281-4F0E + + + Only 10 gems needed for health increase/free life + FD86-4F6E + + + Only 20 gems needed for health increase/free life + 4D86-4F6E + + + Only 30 gems needed for health increase/free life + 7D86-4F6E + + + Only 40 gems needed for health increase/free life + 0D86-4F6E + + + Only 50 gems needed for health increase/free life + 9D86-4F6E + + + Only 60 gems needed for health increase/free life + 1D86-4F6E + + + Only 90 gems needed for health increase/free life + BD86-4F6E + + + Start with 5 Apples + D967-1F60 + + + Start with 20 Apples + 4D67-1F60 + + + Apple power-ups worth 20 instead of 10 + 4D8B-4DD3 + + + Apple power-ups worth 50 + 9D8B-4DD3 + + + Apple power-ups worth 90 + BD8B-4DD3 + + + Bonus round played after every level + DDA7-4DD5 + + + + Alien 3 (USA) + + Invincibility + DD69-1FD0 + + + Infinite energy + 6D64-1D60 + + + Take less damage + D464-1D60 + + + Most attacks do no damage + DD64-1D60 + + + Longer invulnerability after being hit + EE6B-CD00 + + + Slower fuel consumption for flame thrower + EE26-37D4 + + + Faster fuel consumption for flame thrower + 7D26-37D4 + + + Infinite oil for flame thrower + 3C25-3704 + + + Infinite flame thrower + C22A-17D1 + + + Infinite machine-gun + 8B28-4404 + + + Infinite missiles + 8B22-3DA4 + + + Infinite ammo for pulse rifle + 3C28-44D4 + + + Infinite ammo for grenade launcher + 3C22-3D64 + + + Start with more rifle clips + FD36-44D1 + + + Start with even more rifle clips + 4D36-44D1 + + + Start with fewer rifle clips + D036-44D1 + + + Start with more grenade clips + FD3B-4F01 + + + Start with even more grenade clips + 4D3B-4F01 + + + Start with fewer grenade clips + D03B-4F01 + + + Less ammo in rifle clips (works with extra clips only, not the ones you start with) + 742A-44A4 + + + More ammo in rifle clips (works with extra clips only, not the ones you start with) + CD2A-44A4 + + + Less ammo in grenade clips (works with extra clips only, not the ones you start with) + D923-3D64 + + + More ammo in grenade clips (works with extra clips only, not the ones you start with) + F023-3D64 + + + Maximum energy from medi-kits + DD6D-1700 + + + Less energy from medi-kits + D76D-1DA0 + + + Mission 1 completed + 7E0FDEFF + + + Mission 2 completed + 7E0FF0FF + + + Mission 3 completed + 7E0FF2FF + + + Mission 4 completed + 7E0FF4FF + + + Mission 5 completed + 7E0FF6FF + + + Mission 6 completed + 7E0FF8FF + + + Mission 7 completed + 7E0FFAFF + + + Mission 8 completed + 7E0FFCFF + + + + Alien vs. Predator (USA) + + Infinite health + 1DB3-6727 + C236-0DDD + + + Infinite health (alt) + 7E102464 + + + No damage taken from punches + C236-0DDD + + + No damage taken from jumping attacks, tail attacks, rushes + C238-0FDD + + + Infinite lives + C286-A70D + + + Infinite lives (alt) + DD86-A70D + + + Infinite continues + 3CEA-67D8 + + + One hit kills most enemies + DFB5-AD67 + 7E1125FF + 7E1AA5FF + + + Start on level 1-2 + D4EE-A766 + + + Start on level 2-1 + D7EE-A766 + + + Start on level 3-1 + D0EE-A766 + + + Start on level 4-1 + D9EE-A766 + + + Start on level 5-1 + D1EE-A766 + + + Start on level 5-2 + D5EE-A766 + + + Start on level 5-3 + D6EE-A766 + + + Start on level 6-1 + DBEE-A766 + + + Start on level 6-2 + DCEE-A766 + + + Start with full health bar on Standard level + EEB5-6404 + EEB5-64A4 + + + Start with full health bar on Novice level + EEB5-6704 + EEB5-67A4 + + + Start with full health bar on Advanced level + EEB6-6D04 + EEB6-6DA4 + + + Start with full health bar on Expert level + EEB6-6F04 + EEB6-6FA4 + + + Start with up to 9 lives on Options screen (selecting downward from 1 goes to 6) + DB8F-AD9D + + + Start with up to 30 continues on Options screen (selecting downward from 0 goes to 3) + F38F-AD2D + + + Disc power-ups give 1 disc instead of 6 (handicap) + DF83-64AF + + + Disc power-ups give 3 discs + D783-64AF + + + Disc power-ups give 10 discs + DC83-64AF + + + Disc power-ups give 25 discs + FB83-64AF + + + Spear power-ups give 1 spear instead of 6 + DF8E-6D6F + + + Spear power-ups give 3 spears + D78E-6D6F + + + Spear power-ups give 10 spears + DC8E-6D6F + + + Spear power-ups give 25 spears + FB8E-6D6F + + + Spear and disc power-ups last until end of level (can't pick up other power-ups) + EDCA-0DD4 + + + Rhynth meat doesn't add to your maximum health + C282-6FDF + + + Rhynth meat adds 1/2 as much to maximum health (handicap) + D08A-6F6F + + + Rhynth meat adds 2x as much to maximum health + FD8A-6F6F + + + Rhynth meat adds 4x as much to maximum health + 4D8A-6F6F + + + Rhynth meat adds nothing to your current health + DD82-67DF + + + Rhynth meat adds half as much to current health + D082-67DF + + + Rhynth meat adds 2x as much to current health + FD82-67DF + + + Rhynth meat adds 4x as much to current health + 4D82-67DF + + + Ptera meat doesn't heal + C28D-A40F + + + Blue bottles don't heal at all + 1D8D-A7AF + + + Blue bottles heal 1/2 of your health instead of 1/4 + 3C8F-A76F + + + Blue bottles heal completely + DD84-A4DF + + + Light laser can be fired instantly + DFB1-A4D7 + + + Medium laser is fired above 3rd line instead of 2nd + F6B1-A707 + + + Medium laser can be fired above 1st line + D9B5-ADD7 + + + Medium laser can be fired below 1st line - eliminates light laser + DCB1-A4A7 + + + No damage is taken from using heavy laser + F6B5-AF07 + + + Heavy laser can be fired above 2nd line - eliminates medium laser + DFB5-AD67 + + + + Amazing Spider-Man, The - Lethal Foes (Japan) + + Infinite health + 7E0E0C40 + + + Infinite lives + 7E1C2309 + + + Infinite time + 7E1C2263 + + + + American Tail, An - Fievel Goes West (USA) + + Infinite health + 2D60-DD8F + + + Invincibility + 2D6D-D4EF + + + Invincibility (alt) + CB6D-D47F + + + Infinite lives + C2C5-6FDF + + + Infinite time + 3CC4-A4DF + + + Walk left faster + E867-AF5D + + + Walk right faster + D06E-6DED + + + Multi-jumps + DD65-0D84 + + + + Animaniacs (USA) + + Every coin gives you 999 saved slot rotations + DFC8-3D0C + + + Every second coin gives you 99 continues + D4CE-37AC + + + Every slot machine roll gives you 99 continues + D9CE-37AC + + + Super-jump and float + CBBF-47DA + D6BF-470A + DFBF-476A + + + + Arcana (USA) + + Start with 60,000 gold pieces + 1D69-AFD0 + 3C69-AF00 + + + Start with 250 gold pieces + EC69-AFD0 + DD69-AF00 + + + Infinite money for weapons + C225-0F02 + + + Infinite money for items + C22A-0402 + + + Infinite money for rooms + C229-640E + + + Infinite money for elixir + C22F-A7DE + + + Level and statistics for all characters in group are increased after each battle you win + B387-DFF2 + + + Magic points don't decrease + 828B-AF2E + + + + Ardy Lightfoot (USA) + + Invincibility + 2D3F-446D + 2D8F-3407 + + + Infinite lives + C268-CF0D + + + + Arkanoid - Doh It Again (USA) + + Infinite lives + 82B8-1704 + + + S capsule gives you the longest paddle + D762-14D5 + + + S capsule gives you the laser paddle + D062-14D5 + + + Force field lasts until end of level + C2BD-3F60 + + + Keep current paddle when you get force field + DD66-CFA5 + + + + Art of Fighting (USA) + + Infinite health + CB3C-57AF + 3E38-5DDF + 6238-5D0F + + + Infinite time + C235-5DA4 + + + + A.S.P. - Air Strike Patrol (USA) + + No damage from enemy fire + C22A-CD01 + C534-CDD0 + + + Infinite fuel + C2B1-3765 + + + Infinite flares + C237-CFA1 + + + Infinite missles for F-15 Strike Eagle + C2B8-4DA9 + + + Infinite missles for A-10 Thunderbolt II + C2B7-C4D9 + + + + Axelay (USA) + + Invincibility + 2D87-AD04 + EDA6-AFDD + + + Infinite lives + A2AE-DF6D + + + Infinite lives (alt) + C2AE-DF6D + C28F-04D7 + + + Infinite lives (alt 2) + 7E005E02 + + + Infinite credits + C2C5-DDDF + + + Don't lose weapon when hit + 8285-AF07 + 82AA-676D + + + Start with 1 credit + D766-D7A7 + + + Start with 2 credits + D066-D7A7 + + + Start with 3 credits + D966-D7A7 + + + Start with 4 credits + D166-D7A7 + + + Start with 6 credits + D666-D7A7 + + + Start with 7 credits + DB66-D7A7 + + + Start with 8 credits + DC66-D7A7 + + + Start with 9 credits + D866-D7A7 + + + Start with 1 life + DF21-AD04 + + + Start with 2 lives + D421-AD04 + + + Start with 5 lives + D921-AD04 + + + Start with 7 lives + D521-AD04 + + + Start with 9 lives + DB21-AD04 + + + Start with 15 lives + DE21-AD04 + + + Start with 25 lives + FB21-AD04 + + + Start with 50 lives + 7421-AD04 + + + Start with 75 lives + 0821-AD04 + + + Start with 99 lives + 1721-AD04 + + + Start on Stage 2 + CBB7-AFA7 + DFB7-A4D7 + DDB7-A407 + + + Start on Stage 3 + CBB7-AFA7 + D4B7-A4D7 + DDB7-A407 + + + Start on Stage 4 + CBB7-AFA7 + D7B7-A4D7 + DDB7-A407 + + + Start on Stage 5 + CBB7-AFA7 + D0B7-A4D7 + DDB7-A407 + + + Start on Stage 6 + CBB7-AFA7 + D9B7-A4D7 + DDB7-A407 + + + Have 1st weapon - Straight Laser + 7E033002 + + + Have 1st weapon - Round Vulcan + 7E033003 + + + Have 1st weapon - Wind Laser + 7E033005 + + + Have 1st weapon - Explosion Bomb + 7E033006 + + + Have 1st weapon - Macro Missiles + 7E033007 + + + Have 1st weapon - Cluster Bomb + 7E033009 + + + Have 1st weapon - Morning Star + 7E03300A + + + Have 1st weapon - Needle Cracker + 7E03300B + + + Have 2nd weapon - Straight Laser + 7E033202 + + + Have 2nd weapon - Round Vulcan + 7E033203 + + + Have 2nd weapon - Wind Laser + 7E033205 + + + Have 2nd weapon - Explosion Bomb + 7E033206 + + + Have 2nd weapon - Macro Missiles + 7E033207 + + + Have 2nd weapon - Cluster Bomb + 7E033209 + + + Have 2nd weapon - Morning Star + 7E03320A + + + Have 2nd weapon - Needle Cracker + 7E03320B + + + Have 3rd weapon - Straight Laser + 7E033402 + + + Have 3rd weapon - Round Vulcan + 7E033403 + + + Have 3rd weapon - Wind Laser + 7E033405 + + + Have 3rd weapon - Explosion Bomb + 7E033406 + + + Have 3rd weapon - Macro Missiles + 7E033407 + + + Have 3rd weapon - Cluster Bomb + 7E033409 + + + Have 3rd weapon - Morning Star + 7E03340A + + + Have 3rd weapon - Needle Cracker + 7E03340B + + + + Ballz 3D - Fighting at Its Ballziest (USA) + + Always fight Kronk + CB82-EF0D + D082-EF6D + DD82-EFAD + + + Always fight Boomer + CB82-EF0D + D682-EF6D + DD82-EFAD + + + Always fight Bruiser + CB82-EF0D + DA82-EF6D + DD82-EFAD + + + Always fight Turbo + CB82-EF0D + FD82-EF6D + DD82-EFAD + + + Always fight Tsunami + CB82-EF0D + F082-EF6D + DD82-EFAD + + + Always fight Yoko + CB82-EF0D + F682-EF6D + DD82-EFAD + + + Always fight Divine + CB82-EF0D + FA82-EF6D + DD82-EFAD + + + Always fight Crusher + CB82-EF0D + 4D82-EF6D + DD82-EFAD + + + Start rounds with 10 seconds + DC78-E7AD + + + Start rounds with 20 seconds + F078-E7AD + + + Start rounds with 30 seconds + F378-E7AD + + + Start rounds with 40 seconds + 4678-E7AD + + + Start rounds with 50 seconds + 7478-E7AD + + + Start rounds with 60 seconds + 7A78-E7AD + + + Start rounds with 70 seconds + 0178-E7AD + + + Infinite time + C295-ED64 + C296-E7D4 + + + Start with with 1/4 energy + 4EDC-7760 + + + Start with with 1/2 energy + 9EDC-7760 + + + Start with with 3/4 energy + BEDC-7760 + + + + Barbie Super Model (USA) + + Infinite chances + C229-DF07 + + + + Bassin's Black Bass (USA) + + Always catch a 60.32 pound fish + CBCA-A4D3 + + + Always catch a 75.68 pound fish + CBCA-A4D3 + D3CA-A463 + + + Always catch a largemouth bass + CBC8-A403 + DDC8-A463 + 3CC8-A4A3 + + + + BASS Masters Classic - Pro Edition (USA) + + Start with $65,380 + EE40-BA86 + + + + Batman Forever (USA) + + Infinite health + 7E132C57 + + + Infinite lives + 7E001709 + + + One hit kills enemy #1 + 7E133000 + + + Straight low punches are super strong + EE22-C70B + + + Straight high punches are super strong + EE20-3D0B + + + Straight low kicks are super strong + EE29-4F0B + + + Straight high kicks are super strong + EE2C-44AB + + + Crouching low punches are super strong + EE26-14AC + + + Crouching high punches are super strong + EE30-3FA6 + + + Crouching low kicks are super strong + EE3F-3D06 + + + Crouching high kicks are super strong + EE3A-CF06 + + + Straight low punches do no damage + DD22-C70B + + + Straight high punches do no damage + DD20-3D0B + + + Straight low kicks do no damage + DD29-4F0B + + + Straight high kicks do no damage + DD2C-44AB + + + Crouching low punches do no damage + DD26-14AC + + + Crouching high punches do no damage + DD30-3FA6 + + + Crouching low kicks do no damage + DD3F-3D06 + + + Crouching high kicks do no damage + DD3A-CF06 + + + Start with half energy after your first life + 4D2C-4D07 + 4DCE-1465 + + + Start with 1 life + DDB3-47D4 + + + Start with 3 lives + D4B3-47D4 + + + Start with 10 lives + DBB3-47D4 + + + Play as an Inmate + F43C-3B10 + + + Play as a Clown + F03C-3B10 + + + Play as Two-Face + F63C-3B10 + + + Play as a Riddler Thug + FC3C-3B10 + + + + Batman Returns (USA) + + Invincibility + 2DAA-1FA4 + + + Infinite health + C9A7-C7A4 + + + Infinite lives + C9A5-1764 + + + Start with 9 + DB68-4F00 + + + Infinite lives (only 3/4 view levels) + C9A5-1764 + + + Start with 6 test tubes + D16F-4464 + D1C0-4DD7 + + + Start with 9 test tubes + DB6F-4464 + DBC0-4DD7 + + + Protection from some hazards + C9A7-C404 + + + Cape sweep uses up no health + DDAE-3707 + + + Spear gun uses up no health + DD2F-4FAD + + + Cape sweep uses up more health + FDAE-3707 + + + Spear gun uses up more health + FD2F-4FAD + + + Maximum health from hearts + DD2E-3D6B + + + Cape sweep does more damage + F9CF-4F05 + + + Normal punch does more damage + F9CD-4705 + + + Normal knee does more damage + F9CD-4765 + + + Jump kick does more damage + F9CF-4D05 + F9CF-4DD5 + + + Cape sweep does mega-damage + 7DCF-4F05 + + + Normal punch does mega-damage + 7DCD-4705 + + + Normal knee does mega-damage + 7DCD-4765 + + + Jump kick does mega-damage + 7DCF-4D05 + 7DCF-4DD5 + + + Cape sweep does less damage + D4CF-4F05 + + + Normal punch does less damage + D4CD-4705 + + + Normal knee does less damage + D4CD-4765 + + + + Batman - Revenge of the Joker (USA) (Proto) + + Invincibility + 2DA7-4460 + + + Infinite health + C2EF-1FA8 + + + Infinite health (alt) + 7E035307 + 7E035507 + + + Infinite lives + 8263-44DD + + + Infinite lives (alt) + 7E035603 + 7E035803 + + + + Battle Blaze (USA) + + Infinite continues + C285-D4AB + + + Infinite health (disable at end of round) - P1 + 7E06DCC0 + + + Infinite health (disable at end of round) - P2 + 7E0704C0 + + + No health - P1 + 7E06DC00 + + + + Battle Clash (USA) + + Infinite health + C234-3FD3 + + + Infinite health - P1 + 7E15C080 + + + Protection from most enemy attacks + C234-3FD3 + + + Infinite time + C268-CFA5 + + + One hit kills + 7E15A000 + + + Weapon charges faster + D9A9-1DA7 + + + Weapon charges much faster + FDA9-1DA7 + + + Once charged, weapon always stays charged + 1DAA-3FAF + + + Start in Cairo instead of New York + 33EE-3D1F + + + Fight Garam at New York + CBAB-CDA0 + DDAB-CF00 + DDAB-CFD0 + + + Fight Scarab at Cairo + CBAB-CDA0 + DDAB-CF00 + DFAB-CFD0 + + + Fight Lorca at London + CBAB-CDA0 + DDAB-CF00 + D4AB-CFD0 + + + Fight Artemis at Andes + CBAB-CDA0 + DDAB-CF00 + D7AB-CFD0 + + + Fight Schneider at Kyoto + CBAB-CDA0 + DDAB-CF00 + D0AB-CFD0 + + + Fight Ivan at Oceania + CBAB-CDA0 + DDAB-CF00 + D9AB-CFD0 + + + Fight Valius at Babel + CBAB-CDA0 + DDAB-CF00 + D1AB-CFD0 + + + Fight Baron at Moonbase Luna + CBAB-CDA0 + DDAB-CF00 + D5AB-CFD0 + + + + Battletoads & Double Dragon - The Ultimate Team (USA) + + Invincibility (blinking) - P1 + 7E11127F + + + Infinite health - P1 + 7E003A2F + + + Infinite lives - P1 + 7E002605 + + + Infinite lives + 40B8-04AF + + + Start with 2 lives + DF60-D76D + + + Start with 10 lives + DB60-D76D + + + Enemies have less health + DE6E-1466 + + + Start on level 2 with 11 lives + DD65-DD0D + CB66-D46D + DF66-D4AD + + + Start on level 3 with 11 lives + DD65-DD0D + CB66-D46D + D466-D4AD + + + Start on level 4 with 11 lives + DD65-DD0D + CB66-D46D + D766-D4AD + + + Start on level 5 with 11 lives + DD65-DD0D + CB66-D46D + D066-D4AD + + + Start on level 6 with 11 lives + DD65-DD0D + CB66-D46D + D966-D4AD + + + Abobo has less health + 4EB7-1DD6 + + + Big Blag has less health + 4EB3-C4DB + + + Roper has less health + D7BA-3FA8 + + + Robo-Manus has less health + D7C5-3F66 + + + + Battletoads in Battlemaniacs (USA) + + Invincibility + 2D20-34A8 + + + Invincibility in motorcycle levels + C2B4-3F68 + + + Infinite health + 228E-34A0 + 2280-4DD9 + + + Infinite health - P1 + 7E108E0A + + + Infinite health - P2 + 7E10900A + + + Infinite lives + 8286-CF01 + + + Start with 2 lives + DF6D-0D0D + + + Start with 6 lives + D96D-0D0D + + + Start with 10 lives + DB6D-0D0D + + + Infinite lives - both players (except level 2, does not work on falling) + 8986-CF01 + + + Infinite lives when falling + 8026-CD08 + + + Start with 0 continues + DD6D-04AD + + + Start with 5 continues + D96D-04AD + + + Start with 9 continues + DB6D-04AD + + + Infinite continues - P1 + C96A-346F + + + Infinite continues - P2 + C96B-34DF + + + Longer invincibility after getting hit + 6D20-34A8 + + + Take less damage from hits + 8280-4DD9 + + + Protection against most strength level 1 hits + 82A7-3FAF + + + Protection against most strength level 2 hazards + 8982-CFD1 + + + + Bazooka Blitzkrieg (USA) + + Fewer missiles picked up + D9AC-1706 + + + More missiles picked up + F0AC-1706 + + + Only 10 missiles picked up (Set missiles to 10) + DCAB-14A6 + DCAB-17A6 + + + 30 missiles allowed + F3AB-14A6 + F3AB-17A6 + + + Immune to most damage + 4AB5-3DAF + + + Less energy picked up from 'L' pods + D4AF-1406 + + + More energy picked up from 'L' pods + DCAF-1406 + + + A lot more energy picked up from 'L' pods + 4EAF-1406 + + + + Beauty and the Beast (USA) + + Invincibility (disable to pick up rocks, spikes still do damage) + 3CC0-376A + 3CC0-37AA + + + Invincibility (but you can't pick up objects) + 2D6F-4DA0 + + + Invincibility after one hit + 3C6F-4F00 + + + Infinite health + C2C8-3D0A + + + Infinite time + C269-6407 + + + Infinite flower time + C265-6407 + + + Infinite continues + C2E0-DF0F + + + Don't take damage from some enemies + 3CC8-3D0A + + + No loss of light when the candle runs off the screen + 4AC8-47A8 + + + Death flash time is longer + EE66-4FAA + + + + Beavis and Butt-Head (USA) + + Invincibility after first hit + 82EA-A4D1 + + + Almost infinite health + C22C-AF08 + + + Start with half health (1st life) + D16C-0D0D + + + Start with half health (after 1st life) + D161-AF0D + + + Gun power-ups worth 30 + 7DA8-C7DC + + + Gun power-ups worth 5 + D9A8-C7DC + + + Infinite lives + C267-A70D + + + Start with 2 life + DF6C-040D + + + Start with 4 lives + D76C-040D + + + Start with 10 lives + DB6C-040D + + + + Beethoven - The Ultimate Canine Caper! (USA) + + Infinite health + 823F-3D01 + + + Infinite time + 8224-1705 + + + Infinite lives + 82C8-3464 + + + Infinite health (alt) + 7E162804 + + + Infinite time (alt) + 7E165463 + + + Infinite lives (alt) + 7E15C609 + + + + Best of the Best - Championship Karate (USA) + + Almost infinite health + D68F-AD65 + + + Infinite special moves + 828D-D409 + + + Start with 1 special move + DFC3-6D69 + + + Start with 8 special moves + D6C3-6D69 + + + No special moves - P2 + BAC3-6F69 + + + Can play with any boxer - P1 (can't use special moves or get password) + D4C3-0DAD + + + Less strength + DCC3-0FDD + + + Less resistance + DCC3-0F0D + + + Less reflexes + DCC3-0F6D + + + More strength + 74C3-0FDD + + + More resistance + 74C3-0F0D + + + More reflexes + 74C3-0F6D + + + Infinite time + 7E1A3909 + + + No health - P2 + 7E022200 + + + max Reflexes + 7E045963 + + + Max Resistance + 7E045563 + + + Max Strength + 7E045763 + + + + Biker Mice from Mars (USA) + + Infinite ammo + 3CB8-4F63 + + + Infinite cash + 8E89-C7DB + + + Infinite Shield/Armor + 82B8-C76D + + + Infinite Skull effect + C263-CDDA + + + Infinite Star effect + 8289-4F03 + + + Infinite Stopwatch effect + C26C-47D2 + + + Infinite ammo (alt) + 7E17C603 + + + Max Engines + 7EFE3805 + + + Max Tires + 7EFE3C05 + + + Max Armor + 7EFE4005 + + + Max Tornado Shots + 7E1F8863 + + + Always finish 1st + 7E092800 + + + + Bill Laimbeer's Combat Basketball (USA) + + 2-point shots worth 3, 3-point shots worth 4 + 76BF-A4AF + + + All shots worth 1 point + 1BBF-A7DF + DFBF-A70F + + + All shots worth 3 points + 1BBF-A7DF + D7BF-A70F + + + All shots worth 4 points + 1BBF-A7DF + D0BF-A70F + + + All shots worth 5 points + 1BBF-A7DF + D9BF-A70F + + + All shots worth 6 points + 1BBF-A7DF + D1BF-A70F + + + Each half is 0:30 instead of 1:30 + DDB4-67DF + + + Each half is 2:30 + D4B4-67DF + + + Each half is 3:30 + D7B4-67DF + + + Each half is 4:30 + D0B4-67DF + + + Start with $65,296 instead of $10,000 + EEC5-6F16 + + + Start with $8,398,608 + 6DC5-64C6 + + + Start with $16,721,680 + EEC5-64C6 + + + No money is deducted from your total when you trade a player + C2BE-6D4B + C2BE-644B + + + Trade players for free + C2BE-6D4B + C2BE-644B + 6DBE-AD4B + + + Timer continues to count when it is normally stopped + DDB7-67DF + + + + Blackthorne (USA) + + Infinite health + 7E0FC518 + + + Infinite items (enable after obtaining first item, disable before getting next item, repeat this process) + 89C6-1FD4 + + + 3rd slot item mod + 7E187A03 + + + + BlaZeon - The Bio-Cyborg Challenge (USA) + + Invincibility + 2D6D-A700 + + + Infinite lives + 82B4-D4DD + + + Infinite lives (alt) + C2B4-D4DD + C2BD-64AD + + + Start with 1 ship + DD6E-6707 + + + Start with 2 ships + DF6E-6707 + + + Start with 4 ships + D76E-6707 + + + Start with 5 ships + D06E-6707 + + + Start with 7 ships + D16E-6707 + + + Start with 10 ships + DB6E-6707 + + + Start with 26 ships + FB6E-6707 + + + Start on Stage 2 + DF6D-6D07 + + + Start on Stage 3 + D46D-6D07 + + + Start on Stage 4 + D76D-6D07 + + + Start on Stage 5 + D06D-6D07 + + + Mars has infinite atomic shields + C2C7-D7A7 + + + + Blues Brothers, The (USA) + + Invincibility + 1DB3-14DF + + + Infinite health (1P game) + 82A3-3F0D + + + Infinite health (2P game) + 82AE-14D7 + + + Infinite lives + 828F-34DF + + + Infinite time + C2B3-3764 + + + Infinite Discs + 8289-CFDF + + + + Bobby's World (USA) (Proto) + + Invincibility + 2DB7-1DD8 + + + Infinite health + 82BC-1468 + + + Infinite lives + 822D-17AF + + + Infinite health (alt) + 7E139B03 + + + Infinite lives (alt) + 7E139509 + + + + B.O.B. (USA) + + Infinite health (P) + C221-0D6D + + + Infinite health (P) (alt) + 7E022130 + + + Infinite E + 7E022230 + + + Infinite lives + 826E-0F0D + + + Infinite lives (alt) + 4A6E-0F0D + + + Infinite time + C267-C0DD + + + Infinite time (alt) + 7E0F423B + + + Infinite weapons + 8B37-A704 + + + Infinite Remotes + 8BC7-3FE5 + + + Infinite Remotes (alt) + 3CC7-3F85 + + + Infinite Remotes (alt 2) + 8DAF36EA + + + Infinite weapons (except for Flame) + 3C37-A7D4 + + + Infinite weapons (except for Flame) (alt) + 00EB3CEA + + + Infinite Flash Remotes + 7E020963 + + + Infinite Shield Remotes + 7E020A63 + + + Infinite Umbrella Remotes + 7E020B63 + + + Infinite Spring Remotes + 7E020C63 + + + Infinite Helicopter Hat Remotes + 7E020D63 + + + Infinite Floating Bomb Remotes + 7E020E63 + + + Max weapons on pick-up (alt) + 8DA24C00 + + + Max weapons on pick-up + DDC0-C770 + + + Slow down timer + CD61-0D64 + + + Speed up timer + 7961-0D64 + + + Start with 20 3-way + F0A6-1D59 + + + Start with 20 Flame + F0A6-1FE9 + + + Start with 20 Rocket + F0A6-1759 + + + Start with 20 Bolt + F0AB-1DE9 + + + Start with 20 Wave + F0AB-1459 + + + Start with 3 Flash Remotes + DDA8-1F89 + + + Start with 3 Shield Remotes + DFA8-1F89 + + + Start with 3 Umbrella Remotes + D4A8-1F89 + + + Start with 3 Helicopter Hat Remotes + D0A8-1F89 + + + Start with 3 Floating Bomb Remotes + D9A8-1F89 + + + Start with 6 of selected remote + D1A8-1479 + + + Start with 15 of selected remote + DEA8-1479 + + + Start with 1 life + DD66-0DDD + + + Start with 9 lives + D666-0DDD + + + Start with 6 lives + D966-0DDD + + + + Bonkers (USA) + + Invincibility + 2DCD-C404 + + + Infinite health + 89C4-1DDF + + + Infinite bombs + C9AB-CFDD + + + Infinite lives + C963-CD0F + + + Infinite dash + C98C-CD0F + + + + Boxing Legends of the Ring (USA) + + Infinite full stanima + 7E05AF0F + + + Infinite super punches - P1 + C26D-3F05 + + + Infinite super punches - P2 or CPU + C260-C4A9 + + + Infinite strength beads + DD2B-17D9 + C229-C4D9 + + + Infinite time per round + C2BA-A7A7 + + + Each round is 1 minute + DF8D-CDA7 + + + Each round is 2 minutes + D48D-CDA7 + + + Each round is 4 minutes + D08D-CDA7 + + + Each round is 5 minutes + D98D-CDA7 + + + Each round is 6 minutes + D18D-CDA7 + + + Both fighters start with no super punches + DD87-C4D4 + + + Both fighters start with 2 super punches + D487-C4D4 + + + Both fighters start with 3 super punches + D787-C4D4 + + + Create a stronger left jab + 6DEE-CF4E + + + Create a stronger left hook body + 6DEE-CFCE + + + Create a stronger left hook head + 6DEE-C44E + + + Create a stronger left uppercut + 6DEE-C4CE + + + Create a stronger right cross body + 6DEE-C74E + + + Create a stronger right cross head + 6DEE-C7CE + + + Create a stronger right uppercut + 6DED-3D4E + + + Start on round 5 + 338F-C7A4 + + + Start on round 12 + A38F-C7A4 + + + + Brainies, The (USA) + + Infinite time + C262-0DD4 + + + Infinite continues + C262-67AF + + + Start with and always have 9 Jokers + DBCC-6F6D + + + + Brain Lord (USA) + + 9999 HP + 7E08C20F + 7E08C327 + + + 9999 Max HP + 7E08C40F + 7E08C527 + + + 255 Power + 7E08CAFF + + + Have the best status + 7E08DD00 + + + Move faster, same effect as wearing the Cloak + 7E08D407 + + + Infinite G + 7E037697 + + + Can access 13 spells + 7E08D10D + + + Have Magic Shot spell + 7E091002 + + + Have Magic Shield spell + 7E091103 + + + Have Flame Ring spell + 7E091204 + + + Have Fireball spell + 7E091305 + + + Have Impulse spell + 7E091406 + + + Have Lightning spell + 7E091507 + + + Have Magic Missile spell + 7E091608 + + + Have Bound spell + 7E091709 + + + Have Ice spell + 7E09180A + + + Have Phaser spell + 7E09190B + + + Have Slow spell + 7E091A0E + + + Have Stop spell + 7E091B0F + + + Have Ghost spell + 7E091C10 + + + Quick spell charge + 7E08C701 + + + Have the Iron Sword + 7E092101 + 7E092002 + + + Have the Steel Buster + 7E092101 + 7E092003 + + + Have the Platinum Sword + 7E092101 + 7E092005 + + + Have the Battle Axe + 7E092101 + 7E092006 + + + Have the Tomahawk + 7E092101 + 7E092007 + + + Have the Rock Breaker + 7E092101 + 7E092008 + + + Have the Great Axe + 7E092101 + 7E092009 + + + Have the Boomerang + 7E092101 + 7E09200A + + + Have the Chuckler + 7E092101 + 7E09200B + + + Have the Mornin Star + 7E092101 + 7E09200C + + + Have the Heavy Mall + 7E092101 + 7E09200D + + + Have the Long Bow + 7E092101 + 7E09200E + + + Have the Silver Bow + 7E092101 + 7E09200F + + + Have the Lightning Bow + 7E092101 + 7E092010 + + + Have the Fire Sword + 7E092101 + 7E092012 + + + Have the Iron Helmet + 7E092302 + 7E092202 + + + Have the Cross Helmet + 7E092302 + 7E092203 + + + Have the Blackgold Helm + 7E092302 + 7E092204 + + + Have the Warrior's Helm + 7E092302 + 7E092205 + + + Have the Platinum Helm + 7E092302 + 7E092206 + + + Have the Nameless Helm + 7E092302 + 7E092207 + + + Have the Nameless Helm + 7E092302 + 7E092208 + + + Have the Nameless Helm + 7E092302 + 7E092209 + + + Have the Chain Mail + 7E092503 + 7E092402 + + + Have the Banded Mail + 7E092503 + 7E092403 + + + Have the Bone Mail + 7E092503 + 7E092404 + + + Have the Plate Armor + 7E092503 + 7E092405 + + + Have the Royal Armor + 7E092503 + 7E092406 + + + Have the Cape + 7E092503 + 7E092407 + + + Have the Nameless Armor + 7E092503 + 7E092408 + + + Have the Nameless Armor + 7E092503 + 7E092409 + + + Have the Round Shield + 7E092704 + 7E092602 + + + Have the Kite Shield + 7E092704 + 7E092603 + + + Have the Bone Shield + 7E092704 + 7E092604 + + + Have the Warrior Shield + 7E092704 + 7E092605 + + + Have the Battle Shield + 7E092704 + 7E092606 + + + Have the Shield + 7E092704 + 7E092607 + + + Have the Reviving Mirror + 7E092905 + 7E092801 + + + Have the Debug Mirror (a debug item) + 7E092905 + 7E092802 + + + Have the Wind Shoes + 7E092905 + 7E092803 + + + Have the Spike Boots + 7E092905 + 7E092804 + + + Have the Life Jade + 7E092B06 + 7E092A01 + + + Have the Crimson Jade + 7E092B06 + 7E092A02 + + + Have the Foundation Jade + 7E092B06 + 7E092A03 + + + Have the Power Jade + 7E092B06 + 7E092A04 + + + Have the Lightning Jade + 7E092B06 + 7E092A05 + + + Have the Anger Jade + 7E092B06 + 7E092A06 + + + Have the Water Jade + 7E092B06 + 7E092A07 + + + Have the Deceased Jade + 7E092B06 + 7E092A08 + + + Have the Light Jade + 7E092B06 + 7E092A09 + + + Have the Key to the Seal + 7E092D07 + 7E092C01 + + + Have the 3rd floor Key + 7E092D07 + 7E092C02 + + + Have the 4th floor Key + 7E092D07 + 7E092C03 + + + Have the Puzzle Key + 7E092D07 + 7E092C04 + + + Have the Crossroads Key + 7E092D07 + 7E092C05 + + + Have the Sky Room Key + 7E092D07 + 7E092C06 + + + Have the Cave Room Key + 7E092D07 + 7E092C07 + + + Have the Dark Room Key + 7E092D07 + 7E092C08 + + + Have the Basement Key + 7E092D07 + 7E092C09 + + + Have the Detour Key + 7E092D07 + 7E092C0A + + + Have the Bottomless Key + 7E092D07 + 7E092C0B + + + Have the Distance Key + 7E092D07 + 7E092C0C + + + Have the Office Key + 7E092D07 + 7E092C0D + + + Have the Flyer's Key + 7E092D07 + 7E092C0E + + + Have the Steel Sky Key + 7E092D07 + 7E092C0F + + + Have the Invisible Key + 7E092D07 + 7E092C10 + + + Have the Underground Key + 7E092D07 + 7E092C11 + + + Have the Control Key + 7E092D07 + 7E092C12 + + + Have the Preparation Key + 7E092D07 + 7E092C13 + + + Have the Laboratory Key + 7E092D07 + 7E092C14 + + + Have the Power Room Key + 7E092D07 + 7E092C15 + + + Have the Oblivion Key + 7E092D07 + 7E092C16 + + + Have the Western Sky Key + 7E092D07 + 7E092C1F + + + Have the Ocean Key + 7E092D07 + 7E092C20 + + + Have the Under Ice Key + 7E092D07 + 7E092C21 + + + Have the Waterfall Key + 7E092D07 + 7E092C22 + + + Have the Flood Gate Key + 7E092D07 + 7E092C23 + + + Have the Wave Key + 7E092D07 + 7E092C24 + + + Have the Ice Key + 7E092D07 + 7E092C25 + + + Have the Water-Air Key + 7E092D07 + 7E092C26 + + + Have the Red Wing Key + 7E092D07 + 7E092C27 + + + Have the 1st Gate Key + 7E092D07 + 7E092C28 + + + Have the 2nd Gate Key + 7E092D07 + 7E092C29 + + + Have the 3rd Gate Key + 7E092D07 + 7E092C2A + + + Have the Sky Dragon Key + 7E092D07 + 7E092C2B + + + Have the Land Dragon Key + 7E092D07 + 7E092C2C + + + Have the Sea Dragon Key + 7E092D07 + 7E092C2D + + + Have the Dead Dragon Key + 7E092D07 + 7E092C2E + + + Have the Silence Key + 7E092D07 + 7E092C33 + + + Have the Castle Key + 7E092D07 + 7E092C34 + + + Have the Endless Key + 7E092D07 + 7E092C35 + + + Have the Spirit Key + 7E092D07 + 7E092C36 + + + Have the Destruction Key + 7E092D07 + 7E092C37 + + + Have the Platinum Key + 7E092D07 + 7E092C38 + + + Have the Night Key + 7E092D07 + 7E092C39 + + + Have the Afterworld Key + 7E092D07 + 7E092C3A + + + Have the Entropy Key + 7E092D07 + 7E092C3B + + + Have the Fountain Key + 7E092D07 + 7E092C3C + + + Have the Duplicate Key + 7E092D07 + 7E092C3E + + + + Bram Stoker's Dracula (USA) + + Infinite health + C263-0F2F + + + Infinite lives + C268-ADBF + + + Infinite pistol ammo + C92B-A4DA + + + Infinite shotgun ammo + C926-64AA + + + Infinite missile weapon + C927-D762 + + + Turbo walking + 3CC2-6F6D + + + One hit kills on enemies, except bosses + 6D68-DFFF + + + Freeze most ground enemies + 4AA8-64D4 + + + Freeze most aerial enemies + 4AAB-6F64 + + + Start at the final battle + FDEC-0F03 + + + + Brandish (USA) + + Have over 10,000,000 gold + FD53-A3D7 + + + Sell an item for max gold + D484-1405 + 6D84-14D5 + + + Luck stays maxed out + 6D3B-4FD2 + + + Map gets filled when entering a level + 6D02-770B + 3C02-776B + + + + Brawl Brothers (USA) + + Invincibility and infinite special attack + 6D63-1791 + DF63-17B1 + + + Infinite energy + A961-3DB1 + + + + Breath of Fire II (USA) + + Infinite HP in battle + C9FA-EFA6 + + + Infinite AP In menu + 8E64-EDAA + + + Infinite AP In battle + 8BDA-8DDC + + + Main character is different + 46DA-87D4 + 45DA-87D4 + FDDA-87D4 + F4DA-87D4 + F0DA-87D4 + + + Start with 50 HP + 74DA-8F64 + + + Start with 100 HP + 10DA-8F64 + + + Start with 150 HP + B1DA-8F64 + + + Start with 250 HP + ECDA-8F64 + + + Start with 500 HP + DFDA-8FA4 + E0DA-8F64 + + + Start with 750 HP + D4DA-8FA4 + 33DA-8F64 + + + Start with a lot of HP + FEDA-8FA4 + + + Start with 50 AP + 74DA-8464 + + + Start with 100 AP + 10DA-8464 + + + Start with 150 AP + B1DA-8464 + + + Start with 250 AP + ECDA-8464 + + + Start with 500 AP + DFDA-84A4 + E0DA-8464 + + + Start with 750 AP + D4DA-84A4 + 33DA-8464 + + + Start with a lot of AP + FEDA-84A4 + + + Start with 0 strength + DDDA-8704 + + + Start with Mega strength + EEDA-8704 + + + Start with 0 stamina + DDDA-8764 + + + Start with Mega stamina + EEDA-8764 + + + Start with 0 agility + DDDA-87A4 + + + Start with Mega agility + EEDA-87A4 + + + Start with 0 wisdom + DDD3-84D4 + + + Start with Mega wisdom + EED3-84D4 + + + Start with 0 luck + DDD3-8404 + + + Start with Mega luck + EED3-8404 + + + Start with Mega experience points + EED3-87D4 + + + + Breath of Fire (USA) + + Invincibility + 60AE-C46A + + + 9999 EXP after every battle + 336F-172D + + + Infinite usable items in menu + DEEE-C0B4 + + + Create a new character that starts at level 5 + D9BF-CD69 + + + Create a new character that starts with 153 max HP + BBBF-CFD9 + + + Create a new character that starts with 153 HP + BBBF-CF69 + + + Create a new character that starts with 20 max AP + F0BF-C4D9 + + + Create a new character that starts with 20 AP + F0BF-C469 + + + Create a new character that starts with INT at 22 + F1B4-CD09 + + + Create a new character that starts with Agility at 22 + F1B4-CD69 + + + Create a new character that starts with Fate at 40 + 46B4-CFD9 + + + Create a new character that starts with strength at 50 + 74BF-C7A9 + + + Create a new character that starts with Vigor at 50 + 74B4-CDD9 + + + + BS Zelda no Densetsu - Dai-3-wa (Japan) (BS) + + Disable the 57 minute time limit + 3CDD-7F5D + 3CDD-7F8D + 6DDD-7FED + + + + Bubsy II (USA) + + Infinite health + 8FD5-EDD4 + + + Invincibility + 62E5-5F0F + + + Infinite lives + C2D8-7DAF + + + Infinite time in most main levels + C217-8DD7 + C21F-87A7 + + + Infinite time in some bonus levels + C25C-740D + + + Infinite Warp Holes + C2DE-54D0 + + + Infinite Diving Suits + C212-57AD + + + Infinite Smart Bombs + C271-7DD0 + + + Infinite health (alt) + 7E118804 + + + Infinite lives (alt) + 7E342209 + + + + Bubsy in Claws Encounters of the Furred Kind (USA) + + Numbered t-shirts worth one more + 766C-1766 + + + Infinite lives + DDB1-175C + + + Start with 1 life + DD34-4D6D + + + Start with 5 lives + D034-4D6D + + + Start with 25 lives + 4034-4D6D + + + Start with 50 lives + 9D34-4D6D + + + Start with 75 lives + 5934-4D6D + + + Each yarn ball worth 0 + DD60-1FD6 + + + Each yarn ball worth 5 + D960-1FD6 + + + Each yarn ball worth 10 + FD60-1FD6 + + + Crate of yarn holds 0 instead of 25 + DD69-4F6C + + + Crate of yarn holds 50 + 9D69-4F6C + + + Crate of yarn holds 75 + 5969-4F6C + + + Crate of yarn holds 99 + BB69-4F6C + + + Start on chapter 2 + DF6D-472A + + + Start on chapter 3 + D46D-472A + + + Start on chapter 4 + D76D-472A + + + Start on chapter 5 + D06D-472A + + + Start on chapter 6 + D96D-472A + + + Start on chapter 7 + D16D-472A + + + Start on chapter 8 + D66D-472A + + + Start on chapter 9 + DC6D-472A + + + Start on chapter 10 + DA6D-472A + + + Start on chapter 11 + D26D-472A + + + Start on chapter 12 + D36D-472A + + + Start on chapter 13 + DE6D-472A + + + Start on chapter 14 + FD6D-472A + + + Start on Chapter 15 + FF6D-472A + + + Start on Chapter 16 + F46D-472A + + + Bogus jump + 946B-1D8B + + + Super-jump + 716B-1D8B + + + Mega-jump + 436B-1D8B + + + + Bugs Bunny - Rabbit Rampage (USA) + + Invincibility + 2D6A-17AF + + + Infinite health + C28C-4FAF + + + Infinite lives + DDA3-3D07 + + + Infinite lives (alt) + C2A3-3DA7 + + + Start and continue with 10 lives + DC60-CD0D + + + Start and continue with 2 lives + D460-CD0D + + + Take minimal damage + A38C-4FAF + + + Full health from carrots + DD88-476F + + + Moon jumping Bugs + F0B4-1404 + + + Super-jumping Bugs + 0DB4-1404 + E0B7-1DD4 + + + + Bust-A-Move (USA) + + Infinite continues + C281-DFE2 + + + Infinite time to shoot each ball + 3C38-A764 + + + Always get max bonus in shooting rounds + 3C83-D467 + + + Shot guide is always on (new 1P game) + 338B-0DA4 + + + Shot guide is always on (password game) + 338D-07A4 + + + Shot guide is always on (challenge record mode) + 333E-D721 + + + + Captain America and the Avengers (USA) + + Invincibility - P1 + 7E16A820 + + + Invincibility - P2 + 7E16A963 + + + Infinite health - P1 + 7E022663 + + + Infinite health - P2 + 7E022763 + + + Infinite lives - P1 + 7E022909 + + + + Captain Commando (USA) + + Invincibility + 7E040403 + + + Infinite health - P1 + 7E089532 + + + Infinite health - P2 + 7E089332 + + + 9 lives - P1 + 7E0B1509 + + + 9 lives - P2 + 7E0B1309 + + + 9 continues + 7E1D5A39 + + + + Captain Novolin (USA) (En,Fr,Es) + + Invincibility + 7E0C0229 + + + Infinite health + 7E0BDA04 + + + Infinite time + 7E16F200 + + + + Caravan Shooting Collection (Japan) + + Star Force - Always have powered-up weapon + 7E099E01 + + + Star Force - Infinite lives + 7E094D02 + + + Star Force - No enemies (disable before reaching the boss) + 7E096305 + + + Star Soldier - Invincibility + 7E008639 + + + Star Soldier - Infinite lives + 7E062F02 + + + Star Soldier - Rapid fire + 7E063000 + + + Star Soldier - Ship is always blue + 7E008700 + + + Star Soldier - No enemies except bosses + 7E062E00 + + + Hector 87 - Infinite health + 7E00E510 + + + Hector 87 - Infinite lives + 7E00E402 + + + + Carrier Aces (USA) + + Invincibility (works for dogfights and ship fire) + DDED-670F + 6DEE-64DD + + + Infinite fuel + C2B3-6F64 + + + Infinite rockets + 3CC9-D764 + + + + Casper (USA) + + Infinite lives + C225-1071 + + + Infinite health + C221-1981 + + + Have all items and 5 lives after you leave the first room + 2DAC-CD44 + + + + Castlevania - Dracula X (USA) + + Invincibility (turn on after title screen, during game play) + 10D2-FE86 + + + Invincibility after one hit + C969-CD2D + + + Infinite energy + C96D-17FF + + + All hearts worth 99 + 2D25-1FD3 + DD25-1F03 + + + Keep sub-weapon after dying + C9A4-47D7 + + + Keep sub-weapon after continue + C985-17DF + + + Item Crash doesn't use hearts + C9A6-3D94 + + + Start with half energy + 4D21-1707 + + + Start with 1/4 energy + F421-1707 + + + Start with 3/4 energy + 7D21-1707 + + + Small hearts worth 0 + DD29-1763 + + + Small hearts worth 10 + FD29-1763 + + + Small hearts worth 25 + 4929-1763 + + + Start with 99 hearts + 6D81-170F + + + Start with 50 hearts + 9D81-170F + + + Start with 25 hearts + 4981-170F + + + Start with 1 life + DD85-1D6F + + + Start with 10 lives + DB85-1D6F + + + Start with 25 lives + 4085-1D6F + + + Start with 50 lives + 0B85-1D6F + + + Start with 99 lives + BB85-1D6F + + + Infinite lives + C9AF-47A7 + + + Start with 25 hearts after you die + 49A4-44D7 + + + Start with 50 hearts after you die + 9DA4-44D7 + + + Start with 99 hearts after you die + BBA4-44D7 + + + No Invincibility after getting hit + DD6F-CFBF + + + More invincibility after getting hit + EE6F-CFBF + + + Super jump + EB87-C7BD + + + Super-Duper jump + E687-C7BD + + + Mega-jump + E587-C7BC + + + Have the Axe + DFDC-F276 + + + Have the Cross + D4DC-F276 + + + Have the Holy Water + D7DC-F276 + + + Have the Knife + D0DC-F276 + + + Have the Clock + D9DC-F276 + + + Have the Key + D1DC-F276 + + + Start on level 2 + DFD5-F376 + + + Start on level 3 + D4D5-F376 + + + Start on level 4 + D7D5-F376 + + + Start on level 5 + D0D5-F376 + + + Start on level 6 + D9D5-F376 + + + + Chessmaster, The (USA) + + White player's timer is stopped + C9C7-D76F + + + Black player's timer is stopped + C9C9-DFDF + + + Timers count 2x as slow + 56C4-D46F + + + Timers count 3x times as slow + 80C4-D46F + + + Timers count 2x as fast + F3C4-D46F + + + Timers count 3x times as fast + F0C4-D46F + + + + Chester Cheetah - Too Cool to Fool (USA) + + Infinite life points + 3CBF-0D69 + + + Start with 2 life points + D469-DFD9 + + + Start with 0 life points + DD69-DFD9 + + + Badges worth 5 + D965-D7DB + + + Badges worth 25 + 4965-D7DB + + + Badges worth 50 + 9D65-D7DB + + + Infinite credits + A26F-04D4 + + + Invincibility (Chester blinks) You may freeze if you get the guitar and fall in water (have to reset) + 3C60-04D9 + + + + Chester Cheetah - Wild Wild Quest (USA) + + Invincibility (once you eat a bag of Cheetos) + C3CC-6D07 + + + Infinite Cheetos bags (once you collect one) + C282-DFD4 + + + Infinite time + C2B2-A4AD + + + Infinte lives + C2BC-D7AF + + + + Choplifter III - Rescue & Survive (USA) + + Invincibility + 7E0CEB5A + + + Have all weapons and infinte ammo + DD67-CDA7 + DD60-CF67 + + + Infinite secondary weapons + 3C60-34D7 + + + Infinite choppers + C26D-1767 + + + Chopper can carry 30 hostages + F3C7-3D53 + F3C1-1F5E + + + + Chrono Trigger (USA) + + Position 1 - Infinite health + 7E5E30E7 + 7E5E3103 + + + Position 1 - Infinite Magic + 7E5E3463 + + + Position 1 - Attack bar always full + 7EAFAB00 + + + Position 2 - Infinite health + 7E5EB0E7 + 7E5EB103 + + + Position 2 - Infinite Magic + 7E5EB463 + + + Position 2 - Attack bar always full + 7EAFAC00 + + + Position 3 - Infinite health + 7E5F30E7 + 7E5F3103 + + + Position 3 - Infinite Magic + 7E5F3463 + + + Position 3 - Attack bar always full + 7EAFAD00 + + + Use organize to get 90 of all items + B6C6-E76C + DDCB-E7DC + 9CCB-E76C + + + Maxed out abilities for all characters + 65EB-E4A9 + + + Every attack causes 9999 damage + B323-7405 + + + Can open sealed chests + 6D1C-770F + + + Start with a higher max HP + EEDD-7F5D + + + Start with a higher max MP + 63DD-745D + + + Start with max power + BDDD-74ED + + + Start with max stamina + BDDD-777D + + + Start with max speed + BDDD-775D + + + Start with max magic + BDDD-778D + + + Start with max hit ratio + BDDD-77ED + + + Start with max evade + BDDF-7D7D + + + Start with max magic defense + BDDF-7D5D + + + Infinite Speed Boosts + 7E009A03 + + + Instantly enable next Speed Boost + 7E00BA00 + + + + Chuck Rock (USA) + + Invincibility + 7E0BAA25 + + + Infinite health + C9A1-A70D + + + Infinite lives + C9AB-AF0D + + + Jump higher + 70C9-A7DD + + + Super-jump + 49C9-A7DD + + + Mega-jump + F5C9-A7DD + + + + Civilization (USA) + + Infinite time + 7E75D700 + + + Get a new skill every turn + DD30-74A4 + + + Have 42.0 moves until you specify no orders + CB28-5DA4 + 5328-5FD4 + + + Max income + 7E7630FF + + + Start with more money + BB04-EF74 + BB04-EF54 + + + Start with a lot more money + EE04-EF74 + EE04-EF54 + + + + Clay Fighter 2 - Judgment Clay (USA) + + Infinite health and time + CB51-7D64 + 6251-7F04 + 4651-7F64 + F651-7FA4 + + + Select more speed in options + 4D08-E4A1 + + + Select more difficulty in options + DB0B-E4D1 + + + Both players jump off the screen + 8F59-EDA7 + + + Blob spit kills + EE0C-77E9 + + + Buzz saw kills + EE0E-7479 + + + Rocket-anvil attack kills + EE09-5789 + + + Spinning carrot kills + EEB0-5D7C + + + Spin kick towards (special move) kills + EEBB-5F8C + + + Brutal cartwheel kills (when close) + EE1C-5785 + + + Ground spin kills + EE15-8DE5 + + + + Clay Fighter (USA) + + Infinite health P1 + C20B-7916 + C256-E536 + + + Enable Blob's Bomb move (away, away+down, down, towards+down, towards, punch) + 6280-DD6F + + + Always fight Bad Mr. Frosty after 1st match + DD4A-8548 + DD9C-E53E + + + Always fight Taffy after 1st match + DD4A-8548 + DF9C-E53E + + + Always fight Tiny after 1st match + DD4A-8548 + D49C-E53E + + + Always fight The Blob after 1st match + DD4A-8548 + D79C-E53E + + + Always fight Blue Suede Goo after 1st match + DD4A-8548 + D09C-E53E + + + Always fight Ickybod Clay after 1st match + DD4A-8548 + D99C-E53E + + + Always fight Helga after 1st match + DD4A-8548 + D19C-E53E + + + Always fight Bonker after 1st match + DD4A-8548 + D59C-E53E + + + Always fight N. Boss after 1st match + DD4A-8548 + D69C-E53E + + + Start with 1/6 health - 1st round + FDF7-E5CE + + + Start with 1/3 health - 1st round + 4DF7-E5CE + + + Start with 1/2 health - 1st round + 7DF7-E5CE + + + Start with 2/3 health - 1st round + 0DF7-E5CE + + + Start with 5/6 health - 1st round + 9DF7-E5CE + + + Start with 1/6 health - 2nd and later rounds + FD4A-E01C + + + Start with 1/3 health - 2nd and later rounds + 4D4A-E01C + + + Start with 1/2 health - 2nd and later rounds + 7D4A-E01C + + + Start with 2/3 health - 2nd and later rounds + 0D4A-E01C + + + Start with 5/6 health - 2nd and later rounds + 9D4A-E01C + + + Bad Mr. Frosty's Brutal Punches do more damage + 7D46-E1C2 + 7D46-E132 + 7D46-E542 + 7D46-E512 + 7D46-E5C2 + + + Bad Mr. Frosty's Medium Punches do more damage + 7D46-E532 + 7D4B-E042 + 7D4B-E012 + 7D4B-E0C2 + 7D4B-E032 + + + Bad Mr. Frosty's Quick Punches do more damage + 7D4B-E942 + 7D4B-E912 + 7D4B-E9C2 + 7D4B-E932 + 7D4B-E142 + + + Bad Mr. Frosty's Brutal Kicks do more damage + 7D4B-E112 + 7D4B-E1C2 + 7D4B-E132 + 7D4B-E542 + 7D4B-E512 + + + Bad Mr. Frosty's Medium Kicks do more damage + 7D4B-E5C2 + 7D4B-E532 + 7D4C-E042 + 7D4C-E012 + 7D4C-E0C2 + + + Bad Mr. Frosty's Quick Kicks do more damage + 7D4C-E032 + 7D4C-E942 + 7D4C-E912 + 7D4C-E9C2 + 7D4C-E932 + + + Bad Mr. Frosty's Snow Ball (all punches) does more damage + 7D4C-E142 + + + Taffy's Brutal Punches do more damage + 7D48-E0C2 + 7D48-E032 + 7D48-E942 + 7D48-E912 + 7D48-E9C2 + + + Taffy's Medium Punches do more damage + 7D48-E932 + 7D48-E142 + 7D48-E112 + 7D48-E1C2 + 7D48-E132 + + + Taffy's Quick Punches do more damage + 7D48-E542 + 7D48-E512 + 7D48-E5C2 + 7D48-E532 + 7D4A-E042 + + + Taffy's Brutal Kicks do more damage + 7D4A-E012 + 7D4A-E0C2 + 7D4A-E032 + 7D4A-E942 + 7D4A-E912 + + + Taffy's Medium kick does more damage + 7D4A-E9C2 + 7D4A-E932 + 7D4A-E142 + 7D4A-E112 + 7D4A-E1C2 + + + Taffy's Quick Kicks do more damage (not in crouch) + 7D4A-E132 + 7D4A-E542 + 7D4A-7513 + 7D4A-E5C2 + 7D4A-E532 + + + Taffy's Whack (all punches) does more damage + 7D42-E912 + + + Taffy's Whack (all kicks) does more damage + 7D42-E9C2 + + + Tiny's Brutal Punches do more damage + 7D42-E1C2 + 7D42-E132 + 7D42-E542 + 7D42-E512 + 7D42-E5C2 + + + Tiny's Medium Punches do more damage + 7D42-E532 + 7D43-E042 + 7D43-E012 + 7D43-E0C2 + 7D43-E032 + + + Tiny's Quick Punches do more damage + 7D43-E942 + 7D43-E912 + 7D43-E9C2 + 7D43-E932 + 7D43-E142 + + + Tiny's Brutal Kicks do more damage + 7D43-E112 + 7D43-E1C2 + 7D43-E132 + 7D43-E542 + 7D43-E512 + + + Tiny's Medium Kicks do more damage + 7D43-E5C2 + 7D43-E532 + 7D4E-E042 + 7D4E-E012 + 7D4E-E0C2 + + + Tiny's Quick Kicks do more damage + 7D4E-E032 + 7D4E-E942 + 7D4E-E912 + 7D4E-E9C2 + 7D4E-E932 + + + Tiny's Medicine Ball Does more damage + 7D4E-E142 + + + Tiny's Sucker Punch does more damage + 7D4E-E512 + + + Blob's Brutal Punches do more damage + 7D4D-70C3 + 7D4D-7033 + 7D4D-7943 + 7D4D-7913 + 7D4D-79C3 + + + Blob's Medium Punches do more damage + 7D4D-7933 + 7D4D-7143 + 7D4D-7113 + 7D4D-71C3 + 7D4D-7133 + + + Blob's Quick Punches do more damage + 7D4D-7543 + 7D4D-7513 + 7D4D-75C3 + 7D4D-7533 + 7D4F-7043 + + + Blob's Brutal kick does more damage + 7D4F-7013 + 7D4F-70C3 + 7D4F-7033 + 7D4F-7943 + 7D4F-7913 + + + Blob's Medium Kicks do more damage + 7D4F-79C3 + 7D4F-7933 + 7D4F-7143 + 7D4F-7113 + 7D4F-71C3 + + + Blob's Quick Kicks do more damage + 7D4F-7133 + 7D4F-7543 + 7D4F-7513 + 7D4F-75C3 + 7D4F-7533 + + + Blue Suede Goo's Brutal Punches do more damage + 7D44-71C3 + 7D44-7133 + 7D44-7543 + 7D44-7513 + 7D44-75C3 + + + Blue Suede Goo's Medium Punches do more damage + 7D44-7533 + 7D47-7043 + 7D47-7013 + 7D47-70C3 + 7D47-7033 + + + Blue Suede Goo's Quick Punches do more damage + 7D47-7943 + 7D47-7913 + 7D47-79C3 + 7D47-7933 + 7D47-7143 + + + Blue Suede Goo's Brutal Kicks do more damage + 7D47-7113 + 7D47-71C3 + 7D47-7133 + 7D47-7543 + 7D47-7513 + + + Blue Suede Goo's Medium Kicks do more damage + 7D47-75C3 + 7D47-7533 + 7D40-7043 + 7D40-7013 + 7D40-70C3 + + + Blue Suede Goo's Quick Kicks do more damage + 7D40-7033 + 7D40-7943 + 7D40-7913 + 7D40-79C3 + 7D40-7933 + + + Ickybod Clay's Brutal Punches do more damage + 7D49-70C3 + 7D49-7033 + 7D49-7943 + 7D49-7913 + 7D49-79C3 + + + Ickybod Clay's Medium Punches do more damage + 7D49-7933 + 7D49-7143 + 7D49-7113 + 7D49-71C3 + 7D49-7133 + + + Ickybod Clay's Quick Punches do more damage + 7D49-7543 + 7D49-7513 + 7D49-75C3 + 7D49-7533 + 7D41-7043 + + + Ickybod Clay's Brutal Kicks do more damage + 7D41-7013 + 7D41-70C3 + 7D41-7033 + 7D41-7943 + 7D41-7913 + + + Ickybod Clay's Medium Kicks do more damage + 7D41-79C3 + 7D41-7933 + 7D41-7143 + 7D41-7113 + 7D41-71C3 + + + Ickybod Clay's Quick Kicks do more damage + 7D41-7133 + 7D41-7543 + 7D41-7513 + 7D41-75C3 + 7D41-7533 + + + Ickybod Clay's Ecto Punch does more damage + 7D45-7013 + + + Helga's Brutal Punches do more damage + 7D45-71C3 + 7D45-7133 + 7D45-7543 + 7D45-7513 + 7D45-75C3 + + + Helga's Medium Punches do more damage + 7D45-7533 + 7D46-7043 + 7D46-7013 + 7D46-70C3 + 7D46-7033 + + + Helga's Quick Punches do more damage + 7D46-7943 + 7D46-7913 + 7D46-79C3 + 7D46-7933 + 7D46-7143 + + + Helga's Brutal Kicks do more damage + 7D46-7113 + 7D46-71C3 + 7D46-7133 + 7D46-7543 + 7D46-7513 + + + Helga's Medium Kicks do more damage + 7D46-75C3 + 7D46-7533 + 7D4B-7043 + 7D4B-7013 + 7D4B-70C3 + + + Helga's Quick Kicks do more damage (not far away) + 7D46-5033 + 7D4B-7943 + 7D4B-7913 + 7D4B-79C3 + 7D4B-7933 + + + Helga's Viking Ram does more damage + 7D4B-71C3 + + + Bonker's Brutal Punches do more damage + 7D4C-70C3 + 7D4C-7033 + 7D4C-7943 + 7D4C-7913 + 7D4C-79C3 + + + Bonker's Medium Punches do more damage + 7D4C-7933 + 7D4C-7143 + 7D4C-7113 + 7D4C-71C3 + 7D4C-7133 + + + Bonker's Quick Punches do more damage + 7D4C-7543 + 7D4C-7513 + 7D4C-75C3 + 7D4C-7533 + 7D48-7043 + + + Bonker's Brutal Kicks do more damage + 7D48-7013 + 7D48-70C3 + 7D48-7033 + 7D48-7943 + 7D48-7913 + + + Bonker's Medium Kicks do more damage + 7D48-79C3 + 7D48-7933 + 7D48-7143 + 7D48-7113 + 7D48-71C3 + + + Bonker's Quick Kicks do more damage + 7D48-7133 + 7D48-7543 + 7D48-7513 + 7D48-75C3 + 7D48-7533 + + + Bonker's Cutting Cartwheel does more damage + 7D4A-7043 + + + + Claymates (USA) (Sample) + + Invincibility + C2D4-8F50 + + + Infinite time + C216-E779 + + + Multi-jump + 89DA-87E9 + + + Infinite lives + C218-8479 + + + + Cliffhanger (USA) + + Invincibility + ED60-1761 + + + Infinite health + C28E-44A9 + + + Infinite ammo + C2CD-34A5 + + + Infinite lives + 3C8B-1D69 + + + + Clue (USA) + + Always roll a 1 + CBBC-0D07 + 3CBC-0DA7 + DDBC-0D67 + + + Always roll a 2 + CBBC-0D07 + 3CBC-0DA7 + DFBC-0D67 + + + Always roll a 3 + CBBC-0D07 + 3CBC-0DA7 + D4BC-0D67 + + + Always roll a 4 + CBBC-0D07 + 3CBC-0DA7 + D7BC-0D67 + + + Always roll a 5 + CBBC-0D07 + 3CBC-0DA7 + D0BC-0D67 + + + Always roll a 6 + CBBC-0D07 + 3CBC-0DA7 + D9BC-0D67 + + + Allow no interrogations instead of 2 + BDBA-D464 + + + Allow only 1 interrogation + DFBA-D4D4 + + + Allow 3 interrogations + D7BA-D4D4 + + + Allow 4 interrogations + D0BA-D4D4 + + + Allow 5 interrogations + D9BA-D4D4 + + + Infinite interrogations + 8B83-070F + + + + Combatribes, The (USA) + + Invincibility + 2DB1-A7D4 + + + Infinite health + 3CB5-6F64 + CBB5-6FA4 + A6B5-64D4 + 62B5-6464 + + + Infinite credits + A2B3-A404 + + + Infinite health - P1 + 7E1794C8 + + + Infinite health - P2 + 7E1796C8 + + + Infinite credits (alt) + 7E156409 + + + + Congo's Caper (USA) + + Start as Super Congo + 64B9-4FD4 + + + Stay as Super Congo (you may change if you walk on spikes) + CB69-34D7 + + + 1 ruby turns you into Super Congo + CBB2-340D + D4B2-346D + + + Infinite lives + DDEC-CF6D + + + Start with 1 life + DDAC-4F09 + + + Start with 6 lives + D9AC-4F09 + + + Start with 9 lives + D6AC-4F09 + + + 1 life after continue + DDB0-44D4 + + + 6 lives after continue + D9B0-44D4 + + + 9 lives after continue + D6B0-44D4 + + + + Contra III - The Alien Wars (USA) + + Invincibility (top-view levels) + 8961-6F08 + + + Invincibility (side-view levels) - P1 + 89B3-6F01 + 89C0-6D09 + + + Invincibility (side-view levels) - P2 + 89C5-6FD9 + 89B6-AFA1 + + + Infinite continues + C2CA-0F04 + + + Infinite lives (side-view levels) + 22BB-AD01 + + + Infinite lives (top-view levels) + 22BB-6F0B + 6DBB-64DB + + + Infinite bombs (side-view levels) + 2264-D760 + + + Infinite bombs (top-view levels) + 22B8-0766 + + + Start with 5 bombs on each life (side-view levels) + D9BB-AFA1 + D9CE-6D0D + + + Start with 9 bombs on each life (side-view levels) + DBBB-AFA1 + DBCE-6D0D + + + Start with 5 bombs on each life (top-view levels) + D963-6708 + D9CE-6D0F + + + Start with 9 bombs on each life (top-view levels) + DB63-6708 + DBCE-6D0F + + + Enable 30 and 99 lives in option menu (99 actually gives 35,081 lives) + D987-AFA4 + + + Keep main weapon when you die (side-view levels) + 82BA-6FA1 + + + Keep main weapon when you die (top-view levels) + 82BC-646B + + + Always have Scatter Blaster for gun 1 (disable during bonus stages) + 7E1F8401 + + + Always have Missile Launcher for gun 1 (disable during bonus stages) + 7E1F8402 + + + Always have Homing Missile for gun 1 (disable during bonus stages) + 7E1F8403 + + + Always have Torch for gun 1 (disable during bonus stages) + 7E1F8404 + + + Always have Laser for gun 1 (disable during bonus stages) + 7E1F8405 + + + Always have Scatter Blaster for gun 2 (disable during bonus stages) + 7E1F8601 + + + Always have Missile Launcher for gun 2 (disable during bonus stages) + 7E1F8602 + + + Always have Homing Missile for gun 2 (disable during bonus stages) + 7E1F8603 + + + Always have Torch for gun 2 (disable during bonus stages) + 7E1F8604 + + + Always have Laser for gun 2 (disable during bonus stages) + 7E1F8605 + + + + Cool Spot (USA) + + Infinite lives + 402C-D7D1 + + + Start with 1 life + DF28-D404 + + + Start with 6 lives + D128-D404 + + + Start with 9 lives + DB28-D404 + + + Less invincibility time + FE89-DF69 + + + More invincibility time + EE89-DF69 + + + 5 seconds picked up + D98C-0D05 + + + 1 minute picked up + 7A8C-0D05 + + + 16% picked up from '7up' + FD89-07D5 + + + Be able to free fellow spot right away + DD26-D4D9 + + + + Cutthroat Island (USA) + + Infinite health - P1 + 7E09F428 + + + Infinite health - P2 + 7E0A5328 + + + 9 lives - P1 + 7E1EF709 + + + 9 lives - P2 + 7E1EF909 + + + + Cybernator (USA) + + Start on level 3.1 + D4BD-176F + + + Start on level 3.2 + D7BD-176F + + + Start on level 3.3 + D0BD-176F + + + Start on level 4.1 + D9BD-176F + + + Start on level 4.2 + D1BD-176F + + + Start on level 5.1 + D5BD-176F + + + Start on level 5.2 + D6BD-176F + + + Start on level 6.1 + DBBD-176F + + + Start on level 7.3 + FDBD-176F + + + Start on level 7.4 + FFBD-176F + + + View the failed ending + F4BD-176F + + + View the successful ending + F7BD-176F + + + Start with lasers + 62BF-17AF + + + Start with homing missiles + 62BF-17DF + + + Start with napalm + 62B4-1D6F + + + Weapons start at level 2 + D4BF-1FDF + + + Weapons start at level 3 + D7BF-1FDF + + + Start with 2 credits + DFB1-17AF + + + Start with 6 credits + D9B1-17AF + + + Start with 10 credits + DBB1-17AF + + + Infinite credits + C234-4FDD + + + Only 2 P's needed for level 2 vulcan + D461-4D62 + + + Only 4 P's needed for level 3 vulcan + D061-4FD2 + + + Only 3 P's needed for level 3 laser + D761-4462 + + + Only 3 P's needed for level 3 missile + D765-4DD2 + + + Only 2 P's needed for level 2 napalm + D465-4FD2 + + + Only 4 P's needed for level 3 napal + D065-4F62 + + + Only 2 P's needed for level 2 punch + D465-4462 + + + Only 3 P's needed for level 3 punch + D765-47D2 + + + Protection against some hazards + 82C9-470C + 82C7-4FDC + + + Energy chip worth nothing + DD3F-1406 + + + Energy chip worth more + CD3F-1406 + + + + Daffy Duck - The Marvin Missions (USA) + + Invincibility + C283-3D6F + + + Infinite ammo (must have some ammo for the gun to be selectable) + DD85-17DD + + + Infinite lives + DDB3-3404 + + + Infinite continues + DDA2-C76C + + + Start with 1 life + DFBD-1DA4 + + + Start with 9 lives (don't set lives in options menu) + DBBD-1DA4 + + + Start with 25 lives (don't set lives in options menu) + 49BD-1DA4 + + + Start with 51 lives (don't set lives in options menu) + 9FBD-1DA4 + + + Extra lives cost $500 + DDA8-4466 + + + Extra lives cost $1,500 + DFA8-4466 + + + Extra life power-ups don't work + DD23-34D4 + + + Extra life power-ups worth 2 + D423-34D4 + + + Extra life power-ups worth 5 + D923-34D4 + + + Extra lives can't be bought + DDA3-3FA6 + + + 2 extra lives for each life you buy + D4A3-3FA6 + + + 5 extra lives for each life you buy + D9A3-3FA6 + + + Start with 1/2 health + D1B4-3DD7 + + + Start with 3/4 health + DBB4-3DD7 + + + Juice cans set health to 1/2 + D121-CD64 + + + Juice cans set health to 3/4 + DB21-CD64 + + + Start with 0 gems + DDB4-C764 + + + Start with 10 gems (2 continues) + FDB4-C764 + + + Start with 25 gems (5 continues) + 49B4-C764 + + + Gem power-ups worth 0 + DD3C-446D + + + Gem power-ups worth 5 (1 continue) + D93C-446D + + + Bought gems worth 0 + DDA6-34A6 + + + Bought gems worth 5 (1 continue) + D9A6-34A6 + + + Gems are free + DDA8-44D6 + + + Start with 10 ammo for all guns (except blaster) + FDBF-CF64 + + + Start with 50 ammo for all guns + 9DBF-CF64 + + + Start with 90 ammo for all guns + BDBF-CF64 + + + Freeze gun ammo is free + DDAC-4406 + + + Freeze gun ammo is $200 + 4DAC-4406 + + + Electricity gun ammo is free + DDAC-44A6 + + + Electricity gun ammo is $150 + F9AC-44A6 + + + Three-way gun ammo is free + DDAC-4706 + + + Three-way gun ammo is $150 + F9AC-4706 + + + Bomb gun ammo is free + DDAC-47A6 + + + Bomb gun ammo is $150 + F9AC-47A6 + + + Antimatter gun ammo is free + DDA8-4D06 + + + Antimatter gun ammo is $200 + 4DA8-4D06 + + + Bought Freeze gun ammo is worth 20 + 4DAE-44D6 + + + Bought Electricity gun ammo is worth 20 + 4DA9-1406 + + + Bought Three-way gun ammo is worth 20 + 4DA8-1466 + + + Bought Bomb gun ammo is worth 20 + 4DAF-C4A6 + + + Bought Anti matter gun ammo is worth 20 + 4DA5-C7D6 + + + Freeze gun ammo power-ups are worth 20 + 4D28-4FA7 + + + Electricity gun ammo power-ups are worth 20 + 4D26-1DA7 + + + Three-way gun ammo power-ups are worth 20 + 4D20-C7A7 + + + Bomb gun ammo power-ups are worth 20 + 4D2F-34A7 + + + Antimatter gun ammo power-ups are worth 20 + 4D23-3FA7 + + + Start with no nutty attacks + DDBD-CF04 + + + Start with 3 nutty attacks + D7BD-CF04 + + + Start with 5 nutty attacks + D9BD-CF04 + + + Start with 7 nutty attacks + D5BD-CF04 + + + Infinite nutty attacks + C287-34AD + + + Nutty attacks are free + DDA8-4F06 + + + Nutty attacks are $400 + 0DA8-4F06 + + + Start with $2,500 + D4BD-C7D4 + + + Start with $3,500 + D7BD-C7D4 + + + Start with $9,500 + DBBD-C7D4 + + + Start with $30,500 + 7DBD-C7D4 + + + Buy a life and get a ton of money + 6DA8-3766 + + + Start with almost no fuel + DDB4-C404 + + + Start with 2x fuel + F8B4-C404 + + + Start with 3x fuel + 45B4-C404 + + + Jetpack fuel is free + DDA8-4DA6 + + + Fuel is consumed at 1/4 normal rate + D1C8-14A7 + + + Fuel is consumed at 1/2 normal rate + DAC8-14A7 + + + Fuel is consumed at 3/4 normal rate + F4C8-14A7 + + + Fuel power-ups are worth 1/2 as much + D12B-17D4 + + + Fuel power-ups are worth 2x + FC2B-17D4 + + + Bought fuel is worth 1/2 as much + D1A2-C7A6 + + + Bought fuel is worth 2x as much + FCA2-C7A6 + + + Start on level 1-2 + DFB9-1D04 + + + Start on level 1-3 + D4B9-1D04 + + + Start on level 1-4 + D7B9-1D04 + + + Start on level 2-1 + D0B9-1D04 + + + Start on level 2-2 + D9B9-1D04 + + + Start on level 2-3 + D1B9-1D04 + + + Start on level 2-4 + D5B9-1D04 + + + Start on level 3-1 + D6B9-1D04 + + + Start on level 3-2 + DBB9-1D04 + + + Start on level 3-3 + DCB9-1D04 + + + Start on level 3-4 + D8B9-1D04 + + + Start on level 4-1 + DAB9-1D04 + + + Start on level 4-2 + D2B9-1D04 + + + Start on level 4-3 + D3B9-1D04 + + + Start on level 4-4 + DEB9-1D04 + + + Start on level 5-1 + FDB9-1D04 + + + Start on level 5-2 + FFB9-1D04 + + + Start on level 5-3 + F4B9-1D04 + + + Start on level 5-4 + F7B9-1D04 + + + + Darius Twin (USA) + + Invincibility - P1 + C22D-67D9 + + + Invincibility - P2 + C23C-AF60 + + + Infinite lives - P1 + DD35-6FA5 + + + Infinite lives - P2 + DD3B-6FA5 + + + Start with 1 green power cube - P1 + 62CD-AF67 + 4ACE-64D7 + + + Start with 1 green power cube - P2 + 62CD-A407 + 4ACE-64D7 + + + Start with 10 lives - both players + FDC3-6D67 + CBC3-6D07 + 3CC3-6DA7 + + + Start with 15 lives - both players + F9C3-6D67 + CBC3-6D07 + 3CC3-6DA7 + + + Start with 20 lives - both players + 4DC3-6D67 + CBC3-6D07 + 3CC3-6DA7 + + + Start with 25 lives - both players + 49C3-6D67 + CBC3-6D07 + 3CC3-6DA7 + + + Start on planet B + DFB0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet C + D4B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet D + D7B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet E + D0B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet F + D9B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet G + D1B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet H + D5B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet I + D6B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet J + DBB0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet K + DCB0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + Start on planet L + D8B0-A7DD + CDB0-A4AD + DDB0-A70D + 6AB0-A76D + + + + Dark Law - Meaning of Death (Japan) + + Sell an item to get maximum cash + 6D53-7468 + D653-74A8 + + + Fewer random battles + 6D7E-7DA3 + + + Any code will open locked doors + DD4C-7909 + + + One hit kills + 6DC1-8D10 + + + Infinite walking range in battle + DD98-5F19 + + + + David Crane's Amazing Tennis (USA) + + Faster side-to-side movement + EA8B-AFDD + D085-A7DD + + + Even faster side-to-side movement + EC8B-AFDD + D185-A7DD + + + + Death and Return of Superman, The (USA) + + Invincibility + 2D6B-CF6D + ED6C-CFAD + + + Infinite health + C92D-C7DD + 992D-C70D + 622D-C76D + 242D-C7AD + D32F-CDDD + + + Infinite lives + 3324-3F6D + + + Infinite special attacks + 3323-C76D + D323-C7AD + + + + Demolition Man (USA) + + Infinite health + F989-376F + + + Infinite lives + C2AC-1FDD + + + Infinite Grenades + 82A2-4DA1 + + + Infinite ammo - Shotgun and Magnum + 82AA-17AF + + + Infinite ammo - Shotgun + DFAA-14DF + + + Infinite ammo - Magnum + D4BF-1FF0 + + + Jump 2x higher + 4D80-67DF + + + Jump 4x higher + FD80-67DF + + + Jump 8x higher + D680-67DF + + + + Demon's Crest (USA) + + Invincibility after one hit + C92A-44A7 + + + Start a new game with all items + A363-44F4 + A363-4424 + A363-47B4 + + + First enemy takes longer to kill + DB67-C703 + + + First enemy take less time to kill + D467-C703 + + + More flash time + EE3A-1DAF + + + Die after one hit + 6927-CDA7 + + + Super-jump + D635-1F0D + + + Ginseng costs nothing + DD38-CFD9 + + + Enemies always drop the 20 coin + C9A5-370B + + + 20 coin worth 999 + C9A2-17DC + + + 1 coin worth 999 + C9A2-170C + + + Large health refills health fully + C9AC-176C + + + Rapid fire + C939-37D7 + + + + Dennis the Menace (USA) + + Infinite courage + C9B7-4FD7 + C9B7-44A7 + + + Infinite time + C92F-3D9E + + + Infinite lives + C9CB-44AF + + + + Desert Strike - Return to the Gulf (USA) + + Infinite ammo + 223B-07D9 + + + Infinite fuel + DD63-A409 + + + Start with 1 life + DFB1-0F6C + + + Start with 5 lives + D9B1-0F6C + + + Start with 7 lives + D5B1-0F6C + + + Start with 10 lives + DCB1-0F6C + + + Start with 20 lives + F0B1-0F6C + + + Start with 50 lives + 74B1-0F6C + + + Start with 99 lives + 17B1-0F6C + + + Infinite lives + 4A68-04A1 + + + Fuel starts at 25 + FBB1-07DC + + + Fuel starts at 50 + 74B1-07DC + + + Fuel starts at 75 + 08B1-07DC + + + Fuel starts at 150 + B1B1-07DC + + + Fuel starts at 200 + A6B1-07DC + + + Fuel starts at 868 + D7B1-070C + + + 2x fuel consumption + D063-A409 + + + Armor starts at 344 + DFBC-64A9 + DF64-64D1 + + + Armor starts at 856 + D7BC-64A9 + D764-64D1 + + + Armor starts at 1,112 + D0BC-64A9 + D064-64D1 + + + Armor starts at 2,136 + D6BC-64A9 + D664-64D1 + + + Armor starts at 5,208 + F0BC-64A9 + F064-64D1 + + + Guns start at 154 rounds remaining + DD38-6D0F + + + Guns start at 666 rounds remaining + D438-6D0F + + + Guns start at 2,458 rounds remaining + DB38-6D0F + + + Guns start at 5,018 rounds remaining + F738-6D0F + + + Guns start at 9,882 rounds remaining + 4138-6D0F + + + Start with 10 hydras + DC3A-676F + + + Start with 50 hydras + 743A-676F + + + Start with 100 hydras + 103A-676F + + + Start with 250 hydras + EC3A-676F + + + Start with 1 missile + DF33-67DF + + + Start with 20 missiles + F033-67DF + + + Start with 50 missiles + 7433-67DF + + + Start with 100 missiles + 1033-67DF + + + Start with 250 missiles + EC33-67DF + + + Faster gun auto-repeat speed + DF3C-676F + + + Slower gun auto-repeat speed + F63C-676F + + + Missiles fly faster + D032-6D6F + + + Hydras fly faster + D03E-6DDF + + + Guns do as much damage as missiles + 1038-6D6F + + + Hydras do as much damage as missiles + 1032-6DDF + + + Missiles do 250 points of damage + EC33-676F + + + AK47's do 1 point of damage + DF39-DF64 + + + AK47's do 1/2x damage + D439-DF64 + + + AK47's do 2x damage + DC39-DF64 + + + APHIDs do 1 point of damage + DF3E-A7DF + + + APHIDs do 1/2x damage + 493E-A7DF + + + APHIDs do 2x damage + B13E-A7DF + + + AAA's do 1 point of damage + DF3D-A7DF + + + AAA's do 1/2x damage + DC3D-A7DF + + + AAA's do 2x damage + 463D-A7DF + + + Rapiers do 1 point of damage + DF3C-AD6F + + + Rapiers do 1/2x damage + 743C-AD6F + + + Rapiers do 2x damage + A63C-AD6F + + + VDA's do 1 point of damage + DF34-A46F + + + VDA's do 1/2x damage + DA34-A46F + + + VDA's do 2x damage + 7434-A46F + + + ZSU's do 1 point of damage + DF31-AF6F + + + ZSU's do 1/2x damage + F031-AF6F + + + ZSU's do 2x damage + 9D31-AF6F + + + Speedboats do 1 point of damage + DF3F-D464 + + + Speedboats do 1/2x damage + FB3F-D464 + + + Speedboats do 2x damage + 103F-D464 + + + Choppers do 1 point of damage + DF37-D4D4 + + + Choppers do 1/2x damage + 7437-D4D4 + + + Choppers do 2x damage + A637-D4D4 + + + M48's do 1 point of damage + DF32-A76F + + + M48's do 1/2x damage + 7432-A76F + + + M48's do 2x damage + A632-A76F + + + Crotales do 1 point of damage + DF3A-ADDF + + + Crotales do 1/2x damage + 743A-ADDF + + + Crotales do 2x damage + A63A-ADDF + + + AK47's have 1 armor point + DF29-0FDD + + + AK47's have 1/2x armor points + D929-0FDD + + + AK47's have 2x armor points + F029-0FDD + + + APHIDs have 1 armor points + DFA7-D76D + + + APHIDs have 1/2x armor points + DAA7-D76D + + + APHIDs have 2x armor points + 74A7-D76D + + + AAA's have 1 armor points + DF83-ADD7 + + + AAA's have 1/2x armor points + FB83-ADD7 + + + AAA's have 2x armor points + 1083-ADD7 + + + Rapiers have 1 armor points + DFAE-6F6D + + + Rapiers have 1/2x armor points + 49AE-6F6D + + + Rapiers have 2x armor points + B1AE-6F6D + + + VDA's have 1 armor points + DFA9-AFDD + + + VDA's have 1/2x armor points + 74A9-AFDD + + + VDA's have 2x armor points + A6A9-AFDD + + + ZSU's have 1 armor points + DFAD-DFDF + + + ZSU's have 1/2x armor points + 08AD-DFDF + + + ZSU's have 2x armor points + EEAD-DFDF + + + Speedboats have 1 armor points + DFAB-DDDD + + + Speedboats have 1/2x armor points + 08AB-DDDD + + + Speedboats have 2x armor points + EEAB-DDDD + + + Choppers have 1 armor points + DFA7-0DDD + + + Choppers have 1/2x armor points + 08A7-0DDD + + + Choppers have 2x armor points + EEA7-0DDD + + + M48's have 1 armor points + DFA0-646D + + + M48's have 1/2x armor points + 10A0-646D + + + M48's have 2x armor points + DFA0-64AD + + + Crotales have 1 armor points + DFA3-07DD + + + Crotales have 1/2x armor points + 52A3-07DD + + + Crotales have 2x armor points + DFA3-070D + + + AK47 bullets fly slower + DD39-D4D4 + + + APHID bullets fly slower + DD3E-A76F + + + AAA bullets fly slower + DD3D-A76F + + + Rapier bullets fly slower + DD3C-AFDF + + + VDA bullets fly slower + DD34-A7DF + + + ZSU bullets fly slower + DD31-A4DF + + + Speedboat bullets fly slower + DD3F-D7D4 + + + Chopper bullets fly slower + DD37-D464 + + + M48 bullets fly slower + DD33-ADDF + + + + D-Force (USA) + + Start with 10 lives + 7168-D5F6 + C668-D596 + + + Start with 12 lives + C868-D5F6 + C068-D596 + + + Start with 14 lives + CF68-D5F6 + EF68-D596 + + + Start with 16 lives + 9E68-D5F6 + C068-D596 + + + Infinite lives + 3CCA-D4DD + + + Continue with 10 lives + 7168-D70F + C668-D76F + + + Continue with 12 lives + C868-D70F + C068-D76F + + + Continue with 14 lives + CF68-D70F + EF68-D76F + + + Continue with 16 lives + 9E68-D70F + C068-D76F + + + Start with cannon power at level 2 + DFB6-DF6D + + + Start with cannon power at level 3 + D4B6-DF6D + + + Start with cannon power at level 4 + D7B6-DF6D + + + Start with cannon power at level 6 + D9B6-DF6D + + + Start with cannon power at level 8 + D5B6-DF6D + + + Start with cannon power at level 10 + DBB6-DF6D + + + Start with cannon power at level 12 + D8B6-DF6D + + + Continue with cannon power at level 2 + DF68-DF0F + DE68-DD6F + + + Continue with cannon power at level 3 + D468-DF0F + DE68-DD6F + + + Continue with cannon power at level 4 + D768-DF0F + DE68-DD6F + + + Continue with cannon power at level 6 + D968-DF0F + DE68-DD6F + + + Continue with cannon power at level 8 + D568-DF0F + DE68-DD6F + + + Continue with cannon power at level 10 + DB68-DF0F + DE68-DD6F + + + Continue with cannon power at level 12 + D868-DF0F + DE68-DD6F + + + Start equipped with unguided missiles + DAB6-D76D + FDB6-D4AD + + + Continue equipped with unguided missiles + 7D6C-D40F + 2C6C-D46F + FD6C-D7DF + + + Loss of a life does not decrease cannon power at normal difficulty (except on continues) + DDC7-DD0F + + + Loss of a life does not decrease cannon power at hard difficulty (except on continues) + DDC0-D4DF + + + Pink power-up increases missile power along with cannon power + DA3D-6464 + + + + Dino City (USA) + + Infinite health - P1 + 7E16ED03 + + + No harm from most enemies + 6DA6-6D69 + + + Infinite credits - both players + C260-67F7 + + + 1 credit instead of 3 - P1 + DFC2-A494 + + + 2 credits - P1 + D4C2-A494 + + + 5 credits - P1 + D9C2-A494 + + + 7 credits - P1 + D5C2-A494 + + + 9 credits - P1 + DBC2-A494 + + + No credits - P1 + DDC2-A494 + + + 1 credit instead of 3 - P2 + DFCF-DFF7 + + + 2 credits - P2 + D4CF-DFF7 + + + 5 credits - P2 + D9CF-DFF7 + + + 7 credits - P2 + D5CF-DFF7 + + + 9 credits - P2 + DBCF-DFF7 + + + No credits - P2 + DDCF-DFF7 + + + Clock runs faster + 7A64-D420 + + + Clock runs slower + ED64-D420 + + + Clock runs much slower + ED64-D420 + DF64-D7F0 + + + Freeze clock - must switch off effects in bonus stage + 8269-DF90 + + + 1 play per game instead of 3 - both players + DF6D-D7BD + + + 2 plays per game - both players + D46D-D7BD + + + 4 plays per game - both players + D06D-D7BD + + + 5 plays per game - both players + D96D-D7BD + + + 7 plays per game - both players + D56D-D7BD + + + 9 plays per game - both players + DB6D-D7BD + + + Infinite plays - both players + C26E-6D2D + + + No harm if swallowed by a monster + C23B-A7F9 + C232-67B1 + + + Collect 2 eggs for extra play instead of 50 + D427-6D2D + + + Collect 5 eggs for extra play + D927-6D2D + + + Collect 10 eggs for extra play + FD27-6D2D + + + Collect 15 eggs for extra play + F927-6D2D + + + Collect 25 eggs for extra play + 4927-6D2D + + + Collect 75 eggs for extra play + 5927-6D2D + + + Collect 99 eggs for extra play + BB27-6D2D + + + Rex jumps higher + EC6B-DFBE + + + Rex jumps much higher + E66B-DFBE + + + Tops jumps higher + EC8A-D793 + + + Tops jumps much higher + E68A-D793 + + + Timmy and Jamie jump higher + EC22-DF22 + + + Timmy and Jamie jump much higher + E622-DF22 + + + + Donkey Kong Country 2 - Diddy's Kong Quest (USA) (En,Fr) + + Master code - Must be entered (Rev0) + E6EE-A7D7 + 6DAF-12EB + 6D8D-C33E + + + Infinite lives + C2A1-CE5B + C2A5-C37B + + + Start with 3 lives + D465-3D67 + D46C-3D07 + + + Start with 10 lives + DB65-3D67 + DB6C-3D07 + + + Start with 25 lives + F665-3D67 + F66C-3D07 + + + Start with 50 lives + 7F65-3D67 + 7F6C-3D07 + + + Start with 99 lives + 1765-3D67 + 176C-3D07 + + + Start with 255 lives + EE65-3D67 + + + Get 2 lives per 100 bananas collected + D4A1-437C + D4A5-4AEC + + + Get 5 lives per 100 bananas collected + D9A1-437C + D9A5-4AEC + + + Get 255 lives per 100 bananas collected + EEA1-437C + + + When your last Kong is hit the other returns + EEC2-1A1D + EECC-CA4D + + + Easy level exit (press start and select) + DD6C-C7D4 + DD62-C4A4 + + + Start with more kong family coins + 626D-4EBD + + + Kong family coins don't get used up + C2B9-13B7 + C2B1-13F7 + + + Start a new game with more Kremcoins + 626D-432D + + + Kremcoins don't get used up + C2B9-1297 + C2B1-1A27 + + + Mega-jump for Diddy + EDD0-735A + + + Super-jump for Diddy + E7D0-735A + + + Diddy jumps higher + E1D0-735A + + + Diddy doesn't jump as high + EBD0-735A + + + Diddy jumps much lower + ECD0-735A + + + Mega-jump for Dixie + EDD7-5AEA + + + Super-jump for Dixie + E7D7-5AEA + + + Dixie jumps higher + E5D7-5AEA + + + Dixie doesn't jump as high + EBD7-5AEA + + + Dixie jumps much lower + ECD7-5AEA + + + Mega-jump for Rambi with Diddy riding + EFDD-535A + + + Super-jump for Rambi with Diddy riding + E7DD-535A + + + Rambi jumps higher with Diddy riding + E5DD-535A + + + Rambi doesn't jump as high with Diddy riding + ECDD-535A + + + + Donkey Kong Country 2 - Diddy's Kong Quest (USA) (En,Fr) (Rev 1) + + Master code - Must be entered (Rev1) + E6EE-A7D7 + 6DA4-1A8B + 6D8F-C33E + + + Infinite lives + C2A1-CE5B + C2A5-C37B + + + Start with 3 lives + D465-3D67 + D46C-3D07 + + + Start with 10 lives + DB65-3D67 + DB6C-3D07 + + + Start with 25 lives + F665-3D67 + F66C-3D07 + + + Start with 50 lives + 7F65-3D67 + 7F6C-3D07 + + + Start with 99 lives + 1765-3D67 + 176C-3D07 + + + Start with 255 lives + EE65-3D67 + + + Get 2 lives per 100 bananas collected + D4A1-437C + D4A5-4AEC + + + Get 5 lives per 100 bananas collected + D9A1-437C + D9A5-4AEC + + + Get 255 lives per 100 bananas collected + EEA1-437C + + + When your last Kong is hit the other returns + EEC2-1A1D + EECC-CA4D + + + Easy level exit (press start and select) + DD6C-C7D4 + DD62-C4A4 + + + Start with more kong family coins + 626D-4EBD + + + Kong family coins don't get used up + C2B9-13B7 + C2B1-13F7 + + + Start a new game with more Kremcoins + 626D-432D + + + Kremcoins don't get used up + C2B9-1297 + C2B1-1A27 + + + Mega-jump for Diddy + EDD0-735A + + + Super-jump for Diddy + E7D0-735A + + + Diddy jumps higher + E1D0-735A + + + Diddy doesn't jump as high + EBD0-735A + + + Diddy jumps much lower + ECD0-735A + + + Mega-jump for Dixie + EDD7-5AEA + + + Super-jump for Dixie + E7D7-5AEA + + + Dixie jumps higher + E5D7-5AEA + + + Dixie doesn't jump as high + EBD7-5AEA + + + Dixie jumps much lower + ECD7-5AEA + + + Mega-jump for Rambi with Diddy riding + EFDD-535A + + + Super-jump for Rambi with Diddy riding + E7DD-535A + + + Rambi jumps higher with Diddy riding + E5DD-535A + + + Rambi doesn't jump as high with Diddy riding + ECDD-535A + + + + Donkey Kong Country 3 - Dixie Kong's Double Trouble! (USA) (En,Fr) + + Invincibility + B768-C34D + + + Infinite lives + CB6E-73CD + + + Infinite bear coins + DBB8-729D + + + Get Funky's Gyrocopter with no need for DK coins + 6D6C-7EFF + 6D62-722F + + + + Donkey Kong Country (USA) + + Invincibility (no lockup) + 1DCC-CA7A + F6CF-13EA + F6CC-3E7A + + + Invincibility + 1DCC-CA7A + + + Almost invincible (switch off if you get stuck) + 1DCC-CA7A + 1DCA-C2EA + + + Infinite lives + C2C1-4A9C + + + Infinite lives (alt) + C2C9-4E2C + C2C1-4A9C + + + Start With 8 lives + D568-C34D + D568-C33D + + + Start With 11 lives + DC68-C34D + DC68-C33D + + + Start With 16 lives + DE68-C34D + DE68-C33D + + + Start With 26 lives + FB68-C34D + FB68-C33D + + + Start With 51 lives + 7468-C34D + 7468-C33D + + + Start With 76 lives + 0868-C34D + 0868-C33D + + + Start With 100 lives + 1768-C34D + 1768-C33D + + + Start with 255 lives + EE68-C34D + + + 10 Bananas needed for extra life + DBC1-3D6D + DCC1-34AD + DBC9-340D + DCC1-3D6D + + + 25 Bananas needed for extra life + F6C1-3D6D + FBC1-34AD + F6C9-340D + FBC1-3D6D + + + 50 Bananas needed for extra life + 7FC1-3D6D + 74C1-34AD + 7FC9-340D + 74C1-3D6D + + + 75 Bananas needed for extra life + 0CC1-3D6D + 08C1-34AD + 0CC9-340D + 08C1-3D6D + + + Easy level exit (press start and select) + DDB9-3DD4 + + + Easy level exit (press start and select) (alt) + DDB9-3DD4 + DDB0-34A4 + + + Bad buddy code (In 2P team mode, the inactive player can press select to gain control) + DD8B-C28A + + + Bad buddy code (In 2P team mode, the inactive player can press select to gain control) (alt) + DD8B-C28A + DD88-CE5A + + + Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) + D76B-337E + + + Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). + EE65-C37E + + + Return of Kong (alt) + 7E057901 + + + Keep Animals between stages + 1D6B-3FDD + 196A-333D + + + Keep Animals between stages (alt) + D76B-3FDD + 196A-333D + + + Keep Animals between stages (alt) + 1D6B-3FDD + 196A-333D + 1D6B-3D6D + 166A-3ECD + + + High-jump for Donkey Kong + A081-1273 + + + Super-jump for Donkey Kong + 2D81-1273 + + + Mega-jump for Donkey Kong + 3D81-1273 + + + Moon-jump for Donkey Kong + EE81-1273 + + + High-jump for Diddy Kong + 8081-1E73 + + + Super-jump for Diddy Kong + AD81-1E73 + + + Mega-jump for Diddy Kong + 2D81-1E73 + + + Moon-jump for Diddy Kong + EE81-1E73 + + + High-jump for Animals + A08F-C273 + + + Super-jump for Animals + 2D8F-C273 + + + Mega-jump for Animals + 3D8F-C273 + + + Moon-jump for Animals + EE8F-C273 + + + High-jump for Donkey Kong + A081-1273 + A086-13E3 + + + Super-jump for Donkey Kong + 2D81-1273 + 2D86-13E3 + + + Mega-Jump for Donkey Kong + 3D81-1273 + 3D86-13E3 + + + High-jump for Diddy Kong + 8081-1E73 + 808B-1AE3 + + + Super-jump for Diddy Kong + AD81-1E73 + AD8B-1AE3 + + + Mega-Jump for Diddy Kong + 2D81-1E73 + 2D8B-1AE3 + + + High-jump for all Animals + A08F-C273 + A087-C3E3 + + + Super-jump for all Animals + 2D8F-C273 + 2D87-C3E3 + + + Mega-jump for all Animals + 3D8F-C273 + 3087-C3E3 + + + Expresso Multi-jump (jump in mid-air) + EE80-C373 + + + + Donkey Kong Country (USA) (Rev 1) + + Invincibility (no lockup) + 1DCA-C2EA + F6C0-1A8A + F6C2-3AEA + + + Invincibility + 1DCA-C2EA + + + Almost invincible (switch off if you get stuck) + 1DCA-C2EA + + + Infinite lives + C2C1-4A2C + + + Start with 255 lives + EE68-C33D + + + Easy level exit (press start and select) + DDB0-34A4 + + + Bad buddy code (In 2P team mode, the inactive player can press select to gain control) + DD88-CE5A + + + Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) + D76C-327E + + + Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). + EE66-C27E + + + Return of Kong (alt) + 7E057901 + + + Keep Animals between stages + 1D6B-3D6D + 166A-3ECD + + + High-jump Donkey Kong + A086-13E3 + + + Super-jump Donkey Kong + 2D86-13E3 + + + Mega-jump Donkey Kong + 3D86-13E3 + + + Moon-jump Donkey Kong + EE86-13E3 + + + High-jump Diddy Kong + 808B-1AE3 + + + Super-jump Diddy Kong + AD8B-1AE3 + + + Mega-jump Diddy Kong + 2D8B-1AE3 + + + Moon-jump Diddy Kong + EE8B-1AE3 + + + High-jump Animals + A087-C3E3 + + + Super-jump Animals + 2D87-C3E3 + + + Mega-jump Animals + 3087-C3E3 + + + Moon-jump Animals + EE87-C3E3 + + + Expresso Multi-jump (jump in mid-air) + EE81-CEE3 + + + + Donkey Kong Country (USA) (Rev 2) + + Invincibility (no lockup) + F6C3-32EA + 1DC2-C3EA + F6C9-128A + + + Invincibility + 1DC2-C3EA + + + Infinite lives + C2C5-4A2C + + + 255 lives + EE63-333D + + + Easy level exit (press start and select) + DDB9-3764 + + + Bad buddy code (In 2P team mode, the inactive player can press select to gain control) + DD82-CEEA + + + Both Kongs return (get both Kongs back on map screen after dying, doesn't work when you fall off the screen) + D76C-337E + + + Return of Kong (when your last Kong gets hit, the other one returns (reset if you get stuck). Must have had both Kongs at some point). + EE66-C37E + + + Return of Kong (alt) + 7E057901 + + + High-jump for Donkey Kong + A08C-1E53 + + + Super-jump for Donkey Kong + 2D8C-1E53 + + + Mega-jump for Donkey Kong + 308C-1E53 + + + Moon-jump for Donkey Kong + EE8C-1E53 + + + High-jump for Diddy Kong + 8088-1253 + + + Super-jump for Diddy Kong + AD88-1253 + + + Mega-jump for Diddy Kong + 2D88-1253 + + + Moon-jump for Diddy Kong + EE88-1253 + + + High-jump for Animals + A089-CE53 + + + Super-jump for Animals + 2D89-CE53 + + + Mega-jump for Animals + 3089-CE53 + + + Moon-jump for Animals + EE89-CE53 + + + Multi-jump in mid-air + EE8B-CA53 + + + + Doomsday Warrior (USA) + + Infinite health - P1 + 7E02C664 + + + Infinite health - P2 + 7E03C664 + + + No health - P1 + 7E02C600 + + + No health - P2 + 7E03C600 + + + Infinite health and matches last forever + 82C7-046F + + + Always get 4 bonus points for improving abilities + CBB2-ADDD + D0B2-AD0D + 6DB2-A46D + + + On normal level, start with all stats at 2 bars instead of 0 + D9B9-64DD + + + First 6 fights are against Sledge + DDB0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Layban + DFB0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Amon + D4B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Daisy + D7B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against P-Lump + D0B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Grimrock + D9B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Nuform + D1B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 7 fights are against Shadow + D5B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Ashura + D6B0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + First 6 fights are against Main + DBB0-ADAD + 6DB0-AFDD + E9B0-AF0D + + + All fights are in order (you don't choose your opponent) + DDB7-AFAD + + + You can heal completely, not just to the top of each segment + DD83-D4AF + + + Don't heal at all + 3C8E-DDAF + + + + Doom Troopers (USA) + + Invincibility + 7E0C9901 + + + Infinite health + 7E0C3164 + + + Infinite lives + 7E0CB303 + 7E010203 + + + Infinite ammo + 7E00E663 + + + Infinite special weapon ammo + 7E00EA0A + + + Die to complete level (don't use with infinite lives code) + 7E010201 + + + + Doom (USA) + + Infinite health + 6EDE-955D + C3DE-958D + 9CDE-95ED + 5DDD-B07D + 6DDD-B05D + + + Start with mega health and mega armor + BDEA-B053 + 62EA-B953 + + + Start with more ammo + E3EA-B153 + + + Heat vision/color blind mode + CBD3-B17F + + + Select The Shores of Hell or Inferno in any skill level + D7CF-F953 + + + + Double Dragon V - The Shadow Falls (USA) + + Infinite health - P1 + 7E1B8D50 + + + Infinite health - P2 + 7E1C8A50 + + + No health - P1 + 7E1B8D00 + + + No health - P2 + 7E1C8A00 + + + Bosses unlocked cheat enabled + 7F006801 + + + P1 always wins + DDAB-3DAE + + + Computer (P2) can't perform special moves + B3C8-CFBF + B3C6-CDBF + BAC9-3FBF + + + Allows you to pick up to 9 points of any attribute instead of 5 + DBBC-1F27 + + + Both characters start with 50% energy + 46C6-340D + + + Both characters start with 25% energy + F0C6-340D + + + Harder to recover from dizziness + 3C85-CF07 + + + Dizziness doesn't last long + D685-C407 + + + Stuns disabled cheat enabled + 7F006A01 + + + Throwing disabled cheat enabled + 7F006C01 + + + P1 is Billy Lee + 7E063200 + + + P1 is Jimmy Lee + 7E063201 + + + P1 is Jawbreaker + 7E063202 + + + P1 is Icepick + 7E063203 + + + P1 is S Master + 7E063204 + + + P1 is Bones + 7E063205 + + + P1 is Sickle + 7E063206 + + + P1 is Blade + 7E063207 + + + P1 is T Happy + 7E063208 + + + P1 is Countdown + 7E063209 + + + P1 is Dominique + 7E06320A + + + P1 is Sekka + 7E06320B + + + P2 is Billy Lee + 7E063300 + + + P2 is Jimmy Lee + 7E063301 + + + P2 is Jawbreaker + 7E063302 + + + P2 is Icepick + 7E063303 + + + P2 is S Master + 7E063304 + + + P2 is Bones + 7E063305 + + + P2 is Sickle + 7E063306 + + + P2 is Blade + 7E063307 + + + P2 is T Happy + 7E063308 + + + P2 is Countdown + 7E063309 + + + P2 is Dominique + 7E06330A + + + P2 is Sekka + 7E06330B + + + + Dragon's Lair (USA) + + Protection from most hazards + 3C8C-0FA4 + + + Infinite time + 4A84-64D4 + + + Infinite lives + 3C62-D70F + + + Start with 1 life + DD89-0404 + + + Start with 6 lives + D989-0404 + + + Start with 9 lives + D689-0404 + + + Start with the Dagger + DF86-0DD4 + + + Start with the Shuriken + D486-0DD4 + + + Slow timer + 5D89-6D04 + + + Faster timer + 4989-6D04 + + + 1 coin gives 10 + DF88-0F64 + + + + Dragon - The Bruce Lee Story (USA) + + Infinite health (disable before stage ends) + 7E00D9FF + + + Infinite fighting power + 7E00DBFF + + + 0 HP - Enemy 1 + 7E01D900 + + + 0 HP - Enemy 2 + 7E02D900 + + + Infinite time (turn on only in a timed fight and off after defeating your opponent) + 7E208263 + + + Hyper Mode - P1 + 7E003E01 + + + Hyper Mode - P2/Enemy 1 + 7E013E01 + + + Hyper Mode - P3/Enemy 2 + 7E023E01 + + + P1 Knocks Out Easier + 7E009302 + + + P2 Knocks Out Easier + 7E019302 + + + P3 Knocks Out Easier + 7E029302 + + + P1 Can't Be Hit + 7E009544 + + + P2 Can't Be Hit + 7E019544 + + + P3 Can't Be Hit + 7E029544 + + + Start in Alley outside kitchen (version 2) + 7E539E01 + + + Start in Alley outside kitchen + 7E539E02 + + + Start in the Seattle Gym + 7E539E03 + + + Start in the George Wu Gym + 7E539E04 + + + Start in Film Set + 7E539E05 + + + Start in Bruce's Kwoon + 7E539E06 + + + Start in Virgin Gym + 7E539E07 + + + Start in the Big Boss Film set (version 2) + 7E539E08 + + + Start in the Big Boss Film set + 7E539E09 + + + Start in the Enter The Dragon set + 7E539E0A + + + Start in the Armored Boss Arena + 7E539E0B + + + Start in the Machine + 7E539E0C + + + + Dragon View (USA) + + Infinite health (may crash at the end of Ortah Temple if using an emulator) + CE65-4586 + + + Infinite Jade + CE34-3106 + + + Infinite Bombs + E23-C9A2 + + + Infinite Potions + CE26-41A3 + + + Infinite magic for rings + C237-4116 + + + Get maximum level after killing a Demon + 7834-1F67 + + + Sell a fruit to get 254 fruit + 6D37-196B + 7534-C0AB + + + + Drakkhen (USA) + + Protection from some attacks + 8E3D-696D + 8E30-A408 + 8EA2-0113 + + + Magic points restored 50 points at a time while player is on screen + 7433-6FD8 + + + Magic points restored 10 points at a time while player is on screen + DC33-6FD8 + + + + Dream TV (USA) + + Almost infinite health + 8FA6-3DA8 + 8FAA-3FA8 + + + Can't get hit (some characters are white) + DDC7-1DD8 + + + Infinite lives + DDCE-C7DC + + + One-hit kills, except skeletons + 8F23-3768 + + + Start with 5 lives + D9B8-1F04 + + + Start with 1 life + DFB8-1F04 + + + Start with 8 lives + D6B8-1F04 + + + Mega-jump - switch off to land again + 8F84-17D8 + + + Start with 2/3 health - 1st life + 4DBD-CF04 + + + Start with 2/3 health - after 1st life + 4DCE-CD0C + + + Start with 1/3 health - 1st life + FDBD-CF04 + + + Start with 1/3 health - after 1st life + FDCE-CD0C + + + + Dual Orb II (Japan) + + Gain 65,535 EXP from each battle + CEF7-8F9F + A8F7-84FF + + + Sell one item for maximum money + DD4F-8FD4 + + + Can skip barrel puzzle + 544E-7FD6 + + + No random battles + 6D7B-77D6 + + + Enemies start with 10 HP + CE2C-540D + 7B2C-546D + + + Enemies start with 100 HP + CE2C-540D + + + + Dungeon Master (USA) + + Almost no mana loss (must have enough to cast) + 85B5-07D9 + + + Food meter doesn't go down + 85CF-0F29 + + + Water meter doesn't go down + 85C5-0FB9 + + + 1st character has 250 maximum hit points + ECDC-F26F + + + 2nd character has 250 maximum hit points + ECDA-220F + + + 3rd character has 250 maximum hit points + ECD3-B2D4 + + + 4th character has 250 maximum hit points + ECDD-BAA7 + + + 1st character has 250 maximum stamina + A0DC-F36F + DBDC-F3AF + + + 2nd character has 250 maximum stamina + A0DA-230F + DBDA-236F + + + 3rd character has 250 maximum stamina + A0D3-B3D4 + DBD3-B304 + + + 4th character has 250 maximum stamina + A0DD-B2A7 + DBDD-B3D7 + + + 1st character has 250 maximum mana + ECDC-FE6F + + + 2nd character has 250 maximum mana + ECDA-2E0F + + + 3rd character has 250 maximum mana + ECD3-BED4 + + + 4th character has 250 maximum mana + ECDD-B3A7 + + + 1st character has 99 current strength + 17D8-F36F + + + 2nd character has 99 current strength + 17D2-230F + + + 3rd character has 99 current strength + 17DE-B3D4 + + + 4th character has 99 current strength + 17DF-B2A7 + + + 1st character has 99 maximum strength + 17D8-F30F + + + 2nd character has 99 maximum strength + 17D2-23DF + + + 3rd character has 99 maximum strength + 17DE-B2A4 + + + 4th character has 99 maximum strength + 17DF-B267 + + + 1st character has 99 current dexterity + 17D8-FE0F + + + 2nd character has 99 current dexterity + 17D2-2EDF + + + 3rd character has 99 current dexterity + 17DE-B3A4 + + + 4th character has 99 current dexterity + 17DF-B367 + + + 1st character has 99 maximum dexterity + 17D8-FEDF + + + 2nd character has 99 maximum dexterity + 17D2-23AF + + + 3rd character has 99 maximum dexterity + 17DE-B364 + + + 4th character has 99 maximum dexterity + 17DF-B307 + + + 1st character has 99 current wisdom + 17DA-FADF + + + 2nd character has 99 current wisdom + 17D2-2EAF + + + 3rd character has 99 current wisdom + 17DE-BE64 + + + 4th character has 99 current wisdom + 17DF-BE07 + + + 1st character has 99 maximum wisdom + 17D8-FEAF + + + 2nd character has 99 maximum wisdom + 17D2-2E6F + + + 3rd character has 99 maximum wisdom + 17DE-BE04 + + + 4th character has 99 maximum wisdom + 17DF-BED7 + + + 1st character has 99 current vitality + 17DA-FAAF + + + 2nd character has 99 current vitality + 17D3-2A6F + + + 3rd character has 99 current vitality + 17DD-2A04 + + + 4th character has 99 current vitality + 17D4-BAD7 + + + 1st character has 99 maximum vitality + 17DA-FA6F + + + 2nd character has 99 maximum vitality + 17D3-2A0F + + + 3rd character has 99 maximum vitality + 17DD-2AD4 + + + 4th character has 99 maximum vitality + 17DF-BEA7 + + + 1st character has 99 current anti-magic + 17DA-F26F + + + 2nd character has 99 current anti-magic + 17D3-220F + + + 3rd character has 99 current anti-magic + 17DD-22D4 + + + 4th character has 99 current anti-magic + 17D4-BAA7 + + + 1st character has 99 maximum anti-magic + 17DA-F20F + + + 2nd character has 99 maximum anti-magic + 17D3-22DF + + + 3rd character has 99 maximum anti-magic + 17DD-2AA4 + + + 4th character has 99 maximum anti-magic + 17D4-BA67 + + + 1st character has 99 current anti-fire + 17DA-F30F + + + 2nd character has 99 current anti-fire + 17D3-23DF + + + 3rd character has 99 current anti-fire + 17DD-22A4 + + + 4th character has 99 current anti-fire + 17D4-B267 + + + 1st character has 99 maximum anti-fire + 17DA-F3DF + + + 2nd character has 99 maximum anti-fire + 17D3-22AF + + + 3rd character has 99 maximum anti-fire + 17DD-2264 + + + 4th character has 99 maximum anti-fire + 17D4-B207 + + + 1st character is a level 15 fighter + 5EDA-FEAF + + + 1st character is a level 15 ninja + 5ED2-F20F + + + 1st character is a level 15 healer + 5ED2-F3AF + + + 1st character is a level 15 wizard + 5ED3-FA0F + + + 2nd character is a level 15 fighter + 5ED3-2E6F + + + 2nd character is a level 15 ninja + 5EDE-22DF + + + 2nd character is a level 15 healer + 5EDE-236F + + + 2nd character is a level 15 wizard + 5EDD-FAD4 + + + 3rd character is a level 15 fighter + 5EDD-2E04 + + + 3rd character is a level 15 ninja + 5EDF-2AA4 + + + 3rd character is a level 15 healer + 5EDF-2304 + + + 3rd character is a level 15 wizard + 5EDF-2EA4 + + + 4th character is a level 15 fighter + 5ED4-BED7 + + + 4th character is a level 15 ninja + 5ED7-BA67 + + + 4th character is a level 15 healer + 5ED7-B3D7 + + + 4th character is a level 15 wizard + 5ED7-BE67 + + + 1st character has a nearly full food meter + D5D8-FAAF + + + 1st character has a nearly full water meter + D5D8-F20F + + + 2nd character has a nearly full food meter + D5D2-2A6F + + + 2nd character has a nearly full water meter + D5D2-22DF + + + 3rd character has a nearly full food meter + D5DE-BA04 + + + 3rd character has a nearly full water meter + D5DE-BAA4 + + + 4th character has a nearly full food meter + D5DF-BAD7 + + + 4th character has a nearly full water meter + D5DF-BA67 + + + + EarthBound (USA) + + Infinite health (all characters) + 8251-57D6 + + + Infinite health + 7E9A13E7 + 7E9A1403 + + + Get to level 99 after one battle (all characters) + EE2E-54A1 + + + 9999 current PP + 7E9A1B0F + 7E9A1C27 + + + Fast money (buy a bread w/the code off, turn code on and sell it for $32,646) + EE9A-E5F5 + + + Start with a level 9 character + DB23-77D1 + + + Start with a level 15 character + DE23-77D1 + + + Start with a level 50 character + 7423-77D1 + + + Start with a level 100 character + 1723-77D1 + + + Start with a level 255 character + EE23-77D1 + + + Start with a super strong character + EE2E-7D01 + + + Start with a lot of HP + BB2D-5461 + + + Start with a lot of PSI + BB2F-54A1 + + + Dad never calls + E395-87DD + + + + Earth Defense Force (USA) + + Infinite shields + C263-6FAF + + + Infinite credits + C268-A491 + + + Start with 4 shields + 7123-A4A7 + 3D23-A7D7 + + + Start with 5 shields + 2B23-A4A7 + B823-A7D7 + + + Start at experience level 2 + D42E-A7A7 + + + Start at experience level 3 + D72E-A7A7 + + + Start at experience level 4 + D02E-A7A7 + + + Start at experience level 5 + D92E-A7A7 + + + Advancing experience levels is easier + 4D21-6F0F + + + Advancing experience levels is much easier + DA21-6F0F + + + 2 credits + DF2E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + 3 credits + D42E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + 6 credits + D92E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + 8 credits + D52E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + 10 credits + DB2E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + 1 credit + DD2E-AF67 + CB2E-AF07 + DD2E-AFA7 + + + Keep current score when game is continued + C223-AFD7 + C223-AFA7 + + + Start at stage 2 + DF37-DDDD + CB34-D7AD + DD37-DD0D + + + Start at stage 3 + D437-DDDD + CB34-D7AD + DD37-DD0D + + + Start at stage 4 + D737-DDDD + CB34-D7AD + DD37-DD0D + + + Start at stage 5 + D037-DDDD + CB34-D7AD + DD37-DD0D + + + Start at stage 6 + D937-DDDD + CB34-D7AD + DD37-DD0D + + + + Earthworm Jim 2 (USA) + + Invincibility + 7E653C10 + + + Infinite health + CB57-7D0B + + + Infinite lives + CBF0-7464 + + + Start with 200% health + 7450-770B + + + Start with 300% health + 7750-770B + + + Start with 400% health + 7050-770B + + + Start with 500% health + 7950-770B + + + Start with 700% health + 7550-770B + + + Start with 900% health + 7B50-770B + + + Start with 1 life and no continues + 7D55-5F06 + + + Start with 5 lives + 7055-5F06 + + + Start with 7 lives + 7155-5F06 + + + Start with 9 lives + 7655-5F06 + + + Start with 2000 bullets + 749E-54B4 + + + Start with 3000 bullets + 779E-54B4 + + + Start with 4000 bullets + 709E-54B4 + + + Start with 5000 bullets + 799E-54B4 + + + Start with 7000 bullets + 759E-54B4 + + + Start with 9000 bullets + 7B9E-54B4 + + + Get 1000 bullets on pick-up + D798-74F7 + 3B98-7F27 + + + + Earthworm Jim (USA) + + Invincibility against enemies + 7E682A3D + + + Infinite health + A21F-7464 + + + Infinite health (alt) + 7E662739 + + + Infinite Ammo + 2215-EFAF + + + Infinite shields + 7E6B4863 + + + Infinite lives + A2DA-87A7 + + + Start with 1 life + 7D13-8FDF + + + Start with 5 lives + 7013-8FDF + + + Start with 10 lives + 7B13-8FDF + + + Start with 25 lives + 0613-8FDF + + + Start with 50 lives + 1F13-8FDF + + + Start with 300% health + 7717-7F64 + + + Start with 500% health + 7917-7F64 + + + Start with 900% health + 7B17-7F64 + + + Die after one hit + 7D17-7F64 + + + Super shot always active + 7E661CFF + 7E69A009 + + + Infinite time in Sub + 7E675263 + + + Always win race in Andy Asteroids stages (glitchy graphics) + 7E6B46FF + + + Start on What The Heck? + 7E512A01 + + + Start on What The Heck? (Snowman Boss) + 7E512A02 + + + Start on What The Heck? (Boss Fight With Evil The Cat) + 7E512A03 + + + Start on Snot A Problem Round 1 + 7E512A04 + + + Start on Snot A Problem Round 2 + 7E512A05 + + + Start on Snot A Problem Round 3 + 7E512A06 + + + Start on For Pete's Sake + 7E512A07 + + + Start on Buttville, Part 2 + 7E512A08 + + + Start on Buttville, Part 1 + 7E512A09 + + + Start on Level 5, Part 1 + 7E512A0A + + + Start on Level 5 (Chicken Boss) + 7E512A0B + + + Start on Level 5, Part 2 + 7E512A0C + + + Start on Down The Tubes + 7E512A0D + + + Start on Tube Race + 7E512A0E + + + Start on Andy Asteroids?, Course 1 + 7E512A0F + + + Start on Andy Asteroids?, Course 2 + 7E512A10 + + + Start on Andy Asteroids?, Course 3 + 7E512A11 + + + Start on Andy Asteroids?, Course 4 + 7E512A12 + + + Start on Andy Asteroids?, Course 5 + 7E512A13 + + + Start on Andy Asteroids?, Course 6 + 7E512A14 + + + Start on Who Turned Out The Light?, Part 1 + 7E512A15 + + + Start on Who Turned Out The Light?, Part 2 + 7E512A16 + + + Start on Who Turned Out The Light?, Part 3 + 7E512A17 + + + Start on Who Turned Out The Light?, Part 4 + 7E512A18 + + + Start on Who Turned Out The Light?, Part 5 + 7E512A19 + + + + Emerald Dragon (Japan) + + Max level after one battle + 6DDA-E707 + + + Max Parus after one battle + 6DD6-E4D7 + + + No random battles + F6C0-57D0 + + + + Equinox (USA) + + Protection from most small monsters + C28F-AF4D + + + Infinite life energy + 3CA0-0DC7 + + + Infinite magic-must have enough MP for spell to work + CEAE-0D17 + + + More energy from apples + CB2A-C4D9 + + + Super-jump + 4F27-1F00 + 4020-1FD0 + + + Mega-jump + FC27-1F00 + 4020-1FD0 + + + Colored doors don't need keys + DD86-674F + + + Colored doors don't need keys + 3C86-671F + + + Super speed + B32C-4FA0 + CD2C-4700 + + + 'Slow' spell lasts 2x as long + D9AC-6437 + + + 'Slow' spell lasts 3x as long + D6AC-6437 + + + 'Freeze' spell lasts 2x as long + D9AB-6FC7 + + + 'Freeze' spell lasts 3x as long + D6AB-6FC7 + + + + E.V.O. - Search for Eden (USA) + + Invincibility + 1D66-072B + + + Infinite EVO points + 6D27-6FAF + + + Infinite EP + FDD2-FA86 + 45D2-FAE6 + + + Protection from most hazards + C96E-07FB + + + Food replenishes hit points to full + DD60-D18B + + + Less damage from stronger creatures + D566-A7F8 + + + Horn never breaks + C964-A726 + + + Collect one health to max it out + DD61-D97B + + + One-hit kills + DD6C-AFF2 + + + + Extra Innings (USA) + + Game lasts 1 inning + DFBE-ADAD + DFBF-DF6F + DFB4-0FDF + + + Game lasts 2 innings + D4BE-ADAD + D4BF-DF6F + D4B4-0FDF + + + Game lasts 3 innings + D7BE-ADAD + D7BF-DF6F + D7B4-0FDF + + + Game lasts 4 innings + D0BE-ADAD + D0BF-DF6F + D0B4-0FDF + + + Game lasts 5 innings + D9BE-ADAD + D9BF-DF6F + D9B4-0FDF + + + Game lasts 7 innings + D5BE-ADAD + D5BF-DF6F + D5B4-0FDF + + + 1 strike and batter's out + DF67-DF07 + + + 1 strike and batter's out + DD60-A4D7 + + + 2 strikes and batter's out + D467-DF07 + + + 2 strikes and batter's out + DF60-A4D7 + + + Batter never strikes out + C264-D767 + C260-A4A7 + + + 1 ball and batter walks + DF6A-DFA7 + + + 2 balls and batter walks + D46A-DFA7 + + + 3 balls and batter walks + D76A-DFA7 + + + Batter never walks + C26A-DDD7 + + + 1 out per inning + DF67-AD67 + DF61-D4A7 + + + 2 outs per inning + D467-AD67 + D461-D4A7 + + + + Eye of the Beholder (USA) + + Infinite HP + 8285-6D2C + 82DE-049B + + + No waiting to hit again + 828D-A798 + + + Kill with 1 hit (works for monsters also) + CBAA-A726 + 3CA2-AD96 + + + Pick a lawful, human male fighter and he will be at level 6 + D18B-A474 + + + Pick a lawful, human male fighter and he will be at Level 8 + D68B-A474 + + + 999,999 EXP 1st class + 7E05333F + 7E053442 + 7E05350F + + + + F1 ROC - Race of Champions (USA) + + Start player with no money instead of $500 + BA26-A44F + + + Start player with $5,240 + 3C26-AF4F + CB26-AF1F + D426-AF3F + + + Start player with $20,600 + 3C26-AF4F + CB26-AF1F + D626-AF3F + + + Start player with $163,960 + 3C26-AF4F + CB26-AF1F + 0D26-AF3F + + + Start player with $327,800 + 3C26-AF4F + CB26-AF1F + 6D26-AF3F + + + Start player with $652,920 + 3C26-AF4F + CB26-AF1F + EE26-AF3F + + + No damage when hitting walls + C9A8-07DD + + + No damage when hitting other cars + C922-0FDD + + + Normal tires are free + DDEE-6F21 + + + Hi-grip tires are free + DDEE-6491 + + + Rain tires are free + DDEE-6F91 + + + 2L nitro is free + DDED-A491 + + + 3L nitro is free + DDED-A421 + + + 4L nitro is free + DDED-A791 + + + Ford V-8 engine is free + DDEE-6721 + DDED-ADF1 + + + Ilmoa V-8 engine is free + DDED-AD91 + DDED-ADB1 + + + Remart V-10 engine is free + DDED-AD21 + DDED-AFF1 + + + Low DF rear wing is free + DDE3-6791 + + + High DF rear wing is free + DDEE-6D91 + DDEE-6DB1 + + + Low DF front wing is free + DDE3-6D21 + + + High DF front wing is free + DDE3-6F21 + DDE3-64F1 + + + Special-L front wing is free + DDE3-6491 + DDE3-64B1 + + + Small diffuser is free + DDE2-6421 + + + Large diffuser is free + DDE2-6721 + + + Special diffuser is free + DDE3-6D91 + DDE3-6DB1 + + + Hard suspension is free + DDE2-6F21 + + + Active suspension is free + DDE2-6491 + DDE2-64B1 + + + Carbon brakes are free + DDE2-6D91 + + + Antilock brakes are free + DDE2-6D21 + DDE2-6FF1 + + + 5-speed transmission is free + DDEA-6491 + + + 6-speed transmission is free + DDEA-6421 + DDEA-67F1 + + + 7-speed transmission is free + DDEA-6791 + DDEA-67B1 + + + Type 2 chassis is free + DDEA-6D21 + DDEA-6FF1 + + + Type 3 chassis is free + DDEA-6F91 + DDEA-6FB1 + + + + Faceball 2000 (USA) + + Start with 1 life instead of 3 + DFB6-6461 + + + Start with 5 lives + D9B6-6461 + + + Start with 7 lives + D5B6-6461 + + + Start with 9 lives + DBB6-6461 + + + Start with 25 lives + FBB6-6461 + + + Start with 50 lives + 74B6-6461 + + + Start with 75 lives + 08B6-6461 + + + Start with 99 lives + 17B6-6461 + + + Start with 255 lives + EEB6-6461 + + + Infinite lives + 89AB-D708 + + + Start each Cyberzone level with 1 tag required + CBB5-6406 + DFB5-6466 + + + Start each Cyberzone level with 5 tags required + CBB5-6406 + D9B5-6466 + + + Start each Cyberzone level with 20 tags required + CBB5-6406 + F0B5-6466 + + + Start each Cyberzone level with 30 tags required + CBB5-6406 + F3B5-6466 + + + Start each Cyberzone level with 60 tags required + CBB5-6406 + 7AB5-6466 + + + Start each Cyberzone level with 90 tags required + CBB5-6406 + 9CB5-6466 + + + Start Cyberzone mode on zone 1 level 2 + C282-0706 + DFCE-0468 + + + Start Cyberzone mode on zone 1 level 3 + C282-0706 + D4CE-0468 + + + Start Cyberzone mode on zone 1 level 4 + C282-0706 + D7CE-0468 + + + Start Cyberzone mode on zone 1 level 5 + C282-0706 + D0CE-0468 + + + Start Cyberzone mode on zone 1 bonus level + C282-0706 + D9CE-0468 + + + Start Cyberzone mode on zone 2 level 6 + C282-0706 + D1CE-0468 + + + Start Cyberzone mode on zone 2 level 7 + C282-0706 + D5CE-0468 + + + Start Cyberzone mode on zone 2 level 8 + C282-0706 + D6CE-0468 + + + Start Cyberzone mode on zone 2 level 9 + C282-0706 + DBCE-0468 + + + Start Cyberzone mode on zone 2 level 10 + C282-0706 + DCCE-0468 + + + Start Cyberzone mode on zone 2 bonus level + C282-0706 + D8CE-0468 + + + Start Cyberzone mode on zone 3 level 11 + C282-0706 + DACE-0468 + + + Start Cyberzone mode on zone 3 level 12 + C282-0706 + D2CE-0468 + + + Start Cyberzone mode on zone 3 level 13 + C282-0706 + D3CE-0468 + + + Start Cyberzone mode on zone 3 level 14 + C282-0706 + DECE-0468 + + + Start Cyberzone mode on zone 3 level 15 + C282-0706 + FDCE-0468 + + + Start Cyberzone mode on zone 3 bonus level + C282-0706 + FFCE-0468 + + + Start Cyberzone mode on zone 4 level 16 + C282-0706 + F4CE-0468 + + + Start Cyberzone mode on zone 4 level 17 + C282-0706 + F7CE-0468 + + + Start Cyberzone mode on zone 4 level 18 + C282-0706 + F0CE-0468 + + + Start Cyberzone mode on zone 4 level 19 + C282-0706 + F9CE-0468 + + + Start Cyberzone mode on zone 4 level 20 + C282-0706 + F1CE-0468 + + + Start Cyberzone mode on zone 4 bonus level + C282-0706 + F5CE-0468 + + + Start Cyberzone mode on zone 5 level 21 + C282-0706 + F6CE-0468 + + + Start Cyberzone mode on zone 5 level 22 + C282-0706 + FBCE-0468 + + + Start Cyberzone mode on zone 5 level 23 + C282-0706 + FCCE-0468 + + + Start Cyberzone mode on zone 5 level 24 + C282-0706 + F8CE-0468 + + + Start Cyberzone mode on zone 5 level 25 + C282-0706 + FACE-0468 + + + Start Cyberzone mode on zone 5 bonus level + C282-0706 + F2CE-0468 + + + Start Cyberzone mode on zone 6 level 26 + C282-0706 + F3CE-0468 + + + Start Cyberzone mode on zone 6 level 27 + C282-0706 + FECE-0468 + + + Start Cyberzone mode on zone 6 level 28 + C282-0706 + 4DCE-0468 + + + Start Cyberzone mode on zone 6 level 29 + C282-0706 + 4FCE-0468 + + + Start Cyberzone mode on zone 6 level 30 + C282-0706 + 44CE-0468 + + + Start Cyberzone mode on zone 6 bonus level + C282-0706 + 47CE-0468 + + + Start Cyberzone mode on zone 7 level 31 + C282-0706 + 40CE-0468 + + + Start Cyberzone mode on zone 7 level 32 + C282-0706 + 49CE-0468 + + + Start Cyberzone mode on zone 7 level 33 + C282-0706 + 41CE-0468 + + + Start Cyberzone mode on zone 7 level 34 + C282-0706 + 45CE-0468 + + + Start Cyberzone mode on zone 7 level 35 + C282-0706 + 46CE-0468 + + + Start Cyberzone mode on zone 7 bonus level + C282-0706 + 4BCE-0468 + + + Start Cyberzone mode on zone 8 level 36 + C282-0706 + 4CCE-0468 + + + Start Cyberzone mode on zone 8 level 37 + C282-0706 + 48CE-0468 + + + Start Cyberzone mode on zone 8 level 38 + C282-0706 + 4ACE-0468 + + + Start Cyberzone mode on zone 8 level 39 + C282-0706 + 42CE-0468 + + + Start Cyberzone mode on zone 8 level 40 + C282-0706 + 43CE-0468 + + + Start Cyberzone mode on zone 8 level 41 + C282-0706 + 4ECE-0468 + + + Allow 98 seconds in zone 1 bonus level + 1061-DD52 + + + Allow 98 seconds in zone 2 bonus level + 1069-6752 + + + Allow 98 seconds in zone 3 bonus level + 1068-DDE3 + + + Allow 98 seconds in zone 4 bonus level + 1061-A473 + + + Allow 198 seconds in zone 5 bonus level + A66C-047E + + + Allow 198 seconds in zone 6 bonus level + A6B1-D45A + + + Allow 198 seconds in zone 7 bonus level + A6B0-AF7A + + + Only need 8 tags to win in arena mode instead of 10 (start with 2 instead of 0) + B9B1-6F01 + + + + Fatal Fury 2 (USA) + + Infinite health - P1 + 6D7D-54AD + + + Infinite time + DD7E-7FDD + + + Timer is 2x fast + D47E-7FDD + + + Timer is 3x fast + D77E-7FDD + + + Computer can't win a round, except last round, game ends after 4 rounds + C250 + 7FA7 + + + P1 is Billy Kane + CB85-E40F + D685-E46F + DD85-E4AF + + + P1 is Axel Hawk + DB85-E46F + CB85-E40F + DD85-E4AF + + + P1 is Lawrence B + CB85-E40F + DD85-E4AF + DC85-E46F + + + P1 is Wolfgang Krauser + D885-E46F + CB85-E40F + DD85-E4AF + + + P2 is Billy Kane + CB82-E40F + D682-E46F + DD82-E4AF + + + P2 is Axel Hawk + DB82-E46F + CB82-E40F + DD82-E4AF + + + P2 is Lawrence B + DC82-E46F + CB82-E40F + DD82-E4AF + + + P2 is Wolfgang Krauser + D882-E46F + CB82-E40F + DD82-E4AF + + + Super vertical jump - P1 + FDD5-EFCB + + + Bogus vertical jump - P1 + EED5-EFCB + + + Start with 1/2 health + 7D78-770D + + + + Fatal Fury (USA) + + Take minimum damage - P1 + C2A9-D40F + + + Take minimum damage - P2/CPU + C2A2-DF6F + + + Win 1 bout to win the match instead of 2 out of 3 (disable on bonus rounds) + DFA5-64DF + + + 10 seconds to complete bonus rounds + FDC7-AFAF + + + 30 seconds to complete bonus rounds + 7DC7-AFAF + + + 45 seconds to complete bonus rounds + 09C7-AFAF + + + 60 seconds to complete bonus rounds + 1DC7-AFAF + + + 90 seconds to complete bonus rounds + BDC7-AFAF + + + Always fight Richard Myer on the West Subway + BAB4-6DAD + D7BC-A46D + + + Always fight Michael Max on the West Subway + BAB4-6DAD + D0BC-A46D + + + Always fight Duck King on the West Subway + BAB4-6DAD + D9BC-A46D + + + Always fight Tung Fu Rue on the West Subway + BAB4-6DAD + D1BC-A46D + + + Always fight Hwa Jai on the West Subway + BAB4-6DAD + D5BC-A46D + + + Always fight Raiden on the West Subway + BAB4-6DAD + D6BC-A46D + + + Always fight Billy Kane on the West Subway + BAB4-6DAD + DBBC-A46D + + + Always fight Geese Howard on the West Subway + BAB4-6DAD + DCBC-A46D + + + Start with 1/4 health - both players + F6CD-A4AF + + + Start with 1/2 health - both players + 7DCD-A4AF + + + Start with 3/4 health - both players + 06CD-A4AF + + + + Final Fantasy III (USA) + + Start Terra with Man-eater equipped + D15C-78E5 + + + Start Terra with Excalibur equipped + F65C-78E5 + + + Start Terra with Illumina equipped + FC5C-78E5 + + + Start Terra with Atma equipped + FA5C-78E5 + + + Start Terra with Tempest equipped + 435C-78E5 + + + Start Terra with Blizzard equipped + D35C-78E5 + + + Start Terra with Enhancer equipped + F75C-78E5 + + + Start Terra with Mithril shield equipped + 9A58-7675 + + + Start Terra with Gold shield equipped + 9258-7675 + + + Start Terra with Ice shield equipped + 1F58-7675 + + + Start Terra with Fire shield equipped + 1D58-7675 + + + Start Terra with Hairband equipped + 1C58-7655 + + + Start Terra with Leather hat equipped + 1B58-7655 + + + Start Terra with Circlet equipped + 5C58-7655 + + + Start Terra with Mystery veil equipped + 5B58-7655 + + + Start Terra with Red cap equipped + 5658-7655 + + + Start Terra with Silk robe equipped + 6658-7685 + + + Start Terra with Mithril vest equipped + 6B58-7685 + + + Start Terra with White dress equipped + 6858-7685 + + + Start Terra with Genji armor equipped + BC58-7685 + + + Start Terra with Force armor equipped + B058-7685 + + + Activate Terra's Morph command + DAF2-9A58 + + + Infinite Morph time out of battle + EEFE-F288 + + + Infinite Morph time in battle + EE77-2A58 + + + All items in shops are free (switch off to sell items) + 108C-EF03 + 108C-E4A3 + + + Infinite item use + 3CB8-5DAE + + + Use Arange to get 94 of all items + CB48-8462 + 6C48-87D2 + CE44-E7A2 + 2347-ED62 + + + Protect from all status ailments + 3513-5147 + E613-5117 + + + Auto Cast Float, Regen, Haste, Shell, Safe and Rflect + 3813-51C7 + + + Remove curse from Cursed Shield after only 1 battle + DD1D-7D66 + + + Steal command always gets the more rare item an enemy has + DD72-57AC + + + Mog never stumbles when he dances + DDFC-ED0B + + + Enemy 1 has 0 HP + DD7E-2E7C + DD7E-2E5C + + + Enemy 2 has 0 HP + DD7E-2E8C + DD7E-2EEC + + + Enemy 3 has 0 HP + DD7D-FA78 + DD7D-FA58 + + + Enemy 4 has 0 HP + DD7D-FA88 + DD7D-FAE8 + + + Enemy 5 has 0 HP + DD7D-F278 + DD7D-F258 + + + Enemy 6 has 0 HP + DD7D-F288 + DD7D-F2E8 + + + Enemy 1 has 0 HP (alt) + 7E3BFC00 + 7E3BFD00 + + + Enemy 2 has 0 HP (alt) + 7E3BFE00 + 7E3BFF00 + + + Enemy 3 has 0 HP (alt) + 7E3C0000 + 7E3C0100 + + + Enemy 4 has 0 HP (alt) + 7E3C0200 + 7E3C0300 + + + Enemy 5 has 0 HP (alt) + 7E3C0400 + 7E3C0500 + + + Enemy 6 has 0 HP (alt) + 7E3C0600 + 7E3C0700 + + + Party has Sprint Shoes and Moogle Charm effect + 44F2-9EE6 + + + Party has Sprint Shoes and Moogle Charm effect (alt) + 7E11DF22 + + + Party has Offering effect + FC47-570C + 3C47-576C + + + Party has Merit Award effect + DDB9-746E + + + Party has Economizer effect + DD97-5FDA + DD90-EFDB + + + Party has almost max HP and MP + EEDB-EDA8 + + + Offering gives character instant kill attacks + 7EF4-8F0B + + + Enable all characters (once you are able to switch) + EEF2-BE88 + EEF2-BEE8 + + + Have all Blitz's + EEF4-9378 + + + Have all Dance's + EEF0-9E78 + + + Have all Lore's + EEF4-9358 + EEF4-9388 + EEF4-93E8 + + + Have all Rage's + 7E1D2CFF + 7E1D2DFF + 7E1D2EFF + 7E1D2FFF + 7E1D30FF + 7E1D31FF + 7E1D32FF + 7E1D33FF + 7E1D34FF + 7E1D35FF + 7E1D36FF + 7E1D37FF + 7E1D38FF + 7E1D39FF + 7E1D3AFF + 7E1D3BFF + 7E1D3CFF + 7E1D3DFF + 7E1D3EFF + 7E1D3FFF + 7E1D40FF + 7E1D41FF + 7E1D42FF + 7E1D43FF + 7E1D44FF + 7E1D45FF + 7E1D46FF + 7E1D47FF + 7E1D48FF + 7E1D49FF + 7E1D4AFF + 7E1D4BFF + + + Have all SwdTech's + EEFE-F2E8 + + + Have all Espers + EEF1-B35C + EEF1-B38C + EEF1-B3EC + EEF1-BE7C + + + Vigor/Speed/Stamina/MagPwr becomes 255 + D762-EF68 + + + Learn all spells after one battle + 8D17-54A6 + + + Earn tons of EXP after a battle (level 99) + D493-54D8 + + + Save anywhere + 6DDD-BA56 + + + Faster up/down movement on world map + 4DFB-EB88 + 3DF3-E6E8 + + + Faster left/right movement on world map + 4DFE-8C88 + 3DF0-EC78 + + + Celes - Level 99 + 7E16E663 + + + Celes - 9999 HP + 7E16E70F + 7E16E827 + + + Celes - 9999 Max HP + 7E16E90F + 7E16EA27 + + + Celes - 9999 MP + 7E16EB0F + 7E16EC27 + + + Celes - 9999 Max MP + 7E16ED0F + 7E16EE27 + + + Celes - No Ailments + 7E16F200 + + + Celes - Float always on + 7E16F3FF + + + Celes - 255 Vigor + 7E16F8FF + + + Celes - 255 Speed + 7E16F9FF + + + Celes - 255 Stamina + 7E16FAFF + + + Celes - 255 Magic Power + 7E16FBFF + + + Cyan - Level 99 + 7E165263 + + + Cyan - 9999 HP + 7E16530F + 7E165427 + + + Cyan - 9999 Max HP + 7E16550F + 7E165627 + + + Cyan - 9999 MP + 7E16570F + 7E165827 + + + Cyan - 9999 Max MP + 7E16590F + 7E165A27 + + + Cyan - No Ailments + 7E165E00 + + + Cyan - Float always on + 7E165FFF + + + Cyan - 255 Vigor + 7E1664FF + + + Cyan - 255 Speed + 7E1665FF + + + Cyan - 255 Stamina + 7E1666FF + + + Cyan - 255 Magic Power + 7E1667FF + + + Edgar - Level 99 + 7E169C63 + + + Edgar - 9999 HP + 7E169D0F + 7E169E27 + + + Edgar - 9999 Max HP + 7E169F0F + 7E16A027 + + + Edgar - 9999 MP + 7E16A10F + 7E16A227 + + + Edgar - 9999 Max MP + 7E16A30F + 7E16A427 + + + Edgar - No Ailments + 7E16A800 + + + Edgar - Float always on + 7E16A9FF + + + Edgar - 255 Vigor + 7E16AEFF + + + Edgar - 255 Speed + 7E16AFFF + + + Edgar - 255 Stamina + 7E16B0FF + + + Edgar - 255 Magic Power + 7E16B1FF + + + Gau - Level 99 + 7E179F63 + + + Gau - 9999 HP + 7E17A00F + 7E17A127 + + + Gau - 9999 Max HP + 7E17A20F + 7E17A327 + + + Gau - 9999 MP + 7E17A40F + 7E17A527 + + + Gau - 9999 Max MP + 7E17A60F + 7E17A727 + + + Gau - No Ailments + 7E17AB00 + + + Gau - Float always on + 7E17ACFF + + + Gau - 255 Vigor + 7E17B1FF + + + Gau - 255 Speed + 7E17B2FF + + + Gau - 255 Stamina + 7E17B3FF + + + Gau - 255 Magic Power + 7E17B4FF + + + Gogo - Level 99 + 7E17C463 + + + Gogo - 9999 HP + 7E17C50F + 7E17C627 + + + Gogo - 9999 Max HP + 7E17C70F + 7E17C827 + + + Gogo - 9999 MP + 7E17C90F + 7E17CA27 + + + Gogo - 9999 Max MP + 7E17CB0F + 7E17CC27 + + + Gogo - No Ailments + 7E17D000 + + + Gogo - Float always on + 7E17D1FF + + + Gogo - 255 Vigor + 7E17D6FF + + + Gogo - 255 Speed + 7E17D7FF + + + Gogo - 255 Stamina + 7E17D8FF + + + Gogo - 255 Magic Power + 7E17D9FF + + + Locke - Level 99 + 7E162D63 + + + Locke - 9999 HP + 7E162E0F + 7E162F27 + + + Locke - 9999 Max HP + 7E16300F + 7E163127 + + + Locke - 9999 MP + 7E16320F + 7E163327 + + + Locke - 9999 Max MP + 7E16340F + 7E163527 + + + Locke - No Ailments + 7E163900 + + + Locke - Float always on + 7E163AFF + + + Locke - 255 Vigor + 7E163FFF + + + Locke - 255 Speed + 7E1640FF + + + Locke - 255 Stamina + 7E1641FF + + + Locke - 255 Magic Power + 7E1642FF + + + Mog - Level 99 + 7E177A63 + + + Mog - 9999 HP + 7E177B0F + 7E177C27 + + + Mog - 9999 Max HP + 7E177D0F + 7E177E27 + + + Mog - 9999 MP + 7E177F0F + 7E178027 + + + Mog - 9999 Max MP + 7E17810F + 7E178227 + + + Mog - No Ailments + 7E178600 + + + Mog - Float always on + 7E1787FF + + + Mog - 255 Vigor + 7E178CFF + + + Mog - 255 Speed + 7E178DFF + + + Mog - 255 Stamina + 7E178EFF + + + Mog - 255 Magic Power + 7E178FFF + + + Relm - Level 99 + 7E173063 + + + Relm - 9999 HP + 7E17310F + 7E173227 + + + Relm - 9999 Max HP + 7E17330F + 7E173427 + + + Relm - 9999 MP + 7E17350F7E173627 + + + Relm - 9999 Max MP + 7E17370F + 7E173827 + + + Relm - No Ailments + 7E173C00 + + + Relm - Float always on + 7E173DFF + + + Relm - 255 Vigor + 7E1742FF + + + Relm - 255 Speed + 7E1743FF + + + Relm - 255 Stamina + 7E1744FF + + + Relm - 255 Magic Power + 7E1745FF + + + Sabin - Level 99 + 7E16C163 + + + Sabin - 9999 HP + 7E16C20F + 7E16C327 + + + Sabin - 9999 Max HP + 7E16C40F + 7E16C527 + + + Sabin - 9999 MP + 7E16C60F + 7E16C727 + + + Sabin - 9999 Max MP + 7E16C80F + 7E16C927 + + + Sabin - No Ailments + 7E16CD00 + + + Sabin - Float always on + 7E16CEFF + + + Sabin - 255 Vigor + 7E16D3FF + + + Sabin - 255 Speed + 7E16D4FF + + + Sabin - 255 Stamina + 7E16D5FF + + + Sabin - 255 Magic Power + 7E16D6FF + + + Setzer - Level 99 + 7E175563 + + + Setzer - 9999 HP + 7E17560F + 7E175727 + + + Setzer - 9999 Max HP + 7E17580F + 7E175927 + + + Setzer - 9999 MP + 7E175A0F + 7E175B27 + + + Setzer - 9999 Max MP + 7E175C0F + 7E175D27 + + + Setzer - No Ailments + 7E176100 + + + Setzer - Float always on + 7E1762FF + + + Setzer - 255 Vigor + 7E1767FF + + + Setzer - 255 Speed + 7E1768FF + + + Setzer - 255 Stamina + 7E1769FF + + + Setzer - 255 Magic Power + 7E176AFF + + + Shadow - Level 99 + 7E167763 + + + Shadow - 9999 HP + 7E16780F + 7E167927 + + + Shadow - 9999 Max HP + 7E167A0F + 7E167B27 + + + Shadow - 9999 MP + 7E167C0F + 7E167D27 + + + Shadow - 9999 Max MP + 7E167E0F + 7E167F27 + + + Shadow - No Ailments + 7E168300 + + + Shadow - Float always on + 7E1684FF + + + Shadow - 255 Vigor + 7E1689FF + + + Shadow - 255 Speed + 7E168AFF + + + Shadow - 255 Stamina + 7E168BFF + + + Shadow - 255 Magic Power + 7E168CFF + + + Strago - Level 99 + 7E170B63 + + + Strago - 9999 HP + 7E170C0F + 7E170D27 + + + Strago - 9999 Max HP + 7E170E0F + 7E170F27 + + + Strago - 9999 MP + 7E17100F + 7E171127 + + + Strago - 9999 Max MP + 7E17120F + 7E171327 + + + Strago - No Ailments + 7E171700 + + + Strago - Float always on + 7E1718FF + + + Strago - 255 Vigor + 7E171DFF + + + Strago - 255 Speed + 7E171EFF + + + Strago - 255 Stamina + 7E171FFF + + + Strago - 255 Magic Power + 7E1720FF + + + Umaro - Level 99 + 7E17E963 + + + Umaro - 9999 HP + 7E17EA0F + 7E17EB27 + + + Umaro - 9999 Max HP + 7E17EC0F + 7E17ED27 + + + Umaro - 9999 MP + 7E17EE0F + 7E17EF27 + + + Umaro - 9999 Max MP + 7E17F00F + 7E17F127 + + + Umaro - No Ailments + 7E17F500 + + + Umaro - Float always on + 7E17F6FF + + + Umaro - 255 Vigor + 7E17FBFF + + + Umaro - 255 Speed + 7E17FCFF + + + Umaro - 255 Stamina + 7E17FDFF + + + Umaro - 255 Magic Power + 7E17FEFF + + + Terra - Level 99 + 7E160863 + + + Terra - 9999 HP + 7E16090F + 7E160A27 + + + Terra - 9999 Max HP + 7E160B0F + 7E160C27 + + + Terra - 9999 MP + 7E160D0F + 7E160E27 + + + Terra - 9999 Max MP + 7E160F0F + 7E161027 + + + Terra - No ailments + 7E161400 + + + Terra - Float always on + 7E1615FF + + + Terra - 255 Vigor + 7E161AFF + + + Terra - 255 Speed + 7E161BFF + + + Terra - 255 Stamina + 7E161CFF + + + + Final Fantasy III (USA) (Rev 1) + + Start Terra with Man-eater equipped + D15C-78E5 + + + Start Terra with Excalibur equipped + F65C-78E5 + + + Start Terra with Illumina equipped + FC5C-78E5 + + + Start Terra with Atma equipped + FA5C-78E5 + + + Start Terra with Tempest equipped + 435C-78E5 + + + Start Terra with Blizzard equipped + D35C-78E5 + + + Start Terra with Enhancer equipped + F75C-78E5 + + + Start Terra with Mithril shield equipped + 9A58-7675 + + + Start Terra with Gold shield equipped + 9258-7675 + + + Start Terra with Ice shield equipped + 1F58-7675 + + + Start Terra with Fire shield equipped + 1D58-7675 + + + Start Terra with Hairband equipped + 1C58-7655 + + + Start Terra with Leather hat equipped + 1B58-7655 + + + Start Terra with Circlet equipped + 5C58-7655 + + + Start Terra with Mystery veil equipped + 5B58-7655 + + + Start Terra with Red cap equipped + 5658-7655 + + + Start Terra with Silk robe equipped + 6658-7685 + + + Start Terra with Mithril vest equipped + 6B58-7685 + + + Start Terra with White dress equipped + 6858-7685 + + + Start Terra with Genji armor equipped + BC58-7685 + + + Start Terra with Force armor equipped + B058-7685 + + + Activate Terra's Morph command + DAF2-9A58 + + + Infinite Morph time out of battle + EEFE-F288 + + + Infinite Morph time in battle + EE77-2A58 + + + All items in shops are free (switch off to sell items) + 108C-EF03 + 108C-E4A3 + + + Infinite item use + 3CB8-5DAE + + + Infinite item use (alt) + 3CBC-576E + + + Use Arange to get 94 of all items + CB48-8462 + 6C48-87D2 + CE44-E7A2 + 2347-ED62 + + + Protect from all status ailments + 3513-5147 + E613-5117 + + + Auto cast Float, Regen, Haste, Shell, Safe and Rflect + 3813-51C7 + + + Remove curse from Cursed Shield after only 1 battle + DD1D-7D66 + + + Steal command always gets the more rare item an enemy has + DD72-57AC + + + Mog never stumbles when he dances + DDFC-ED0B + + + Enemy 1 has 0 HP + DD7E-2E7C + DD7E-2E5C + + + Enemy 2 has 0 HP + DD7E-2E8C + DD7E-2EEC + + + Enemy 3 has 0 HP + DD7D-FA78 + DD7D-FA58 + + + Enemy 4 has 0 HP + DD7D-FA88 + DD7D-FAE8 + + + Enemy 5 has 0 HP + DD7D-F278 + DD7D-F258 + + + Enemy 6 has 0 HP + DD7D-F288 + DD7D-F2E8 + + + Enemy 1 has 0 HP (alt) + 7E3BFC00 + 7E3BFD00 + + + Enemy 2 has 0 HP (alt) + 7E3BFE00 + 7E3BFF00 + + + Enemy 3 has 0 HP (alt) + 7E3C0000 + 7E3C0100 + + + Enemy 4 has 0 HP (alt) + 7E3C0200 + 7E3C0300 + + + Enemy 5 has 0 HP (alt) + 7E3C0400 + 7E3C0500 + + + Enemy 6 has 0 HP (alt) + 7E3C0600 + 7E3C0700 + + + Party has Sprint Shoes and Moogle Charm effect + AADC-EF08 + + + Party has Sprint Shoes and Moogle Charm effect (alt) + AADC-EDA8 + + + Party has Sprint Shoes and Moogle Charm effect (alt 2) + 7E11DF22 + + + Party has Offering effect + FC47-570C + 3C47-576C + + + Party has Merit Award effect + DDB9-746E + + + Party has Economizer effect + DD97-5FDA + DD90-EFDB + + + Party has almost max HP and MP + EEDB-EDA8 + + + Offering gives character instant kill attacks + 7EF4-8F0B + + + Enable all characters (once you are able to switch) + EEF2-BE88 + EEF2-BEE8 + + + Have all Blitz's + EEF4-9378 + + + Have all Dance's + EEF0-9E78 + + + Have all Lore's + EEF4-9358 + EEF4-9388 + EEF4-93E8 + + + Have all Rage's + 7E1D2CFF + 7E1D2DFF + 7E1D2EFF + 7E1D2FFF + 7E1D30FF + 7E1D31FF + 7E1D32FF + 7E1D33FF + 7E1D34FF + 7E1D35FF + 7E1D36FF + 7E1D37FF + 7E1D38FF + 7E1D39FF + 7E1D3AFF + 7E1D3BFF + 7E1D3CFF + 7E1D3DFF + 7E1D3EFF + 7E1D3FFF + 7E1D40FF + 7E1D41FF + 7E1D42FF + 7E1D43FF + 7E1D44FF + 7E1D45FF + 7E1D46FF + 7E1D47FF + 7E1D48FF + 7E1D49FF + 7E1D4AFF + 7E1D4BFF + + + Have all SwdTech's + EEFE-F2E8 + + + Have all Espers + EEF1-B35C + EEF1-B38C + EEF1-B3EC + EEF1-BE7C + + + Learn all spells after one battle + 8D17-54A6 + + + Earn tons of EXP after a battle (level 99) + 0493-54D8 + + + Save anywhere + 6DDD-BA56 + + + Save anywhere (alt) + 7E020180 + + + Faster up/down movement on world map + 4DFB-EB88 + 3DF3-E6E8 + + + Faster left/right movement on world map + 4DFE-8C88 + 3DF0-EC78 + + + Celes - Level 99 + 7E16E663 + + + Celes - 9999 HP + 7E16E70F + 7E16E827 + + + Celes - 9999 Max HP + 7E16E90F + 7E16EA27 + + + Celes - 9999 MP + 7E16EB0F + 7E16EC27 + + + Celes - 9999 Max MP + 7E16ED0F + 7E16EE27 + + + Celes - No Ailments + 7E16F200 + + + Celes - Float always on + 7E16F3FF + + + Celes - 255 Vigor + 7E16F8FF + + + Celes - 255 Speed + 7E16F9FF + + + Celes - 255 Stamina + 7E16FAFF + + + Celes - 255 Magic Power + 7E16FBFF + + + Cyan - Level 99 + 7E165263 + + + Cyan - 9999 HP + 7E16530F + 7E165427 + + + Cyan - 9999 Max HP + 7E16550F + 7E165627 + + + Cyan - 9999 MP + 7E16570F + 7E165827 + + + Cyan - 9999 Max MP + 7E16590F + 7E165A27 + + + Cyan - No Ailments + 7E165E00 + + + Cyan - Float always on + 7E165FFF + + + Cyan - 255 Vigor + 7E1664FF + + + Cyan - 255 Speed + 7E1665FF + + + Cyan - 255 Stamina + 7E1666FF + + + Cyan - 255 Magic Power + 7E1667FF + + + Edgar - Level 99 + 7E169C63 + + + Edgar - 9999 HP + 7E169D0F + 7E169E27 + + + Edgar - 9999 Max HP + 7E169F0F + 7E16A027 + + + Edgar - 9999 MP + 7E16A10F + 7E16A227 + + + Edgar - 9999 Max MP + 7E16A30F + 7E16A427 + + + Edgar - No Ailments + 7E16A800 + + + Edgar - Float always on + 7E16A9FF + + + Edgar - 255 Vigor + 7E16AEFF + + + Edgar - 255 Speed + 7E16AFFF + + + Edgar - 255 Stamina + 7E16B0FF + + + Edgar - 255 Magic Power + 7E16B1FF + + + Gau - Level 99 + 7E179F63 + + + Gau - 9999 HP + 7E17A00F + 7E17A127 + + + Gau - 9999 Max HP + 7E17A20F + 7E17A327 + + + Gau - 9999 MP + 7E17A40F + 7E17A527 + + + Gau - 9999 Max MP + 7E17A60F + 7E17A727 + + + Gau - No Ailments + 7E17AB00 + + + Gau - Float always on + 7E17ACFF + + + Gau - 255 Vigor + 7E17B1FF + + + Gau - 255 Speed + 7E17B2FF + + + Gau - 255 Stamina + 7E17B3FF + + + Gau - 255 Magic Power + 7E17B4FF + + + Gogo - Level 99 + 7E17C463 + + + Gogo - 9999 HP + 7E17C50F + 7E17C627 + + + Gogo - 9999 Max HP + 7E17C70F + 7E17C827 + + + Gogo - 9999 MP + 7E17C90F + 7E17CA27 + + + Gogo - 9999 Max MP + 7E17CB0F + 7E17CC27 + + + Gogo - No Ailments + 7E17D000 + + + Gogo - Float always on + 7E17D1FF + + + Gogo - 255 Vigor + 7E17D6FF + + + Gogo - 255 Speed + 7E17D7FF + + + Gogo - 255 Stamina + 7E17D8FF + + + Gogo - 255 Magic Power + 7E17D9FF + + + Locke - Level 99 + 7E162D63 + + + Locke - 9999 HP + 7E162E0F + 7E162F27 + + + Locke - 9999 Max HP + 7E16300F + 7E163127 + + + Locke - 9999 MP + 7E16320F + 7E163327 + + + Locke - 9999 Max MP + 7E16340F + 7E163527 + + + Locke - No Ailments + 7E163900 + + + Locke - Float always on + 7E163AFF + + + Locke - 255 Vigor + 7E163FFF + + + Locke - 255 Speed + 7E1640FF + + + Locke - 255 Stamina + 7E1641FF + + + Locke - 255 Magic Power + 7E1642FF + + + Mog - Level 99 + 7E177A63 + + + Mog - 9999 HP + 7E177B0F + 7E177C27 + + + Mog - 9999 Max HP + 7E177D0F + 7E177E27 + + + Mog - 9999 MP + 7E177F0F + 7E178027 + + + Mog - 9999 Max MP + 7E17810F + 7E178227 + + + Mog - No Ailments + 7E178600 + + + Mog - Float always on + 7E1787FF + + + Mog - 255 Vigor + 7E178CFF + + + Mog - 255 Speed + 7E178DFF + + + Mog - 255 Stamina + 7E178EFF + + + Mog - 255 Magic Power + 7E178FFF + + + Relm - Level 99 + 7E173063 + + + Relm - 9999 HP + 7E17310F + 7E173227 + + + Relm - 9999 Max HP + 7E17330F + 7E173427 + + + Relm - 9999 MP + 7E17350F7E173627 + + + Relm - 9999 Max MP + 7E17370F + 7E173827 + + + Relm - No Ailments + 7E173C00 + + + Relm - Float always on + 7E173DFF + + + Relm - 255 Vigor + 7E1742FF + + + Relm - 255 Speed + 7E1743FF + + + Relm - 255 Stamina + 7E1744FF + + + Relm - 255 Magic Power + 7E1745FF + + + Sabin - Level 99 + 7E16C163 + + + Sabin - 9999 HP + 7E16C20F + 7E16C327 + + + Sabin - 9999 Max HP + 7E16C40F + 7E16C527 + + + Sabin - 9999 MP + 7E16C60F + 7E16C727 + + + Sabin - 9999 Max MP + 7E16C80F + 7E16C927 + + + Sabin - No Ailments + 7E16CD00 + + + Sabin - Float always on + 7E16CEFF + + + Sabin - 255 Vigor + 7E16D3FF + + + Sabin - 255 Speed + 7E16D4FF + + + Sabin - 255 Stamina + 7E16D5FF + + + Sabin - 255 Magic Power + 7E16D6FF + + + Setzer - Level 99 + 7E175563 + + + Setzer - 9999 HP + 7E17560F + 7E175727 + + + Setzer - 9999 Max HP + 7E17580F + 7E175927 + + + Setzer - 9999 MP + 7E175A0F + 7E175B27 + + + Setzer - 9999 Max MP + 7E175C0F + 7E175D27 + + + Setzer - No Ailments + 7E176100 + + + Setzer - Float always on + 7E1762FF + + + Setzer - 255 Vigor + 7E1767FF + + + Setzer - 255 Speed + 7E1768FF + + + Setzer - 255 Stamina + 7E1769FF + + + Setzer - 255 Magic Power + 7E176AFF + + + Shadow - Level 99 + 7E167763 + + + Shadow - 9999 HP + 7E16780F + 7E167927 + + + Shadow - 9999 Max HP + 7E167A0F + 7E167B27 + + + Shadow - 9999 MP + 7E167C0F + 7E167D27 + + + Shadow - 9999 Max MP + 7E167E0F + 7E167F27 + + + Shadow - No Ailments + 7E168300 + + + Shadow - Float always on + 7E1684FF + + + Shadow - 255 Vigor + 7E1689FF + + + Shadow - 255 Speed + 7E168AFF + + + Shadow - 255 Stamina + 7E168BFF + + + Shadow - 255 Magic Power + 7E168CFF + + + Strago - Level 99 + 7E170B63 + + + Strago - 9999 HP + 7E170C0F + 7E170D27 + + + Strago - 9999 Max HP + 7E170E0F + 7E170F27 + + + Strago - 9999 MP + 7E17100F + 7E171127 + + + Strago - 9999 Max MP + 7E17120F + 7E171327 + + + Strago - No Ailments + 7E171700 + + + Strago - Float always on + 7E1718FF + + + Strago - 255 Vigor + 7E171DFF + + + Strago - 255 Speed + 7E171EFF + + + Strago - 255 Stamina + 7E171FFF + + + Strago - 255 Magic Power + 7E1720FF + + + Umaro - Level 99 + 7E17E963 + + + Umaro - 9999 HP + 7E17EA0F + 7E17EB27 + + + Umaro - 9999 Max HP + 7E17EC0F + 7E17ED27 + + + Umaro - 9999 MP + 7E17EE0F + 7E17EF27 + + + Umaro - 9999 Max MP + 7E17F00F + 7E17F127 + + + Umaro - No Ailments + 7E17F500 + + + Umaro - Float always on + 7E17F6FF + + + Umaro - 255 Vigor + 7E17FBFF + + + Umaro - 255 Speed + 7E17FCFF + + + Umaro - 255 Stamina + 7E17FDFF + + + Umaro - 255 Magic Power + 7E17FEFF + + + Terra - Level 99 + 7E160863 + + + Terra - 9999 HP + 7E16090F + 7E160A27 + + + Terra - 9999 Max HP + 7E160B0F + 7E160C27 + + + Terra - 9999 MP + 7E160D0F + 7E160E27 + + + Terra - 9999 Max MP + 7E160F0F + 7E161027 + + + Terra - No ailments + 7E161400 + + + Terra - Float always on + 7E1615FF + + + Terra - 255 Vigor + 7E161AFF + + + Terra - 255 Speed + 7E161BFF + + + Terra - 255 Stamina + 7E161CFF + + + + Final Fantasy II (USA) + + Almost infinite HP. Can make big and sometimes normal monsters invincible. Switch off to defeat them. + 82A3-6F63 + + + Infinite MP during battles, doesn't work on twin attacks + 8267-0D62 + + + Get at least 150 GP after each battle + 1B39-070E + B139-076E + 3C39-07AE + + + Get at least 255 GP after each battle + 1B39-070E + EE39-076E + 3C39-07AE + + + Get at least 65,536 GP after each battle + 3335-0D6E + + + Money doesn't decrease if you run away from a battle + C262-DF03 + C262-D763 + + + Money doesn't decrease in shops + C2AD-AD69 + C3AD-AFA9 + + + Gunslinger Code + 00CE-6D69 + + + No random battles + DDD6-B28B + + + No random battles (alt) + 1D60-0704 + + + automatically win battles (no EXP or gold gained) + 7E180102 + 7E180008 + + + Save anywhere in the game + CBBA-07A4 + + + Always fight the rarest enemy in that area + DA6E-6FD4 + + + Always get a treasure from each enemy defeated + 6D32-D7DE + + + When treasures are awarded after battle, receive 5 instead of 1 + D926-D4D9 + + + When arrows are awarded after battle, receive 50 instead of 10 + 7425-D769 + + + When treasures are awarded after battle, receive the rarest + D734-0DDE + + + Infinite use of items outside of battle except for the Whistle + C3CE-6F09 + + + Sumon the Big Chocobo anywhere by using a Carrot instead of the Whistle + 38C4-AF00 + + + Infinite Whistles + C3C4-A4D0 + + + The quantity of items don't decrease when selling them + 82A9-6FD1 + + + Get 99 of items that you are given or find in a pot, treasure chest, ect + 17BF-D404 + + + Get 99 arrows when you find them in a pot or treasure chest + 17B4-D4D4 + + + No music while traveling or in a town + 1D67-A7A4 + + + Item Cure2 is ultra strong + A6B7-A4E2 + + + Item Cure2 restores HP to all members in the party during battle + 0DB7-A482 + + + Item Cure2 restores all HP/MP during battle + F1B7-A752 + + + Fire1 spell is ultra strong + A6B0-D7E3 + + + Fire1 spell hits every enemy + AFB0-D783 + + + Ice1 spell is ultra strong + A6B1-DD53 + + + Ice1 spell hits every enemy + AFB1-DD73 + + + Lit1 spell is ultra strong + A6B5-DDE3 + + + Lit1 spell hits every enemy + AFB5-DD83 + + + + Final Fantasy II (USA) (Rev 1) + + Almost infinite HP. Can make big and sometimes normal monsters invincible. Switch off to defeat them. + 82AE-6F63 + + + Infinite MP during battles, doesn't work on twin attacks + 8267-0D62 + + + Get at least 150 GP after each battle + 1B35-0D6E + B135-0DAE + 3C35-0FDE + + + Get at least 255 GP after each battle + 3335-076E + + + Get at least 65,536 GP after each battle + 3336-0FAE + + + Money doesn't decrease if you run away from a battle + C262-DF03 + C262-D763 + + + Money doesn't decrease in shops + C2AD-AD69 + C3AD-AFA9 + + + Gunslinger Code + 00CE-6D69 + + + No random battles + DDD6-B28B + + + No random battles (alt) + 1D60-0704 + + + automatically win battles (no EXP or gold gained) + 7E180102 + 7E180008 + + + Save anywhere in the game + CBBA-07A4 + + + Always fight the rarest enemy in that area + DA6E-6FD4 + + + Always get a treasure from each enemy defeated + 6D3E-DD0E + + + Infinite use of items outside of battle except for the Whistle + C3CE-6F09 + + + Sumon the Big Chocobo anywhere by using a Carrot instead of the Whistle + 38C4-AF00 + + + Infinite Whistles + C3C4-A4D0 + + + The quantity of items don't decrease when selling them + 82A9-6FD1 + + + Get 99 of items that you are given or find in a pot, treasure chest, ect + 17BF-D404 + + + Get 99 arrows when you find them in a pot or treasure chest + 17B4-D4D4 + + + No music while traveling or in a town + 1D67-A7A4 + + + Item Cure2 is ultra strong + A6B7-A4E2 + + + Item Cure2 restores HP to all members in the party during battle + 0DB7-A482 + + + Item Cure2 restores all HP/MP during battle + F1B7-A752 + + + Fire1 spell is ultra strong + A6B0-D7E3 + + + Fire1 spell hits every enemy + AFB0-D783 + + + Ice1 spell is ultra strong + A6B1-DD53 + + + Ice1 spell hits every enemy + AFB1-DD73 + + + Lit1 spell is ultra strong + A6B5-DDE3 + + + Lit1 spell hits every enemy + AFB5-DD83 + + + + Final Fantasy IV (Japan) + + Gunslinger Code + 00CF-A469 + + + + Final Fantasy - Mystic Quest (USA) + + Infinite cure potions + 83AF-D40D + + + Use a cure, gain a cure + E3AF-D40D + + + Gain 198 cures after one is used + 03AF-D40D + + + Cure restores life points to maximum + DDA4-D40D + + + Infinite life points - can make enemies invincible + C96B-64AB + + + Infinite ninja stars + C9B8-D4A6 + + + Infinite bombs in battle + C9B0-D7A6 + + + Quick level gain + 6D2A-DD8D + + + + Final Fantasy - Mystic Quest (USA) (Rev 1) + + Infinite cure potions + 83AF-D40D + + + Use a cure, gain a cure + E3AF-D40D + + + Gain 198 cures after one is used + 03AF-D40D + + + Cure restores life points to maximum + DDA4-D40D + + + Infinite life points - can make enemies invincible + C96B-64AB + + + Infinite ninja stars + C9B8-D4A6 + + + Infinite bombs in battle + C9B0-D7A6 + + + Quick level gain + 6D2A-DD8D + + + + Final Fight 2 (USA) + + Invincibility + 2D65-3706 + + + Infinite health + C9E1-446F + C9C8-CFDB + + + Infinite lives + C9CE-1DAB + + + Infinite lives (alt) + DDCE-1D6B + + + Infinite time + C2A0-1F0C + + + Infinite time (alt) + DDA0-1DDC + + + Faster timer + D4A0-1DDC + + + Start with 1 life + DDCF-C7D6 + + + Start with 3 lives + D4CF-C7D6 + + + Start with 7 lives + D1CF-C7D6 + + + Start with 10 lives + DBCF-C7D6 + + + Barbecue restores vitality 50% instead of 95% + 0DED-1DAC + + + Barbecue worth nothing + DDED-1DAC + + + Soft drink restores vitality 95% + 6DEE-470C + + + Soft drink worth nothing + DDEE-470C + + + Both players can select same character + 33C5-1404 + + + P1 and P2 can't harm each other in a 2P game + DDB4-4708 + + + Slow motion (disable until play begins) + D46A-14AF + + + Hitting someone with your super move makes you invincible + DFCC-C4DB + + + + Final Fight 3 (USA) + + Invincibility (blinking) + 7E052002 + + + Infinite health + 7E055847 + + + Infinite time + C2F9-84DF + + + Instant super energy + CBB5-5D07 + 46B5-5D67 + DDB5-5DA7 + 4BB5-5F07 + + + Infinite super energy (alt) + 7E051663 + + + Infinite lives + 3C6C-84AF + + + + Final Fight Guy (USA) + + Infinite health + 89AF-0401 + + + Infinite health (alt) + 9DDF-9278 + + + Infinite time + 1DC3-6409 + + + Infinite time (alt) + DBD8-FE78 + + + Hit enemies from anywhere on the screen + CC6D-D40D + D433-0D6F + + + Enemies never get knocked down, hit them until they die + 7E0D7000 + + + Enemy 1 has no health + 7E101400 + + + Enemy 2 has no health + 7E10B400 + + + Enemy 3 has no health + 7E115400 + + + Boss have no health + 7E11F400 + 7E11F500 + + + Gain 9 lives every time you die + DDC0-ADA6 + + + No health lost from spin kick + 89CB-AD0C + + + Attack speed greatly increased + DFDF-9E88 + + + Any food restores all health + DDBD-6F06 + + + Always get Knife + 7E1C1100 + + + Always get Sword + 7E1C1102 + + + Always get Pipe + 7E1C1104 + + + Start on stage 2 - Subway + 7EFFFE01 + + + Start on stage 3 - West Side + 7EFFFE02 + + + Start on stage 4 - Bay Area + 7EFFFE04 + + + Start on stage 5 - Uptown + 7EFFFE05 + + + Start on bonus stage - Car + 7EFFFE06 + + + + Final Fight (USA) + + Invincibility + 2DCD-AF6B + + + Infinite health + 89A1-0DA1 + C9C4-AD6C + + + Infinite health (alt) + 9DDF-9278 + + + Infinite lives + A9C3-6F66 + D433-0D6F + + + Infinite lives (alt) + CE33-076F + + + Infinite time + A2C0-A7D0 + + + Slower timer + D4C9-AFD0 + + + Faster timer + DDC9-AFD0 + + + Enemies never get knocked down, hit them until they die + 7E0D7000 + + + Enemy 1 has no health + 7E101400 + + + Enemy 2 has no health + 7E10B400 + + + Enemy 3 has no health + 7E115400 + + + Bosses have no health + 7E11F400 + 7E11F500 + + + Any food restores all health + DD8D-6F06 + + + Always get Knife + 7E1C1100 + + + Always get Sword + 7E1C1102 + + + Always get Pipe + 7E1C1104 + + + Start with 2 credits + DFC8-D4A1 + + + Start with 6 credits + D9C8-D4A1 + + + Start with 10 credits + DBC8-D4A1 + + + Attack speed greatly increased + DFDF-9E88 + + + Start on stage 2 - Subway + DFEE-2E88 + + + Start on stage 3 - West Side + D4EE-2E88 + + + Start on stage 4 - Bay Area + D0EE-2E88 + + + Start on stage 5 - Uptown + D9EE-2E88 + + + Start on bonus stage - Car + D1EE-2E88 + + + + Firepower 2000 (USA) + + Start at level 2 + D4B3-1764 + + + Start at level 3 + D7B3-1764 + + + Start at level 4 + D0B3-1764 + + + Start at level 5 + D9B3-1764 + + + Start at level 6 + D1B3-1764 + + + Start with 1 life instead of 4 + DF69-1DAF + + + Start with 2 lives + D469-1DAF + + + Start with 3 lives + D769-1DAF + + + Start with 5 lives + D969-1DAF + + + Start with 7 lives + D569-1DAF + + + Start with 10 lives + DC69-1DAF + + + Start with 15 lives + DE69-1DAF + + + Start with 25 lives + FB69-1DAF + + + Start with 50 lives + 7469-1DAF + + + Start with 75 lives + 0869-1DAF + + + Start with 100 lives + 1069-1DAF + + + Infinite lives + 8263-4DDF + + + Start with bullet strength at 3 instead of 1 + D765-146F + + + Start with bullet strength at 6 + D165-146F + + + Start with flame strength at 3 instead of 1 + D761-14DF + + + Start with flame strength at 6 + D161-14DF + + + Start with flame strength at 0 + DD61-14DF + + + Start with plasma strength at 3 instead of 1 + D761-176F + + + Start with plasma strength at 6 + D161-176F + + + Start with plasma strength at 0 + DD61-176F + + + Start with laser strength at 1 instead of 0 + DF65-1FDF + + + Start with laser strength at 3 + D765-1FDF + + + Start with laser strength at 6 + D165-1FDF + + + Start with ionic strength at 1 instead of 0 + DF66-1DDF + + + Start with ionic strength at 3 + D766-1DDF + + + Start with ionic strength at 6 + D166-1DDF + + + Loss of vehicle does not reduce bullet strength + 8267-170F + + + Loss of vehicle does not reduce flame strength + 826E-470F + + + Loss of vehicle does not reduce plasma strength + 826D-170F + + + Loss of vehicle does not reduce laser strength + 826F-170F + + + Loss of vehicle does not reduce ionic strength + 8264-170F + + + Bubble shield lasts for 4 seconds instead of 12 + DF8B-CD07 + + + Bubble shield lasts for 8 seconds + D48B-CD07 + + + Bubble shield lasts for 16 seconds + D08B-CD07 + + + Bubble shield lasts for 32 seconds + D68B-CD07 + + + Bubble shield lasts for 64 seconds + FD8B-CD07 + + + Bubble shield on jeep lasts until end of level + C2CB-3FD4 + + + Bubble shield on helicopter lasts until end of level + C2CF-1464 + + + + First Samurai (USA) + + Infinite life force + C9BF-D4D1 + + + Infinite axe + C9B6-6700 + C9BE-6D00 + + + Infinite warp lantern + C96D-04A5 + + + Infinite lives + 406E-D461 + + + Start with 9 lives + DB6A-676F + + + Start with 2 lives + D46A-676F + + + Full weapon power for dagger on pick-up + D783-0F09 + + + Less force picked up from baddies + D4C5-AFA5 + + + More force picked up from baddies + D6C5-AFA5 + + + Lots more power picked up from baddies + F9C5-AFA5 + + + Less life force from food + D789-AFA9 + + + More life force from food + FD89-AFA9 + + + + Flashback - The Quest for Identity (USA) (En,Fr,De) + + Never lose a shield when shot (switch off effects to kill enemies) + 3C1F-EDAC + + + Don't die from most falls + 8511-ED6C + + + Start with 1 shield + D4D4-5F78 + + + Start with 2 shields + D7D4-5F78 + + + Start with 3 shields + D0D4-5F78 + + + Start with 5 shields + D1D4-5F78 + + + Start with 10 shields + D8D4-5F78 + + + Start with 20 shields + F9D4-5F78 + + + Start with 50 shields + 77D4-5F78 + + + Start with 100 shields + 19D4-5F78 + + + Start with 50 credits + 74F0-5F7B + + + Start with 100 credits + 10F0-5F7B + + + Start with 250 credits + ECF0-5F7B + + + Start with 512 credits + D4F0-5DEB + + + Start with 1024 credits + D0F0-5DEB + + + + Flintstones, The - The Treasure of Sierra Madrock (USA) + + Invincibility + DDCF-1DB7 + + + Infinite stamina + C28D-44FD + + + Infinite time - 1P game + C2A9-3D64 + + + Infinite lives - 1P game + C2CF-17A4 + + + + Flintstones, The (USA) (En,Fr,De,Es,It) + + Invincibility + 2DB9-3D62 + 2DB3-CD02 + + + Infinite health + 82BB-C402 + C9B9-37D2 + + + Infinite lives + 226A-ADDD + + + Infinite time + A2EE-CFD6 + + + + F-Zero (USA) + + Infinite power + 7E00C900 + 7E00CA08 + + + Infinite spare machines + A96E-A4A4 + + + Start with 1 spare machine + DF6C-0F0A + + + Start with 5 spare machines + D96C-0F0A + + + Start with 9 spare machines + DB6C-0F0A + + + Infinite turbos + D484-D404 + + + Infinite turbos (alt) + 7E0CF303 + + + Always rank 1st + CB3C-0FA4 + DF3C-04D4 + + + Always rank 1st (alt) + 7E115000 + + + Always boosted + 7E0D5108 + + + + Ganpuru - Gunman's Proof (Japan) + + Infinite health vs enemies/bullets + C266-3FBA + + + Infinite ammo for picked up guns + C281-4DAC + + + Infinite ammo for picked up hand weapons + C286-4FAC + + + Always have stronger attacks + DD66-14B2 + + + Always have super strong attacks + CB66-1FB2 + 7E66-14F2 + 6966-1422 + + + Easily get max money + DD68-4422 + + + Easily get max score + DD6D-1FB2 + + + Always have Starmine Bombs (if you have none, fire 3 off) + DDB5-3FFD + D42F-1F47 + + + Always get Rank S for dungeons, regardless of time taken + BA2B-3FC4 + + + + George Foreman's KO Boxing (USA) (Rev 1) + + Infinite time + CB62-040F + 5662-046F + + + Infinite Super Punch after obtaining it + 6D25-A464 + + + Time goes slower + 566D-07DD + + + Time speeds up + DC6D-07DD + + + Start with 1/2x health - both players + 4D6C-D70D + + + Damage inflicted by your opponent affects him (your health may slightly decrease) + C228-A764 + 5728-A7A4 + 622A-AFA4 + 572A-A4D4 + + + + Ghoul Patrol (USA) + + Super powered normal arrows + EE61-C4A3 + + + Infinite health + 7E1D090A + + + Infinite lives + 7E1DA163 + + + Always have weapon + 7E1CFE01 + + + Infinite Keys + 7E1D5D63 + + + Infinite Shot 1 + 7E1D2163 + + + Infinite Shot 2 + 7E1D2963 + + + Infinite Shot 3 + 7E1D2363 + + + Infinite Shot 4 + 7E1D1F63 + + + Infinite Blue Potions + 7E1D6363 + + + Infinite Red Potions + 7E1D6163 + + + Infinite Green Potions + 7E1D6563 + + + Infinite Medipaks + 7E1D7163 + + + Infinite ? Potions + 7E1D6963 + + + Infinite Vials + 7E1D6763 + + + All victims already rescued + 7E1E0500 + + + + Gods (USA) + + Shields last until at least end of the world (switch off if you get stuck) + 1DE7-31E8 + + + Infinite lives + C269-C1EB + + + Items you can afford in the shops are free + A284-35EC + + + Start with 2 lives + DF3C-4073 + + + Start with 6 lives + D93C-4073 + + + Start with 10 lives + DB3C-4073 + + + + Goof Troop (USA) + + Infinite health + 692F-1FA7 + + + 4 hearts give you a life + D0C0-3FA8 + B3C9-3DD8 + + + 2 hearts give you a life + D4C0-3FA8 + B3C9-3DD8 + + + 2 hearts from cherries + D4A8-4762 + + + 4 hearts from bananas + D0A8-47A2 + + + 1 heart from bananas + DFA8-47A2 + + + Infinite lives + C96F-3F6C + + + Start with 9 lives + DBCD-146D + + + Start with 6 lives + D1CD-146D + + + Start with 1 life + DFCD-146D + + + Goofy has quicker left-right movement + D46F-C70E + E264-C70E + + + Max has quicker left-right movement + D46E-170E + E26D-C70E + + + + Gradius III (USA) + + Invincibility + 6D2D-D464 + + + Infinite Forcefield + 7E034602 + 7E035002 + + + Infinite Konami code use (up, up, down, down, left, right, left, right, B, A) + C2A9-0DDD + + + Enables Arcade option in options menu + D78F-D4AF + + + Enemies die automatically + 7E00DC0B + + + Start with 1 life + DD8B-6DA4 + + + Start with 2 lives + DF8B-6DA4 + + + Start with 4 lives + D78B-6DA4 + + + Start with 5 lives + D08B-6DA4 + + + Start with 9 lives + D68B-6DA4 + + + Start with 16 lives + DE8B-6DA4 + + + Start with 31 lives + F38B-6DA4 + + + Infinite lives + 3C8E-DDD7 + 3C8E-DD07 + + + Infinite lives (alt) + 7E007C03 + + + Start with 1 credit (1P game) + DFC3-DF0D + + + Start with 2 credits + D4C3-DF0D + + + Start with 6 credits + D1C3-DF0D + + + Start with 7 credits + D5C3-DF0D + + + Start with 8 credits + D6C3-DF0D + + + Start with 9 credits + DBC3-DF0D + + + Infinite credits + C227-6DDD + + + Infinite credits (alt) + 00D230AD + + + Infinite continues + 7E1E0603 + + + Makes Earwig Scorpion (Stage 1 mayor) much easier to defeat + DFBB-A766 + + + Makes Bubble Brain (Stage 2 mayor) easier to defeat + DFB1-6F6C + + + Weapons status gauge remains at current level after a weapon is selected + 3C29-0704 + 3C29-0764 + + + Weapons status gauge remains at current level after a weapon is selected (alt) + 00D95DEA + 00D95EEA + + + Enemies shoot at you more + CBAF-D7AD + DFA4-DDDD + + + Have Mega Crush + 7E00B007 + + + Have Max Speed + 7E00B205 + + + Have support upgrade - Missile + 7E00B40B + + + Have support upgrade - Spread Bomb + 7E00B40C + + + Have support upgrade - 2-Way Missile + 7E00B40D + + + Have gun - Double + 7E00B602 + + + Have gun - Tailgun + 7E00B603 + + + Have gun - Back Double + 7E00B604 + + + Have gun - Verticle + 7E00B605 + + + Have gun - Twin Laser + 7E00B606 + + + Have gun - Laser + 7E00B607 + + + Have gun - Charged Laser + 7E00B609 + + + Have gun - Laser (2nd) + 7E00B60A + + + Have 99 million points - P1 + 7E1F4799 + + + Have 99 million points - P2 + 7E1F4B99 + + + + Great Battle III, The (Japan) + + Invincibility + 2D80-0DDF + 2D80-0F0F + + + Infinite energy + 8985-D76D + + + Infinite lives + 2981-04A7 + + + + Great Circus Mystery Starring Mickey & Minnie, The (USA) + + Invincible to enemies + 6D94-E764 + + + Invincible to ground hazards + 6DF3-5FA0 + + + Collect one coin for 999 + DD9D-5D07 + + + Infinite vacuum + C9FB-5769 + + + Infinite bullets + C9FB-8FA9 + + + + GunForce - Battle Fire Engulfed Terror Island (USA) + + Invincibility + 7E0055B1 + + + Infinite time (enable during gameplay only) + 7E002809 + 7E002909 + + + Infinite lives - P1 + 7E005109 + + + Infinite lives - P2 + 7E005209 + + + Infinite continues - P1 + 7E005309 + + + Infinite continues - P2 + 7E005409 + + + Have Rapid Fire + 7E0057FF + + + Have regular gun + 7E901501 + + + Have Laser gun + 7E901504 + + + Have Bazooka + 7E901507 + + + Have Flamethrower + 7E90150E + + + + Hagane - The Final Conflict (USA) + + Invincibility + 1D0B-576D + + + Infinite time + 6D6F-8D0F + + + Infinite bombs + 3CBF-8FDD + + + Infinite daggers + 3CB9-5F6D + + + Infinite lives + 3C62-540F + + + Start with 9 lives + DB63-57DD + + + Start with 9 special attack points + DB6E-5DDD + + + Start with maximum health points + D963-5FDD + + + Infinite special attacks + 3C68-EDD4 + + + One hit kills + DD0D-770D + + + Start on stage 2 - Fortress Of Doom + CB6A-5D0D + DF6A-5D6D + + + Start on stage 3 - Violated Heavens + CB6A-5D0D + D46A-5D6D + + + Start on stage 4 - Cry Of The Spirits + CB6A-5D0D + D76A-5D6D + + + Start on stage 5 - Into The Darkness + CB6A-5D0D + D06A-5D6D + + + + HAL's Hole in One Golf (USA) + + No penalty if you land in water or out of bounds + 4A6C-6D69 + + + Always start hole with 1-shot penalty + DF6F-0D00 + + + Max 7 strokes per hole + D56C-A401 + + + Max 5 strokes per hole + D96C-A401 + + + + Harley's Humongous Adventure (USA) + + Infinite health against most enemies + 7EAB4532 + + + Start with all weapons + 09DED9FF + + + Infinite weapons on pick-up + 7EAB549A + + + Infinite Air + 7E24B2FF + + + Infinite Jet Fuel on pick-up + DDCD-6DF5 + + + Infinite Fuel on pick-up (disable to complete level) + 7E24BCFF + + + Infinte Nuts + 7E24AC99 + + + Infinite Invincibility Spray + 7EAB4484 + + + Moon-jump + 7E028302 + + + Infinite ammo + DD87-A4B0 + + + Start with maximum fuel on every level + 6DCF-04B1 + + + Any fuel power-up gives maximum amount + DDC4-6495 + + + Infinite time + 7E1C3B64 + + + Infinite time on Vent level + 3C83-ADA4 + + + Press X on the title screen with the house to get level select menu + D43E-046F + + + Start with 4 hearts + D6CF-ADB1 + + + Start with 5 hearts + DCCF-ADB1 + + + Start with 10 of every weapon + FD22-6415 + + + Start with 25 of every weapon + 4922-6415 + + + Start with 50 of every weapon + 9D22-6415 + + + Start with 99 of every weapon + BB22-6415 + + + Protection against some hazards + C2C0-0DB5 + + + Start with 2 lives + DFCF-A7F1 + + + Start with 6 lives + D9CF-A7F1 + + + Start with 11 lives + FDCF-A7F1 + + + Start with 26 lives + 49CF-A7F1 + + + Start with 51 lives + 9DCF-A7F1 + + + Start with 100 lives + BBCF-A7F1 + + + Infinite lives + C2C8-07B5 + + + Get only 5 ammo from a weapon power-up + D98D-DDB9 + + + Get 20 ammo from a weapon power-up + 4D8D-DDB9 + + + Get 30 ammo from a weapon power-up + 7D8D-DDB9 + + + Get 40 ammo from a weapon power-up + 0D8D-DDB9 + + + Get 50 ammo from a weapon power-up + 9D8D-DDB9 + + + 20 seconds to collect power-ups on level 1 + F08C-A704 + + + 60 seconds to collect power-ups on level 1 + 7A8C-A704 + + + 90 seconds to collect power-ups on level 1 + 9C8C-A704 + + + 60 seconds to complete the Vent level + 7A88-A7D4 + + + + Harvest Moon (USA) + + Can access all items temporarily + C980-3460 + + + Don't lose stamina + C22E-4DD0 + + + Go to bed to get 200 stamina + CB68-34A6 + A668-37D6 + 3C68-3706 + + + With 1 or more wood, take some to get 999 + 6D87-CFDA + + + With 0 wood, take some to get 999 + F987-CDDA + + + Fencing doesn't break when it storms + 6DC5-3DAB + + + Go to sleep to put a bell plant next to the stable + FD69-47DB + + + Go to sleep to enable the egg festival prize + DB6B-3F6B + DD6B-3FAB + FD6B-34DB + + + + Home Alone 2 - Lost in New York (USA) + + Infinite power - some things can still kill you + C22E-AF9D + + + Start with 1 life instead of 3 + DFB5-6FA7 + + + Start with 5 lives + D9B5-6FA7 + + + Start with 9 lives + DBB5-6FA7 + + + Start with 25 lives + FBB5-6FA7 + + + Start with 50 lives + 74B5-6FA7 + + + Start with 99 lives + 17B5-6FA7 + + + Infinite lives + C264-D464 + + + Extra life from 1 pizza slice instead of 6 + DF2B-AFBF + + + Extra life from 2 pizza slices + D42B-AFBF + + + Extra life from 3 pizza slices + D72B-AFBF + + + Extra life from 4 pizza slices + D02B-AFBF + + + Extra life from 5 pizza slices + D92B-AFBF + + + Dart guns have 50 shots + 7427-AF2F + 7429-AD9F + + + Infinite ammo + 3CB7-6DA4 + + + + Home Alone (USA) + + Start with 1 life instead of 3 + DF2B-AFD4 + + + Start with 2 lives + D42B-AFD4 + + + Start with 5 lives + D92B-AFD4 + + + Start with 9 lives + DB2B-AFD4 + + + Start with 25 lives + 492B-AFD4 + + + Start with 50 lives + 9D2B-AFD4 + + + Start with 99 lives + BB2B-AFD4 + + + Infinite lives + DD21-DFD4 + + + Infinite power + C220-D464 + + + Extra life with 1 pizza slice instead of 8 + DF66-04A7 + + + Extra life with 2 pizza slices + D466-04A7 + + + Extra life with 3 pizza slices + D766-04A7 + + + Extra life with 4 pizza slices + D066-04A7 + + + Extra life with 5 pizza slices + D966-04A7 + + + Extra life with 6 pizza slices + D166-04A7 + + + Extra life with 7 pizza slices + D566-04A7 + + + Infinite baseballs, slingshot ammo and rifle bullets + DD2A-A76F + + + Power boost on jumps + 3DB1-07D5 + + + Super power boost on jumps + ADB1-07D5 + + + Need 1 item (instead of 24) to complete level 1 + DF23-A764 + + + Need 5 items to complete level 1 + D923-A764 + + + Need 10 items to complete level 1 + FD23-A764 + + + Need 15 items to complete level 1 + F923-A764 + + + Need 20 items to complete level 1 + 4D23-A764 + + + Need 1 item (instead of 30) to complete level 2 + DF23-A7A4 + + + Need 5 items to complete level 2 + D923-A7A4 + + + Need 10 items to complete level 2 + FD23-A7A4 + + + Need 15 items to complete level 2 + F923-A7A4 + + + Need 20 items to complete level 2 + 4D23-A7A4 + + + Need 25 items to complete level 2 + 4923-A7A4 + + + Need 1 item (instead of 35) to complete level 3 + DF2E-ADD4 + + + Need 5 items to complete level 3 + D92E-ADD4 + + + Need 10 items to complete level 3 + FD2E-ADD4 + + + Need 15 items to complete level 3 + F92E-ADD4 + + + Need 20 items to complete level 3 + 4D2E-ADD4 + + + Need 25 items to complete level 3 + 492E-ADD4 + + + Need 1 item (instead of 35) to complete level 4 + DF2E-AD04 + + + Need 5 items to complete level 4 + D92E-AD04 + + + Need 10 items to complete level 4 + FD2E-AD04 + + + Need 15 items to complete level 4 + F92E-AD04 + + + Need 20 items to complete level 4 + 4D2E-AD04 + + + Need 25 items to complete level 4 + 492E-AD04 + + + Start on level 2 + DF69-DFAD + AB69-D40D + D769-D46D + + + Start on level 3 + D469-DFAD + AB69-D40D + D769-D46D + + + Start on level 4 + D769-DFAD + AB69-D40D + D769-D46D + + + + Home Improvement (USA) + + Infinite lives + CB69-1FDE + + + Infinite nut bolts + C9BC-3673 + C9C4-4683 + C26F-468A + + + + Hook (USA) + + Infinite power (disable if you get stuck) + 3CA5-D70F + + + Infinite power (alt) + 7EF7C103 + + + Infinite lives + 7E1F0003 + + + Infinite flying + 7E1F0780 + 7E1F0801 + + + Infinite time + A268-6F03 + + + Infinite time (alt) + 7E1F1459 + + + Time starts at 7 min - stage 1 + D56B-ADA2 + + + Time starts at 3 min - stage 1 + D76B-ADA2 + + + Start with 3 power leaves + D066-0FDD + + + + Hunt for Red October, The (USA) + + Start with 0 bombs instead of 40 + DD34-4761 + + + Start with 99 bombs + 1734-4761 + + + Infinite bombs + C2AE-1404 + + + Start with 0 torpedoes instead of 60 + DD3F-47D1 + + + Start with 99 torpedoes + 173F-47D1 + + + Infinite torpedoes + C2A0-1D64 + + + Start with 0 Surface-to-Air Missiles (SAMs) instead of 25 + DD34-44D1 + + + Start with 50 SAMs + 7434-44D1 + + + Start with 99 SAMs + 1734-44D1 + + + Infinite SAMs + C2AB-CFD4 + + + Start with 0 Surface-to-Surface Missiles (SSMs) instead of 25 + DD34-4D61 + + + Start with 50 SSMs + 7434-4D61 + + + Start with 99 SSMs + 1734-4D61 + + + Infinite SSMs + C2A7-3D64 + + + Start with 0 Electronic Countermeasures (ECMs) instead of 2 + DD3F-4F61 + + + Start with 50 ECMs + 743F-4F61 + + + Start with 99 ECMs + 173F-4F61 + + + Infinite ECMs + C2AC-34D4 + + + Start in theatre I - Caribbean + D4BA-1F64 + + + Start in theatre II - North Pacifi + D1BA-1F64 + + + Start in theatre III - Mediterranean + DABA-1F64 + + + Start on the final mission - Return to the USSR + FDBA-1F64 + + + + Hurricanes (USA) + + Invincibility + 7E0CA2FF + + + Infinite health + 7E0D0E2C + + + Infinite time + 7E125209 + + + Infinite lives + 7E0D1609 + + + + HyperZone (USA) + + Infinite energy + 4A8A-DFD1 + + + Start with 8 lives + D5C4-DFD1 + + + Start with 1 life + DDC4-DFD1 + + + Restore energy more quickly + D76A-D7D5 + + + Restore energy more slowly + DD6A-D7D5 + + + + Ignition Factor, The (USA) + + Infinite Extinguisher + B9C0-87AC + + + Infinite Air Tank + C9CA-E40C + + + Infinite health + C96E-740B + + + Infinite time + DDCA-5F04 + + + + Illusion of Gaia (USA) + + Infinite energy + C2A5-44A2 + + + Start with a lot more energy + F061-44DD + + + Start with 20 strength points + F065-4D0D + + + Start with 50 strength points + 7465-4D0D + + + Start with 80 strength points + 9D65-4D0D + + + Start with max HP + EE61-440D + + + Can always attack + 7E09AE00 + + + Have all Statues + 7E0A1FBF + + + Have all Statues (alt) + 7E0A1FBF + + + Less charge time for psycho dash + D98F-4F0C + + + Less charge time for dark friar + D98B-4DDC + + + Super run left/right only + D9AA-1F0B + E8A5-14AB + + + Super run up/down only + EAA7-1D6B + D0A3-446B + + + Get 2x the energy from herbs + FD6B-47A3 + + + Get 3x the energy from herbs + F66B-47A3 + + + Red Jewel 50 check passes + DDA0-3D37 + + + Red Jewel 30 check passes + DDA7-3447 + + + Red Jewel 20 check passes + DDA4-3F37 + + + Red Jewel 12 check passes + DDAF-3FC7 + + + Red Jewel 08 check passes + DDAD-3F17 + + + Red Jewel 05 check passes + DDAE-CF47 + + + Red Jewel 03 check passes + DDA3-CD37 + + + Walk through walls + 82E301AF + 82E3049B + + + + Imperium (USA) + + Invincible against lesser robots, weapons and lasers + 1D34-D4A1 + 1DC3-DDF7 + + + Start with 1 life point + DFA2-D4A4 + + + Start with 3 life points + D7A2-D4A4 + + + Start with 5 bombs + D9BD-64D7 + + + Start with 9 bombs + DBBD-64D7 + + + + Incantation (USA) + + Infinite energy + C234-CFD7 + + + Infinite lives + C2A0-3FD7 + + + Infinite energy (alt) + 7E111530 + + + Infinite lives (alt) + 7E084664 + + + Max bonus + 7E083C5A + 7E083E63 + + + + Incredible Hulk, The (USA) + + Infinite health + 8260-1465 + C2E9-44DF + + + Infinite and max health + 7E071863 + + + Infinite lives + 7E00C009 + + + Infinite transformation capsules on pick-up + C96D-CDC6 + + + Health doesn't decrease when Hulked-out + C260-4746 + + + Start with 1 life + DFBD-CD6F + + + Start with 6 lives + D1BD-CD6F + + + Start with 9 lives + DBBD-CD6F + + + Get 4 shots from gun + D0BC-173B + + + Get 9 shots from gun + DBBC-173B + + + Get 20 shots from gun + F0BC-173B + + + Get 20 seconds from time icon + 4DB0-1F4B + + + Get 40 seconds from time icon + 0DB0-1F4B + + + 2x energy from gamma capsules + F3BE-144B + + + Gamma capsules act as mega-gamma capsules + DDB8-171B + + + Super-jump (sometimes) + DA25-34A7 + DA34-47AD + + + Mega-jump (sometimes) + FB25-34A7 + FB34-47AD + + + Mega damage from Hulk's uppercut + DCB7-44D0 + + + Mega damage from Hulk's head butt + DCB1-4FD0 + + + 4x damage from Hulk's uppercut + D0B7-44D0 + + + 4x damage from Hulk's head-butt + D0B1-4FD0 + + + Start on level 2 + DDB2-1F0F + + + Start on level 3 + 4DB2-1F0F + + + Start on level 4 + 0DB2-1F0F + + + Start on level 5 + 6DB2-1F0F + + + + Indiana Jones' Greatest Adventures (USA) + + Infinite energy + CB24-4D64 + + + Start with very little energy + DFC1-3707 + + + Start with about 1/2 energy + D7C1-3707 + + + Start with more energy (ignore energy meter) + DEC1-3701 + + + Hearts don't restore energy + C2B6-440F + + + Infinite grenades + C2B6-370F + + + Start with 5 grenades + D9C7-CF0F + + + Start with 9 grenades + DBC7-CF0F + + + Start with 15 grenades + DEC7-CF0F + + + Can't collect any more grenades + C2B9-37DF + + + Start with 2 lives + DFCC-1E83 + + + Start with 5 lives + D0CC-1E83 + + + Start with 10 lives + DBCC-1E83 + + + Start with no continues + D1C8-13E3 + + + Infinite continues + 3CAB-CE82 + F0BC-173B + + + + Inspector Gadget (USA) + + Invincibility (keep coat in collisions) + C269-5D0D + + + Start with 3 plungers + D74B-E7D7 + + + Infinite lives + C216-5DD4 + + + Infinite time + C297-8F0F + + + + Jack Nicklaus Golf (USA) + + Each round ends after hole 1 + DF33-076F + DDEB-D40A + + + Each round ends after hole 2 + D433-076F + DFEB-D40A + + + Each round ends after hole 3 + D733-076F + D4EB-D40A + + + Each round ends after hole 4 + D033-076F + D7EB-D40A + + + Each round ends after hole 5 + D933-076F + D0EB-D40A + + + Each round ends after hole 6 + D133-076F + D9EB-D40A + + + Each round ends after hole 7 + D533-076F + D1EB-D40A + + + Each round ends after hole 8 + D633-076F + D5EB-D40A + + + Each round ends after hole 9 + DB33-076F + D6EB-D40A + + + Each round ends after hole 10 + DC33-076F + DBEB-D40A + + + Each round ends after hole 11 + D833-076F + DCEB-D40A + + + Each round ends after hole 12 + DA33-076F + D8EB-D40A + + + Each round ends after hole 13 + D233-076F + DAEB-D40A + + + Each round ends after hole 14 + D333-076F + D2EB-D40A + + + Each round ends after hole 15 + DE33-076F + D3EB-D40A + + + Each round ends after hole 16 + FD33-076F + DEEB-D40A + + + Each round ends after hole 17 + FF33-076F + FDEB-D40A + + + Infinite mulligans + 82BF-6707 + + + Mulligan can be taken after any stroke + 6DB2-0D07 + + + No mulligans allowed + DDBA-0467 + + + + James Bond Jr (USA) + + Infinite health (you can still be hurt by some things) + CE2B-D4B6 + + + Infinite grenades + C22A-6FBC + + + Infinite darts + C227-DDF8 + + + Start with 1 life on the ground instead of 5 + DFA0-670D + + + Start with 3 lives on the ground + D7A0-670D + + + Start with 7 lives on the ground + D5A0-670D + + + Start with 9 lives on the ground + DBA0-670D + + + Infinite lives on the ground + C2E0-6F0D + + + Start with 1 life in the air instead of 5 + DF68-DDAD + + + Start with 3 lives in the air + D768-DDAD + + + Start with 7 lives in the air + D568-DDAD + + + Start with 9 lives in the air + DB68-DDAD + + + Infinite lives in the air + C26C-6F08 + + + Start with 0 grenades and darts instead of 10 + DDE7-6F6D + + + Start with 5 grenades and darts + D9E7-6F6D + + + Start with 25 grenades and darts + FBE7-6F6D + + + Start with 50 grenades and darts + 74E7-6F6D + + + Start with 99 grenades and darts + 17E7-6F6D + + + Start with 0 darts instead of 10 + DDA9-640D + CEE7-64AD + + + Start with 5 darts + D9A9-640D + CEE7-64AD + + + Start with 25 darts + FBA9-640D + CEE7-64AD + + + Start with 50 darts + 74A9-640D + CEE7-64AD + + + Start with 99 darts + 17A9-640D + CEE7-64AD + + + Hearts worth 0 + C23D-6FBC + + + Large red grenade worth 0 instead of 5 + DD34-679C + + + Large red grenade worth 10 + DC34-679C + + + Large red grenade worth 20 + F034-679C + + + Large red grenade worth 30 + F334-679C + + + Large red grenade worth 40 + 4634-679C + + + Small silver grenade worth 0 instead of 1 + 3C3A-ADFC + + + Start on level 3 + CBAC-6D0D + DFAC-6D6D + + + Start on level 5 + CBAC-6D0D + D4AC-6D6D + + + Start on level 7 + CBAC-6D0D + D7AC-6D6D + + + Start on level 3, part 2 + CBAB-67AD + D0AC-6DDD + 6DAC-6D0D + + + Start on level 3, part 3 + CBAB-67AD + D5AC-6DDD + 6DAC-6D0D + + + Start on level 5, part 2 + CBAB-67AD + D9AC-6DDD + 6DAC-6D0D + + + Start on level 5, part 3 + CBAB-67AD + D6AC-6DDD + 6DAC-6D0D + + + Start on level 7, part 2 + CBAB-67AD + D1AC-6DDD + 6DAC-6D0D + + + Start on level 7, part 3 + CBAB-67AD + DBAC-6DDD + 6DAC-6D0D + + + + Jetsons, The - Invasion of the Planet Pirates (USA) + + Invincibility + 3C62-1761 + + + Infinite lives + C26D-4767 + + + Infinite time + C2AD-4D6F + + + Maximum vacuum power + D0BB-146D + + + + Jim Lee's WildC.A.T.S - Covert Action Teams (USA) + + Invincibility + C2C5-CDCB + + + Infinite health + 826C-C7C6 + + + Infinite lives + 3CB7-1F1C + + + Infinite health (alt) + 7E401E48 + + + Infinite lives (alt) + 7E1F9303 + + + + Jim Power - The Lost Dimension in 3D (USA) + + Invincibility + CEAB-1D0D + + + Invincibility (alt) + 7E074E39 + + + Infinite lives + C9AD-CF0D + + + Infinite lives (alt) + 7E003F09 + + + Infinite time + C920-3FA5 + + + Infinite time (alt) + 7E0043FF + + + Infinite SB + C93F-4764 + + + Infinite SB (alt) + 7E004109 + + + Jump as high as you want and jump through walls (disable to come back down) + 7E077E10 + + + + Joe & Mac 2 - Lost in the Tropics (USA) + + Infinite health + B987-CD6D + + + Infinite lives + B9C1-3467 + + + Start with $2020 + A73F-47AF + + + + Joe & Mac (USA) + + Invincibility after one hit + 892C-64D4 + + + Infinite health + 2BBA-64D7 + + + Infinite health (alt) + 8BBA-64D7 + + + Infinite health - P1 + 7E081C14 + + + Infinite health - P2 + 7E085C0F + + + Infinite lives + DD36-D40D + + + Infinite lives (alt) + 8936-D46D + + + Infinite lives - P1 + 7E082205 + + + Infinite lives - P2 + 7E086205 + + + Infinite Keys + C936-D708 + + + All food fully restores health + DDE0-0F6F + + + Have no weapon - P1 + 7E081AB8 + + + Have no weapon - P2 + 7E085AB8 + + + Have Bone - P1 + 7E081AB9 + + + Have Bone - P2 + 7E085AB9 + + + Have Boomerang - P1 + 7E081ABA + + + Have Boomerang - P2 + 7E085ABA + + + Have Fire - P1 + 7E081ABB + + + Have Fire - P2 + 7E085ABB + + + Have Wheel - P1 + 7E081ABC + + + Have Wheel - P2 + 7E085ABC + + + Start with 2 lives + CBC8-6404 + DFC8-6464 + + + Start with 6 lives + CBC8-6404 + D9C8-6464 + + + Start with 10 lives + CBC8-6404 + DBC8-6464 + + + + John Madden Football '93 (USA) + + 9 timeouts - P1 + DB30-D43A + + + 6 timeouts - P1 + D130-D43A + + + 1 timeout - P1 + DF30-D43A + + + 9 timeouts - P2 + DB30-D74A + + + 6 timeouts - P2 + D130-D74A + + + 1 timeout - P2 + DF30-D74A + + + Infinite timeouts - both players + 3C3A-0FAD + + + + John Madden Football (USA) + + Always 1st down + C2AB-64A4 + + + Infinite time-outs + 3C24-A70D + + + Play clock is 20 seconds instead of 45 + F0A2-A4DD + + + Play clock is 30 seconds + F3A2-A4DD + + + Play clock is 60 seconds (CPU will run down the play clock) + 7AA2-A4DD + + + Play clock is 90 seconds (CPU will run down the play clock) + 9CA2-A4DD + + + Only have 3 plays to get a first down or TD (down counter starts at 2) + D4A3-6D04 + + + Only have 2 plays to get a first down or TD (down counter starts at 3) + D7A3-6D04 + + + Only have 1 play to get a first down or TD (down counter starts at 4) + D0A3-6D04 + + + No time-outs instead of 3 - P1 + DD69-A407 + + + 6 time-outs - P1 + D169-A407 + + + 9 time-outs - P1 + DB69-A407 + + + No time-outs - P2 + DD69-A467 + + + 6 time-outs - P2 + D169-A467 + + + 9 time-outs - P2 + DB69-A467 + + + Safeties worth 1 point instead of 2 + 82A6-AF64 + + + Safeties worth 0 points + 82A6-AF64 + 82A6-A404 + + + Touchdowns worth 0 points instead of 6 + DDA4-0767 + + + Touchdowns worth 1 point + DFA4-0767 + + + Touchdowns worth 2 points + D4A4-0767 + + + Touchdowns worth 3 points + D7A4-0767 + + + Touchdowns worth 4 points + D0A4-0767 + + + Touchdowns worth 5 points + D9A4-0767 + + + Touchdowns worth 7 points + D5A4-0767 + + + Touchdowns worth 8 points + D6A4-0767 + + + Touchdowns worth 9 points + DBA4-0767 + + + Extra points and field goals worth 0 + 3CA7-A707 + 3CA7-A767 + + + Extra point or field goal resets score to 0 + B3A7-A7A7 + + + Start with 3 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + D76C-6D67 + + + Start with 5 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + + + Start with 9 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + DB6C-6D67 + + + Start with 12 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + DA6C-6D67 + + + Start with 15 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + DE6C-6D67 + + + Start with 20 points - P1 + CB6C-6D07 + 626C-6FD7 + 416C-6F07 + ED6C-6467 + F06C-6D67 + + + Start with 3 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + D76C-6D67 + + + Start with 5 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + + + Start with 9 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + DB6C-6D67 + + + Start with 12 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + DA6C-6D67 + + + Start with 15 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + DE6C-6D67 + + + Start with 20 points - P2 + CB6C-6D07 + 626C-6FD7 + 486C-6F07 + ED6C-6467 + F06C-6D67 + + + + J.R.R. Tolkien's The Lord of the Rings - Volume 1 (USA) + + Invincibility - all your characters + 82A2-CF6D + + + Start with 908 HP + DBCE-C360 + DBCE-C4A0 + + + Start with 9908 HP + BBCE-C360 + BBCE-C4A0 + + + Start the game with more strength + 62CD-34D0 + + + 9999 HP - character 1 + 7E022499 + 7E022599 + + + 9999 max HP - character 1 + 7E023699 + 7E023799 + + + 9999 EXP - character 1 + 7E024699 + 7E024799 + + + Level 98 - character 1 + 7E025698 + + + 9999 HP - character 2 + 7E022699 + 7E022799 + + + 9999 max HP - character 2 + 7E023899 + 7E023999 + + + 9999 EXP - character 2 + 7E024899 + 7E024999 + + + Level 98 - character 2 + 7E025898 + + + + Judge Dredd (USA) + + Start with all weapons and almost infinite ammo + EE63-1318 + + + Start with 1 life + DF62-1A38 + + + Start with 5 lives + D962-1A38 + + + Start with 9 lives + DB62-1A38 + + + Almost infinite ammo + C2BE-4A4B + + + Almost infinite energy + C2A9-1627 + + + Invincible after getting hit + C22C-1B2D + + + Don't flash after getting hit + DDA9-1CB7 + + + Don't flash as long after getting hit + 74A9-1CB7 + + + Flash longer after getting hit + EEA9-1CB7 + + + Start with very little energy on your first life + DE6D-C338 + + + Start with half energy on your first life + 6D6D-C338 + + + Start with about 3/4 energy on your first life + A16D-C338 + + + Start with very little energy after first life + DE3A-48B7 + + + Start with half energy after first life + 6D3A-48B7 + + + Start with about 3/4 energy after first life + A13A-48B7 + + + + Jungle Book, The (USA) + + Infinite weapons + DD6F-4DD4 + + + Start with 9 hearts (normal game) + DBEF-1F67 + + + Start with 6 hearts (normal game) + D1EF-1F67 + + + Start with 1 heart (normal game) + DFEF-1F67 + + + Start with 10 lives (normal game) + DBEF-1DD7 + + + Start with 2 lives (normal game) + DFEF-1DD7 + + + Infinite lives + C2CC-4704 + + + Hearts from big jungle fruit restore all energy + DDCF-3F6D + + + 20 seconds from hourglass + D4C0-1FAF + + + 30 seconds from hourglass + D7C0-1FAF + + + Super-jumping Mowgli + E8CA-3DA4 + + + Mega-jumping Mowgli + ECCA-3DA4 + + + Bonus gems worth 2 (don't collect over 100) + D4CA-4DDF + + + Bonus gems worth 3 (don't collect over 100) + D7CA-4DDF + + + Bonus gems worth 4 (don't collect over 100) + D0CA-4DDF + + + Red gems worth 2 (don't collect over 100) + D4C2-4FAF + + + Red gems worth 3 (don't collect over 100) + D7C2-4FAF + + + Red gems worth 4 (don't collect over 100) + D0C2-4FAF + + + The amazing rock (just for fun) + DD65-47AD + + + + Jungle Strike (USA) + + Infinite ammo + C2A5-476F + + + Infinite armor + C2A9-4FA7 + + + Infinite lives + CEBE-C4D4 + + + Start with less fuel + 7485-C7D1 + + + Start with more fuel + 7485-C7D1 + + + Start with mega fuel + 7485-C701 + + + Start with 0 hellfires + DD86-C761 + + + Start with more hellfires + B186-C761 + + + Start with mega hellfires + B186-C7A1 + + + Start with less gun ammo + DD8B-C4A1 + + + Start with more gun ammo + F18B-C4A1 + + + Start with mega gun ammo + 748B-C4A1 + + + Start with less hydras + FB8B-CFD1 + + + Start with more hydras + EE8B-CFD1 + + + Start with mega hydras + 748B-CF01 + + + + Jurassic Park II - The Chaos Continues (USA) (En,Fr,De,It) + + Invincibility - P1 + 7EB04A0E + + + Almost invincible + 8BEB-C22D + 8B65-1C67 + + + Invincibiltiy after one hit until you enter a new screen + 82B6-C704 + + + Infinite health - P1 + 7EB03228 + + + Infintie health against some larger dinosaurs + 6DED-3A9D + + + One hit kills on some dinosaurs + D462-48DD + + + Regular Gun is super strong + 0D6A-106E + + + Start with less Machine Gun ammo + DEC0-397D + + + Start with more Shotgun ammo + 10C0-31ED + + + Start with less Tranquilizer Gun ammo + FDC9-315D + + + Start with more Tranquilizer Missiles + 10C1-307D + + + Flash longer after getting hit + EE30-1DAF + + + Don't flash after getting hit + DD30-1DAF + + + Velociraptor takes more damage + 4DC5-C67C + + + Infinite Machine Gun ammo + 7EA9B0FF + + + Infinite Shotgun ammo + 7EA9B2FF + + + Infinite Grenade Launcher + 7EA9B6FF + + + Infinite Dino stock + 7E000864 + + + Have Rifle + 7EB04000 + + + Have Machine Gun + 7EB04001 + + + Have Shotgun + 7EB04002 + + + Have Charge Gun + 7EB04003 + + + Have Tranquilizer Gun + 7EB04004 + + + Have Big Bomb Gun + 7EB04005 + + + Have Big Bomb Gun with Dinosaur icon + 7EB04007 + + + Have Needle Gun with clock icon + 7EB04008 + + + + Jurassic Park (USA) + + Infinite health + 7E02EB03 + + + Infinite lives + C26A-4700 + + + Infinite lives (alt) + 7E02A303 + + + Infinite ammo - all weapons + 7E028B20 + 7E029520 + 7E029F20 + + + Start with 2 lives + DF2E-3DD9 + + + Start with 4 lives + D72E-3DD9 + + + Cattle Prod energy recharges to about 3/4 full when outside + F682-CFAD + + + Cattle Prod energy recharges to about 1/2 full when outside + FD82-CFAD + + + Cattle Prod energy recharges to about 1/4 full when outside + D682-CFAD + + + Infinite Cattle Prod energy when outside + C285-C76D + + + Infinite 1st weapons when outside + C2CB-3407 + + + Infinite 2nd weapons when outside (except gas grenade) + 8289-4DAD + + + Cattle Prod energy recharges to 1/2 full when inside + EDEA-4767 + + + Infinite Cattle Prod energy when inside + C282-4B65 + + + Infinite 1st weapons when inside + 3CC4-3C65 + 3CCA-36D5 + + + Infinite 2nd weapons when inside (except gas grenade) + C2C6-3BD1 + + + Infinite continues with 4 lives + C2B8-C4D0 + + + Continue 1st time with 5 lives + D0BC-CDA0 + + + Continue with 5 lives after 1st continue + D0BC-C7D0 + + + Start with 1 egg needed + DF23-3469 + + + Generator on + 7E00F0EF + + + Have level 1 security card + 7E026501 + + + Have level 2 security card + 7E026701 + + + Have all 18 Eggs + 7E0E0F00 + 7E0E1000 + + + Have John Hammond ID Card + 7E025301 + + + Have Dr. Ellie Sattler ID Card + 7E025501 + + + Have Robert Muldoon ID Card + 7E025701 + + + Have Dr. Allen Grant ID Card + 7E025901 + + + Have Donald Gennaro ID Card + 7E025B01 + + + Have Ray Arnold ID Card + 7E025E01 + + + Have Dennis Nedry ID Card + 7E026001 + + + Have Dr. Henry Wu ID Card + 7E026101 + + + Have Dr. Ian Malcolm ID Card + 7E026301 + + + + Jurassic Park (USA) (Rev 1) + + Infinite health + 7E02EB03 + + + Infinite lives + C26A-4700 + + + Infinite lives (alt) + 7E02A303 + + + Infinite ammo - all weapons + 7E028B20 + 7E029520 + 7E029F20 + + + Start with 2 lives + DF2E-3DD9 + + + Start with 4 lives + D72E-3DD9 + + + Cattle Prod energy recharges to about 3/4 full when outside + F682-CFAD + + + Cattle Prod energy recharges to about 1/2 full when outside + FD82-CFAD + + + Cattle Prod energy recharges to about 1/4 full when outside + D682-CFAD + + + Infinite Cattle Prod energy when outside + C285-C76D + + + Infinite 1st weapons when outside + C2CB-3407 + + + Infinite 2nd weapons when outside (except gas grenade) + 8289-4DAD + + + Cattle Prod energy recharges to 1/2 full when inside + EDEA-4767 + + + Infinite Cattle Prod energy when inside + C282-4B65 + + + Infinite 1st weapons when inside + 3CC4-3C65 + 3CCA-36D5 + + + Infinite 2nd weapons when inside (except gas grenade) + C2C6-3BD1 + + + Infinite continues with 4 lives + C2B8-C4D0 + + + Continue 1st time with 5 lives + D0BC-CDA0 + + + Continue with 5 lives after 1st continue + D0BC-C7D0 + + + Start with 1 egg needed + DF23-3469 + + + Generator on + 7E00F0EF + + + Have level 1 security card + 7E026501 + + + Have level 2 security card + 7E026701 + + + Have all 18 Eggs + 7E0E0F00 + 7E0E1000 + + + Have John Hammond ID Card + 7E025301 + + + Have Dr. Ellie Sattler ID Card + 7E025501 + + + Have Robert Muldoon ID Card + 7E025701 + + + Have Dr. Allen Grant ID Card + 7E025901 + + + Have Donald Gennaro ID Card + 7E025B01 + + + Have Ray Arnold ID Card + 7E025E01 + + + Have Dennis Nedry ID Card + 7E026001 + + + Have Dr. Henry Wu ID Card + 7E026101 + + + Have Dr. Ian Malcolm ID Card + 7E026301 + + + + Kablooey (USA) + + Infinite lives + C261-0F0D + + + Start with 1 life instead of 5 + DF6B-D76D + + + Start with 3 lives + D76B-D76D + + + Start with 10 lives + DC6B-D76D + + + Start with 25 lives + FB6B-D76D + + + Start with 50 lives + 746B-D76D + + + Start with 75 lives + 086B-D76D + + + Start with 98 lives + 146B-D76D + + + Bonus timer doesn't count down + 3C27-6D0D + + + Level is completed after only 1 bomb goes off + BAC8-07D4 + + + Start on level 2 + BA25-07D7 + DF25-04D7 + + + Start on level 3 + BA25-07D7 + D425-04D7 + + + Start on level 4 + BA25-07D7 + D725-04D7 + + + Start on level 5 + BA25-07D7 + D025-04D7 + + + Start on level 6 + BA25-07D7 + D925-04D7 + + + Start on level 7 + BA25-07D7 + D125-04D7 + + + Start on level 8 + BA25-07D7 + D525-04D7 + + + Start on level 9 + BA25-07D7 + D625-04D7 + + + Start on level 10 + BA25-07D7 + DB25-04D7 + + + Start on level 11 + BA25-07D7 + DC25-04D7 + + + Start on level 12 + BA25-07D7 + D825-04D7 + + + Start on level 13 + BA25-07D7 + DA25-04D7 + + + Start on level 14 + BA25-07D7 + D225-04D7 + + + Start on level 15 + BA25-07D7 + D325-04D7 + + + Start on level 16 + BA25-07D7 + DE25-04D7 + + + Start on level 17 + BA25-07D7 + FD25-04D7 + + + Start on level 18 + BA25-07D7 + FF25-04D7 + + + Start on level 19 + BA25-07D7 + F425-04D7 + + + Start on level 20 + BA25-07D7 + F725-04D7 + + + Start on level 21 + BA25-07D7 + F025-04D7 + + + Start on level 22 + BA25-07D7 + F925-04D7 + + + Start on level 23 + BA25-07D7 + F125-04D7 + + + Start on level 24 + BA25-07D7 + F525-04D7 + + + Start on level 25 + BA25-07D7 + F625-04D7 + + + Start on level 26 + BA25-07D7 + FB25-04D7 + + + Start on level 27 + BA25-07D7 + FC25-04D7 + + + Start on level 28 + BA25-07D7 + F825-04D7 + + + Start on level 29 + BA25-07D7 + FA25-04D7 + + + Start on level 30 + BA25-07D7 + F225-04D7 + + + Start on level 31 + BA25-07D7 + F325-04D7 + + + Start on level 32 + BA25-07D7 + FE25-04D7 + + + Start on level 33 + BA25-07D7 + 4D25-04D7 + + + Start on level 34 + BA25-07D7 + 4F25-04D7 + + + Start on level 35 + BA25-07D7 + 4425-04D7 + + + Start on level 36 + BA25-07D7 + 4725-04D7 + + + Start on level 37 + BA25-07D7 + 4025-04D7 + + + Start on level 38 + BA25-07D7 + 4925-04D7 + + + Start on level 39 + BA25-07D7 + 4125-04D7 + + + Start on level 40 + BA25-07D7 + 4525-04D7 + + + Start on level 41 + BA25-07D7 + 4625-04D7 + + + Start on level 42 + BA25-07D7 + 4B25-04D7 + + + Start on level 43 + BA25-07D7 + 4C25-04D7 + + + Start on level 44 + BA25-07D7 + 4825-04D7 + + + Start on level 45 + BA25-07D7 + 4A25-04D7 + + + Start on level 46 + BA25-07D7 + 4225-04D7 + + + Start on level 47 + BA25-07D7 + 4325-04D7 + + + Start on level 48 + BA25-07D7 + 4E25-04D7 + + + Start on level 49 + BA25-07D7 + 7D25-04D7 + + + Start on level 50 + BA25-07D7 + 7F25-04D7 + + + Start on level 51 + BA25-07D7 + 7425-04D7 + + + Start on level 52 + BA25-07D7 + 7725-04D7 + + + Start on level 53 + BA25-07D7 + 7025-04D7 + + + Start on level 54 + BA25-07D7 + 7925-04D7 + + + Start on level 55 + BA25-07D7 + 7125-04D7 + + + Start on level 56 + BA25-07D7 + 7525-04D7 + + + Start on level 57 + BA25-07D7 + 7625-04D7 + + + Start on level 58 + BA25-07D7 + 7B25-04D7 + + + Start on level 59 + BA25-07D7 + 7C25-04D7 + + + Start on level 60 + BA25-07D7 + 7825-04D7 + + + Start on level 61 + BA25-07D7 + 7A25-04D7 + + + Start on level 62 + BA25-07D7 + 7225-04D7 + + + Start on level 63 + BA25-07D7 + 7325-04D7 + + + Start on level 64 + BA25-07D7 + 7E25-04D7 + + + Start on level 65 + BA25-07D7 + 0D25-04D7 + + + Start on level 66 + BA25-07D7 + 0F25-04D7 + + + Start on level 67 + BA25-07D7 + 0425-04D7 + + + Start on level 68 + BA25-07D7 + 0725-04D7 + + + Start on level 69 + BA25-07D7 + 0025-04D7 + + + Start on level 70 + BA25-07D7 + 0925-04D7 + + + Start on level 71 + BA25-07D7 + 0125-04D7 + + + Start on level 72 + BA25-07D7 + 0525-04D7 + + + Start on level 73 + BA25-07D7 + 0625-04D7 + + + Start on level 74 + BA25-07D7 + 0B25-04D7 + + + Start on level 75 + BA25-07D7 + 0C25-04D7 + + + Start on level 76 + BA25-07D7 + 0825-04D7 + + + Start on level 77 + BA25-07D7 + 0A25-04D7 + + + Start on level 78 + BA25-07D7 + 0225-04D7 + + + Start on level 79 + BA25-07D7 + 0325-04D7 + + + Start on level 80 + BA25-07D7 + 0E25-04D7 + + + Start on level 81 + BA25-07D7 + 9D25-04D7 + + + Start on level 82 + BA25-07D7 + 9F25-04D7 + + + Start on level 83 + BA25-07D7 + 9425-04D7 + + + Start on level 84 + BA25-07D7 + 9725-04D7 + + + Start on level 85 + BA25-07D7 + 9025-04D7 + + + Start on level 86 + BA25-07D7 + 9925-04D7 + + + Start on level 87 + BA25-07D7 + 9125-04D7 + + + Start on level 88 + BA25-07D7 + 9525-04D7 + + + Start on level 89 + BA25-07D7 + 9625-04D7 + + + Start on level 90 + BA25-07D7 + 9B25-04D7 + + + Start on level 91 + BA25-07D7 + 9C25-04D7 + + + Start on level 92 + BA25-07D7 + 9825-04D7 + + + Start on level 93 + BA25-07D7 + 9A25-04D7 + + + Start on level 94 + BA25-07D7 + 9225-04D7 + + + Start on level 95 + BA25-07D7 + 9325-04D7 + + + Start on level 96 + BA25-07D7 + 9E25-04D7 + + + Start on level 97 + BA25-07D7 + 1D25-04D7 + + + Start on level 98 + BA25-07D7 + 1F25-04D7 + + + Start on level 99 + BA25-07D7 + 1425-04D7 + + + Start on level 100 + BA25-07D7 + 1725-04D7 + + + Start on level 101 + BA25-07D7 + 1025-04D7 + + + Start on level 102 + BA25-07D7 + 1925-04D7 + + + Start on level 103 + BA25-07D7 + 1125-04D7 + + + Start on level 104 + BA25-07D7 + 1525-04D7 + + + Start on level 105 + BA25-07D7 + 1625-04D7 + + + Start on level 106 + BA25-07D7 + 1B25-04D7 + + + Start on level 107 + BA25-07D7 + 1C25-04D7 + + + Start on level 108 + BA25-07D7 + 1825-04D7 + + + Start on level 109 + BA25-07D7 + 1A25-04D7 + + + Start on level 110 + BA25-07D7 + 1225-04D7 + + + Start on level 111 + BA25-07D7 + 1325-04D7 + + + Start on level 112 + BA25-07D7 + 1E25-04D7 + + + Start on level 113 + BA25-07D7 + 5D25-04D7 + + + Start on level 114 + BA25-07D7 + 5F25-04D7 + + + Start on level 115 + BA25-07D7 + 5425-04D7 + + + Start on level 116 + BA25-07D7 + 5725-04D7 + + + Start on level 117 + BA25-07D7 + 5025-04D7 + + + Start on level 118 + BA25-07D7 + 5925-04D7 + + + Start on level 119 + BA25-07D7 + 5125-04D7 + + + Start on level 120 + BA25-07D7 + 5525-04D7 + + + Start on level 121 + BA25-07D7 + 5625-04D7 + + + Start on level 122 + BA25-07D7 + 5B25-04D7 + + + Start on level 123 + BA25-07D7 + 5C25-04D7 + + + Start on level 124 + BA25-07D7 + 5825-04D7 + + + Start on level 125 + BA25-07D7 + 5A25-04D7 + + + Start on level 126 + BA25-07D7 + 5225-04D7 + + + Start on level 127 + BA25-07D7 + 5325-04D7 + + + Start on level 128 + BA25-07D7 + 5E25-04D7 + + + Start on level 129 + BA25-07D7 + 6D25-04D7 + + + Start on level 130 + BA25-07D7 + 6F25-04D7 + + + + Kawasaki Caribbean Challenge (USA) + + Only 1 lap required to qualify instead of 2 + DF6F-64AD + + + Races are 1 lap instead of 5 + DF67-676D + + + Races are 2 laps + D467-676D + + + Races are 3 laps + D767-676D + + + Races are 4 laps + D067-676D + + + Coming in first is worth 9 points instead of 5 + DB82-0DD7 + + + Coming in last is worth 5 points instead of 0 + D982-0FD7 + + + Coming in last is worth 9 points + DB82-0FD7 + + + Always advance to the next island regardless of points + 6D80-DD04 + + + Each island requires 3 points instead of 5 + D7C2-0F04 + + + Each island requires 4 points + D0C2-0F04 + + + Each island requires 6 points + D1C2-0F04 + + + Each island requires 7 points + D5C2-0F04 + + + Opponents drive erratically - player is guaranteed 1st place + 6967-07AD + + + Start the Challenge with the 2nd motorcycle and jet ski + 6967-070D + + + + Ken Griffey Jr. Presents Major League Baseball (USA) + + 1 ball and you walk + DFC3-170F + + + 2 balls and you walk + D4C3-170F + + + Can't walk a player + CBB3-1D2D + + + 1 strike and you're out + DFCE-1F0F + + + 2 strikes and you're out + D4CE-1F0F + + + Can't strike out + C2BE-179D + + + Invisible baserunners + DF27-CFA4 + + + 2 outs and whole team is out + D4C3-170F + + + No outs except strike outs + C2A2-4D94 + C2AA-47B4 + + + Computer can't score + C28A-3FA7 + + + Computer can't score + CBB0-4797 + + + Computer can't score + C283-34D7 + + + + Kid Klown in Crazy Chase (USA) + + Infinite health + C229-1D67 + + + Infinite continues + C238-1F27 + + + + Killer Instinct (USA) + + Master code - must be entered + 3C61-D4DF + + + Infinite health - P1 + 7E0D2478 + 7E0D2678 + + + Infinite health - P2 + 7E0D2878 + 7E0D2A78 + + + No health - P1 + 7E0D2400 + 7E0D2600 + + + No health - P2 + 7E0D2800 + 7E0D2A00 + + + CPU cannot move from starting position + 7E0E0801 + + + Play as Eyedol + 7E024E0A + + + P1 takes all damage + EEC1-34AF + + + Always fight Jago + C265-1467 + 60E6-47D2 + + + Always fight Combo + C265-1467 + 6EE6-47D2 + + + Always fight Thunder + C265-1467 + 6BE6-47D2 + + + Always fight Glacius + C265-1467 + 6FE6-47D2 + + + Always fight Cinder + C265-1467 + 6DE6-47D2 + + + Always fight Orchid + C265-1467 + 64E6-47D2 + + + Always Fight Riptor + C265-1467 + B0E6-47D2 + + + Always fight Sabrewulf + C265-1467 + CBE6-4702 + + + Always fight Spinal + C265-1467 + CBEC-4702 + + + Always fight Fulgore + C265-1467 + CBE8-4D62 + + + Always fight Eyedol + C265-1467 + CBE8-4FA2 + + + + Killer Instinct (USA) (Rev 1) + + Infinite health - P1 + 7E0D2478 + 7E0D2678 + + + Infinite health - P2 + 7E0D2878 + 7E0D2A78 + + + No health - P1 + 7E0D2400 + 7E0D2600 + + + No health - P2 + 7E0D2800 + 7E0D2A00 + + + CPU cannot move from starting position + 7E0E0801 + + + Play as Eyedol + 7E024E0A + + + + King Arthur's World (USA) + + Start on training level 2 + F561-DD86 + + + Start on training level 3 + FB61-DD86 + + + Start on training level 4 + F161-DD86 + + + Start on training level 5 + F261-DD86 + + + Start on training level 6 + F361-DD86 + + + Start on training level 7 + FE61-DD86 + + + Start on training level 8 + 4D61-DD86 + + + Start on training level 9 + FC61-DD86 + + + Start on real world level 1 + DF61-DD86 + + + Start on real world level 2 + D461-DD86 + + + Start on real world level 3 + D761-DD86 + + + Start on real world level 4 + D061-DD86 + + + Start on goblin underworld level 1 + D961-DD86 + + + Start on goblin underworld level 2 + D161-DD86 + + + Start on goblin underworld level 3 + D561-DD86 + + + Start on goblin underworld level 4 + D661-DD86 + + + Start on cloud world level 1 + DA61-DD86 + + + Start on cloud world level 2 + D261-DD86 + + + Start on cloud world level 3 + D361-DD86 + + + Start on cloud world level 4 + DE61-DD86 + + + Start on cloud world level 5 + FD61-DD86 + + + Start on cloud world level 6 + FF61-DD86 + + + Start on cloud world level 7 + F461-DD86 + + + Unlimited men - if you have at least one of that type + 8EA8-642F + 8EAC-6F2F + + + Start with many men + CBEB-6405 + F0EB-6465 + DDEB-64A5 + + + Unlimited spells - must have at least one to use + 8EBC-6DEC + + + Start with 4 of each type of spell + C4EE-6D79 + 7DEE-6D59 + D4EE-6D89 + + + + King Arthur & The Knights of Justice (USA) + + Infinite health + 8B6B-14F4 + + + Infinite attack power + 33BD-14AF + 33B9-176F + + + Infinite healing herbs + C28A-4DAC + + + Start with 99 healing herbs + 14E6-37D4 + + + Start with 99 shield attacks + 14EB-3764 + + + + King of Dragons, The (USA) + + Invincibility + ED76-E4AF + + + Infinite energy + C9B5-7FDD + + + Infinite time + DD0E-EF0D + + + Infinite credits + CE05-8F0D + + + Start with level 6 Sword + 6351-E40D + 6955-EDDD + + + Start with level 6 Shield + 6355-E7AD + 6956-EF6D + + + + King of the Monsters (USA) + + Faster timer + F5AF-D5A1 + + + Slower timer + 1DAF-DFA1 + + + Start with less health - P1 + 6DB2-AF67 + + + Start with less health - P2 + 6DC4-D764 + + + 3 power points needed to get to next power level + D7A1-0DA1 + + + + Kirby's Avalanche (USA) + + Boulder warnings don't appear + 80A8-C4CD + + + Only red blobs fall + CB60-C737 + DD69-CD47 + DD69-CD17 + + + Only yellow blobs fall + CB60-C737 + DF69-CD47 + DF69-CD17 + + + Only green blobs fall + CB60-C737 + D769-CD47 + D769-CD17 + + + Only purple blobs fall + CB60-C737 + D069-CD47 + D069-CD17 + + + Only blue blobs fall + CB60-C737 + D969-CD47 + D969-CD17 + + + Only red and yellow blobs fall + CB60-C737 + DD69-CD47 + DF69-CD17 + + + Only red and green blobs fall + CB60-C737 + DD69-CD47 + D769-CD17 + + + Only red and purple blobs fall + CB60-C737 + DD69-CD47 + D069-CD17 + + + Only red and blue blobs fall + CB60-C737 + DD69-CD47 + D969-CD17 + + + Only red blobs with a boulder fall + CB60-C737 + DD69-CD47 + D169-CD17 + + + Only yellow and red blobs fall + CB60-C737 + DF69-CD47 + DD69-CD17 + + + Only yellow and green blobs fall + CB60-C737 + DF69-CD47 + D769-CD17 + + + Only yellow and purple blobs fall + CB60-C737 + DF69-CD47 + D069-CD17 + + + Only yellow and blue blobs fall + CB60-C737 + DF69-CD47 + D969-CD17 + + + Only yellow blobs with a boulder fall + CB60-C737 + DF69-CD47 + D169-CD17 + + + Only green and yellow blobs fall + CB60-C737 + D769-CD47 + DF69-CD17 + + + Only green and red blobs fall + CB60-C737 + D769-CD47 + DD69-CD17 + + + Only green and purple blobs fall + CB60-C737 + D769-CD47 + D069-CD17 + + + Only green and blue blobs fall + CB60-C737 + D769-CD47 + D969-CD17 + + + Only green blobs with a boulder fall + CB60-C737 + D769-CD47 + D169-CD17 + + + Only purple and yellow blobs fall + CB60-C737 + D069-CD47 + DF69-CD17 + + + Only purple and green blobs fall + CB60-C737 + D069-CD47 + D769-CD17 + + + Only purple and red blobs fall + CB60-C737 + D069-CD47 + DD69-CD17 + + + Only purple and blue blobs fall + CB60-C737 + D069-CD47 + D969-CD17 + + + Only purple blobs with a boulder fall + CB60-C737 + D069-CD47 + D169-CD17 + + + Only blue and yellow blobs fall + CB60-C737 + D969-CD47 + DF69-CD17 + + + Only blue and green blobs fall + CB60-C737 + D969-CD47 + D769-CD17 + + + Only blue and purple blobs fall + CB60-C737 + D969-CD47 + D069-CD17 + + + Only blue and red blobs fall + CB60-C737 + D969-CD47 + DD69-CD17 + + + Only blue blobs with a boulder fall + CB60-C737 + D969-CD47 + D169-CD17 + + + Only a boulder and yellow blobs fall + CB60-C737 + D169-CD47 + DF69-CD17 + + + Only a boulder and green blobs fall + CB60-C737 + D169-CD47 + D769-CD17 + + + Only a boulder and purple blobs fall + CB60-C737 + D169-CD47 + D069-CD17 + + + Only a boulder and blue blobs fall + CB60-C737 + D169-CD47 + D969-CD17 + + + Only a boulder and red blobs fall + CB60-C737 + D169-CD47 + DD69-CD17 + + + Only boulders fall + CB60-C737 + D169-CD47 + D169-CD17 + + + Disable the next box + CBB7-4D4D + 3CB7-4DCD + CBB7-4F1D + 3CB7-4F3D + + + + Kirby's Dream Course (USA) + + Start with 5 lives + D0A9-4F6D + + + Start with 7 lives + D1A9-4F6D + + + Start with 9 lives + D6A9-4F6D + + + Start with 1 strawberry + DFAD-1F0D + + + Start with 2 strawberries + D4AD-1F0D + + + Start with 3 strawberries + D7AD-1F0D + + + Infinite strawberries + 82CF-4D6E + + + Don't ever gain any strawberries + 82CD-4D0E + + + Don't lose a life from falling out of bounds + 82E2-4DD4 + + + + Kirby's Dream Land 3 (USA) + + Always have Invincibility (Kirby) + 4054B201 + + + Infinite life (Kirby) + 4039D10A + + + Infinite life (Partner) + 4039D308 + + + Infinite lives + 4039CF0A + + + Start a new game with 9 lives + DC85-64D4 + + + Start a new game with 25 lives + FC85-64D4 + + + Start a new game with 98 lives + 1785-64D4 + + + Infinite Mouth Shot + 4054ED02 + + + Always have No Mouth power + 4054A900 + + + Always have Fireball Mouth power + 4054A901 + + + Always have Stone Mouth power + 4054A902 + + + Always have Ice Mouth power + 4054A903 + + + Always have Needle Mouth power + 4054A904 + + + Always have Broom Mouth power + 4054A905 + + + Always have Parasol Mouth power + 4054A906 + + + Always have Spark Mouth power + 4054A907 + + + Always have Boomerang Mouth power + 4054A908 + + + Have all level 1 Stars + 4053A701 + 4053A801 + 4053A901 + 4053AA01 + 4053AB01 + 4053AC01 + + + Have all level 2 Stars + 4053AE01 + 4053AF01 + 4053B001 + 4053B101 + 4053B201 + 4053B301 + + + Have all level 3 Stars + 4053B501 + 4053B601 + 4053B701 + 4053B801 + 4053B901 + 4053BA01 + + + Have all level 4 Stars + 4053BC01 + 4053BD01 + 4053BE01 + 4053BF01 + 4053C001 + 4053C101 + + + + Kirby Super Star (USA) + + Always have invincibility + 3035F10A + + + Infinite health + 62E2-AD61 + + + Infinite health (friend) + 40137E30 + + + Infinite lives + C263-AF02 + + + + Knights of the Round (USA) + + Invincibility + ED2F-3FD9 + + + More invincibility time after successful block + EE2C-C7DC + + + Infinite energy + 8B29-4D65 + + + Almost infinite energy + 4029-4DD5 + 4022-1DD5 + + + Maximum energy from most food + DDAD-17BF + + + Infinite lives + 8B27-4F68 + + + Infinite time + C26C-47AF + + + Slower timer + 1D6B-47AF + + + Faster timer + F36B-47AF + + + No energy lost from special move + DD2A-3406 + + + Less energy lost from special move + D12A-3406 + + + More energy lost from special move + F02A-3406 + + + Super-jump - Arthur + DAC9-1DDB + + + Super-jump - Lancelot + DAC0-17DB + + + Super-jump - Percival + DAC9-1FDB + + + Start on stage 2 + 3C81-4461 + CB81-44A1 + DF81-47D1 + + + Start on stage 3 + 3C81-4461 + CB81-44A1 + D481-47D1 + + + Start on stage 4 + 3C81-4461 + CB81-44A1 + D781-47D1 + + + Start on stage 5 + 3C81-4461 + CB81-44A1 + D081-47D1 + + + Start on stage 6 + 3C81-4461 + CB81-44A1 + D981-47D1 + + + + Krusty's Super Fun House (USA) + + Invincibility - Krusty + 8725-0D64 + + + Infinite Custard Pies + C1E1-D7DD + + + Infinite Superballs + C1E2-D76D + + + Infinite lives + C265-0FA7 + + + Start with section 1 finished + DD65-67DF + 6D65-670F + D965-676F + + + Start with section 2 finished + DF65-67DF + 6D65-670F + D965-676F + + + Start with section 3 finished + D465-67DF + 6D65-670F + D965-676F + + + Start with section 4 finished + D765-67DF + 6D65-670F + D965-676F + + + Start with access to all sections + D065-67DF + 6D65-670F + D965-676F + + + Start with 1 life instead of 3 + DF6C-D704 + + + Start with 2 lives + D46C-D704 + + + Start with 5 lives + D96C-D704 + + + Start with 7 lives + D56C-D704 + + + Start with 9 lives + DB6C-D704 + + + Start with 0 Custard Pies + DD6B-D764 + + + Start with 2 Custard Pies + D46B-D764 + + + Start with 5 Custard Pies + D96B-D764 + + + Start with 2 Superballs instead of 10 Custard Pies + D46B-D764 + DF6C-DDA4 + + + Start with 5 Superballs + D96B-D764 + DF6C-DDA4 + + + Start with 10 Superballs + DF6C-DDA4 + + + Custard Pie bonus worth 2 pies instead of 10 + D43D-67D7 + + + Custard Pie bonus worth 5 pies + D93D-67D7 + + + Custard Pie bonus same as Superball bonus (disable is game freezes) + D03D-6767 + + + Superball bonus worth 2 balls instead of 5 (disable is game freezes) + D43F-6F67 + + + Superball bonus worth 10 balls (disable is game freezes) + DC3F-6F67 + + + Superball bonus same as Custard Pie bonus (disable is game freezes) + 6D3F-6DA7 + E03F-6FD7 + + + Food bonuses restore less strength + D53E-0407 + + + Food bonuses restore more strength + F33E-0407 + + + Food bonuses restore Krusty to full strength + 173E-0407 + + + Food bonuses also get Custard Pie bonus + D03D-6FD7 + + + Food bonuses also get Superball bonus + D33D-6FD7 + + + Doll bonus same as Custard Pie bonus + 3134-6D67 + 6D34-6D07 + + + Doll bonus same as Superball bonus + ED34-6D67 + 6D34-6D07 + + + Doll bonus same as food bonus + 2F34-6D67 + 6D34-6D07 + + + Jump higher - Krusty + FD3C-D704 + + + Jump much higher - Krusty + D63C-D704 + + + + Lagoon (USA) + + HP always recovers instantly + CBB0-0FA0 + EEB0-04D0 + + + MP always recovers instantly + CBB0-07A0 + EEB9-0DD0 + + + Save always available + 6D8A-6FA8 + F78A-64D8 + + + Pit death disabled + 1DA9-04D1 + + + Start with 612 gold + D42D-6D6C + + + Start with 1,380 gold + D92D-6D6C + + + Start with 2,148 gold + D62D-6D6C + + + Start with 8,292 gold + 4D2D-6D6C + + + Start with 22,116 gold + 912D-6D6C + + + Start with 65,380 gold + EE2D-6D6C + + + Get 100 gold pieces for each creature killed + 1BB5-D769 + 10B5-D7A9 + 3CB6-DDD9 + + + Get 1 gold piece for each creature killed + 1BB5-D769 + DFB5-D7A9 + 3CB6-DDD9 + + + Get 200 gold pieces for each creature killed + 1BB5-D769 + A6B5-D7A9 + 3CB6-DDD9 + + + Start on level 2, MP = 8/8, HP = 17/17, EXP = 0/40 + D422-040C + + + Start on level 3, MP = 10/10, HP = 23/23, EXP = 0/90 + D722-040C + + + Start on level 4, MP = 12/12, HP = 28/28, EXP = 0/170 + D022-040C + + + Start on level 5, MP = 19/19, HP =36/36, EXP = 0/280 + D922-040C + + + Start on level 241, HP = 255, MP = 255, EXP = 22859, walk at a regular speed + EF22-040C + + + Start on level 242, HP = 220, MP = 221, EXP = 30560, walk at a medium speed + E422-040C + + + Start with 0 strength + DD23-07DC + + + Start with 100 strength + 1023-07DC + + + Start with 255 strength + EE23-07DC + + + Start with 0 defense + DD2E-04AC + + + Start with 100 defense + 102E-04AC + + + Start with 255 defense + EE2E-04AC + + + Start with 999 defense + E12E-07DC + F52E-04AC + + + + Lamborghini - American Challenge (USA) + + Always finish first + 7E167E01 + + + Infinite money + 7E0D21FF + 7E0D22FF + + + Infinite Boost + 7E0DDD09 + + + Start with $128,000 + DD6E-440D + D96E-446D + + + Start with $88,000 + 5D6E-440D + D76E-446D + + + Start with $12,800 + 6D6E-440D + + + Repair 10% of car for $100 + C224-CF8F + + + Repair 10% of car for free + 3324-C45F + + + Free turbos + C22A-377D + + + Turbos for $1000 + DC28-348D + DD28-34ED + + + Turbos for $2000 + F028-348D + DD28-34ED + + + Start with 6-speed transmission + D169-443B + + + Don't take damage in races + 8B81-34D7 + + + + Last Action Hero (USA) + + Invincibility + 62AF-140D + + + Infinite health + C2A0-1D6D + + + Infinite time + C2BF-1FAF + + + Infinite lives + A2CB-4FAF + + + + Lawnmower Man, The (USA) + + Infinite lives + 40BE-1DAD + + + After you die, your main weapon is fully powered up from then on + D0B5-CDAD + CBB5-CD6D + + + Invincible in Cyber Run level + C268-17AC + + + Invincible in Cyber Tube level + C26A-CD6C + + + Invincible in Cyber Jobe level + C223-1DD5 + + + Invincible in Cyber Space level + C2A2-479C + + + Super-jump + ECB6-4FD7 + + + Energize icon effect is 2x longer + D785-376F + + + Energize icon effect is 4x longer + D985-376F + + + Bitstream powers up instantly (don't shoot too many bitstreams at once) + D1BB-4F64 + + + Keep weapon power ups once gained + DDB5-CDAD + + + Never lose homing bullets once gained + CEB7-CFAD + + + Never lose rear bullets once gained + CEB7-CDAD + + + + Legend of the Mystical Ninja, The (USA) + + Infinite health + 89CF-0729 + + + Infinite lives - top-view stages + 3CA6-A764 + + + Start with 6 lives + D927-A464 + + + Start with 9 lives + D627-A464 + + + Don't lose most weapons when hit + 40C0-04F9 + + + Die after one hit + DDCF-0429 + + + Pick-up more coins from enemies + 9DAF-DD6E + + + No coins used up when thrown + DDED-D4D4 + + + Faster timer + F0BE-AF20 + + + Slower timer + 1DBE-AF20 + + + + Legend of Zelda, The - A Link to the Past (USA) + + Invincibility + 1CDF-2EE6 + + + Infinite rupees + 35E1-2A76 + + + Infinite health and all heart containers + CDE1-2E56 + + + Almost infinite health + AE6E-DF2A + + + Infinite magic + 6DE1-2E86 + + + Almost infinite magic + AE8A-D4FA + AE8D-0D9A + + + Max heart containers + CDEE-DDBF + + + Infinite Bombs + AE67-0D30 + + + Infinite Bombs (alt) + 17E0-2AE6 + + + Bombs full + 7EF37501 + + + Infinite Arrows + 17E5-22E6 + + + Dash without having the Pegasus Boots + EEE5-2356 + + + Use the Magic Mirror to warp between the light and dark worlds freely + 6DC9-0D23 + + + Some shops don't take your money + AEEC-A586 + + + Infinite time for digging game in the dark world + 7E04B41E + + + Spin attack needs nearly no time to charge + D6B5-049E + + + Spin attack needs no time at all to charge + DDB5-049E + + + Enemies that normally drop items will drop them 100% of the time + DDE8-142C + + + Play chest game for free and able to open all chests + D738-1DA5 + + + Free chest game and can open all chests + D738-1DA5 + + + Always get Faerie at the Pond Of Happiness (as if you threw in 100 rupees) + 7EF36A64 + + + No enemies in dungeons + D9D7-9A78 + D9D7-9A58 + D9D7-9A88 + + + Dark rooms are fully lit + D7D9-F38B + + + Trigger doors are open (works with most dungeon doors, some that even look closed) + EED6-BE5B + + + Luck modifier - Great + 7E0CF901 + + + Luck modifier - Big Trouble + 7E0CF902 + + + Turn rain on + 7E001D01 + + + Turn rain off + 7E001D00 + + + Have 20 Heart Containers and infinite health + 7EF36DA0 + + + Have Blue Mail + 7EF35B02 + + + Have Bombos Medallion + DFE0-22E6 + + + Have Book Of Mudora + DFE0-2E86 + + + Have Boomerang + 7EF34101 + + + Have Bow + 7EF34001 + + + Have Bow with Arrows + 7EF34002 + + + Have Bow with Silver Arrows + 7EF34004 + + + Have Bug-Catching Net + DFE0-2E56 + + + Have Cane Of Byrna + DFE9-2A56 + + + Have Cane Of Somaria + DFE9-2A76 + + + Have Ether Medallion + DFE0-2376 + + + Have Fire Rod + DFE0-2256 + + + Have Flute + D4E0-2E76 + + + Have Flute with Duck + D7E0-2E76 + + + Have Golden Sword (level 4) + D0E9-2356 + + + Have Hookshot + DFE0-2A86 + + + Have Ice Rod + DFE0-2286 + + + Have Lamp + DFE0-2386 + + + Have Magic Boomerang + D4E0-2A56 + + + Have Magic Cape + DFE9-2A86 + + + Have Magic Hammer + DFE0-23E6 + + + Have Magic Mirror + D4E9-2AE6 + + + Have Magic Powder + D4E0-2276 + + + Have Mirror Shield + D7E9-2386 + + + Have Moon Pearl + DFE9-22E6 + + + Have Pegasus Boots + D4E9-2256 + + + Have Quake Medallion + DFE0-2356 + + + Have Red Mail + D4E9-23E6 + + + Have Shovel + DFE0-2E76 + + + Have Titan's Mitten + D4E9-2276 + + + Have Zora's Flippers + DFE9-2286 + + + Have 1/2 Magic curse + DFE5-23E6 + + + Have all abilities except Lift + 1EE5-2356 + + + Have all Lift abilities + D7E9-2276 + + + Have all Crystals + 7EF37A7F + + + Have all Pendants + 7EF37447 + + + Have Small Key In dungeons + 7EF36F09 + + + Have Big Key in dungeons + 7EF366FF + 7EF367FF + + + Have Compass in dungeons + 7EF365FF + + + Have all Maps, Compasses and Big Keys + EEE1-2276 + EEE1-2256 + EEE1-2286 + EEE1-22E6 + EEE1-2376 + EEE1-2356 + + + Have bottle 1 + 7EF35C02 + + + Have bottle 1 with infinite Mushrooms + 7EF35C01 + + + Have bottle 1 with infinite Red Medicine (life) + 7EF35C03 + + + Have bottle 1 with infinite Green Medicine (magic) + 7EF35C04 + + + Have bottle 1 with infinite Blue Medicine (cure all) + 7EF35C05 + + + Have bottle 1 with infinite Faeries + 7EF35C06 + + + Have bottle 1 with infinite Bees + 7EF35C07 + + + Have bottle 1 with infinite Good Bees + 7EF35C08 + + + Have bottle 2 + 7EF35D02 + + + Have bottle 2 with infinite Mushrooms + 7EF35D01 + + + Have bottle 2 with infinite Red Medicine (life) + 7EF35D03 + + + Have bottle 2 with infinite Green Medicine (magic) + 7EF35D04 + + + Have bottle 2 with infinite Blue Medicine (cure all) + 7EF35D05 + + + Have bottle 2 with infinite Faeries + 7EF35D06 + + + Have bottle 2 with infinite Bees + 7EF35D07 + + + Have bottle 2 with infinite Good Bees + 7EF35D08 + + + Have bottle 3 + 7EF35E02 + + + Have bottle 3 with infinite Mushrooms + 7EF35E01 + + + Have bottle 3 with infinite Red Medicine (life) + 7EF35E03 + + + Have bottle 3 with infinite Green Medicine (magic) + 7EF35E04 + + + Have bottle 3 with infinite Blue Medicine (cure all) + 7EF35E05 + + + Have bottle 3 with infinite Faeries + 7EF35E06 + + + Have bottle 3 with infinite Bees + 7EF35E07 + + + Have bottle 3 with infinite Good Bees + 7EF35E08 + + + Have bottle 4 + 7EF35F02 + + + Have bottle 4 with infinite Mushrooms + 7EF35F01 + + + Have bottle 4 with infinite Red Medicine (life) + 7EF35F03 + + + Have bottle 4 with infinite Green Medicine (magic) + 7EF35F04 + + + Have bottle 4 with infinite Blue Medicine (cure all) + 7EF35F05 + + + Have bottle 4 with infinite Faeries + 7EF35F06 + + + Have bottle 4 with infinite Bees + 7EF35F07 + + + Have bottle 4 with infinite Good Bees + 7EF35F08 + + + + Legend (USA) + + Invincibility + 62A6-3FAD + 29A6-34DD + F7A6-340D + + + Infinite health + C2EB-1709 + + + Infinite time + C23F-1DDD + + + Infinite lives + C289-1DD7 + + + + Lemmings (USA) (Rev 1) + + Have a lot of time + 7E0094FF + + + Open all 'Fun' levels + 7FFFC01E + + + Open all 'Tricky' levels + 7FFFC11E + + + Open all 'Taxing' levels + 7FFFC21E + + + Open all 'Mayhem' levels + 7FFFC31E + + + Open all 'SUNSOFT' levels + 7FFFC405 + + + Instantly win levels + 7E009100 + + + 0% Lemmings needed + 7E009200 + + + Have 99 Climbers left + 7E009563 + + + Have 99 Floaters left + 7E009663 + + + Have 99 Exploders left + 7E009763 + + + Have 99 Blockers left + 7E009863 + + + Have 99 Builders left + 7E009963 + + + Have 99 Bashers left + 7E009A63 + + + Have 99 Miners left + 7E009B63 + + + Have 99 Diggers left + 7E009C63 + + + Have 0 Lemmings left in level + 7E006900 + + + Have 0 Lemmings left to enter level + 7E006A00 + + + Always rescued 100% of Lemmings + 7E006B64 + + + Infinite climbers if you start with at least 1 + C984-A467 + + + Infinite floaters if you start with at least 1 + C98F-AD07 + + + Infinite bombers if you start with at least 1 + C987-A407 + + + Infinite blockers if you start with at least 1 + C984-6DA7 + + + Infinite builders if you start with at least 1 + C98E-6D07 + + + Infinite bashers if you start with at least 1 + C982-6FD7 + + + Infinite miners if you start with at least 1 + C981-67D7 + + + Infinite diggers if you start with at least 1 + C98B-64A7 + + + Each saved lemming counts as 2 + 31B6-6FAF + 18B6-64DF + + + Start on Level 2; rating: Fun + CBCC-DD05 + DFCC-DD65 + C9C8-0FD5 + + + Start on Level 3; rating: Fun + CBCC-DD05 + D4CC-DD65 + C9C8-0FD5 + + + Start on Level 4; rating: Fun + CBCC-DD05 + D7CC-DD65 + C9C8-0FD5 + + + Start on Level 5; rating: Fun + CBCC-DD05 + D0CC-DD65 + C9C8-0FD5 + + + Start on Level 6; rating: Fun + CBCC-DD05 + D9CC-DD65 + C9C8-0FD5 + + + Start on Level 7; rating: Fun + CBCC-DD05 + D1CC-DD65 + C9C8-0FD5 + + + Start on Level 8; rating: Fun + CBCC-DD05 + D5CC-DD65 + C9C8-0FD5 + + + Start on Level 9; rating: Fun + CBCC-DD05 + D6CC-DD65 + C9C8-0FD5 + + + Start on Level 10; rating: Fun + CBCC-DD05 + DBCC-DD65 + C9C8-0FD5 + + + Start on Level 11; rating: Fun + CBCC-DD05 + DCCC-DD65 + C9C8-0FD5 + + + Start on Level 12; rating: Fun + CBCC-DD05 + D8CC-DD65 + C9C8-0FD5 + + + Start on Level 13; rating: Fun + CBCC-DD05 + DACC-DD65 + C9C8-0FD5 + + + Start on Level 14; rating: Fun + CBCC-DD05 + D2CC-DD65 + C9C8-0FD5 + + + Start on Level 15; rating: Fun + CBCC-DD05 + D3CC-DD65 + C9C8-0FD5 + + + Start on Level 16; rating: Fun + CBCC-DD05 + DECC-DD65 + C9C8-0FD5 + + + Start on Level 17; rating: Fun + CBCC-DD05 + FDCC-DD65 + C9C8-0FD5 + + + Start on Level 18; rating: Fun + CBCC-DD05 + FFCC-DD65 + C9C8-0FD5 + + + Start on Level 19; rating: Fun + CBCC-DD05 + F4CC-DD65 + C9C8-0FD5 + + + Start on Level 20; rating: Fun + CBCC-DD05 + F7CC-DD65 + C9C8-0FD5 + + + Start on Level 21; rating: Fun + CBCC-DD05 + F0CC-DD65 + C9C8-0FD5 + + + Start on Level 22; rating: Fun + CBCC-DD05 + F9CC-DD65 + C9C8-0FD5 + + + Start on Level 23; rating: Fun + CBCC-DD05 + F1CC-DD65 + C9C8-0FD5 + + + Start on Level 24; rating: Fun + CBCC-DD05 + F5CC-DD65 + C9C8-0FD5 + + + Start on Level 25; rating: Fun + CBCC-DD05 + F6CC-DD65 + C9C8-0FD5 + + + Start on Level 26; rating: Fun + CBCC-DD05 + FBCC-DD65 + C9C8-0FD5 + + + Start on Level 27; rating: Fun + CBCC-DD05 + FCCC-DD65 + C9C8-0FD5 + + + Start on Level 28; rating: Fun + CBCC-DD05 + F8CC-DD65 + C9C8-0FD5 + + + Start on Level 29; rating: Fun + CBCC-DD05 + FACC-DD65 + C9C8-0FD5 + + + Start on Level 30; rating: Fun + CBCC-DD05 + F2CC-DD65 + C9C8-0FD5 + + + Start on Level 1; rating: Tricky + CBCC-DD05 + F3CC-DD65 + C9C8-0FD5 + + + Start on Level 2; rating: Tricky + CBCC-DD05 + FECC-DD65 + C9C8-0FD5 + + + Start on Level 3; rating: Tricky + CBCC-DD05 + 4DCC-DD65 + C9C8-0FD5 + + + Start on Level 4; rating: Tricky + CBCC-DD05 + 4FCC-DD65 + C9C8-0FD5 + + + Start on Level 5; rating: Tricky + CBCC-DD05 + 44CC-DD65 + C9C8-0FD5 + + + Start on Level 6; rating: Tricky + CBCC-DD05 + 47CC-DD65 + C9C8-0FD5 + + + Start on Level 7; rating: Tricky + CBCC-DD05 + 40CC-DD65 + C9C8-0FD5 + + + Start on Level 8; rating: Tricky + CBCC-DD05 + 49CC-DD65 + C9C8-0FD5 + + + Start on Level 9; rating: Tricky + CBCC-DD05 + 41CC-DD65 + C9C8-0FD5 + + + Start on Level 10; rating: Tricky + CBCC-DD05 + 45CC-DD65 + C9C8-0FD5 + + + Start on Level 11; rating: Tricky + CBCC-DD05 + 46CC-DD65 + C9C8-0FD5 + + + Start on Level 12; rating: Tricky + CBCC-DD05 + 4BCC-DD65 + C9C8-0FD5 + + + Start on Level 13; rating: Tricky + CBCC-DD05 + 4CCC-DD65 + C9C8-0FD5 + + + Start on Level 14; rating: Tricky + CBCC-DD05 + 48CC-DD65 + C9C8-0FD5 + + + Start on Level 15; rating: Tricky + CBCC-DD05 + 4ACC-DD65 + C9C8-0FD5 + + + Start on Level 16; rating: Tricky + CBCC-DD05 + 42CC-DD65 + C9C8-0FD5 + + + Start on Level 17; rating: Tricky + CBCC-DD05 + 43CC-DD65 + C9C8-0FD5 + + + Start on Level 18; rating: Tricky + CBCC-DD05 + 4ECC-DD65 + C9C8-0FD5 + + + Start on Level 19; rating: Tricky + CBCC-DD05 + 7DCC-DD65 + C9C8-0FD5 + + + Start on Level 20; rating: Tricky + CBCC-DD05 + 7FCC-DD65 + C9C8-0FD5 + + + Start on Level 21; rating: Tricky + CBCC-DD05 + 74CC-DD65 + C9C8-0FD5 + + + Start on Level 22; rating: Tricky + CBCC-DD05 + 77CC-DD65 + C9C8-0FD5 + + + Start on Level 23; rating: Tricky + CBCC-DD05 + 70CC-DD65 + C9C8-0FD5 + + + Start on Level 24; rating: Tricky + CBCC-DD05 + 79CC-DD65 + C9C8-0FD5 + + + Start on Level 25; rating: Tricky + CBCC-DD05 + 71CC-DD65 + C9C8-0FD5 + + + Start on Level 26; rating: Tricky + CBCC-DD05 + 75CC-DD65 + C9C8-0FD5 + + + Start on Level 27; rating: Tricky + CBCC-DD05 + 76CC-DD65 + C9C8-0FD5 + + + Start on Level 28; rating: Tricky + CBCC-DD05 + 7BCC-DD65 + C9C8-0FD5 + + + Start on Level 29; rating: Tricky + CBCC-DD05 + 7CCC-DD65 + C9C8-0FD5 + + + Start on Level 30; rating: Tricky + CBCC-DD05 + 78CC-DD65 + C9C8-0FD5 + + + Start on Level 1; rating: Taxing + CBCC-DD05 + 7ACC-DD65 + C9C8-0FD5 + + + Start on Level 2; rating: Taxing + CBCC-DD05 + 72CC-DD65 + C9C8-0FD5 + + + Start on Level 3; rating: Taxing + CBCC-DD05 + 73CC-DD65 + C9C8-0FD5 + + + Start on Level 4; rating: Taxing + CBCC-DD05 + 7ECC-DD65 + C9C8-0FD5 + + + Start on Level 5; rating: Taxing + CBCC-DD05 + 0DCC-DD65 + C9C8-0FD5 + + + Start on Level 6; rating: Taxing + CBCC-DD05 + 0FCC-DD65 + C9C8-0FD5 + + + Start on Level 7; rating: Taxing + CBCC-DD05 + 04CC-DD65 + C9C8-0FD5 + + + Start on Level 8; rating: Taxing + CBCC-DD05 + 07CC-DD65 + C9C8-0FD5 + + + Start on Level 9; rating: Taxing + CBCC-DD05 + 00CC-DD65 + C9C8-0FD5 + + + Start on Level 10; rating: Taxing + CBCC-DD05 + 09CC-DD65 + C9C8-0FD5 + + + Start on Level 11; rating: Taxing + CBCC-DD05 + 01CC-DD65 + C9C8-0FD5 + + + Start on Level 12; rating: Taxing + CBCC-DD05 + 05CC-DD65 + C9C8-0FD5 + + + Start on Level 13; rating: Taxing + CBCC-DD05 + 06CC-DD65 + C9C8-0FD5 + + + Start on Level 14; rating: Taxing + CBCC-DD05 + 0BCC-DD65 + C9C8-0FD5 + + + Start on Level 15; rating: Taxing + CBCC-DD05 + 0CCC-DD65 + C9C8-0FD5 + + + Start on Level 16; rating: Taxing + CBCC-DD05 + 08CC-DD65 + C9C8-0FD5 + + + Start on Level 17; rating: Taxing + CBCC-DD05 + 0ACC-DD65 + C9C8-0FD5 + + + Start on Level 18; rating: Taxing + CBCC-DD05 + 02CC-DD65 + C9C8-0FD5 + + + Start on Level 19; rating: Taxing + CBCC-DD05 + 03CC-DD65 + C9C8-0FD5 + + + Start on Level 20; rating: Taxing + CBCC-DD05 + 0ECC-DD65 + C9C8-0FD5 + + + Start on Level 21; rating: Taxing + CBCC-DD05 + 9DCC-DD65 + C9C8-0FD5 + + + Start on Level 22; rating: Taxing + CBCC-DD05 + 9FCC-DD65 + C9C8-0FD5 + + + Start on Level 23; rating: Taxing + CBCC-DD05 + 94CC-DD65 + C9C8-0FD5 + + + Start on Level 24; rating: Taxing + CBCC-DD05 + 97CC-DD65 + C9C8-0FD5 + + + Start on Level 25; rating: Taxing + CBCC-DD05 + 90CC-DD65 + C9C8-0FD5 + + + Start on Level 26; rating: Taxing + CBCC-DD05 + 99CC-DD65 + C9C8-0FD5 + + + Start on Level 27; rating: Taxing + CBCC-DD05 + 91CC-DD65 + C9C8-0FD5 + + + Start on Level 28; rating: Taxing + CBCC-DD05 + 95CC-DD65 + C9C8-0FD5 + + + Start on Level 29; rating: Taxing + CBCC-DD05 + 96CC-DD65 + C9C8-0FD5 + + + Start on Level 30; rating: Taxing + CBCC-DD05 + 9BCC-DD65 + C9C8-0FD5 + + + Start on Level 1; rating: Mayhem + CBCC-DD05 + 9CCC-DD65 + C9C8-0FD5 + + + Start on Level 2; rating: Mayhem + CBCC-DD05 + 98CC-DD65 + C9C8-0FD5 + + + Start on Level 3; rating: Mayhem + CBCC-DD05 + 9ACC-DD65 + C9C8-0FD5 + + + Start on Level 4; rating: Mayhem + CBCC-DD05 + 92CC-DD65 + C9C8-0FD5 + + + Start on Level 5; rating: Mayhem + CBCC-DD05 + 93CC-DD65 + C9C8-0FD5 + + + Start on Level 6; rating: Mayhem + CBCC-DD05 + 9ECC-DD65 + C9C8-0FD5 + + + Start on Level 7; rating: Mayhem + CBCC-DD05 + 1DCC-DD65 + C9C8-0FD5 + + + Start on Level 8; rating: Mayhem + CBCC-DD05 + 1FCC-DD65 + C9C8-0FD5 + + + Start on Level 9; rating: Mayhem + CBCC-DD05 + 14CC-DD65 + C9C8-0FD5 + + + Start on Level 10; rating: Mayhem + CBCC-DD05 + 17CC-DD65 + C9C8-0FD5 + + + Start on Level 11; rating: Mayhem + CBCC-DD05 + 10CC-DD65 + C9C8-0FD5 + + + Start on Level 12; rating: Mayhem + CBCC-DD05 + 19CC-DD65 + C9C8-0FD5 + + + Start on Level 13; rating: Mayhem + CBCC-DD05 + 11CC-DD65 + C9C8-0FD5 + + + Start on Level 14; rating: Mayhem + CBCC-DD05 + 15CC-DD65 + C9C8-0FD5 + + + Start on Level 15; rating: Mayhem + CBCC-DD05 + 16CC-DD65 + C9C8-0FD5 + + + Start on Level 16; rating: Mayhem + CBCC-DD05 + 1BCC-DD65 + C9C8-0FD5 + + + Start on Level 17; rating: Mayhem + CBCC-DD05 + 1CCC-DD65 + C9C8-0FD5 + + + Start on Level 18; rating: Mayhem + CBCC-DD05 + 18CC-DD65 + C9C8-0FD5 + + + Start on Level 19; rating: Mayhem + CBCC-DD05 + 1ACC-DD65 + C9C8-0FD5 + + + Start on Level 20; rating: Mayhem + CBCC-DD05 + 12CC-DD65 + C9C8-0FD5 + + + Start on Level 21; rating: Mayhem + CBCC-DD05 + 13CC-DD65 + C9C8-0FD5 + + + Start on Level 22; rating: Mayhem + CBCC-DD05 + 1ECC-DD65 + C9C8-0FD5 + + + Start on Level 23; rating: Mayhem + CBCC-DD05 + 5DCC-DD65 + C9C8-0FD5 + + + Start on Level 24; rating: Mayhem + CBCC-DD05 + 5FCC-DD65 + C9C8-0FD5 + + + Start on Level 25; rating: Mayhem + CBCC-DD05 + 54CC-DD65 + C9C8-0FD5 + + + Start on Level 26; rating: Mayhem + CBCC-DD05 + 57CC-DD65 + C9C8-0FD5 + + + Start on Level 27; rating: Mayhem + CBCC-DD05 + 50CC-DD65 + C9C8-0FD5 + + + Start on Level 28; rating: Mayhem + CBCC-DD05 + 59CC-DD65 + C9C8-0FD5 + + + Start on Level 29; rating: Mayhem + CBCC-DD05 + 51CC-DD65 + C9C8-0FD5 + + + Start on Level 30; rating: Mayhem + CBCC-DD05 + 55CC-DD65 + C9C8-0FD5 + + + Start on Level 1; rating: Sunsoft + CBCC-DD05 + 56CC-DD65 + C9C8-0FD5 + + + Start on Level 2; rating: Sunsoft + CBCC-DD05 + 5BCC-DD65 + C9C8-0FD5 + + + Start on Level 3; rating: Sunsoft + CBCC-DD05 + 5CCC-DD65 + C9C8-0FD5 + + + Start on Level 4; rating: Sunsoft + CBCC-DD05 + 58CC-DD65 + C9C8-0FD5 + + + Start on Level 5; rating: Sunsoft + CBCC-DD05 + 5ACC-DD65 + C9C8-0FD5 + + + + Lester the Unlikely (USA) + + Infinite health + 7E859B03 + + + Infinite health against most enemies + C2C2-8DEB + + + Infinite lives + C2C6-7F58 + + + Flashing lasts a long time after getting hit + D0C2-848B + + + Flashing lasts a really long time after getting hit + DAC2-848B + + + Lighter gravity effect (disable right after pressing start, don't enable until first game play screen) + 0DCA-5D5B + + + Even lighter gravity effect + 49CA-5D5B + + + Amazingly lighter gravity effect + F9CA-5D5B + + + + Lethal Enforcers (USA) + + Invincibility + 7E00B207 + + + Infinite ammo + 3CCE-C4AB + + + Infinite ammo for all guns + 7E1FC006 + + + No damage from bad guys + 3CB5-140C + + + No energy loss when you hit civilians + 3CB2-446C + + + 1/2 your energy is lost when you hit civilians + 3CB2-446C + + + Play with more energy + F365-CF64 + F362-CD64 + + + Keep weapon until you die + 6DBF-1FAC + + + Magnum - more shots per round + DAA3-4F60 + + + Normal gun - more shots per round + DAA3-4D60 + + + Shotgun - more shots per round + DAA3-4460 + + + Have Grenade Launcher + 7E1FBC02 + + + Have Magnum + 7E1FBC04 + + + Have Shotgun + 7E1FBC06 + + + Have Automatic + 7E1FBC08 + + + Have Glock 45 + 7E1FBC0A + + + + Lethal Weapon (USA) + + Infinite ammo + DD8D-D7A4 + + + Infinite ammo (alt) + 7E021E07 + + + Infinite health + 4ABE-AFD7 + + + Infinite health (alt) + 7E022606 + + + Infinite time + C285-670F + + + Infinite time (alt) + 7E0D2899 + 7E0D2909 + + + More bullets in magazine + DB8F-DF64 + + + 2 magazines on pick-up + D4CA-A7AF + + + 4 magazines on pick-up + D0CA-A7AF + + + Start with more magazine clips + DB6A-AF6F + + + Start with fewer magazine clips + DF6A-AF6F + + + Slower timer + 148B-6F0F + + + Faster timer + FE8B-6F0F + + + Start with more badges + D162-A7DF + + + Start with fewer badges + DD62-A7DF + + + Super-jump (can get stuck) + 3CBD-04DF + + + + Lion King, The (USA) + + Roaring doesn't decrease your roar meter + C291-5763 + + + Roar meter doesn't fill up with time + C289-5D6F + + + Don't lose roar power when you get hit + C293-E703 + + + Almost infinite energy + C298-7DDE + + + Infinite lives + CE6E-8464 + + + + Lufia II - Rise of the Sinistrals (USA) + + Infinite 999 MP in and out of battle + EEEE-44D9 + + + Level 99 after one battle + 6EEB-17A1 + + + Level 83 after one battle + EEEB-17A1 + + + Gain 35,000 gold after a battle + EEED-4F05 + + + Enemies always miss + EEE5-4FD5 + + + One hit kills + EEE7-44D5 + + + + Lufia & The Fortress of Doom (USA) + + Move around caves and world map quicker (except when leaving a vehicle) + 4DB4-D401 + + + Infinite HP (hit points) + 8236-0F34 + + + Infinite magic points in battle mode + 823A-0FC4 + + + No HP lost when walking over swamp ground + DDB8-6FD9 + + + More HP lost when walking over swamp ground + D0B8-6FD9 + + + Cheap bombs - 1 gold each + DF30-A718 + + + Cheap smokeballs - 1 gold each + DF3C-0D18 + + + Immune to all petrifying effects (stone, poison, confused, etc.) + 6D8F-0DC4 + + + Shopkeepers don't charge for purchases - some shops only + 95A8-67A4 + + + More agility points from speed potion + FD34-0448 + + + More intelligence points from mind potion + FD30-0438 + + + More strength points from great potion + FD31-07C8 + + + Higher max level of magic points from spell potion + FD3D-0F18 + + + Higher max level of hit points from power potion + FD33-DDC8 + + + No random battles + 7E149E00 + + + 99 of item in slot 1 + 7E14F863 + + + 99 of item in slot 2 + 7E14FA63 + + + 99 of item in slot 3 + 7E14FC63 + + + Slot 1 - Nothing + 7E14F700 + + + Slot 1 - Knife + 7E14F701 + + + Slot 1 - Club + 7E14F702 + + + Slot 1 - Mace + 7E14F703 + + + Slot 1 - Dagger + 7E14F704 + + + Slot 1 - Long Knife + 7E14F705 + + + Slot 1 - Short Sword + 7E14F706 + + + Slot 1 - Rod + 7E14F707 + + + Slot 1 - Gladius + 7E14F708 + + + Slot 1 - Glass Robe + 7E14F709 + + + Slot 1 - Brone Sword + 7E14F70A + + + Slot 1 - Staff + 7E14F70B + + + Slot 1 - Scimitar + 7E14F70C + + + Slot 1 - Rapier + 7E14F70D + + + Slot 1 - Long Sword + 7E14F70E + + + Slot 1 - Long Staff + 7E14F70F + + + Slot 1 - Axe + 7E14F710 + + + Slot 1 - Spear + 7E14F711 + + + Slot 1 - Morning Star + 7E14F712 + + + Slot 1 - Catwhip + 7E14F713 + + + Slot 1 - Battle Axe + 7E14F714 + + + Slot 1 - Hammer Rod + 7E14F715 + + + Slot 1 - Trident + 7E14F716 + + + Slot 1 - Silver Rod + 7E14F717 + + + Slot 1 - Silver Sword + 7E14F718 + + + Slot 1 - Buster Sword + 7E14F719 + + + Slot 1 - Zircon Rod + 7E14F71A + + + Slot 1 - Great Axe + 7E14F71B + + + Slot 1 - Great Blade + 7E14F71C + + + Slot 1 - Zircon Axe + 7E14F71D + + + Slot 1 - Zircon Sword + 7E14F71E + + + Slot 1 - Broad Sword + 7E14F71F + + + Slot 1 - Broad Rod + 7E14F720 + + + Slot 1 - Luck Blade + 7E14F721 + + + Slot 1 - Gloom Pick + 7E14F722 + + + Slot 1 - Dual Blade + 7E14F723 + + + Slot 1 - Dress + 7E14F724 + + + Slot 1 - Cloth + 7E14F725 + + + Slot 1 - Cloth Armor + 7E14F726 + + + Slot 1 - Robe + 7E14F727 + + + Slot 1 - Tan Armor + 7E14F728 + + + Slot 1 - Tan Robe + 7E14F729 + + + Slot 1 - Light Armor + 7E14F72A + + + Slot 1 - Light Robe + 7E14F72B + + + Slot 1 - Chain Mail + 7E14F72C + + + Slot 1 - Chain Cloth + 7E14F72D + + + Slot 1 - Plate Cloth + 7E14F72E + + + Slot 1 - Brone Armor + 7E14F72F + + + Slot 1 - Quilted Silk + 7E14F730 + + + Slot 1 - Half Mail + 7E14F731 + + + Slot 1 - Brone Robe + 7E14F732 + + + Slot 1 - Silver Armor + 7E14F733 + + + Slot 1 - Silver Robe + 7E14F734 + + + Slot 1 - Plate Mail + 7E14F735 + + + Slot 1 - Zircon Robe + 7E14F736 + + + Slot 1 - Zircon Armor + 7E14F737 + + + Slot 1 - Clear Silk + 7E14F738 + + + Slot 1 - Bracelet + 7E14F739 + + + Slot 1 - Tan Shield + 7E14F73A + + + Slot 1 - Wood Shield + 7E14F73B + + + Slot 1 - Buckler + 7E14F73C + + + Slot 1 - Wood Wrist + 7E14F73D + + + Slot 1 - Kite Shield + 7E14F73E + + + Slot 1 - Round Shield + 7E14F73F + + + Slot 1 - Round Wrist + 7E14F740 + + + Slot 1 - Brone Shield + 7E14F741 + + + Slot 1 - Tower Shield + 7E14F742 + + + Slot 1 - Large Shield + 7E14F743 + + + Slot 1 - Silver Wrist + 7E14F744 + + + Slot 1 - Silver Plate + 7E14F745 + + + Slot 1 - Zircon Wrist + 7E14F746 + + + Slot 1 - Zircon Plate + 7E14F747 + + + Slot 1 - Cloth Helm + 7E14F748 + + + Slot 1 - Tan Helm + 7E14F749 + + + Slot 1 - Hair Band + 7E14F74A + + + Slot 1 - Wood Helm + 7E14F74B + + + Slot 1 - Glass Cap + 7E14F74C + + + Slot 1 - Brone Helm + 7E14F74D + + + Slot 1 - Red Beret + 7E14F74E + + + Slot 1 - Iron Helm + 7E14F74F + + + Slot 1 - Plate Cap + 7E14F750 + + + Slot 1 - Plate Helm + 7E14F751 + + + Slot 1 - Glass Beret + 7E14F752 + + + Slot 1 - Silver Helm + 7E14F753 + + + Slot 1 - Sakret + 7E14F754 + + + Slot 1 - Zircon Beret + 7E14F755 + + + Slot 1 - Zircon Helm + 7E14F756 + + + Slot 1 - Sandal + 7E14F757 + + + Slot 1 - Cloth Shoes + 7E14F758 + + + Slot 1 - Tan Shoes + 7E14F759 + + + Slot 1 - Spike Shoes + 7E14F75A + + + Slot 1 - Heeled Shoes + 7E14F75B + + + Slot 1 - Wind Shoes + 7E14F75C + + + Slot 1 - Wind Heels + 7E14F75D + + + Slot 1 - Knife Shoes + 7E14F75E + + + Slot 1 - Needle Heels + 7E14F75F + + + Slot 1 - Sonic Shoes + 7E14F760 + + + Slot 1 - Sonic Heels + 7E14F761 + + + Slot 1 - Sword Shoes + 7E14F762 + + + Slot 1 - Cat Heels + 7E14F763 + + + Slot 1 - Mach Shoes + 7E14F764 + + + Slot 1 - Mach Heels + 7E14F765 + + + Slot 1 - Power Ring + 7E14F766 + + + Slot 1 - HiPower Ring + 7E14F767 + + + Slot 1 - Daze Ring + 7E14F768 + + + Slot 1 - Hi Daze Ring + 7E14F769 + + + Slot 1 - Mind Ring + 7E14F76A + + + Slot 1 - Sonic Ring + 7E14F76B + + + Slot 1 - Mach Ring + 7E14F76C + + + Slot 1 - Undead Ring + 7E14F76D + + + Slot 1 - Ghost Ring + 7E14F76E + + + Slot 1 - Dragon Ring + 7E14F76F + + + Slot 1 - Sea Ring + 7E14F770 + + + Slot 1 - Fly Ring + 7E14F771 + + + Slot 1 - Water Ring + 7E14F772 + + + Slot 1 - Fire Ring + 7E14F773 + + + Slot 1 - Ice Ring + 7E14F774 + + + Slot 1 - Electro Ring + 7E14F775 + + + Slot 1 - Flash Ring + 7E14F776 + + + Slot 1 - Flame Ring + 7E14F777 + + + Slot 1 - Water Ring + 7E14F778 + + + Slot 1 - Blast Ring + 7E14F779 + + + Slot 1 - Frost Ring + 7E14F77A + + + Slot 1 - Might Armor + 7E14F77B + + + Slot 1 - Might Shield + 7E14F77C + + + Slot 1 - Might Helmet + 7E14F77D + + + Slot 1 - Gloom Ring + 7E14F77E + + + Slot 1 - Gloom Voice + 7E14F77F + + + Slot 1 - Dummy (?) + 7E14F780 + + + Slot 1 - Brone Breast + 7E14F781 + + + Slot 1 - Carbo Sword + 7E14F782 + + + Slot 1 - Carbo Plate + 7E14F783 + + + Slot 1 - Carbo Shield + 7E14F784 + + + Slot 1 - Carbo Helm + 7E14F785 + + + Slot 1 - Carbo Cap + 7E14F786 + + + Slot 1 - Gloom Guard + 7E14F787 + + + Slot 1 - Diamond Ring + 7E14F788 + + + Slot 1 - Engage Ring + 7E14F789 + + + Slot 1 - Monster Ring + 7E14F78A + + + Slot 1 - Blue Ring + 7E14F78B + + + Slot 1 - Yellow Ring + 7E14F78C + + + Slot 1 - Red Ring + 7E14F78D + + + Slot 1 - Purple Ring + 7E14F78E + + + Slot 1 - Green Ring + 7E14F78F + + + Slot 1 - White Ring + 7E14F790 + + + Slot 1 - Black Ring + 7E14F791 + + + Slot 1 - Heavy Ring + 7E14F792 + + + Slot 1 - Wave Ring + 7E14F793 + + + Slot 1 - Potion + 7E14F794 + + + Slot 1 - Hi Potion + 7E14F795 + + + Slot 1 - Ex Potion + 7E14F796 + + + Slot 1 - Hi Magic + 7E14F797 + + + Slot 1 - Ex Magic + 7E14F798 + + + Slot 1 - Antidote + 7E14F799 + + + Slot 1 - Sweet Water + 7E14F79A + + + Slot 1 - Foul Water + 7E14F79B + + + Slot 1 - Awaken + 7E14F79C + + + Slot 1 - Stone Cure + 7E14F79D + + + Slot 1 - Mystery Pin + 7E14F79E + + + Slot 1 - Shriek + 7E14F79F + + + Slot 1 - Swing Wing + 7E14F7A0 + + + Slot 1 - Magic Guard + 7E14F7A1 + + + Slot 1 - Power Gourd + 7E14F7A2 + + + Slot 1 - Mind Gourd + 7E14F7A3 + + + Slot 1 - Power Potion + 7E14F7A4 + + + Slot 1 - Spell Potion + 7E14F7A5 + + + Slot 1 - Speed Potion + 7E14F7A6 + + + Slot 1 - Mind Potion + 7E14F7A7 + + + Slot 1 - Great Potion + 7E14F7A8 + + + Slot 1 - Float + 7E14F7A9 + + + Slot 1 - Smoke Ball + 7E14F7AA + + + Slot 1 - Arrow + 7E14F7AB + + + Slot 1 - Mid Arrow + 7E14F7AC + + + Slot 1 - Big Arrow + 7E14F7AD + + + Slot 1 - Arrows + 7E14F7AE + + + Slot 1 - Hi Arrows + 7E14F7AF + + + Slot 1 - Ex Arrows + 7E14F7B0 + + + Slot 1 - Dragon Arrow + 7E14F7B1 + + + Slot 1 - Sleep Arrow + 7E14F7B2 + + + Slot 1 - Puzzle Arrow + 7E14F7B3 + + + Slot 1 - Stun Arrow + 7E14F7B4 + + + Slot 1 - Gloom Arrow + 7E14F7B5 + + + Slot 1 - Bomb + 7E14F7B6 + + + Slot 1 - Hi Bomb + 7E14F7B7 + + + Slot 1 - Ex Bomb + 7E14F7B8 + + + Slot 1 - Miracle + 7E14F7B9 + + + Slot 1 - Revive + 7E14F7BA + + + Slot 1 - Pear Cider + 7E14F7BB + + + Slot 1 - Sour Cider + 7E14F7BC + + + Slot 1 - Lime Cider + 7E14F7BD + + + Slot 1 - Plum Cider + 7E14F7BE + + + Slot 1 - Apple Cider + 7E14F7BF + + + Slot 1 - Hair Band + 7E14F7C0 + + + Slot 1 - Brooch + 7E14F7C1 + + + Slot 1 - Earring + 7E14F7C2 + + + Slot 1 - Necklace + 7E14F7C3 + + + Slot 1 - Stuffed Bear + 7E14F7C4 + + + Slot 1 - Stuffed Dog + 7E14F7C5 + + + Slot 1 - Stuffed Pig + 7E14F7C6 + + + Slot 1 - Emerald + 7E14F7C7 + + + Slot 1 - Opal + 7E14F7C8 + + + Slot 1 - Goblet + 7E14F7C9 + + + Slot 1 - Ear Tip + 7E14F7CA + + + Slot 1 - Empty Bottle + 7E14F7CB + + + Slot 1 - Gown + 7E14F7CC + + + Slot 1 - Ribbon + 7E14F7CD + + + Slot 1 - Fry Pan + 7E14F7CE + + + Slot 1 - Small Knife + 7E14F7CF + + + Slot 1 - Pot + 7E14F7D0 + + + Slot 1 - Chop Block + 7E14F7D1 + + + Slot 1 - Apron + 7E14F7D2 + + + Slot 1 - Dragon Egg + 7E14F7D3 + + + Slot 1 - Crown + 7E14F7D4 + + + Slot 1 - Secret Map + 7E14F7D5 + + + Slot 1 - Miracle Gem + 7E14F7D6 + + + Slot 1 - Silver Wick + 7E14F7D7 + + + Slot 1 - Royal Statue + 7E14F7D8 + + + Slot 1 - Silver Tarot + 7E14F7D9 + + + Slot 1 - Golden Pawn + 7E14F7DA + + + Slot 1 - Crown Jewels + 7E14F7DB + + + Slot 1 - Wind Flute + 7E14F7DC + + + Slot 1 - Escape + 7E14F7DD + + + Slot 1 - Magic Jar + 7E14F7DE + + + Slot 1 - Dragon Tooth + 7E14F7DF + + + Slot 1 - Grilled Newt + 7E14F7E0 + + + Slot 1 - Poison Pin + 7E14F7E1 + + + Slot 1 - Might Sword + 7E14F7E2 + + + Slot 1 - Straw Doll + 7E14F7E3 + + + Slot 1 - Long Nail + 7E14F7E4 + + + Slot 1 - Bomb + 7E14F7E5 + + + Slot 1 - Alumina + 7E14F7E6 + + + Slot 1 - Power Oil + 7E14F7E7 + + + Slot 1 - Elven Bow + 7E14F7E8 + + + Slot 1 - Artea's Bow + 7E14F7E9 + + + Slot 1 - Might Bow + 7E14F7EA + + + Slot 1 - Dummy (?) + 7E14F7EB + + + Slot 1 - Dummy (?) + 7E14F7EC + + + Slot 1 - Dummy (?) + 7E14F7ED + + + Slot 1 - Dummy (?) + 7E14F7EE + + + Slot 1 - Free Door + 7E14F7EF + + + Slot 1 - Sheran Key + 7E14F7F0 + + + Slot 1 - Letter + 7E14F7F1 + + + Slot 1 - Dais Key + 7E14F7F2 + + + Slot 1 - Shrine Key + 7E14F7F3 + + + Slot 1 - Pirate Key + 7E14F7F4 + + + Slot 1 - Light Key + 7E14F7F5 + + + Slot 1 - Oil Key + 7E14F7F6 + + + Slot 1 - Green Jade + 7E14F7F7 + + + Slot 1 - Red Sapphire + 7E14F7F8 + + + Slot 1 - Blue Jade + 7E14F7F9 + + + Slot 1 - Purple Newt + 7E14F7FA + + + Slot 1 - Glasdar Key + 7E14F7FB + + + Slot 1 - Magic Flavor + 7E14F7FC + + + Slot 1 - Fairy Kiss + 7E14F7FD + + + Slot 2 - Nothing + 7E14F900 + + + Slot 2 - Knife + 7E14F901 + + + Slot 2 - Club + 7E14F902 + + + Slot 2 - Mace + 7E14F903 + + + Slot 2 - Dagger + 7E14F904 + + + Slot 2 - Long Knife + 7E14F905 + + + Slot 2 - Short Sword + 7E14F906 + + + Slot 2 - Rod + 7E14F907 + + + Slot 2 - Gladius + 7E14F908 + + + Slot 2 - Glass Robe + 7E14F909 + + + Slot 2 - Brone Sword + 7E14F90A + + + Slot 2 - Staff + 7E14F90B + + + Slot 2 - Scimitar + 7E14F90C + + + Slot 2 - Rapier + 7E14F90D + + + Slot 2 - Long Sword + 7E14F90E + + + Slot 2 - Long Staff + 7E14F90F + + + Slot 2 - Axe + 7E14F910 + + + Slot 2 - Spear + 7E14F911 + + + Slot 2 - Morning Star + 7E14F912 + + + Slot 2 - Catwhip + 7E14F913 + + + Slot 2 - Battle Axe + 7E14F914 + + + Slot 2 - Hammer Rod + 7E14F915 + + + Slot 2 - Trident + 7E14F916 + + + Slot 2 - Silver Rod + 7E14F917 + + + Slot 2 - Silver Sword + 7E14F918 + + + Slot 2 - Buster Sword + 7E14F919 + + + Slot 2 - Zircon Rod + 7E14F91A + + + Slot 2 - Great Axe + 7E14F91B + + + Slot 2 - Great Blade + 7E14F91C + + + Slot 2 - Zircon Axe + 7E14F91D + + + Slot 2 - Zircon Sword + 7E14F91E + + + Slot 2 - Broad Sword + 7E14F91F + + + Slot 2 - Broad Rod + 7E14F920 + + + Slot 2 - Luck Blade + 7E14F921 + + + Slot 2 - Gloom Pick + 7E14F922 + + + Slot 2 - Dual Blade + 7E14F923 + + + Slot 2 - Dress + 7E14F924 + + + Slot 2 - Cloth + 7E14F925 + + + Slot 2 - Cloth Armor + 7E14F926 + + + Slot 2 - Robe + 7E14F927 + + + Slot 2 - Tan Armor + 7E14F928 + + + Slot 2 - Tan Robe + 7E14F929 + + + Slot 2 - Light Armor + 7E14F92A + + + Slot 2 - Light Robe + 7E14F92B + + + Slot 2 - Chain Mail + 7E14F92C + + + Slot 2 - Chain Cloth + 7E14F92D + + + Slot 2 - Plate Cloth + 7E14F92E + + + Slot 2 - Brone Armor + 7E14F92F + + + Slot 2 - Quilted Silk + 7E14F930 + + + Slot 2 - Half Mail + 7E14F931 + + + Slot 2 - Brone Robe + 7E14F932 + + + Slot 2 - Silver Armor + 7E14F933 + + + Slot 2 - Silver Robe + 7E14F934 + + + Slot 2 - Plate Mail + 7E14F935 + + + Slot 2 - Zircon Robe + 7E14F936 + + + Slot 2 - Zircon Armor + 7E14F937 + + + Slot 2 - Clear Silk + 7E14F938 + + + Slot 2 - Bracelet + 7E14F939 + + + Slot 2 - Tan Shield + 7E14F93A + + + Slot 2 - Wood Shield + 7E14F93B + + + Slot 2 - Buckler + 7E14F93C + + + Slot 2 - Wood Wrist + 7E14F93D + + + Slot 2 - Kite Shield + 7E14F93E + + + Slot 2 - Round Shield + 7E14F93F + + + Slot 2 - Round Wrist + 7E14F940 + + + Slot 2 - Brone Shield + 7E14F941 + + + Slot 2 - Tower Shield + 7E14F942 + + + Slot 2 - Large Shield + 7E14F943 + + + Slot 2 - Silver Wrist + 7E14F944 + + + Slot 2 - Silver Plate + 7E14F945 + + + Slot 2 - Zircon Wrist + 7E14F946 + + + Slot 2 - Zircon Plate + 7E14F947 + + + Slot 2 - Cloth Helm + 7E14F948 + + + Slot 2 - Tan Helm + 7E14F949 + + + Slot 2 - Hair Band + 7E14F94A + + + Slot 2 - Wood Helm + 7E14F94B + + + Slot 2 - Glass Cap + 7E14F94C + + + Slot 2 - Brone Helm + 7E14F94D + + + Slot 2 - Red Beret + 7E14F94E + + + Slot 2 - Iron Helm + 7E14F94F + + + Slot 2 - Plate Cap + 7E14F950 + + + Slot 2 - Plate Helm + 7E14F951 + + + Slot 2 - Glass Beret + 7E14F952 + + + Slot 2 - Silver Helm + 7E14F953 + + + Slot 2 - Sakret + 7E14F954 + + + Slot 2 - Zircon Beret + 7E14F955 + + + Slot 2 - Zircon Helm + 7E14F956 + + + Slot 2 - Sandal + 7E14F957 + + + Slot 2 - Cloth Shoes + 7E14F958 + + + Slot 2 - Tan Shoes + 7E14F959 + + + Slot 2 - Spike Shoes + 7E14F95A + + + Slot 2 - Heeled Shoes + 7E14F95B + + + Slot 2 - Wind Shoes + 7E14F95C + + + Slot 2 - Wind Heels + 7E14F95D + + + Slot 2 - Knife Shoes + 7E14F95E + + + Slot 2 - Needle Heels + 7E14F95F + + + Slot 2 - Sonic Shoes + 7E14F960 + + + Slot 2 - Sonic Heels + 7E14F961 + + + Slot 2 - Sword Shoes + 7E14F962 + + + Slot 2 - Cat Heels + 7E14F963 + + + Slot 2 - Mach Shoes + 7E14F964 + + + Slot 2 - Mach Heels + 7E14F965 + + + Slot 2 - Power Ring + 7E14F966 + + + Slot 2 - HiPower Ring + 7E14F967 + + + Slot 2 - Daze Ring + 7E14F968 + + + Slot 2 - Hi Daze Ring + 7E14F969 + + + Slot 2 - Mind Ring + 7E14F96A + + + Slot 2 - Sonic Ring + 7E14F96B + + + Slot 2 - Mach Ring + 7E14F96C + + + Slot 2 - Undead Ring + 7E14F96D + + + Slot 2 - Ghost Ring + 7E14F96E + + + Slot 2 - Dragon Ring + 7E14F96F + + + Slot 2 - Sea Ring + 7E14F970 + + + Slot 2 - Fly Ring + 7E14F971 + + + Slot 2 - Water Ring + 7E14F972 + + + Slot 2 - Fire Ring + 7E14F973 + + + Slot 2 - Ice Ring + 7E14F974 + + + Slot 2 - Electro Ring + 7E14F975 + + + Slot 2 - Flash Ring + 7E14F976 + + + Slot 2 - Flame Ring + 7E14F977 + + + Slot 2 - Water Ring + 7E14F978 + + + Slot 2 - Blast Ring + 7E14F979 + + + Slot 2 - Frost Ring + 7E14F97A + + + Slot 2 - Might Armor + 7E14F97B + + + Slot 2 - Might Shield + 7E14F97C + + + Slot 2 - Might Helmet + 7E14F97D + + + Slot 2 - Gloom Ring + 7E14F97E + + + Slot 2 - Gloom Voice + 7E14F97F + + + Slot 2 - Dummy (?) + 7E14F980 + + + Slot 2 - Brone Breast + 7E14F981 + + + Slot 2 - Carbo Sword + 7E14F982 + + + Slot 2 - Carbo Plate + 7E14F983 + + + Slot 2 - Carbo Shield + 7E14F984 + + + Slot 2 - Carbo Helm + 7E14F985 + + + Slot 2 - Carbo Cap + 7E14F986 + + + Slot 2 - Gloom Guard + 7E14F987 + + + Slot 2 - Diamond Ring + 7E14F988 + + + Slot 2 - Engage Ring + 7E14F989 + + + Slot 2 - Monster Ring + 7E14F98A + + + Slot 2 - Blue Ring + 7E14F98B + + + Slot 2 - Yellow Ring + 7E14F98C + + + Slot 2 - Red Ring + 7E14F98D + + + Slot 2 - Purple Ring + 7E14F98E + + + Slot 2 - Green Ring + 7E14F98F + + + Slot 2 - White Ring + 7E14F990 + + + Slot 2 - Black Ring + 7E14F991 + + + Slot 2 - Heavy Ring + 7E14F992 + + + Slot 2 - Wave Ring + 7E14F993 + + + Slot 2 - Potion + 7E14F994 + + + Slot 2 - Hi Potion + 7E14F995 + + + Slot 2 - Ex Potion + 7E14F996 + + + Slot 2 - Hi Magic + 7E14F997 + + + Slot 2 - Ex Magic + 7E14F998 + + + Slot 2 - Antidote + 7E14F999 + + + Slot 2 - Sweet Water + 7E14F99A + + + Slot 2 - Foul Water + 7E14F99B + + + Slot 2 - Awaken + 7E14F99C + + + Slot 2 - Stone Cure + 7E14F99D + + + Slot 2 - Mystery Pin + 7E14F99E + + + Slot 2 - Shriek + 7E14F99F + + + Slot 2 - Swing Wing + 7E14F9A0 + + + Slot 2 - Magic Guard + 7E14F9A1 + + + Slot 2 - Power Gourd + 7E14F9A2 + + + Slot 2 - Mind Gourd + 7E14F9A3 + + + Slot 2 - Power Potion + 7E14F9A4 + + + Slot 2 - Spell Potion + 7E14F9A5 + + + Slot 2 - Speed Potion + 7E14F9A6 + + + Slot 2 - Mind Potion + 7E14F9A7 + + + Slot 2 - Great Potion + 7E14F9A8 + + + Slot 2 - Float + 7E14F9A9 + + + Slot 2 - Smoke Ball + 7E14F9AA + + + Slot 2 - Arrow + 7E14F9AB + + + Slot 2 - Mid Arrow + 7E14F9AC + + + Slot 2 - Big Arrow + 7E14F9AD + + + Slot 2 - Arrows + 7E14F9AE + + + Slot 2 - Hi Arrows + 7E14F9AF + + + Slot 2 - Ex Arrows + 7E14F9B0 + + + Slot 2 - Dragon Arrow + 7E14F9B1 + + + Slot 2 - Sleep Arrow + 7E14F9B2 + + + Slot 2 - Puzzle Arrow + 7E14F9B3 + + + Slot 2 - Stun Arrow + 7E14F9B4 + + + Slot 2 - Gloom Arrow + 7E14F9B5 + + + Slot 2 - Bomb + 7E14F9B6 + + + Slot 2 - Hi Bomb + 7E14F9B7 + + + Slot 2 - Ex Bomb + 7E14F9B8 + + + Slot 2 - Miracle + 7E14F9B9 + + + Slot 2 - Revive + 7E14F9BA + + + Slot 2 - Pear Cider + 7E14F9BB + + + Slot 2 - Sour Cider + 7E14F9BC + + + Slot 2 - Lime Cider + 7E14F9BD + + + Slot 2 - Plum Cider + 7E14F9BE + + + Slot 2 - Apple Cider + 7E14F9BF + + + Slot 2 - Hair Band + 7E14F9C0 + + + Slot 2 - Brooch + 7E14F9C1 + + + Slot 2 - Earring + 7E14F9C2 + + + Slot 2 - Necklace + 7E14F9C3 + + + Slot 2 - Stuffed Bear + 7E14F9C4 + + + Slot 2 - Stuffed Dog + 7E14F9C5 + + + Slot 2 - Stuffed Pig + 7E14F9C6 + + + Slot 2 - Emerald + 7E14F9C7 + + + Slot 2 - Opal + 7E14F9C8 + + + Slot 2 - Goblet + 7E14F9C9 + + + Slot 2 - Ear Tip + 7E14F9CA + + + Slot 2 - Empty Bottle + 7E14F9CB + + + Slot 2 - Gown + 7E14F9CC + + + Slot 2 - Ribbon + 7E14F9CD + + + Slot 2 - Fry Pan + 7E14F9CE + + + Slot 2 - Small Knife + 7E14F9CF + + + Slot 2 - Pot + 7E14F9D0 + + + Slot 2 - Chop Block + 7E14F9D1 + + + Slot 2 - Apron + 7E14F9D2 + + + Slot 2 - Dragon Egg + 7E14F9D3 + + + Slot 2 - Crown + 7E14F9D4 + + + Slot 2 - Secret Map + 7E14F9D5 + + + Slot 2 - Miracle Gem + 7E14F9D6 + + + Slot 2 - Silver Wick + 7E14F9D7 + + + Slot 2 - Royal Statue + 7E14F9D8 + + + Slot 2 - Silver Tarot + 7E14F9D9 + + + Slot 2 - Golden Pawn + 7E14F9DA + + + Slot 2 - Crown Jewels + 7E14F9DB + + + Slot 2 - Wind Flute + 7E14F9DC + + + Slot 2 - Escape + 7E14F9DD + + + Slot 2 - Magic Jar + 7E14F9DE + + + Slot 2 - Dragon Tooth + 7E14F9DF + + + Slot 2 - Grilled Newt + 7E14F9E0 + + + Slot 2 - Poison Pin + 7E14F9E1 + + + Slot 2 - Might Sword + 7E14F9E2 + + + Slot 2 - Straw Doll + 7E14F9E3 + + + Slot 2 - Long Nail + 7E14F9E4 + + + Slot 2 - Bomb + 7E14F9E5 + + + Slot 2 - Alumina + 7E14F9E6 + + + Slot 2 - Power Oil + 7E14F9E7 + + + Slot 2 - Elven Bow + 7E14F9E8 + + + Slot 2 - Artea's Bow + 7E14F9E9 + + + Slot 2 - Might Bow + 7E14F9EA + + + Slot 2 - Dummy (?) + 7E14F9EB + + + Slot 2 - Dummy (?) + 7E14F9EC + + + Slot 2 - Dummy (?) + 7E14F9ED + + + Slot 2 - Dummy (?) + 7E14F9EE + + + Slot 2 - Free Door + 7E14F9EF + + + Slot 2 - Sheran Key + 7E14F9F0 + + + Slot 2 - Letter + 7E14F9F1 + + + Slot 2 - Dais Key + 7E14F9F2 + + + Slot 2 - Shrine Key + 7E14F9F3 + + + Slot 2 - Pirate Key + 7E14F9F4 + + + Slot 2 - Light Key + 7E14F9F5 + + + Slot 2 - Oil Key + 7E14F9F6 + + + Slot 2 - Green Jade + 7E14F9F9 + + + Slot 2 - Red Sapphire + 7E14F9F8 + + + Slot 2 - Blue Jade + 7E14F9F9 + + + Slot 2 - Purple Newt + 7E14F9FA + + + Slot 2 - Glasdar Key + 7E14F9FB + + + Slot 2 - Magic Flavor + 7E14F9FC + + + Slot 2 - Fairy Kiss + 7E14F9FD + + + Slot 3 - Nothing + 7E14FB00 + + + Slot 3 - Knife + 7E14FB01 + + + Slot 3 - Club + 7E14FB02 + + + Slot 3 - Mace + 7E14FB03 + + + Slot 3 - Dagger + 7E14FB04 + + + Slot 3 - Long Knife + 7E14FB05 + + + Slot 3 - Short Sword + 7E14FB06 + + + Slot 3 - Rod + 7E14FB07 + + + Slot 3 - Gladius + 7E14FB08 + + + Slot 3 - Glass Robe + 7E14FB09 + + + Slot 3 - Brone Sword + 7E14FB0A + + + Slot 3 - Staff + 7E14FB0B + + + Slot 3 - Scimitar + 7E14FB0C + + + Slot 3 - Rapier + 7E14FB0D + + + Slot 3 - Long Sword + 7E14FB0E + + + Slot 3 - Long Staff + 7E14FB0F + + + Slot 3 - Axe + 7E14FB10 + + + Slot 3 - Spear + 7E14FB11 + + + Slot 3 - Morning Star + 7E14FB12 + + + Slot 3 - Catwhip + 7E14FB13 + + + Slot 3 - Battle Axe + 7E14FB14 + + + Slot 3 - Hammer Rod + 7E14FB15 + + + Slot 3 - Trident + 7E14FB16 + + + Slot 3 - Silver Rod + 7E14FB17 + + + Slot 3 - Silver Sword + 7E14FB18 + + + Slot 3 - Buster Sword + 7E14FB19 + + + Slot 3 - Zircon Rod + 7E14FB1A + + + Slot 3 - Great Axe + 7E14FB1B + + + Slot 3 - Great Blade + 7E14FB1C + + + Slot 3 - Zircon Axe + 7E14FB1D + + + Slot 3 - Zircon Sword + 7E14FB1E + + + Slot 3 - Broad Sword + 7E14FB1F + + + Slot 3 - Broad Rod + 7E14FB20 + + + Slot 3 - Luck Blade + 7E14FB21 + + + Slot 3 - Gloom Pick + 7E14FB22 + + + Slot 3 - Dual Blade + 7E14FB23 + + + Slot 3 - Dress + 7E14FB24 + + + Slot 3 - Cloth + 7E14FB25 + + + Slot 3 - Cloth Armor + 7E14FB26 + + + Slot 3 - Robe + 7E14FB27 + + + Slot 3 - Tan Armor + 7E14FB28 + + + Slot 3 - Tan Robe + 7E14FB29 + + + Slot 3 - Light Armor + 7E14FB2A + + + Slot 3 - Light Robe + 7E14FB2B + + + Slot 3 - Chain Mail + 7E14FB2C + + + Slot 3 - Chain Cloth + 7E14FB2D + + + Slot 3 - Plate Cloth + 7E14FB2E + + + Slot 3 - Brone Armor + 7E14FB2F + + + Slot 3 - Quilted Silk + 7E14FB30 + + + Slot 3 - Half Mail + 7E14FB31 + + + Slot 3 - Brone Robe + 7E14FB32 + + + Slot 3 - Silver Armor + 7E14FB33 + + + Slot 3 - Silver Robe + 7E14FB34 + + + Slot 3 - Plate Mail + 7E14FB35 + + + Slot 3 - Zircon Robe + 7E14FB36 + + + Slot 3 - Zircon Armor + 7E14FB37 + + + Slot 3 - Clear Silk + 7E14FB38 + + + Slot 3 - Bracelet + 7E14FB39 + + + Slot 3 - Tan Shield + 7E14FB3A + + + Slot 3 - Wood Shield + 7E14FB3B + + + Slot 3 - Buckler + 7E14FB3C + + + Slot 3 - Wood Wrist + 7E14FB3D + + + Slot 3 - Kite Shield + 7E14FB3E + + + Slot 3 - Round Shield + 7E14FB3F + + + Slot 3 - Round Wrist + 7E14FB40 + + + Slot 3 - Brone Shield + 7E14FB41 + + + Slot 3 - Tower Shield + 7E14FB42 + + + Slot 3 - Large Shield + 7E14FB43 + + + Slot 3 - Silver Wrist + 7E14FB44 + + + Slot 3 - Silver Plate + 7E14FB45 + + + Slot 3 - Zircon Wrist + 7E14FB46 + + + Slot 3 - Zircon Plate + 7E14FB47 + + + Slot 3 - Cloth Helm + 7E14FB48 + + + Slot 3 - Tan Helm + 7E14FB49 + + + Slot 3 - Hair Band + 7E14FB4A + + + Slot 3 - Wood Helm + 7E14FB4B + + + Slot 3 - Glass Cap + 7E14FB4C + + + Slot 3 - Brone Helm + 7E14FB4D + + + Slot 3 - Red Beret + 7E14FB4E + + + Slot 3 - Iron Helm + 7E14FB4F + + + Slot 3 - Plate Cap + 7E14FB50 + + + Slot 3 - Plate Helm + 7E14FB51 + + + Slot 3 - Glass Beret + 7E14FB52 + + + Slot 3 - Silver Helm + 7E14FB53 + + + Slot 3 - Sakret + 7E14FB54 + + + Slot 3 - Zircon Beret + 7E14FB55 + + + Slot 3 - Zircon Helm + 7E14FB56 + + + Slot 3 - Sandal + 7E14FB57 + + + Slot 3 - Cloth Shoes + 7E14FB58 + + + Slot 3 - Tan Shoes + 7E14FB59 + + + Slot 3 - Spike Shoes + 7E14FB5A + + + Slot 3 - Heeled Shoes + 7E14FB5B + + + Slot 3 - Wind Shoes + 7E14FB5C + + + Slot 3 - Wind Heels + 7E14FB5D + + + Slot 3 - Knife Shoes + 7E14FB5E + + + Slot 3 - Needle Heels + 7E14FB5F + + + Slot 3 - Sonic Shoes + 7E14FB60 + + + Slot 3 - Sonic Heels + 7E14FB61 + + + Slot 3 - Sword Shoes + 7E14FB62 + + + Slot 3 - Cat Heels + 7E14FB63 + + + Slot 3 - Mach Shoes + 7E14FB64 + + + Slot 3 - Mach Heels + 7E14FB65 + + + Slot 3 - Power Ring + 7E14FB66 + + + Slot 3 - HiPower Ring + 7E14FB67 + + + Slot 3 - Daze Ring + 7E14FB68 + + + Slot 3 - Hi Daze Ring + 7E14FB69 + + + Slot 3 - Mind Ring + 7E14FB6A + + + Slot 3 - Sonic Ring + 7E14FB6B + + + Slot 3 - Mach Ring + 7E14FB6C + + + Slot 3 - Undead Ring + 7E14FB6D + + + Slot 3 - Ghost Ring + 7E14FB6E + + + Slot 3 - Dragon Ring + 7E14FB6F + + + Slot 3 - Sea Ring + 7E14FB70 + + + Slot 3 - Fly Ring + 7E14FB71 + + + Slot 3 - Water Ring + 7E14FB72 + + + Slot 3 - Fire Ring + 7E14FB73 + + + Slot 3 - Ice Ring + 7E14FB74 + + + Slot 3 - Electro Ring + 7E14FB75 + + + Slot 3 - Flash Ring + 7E14FB76 + + + Slot 3 - Flame Ring + 7E14FB77 + + + Slot 3 - Water Ring + 7E14FB78 + + + Slot 3 - Blast Ring + 7E14FB79 + + + Slot 3 - Frost Ring + 7E14FB7A + + + Slot 3 - Might Armor + 7E14FB7B + + + Slot 3 - Might Shield + 7E14FB7C + + + Slot 3 - Might Helmet + 7E14FB7D + + + Slot 3 - Gloom Ring + 7E14FB7E + + + Slot 3 - Gloom Voice + 7E14FB7F + + + Slot 3 - Dummy (?) + 7E14FB80 + + + Slot 3 - Brone Breast + 7E14FB81 + + + Slot 3 - Carbo Sword + 7E14FB82 + + + Slot 3 - Carbo Plate + 7E14FB83 + + + Slot 3 - Carbo Shield + 7E14FB84 + + + Slot 3 - Carbo Helm + 7E14FB85 + + + Slot 3 - Carbo Cap + 7E14FB86 + + + Slot 3 - Gloom Guard + 7E14FB87 + + + Slot 3 - Diamond Ring + 7E14FB88 + + + Slot 3 - Engage Ring + 7E14FB89 + + + Slot 3 - Monster Ring + 7E14FB8A + + + Slot 3 - Blue Ring + 7E14FB8B + + + Slot 3 - Yellow Ring + 7E14FB8C + + + Slot 3 - Red Ring + 7E14FB8D + + + Slot 3 - Purple Ring + 7E14FB8E + + + Slot 3 - Green Ring + 7E14FB8F + + + Slot 3 - White Ring + 7E14FB90 + + + Slot 3 - Black Ring + 7E14FB91 + + + Slot 3 - Heavy Ring + 7E14FB92 + + + Slot 3 - Wave Ring + 7E14FB93 + + + Slot 3 - Potion + 7E14FB94 + + + Slot 3 - Hi Potion + 7E14FB95 + + + Slot 3 - Ex Potion + 7E14FB96 + + + Slot 3 - Hi Magic + 7E14FB97 + + + Slot 3 - Ex Magic + 7E14FB98 + + + Slot 3 - Antidote + 7E14FB99 + + + Slot 3 - Sweet Water + 7E14FB9A + + + Slot 3 - Foul Water + 7E14FB9B + + + Slot 3 - Awaken + 7E14FB9C + + + Slot 3 - Stone Cure + 7E14FB9D + + + Slot 3 - Mystery Pin + 7E14FB9E + + + Slot 3 - Shriek + 7E14FB9F + + + Slot 3 - Swing Wing + 7E14FBA0 + + + Slot 3 - Magic Guard + 7E14FBA1 + + + Slot 3 - Power Gourd + 7E14FBA2 + + + Slot 3 - Mind Gourd + 7E14FBA3 + + + Slot 3 - Power Potion + 7E14FBA4 + + + Slot 3 - Spell Potion + 7E14FBA5 + + + Slot 3 - Speed Potion + 7E14FBA6 + + + Slot 3 - Mind Potion + 7E14FBA7 + + + Slot 3 - Great Potion + 7E14FBA8 + + + Slot 3 - Float + 7E14FBA9 + + + Slot 3 - Smoke Ball + 7E14FBAA + + + Slot 3 - Arrow + 7E14FBAB + + + Slot 3 - Mid Arrow + 7E14FBAC + + + Slot 3 - Big Arrow + 7E14FBAD + + + Slot 3 - Arrows + 7E14FBAE + + + Slot 3 - Hi Arrows + 7E14FBAF + + + Slot 3 - Ex Arrows + 7E14FBB0 + + + Slot 3 - Dragon Arrow + 7E14FBB1 + + + Slot 3 - Sleep Arrow + 7E14FBB2 + + + Slot 3 - Puzzle Arrow + 7E14FBB3 + + + Slot 3 - Stun Arrow + 7E14FBB4 + + + Slot 3 - Gloom Arrow + 7E14FBB5 + + + Slot 3 - Bomb + 7E14FBB6 + + + Slot 3 - Hi Bomb + 7E14FBB7 + + + Slot 3 - Ex Bomb + 7E14FBB8 + + + Slot 3 - Miracle + 7E14FBB9 + + + Slot 3 - Revive + 7E14FBBA + + + Slot 3 - Pear Cider + 7E14FBBB + + + Slot 3 - Sour Cider + 7E14FBBC + + + Slot 3 - Lime Cider + 7E14FBBD + + + Slot 3 - Plum Cider + 7E14FBBE + + + Slot 3 - Apple Cider + 7E14FBBF + + + Slot 3 - Hair Band + 7E14FBC0 + + + Slot 3 - Brooch + 7E14FBC1 + + + Slot 3 - Earring + 7E14FBC2 + + + Slot 3 - Necklace + 7E14FBC3 + + + Slot 3 - Stuffed Bear + 7E14FBC4 + + + Slot 3 - Stuffed Dog + 7E14FBC5 + + + Slot 3 - Stuffed Pig + 7E14FBC6 + + + Slot 3 - Emerald + 7E14FBC7 + + + Slot 3 - Opal + 7E14FBC8 + + + Slot 3 - Goblet + 7E14FBC9 + + + Slot 3 - Ear Tip + 7E14FBCA + + + Slot 3 - Empty Bottle + 7E14FBCB + + + Slot 3 - Gown + 7E14FBCC + + + Slot 3 - Ribbon + 7E14FBCD + + + Slot 3 - Fry Pan + 7E14FBCE + + + Slot 3 - Small Knife + 7E14FBCF + + + Slot 3 - Pot + 7E14FBD0 + + + Slot 3 - Chop Block + 7E14FBD1 + + + Slot 3 - Apron + 7E14FBD2 + + + Slot 3 - Dragon Egg + 7E14FBD3 + + + Slot 3 - Crown + 7E14FBD4 + + + Slot 3 - Secret Map + 7E14FBD5 + + + Slot 3 - Miracle Gem + 7E14FBD6 + + + Slot 3 - Silver Wick + 7E14FBD7 + + + Slot 3 - Royal Statue + 7E14FBD8 + + + Slot 3 - Silver Tarot + 7E14FBD9 + + + Slot 3 - Golden Pawn + 7E14FBDA + + + Slot 3 - Crown Jewels + 7E14FBDB + + + Slot 3 - Wind Flute + 7E14FBDC + + + Slot 3 - Escape + 7E14FBDD + + + Slot 3 - Magic Jar + 7E14FBDE + + + Slot 3 - Dragon Tooth + 7E14FBDF + + + Slot 3 - Grilled Newt + 7E14FBE0 + + + Slot 3 - Poison Pin + 7E14FBE1 + + + Slot 3 - Might Sword + 7E14FBE2 + + + Slot 3 - Straw Doll + 7E14FBE3 + + + Slot 3 - Long Nail + 7E14FBE4 + + + Slot 3 - Bomb + 7E14FBE5 + + + Slot 3 - Alumina + 7E14FBE6 + + + Slot 3 - Power Oil + 7E14FBE7 + + + Slot 3 - Elven Bow + 7E14FBE8 + + + Slot 3 - Artea's Bow + 7E14FBE9 + + + Slot 3 - Might Bow + 7E14FBEA + + + Slot 3 - Dummy (?) + 7E14FBEB + + + Slot 3 - Dummy (?) + 7E14FBEC + + + Slot 3 - Dummy (?) + 7E14FBED + + + Slot 3 - Dummy (?) + 7E14FBEE + + + Slot 3 - Free Door + 7E14FBEF + + + Slot 3 - Sheran Key + 7E14FBF0 + + + Slot 3 - Letter + 7E14FBF1 + + + Slot 3 - Dais Key + 7E14FBF2 + + + Slot 3 - Shrine Key + 7E14FBF3 + + + Slot 3 - Pirate Key + 7E14FBF4 + + + Slot 3 - Light Key + 7E14FBF5 + + + Slot 3 - Oil Key + 7E14FBF6 + + + Slot 3 - Green Jade + 7E14FBFB + + + Slot 3 - Red Sapphire + 7E14FBF8 + + + Slot 3 - Blue Jade + 7E14FBF9 + + + Slot 3 - Purple Newt + 7E14FBFA + + + Slot 3 - Glasdar Key + 7E14FBFB + + + Slot 3 - Magic Flavor + 7E14FBFC + + + Slot 3 - Fairy Kiss + 7E14FBFD + + + + Madden NFL '94 (USA) + + Touchdowns worth 0 points + DDAA-5D0F + + + Touchdowns worth 3 points + D7AA-5D0F + + + Touchdowns worth 5 points + D9AA-5D0F + + + Touchdowns worth 9 points + DBAA-5D0F + + + Extra points worth 0 points + DDAE-ED0F + + + Extra points worth 3 points + D7AE-ED0F + + + Extra points worth 5 points + D9AE-ED0F + + + Extra points worth 7 points + D5AE-ED0F + + + Safeties worth 0 points + DDAB-8DAD + + + Safeties worth 3 points + D7AB-8DAD + + + Safeties worth 5 points + D9AB-8DAD + + + Safeties worth 7 points + D5AB-8DAD + + + Field goals worth 0 points + DDAE-E76F + + + Field goals worth 2 points + D4AE-E76F + + + Field goals worth 5 points + D9AE-E76F + + + Field goals worth 7 points + D5AE-E76F + + + Field goals worth 9 points + DBAE-E76F + + + Visitors start with a 5-point lead + D93F-7D0F + DE3F-7D6F + + + Visitors start with a 7-point lead + D53F-7D0F + DE3F-7D6F + + + Visitors start with a 10-point lead + DC3F-7D0F + DE3F-7D6F + + + Visitors start with a 14-point lead + D33F-7D0F + DE3F-7D6F + + + Visitors start with a 35-point lead + 473F-7D0F + DE3F-7D6F + + + Home team starts with a 3-point lead + D73F-7D0F + DE3F-7F6F + + + Home team starts with a 7-point lead + D53F-7D0F + DE3F-7F6F + + + Home team starts with a 10-point lead + DC3F-7D0F + DE3F-7F6F + + + Home team starts with a 14-point lead + D33F-7D0F + DE3F-7F6F + + + Home team starts with a 35-point lead + 473F-7D0F + DE3F-7F6F + + + TD, FG, PAT, S worth 1 point - home team + CBA2-8F6D + DFA2-8FAD + + + TD, FG, PAT, S worth 3 points - home team + CBA2-8F6D + D7A2-8FAD + + + TD, FG, PAT, S worth 5 points - home team + CBA2-8F6D + D9A2-8FAD + + + TD, FG, PAT, S worth 7 points - home team + CBA2-8F6D + D5A2-8FAD + + + TD, FG, PAT, S worth 14 points - home team + CBA2-8F6D + D3A2-8FAD + + + TD, FG, PAT, S worth 21 points - home team + CBA2-8F6D + F9A2-8FAD + + + TD, FG, PAT, S worth 35 points - home team + CBA2-8F6D + 47A2-8FAD + + + TD, FG, PAT, S worth 3 points - visitor + CBAD-ED0D + DFAD-ED6D + + + TD, FG, PAT, S worth 5 points - visitor + CBAD-ED0D + D9AD-ED6D + + + TD, FG, PAT, S worth 7 points - visitor + CBAD-ED0D + D5AD-ED6D + + + TD, FG, PAT, S worth 14 points - visitor + CBAD-ED0D + D3AD-ED6D + + + TD, FG, PAT, S worth 21 points - visitor + CBAD-ED0D + F9AD-ED6D + + + TD, FG, PAT, S worth 35 points - visitor + CBAD-ED0D + 47AD-ED6D + + + Always 1st down + 3CAC-5DDD + + + 1 play to get a 1st down + D4A8-54AD + + + 2 plays to get a 1st down + D7A8-54AD + + + 3 plays to get a 1st down + D0A8-54AD + + + 5 plays to get a 1st down + D1A8-54AD + + + 7 plays to get a 1st down + D6A8-54AD + + + + Madden NFL 95 (USA) + + Start with 15 seconds on the play clock + DE55-84DF + + + Start with 1 timeout - P1 + DFD0-7DAD + + + Start with 1 timeout - P2 + DFD0-7FDD + + + Infinite timeouts - both players (slightly glitchy) + 8250-5700 + + + Safetys worth 0 points + DD6F-77AF + + + Safetys worth 1 points + DF6F-77AF + + + Safetys worth 5 points + D06F-77AF + + + Safetys worth 7 points + D56F-77AF + + + Touchdowns worth 0 points + DD62-E4DF + + + Touchdowns worth 1 points + DF62-E4DF + + + Touchdowns worth 5 points + D062-E4DF + + + Touchdowns worth 9 points + DB62-E4DF + + + Field goals worth 0 points + DD6F-8404 + + + Field goals worth 1 points + DF6F-8404 + + + Field goals worth 5 points + D06F-8404 + + + Field goals worth 9 points + DB6F-8404 + + + Always 1st down + C267-E46D + + + + Madden NFL 96 (USA) + + Infinite time (2P mode only) + C2D2-8F0D + + + Start with 5 downs each possession + DD65-E7A7 + + + Start with 3 downs each possession + D765-E7A7 + + + Start with 2 downs each possession + D465-E7A7 + + + Start with 1 down each possession + DF65-E7A7 + + + Infinite downs + C26A-8767 + + + Safeties are worth 0 points + DD62-EFA7 + + + Safeties are worth 1 point + DF62-EFA7 + + + Safeties are worth 3 points + D462-EFA7 + + + Safeties are worth 5 points + D962-EFA7 + + + Safeties are worth 7 points + D562-EFA7 + + + Safeties are worth 9 points + DB62-EFA7 + + + Field Goals are worth 0 points + DDBB-8DAF + + + Field Goals are worth 1 point + DFBB-8DAF + + + Field Goals are worth 2 points + D4BB-8DAF + + + Field Goals are worth 5 points + D9BB-8DAF + + + Field Goals are worth 7 points + D5BB-8DAF + + + Field Goals are worth 9 points + DBBB-8DAF + + + Infinite timeouts + 8297-7F09 + + + + Magical Quest Starring Mickey Mouse, The (USA) + + Start with 1 life instead of 3 + DD69-07A0 + + + Start with 7 lives + D169-07A0 + + + Start with 10 lives + DB69-07A0 + + + Infinite lives + C22B-ADA5 + + + Protection from most hits (lose no hearts) (switch off if you get stuck) + C2E7-D462 + + + Infinite magic - wizard's costume only + C23E-6405 + + + Each gold coin worth 10 (if you pick up too much, you may go back to 0) + DFE7-0708 + + + Longer invincibility after getting hit (Mickey blinks) + C23D-6FA0 + + + No invincibility after getting hit + CB3D-6D60 + + + Super-jump + 1B2D-6765 + 4A2D-67A5 + + + Mega-jump + 1B2D-6765 + 4D2D-67A5 + + + Leap tall buildings in a single bound + 1B2D-6765 + F02D-67A5 + + + Items in general store are free if you can afford them + 6DE6-04A8 + 48E6-07D8 + + + Start with 1 heart instead of 3 + DFAE-D4D7 + + + Start with 5 hearts + D9AE-D4D7 + + + Start with 7 hearts + D5AE-D4D7 + + + Start with 10 hearts + DCAE-D4D7 + + + Small heart fills health meter completely + 622F-DDD6 + C22F-DF06 + + + + Magic Sword (USA) + + Invincibility + 7E831C09 + + + Infinite health + 7E043209 + + + No health loss on collision with enemies + C2BC-D7A5 + C280-D7DD + + + Infinite support health + 7E042304 + + + Infinite magic + 7E040C09 + 7E040D09 + + + No health loss when magic is used + C2B4-6FD9 + + + No magic counter countdown + C2CC-0F67 + + + Slower magic counter countdown + 5ECC-0D67 + + + Faster magic counter countdown + EECC-0D67 + + + Have powered-up attack + 7E068A06 + + + Infinite Silver Keys + 7E040F09 + + + Infinite Gold Keys + 7E041009 + + + Infinite Platinum Keys + 7E041109 + + + Have optimum sword + 7E040A06 + + + Have optimum shield + 7E040B04 + + + Never lose shield + 7E043502 + + + Barrier Invincibility + 7E06D6FF + + + Infinite continues + 7E042D09 + + + Set score to 90,000,000 + 7E044809 + + + Support modifier - Amazon + 7E042403 + + + Support modifier - Big Man + 7E042407 + + + Support modifier - Wizard + 7E042409 + + + Support modifier - Knight + 7E04240C + + + Support modifier - Lizardman + 7E04240F + + + Support modifier - Ninja + 7E042412 + + + Support modifier - Thief + 7E042415 + + + Support modifier - Cleric + 7E042418 + + + Max power for Amazon's Crossbow + 7E041307 + + + Max power for Big Man's Axe + 7E041407 + + + Max power for Wizard's Magic Missile + 7E041507 + + + Max power for Knight's Spear + 7E041607 + + + Max power for Lizardman's Sword + 7E041707 + + + Max power for Ninja's Throwing Star + 7E041807 + + + Max power for Thief's Bomb + 7E041907 + + + Max power for Cleric's Magic Bullet + 7E041A07 + + + + Mario Is Missing! (USA) + + Talk to someone once to learn all they know (all four checks appear on computer for that person) + CB8D-17DF + EE8D-170F + 3C8D-176F + + + Use computer to access any facts except pamphlets (no checks appear on computer) + 6D8D-C4AF + DD80-C70F + DD85-C4DF + + + Use computer to view pamphlets on any artifact (no checks appear on computer) + 6D82-17AF + + + Always get Yoshi after using Globulator + DFED-4D04 + + + Pick up one artifact and get all three + CB8E-47AF + EE8D-1DDF + 3C8D-1D0F + + + Have all three arifacts + 7E050A07 + + + Always have Yoshi (Globulator doesn't automatically pick your location) + 7E06DB01 + + + No waiting on wrong answer + 7E056500 + + + + Mario Paint (Japan, USA) + + Invincibility in bug swatting game + CBCF-0769 + 62C4-0DA9 + EECF-07A9 + + + Invincibility in bug swatting game (alt) + 7F0040FF + + + Infinite lives in bug swatting game + A2C3-6409 + + + Infinite lives in bug swatting game (alt) + 7F001863 + + + Have all icons in bug swatting game + CBC4-A400 + + + Have all icons in bug swatting game (alt) + 7F00120F + + + Star easier to get under P on title screen + DD69-1F52 + DD69-1452 + DF69-1482 + + + Only need to swat once to move around and kill flies + 7F001E02 + + + Enable all rotate/flip options + 7E099F01 + + + One-hit to kill boss + 7F00C914 + + + Start on level 2 + 7F001401 + + + Start on level 3 + 7F001402 + + + + Mario's Time Machine (USA) + + Bonus timer doesn't count down in the whole game + DD6A-1405 + + + Don't lose mushrooms in collisions + CB64-3FA9 + DD64-34D7 + DD64-3409 + + + 1 wrong answer to questions allowed + DF24-1704 + + + 255 wrong answers allowed (ignore sad face icon) + EE24-1704 + + + + Marvel Super Heroes - War of the Gems (USA) + + Infinite health + B9D9-74D4 + + + Infinite Air + B9D9-74D4 + + + Infinite Air (alt) + E15A-5F66 + + + Always have a Gem + B354-E4D8 + + + Infinite equipment, all Gems selectable on pick-up + FA85-7464 + 6D85-7704 + FE85-7764 + + + Invincibility - Boston Aquarium + 7E042D03 + 7E042F00 + + + Invincibility - Alaska + 7E02CD03 + 7E02CF00 + + + Invincibility - Dr. Doom's Castle + 7E02BD03 + 7E02BF00 + + + Invincibility - Amazon + 7E02FD03 + 7E02FF00 + + + Invincibility - Magus' Spaceship and Asteroid Belt + 7E026D03 + 7E026F00 + + + Invincibility - Egypt + 7E02DD03 + 7E02DF00 + + + Invincibility - Arizona Mining Facility + 7E031D03 + 7E031F00 + + + Invincibility - Mt. Vezuvius + 7E039D03 + 7E039F00 + + + Invincibility - Nebula's Level + 7E033D03 + 7E033F00 + + + Invincibility - Thanos' Level + 7E034D03 + 7E034F00 + + + Infinite health - Dr. Doom's Castle + 7E026B64 + + + Infinite health - Alaska + 7E027B64 + + + Infinite health - Mt. Vesuvius + 7E034B64 + + + Infinite health - Egypt + 7E028B64 + + + Infinite health - Arizona Mining Facility + 7E02CB64 + + + Always have 9 Gem power items + E916-740D + + + Always have 9 Revive items + E15A-5F66 + + + Always have 9 Big energy Tanks + 7FFF1A09 + + + Always have 9 Small energy Tanks + 7FFF1B09 + + + + Mary Shelley's Frankenstein (USA) + + Infinite health + C2B9-1DA4 + 8533-3F0D + + + Energy balls don't deplete health + DDE5-3FB0 + DDE5-3F20 + + + + Mask, The (USA) + + Invincibility after one hit + 82C0-476F + + + Infinite life + 7E18AF20 + 7E18B003 + + + Infinite mask power + C282-1F0D + + + Infinite mask power (alt) + 7E008F84 + 7E009003 + + + Start with 100 mask energy + DF6E-44AD + + + Start with 300 mask energy + D76E-44AD + + + Start with 900 mask energy + DB6E-44AD + + + Mallet doesn't use any power + 8EBF-3DD4 + + + Green hearts worth 10 + FDC6-3707 + + + Green hearts worth 30 + 7DC6-3707 + + + Green hearts worth 100 + CDC6-3707 + + + Green hearts worth 0 + C2CC-3F07 + + + Start with 1 life + CB63-446D + DD63-44AD + DD63-47DD + + + Start with 5 lives + CB63-446D + D963-44AD + DD63-47DD + + + Start with 9 lives + CB63-446D + DB63-44AD + DD63-47DD + + + Infinite lives + C961-146F + + + Flash longer + EE88-140D + + + Don't flash at all + DD88-140D + + + M's worth 0 + C9C4-3467 + + + M's worth 10 + FDCF-37A7 + + + M's worth 30 + 7DCF-37A7 + + + M's worth 100 + CDCF-37A7 + + + + MechWarrior 3050 (USA) + + Almost infinite ammo + C295-5FAD + + + Almost invincible (Switch off to kill some enemies) + 1D9E-ED6D + + + Coolant does nothing + CB6B-5464 + CB6B-5704 + + + Guass Rifle starts at 10 + DC09-7998 + + + Guass Rifle starts at 50 + 7409-7998 + + + Guass Rifle starts at 100 + 1009-7998 + + + Arrow VI Missiles start at 20 + F009-7028 + + + Arrow VI Missiles start at 50 + 7409-7028 + + + Arrow VI Missiles start at 100 + 1009-7028 + + + Particle Projection Cannon start at 10 + DC00-7528 + + + Particle Projection Cannon start at 50 + 7400-7528 + + + Particle Projection Cannon start at 100 + 1000-7528 + + + Machine Gun starts at 100 + DD00-79B8 + 1000-7998 + + + Machine Gun starts at 1,000 + D700-79B8 + 3600-7998 + + + Machine Gun starts at 10,000 + 4100-79B8 + FD00-7998 + + + Auto Cannon starts at 50 + 7400-7928 + + + Auto Cannon starts at 100 + 1000-7928 + + + Auto Cannon starts at 250 + EC00-7928 + + + Large Laser starts at 50 + 7400-7128 + DD00-75F8 + + + Large Laser starts at 1,000 + 3600-7128 + D700-75F8 + + + Large Laser starts at 10,000 + FD00-7128 + 4100-75F8 + + + Inferno Short-Range Missiles start at 10 + DC00-7198 + + + Inferno Short-Range Missiles start at 50 + 7400-7198 + + + Inferno Short-Range Missiles start at 250 + EC00-7198 + + + Maelstrom Long-Range Missiles start at 20 + F009-7098 + + + Maelstrom Long-Range Missiles start at 100 + 1009-7098 + + + Maelstrom Long-Range Missiles start at 250 + EC09-7098 + + + Thunder Time-Delay Mines start at 10 + DC00-7598 + + + Thunder Time-Delay Mines start at 100 + 1000-7598 + + + Thunder Time-Delay Mines start at 250 + EC00-7598 + + + + MechWarrior (USA) + + Start with 100,000 C-bills + 103E-C4AD + + + Start with 250,000 C-bills + EC3E-C4AD + + + Start with 562,000 C-bills + D43E-C7DD + + + Start with 1,074,000 C-bills + D03E-C7DD + + + Start with 5,170,000 C-bills + F03E-C7DD + + + Start with 10,290,000 C-bills + 463E-C7DD + + + Getting any money sets money to 32 million C-bills + DD38-146D + + + 100 ammo for short-range missiles + 102F-C7A4 + + + 100 ammo for short-range homing missiles + 1024-CD04 + + + 80 ammo for medium-range missiles + 9D24-CDA4 + + + 80 ammo for medium-range homing missiles + 9D24-CF04 + + + 40 ammo for long-range missiles + 4624-CFA4 + + + 40 ammo for long-range homing missiles + 4624-C404 + + + 200 short-range missiles + A62F-C7A4 + + + 200 short-range homing missiles + A624-CD04 + + + 100 medium-range missiles + 1024-CDA4 + + + 100 medium-range homing missiles + 1024-CF04 + + + 100 long-range missiles + 1024-CFA4 + + + 100 long-range homing missiles + 1024-C404 + + + Infinite short-range missiles + EE2F-C7A4 + + + Infinite short-range homing missiles + EE24-CD04 + + + Infinite medium-range missiles + EE24-CDA4 + + + Infinite medium-range homing missiles + EE24-CF04 + + + Infinite long-range missiles + EE24-CFA4 + + + Infinite long-range homing missiles + EE24-C404 + + + Infinite machine gun ammo + EE24-C4A4 + + + Never run out of any ammo + 3CCD-4404 + + + Protection from most hazards + 628C-4F20 + + + Mech isn't slowed down as much by most obstacles + CBED-34F7 + 3CED-34B7 + + + + Mega Man 7 (USA) + + Invincibility after first hit (blinking) + 6D79-84A0 + + + Infinite health + C2DB-5F62 + + + Infinite health (alt) + D9DB-5DA2 + + + Infinite E-Tanks + C209-7DA4 + + + Infinite E-Tanks (alt) + 7E0BA0FF + + + Infinite W-Tanks + C20B-7DD4 + + + Infinite W-Tanks (alt) + 7E0BA1FF + + + Infinite S-Tanks + C20E-7D04 + + + Infinite S-Tanks (alt) + 7E0BA2FF + + + Infinite Beat Whistles + C277-8F00 + + + Infinite Beat Whistles (alt) + 7E0BA384 + + + Infinite Bolts + 7E0BA6E7 + 7E0BA703 + + + Infinite weapon energy + FEC2-E405 + + + Infinite slide + 7E0C61FF + + + Moon-jump + 7E0C1AF4 + + + Have exit + 7E0BA4FF + + + Have S.Adapt + 7E0B9FFF + + + Have Super Fist upgrade for S.Adapt + 7E0BA44F + + + Have Proto Shield + 7E0B95FF + + + Infinite Feeze Cracker + 7E0B85FF + + + Infinite Junk Shield + 7E0B89FF + + + Infinite Scorch Wheel + 7E0B8BFF + + + Infinite Slash Claw + 7E0B8DFF + + + Infinite Thunder Bolt + 7E0B87FF + + + Infinite Noise Crush + 7E0B8FFF + + + Infinite Danger Wrap + 7E0B91FF + + + Infinite Wild Coil + 7E0B93FF + + + Infinite Rush Coil + 7E0B9BFF + + + Infinite Rush Search + 7E0B97FF + + + + Mega Man Soccer (USA) + + Choose any character to play as Dr. Willy + CBCA-3F60 + F0CA-3FA0 + DDCA-34D0 + + + + Mega Man X2 (USA) + + Invincibility + 08944008 + + + Infinite health + C223-0414 + + + Infinite health (alt) + BA23-0FC4 + + + Infinite health (alt 2) + 7E09FF20 + + + Max health containers + 7E1FD120 + + + Infinite lives + 7E1FB309 + + + One hit kills + 6D2D-AF14 + + + Have Shouryuken (F, D, DF + Fire) (must have max health and health containers) + 7E1FB180 + + + Infinite L.Tracer + 7E1FCD5C + + + Infinite Bubble.S + 7E1FBD5C + + + Infinite Crystal.H + 7E1FBB5C + + + Infinite Magnet.M + 7E1FC75C + + + Infinite S.Burner + 7E1FC95C + + + Infinite S.Chain + 7E1FC55C + + + Infinite S.Slicer + 7E1FC35C + + + Infinite S.Wheel + 7E1FC15C + + + Infinite Silk.S + 7E1FBF5C + + + Infinite G.Crush + 7E1FCB5C + + + Infinite Dash + 7E0A2A16 + + + Have all equipment + 7E1FD0FF + + + Have sub-tank 1 full + 7E1FB6FF + + + Have sub-tank 2 full + 7E1FB7FF + + + Have sub-tank 3 full + 7E1FB8FF + + + Have sub-tank 4 full + 7E1FB9FF + + + + Mega Man X3 (USA) + + Invincibility (enable) + 7E0A0808 + + + Invincibility (disable) + 7E0A0800 + + + Infinite health + C2AD-6FF7 + + + Start with max health bar + F02A-ADF4 + + + Infinite lives + 7E1FB409 + + + Infinite Boosts + 7E0A9A01 + + + Get all equipment when you enter the start menu + 00CD80A9 + 00CD81FF + 00CD828D + 00CD83D7 + + + Infinite special weapons on pick-up + 82CB-0D2F + 82CA-0F2F + + + Always Super Shot + 7E0A6702 + + + Infinite Air Dash + 7E0A3478 + + + Have Zero-Saber + 7E1FB2FC + + + Have all upgrades + 7E1FD14F + + + Invincible Ride Armor + 7E0CF801 + + + Skip bosses at start of game and proceed to stage select + B933-DF6C + + + Super-jump + D586-6F26 + + + Mega-jump + DB86-6F26 + + + Ultra mega-jump + D886-6F26 + + + + Mega Man X (USA) + + Infinite health + C2B9-1FF7 + + + Max health containers + 7E1F9A20 + + + Infinite lives + C2B9-3404 + + + Infinite lives (alt) + 7E1F8009 + + + Start with 10 lives + DBBE-446F + + + Start with 7 lives + D1BE-446F + + + Start with 5 lives + D0BE-446F + + + Start with 1 life + DDBE-446F + + + Start with less health + D6BE-47AF + + + Start with more health + 4DBE-47AF + + + One hit kills (most enemies) + 6DB5-CD97 + + + Have all equipment + 7E1F99FF + + + Have sub-tank 1 full + 7E1F83FF + + + Have sub-tank 2 full + 7E1F84FF + + + Have sub-tank 3 full + 7E1F85FF + + + Have sub-tank 4 full + 7E1F86FF + + + Start with all weapons and all enemies defeated (except Sigma) + 23BD-3F07 + + + Infinite weapons once you have them + C9B3-4769 + + + Bogus jump (may go back to normal jumps) + D08A-1FBC + + + Super-jump (may go back to normal jumps) + D58A-1FBC + + + Mega-jump (may go back to normal jumps) + DB8A-1FBC + + + Weapon charges to 1st power level faster + DDB1-4F61 + + + + Mega Man X (USA) (Rev 1) + + Max health containers + 7E1F9A20 + + + Infinite lives + 7E1F8009 + + + Start with 10 lives + DBBE-446F + + + Start with 7 lives + D1BE-446F + + + Start with 5 lives + D0BE-446F + + + Start with 1 life + DDBE-446F + + + Start with less health + D6BE-47AF + + + Start with more health + 4DBE-47AF + + + One hit kills (most enemies) + 6DB5-CD97 + + + Have all equipment + 7E1F99FF + + + Have sub-tank 1 full + 7E1F83FF + + + Have sub-tank 2 full + 7E1F84FF + + + Have sub-tank 3 full + 7E1F85FF + + + Have sub-tank 4 full + 7E1F86FF + + + Infinite weapons once you have them + C9B3-4769 + + + Bogus jump (may go back to normal jumps) + D08A-1FBC + + + Super-jump (may go back to normal jumps) + D58A-1FBC + + + + Metal Combat - Falcon's Revenge (USA) + + Infinite health + 7E19687F + + + No time + 7E03C500 + 7E03C700 + + + Infinite Bombs + 7E03FE08 + + + Infinite Energy Bolt charge + 7E1B1396 + + + + Metal Marines (USA) + + Building an ICBM only takes up one space + 6DA1-67AD + + + Can view entire enemy map + 6DCE-DD03 + + + Enemy has no attack phase + 1D25-64A8 + + + Instant maximum energy + DD25-04AD + + + Instant maximum war funds + DD28-0D0D + + + Enemy always has 0 energy + BA21-07AD + + + Enemy always has 0 war funds + BA2C-0F0D + + + + Metal Morph (USA) + + Start with 255 continues + EE6C-1FDD + + + Freeze timer on continue screen + C2AD-4D65 + + + Infinite ammo for all weapons (to change weapons, turn code off, pick up new weapon, turn back on) + C926-C7A1 + + + Infinite continues + C9A9-4F65 + + + + Metal Warriors (USA) + + Infinite health (Mech) + C38F-4DD0 + + + Infinite health (Human) + C9A9-3D60 + + + Infinite Gun ammo on pickup + 306C-1D65 + + + Press L to go Hyper (Mech) + C168-1F05 + + + + Mickey Mania - The Timeless Adventures of Mickey Mouse (USA) + + Infinite health + C2B8-CAC3 + + + Start with less health + D4AA-3869 + + + Start with more health + DBAA-3869 + + + Infinite lives + C2B3-C313 + + + Start with 1 life + DDA3-36D9 + + + Start with 7 lives + D1A3-36A9 + + + Start with 10 lives + DBA3-36A9 + + + Each marble worth 99 + CB8C-C27A + + + Infinite marbles + C2A8-CA32 + + + One hit and you're dead + DDAA-3869 + + + Start on stage - the Wharf + DFAB-3669 + + + Start on stage - Mad Doc 1 + D4AB-3669 + + + Start on stage - Mad Doc 2 + D7AB-3669 + + + Start on stage - Ride The Gurney + D0AB-3669 + + + Start on stage - Mad Doc 4 + D9AB-3669 + + + Start on stage - Elevator + D1AB-3669 + + + Start on stage - Mad Doc Eol + D5AB-3669 + + + Start on stage - Moose Hunt + D6AB-3669 + + + Start on stage - Moose Chase + DBAB-3669 + + + Start on stage - Haunted House + DCAB-3669 + + + Start on stage - Haunted Basement + D8AB-3669 + + + Start on stage - Haunted Halls + DAAB-3669 + + + Start on stage - Garden + D2AB-3669 + + + Start on stage - Tunnel + D3AB-3669 + + + Start on stage - Steps + DEAB-3669 + + + Start on stage - Table + FDAB-3669 + + + Start on stage - Library + FFAB-3669 + + + Start on stage - Kitchen + F4AB-3669 + + + Start on stage - Dungeon + F7AB-3669 + + + Start on stage - Tower Escape + F0AB-3669 + + + + Mickey to Donald - Magical Adventure 3 (Japan) + + Invincibility - P1 + 7E0454FF + + + Invincibility - P2 + 7E0554FF + + + Infinite health - P1 + 7E046F03 + + + Infinite health - P2 + 7E056F03 + + + Infinite lives - P1 + 7E048604 + + + Infinite lives - P2 + 7E058604 + + + Infinite Oxygen - P1 + 7E04810F + + + Infinite Oxygen - P2 + 7E05810F + + + Set max power bar - P1 + 7E048AFF + + + Set max power bar - P2 + 7E058AFF + + + + Micro Machines (USA) + + Infinite lives + 7E032309 + + + + Mighty Max (USA) + + Invincibility + 7E0254A1 + + + Infinite energy + 7E029403 + + + Infinite lives + 7E028C09 + + + + Mighty Morphin Power Rangers - The Fighting Edition (USA) + + Infinite health - P1 + 7E1A2270 + + + Infinite health - P2 + 7E1A2670 + + + Special maxed - P1 + 7E06A030 + + + Special maxed - P2 + 7E06A630 + + + Play As Ivan Ooze - P1 + 7E1A6810 + + + Play as Ivan Ooze - P2 + 7E1A6C10 + + + Infinite round time + 7E06B806 + 7E06BA00 + + + Infinite time + 7E06BC01 + + + Special 1 - P1 + 7E1B0007 + 7E1B020C + + + Special 2 - P1 + 7E1B0807 + 7E1B0A0C + + + Special 3 - P1 + 7E1B1007 + 7E1B120C + + + Special 4 - P1 + 7E1B1807 + 7E1B1A0C + + + Special 5 - P1 + 7E1B2007 + 7E1B220C + + + Special 1 - P2 + 7E1B0407 + 7E1B060C + + + Special 2 - P2 + 7E1B0C07 + 7E1B0E0C + + + Special 3 - P2 + 7E1B1407 + 7E1B160C + + + Special 4 - P2 + 7E1B1C07 + 7E1B1E0C + + + Special 5 - P2 + 7E1B2407 + 7E1B260C + + + Super move - P2 + 7E1B3403 + 7E1B3618 + + + + Mighty Morphin Power Rangers - The Movie (USA) + + Invincibility + 6286-D46A + + + Invincibility - P1 + 7E1C2801 + + + Infinite health - P1 + 7E062805 + + + Infinite power - P1 + 7E062A18 + + + Infinite life force + C226-07A2 + + + Almost infinite life force + 8B26-07A2 + + + Start with a lot of energy - first life only + DBA2-04AD + + + Start with very little energy - first life only + DFA2-04AD + + + Start with very little energy after first life + DF29-07DA + + + Start with more energy after first life + DB29-07DA + + + Infinite time P1 + FF413909 + + + Infinite continues - 1P mode + C2E0-DF0A + + + Infinite continues - 2P mode + C2B1-AFAA + + + Start with 9 continues + DBA8-0DDD + + + No continues + DDA8-0DDD + + + Start with mega-points + D7AA-0DDD + + + Infinite lives + C229-0D6A + + + Infinite lives - P1 + 7E060A09 + + + Start with 9 lives + DB6E-0D6D + + + Start with 5 lives + D96E-0D6D + + + Start with 1 life + DF6E-0D6D + + + Large main power up box gives max power + F620-0FA2 + + + Main collectable power doesn't go down after ranger powerup as fast + 3C8D-6D67 + 3CA4-64DA + + + + Mighty Morphin Power Rangers (USA) + + Infinite health (Megazord) + 7E04C071 + + + Infinite power (Megazord) + 7E04C271 + + + Invincibility + C280-AD2F + + + Infinite health + C286-6DF4 + + + Start game with full health + AD82-64DD + + + More health from capsule + AD64-6465 + + + Start with 1 life + DD8A-6DDD + + + Start with 6 lives + D98A-6DDD + + + Start with 9 lives + D68A-6DDD + + + Infinite lives + 3CAA-DFDF + + + Infinite bombs on pick-up + C2B7-0FF7 + + + Mega-jump + EC6A-ADF7 + + + Trini moves faster + D468-04BF + EE62-0DBF + + + Billy moves faster + D46C-0DBF + EE6A-049F + + + Jason moves faster + D46B-04BF + D46A-0D9F + + + Kimberley moves faster + AD6C-049F + AD62-0D9F + + + Zach moves faster + D468-0DBF + + + Zach moves faster, but the wrong way + EE62-04BF + + + + Monopoly (USA) + + Land, rent and some other things are free - all players + 1D85-6FDF + + + Land, rent and some other things are $50 - all players + 3B85-6FDF + 7485-6F0F + DD85-6F6F + + + Land, rent and some other things are $100 - all players + 3B85-6FDF + 1085-6F0F + DD85-6F6F + + + Land, rent and some other things are $200 - all players + 3B85-6FDF + A685-6F0F + DD85-6F6F + + + Land, rent and some other things are $500 - all players + 3B85-6FDF + E085-6F0F + DD85-6F6F + + + Always throw double 6's + CBB3-AF0D + D1B3-AF6D + D1B3-AFAD + + + Always throw double 5's + CBB3-AF0D + D9B3-AF6D + D9B3-AFAD + + + Always throw double 4's + CBB3-AF0D + D0B3-AF6D + D0B3-AFAD + + + Always throw double 3's + CBB3-AF0D + D4B3-AF6D + D7B3-AFAD + + + Always throw double 2's + CBB3-AF0D + D4B3-AF6D + D4B3-AFAD + + + Always throw double 1's + CBB3-AF0D + DFB3-AF6D + DFB3-AFAD + + + P1 has a Get Out Of Jail card + 7E08F201 + + + P2 has a Get Out Of Jail card + 7E08F401 + + + P3 has a Get Out Of Jail card + 7E08F601 + + + P4 has a Get Out Of Jail card + 7E08F801 + + + P5 has a Get Out Of Jail card + 7E08FA01 + + + P6 has a Get Out Of Jail card + 7E08FC01 + + + P7 has a Get Out Of Jail card + 7E08FE01 + + + P8 has a Get Out Of Jail card + 7E090001 + + + + Monopoly (USA) (Rev 1) + + Land, rent and some other things are free - all players + 1D85-6FDF + + + Land, rent and some other things are $50 - all players + 3B85-6FDF + 7485-6F0F + DD85-6F6F + + + Land, rent and some other things are $100 - all players + 3B85-6FDF + 1085-6F0F + DD85-6F6F + + + Land, rent and some other things are $200 - all players + 3B85-6FDF + A685-6F0F + DD85-6F6F + + + Land, rent and some other things are $500 - all players + 3B85-6FDF + E085-6F0F + DD85-6F6F + + + Always throw double 6's + CBB3-AF0D + D1B3-AF6D + D1B3-AFAD + + + Always throw double 5's + CBB3-AF0D + D9B3-AF6D + D9B3-AFAD + + + Always throw double 4's + CBB3-AF0D + D0B3-AF6D + D0B3-AFAD + + + Always throw double 3's + CBB3-AF0D + D4B3-AF6D + D7B3-AFAD + + + Always throw double 2's + CBB3-AF0D + D4B3-AF6D + D4B3-AFAD + + + Always throw double 1's + CBB3-AF0D + DFB3-AF6D + DFB3-AFAD + + + P1 has a Get Out Of Jail card + 7E08F201 + + + P2 has a Get Out Of Jail card + 7E08F401 + + + P3 has a Get Out Of Jail card + 7E08F601 + + + P4 has a Get Out Of Jail card + 7E08F801 + + + P5 has a Get Out Of Jail card + 7E08FA01 + + + P6 has a Get Out Of Jail card + 7E08FC01 + + + P7 has a Get Out Of Jail card + 7E08FE01 + + + P8 has a Get Out Of Jail card + 7E090001 + + + + Mortal Kombat 3 (USA) + + Invincibility (except throws and uppercuts) - P1 + 7E544701 + + + Invincibility (except throws and uppercuts) - P2 + 7E544901 + + + Infinite health + CBE3-4D64 + C9E3-4DA4 + 62E3-4F04 + 70E3-4F64 + 71E3-4FA4 + + + Infinite health - P1 + C230-CD62 + + + Infinite health - P2 + C239-CD62 + + + First round / one button fatalities + 7E3AF001 + + + Infinite continues + A220-3FB6 + + + Press A on main menu for Sound Test + D42E-44D8 + + + Press Up on main menu for Kool Stuff Menu + D424-17D8 + + + Press Select on main menu for Kooler Stuff Menu + D421-1DD8 + + + Press X on main menu for Scott's Menu + D42B-1FD8 + + + P1 takes all damage + DD37-CF62 + + + P2 takes all damage + 6D37-CF02 + + + Always fight Kano + CE8F-3FB7 + BA23-3727 + DDAE-4FFF + + + Always fight Sonya + CE8F-3FB7 + BA23-3727 + DFAE-4FFF + + + Always fight Jax + CE8F-3FB7 + BA23-3727 + D4AE-4FFF + + + Always fight Nightwolf + CE8F-3FB7 + BA23-3727 + D7AE-4FFF + + + Always fight Sub-Zero + CE8F-3FB7 + BA23-3727 + D0AE-4FFF + + + Always fight Stryker + CE8F-3FB7 + BA23-3727 + D9AE-4FFF + + + Always fight Sindel + CE8F-3FB7 + BA23-3727 + D1AE-4FFF + + + Always fight Sektor + CE8F-3FB7 + BA23-3727 + D5AE-4FFF + + + Always fight Cyrax + CE8F-3FB7 + BA23-3727 + D6AE-4FFF + + + Always fight Kung Lao + CE8F-3FB7 + BA23-3727 + DBAE-4FFF + + + Always fight Kabal + CE8F-3FB7 + BA23-3727 + DCAE-4FFF + + + Always fight Sheeva + CE8F-3FB7 + BA23-3727 + D8AE-4FFF + + + Always fight Shang Tsung + CE8F-3FB7 + BA23-3727 + DAAE-4FFF + + + Always fight Liu Kang + CE8F-3FB7 + BA23-3727 + D2AE-4FFF + + + Always fight Smoke + CE8F-3FB7 + BA23-3727 + D3AE-4FFF + + + Always fight Motaro + CE8F-3FB7 + BA23-3727 + DEAE-4FFF + + + Always fight Shao Kahn + CE8F-3FB7 + BA23-3727 + FDAE-4FFF + + + Always fight Noob-Saibot + CE8F-3FB7 + BA23-3727 + FFAE-4FFF + + + + Mortal Kombat II (USA) + + Invincibility - P1 + C2B1-14F7 + + + Invincibility - P2/CPU + C2B5-14F7 + + + Infinite health + CB89-4FAA + CF89-44DA + DD89-440A + EA89-44AA + 4389-47DA + + + Infinite time + 6DC7-1DAA + + + No health - P1 + DDB1-1FF7 + + + No health - P2/CPU + DDB5-1FF7 + + + Have 127x more fatality time + 5EC2-CF02 + + + Infinite continues + C2C4-47AA + + + Start with 0 continues + DF8C-CDDA + + + Start with 2 continues + D78C-CDDA + + + Start with 6 continues + D58C-CDDA + + + Start with 8 continues + DB8C-CDDA + + + Disable throws - 2P mode + 622B-C7AC + + + Always fight Kung Lao + CBC6-3D6E + DDC6-3DAE + + + Always fight Liu Kang + CBC6-3D6E + DFC6-3DAE + + + Always fight Cage + CBC6-3D6E + D4C6-3DAE + + + Always fight Baraka + CBC6-3D6E + D7C6-3DAE + + + Always fight Kitana + CBC6-3D6E + D0C6-3DAE + + + Always fight Mileena + CBC6-3D6E + D9C6-3DAE + + + Always fight Shang Tsung + CBC6-3D6E + D1C6-3DAE + + + Always fight Rayden + CBC6-3D6E + D5C6-3DAE + + + Always fight Sub-Zero + CBC6-3D6E + D6C6-3DAE + + + Always fight Reptile + CBC6-3D6E + DBC6-3DAE + + + Always fight Scorpion + CBC6-3D6E + DCC6-3DAE + + + Always fight Jax + CBC6-3D6E + D8C6-3DAE + + + Always fight Kintaro + CBC6-3D6E + DAC6-3DAE + + + Always fight Shao Kahn + CBC6-3D6E + D2C6-3DAE + + + Always fight Smoke + CBC6-3D6E + D3C6-3DAE + + + Always fight Noob Saibot + CBC6-3D6E + DEC6-3DAE + + + Always fight Jade + CBC6-3D6E + FDC6-3DAE + + + Mileena's Sai Throw does massive damage + 06E1-17D4 + + + Liu Kang's High Fireball does massive damage + 06E9-1DD7 + + + Kung Lao's Hat Throw does massive damage + 06E2-1767 + + + Cage's Shadow Kick does massive damage + 06EF-4767 + + + Reptile's Force Ball does massive damage + 06EB-17AF + + + Shang Tsung's Flaming Skull attack does massive damage + 06E0-4FA4 + + + Kitana's Fan Throw does massive damage + 06E9-17A4 + + + Baraka's Blade Spark does massive damage + 06EE-C4A4 + + + Rayden's Lightning Bolt does massive damage + 06E4-34DF + + + Enable all 2P rules/moves when fighting computer + 6DCF-4D9D + + + + Mortal Kombat II (USA) (Rev 1) + + No health - P1 + DDB1-1FF7 + + + No health - P2/CPU + DDB5-1FF7 + + + Have 127x more fatality time + 5EC3-CF02 + + + Disable throws - 2P mode + 622B-C7AC + + + Enable all 2P rules/moves when fighting computer + 6DCF-4D9D + + + + Mortal Kombat (USA) + + Infinite health + CF30-CFAF + 6230-C40F + 8B30-C46F + + + Infinite time + C9B2-17AF + + + Have much more fatality time + 5EB5-3F64 + + + Each round is 199 seconds (time counts down twice) + D466-3D04 + + + Each round is 90 seconds + BF66-3DD4 + DD66-3D04 + + + Each round is 80 seconds + 6F66-3DD4 + DD66-3D04 + + + Each round is 70 seconds + 5F66-3DD4 + DD66-3D04 + + + Each round is 60 seconds + 1F66-3DD4 + DD66-3D04 + + + Each round is 50 seconds + 9F66-3DD4 + DD66-3D04 + + + Each round is 40 seconds + 0F66-3DD4 + DD66-3D04 + + + Each round is 30 seconds + 7F66-3DD4 + DD66-3D04 + + + Each round is 20 seconds + 4F66-3DD4 + DD66-3D04 + + + Each round is 10 seconds + FF66-3DD4 + DD66-3D04 + + + Always fight in the the Courtyard + DD6A-47AF + + + After 1st match, almost always fight at the Palace Gates + CB6A-44AF + DF6A-47DF + + + After 1st match, almost always fight in the Warrior Shrine + CB6A-44AF + D46A-47DF + + + After 1st match, almost always fight in the Pit + CB6A-44AF + D76A-47DF + + + After 1st match, almost always fight in the Throne Room + CB6A-44AF + D06A-47DF + + + After 1st match, almost always fight in Goro's Lair + CB6A-44AF + D96A-47DF + + + After 1st match, almost always fight in the bottom of the pit (screen says Goro's Lair) + CB6A-44AF + D16A-47DF + + + Almost always fight Johnny Cage + CBBA-394F + DDBA-391F + + + Almost always fight Kano + CBBA-394F + DFBA-391F + + + Almost always fight Rayden + CBBA-394F + D4BA-391F + + + Almost always fight Liu Kang + CBBA-394F + D7BA-391F + + + Almost always fight Scorpion + CBBA-394F + D0BA-391F + + + Almost always fight Sub-Zero + CBBA-394F + D9BA-391F + + + Almost always fight Sonya Blade + CBBA-394F + D1BA-391F + + + Almost always fight Goro (don't use Kano's or Johnny Cage's finishing move on Goro) + CBBA-394F + D5BA-391F + + + Start on Match 2 + DF61-14DD + + + Start on Match 3 + D461-14DD + + + Start on Match 4 + D761-14DD + + + Start on Match 5 + D061-14DD + + + Start on Match 6 + D961-14DD + + + Start on Mirror Match + D161-14DD + + + Start on Endurance 1 match + D561-14DD + + + Start on Endurance 2 match + D661-14DD + + + Start on Endurance 3 match + DB61-14DD + + + Start on match with Goro + DC61-14DD + + + Start on match with Shang Tsung + D861-14DD + + + Always get Flawless Victory bonus + 6DB8-3D67 + + + First strike of any kind wins round + DDBC-370F + + + All throws do more damage + 56B9-4DAD + + + Kano's High Punch does more damage + F320-1914 + + + Kano's Low Punch does more damage + F320-15C4 + + + Kano's High Kick does more damage + 0626-1514 + + + Kano's Low Kick does more damage + 062B-19C4 + + + Kano's Head Blow does more damage + 0621-1044 + + + Kano's Knee does more damage + 0629-1934 + + + Kano's Crouched Kick does more damage + 7A26-1944 + + + Kano's Uppercut does more damage + 5625-1134 + + + Kano's Roundhouse Kick does more damage + 1D27-1544 + + + Kano's Foot Sweep does more damage + 7A25-10C4 + + + Kano's Flying Punch does more damage + 082C-1144 + + + Kano's Knife does more damage (only at close distance) + 0824-11C4 + + + Johnny Cage's High Punch does more damage + F32C-4944 + + + Johnny Cage's Low Punch does more damage + F32C-4514 + + + Johnny Cage's High Kick does more damage + 062B-40C4 + + + Johnny Cage's Low Kick does more damage + 042B-4134 + + + Johnny Cage's Head Blow does more damage + 7A2A-4144 + + + Johnny Cage's Knee does more damage + 0622-4014 + + + Johnny Cage's Crouched Kick does more damage + F628-4534 + + + Johnny Cage's Uppercut does more damage + 5622-41C4 + + + Johnny Cage's Roundhouse Kick does more damage + 1D26-4114 + + + Johnny Cage's Foot Sweep does more damage + 7A28-49C4 + + + Johnny Cage's Flying Punch does more damage + 0826-4044 + + + Johnny Cage's Shadow Kick does more damage + 9C20-41C4 + + + Johnny Cage's Fireball does more damage (only at close distance) + 0821-4914 + + + Johnny Cage's Split Punch does more damage + 1129-4544 + + + Liu Kang's High Punch does more damage + F323-C034 + + + Liu Kang's Low Punch does more damage + F323-C544 + + + Liu Kang's High Kick does more damage + 0624-30C4 + + + Liu Kang's Low Kick does more damage + 0624-3134 + + + Liu Kang's Head Blow does more damage + 7A28-C534 + + + Liu Kang's Knee does more damage + 062E-C914 + + + Liu Kang's Crouched Kick does more damage + 7A2F-3114 + + + Liu Kang's Uppercut does more damage + 562F-3044 + + + Liu Kang's Roundhouse Kick does more damage + 1D22-C1C4 + + + Liu Kang's Foot Sweep does more damage + 7A2D-3934 + + + Liu Kang's Flying Punch does more damage + 0827-3514 + + + Liu Kang's Special Flying Kick does more damage + 9C28-C9C4 + + + Liu Kang's Fireball does more damage (only at close distance) + 082A-C144 + + + Sonya Blade's High Punch does more damage + F32F-393F + + + Sonya Blade's Low Punch does more damage + F324-304F + + + Sonya Blade's High Kick does more damage + 9023-C01F + + + Sonya Blade's Low Kick does more damage + 9F23-C1CF + + + Sonya Blade's Head Blow does more damage + 7A2E-C03F + + + Sonya Blade's Knee does more damage + 062E-C54F + + + Sonya Blade's Crouched Kick does more damage + 7A2D-35CF + + + Sonya Blade's Uppercut does more damage + 5624-311F + + + Sonya Blade's Roundhouse Kick does more damage + 1122-C14F + + + Sonya Blade's Foot Sweep does more damage + 7A2A-C53F + + + Sonya Blade's Flying Punch does more damage + 0827-313F + + + Sonya Blade's Leg Grab does more damage + 5620-17A7 + + + Sonya Blade's Sonic Rings does more damage (only at close distance) + 0822-C13F + + + Sonya Blade's Special Flying Kick does more damage + 0827-313F + + + Rayden's High Punch does more damage + F324-C914 + + + Rayden's Low Punch does more damage + F327-C934 + + + Rayden's High Kick does more damage + 092F-C034 + + + Rayden's Low Kick does more damage + 042F-C544 + + + Rayden's Head Blow does more damage + 7A29-C0C4 + + + Rayden's Knee does more damage + 0629-C134 + + + Rayden's Crouched Kick does more damage + F620-C114 + + + Rayden's Uppercut does more damage + 5621-C944 + + + Rayden's Roundhouse Kick does more damage + 9C2D-C1C4 + + + Rayden's Foot Sweep does more damage + 7A20-C044 + + + Rayden's Flying Punch does more damage + 082D-C014 + + + Rayden's Flying Thunderbolt does more damage + 9C22-1514 + + + Rayden's Lightning does more damage (only at close distance) + 0823-19C4 + + + Scorpion's, Sub-Zero's and Reptile's High Punch do more damage + F328-3934 + + + Scorpion's, Sub-Zero's and Reptile's Low Punch do more damage + F32A-3044 + + + Scorpion's, Sub-Zero's and Reptile's High Kick do more damage + 062E-39C4 + + + Scorpion's, Sub-Zero's and Reptile's Low Kick do more damage + 062E-3534 + + + Scorpion's, Sub-Zero's and Reptile's Head Blow do more damage + 7A22-30C4 + + + Scorpion's, Sub-Zero's and Reptile's Knee do more damage + 062A-3114 + + + Scorpion's, Sub-Zero's and Reptile's Crouched Kick do more damage + F62F-41C7 + + + Scorpion's, Sub-Zero's and Reptile's Uppercut do more damage + 562C-35C4 + + + Scorpion's, Sub-Zero's and Reptile's Roundhouse Kick do more damage + 1D2F-4017 + + + Scorpion's, Sub-Zero's and Reptile's Foot Sweep do more damage + 7A2D-4147 + + + Scorpion's, Sub-Zero's and Reptile's Flying Punch do more damage + 0823-3944 + + + Sub-Zero's and Reptile's Deep Freeze do damage + 462C-3914 + + + Sub-Zero's and Reptile's Slide do more damage + 4525-3144 + + + Scorpion's and Reptile's Harpoon do more damage + F626-31C4 + + + Scorpion's and Reptile's Scorpion Split do more damage + 0823-3944 + + + + Mr. Do! (USA) + + Infinite lives + 7E18B209 + + + Two enemies on screen at most + 7E144000 + + + Level modifier (level is always one less than entered) + 7E189E?? + 7E18A0?? + 7E18B4?? + + + + Mr. Nutz (USA) (En,Fr) + + Invincibility + 7E008D2D + + + Infinite Nuts + 7E0A2999 + + + Infinite coins + 7E189499 + + + + Mr. Tuff (USA) (En,Fr,De) (Proto) (1994-07-12) + + Invincibility + 7EEB46FE + + + Infinite health + 7ED58003 + + + Infinite lives + 7ED58003 + + + No targets to smash + 7EEB2E00 + + + + Ms. Pac-Man (USA) + + Ghosts eatable at start and infinite power pill time + 7E029E03 + + + Infinite Power Pellet time + 7E029E01 + + + Infinite lives + 7E028C03 + + + Level modifier + 7E039E?? + + + + Mystic Ark (Japan) + + 999 HP for hero + 7EB0040F + 7EB00527 + + + 999 MP for Hero + 7EB008E7 + 7EB00903 + + + Have enough gold + 7EB120FF + 7EB121FF + + + Quick gain EXP + 7E0551FF + 7E0552FF + + + + NBA All-Star Challenge (USA) + + P1 can't score in the 1-on-1, free throw or tournament stages + 123B-3F0D + + + P2 or computer can't score in the 1-on-1, free throw or tournament events + A238-340D + + + P1 can't score in 3-point shootout + A239-1F0D + + + P1 can't score in 3-point shootout + A237-176D + + + P2 or computer can't score in 3-point shootout + A23F-176D + + + P2 or computer can't score in 3-point shootout + A23D-1FAD + + + Stop shot clock (1-on-1 and 1-on-1 tournament modes) + A2C6-3F07 + 6DC6-3DA7 + + + 12-second shot clock (1-on-1 and 1-on-1 tournament modes) + DFC3-34D7 + D4C3-3DA7 + + + 48-second shot clock - after the 1st shot (1-on-1 and 1-on-1 tournament modes) + D0C3-34D7 + D6C3-3DA7 + + + + NBA Jam - Tournament Edition (USA) + + P1 starts with 1 point + 33E0-4DAC + + + P2 starts with 1 point + 33E0-47AC + + + Infinite shot clock time + C2C9-1467 + + + Lets you set shot clock option down to 1 + DF62-1B1B + + + P1 has almost infinite turbo + C28B-1DA5 + + + P2 has almost infinite turbo + C286-1B2B + + + P1 turbo recharges quicker + DF8A-1D65 + + + P1 has twice as much turbo + 0D8A-1FA5 + + + P2 turbo recharges quicker + DF88-1BBB + + + P2 has twice as much turbo + 0D88-1C2B + + + P1's shots worth more + 76C2-6DDF + + + P2's shots worth more + 76C3-DF04 + + + Player is on fire after 2 baskets instead of 3 + D0BF-11C8 + + + P1 has no turbo - except in tournament mode + CB88-1565 + + + P2 has no turbo - except in tournament mode + CB88-16BB + + + All players are much faster - except in tournament mode + DDE4-0B28 + D1E4-08F8 + + + All players are super fast - except in tournament mode + DDE4-0B28 + DBE4-08F8 + + + Hot spots and Power ups are on in tournament mode automatically (don't select the Special Features M + D1E9-DC98 + + + All secret power-ups on for all human players + DDE5-C74C + 6DEB-CD4C + + + All secret power-ups except slippery floors on for all human players + DDE5-C74C + 6DEB-CD4C + 41E5-F47D + + + All secret power-ups on for P1 + EEEA-1FDC + EEEA-1F0C + + + P1 has Power push, Power-up 3pts, Infinite turbo, Always on fire, Super dunks, Max power, power-up goal tending, and quick hands + EEEA-1FDC + + + P1 has Power-up offense, speed up, block opponent to make both fall, teleport pass, and high shots + EEEA-1F0C + + + P1 has power push + DFEA-1FDC + + + P1 has powered up 3 pointers + D4EA-1FDC + + + P1 has infinite turbo + D0EA-1FDC + + + P1 is always on fire + D6EA-1FDC + + + P1 has super dunks + FDEA-1FDC + + + P1 has max power + 4DEA-1FDC + + + P1 has powered up goal tending + 0DEA-1FDC + + + P1 has quick hands + 6DEA-1FDC + + + P1 has powered up offense + DFEA-1F0C + + + P1 moves very quickly + D4EA-1F0C + + + P1 knocks down both opponents by pushing one + D0EA-1F0C + + + P1 has teleport passes + D6EA-1F0C + + + P1 knocks down opposite opponent + FDEA-1F0C + + + P1 has high shots + 4DEA-1F0C + + + All secret power-ups on for P2 + EEE1-C46C + EEE1-C4AC + + + P2 has Power Block, Power-up 3pts, Infinite turbo, Always on fire, Super dunks, Max power, power-up goal tending, and quick hands + EEE1-C46C + + + P2 has Power-up offense, speed up, block opponent to make both fall, teleport pass, and high shots + EEE1-C4AC + + + P2 has Power Block + DFE1-C46C + + + P2 has powered up 3 pointers + D4E1-C46C + + + P2 has infinite turbo + D0E1-C46C + + + P2 is always on fire + D6E1-C46C + + + P2 has super dunks + FDE1-C46C + + + P2 has max power + 4DE1-C46C + + + P2 has powered up goal tending + 0DE1-C46C + + + P2 has quick hands + 6DE1-C46C + + + P2 has powered up offense + DFE1-C4AC + + + P2 moves very quickly + D4E1-C4AC + + + P2 knocks down both opponents by pushing two + D0E1-C4AC + + + P2 has teleport passes + D6E1-C4AC + + + P2 knocks down opposite opponent + FDE1-C4AC + + + P2 has high shots + 4DE1-C4AC + + + All secret power-ups on for P3 + EEEF-3DDC + EEEF-3D0C + + + P3 has Power Block, Power-up 3pts, Infinite turbo, Always on fire, Super dunks, Max power, power-up goal tending, and quick hands + EEEF-3DDC + + + P3 has Power-up offense, speed up, block opponent to make both fall, teleport pass, and high shots + EEEF-3D0C + + + P3 has Power Block + DFEF-3DDC + + + P3 has powered up 3 pointers + D4EF-3DDC + + + P3 has infinite turbo + D0EF-3DDC + + + P3 is always on fire + D6EF-3DDC + + + P3 has super dunks + FDEF-3DDC + + + P3 has max power + 4DEF-3DDC + + + P3 has powered up goal tending + 0DEF-3DDC + + + P3 has quick hands + 6DEF-3DDC + + + P3 has powered up offense + DFEF-3D0C + + + P3 moves very quickly + D4EF-3D0C + + + P3 knocks down both opponents by pushing three + D0EF-3D0C + + + P3 has teleport passes + D6EF-3D0C + + + P3 knocks down opposite opponent + FDEF-3D0C + + + P3 has high shots + 4DEF-3D0C + + + All secret power-ups on for P4 + EEE8-3F6C + EEE8-3FAC + + + P4 has Power Block, Power-up 3pts, Infinite turbo, Always on fire, Super dunks, Max power, power-up goal tending, and quick hands + EEE8-3F6C + + + P4 has Power-up offense, speed up, Block opponent to make both fall, teleport pass and high shots + EEE8-3FAC + + + P4 has Power Block + DFE8-3F6C + + + P4 has powered up 3 pointers + D4E8-3F6C + + + P4 has infinite turbo + D0E8-3F6C + + + P4 is always on fire + D6E8-3F6C + + + P4 has super dunks + FDE8-3F6C + + + P4 has max power + 4DE8-3F6C + + + P4 has powered up goal tending + 0DE8-3F6C + + + P4 has quick hands + 6DE8-3F6C + + + P4 has powered up offense + DFE8-3FAC + + + P4 moves very quickly + D4E8-3FAC + + + P4 knocks down both opponents by pushing four + D0E8-3FAC + + + P4 has teleport passes + D6E8-3FAC + + + P4 knocks down opposite opponent + FDE8-3FAC + + + P4 has high shots + 4DE8-3FAC + + + + NBA Jam (USA) (Rev 1) + + Visitor's baskets worth 1 + BBCC-0F6F + + + Visitor's baskets worth 2 + 34CC-0F6F + + + Visitor's baskets worth 3 + 30CC-0F6F + + + Visitor's baskets worth 4 + 39CC-0F6F + + + Visitor's baskets worth 5 + 35CC-0F6F + + + Visitor's baskets worth 6 + 36CC-0F6F + + + Visitor's baskets worth 7 + 3CCC-0F6F + + + Visitor's baskets worth 8 + 3ACC-0F6F + + + Home's baskets worth 1 + BBC6-A7AF + + + Home's baskets worth 2 + 34C6-A7AF + + + Home's baskets worth 3 + 30C6-A7AF + + + Home's baskets worth 4 + 39C6-A7AF + + + Home's baskets worth 5 + 35C6-A7AF + + + Home's baskets worth 6 + 36C6-A7AF + + + Home's baskets worth 7 + 3CC6-A7AF + + + Home's baskets worth 8 + 3AC6-A7AF + + + All players have super dunk ability + D8E8-C718 + + + All players have super dunk ability (alt) + D8E7-C448 + + + All players have infinite turbo + D6E3-C748 + + + All players have infinite turbo (alt) + D6E1-CF38 + + + All players always on fire + D6E2-CFC8 + + + All players always on fire (alt) + D6E9-CD18 + + + All players have super interception ability + D8E6-C7C8 + + + All players have super interception ability (alt) + D8ED-C418 + + + Juice mode + D6ED-3DC8 + + + Juice mode (alt) + D6E5-C718 + + + Shot success percentages displayed for non-dunk shots + D6EC-CF38 + + + Shot success percentages displayed for non-dunk shots (alt) + D6E4-CDC8 + + + Only need 2 baskets to be on fire (1 of 2) + D4BD-3038 + + + Only need 2 baskets to be on fire (2 of 2) + D4BA-C948 + + + Need 4 baskets to be on fire + D0BD-3038 + + + Need 5 baskets to be on fire + D9BD-3038 + + + Need 6 baskets to be on fire + D1BD-3038 + + + Need 7 baskets to be on fire + D5BD-3038 + + + Need 8 baskets to be on fire + D6BD-3038 + + + Need 9 baskets to be on fire + DBBD-3038 + + + Need 10 baskets to be on fire + DCBD-3038 + + + Need 2 baskets to stay on fire until an opponent goes on fire + D4BD-3038 + + + Turbo bar never goes up (until next quarter) + DDE6-3B2A + + + Turbo bar never goes up (until next quarter) (alt) + DDE1-3C2A + + + Turbo bar restores very slowly + D3E6-3B2A + + + Turbo bar restores very slowly (alt) + D3E1-3C2A + + + Turbo bar restores much slower + F9E6-3B2A + + + Turbo bar restores much slower (alt) + F9E1-3C2A + + + Turbo bar restores slower + F2E6-3B2A + + + Turbo bar restores slower (alt) + F2E1-3C2A + + + Turbo bar restores faster + 0DE6-3B2A + + + Turbo bar restores faster (alt) + 0DE1-3C2A + + + Turbo bar restores much faster + 9DE6-3B2A + + + Turbo bar restores much faster (alt) + 9DE1-3C2A + + + Turbo bar restores extremely fast + 6FE6-3B2A + + + Turbo bar restores extremely fast (alt) + 6FE1-3C2A + + + Turbo drains very slowly + D0E5-3CFA + + + Turbo drains very slowly (alt) + D0E9-38FA + + + Turbo drains slower + D6E5-3CFA + + + Turbo drains slower (alt) + D6E9-38FA + + + Turbo drains slightly slower + FDE5-3CFA + + + Turbo drains slightly slower (alt) + FDE9-38FA + + + Turbo drains slightly faster + 44E5-3CFA + + + Turbo drains slightly faster (alt) + 44E9-38FA + + + Turbo drains faster + 42E5-3CFA + + + Turbo drains faster (alt) + 42E9-38FA + + + Turbo drains very fast + 76E5-3CFA + + + Turbo drains very fast (alt) + 76E9-38FA + + + + NBA Showdown (USA) + + No personal fouls - both teams + C23B-44A8 + + + 12-sec. shot clock when ball is in-bounded - P1 + DAE3-14AA + DAB7-37DA + DA3F-140F + + + 12-sec. shot clock when ball is in-bounded - computer + DAE3-14AA + DA6E-47D8 + DA84-CDDB + + + Infinite shot clock - computer + C220-4FDF + + + Infinite time + C224-4DA4 + + + 1-min. quarters + DFED-342C + + + 3 time-outs + D7E1-1D6A + + + Infinite time-outs + C239-1F6D + + + + NCAA Basketball (USA) (Rev 1) + + Shot timer starts at 10 sec. instead of 45 + FDBB-DDD9 + + + Shot timer starts at 20 sec. + 4DBB-DDD9 + + + Shot timer starts at 30 sec. + 7DBB-DDD9 + + + Shot timer starts at 60 sec. + 1DBB-DDD9 + + + Shot timer starts at 90 sec. + BDBB-DDD9 + + + Infinite time to shoot + C2B5-DDA9 + + + Infinite timeouts - P1 + C224-6FDF + + + Infinite timeouts - P2 + C224-676F + + + 3-point shots worth 0 - both players + DD34-A767 + + + 3-point shots worth 1 point + DF34-A767 + + + 3-point shots worth 2 points + D434-A767 + + + 3-point shots worth 4 points + D034-A767 + + + 3-point shots worth 5 points + D934-A767 + + + 3-point shots worth 6 points + D134-A767 + + + 3-point shots worth 7 points + D534-A767 + + + 3-point shots worth 8 points + D634-A767 + + + 3-point shots worth 9 points + DB34-A767 + + + P1 shots worth 1 extra point (2-pt. shots worth 3, 3-pt. shots worth 4) + 76BA-A404 + 76B9-6FA7 + + + P2 shots worth 1 extra point (2-pt. shots worth 3, 3-pt. shots worth 4) + 76B0-64A7 + 76B8-A704 + + + P1 free throws worth 2 instead of 1 + 76BD-0D07 + + + P2 free throws worth 2 + 76BE-DF07 + + + No 5-second violations + C265-D4D7 + + + + NHLPA Hockey '93 (USA) + + Period clock runs faster + F160-4776 + + + Period clock runs slower + D060-4776 + + + Period clock runs much faster + 0D60-4776 + + + Period clock runs much slower + DF60-4776 + + + Period clock is frozen (no time limit) + C269-4D86 + + + Each period lasts 1 minute instead of 10 minutes + 7AE8-4D98 + DDE8-4DB8 + + + Each period lasts 2 minutes + 56E8-4D98 + DDE8-4DB8 + + + Each period lasts 3 minutes + 80E8-4D98 + DDE8-4DB8 + + + Each period lasts 4 minutes + EDE8-4D98 + DDE8-4DB8 + + + Each period lasts 15 minutes + 60E8-4D98 + D7E8-4DB8 + + + Each period lasts 30 minutes + D6E8-4D98 + D5E8-4DB8 + + + Each period lasts 40 minutes + 1DE8-4D98 + DBE8-4DB8 + + + Each period lasts 60 minutes + FDE8-4D98 + D3E8-4DB8 + + + All penalties last 1 minute + DF31-3F64 + CB31-3F04 + + + All penalties last 2 minutes + D431-3F64 + CB31-3F04 + + + All penalties last 3 minutes + D731-3F64 + CB31-3F04 + + + All penalties last 4 minutes + D031-3F64 + CB31-3F04 + + + All penalties last 5 minutes + D931-3F64 + CB31-3F04 + + + All penalties last 7 minutes + D531-3F64 + CB31-3F04 + + + All penalties last 9 minutes + DB31-3F64 + CB31-3F04 + + + + NHL Stanley Cup (USA) (En,Fr) + + Visitor starts with 1 point (exhibition mode) + DF67-CDA4 + D667-CFA4 + E667-CF64 + + + Home starts with 1 point (exhibition mode) + DF67-CDA4 + D667-CFA4 + EC67-CF64 + + + Visitor starts with 3 points (exhibition mode) + D767-CDA4 + D667-CFA4 + E667-CF64 + + + Home starts with 3 points (exhibition mode) + D767-CDA4 + D667-CFA4 + EC67-CF64 + + + Visitor starts with 5 points (exhibition mode) + D967-CDA4 + D667-CFA4 + E667-CF64 + + + Home starts with 5 points (exhibition mode) + D967-CDA4 + D667-CFA4 + EC67-CF64 + + + Visitor starts with 7 points (exhibition mode) + D567-CDA4 + D667-CFA4 + E667-CF64 + + + Home starts with 7 points (exhibition mode) + D567-CDA4 + D667-CFA4 + EC67-CF64 + + + Visitor starts with 9 points (exhibition mode) + DB67-CDA4 + D667-CFA4 + E667-CF64 + + + Home starts with 9 points (exhibition mode) + DB67-CDA4 + D667-CFA4 + EC67-CF64 + + + Visitor scores 1 point for goals, Home scores 3 + 1BA1-4D01 + + + Periods are 1 min (choose 5 minutes from Options) + DFE0-CD0F + + + Periods are 3 min (choose 5 minutes from Options) + D7E0-CD0F + + + Periods are 7 min (choose 5 minutes from Options) + D5E0-CD0F + + + Periods are 9 min (choose 5 minutes from Options) + DBE0-CD0F + + + Periods are 15 min (choose 10 minutes from Options) + 94ED-C46F + + + Periods are 30 min (choose 10 minutes from Options) + D7E0-C76F + + + Penalty for charging is 1 minute instead of 2 + 7A2B-3F00 + + + Penalty for holding is 1 minute instead of 2 + 7A2B-3760 + + + Penalty for tripping is 1 minute instead of 2 + 7A2C-3FA0 + + + Penalty for high sticking is 1 minute instead of 2 + 7A28-3DD0 + + + Penalty for elbowing is 1 minute instead of 2 + 7A28-3400 + + + Penalty for hooking is 1 minute instead of 2 + 7A2A-3D60 + + + Penalty for roughing is 1 minute instead of 2 + 7A2A-34A0 + + + Penalty for slashing is 1 minute instead of 4 + 7A22-3FD0 + + + Penalty for spearing is 1 minute instead of 2 + 7A22-3700 + + + Penalty for charging is 30 seconds + F32B-3F00 + + + Penalty for holding is 30 seconds + F32B-3760 + + + Penalty for tripping is 30 seconds + F32C-3FA0 + + + Penalty for high sticking is 30 seconds + F328-3DD0 + + + Penalty for elbowing is 30 seconds + F328-3400 + + + Penalty for hooking is 30 seconds + F32A-3D60 + + + Penalty for roughing is 30 seconds + F32A-34A0 + + + Penalty for slashing is 30 seconds + F322-3FD0 + + + Penalty for spearing is 30 seconds + F322-3700 + + + Penalty for charging is 3 minutes + 802B-3F00 + + + Penalty for holding is 3 minutes + 802B-3760 + + + Penalty for tripping is 3 minutes + 802C-3FA0 + + + Penalty for high sticking is 3 minutes + 8028-3DD0 + + + Penalty for elbowing is 3 minutes + 8028-3400 + + + Penalty for hooking is 3 minutes + 802A-3D60 + + + Penalty for roughing is 3 minutes + 802A-34A0 + + + Penalty for slashing is 3 minutes + 8022-3FD0 + + + Penalty for spearing is 3 minutes + 8022-3700 + + + + Nigel Mansell's World Championship Racing (USA) + + Almost no tire wear (graphic distortion in the pits) + C96B-1705 + C9B1-4D61 + + + Only 1 lap required on all tracks + E481-3467 + + + Only 3 laps required in South Africa + D461-4FBA + + + Only 3 laps required in Mexico + D461-44FA + + + Only 3 laps required in Brazil + D461-44BA + + + Only 3 laps required in Spain + D461-47FA + + + Only 3 laps required in San Marino + D461-47BA + + + Only 3 laps required in Monaco + D465-4DFA + + + Only 3 laps required in Canada + D465-4DBA + + + Only 3 laps required in France + D465-4FFA + + + Only 3 laps required in Britain + D465-4FBA + + + Only 3 laps required in Germany + D465-44FA + + + Only 3 laps required in Hungary + D465-44BA + + + Only 3 laps required in Belgium + D465-47FA + + + Only 3 laps required in Italy + D465-47BA + + + Only 3 laps required in Portugal + D466-4DFA + + + Only 3 laps required in Japan + D466-4DBA + + + Only 3 laps required in Australia + D466-4FFA + + + Start in Mexico in the Full Season + DF62-0953 + + + Start in Brazil + D462-0953 + + + Start in Spain + D762-0953 + + + Start in San Marino + D062-0953 + + + Start in Monaco + D962-0953 + + + Start in Canada + D162-0953 + + + Start in France + D562-0953 + + + Start in Britain + D662-0953 + + + Start in Germany + DB62-0953 + + + Start in Hungary + DC62-0953 + + + Start in Belgium + D862-0953 + + + Start in Italy + DA62-0953 + + + Start in Portugal + D262-0953 + + + Start in Japan + D362-0953 + + + Start in Australia + DE62-0953 + + + Start on extra course (stats are for South Africa but the course is different) + FD62-0953 + + + Full season ends after South Africa + DF3E-015A + + + Full season ends after Mexico + D43E-015A + + + Full season ends after Brazil + D73E-015A + + + Full season ends after Spain + D03E-015A + + + Full season ends after San Marino + D93E-015A + + + Full season ends after Monaco + D13E-015A + + + Full season ends after Canada + D53E-015A + + + Full season ends after France + D63E-015A + + + Full season ends after Britain + DB3E-015A + + + Full season ends after Germany + DC3E-015A + + + Full season ends after Hungary + D83E-015A + + + Full season ends after Belgium + DA3E-015A + + + Full season ends after Italy + D23E-015A + + + Full season ends after Portugal + D33E-015A + + + Full season ends after Japan + DE3E-015A + + + + Ninja Gaiden Trilogy (USA) + + (NG) Invincibility + 6DB5-3797 + + + (NG) Infinite health + C9C3-3F2D + + + (NG) Infinite time + DD81-1F97 + + + (NG) Start with very little time + B1C8-3DF8 + + + (NG) Start with lots of time + EEC8-3DF8 + + + (NG) Restart with very little health (after first life) + DFCE-142F + + + (NG) Restart with about half health (after first life) + DFCE-142F + + + (NG) Start with 1 life + DDC5-4DF4 + + + (NG) Start with 5 lives + D7C5-4DF4 + + + (NG) Start with 9 lives + D6C5-4DF4 + + + (NG) Infinite lives + C9CF-CFBF + + + (NGII) Invincibility + 1DB4-CD4D + + + (NGII) Infinite health + C9BB-441F + + + (NGII) Infinite time + C96F-1FC7 + + + (NGII) Start with very little health + DFB3-144F + + + (NGII) Start with about half health + D6B3-144F + + + (NGII) Start every life with two shadow ninjas + DEB9-14C4 + + + (NGII) Throwing stars doesn't use energy (ignore counter) + DFC4-1F47 + + + (NGII) Start with 1 life + DDB3-C4CF + + + (NGII) Infinite lives + C961-3D37 + + + (NGIII) Invincibility + DDAB-3FE7 + + + (NGIII) Infinite health + C92A-CFED + + + (NGIII) Infinite time + C927-17EF + + + (NGIII) Almost infinite ninja power + C9A7-C757 + + + (NGIII) Start with 99 weapon points (ignore counter) + 176C-CDE7 + + + (NGIII) Start with 1 life + DD6B-CF87 + + + (NGIII) Start with 5 lives + D76B-CF87 + + + (NGIII) Start with 9 lives + D66B-CF87 + + + (NGIII) Infinite lives + CB69-CD57 + + + (NGIII) Start with very little health + DF68-CD77 + + + + Ninjawarriors, The (USA) + + Invincibility + EDB0-D768 + ED8E-AD0B + 2DB1-DDD8 + 2DB1-DF08 + 2D8D-A70B + + + Infinite health + C2B0-DD6C + + + Infinite time + 62C4-6DD7 + + + Infinite specials once you obtain one + CECB-A467 + + + + No Escape (USA) + + Infinite health + 852A-CF67 + + + Infinite time + CBB4-C75F + + + Infinite lives + 842F-44A7 + + + + Nolan Ryan's Baseball (USA) + + 1 strike and batter is out + A3BF-6DD1 + + + Batter never strikes out + C2BF-6DD1 + + + 1 ball and batter walks + A3BE-0D61 + + + Batter never walks + C2BE-0D61 + + + Each run worth 2 - P1 + 76AC-0D65 + + + Each run worth 2 - P2 + 76A8-04D5 + + + Short game (play only odd-numbered innings) + 766D-67A5 + + + Increasing a player's power setting does not decrease the power number excess (use to maximize stats + DDC8-D706 + + + Maximum power for a player is 32 instead of 25 + 4DBF-A7A8 + + + Maximum power for a player is 40 instead of 25 + 46BF-A7A8 + + + Maximum power for a player is 48 + 7DBF-A7A8 + + + + Nosferatu (USA) + + Almost infinite health + C9BA-1F04 + + + Start with very little health + DFB2-34D7 + + + Start with less health + D7B2-34D7 + + + Start with more health + DBB2-34D7 + + + Start with a lot more health + DEB2-34D7 + + + Start with more time + CBCE-CDAD + 44CE-CFDD + DDCE-CF0D + + + Infinite time + C127-4D67 + + + Start on stage 1-2 + D1B3-3DA7 + + + Start on stage 1-3 + DBB3-3DA7 + + + Start on stage 2 + DCB3-3DA7 + + + Start on stage 2-2 + FDB3-3DA7 + + + Start on stage 2-3 + FFB3-3DA7 + + + Start on stage 2-4 + F5B3-3DA7 + + + Start on stage 3 + F6B3-3DA7 + + + Start on stage 3-2 + 4DB3-3DA7 + + + Start on stage 3-3 + 40B3-3DA7 + + + Start on stage 4 + 45B3-3DA7 + + + Start on stage 4-2 + 42B3-3DA7 + + + Start on stage 4-3 + 43B3-3DA7 + + + Start on stage 4-4 + 70B3-3DA7 + + + Start on stage 5 + 79B3-3DA7 + + + Start on stage 5-2 + 78B3-3DA7 + + + Start on stage 5-3 + 7AB3-3DA7 + + + Start on stage 5-4 + 09B3-3DA7 + + + Start on stage 6 + 01B3-3DA7 + + + Start on stage 6-2 + 03B3-3DA7 + + + Start on the final stage + 90B3-3DA7 + + + Watch the ending + 91B3-3DA7 + + + Start on the final stage with more crystals + 90B3-3DA7 + 62B3-3FA7 + + + Don't lose crystals when you get hit + C265-3DBD + + + + Obitus (USA) + + Infinite health + 7E111320 + + + Infinite Stamina + 7E111720 + + + Infinite Daggers (Keep off until you obtain one) + 7F132E02 + + + Infinite Silver Keys (Keep off until you obtain one) + 7F0ED802 + + + Infinite Gold Coins (Keep off until you obtain one) + 7F0E8E63 + + + + Ogre Battle - The March of the Black Queen (USA) + + Level up after every battle (even if you run away) + DD2F-AFF4 + + + View 'Edit Units' screen to give everyone 2778 max HP (2000 of it won't be visible, and you won't get your HP restored. It will go down to 999 max HP if it tries to update the amount) + CBE7-A70C + B2E0-AD6C + 2CE0-ADAC + DCE0-AFDC + + + View someone's stats from 'Edit Units' screen to give them max Luck + CB67-ADFB + EE67-AD9B + 3C67-ADBB + BE67-AD2B + + + View someone's stats from 'Edit Units' screen to give them max Cha + CB6F-A7FB + 196F-A79B + 3C6F-A7BB + BE6F-A72B + + + Every hidden thing is visible when you first enter an area + CB6A-AD20 + CB6A-AF90 + EE6A-AFB0 + + + Leader's group moves 'Sky High' + DDE6-1D68 + + + Lans' group moves 'Sky High' + DDE7-1F68 + + + Judgement tarot card is stronger + EE20-070E + + + + On the Ball (USA) + + Start with 2 credits + DF66-DDA0 + + + Start with 6 credits + D966-DDA0 + + + Start with 8 credits + D566-DDA0 + + + Start with 10 credits + DB66-DDA0 + + + Infinite credits + C2AE-DF65 + + + Faster timer + D4BB-D404 + + + Stop timer - not lap timer (can still lose time by hitting hazards) + DDBB-D404 + + + Minus blocks and bricks worth 0 + C2BA-D7D4 + + + Minus 2 second block worth 0 + DDB7-0DA5 + + + Minus 2 second block worth minus 1 + FDB7-0DA5 + + + Minus 2 second block worth minus 3 + 7DB7-0DA5 + + + Minus 2 second block worth minus 4 + 0DB7-0DA5 + + + Minus 2 second block worth minus 5 + 9DB7-0DA5 + + + Minus 2 second block worth minus 6 + 1DB7-0DA5 + + + Minus 2 second block worth minus 7 + 5DB7-0DA5 + + + Minus 2 second block worth minus 8 + 6DB7-0DA5 + + + Minus 2 second block worth minus 9 + BDB7-0DA5 + + + Minus 5 second block worth 0 + DDB0-0F65 + + + Minus 5 second block worth minus 1 + FDB0-0F65 + + + Minus 5 second block worth minus 2 + 4DB0-0F65 + + + Minus 5 second block worth minus 3 + 7DB0-0F65 + + + Minus 5 second block worth minus 4 + 0DB0-0F65 + + + Minus 5 second block worth minus 6 + 1DB0-0F65 + + + Minus 5 second block worth minus 7 + 5DB0-0F65 + + + Minus 5 second block worth minus 8 + 6DB0-0F65 + + + Minus 5 second block worth minus 9 + BDB0-0F65 + + + Minus 3 second brick worth 0 + DDB9-0405 + + + Minus 3 second brick worth minus 1 + FDB9-0405 + + + Minus 3 second brick worth minus 2 + 4DB9-0405 + + + Minus 3 second brick worth minus 4 + 0DB9-0405 + + + Minus 3 second brick worth minus 5 + 9DB9-0405 + + + Minus 3 second brick worth minus 6 + 1DB9-0405 + + + Minus 3 second brick worth minus 7 + 5DB9-0405 + + + Minus 3 second brick worth minus 8 + 6DB9-0405 + + + Minus 3 second brick worth minus 9 + BDB9-0405 + + + Plus bricks worth 0 + C2B8-DFA4 + + + Plus 3 bricks worth 0 + DDBB-0DA5 + + + Plus 3 bricks worth plus 1 + FDBB-0DA5 + + + Plus 3 bricks worth plus 2 + 4DBB-0DA5 + + + Plus 3 bricks worth plus 4 + 0DBB-0DA5 + + + Plus 3 bricks worth plus 5 + 9DBB-0DA5 + + + Plus 3 bricks worth plus 6 + 1DBB-0DA5 + + + Plus 3 bricks worth plus 7 + 5DBB-0DA5 + + + Plus 3 bricks worth plus 8 + 6DBB-0DA5 + + + Plus 3 bricks worth plus 9 + BDBB-0DA5 + + + Plus 5 bricks worth 0 + DDBC-0F65 + + + Plus 5 bricks worth plus 1 + FDBC-0F65 + + + Plus 5 bricks worth plus 2 + 4DBC-0F65 + + + Plus 5 bricks worth plus 3 + 7DBC-0F65 + + + Plus 5 bricks worth plus 4 + 0DBC-0F65 + + + Plus 5 bricks worth plus 6 + 1DBC-0F65 + + + Plus 5 bricks worth plus 7 + 5DBC-0F65 + + + Plus 5 bricks worth plus 8 + 6DBC-0F65 + + + Plus 5 bricks worth plus 9 + BDBC-0F65 + + + + Operation Logic Bomb (USA) + + Infinite health + C2B5-4DD0 + + + Infinite health (alt) + 819070AD + + + Take minimal damage + 33C6-C704 + + + Infinite weapons + 03ED4E01 + + + 1 continue + DFB4-1FD4 + + + 6 continues + D1B4-1FD4 + + + 9 continues + DBB4-1FD4 + + + Start game with Tracking Missiles + D7BD-1D64 + 4DBE-4DD4 + 40BD-1FD4 + + + Start game with Tracking Missiles (alt) + 8098F020 + 80990203 + 80990424 + + + Start game with Reflecting Laser + D0BD-1D64 + 4DBE-4DD4 + 40BD-1FD4 + + + Start game with Reflecting Laser (alt) + 8098F020 + 80990204 + 80990424 + + + Start game with Flame Thrower + D9BD-1D64 + 4DBE-4DD4 + 40BD-1FD4 + + + Start game with Flame Thrower (alt) + 8098F020 + 80990205 + 80990424 + + + Start game with Hologram weapon + DFBF-1FD4 + BABF-14D4 + BABF-14A4 + + + Start game with Hologram weapon (alt) + 80991401 + 8099189C + 80991B9C + + + Start game with Directional Mines + D4BF-1FD4 + BABF-14D4 + BABF-14A4 + + + Start game with Directional Mines (alt) + 80991402 + 8099189C + 80991B9C + + + Faster left-to-right movement + E2B2-1F00 + D4BA-1700 + + + Faster left-to-right movement (alt) + 8191CD02 + 8191D5FD + + + Faster up-and-down movement + E2BD-CFA0 + D4B3-1FA0 + + + Faster up-and-down movement (alt) + 8191E702 + 819207FD + + + Reflecting laser fire travels longer + 1DB2-44D9 + + + Reflecting laser fire travels a lot longer + EEB2-44D9 + + + Reflecting laser fire travels a lot longer (alt) + 8194D8FF + + + + Operation Thunderbolt (USA) + + Infinite health + 7E36EA63 + + + Infinite Bullets + 7E36ED09 + + + Infinite Rockets + 7E36EF09 + + + Infinite Clips + 7E36EE09 + + + + Oscar (USA) + + Invincibility + 7E032003 + + + Invincibility (alt) + 7E05B6FF + + + Infinite lives + 7E03220A + + + All Oscars found + 7E032400 + + + No Oscars to find + 7E032400 + + + + Outlander (USA) + + Start with more car ammo + D980-47A1 + + + Start with less car ammo + DD80-47A1 + + + Start with more handgun ammo + 1A89-4FD1 + + + Start with less handgun ammo + FD89-4FD1 + + + Infinite handgun ammo + DD69-45A4 + + + Car ammo worth nothing on pick-up + DD67-C1A4 + + + Car ammo worth more on pick-up + D467-C5D4 + + + Water worth nothing on pick-up + DD63-C0A4 + + + Water worth more on pick-up + DF63-C9D4 + + + Hand gun ammo worth nothing on pick-up + DD66-C064 + + + Food worth nothing on pick-up + DD6A-C0D4 + + + Infinite health while in the car + C260-CF07 + C260-6F07 + + + Almost infinite health while out of the car (except when you eat poisonous food) + C9B6-450D + + + Start with more fuel + D480-4F61 + + + Gas can worth nothing on pick-up + DD6F-C004 + + + Gas can worth more on pick-up + D46F-C064 + + + Infinite surface-to-air missiles if you have at least one + C285-C7D9 + + + + Out of This World (USA) + + First three shields are infinite + 7E0D84E7 + 7E0D8AE7 + 7E0D90E7 + + + Infinite ammo in levels that have guns + 7E0C4E80 + 7E0C4F80 + + + + Out to Lunch (USA) + + Infinite lives + 7E008863 + + + Score modifier + 7E000963 + + + + Pac-Attack (USA) + + Fairy bar is always full (normal mode) + 7E160EFF + + + + Pac-Man 2 - The New Adventures (USA) + + Infinite power pellets + C288-3FDB + + + Have Rope-Way and Train Pass + 7E050004 + + + Have all 3 Power Pellets + 7E050603 + + + Have All 3 Cartridges + 7E050707 + + + Have all 3 I.D. Cards + 7E050807 + + + Have Milk + 7E050901 + + + + Paladin's Quest (USA) + + Level 99 after one battle + 6D63-6701 + 6D6E-6401 + + + Infinite health + 10B5-6405 + + + Spells use up no HP + 108E-AF00 + + + No money needed in toolhouse and weapon shop + BA88-6481 + + + No money needed in learning center + BA3A-04BE + + + Spell power increases at 2x normal rate + D063-D401 + + + Spell power increases at 3x normal rate + D163-D401 + + + No random battles + 7E186809 + + + Infinite high gold + 7E17C30E + + + Character 1 - level 99 + 7E15FA63 + + + Character 1 - 9999 current HP + 7E15FE0F + 7E15FF27 + + + Character 1 - 9999 max HP + 7E16000F + 7E160127 + + + Character 1 - 999 Power/Attack + 7E1602E7 + 7E160303 + + + Character 1 - 999 SP/Attack SP + 7E1604E7 + 7E160503 + + + Character 1 - 999 Defense/Endurance + 7E1606E7 + 7E160703 + + + Character 1 - 999 Luck + 7E1608E7 + 7E160803 + + + Character 1 - 99 available Magic + 7E160F63 + + + Character 1 - 127 E Spirit + 7E16107F + + + Character 1 - 127 W Spirit + 7E16117F + + + Character 1 - 127 F Spirit + 7E16127F + + + Character 1 - 127 Sk Spirit + 7E16137F + + + Character 1 - 127 L Spirit + 7E16147F + + + Character 1 - 127 A Spirit + 7E16157F + + + Character 1 - 127 MT Spirit + 7E16167F + + + Character 1 - 127 SP Spirit + 7E16177F + + + Character 1 - 25 spells + 7E16DD25 + + + Character 2 - level 99 + 7E162063 + + + Character 2 - 9999 current HP + 7E16240F + 7E162527 + + + Character 2 - 9999 max HP + 7E16260F + 7E162727 + + + Character 2 - 999 Power/Attack + 7E1628E7 + 7E162903 + + + Character 2 - 999 SP/Attack SP + 7E162AE7 + 7E162B03 + + + Character 2 - 999 Defense/Endurance + 7E162CE7 + 7E162D03 + + + Character 2 - 999 Luck + 7E162EE7 + 7E162E03 + + + Character 2 - 99 available Magic + 7E163563 + + + Character 2 - 127 E Spirit + 7E16367F + + + Character 2 - 127 W Spirit + 7E16377F + + + Character 2 - 127 F Spirit + 7E16387F + + + Character 2 - 127 Sk Spirit + 7E16397F + + + Character 2 - 127 L Spirit + 7E163A7F + + + Character 2 - 127 A Spirit + 7E163B7F + + + Character 2 - 127 MT Spirit + 7E163C7F + + + Character 2 - 127 SP Spirit + 7E163D7F + + + Character 2 - 25 spells + 7E170325 + + + Character 3 - level 99 + 7E164663 + + + Character 3 - 9999 current HP + 7E164A0F + 7E164B27 + + + Character 3 - 9999 max HP + 7E164C0F + 7E164D27 + + + Character 3 - 999 Power/Attack + 7E164EE7 + 7E164F03 + + + Character 3 - 999 SP/Attack SP + 7E1650E7 + 7E165103 + + + Character 3 - 999 Defense/Endurance + 7E1652E7 + 7E165303 + + + Character 3 - 999 Luck + 7E1654E7 + 7E165403 + + + Character 3 - 99 available Magic + 7E165B63 + + + Character 3 - 127 E Spirit + 7E165C7F + + + Character 3 - 127 W Spirit + 7E165D7F + + + Character 3 - 127 F Spirit + 7E165E7F + + + Character 3 - 127 Sk Spirit + 7E165F7F + + + Character 3 - 127 L Spirit + 7E16607F + + + Character 3 - 127 A Spirit + 7E16617F + + + Character 3 - 127 MT Spirit + 7E16627F + + + Character 3 - 127 SP Spirit + 7E16637F + + + Character 3 - 25 spells + 7E172925 + + + Character 4 - level 99 + 7E166C63 + + + Character 4 - 9999 current HP + 7E16700F + 7E167127 + + + Character 4 - 9999 max HP + 7E16720F + 7E167327 + + + Character 4 - 999 Power/Attack + 7E1674E7 + 7E167503 + + + Character 4 - 999 SP/Attack SP + 7E1676E7 + 7E167703 + + + Character 4 - 999 Defense/Endurance + 7E1678E7 + 7E167903 + + + Character 4 - 999 Luck + 7E167AE7 + 7E167A03 + + + Character 4 - 99 available Magic + 7E168163 + + + Character 4 - 127 E Spirit + 7E16827F + + + Character 4 - 127 W Spirit + 7E16837F + + + Character 4 - 127 F Spirit + 7E16847F + + + Character 4 - 127 Sk Spirit + 7E16857F + + + Character 4 - 127 L Spirit + 7E16867F + + + Character 4 - 127 A Spirit + 7E16877F + + + Character 4 - 127 MT Spirit + 7E16887F + + + Character 4 - 127 SP Spirit + 7E16897F + + + Character 4 - 25 spells + 7E174F25 + + + Chezni starts with 255 max. HP + EEEB-6D1F + + + Chezni starts with 255 present HP + EEE6-673F + + + Chezni starts with 40 Power, 42 Attack + 46EB-6D3F + + + Chezni starts with 60 Power, 62 Attack + 7AEB-6D3F + + + Chezni starts with 42 Defense, 30 Endurance + F3EB-6F3F + + + Chezni starts with 72 Defense, 60 Endurance + 7AEB-6F3F + + + Chezni starts with 30 Speed + F3EB-6F1F + + + Chezni starts with 60 Speed + 7AEB-6F1F + + + Chezni starts with a bow + D6EA-6F1D + + + Chezni starts with a light sword + D2EA-6F1D + + + Chezni starts with a mid sword + FDEA-6F1D + + + Chezni starts with a Aybro Spear + FCEA-6F1D + + + Chezni starts with a heavy sword + F5EA-6F1D + + + Chezni starts with a wind sword + 7DEA-6F1D + + + Chezni starts with HST + 70EA-6F1D + + + Chezni starts with Gomutai + 9FEA-6F1D + + + Chezni starts with a Psych Beam + 54EA-6F1D + + + Chezni starts with a flame thrower + 57EA-6F1D + + + Chezni starts with light armor + D8EA-6FCD + + + Chezni starts with mid armor + DEEA-6FCD + + + Chezni starts with heavy armor + FAEA-6FCD + + + Chezni starts with storm armor + 7FEA-6FCD + + + Chezni starts with bib + 77EA-6FCD + + + Chezni starts with wood boots + D4EA-6F3D + + + Chezni starts with long boots + F8EA-6F3D + + + Chezni starts with knife boots + 40EA-6F3D + + + Chezni starts with mid boots + F9EA-6F3D + + + Chezni starts with sun helm + 74EA-6D3D + + + Chezni starts with leather helm + D9EA-6D3D + + + Chezni starts with helmet + DAEA-6D3D + + + Chezni starts with rage helmet + 4AEA-6D3D + + + Chezni starts with power helmet + F1EA-6D3D + + + Chezni starts with cosmo helmet + 55EA-6D3D + + + Chezni starts with gabni shield + 79EA-6F4D + + + Chezni starts with leather shield + 71EA-6F4D + + + Chezni starts with pick-axe + DBEA-6F4D + + + Chezni starts with gauntlet + F0EA-6F4D + + + Chezni starts with fire shield + FBEA-6F4D + + + Chezni starts with Rft shield + 59EA-6F4D + + + + Paperboy 2 (USA) + + Paperboy starts with 1 life instead of 5 + DFBF-A767 + + + Paperboy starts with 3 lives + D7BF-A767 + + + Paperboy starts with 7 lives + D5BF-A767 + + + Paperboy starts with 9 lives + DBBF-A767 + + + Paperboy starts with 25 lives + FBBF-A767 + + + Paperboy starts with 50 lives + 74BF-A767 + + + Paperboy starts with 99 lives + 17BF-A767 + + + Papergirl starts with 1 life instead of 5 + DFB5-ADD7 + + + Papergirl starts with 3 lives + D7B5-ADD7 + + + Papergirl starts with 7 lives + D5B5-ADD7 + + + Papergirl starts with 9 lives + DBB5-ADD7 + + + Papergirl starts with 25 lives + FBB5-ADD7 + + + Papergirl starts with 50 lives + 74B5-ADD7 + + + Papergirl starts with 99 lives + 17B5-ADD7 + + + Infinite lives - but game still ends when all subscriptions are canceled + DDBE-6404 + + + Start with 25 papers instead of 10 + FBC6-DFAD + + + Start with 50 papers + 74C6-DFAD + + + Start with 99 papers + 17C6-DFAD + + + Paper bundles worth 0 if you have less than 10 + DD6D-6F60 + + + Paper bundles worth 5 if you have less than 10 + D96D-6F60 + + + Paper bundles worth 20 if you have less than 10 + F06D-6F60 + + + Paper bundles worth 30 if you have less than 10 + F36D-6F60 + + + Paper bundles worth 40 if you have less than 10 + 466D-6F60 + + + Paper bundles worth 50 if you have less than 10 + 746D-6F60 + + + Continue next life with 1 paper if you had less than 10 + DFC1-0FAF + + + Continue next life with 5 papers if you had less than 10 + D9C1-0FAF + + + Continue next life with 20 papers if you had less than 10 + F0C1-0FAF + + + Continue next life with 30 papers if you had less than 10 + F3C1-0FAF + + + Continue next life with 40 papers if you had less than 10 + 46C1-0FAF + + + Continue next life with 50 papers if you had less than 10 + 74C1-0FAF + + + Infinite papers + DD88-D464 + + + Start with 79 seconds instead of 39 in Week 1 training course + DB6A-ADA0 + + + Start with 59 seconds in Week 1 training course + D56A-ADA0 + + + Start with 19 seconds in Week 1 training course + D76A-ADA0 + + + Infinite time in training course + DD67-D4D9 + + + + Peace Keepers, The (USA) + + Invincibility + C229-CF07 + + + Infinite health + 6E31-4DAD + B031-4FDD + D131-4F0D + 5331-4F6D + + + + PGA Tour Golf (USA) + + Allow 14 clubs for full set instead of 13 + D235-6D07 + D22A-D40F + + + Allow 15 clubs for full set + D335-6D07 + D32A-D40F + + + Allow 16 clubs for full set + DE35-6D07 + DE2A-D40F + + + No wind + 6DC8-6DD7 + + + Constant wind of 10 mph + CBC8-6DD7 + DDC8-6D67 + DCC8-6D07 + + + Constant wind direction to the left + BACA-64D7 + + + Each round ends after hole 1 + DFA7-A704 + + + Each round ends after hole 2 + D4A7-A704 + + + Each round ends after hole 3 + D7A7-A704 + + + Each round ends after hole 4 + D0A7-A704 + + + Each round ends after hole 5 + D9A7-A704 + + + Each round ends after hole 6 + D1A7-A704 + + + Each round ends after hole 7 + D5A7-A704 + + + Each round ends after hole 8 + D6A7-A704 + + + Each round ends after hole 9 + DBA7-A704 + + + Each round ends after hole 10 + DCA7-A704 + + + Each round ends after hole 11 + D8A7-A704 + + + Each round ends after hole 12 + DAA7-A704 + + + Each round ends after hole 13 + D2A7-A704 + + + Each round ends after hole 14 + D3A7-A704 + + + Each round ends after hole 15 + DEA7-A704 + + + Each round ends after hole 16 + FDA7-A704 + + + Each round ends after hole 17 + FFA7-A704 + + + + Phalanx - The Enforce Fighter A-144 (USA) + + After losing a life automatically finish level, gain 99 lives and retain all power-ups + 00D83AAD + + + Armor cannot be damaged + 3C21-AD0F + + + Once power-up has been obtained, it is not lost until you continue (doesn't work for weapon, only power-ups) + C229-D7A4 + + + Power capsule restores armor to full strength + 9D23-6DAF + 6723-6FDF + + + Power capsule has no effect on armor or power-up + 1D23-6D6F + + + Start with 1 credit instead of 4 + DFA8-05E3 + DF2D-015A + + + Start with 2 credits + D4A8-05E3 + D42D-015A + + + Start with 3 credits + D7A8-05E3 + D72D-015A + + + Start with 5 credits + D9A8-05E3 + D92D-015A + + + Start with 7 credits + D5A8-05E3 + D52D-015A + + + Start with 10 credits + FDA8-05E3 + FD2D-015A + + + Infinite credits + DD63-DD04 + + + Start with 2 lives + D4A8-00E3 + D42D-008A + + + Start with 3 lives + D7A8-00E3 + D72D-008A + + + Start with 4 lives + D0A8-00E3 + D02D-008A + + + Start with 6 lives + D1A8-00E3 + D12D-008A + + + Start with 11 lives + FFA8-00E3 + FF2D-008A + + + Start with 26 lives + 41A8-00E3 + 412D-008A + + + Start with 51 lives + 9FA8-00E3 + 9F2D-008A + + + Start with 100 lives + BCA8-00E3 + BC2D-008A + + + Start with 1 life + DFA8-00E3 + DF2D-008A + + + Infinite lives + DD2A-64AF + + + Infinite lives (alt) + 00D6CB00 + + + Start on mission 2 + D42F-007A + D4AA-01E3 + + + Start on mission 3 + D72F-007A + D7AA-01E3 + + + Start on mission 4 + D02F-007A + D0AA-01E3 + + + Start on mission 5 + D92F-007A + D9AA-01E3 + + + Start on mission 6 + D12F-007A + D1AA-01E3 + + + Start on mission 7 + D52F-007A + D5AA-01E3 + + + + Phantom 2040 (USA) (Beta) + + Invincibility after first hit + 3367-3760 + + + Infinite lives + C2AF-CFD9 + + + Infinite weapon energy + C2AA-14A9 + + + Access all weapons (highlight weapon and press X to equip) + B23B-34D9 + + + + Phantom 2040 (USA) + + Invincibility + 3365-3DD0 + 3361-34A0 + + + Infinite lives + 62AF-34D9 + + + Infinite weapon energy + C2A2-CF69 + + + Access all weapons (highlight weapon and press X to equip) + 233E-3FD9 + + + + Pilotwings (USA) + + Infinite fuel + 108D-0FA7 + + + Reduce gravity + 4DE7-CD0F + + + Increase gravity + CDE7-CD0F + + + Increase rocket pack thrust power 3x + E2EF-6F0F + + + Infinite time - switch off to detach hang glider from plane + DD8E-AFD5 + + + + Pink Goes to Hollywood (USA) + + Invincibility + 1DB0-C7AA + 1DB9-3F62 + 1DB1-CFA2 + + + Invincibility (alt) + 7E0201FF + + + Infinite lives + 7E01FF03 + + + + Pirates of Dark Water, The (USA) + + Invincibility + C28B-47D4 + + + Health refills about every 15 seconds + 4F82-17AF + D583-1DDF + + + Infinite health + DD82-14AF + + + Infinite health (alt) + 622B-37D8 + CB2B-3468 + 962B-34A8 + + + Infinite special attacks (no health loss) + DDA5-1DDF + + + Infinite lives + C280-1F6F + + + Start with 6 lives (not when joining in) + D9C8-4DA4 + + + Start with 2 lives (not when joining in) + DFC8-4DA4 + + + 1/2 health after 1st hit (1st life only) + 4D65-1FF5 + 4D63-440E + + + Start with less health (after 1st life) + 4DB0-CFDF + + + + Pitfall - The Mayan Adventure (USA) + + Start with 10 lives + DB6B-C4A1 + DBC6-34DE + + + Start with 7 lives + D16B-C4A1 + D1C6-34DE + + + Start with 2 lives + DF6B-C4A1 + DFC6-34DE + + + Get 2x energy from sacred hearts + 746B-4D6A + + + Get 3x energy from sacred hearts + 086B-4D6A + + + Sling stones do mega-damage + 74A4-CF69 + + + Time keeper power-up lasts longer + ED6C-CDDA + D46C-CD0A + + + Pick up 20 Stones of Pacal for every 1 + F06D-1D0A + + + Infinite Stones of Pacal + DDA6-3D69 + + + Infinite sling stones + DDA5-1709 + + + Infinite boomerangs + DDA5-3700 + + + Moon-jump + DD6F-C7A1 + + + Reset game to play original Pitfall infinitely + D3B5-1F0F + + + Replaces main game with original Pitfall + D389-4FAA + + + + Pit-Fighter (USA) + + Start with more health + EEBF-A4D0 + + + Start with less health + 74BF-A4D0 + + + Start with a lot more health + D4BF-A760 + + + Start with 3 super powers + D7B3-D769 + + + Infinite super powers after gaining one + DD32-6700 + + + Executioner in match 1 has less health + 10C6-07DF + + + Executioner in match 1 has more health + DFC6-070F + + + C.C. has less health in match 2 + 10CB-07DF + DDCB-070F + + + C.C. has more health in match 2 + D4CB-070F + + + Angel has less health in match 3 + 10C8-07DF + + + Angel has more health in match 3 + DFC8-070F + + + All opponents have less health + C485-0DD7 + DD85-0D07 + 10C6-07DF + + + All opponents have more health + C485-0DD7 + DD85-0D07 + 10C6-07DF + D4C6-070F + + + + Pocky & Rocky (USA) + + Infinite time + CB2D-DFDF + + + Infinite lives - Pocky + DDA7-AD65 + + + Infinite lives - Rocky + DD35-0761 + + + 1 life - Pocky + DF62-A7D4 + + + 6 lives - Pocky + D162-A7D4 + + + 9 lives - Pocky + DB62-A7D4 + + + 1 life - Rocky + DF62-A704 + + + 6 lives - Rocky + D162-A704 + + + 9 lives - Rocky + DB62-A704 + + + Infinite energy - Pocky + C933-A794 + + + Infinite energy - Rocky + C93E-A797 + + + Weapons don't deplete when hit - Pocky + 4032-A4F4 + + + Weapons don't deplete when hit - Pocky + 4033-AFF7 + + + Blue ball acts as red ball - Pocky + D43F-6FF4 + + + Red ball acts as blue ball - Pocky + DF3D-6424 + + + Blue ball acts as red ball - Rocky + D43B-6F27 + + + Red ball acts as blue ball - Rocky + DF36-67B7 + + + 9 lives stolen from Rocky (must have one life remaining) + DBAA-AD60 + + + 9 lives stolen from Pocky (must have one life remaining) + DB3A-DD69 + + + + Populous (USA) + + Allows you to select any world from the Conquer screen (B and X buttons) + DD30-64DD + + + Your population starts at 10 instead of 3 for battles 0-4 + DC6C-6F09 + + + Your population starts at 20 for battles 0-4 + F06C-6F09 + + + Your population starts at 30 for battles 0-4 + F36C-6F09 + + + His population starts at 10 instead of 3 for battles 0-4 + DC6C-6F69 + + + His population starts at 20 for battles 0-4 + F06C-6F69 + + + His population starts at 30 for battles 0-4 + F36C-6F69 + + + You have no Supreme Commands available for battles 0-4 + DD6C-6D69 + + + He has all Supreme Commands available for battles 0-4 + 7E6C-6D09 + + + Your population starts at 10 instead of 3 for battles 5-9 + DC6C-67A9 + + + Your population starts at 20 for battles 5-9 + F06C-67A9 + + + Your population starts at 30 for battles 5-9 + F36C-67A9 + + + His population starts at 10 instead of 3 for battles 5-9 + DC68-6DD9 + + + His population starts at 20 for battles 5-9 + F068-6DD9 + + + His population starts at 30 for battles 5-9 + F368-6DD9 + + + You have no Supreme Commands available for battles 5-9 + DD6C-67D9 + + + He has all Supreme Commands available for battles 5-9 + 7E6C-64A9 + + + Your population starts at 10 instead of 2 for battles 10-14 + DC68-6409 + + + Your population starts at 20 for battles 10-14 + F068-6409 + + + Your population starts at 30 for battles 10-14 + F368-6409 + + + His population starts at 10 instead of 2 for battles 10-14 + DC68-6469 + + + His population starts at 20 for battles 10-14 + F068-6469 + + + His population starts at 30 for battles 10-14 + F368-6469 + + + You have no Supreme Commands available for battles 10-14 + DD68-6F69 + + + He has all Supreme Commands available for battles 10-14 + 7E68-6F09 + + + + Porky Pig's Haunted Holiday (USA) (Sunsoft) + + Invincibility + C9C3-D708 + + + Start with 1 life + DDC6-DFAD + + + Start with 7 lives + D1C6-DFAD + + + Start with 10 lives + DBC6-DFAD + + + Start with 1 heart + DFC6-D46D + + + Start with 2 hearts + D4C6-D46D + + + Start with 8 hearts + D6C6-D46D + + + Start with 10 hearts + DCC6-D46D + + + Don't flash after geting hit + DD26-D4DB + + + Don't flash as long after geting hit + F426-D4DB + + + Flash longer after geting hit + EE26-D4DB + + + Cupcakes are worth 0 + DD6F-6FDE + + + Cupcakes are worth 2 + D46F-6FDE + + + Cupcakes are worth 5 + D96F-6FDE + + + Cupcakes are worth 10 + DC6F-6FDE + + + Cupcakes are worth 15 + DE6F-6FDE + + + + Power Piggs of the Dark Age (USA) + + Partial invincibility + 7E06A43F + + + Infinite health + 7E147E00 + + + Infinite lives + 7E150009 + + + Infinite Doughnuts + 7E150509 + + + Start on level Beautiful Downtown Pigg + 7E187400 + + + Start on level Dark Age Donut + 7E187401 + + + Start on level North Blowhole Forest + 7E187402 + + + Start on level Road to Wolff Castle + 7E187403 + + + + Prehistorik Man (USA) + + Invincibility + 7E00B603 + + + Infinite health + 7E055803 + + + Infinite lives + 7E055603 + + + Infinite Shout + 7E056C0A + + + Infinite ammo + 7E056499 + + + Level modifier (first level must be cleared before the code actually works) + 7E052A## + + + Lots of bones + 7E056099 + 7E056109 + + + Have 99 diamonds (disable after you finish the level) + 7E081499 + + + + Primal Rage (USA) + + Infinite health - P1 + 7E192600 + + + Infinite health - P2 + 7E192800 + + + Infinite time + C20F-E767 + + + One hit kills - P1 + 7E210C01 + + + One hit kills - P2 + 7E210E01 + + + Infinite fatality time + 7E027000 + 7E02CE54 + + + Press down 3 times then start at the Start/Options screen for a hidden menu + D925-846F + + + Start with less health + 0DA5-876D + + + Able to select as many credits as you want in the options screen + BB54-87AB + + + Select different times in the options screen + FD1D-7DD4 + + + + Prince of Persia (USA) + + Infinite time + 6D32-0FA1 + DC32-04D1 + + + Start with 2 health points instead of 3 + D430-04A5 + + + Start with 4 health points + D030-04A5 + + + Start with 5 health points + D930-04A5 + + + Start with 6 health points + D130-04A5 + + + Start with 7 health points + D530-04A5 + + + Start with 8 health points + D630-04A5 + + + Start with 9 health points + DB30-04A5 + + + Start with 15 health points + FD30-04A5 + + + Non-fatal injuries do no damage + BAA6-ADA5 + + + Non-fatal falls do no damage + 43C9-6D61 + + + Non-fatal falls do 2 points of damage instead of 1 + D4C1-6701 + + + Falls do no damage except spikes (if you get stuck choose End Game and use a password to start the level over) + 6DC0-6701 + + + All enemies have 1 health point + C260-A701 + DF6C-DFA0 + + + All enemies have 2 health points + C260-A701 + D46C-DFA0 + + + All enemies have 3 health points + C260-A701 + D76C-DFA0 + + + All enemies have 4 health points + C260-A701 + D06C-DFA0 + + + All enemies have 5 health points + C260-A701 + D96C-DFA0 + + + All enemies have 10 health points + C260-A701 + DC6C-DFA0 + + + Enemies drop dead immediately (disable on bosses) + BA69-ADA1 + + + Start on level 2 + DFB7-D46E + + + Start on level 3 + D4B7-D46E + + + Start on level 4 + D7B7-D46E + + + Start on level 5 + D0B7-D46E + + + Start on level 6 + D9B7-D46E + + + Start on level 7 + D1B7-D46E + + + Start on level 8 + D5B7-D46E + + + Start on level 9 + D6B7-D46E + + + Start on level 10 + DBB7-D46E + + + Start on level 11 + DCB7-D46E + + + Start on level 12 + D8B7-D46E + + + Start on level 13 + DAB7-D46E + + + Start on level 14 + D2B7-D46E + + + Start on level 15 + D3B7-D46E + + + Start on level 16 + DEB7-D46E + + + Start on level 17 + FDB7-D46E + + + Start on level 18 + FFB7-D46E + + + Start on level 19 + F4B7-D46E + + + Start on level 20 + F7B7-D46E + + + + Push-Over (USA) + + Still can complete level even if time runs out + 6D6B-6F0F + + + Tokens aren't lost when used to undo a push + 3366-6F0F + + + Tokens aren't lost when used to advance when time runs out + 3367-A4AF + + + Start on level 2 + CB66-AD6F + 6266-AF0F + DF66-ADAF + + + Start on level 3 + CB66-AD6F + 6266-AF0F + D466-ADAF + + + Start on level 4 + CB66-AD6F + 6266-AF0F + D766-ADAF + + + Start on level 5 + CB66-AD6F + 6266-AF0F + D066-ADAF + + + Start on level 6 + CB66-AD6F + 6266-AF0F + D966-ADAF + + + Start on level 7 + CB66-AD6F + 6266-AF0F + D166-ADAF + + + Start on level 8 + CB66-AD6F + 6266-AF0F + D566-ADAF + + + Start on level 9 + CB66-AD6F + 6266-AF0F + D666-ADAF + + + Start on level 10 + CB66-AD6F + 6266-AF0F + DB66-ADAF + + + Start on level 11 + CB66-AD6F + 6266-AF0F + DC66-ADAF + + + Start on level 12 + CB66-AD6F + 6266-AF0F + D866-ADAF + + + Start on level 13 + CB66-AD6F + 6266-AF0F + DA66-ADAF + + + Start on level 14 + CB66-AD6F + 6266-AF0F + D266-ADAF + + + Start on level 15 + CB66-AD6F + 6266-AF0F + D366-ADAF + + + Start on level 16 + CB66-AD6F + 6266-AF0F + DE66-ADAF + + + Start on level 17 + CB66-AD6F + 6266-AF0F + FD66-ADAF + + + Start on level 18 + CB66-AD6F + 6266-AF0F + FF66-ADAF + + + Start on level 19 + CB66-AD6F + 6266-AF0F + F466-ADAF + + + Start on level 20 + CB66-AD6F + 6266-AF0F + F766-ADAF + + + Start on level 21 + CB66-AD6F + 6266-AF0F + F066-ADAF + + + Start on level 22 + CB66-AD6F + 6266-AF0F + F966-ADAF + + + Start on level 23 + CB66-AD6F + 6266-AF0F + F166-ADAF + + + Start on level 24 + CB66-AD6F + 6266-AF0F + F566-ADAF + + + Start on level 25 + CB66-AD6F + 6266-AF0F + F666-ADAF + + + Start on level 26 + CB66-AD6F + 6266-AF0F + FB66-ADAF + + + Start on level 27 + CB66-AD6F + 6266-AF0F + FC66-ADAF + + + Start on level 28 + CB66-AD6F + 6266-AF0F + F866-ADAF + + + Start on level 29 + CB66-AD6F + 6266-AF0F + FA66-ADAF + + + Start on level 30 + CB66-AD6F + 6266-AF0F + F266-ADAF + + + Start on level 31 + CB66-AD6F + 6266-AF0F + F366-ADAF + + + Start on level 32 + CB66-AD6F + 6266-AF0F + FE66-ADAF + + + Start on level 33 + CB66-AD6F + 6266-AF0F + 4D66-ADAF + + + Start on level 34 + CB66-AD6F + 6266-AF0F + 4F66-ADAF + + + Start on level 35 + CB66-AD6F + 6266-AF0F + 4466-ADAF + + + Start on level 36 + CB66-AD6F + 6266-AF0F + 4766-ADAF + + + Start on level 37 + CB66-AD6F + 6266-AF0F + 4066-ADAF + + + Start on level 38 + CB66-AD6F + 6266-AF0F + 4966-ADAF + + + Start on level 39 + CB66-AD6F + 6266-AF0F + 4166-ADAF + + + Start on level 40 + CB66-AD6F + 6266-AF0F + 4566-ADAF + + + Start on level 41 + CB66-AD6F + 6266-AF0F + 4666-ADAF + + + Start on level 42 + CB66-AD6F + 6266-AF0F + 4B66-ADAF + + + Start on level 43 + CB66-AD6F + 6266-AF0F + 4C66-ADAF + + + Start on level 44 + CB66-AD6F + 6266-AF0F + 4866-ADAF + + + Start on level 45 + CB66-AD6F + 6266-AF0F + 4A66-ADAF + + + Start on level 46 + CB66-AD6F + 6266-AF0F + 4266-ADAF + + + Start on level 47 + CB66-AD6F + 6266-AF0F + 4366-ADAF + + + Start on level 48 + CB66-AD6F + 6266-AF0F + 4E66-ADAF + + + Start on level 49 + CB66-AD6F + 6266-AF0F + 7D66-ADAF + + + Start on level 50 + CB66-AD6F + 6266-AF0F + 7F66-ADAF + + + Start on level 51 + CB66-AD6F + 6266-AF0F + 7466-ADAF + + + Start on level 52 + CB66-AD6F + 6266-AF0F + 7766-ADAF + + + Start on level 53 + CB66-AD6F + 6266-AF0F + 7066-ADAF + + + Start on level 54 + CB66-AD6F + 6266-AF0F + 7966-ADAF + + + Start on level 55 + CB66-AD6F + 6266-AF0F + 7166-ADAF + + + Start on level 56 + CB66-AD6F + 6266-AF0F + 7566-ADAF + + + Start on level 57 + CB66-AD6F + 6266-AF0F + 7666-ADAF + + + Start on level 58 + CB66-AD6F + 6266-AF0F + 7B66-ADAF + + + Start on level 59 + CB66-AD6F + 6266-AF0F + 7C66-ADAF + + + Start on level 60 + CB66-AD6F + 6266-AF0F + 7866-ADAF + + + Start on level 61 + CB66-AD6F + 6266-AF0F + 7A66-ADAF + + + Start on level 62 + CB66-AD6F + 6266-AF0F + 7266-ADAF + + + Start on level 63 + CB66-AD6F + 6266-AF0F + 7366-ADAF + + + Start on level 64 + CB66-AD6F + 6266-AF0F + 7E66-ADAF + + + Start on level 65 + CB66-AD6F + 6266-AF0F + 0D66-ADAF + + + Start on level 66 + CB66-AD6F + 6266-AF0F + 0F66-ADAF + + + Start on level 67 + CB66-AD6F + 6266-AF0F + 0466-ADAF + + + Start on level 68 + CB66-AD6F + 6266-AF0F + 0766-ADAF + + + Start on level 69 + CB66-AD6F + 6266-AF0F + 0066-ADAF + + + Start on level 70 + CB66-AD6F + 6266-AF0F + 0966-ADAF + + + Start on level 71 + CB66-AD6F + 6266-AF0F + 0166-ADAF + + + Start on level 72 + CB66-AD6F + 6266-AF0F + 0566-ADAF + + + Start on level 73 + CB66-AD6F + 6266-AF0F + 0666-ADAF + + + Start on level 74 + CB66-AD6F + 6266-AF0F + 0B66-ADAF + + + Start on level 75 + CB66-AD6F + 6266-AF0F + 0C66-ADAF + + + Start on level 76 + CB66-AD6F + 6266-AF0F + 0866-ADAF + + + Start on level 77 + CB66-AD6F + 6266-AF0F + 0A66-ADAF + + + Start on level 78 + CB66-AD6F + 6266-AF0F + 0266-ADAF + + + Start on level 79 + CB66-AD6F + 6266-AF0F + 0366-ADAF + + + Start on level 80 + CB66-AD6F + 6266-AF0F + 0E66-ADAF + + + Start on level 81 + CB66-AD6F + 6266-AF0F + 9D66-ADAF + + + Start on level 82 + CB66-AD6F + 6266-AF0F + 9F66-ADAF + + + Start on level 83 + CB66-AD6F + 6266-AF0F + 9466-ADAF + + + Start on level 84 + CB66-AD6F + 6266-AF0F + 9766-ADAF + + + Start on level 85 + CB66-AD6F + 6266-AF0F + 9066-ADAF + + + Start on level 86 + CB66-AD6F + 6266-AF0F + 9966-ADAF + + + Start on level 87 + CB66-AD6F + 6266-AF0F + 9166-ADAF + + + Start on level 88 + CB66-AD6F + 6266-AF0F + 9566-ADAF + + + Start on level 89 + CB66-AD6F + 6266-AF0F + 9666-ADAF + + + Start on level 90 + CB66-AD6F + 6266-AF0F + 9B66-ADAF + + + Start on level 91 + CB66-AD6F + 6266-AF0F + 9C66-ADAF + + + Start on level 92 + CB66-AD6F + 6266-AF0F + 9866-ADAF + + + Start on level 93 + CB66-AD6F + 6266-AF0F + 9A66-ADAF + + + Start on level 94 + CB66-AD6F + 6266-AF0F + 9266-ADAF + + + Start on level 95 + CB66-AD6F + 6266-AF0F + 9366-ADAF + + + Start on level 96 + CB66-AD6F + 6266-AF0F + 9E66-ADAF + + + Start on level 97 + CB66-AD6F + 6266-AF0F + 1D66-ADAF + + + Start on level 98 + CB66-AD6F + 6266-AF0F + 1F66-ADAF + + + Start on level 99 + CB66-AD6F + 6266-AF0F + 1466-ADAF + + + + Q-bert 3 (USA) + + Start with 1 life instead of 5 + DF66-D7DD + + + Start with 3 lives + D766-D7DD + + + Start with 7 lives + D566-D7DD + + + Start with 9 lives + DB66-D7DD + + + Start with 25 lives + FB66-D7DD + + + Start with 100 lives + 1066-D7DD + + + Infinite lives + C2C5-AF6F + + + Start on level 1-2 + DF61-D76D + + + Start on level 1-3 + D461-D76D + + + Start on level 1-4 + D761-D76D + + + Start on level 2-1 + D061-D76D + + + Start on level 2-2 + D961-D76D + + + Start on level 2-3 + D161-D76D + + + Start on level 2-4 + D561-D76D + + + Start on level 3-1 + D661-D76D + + + Start on level 3-2 + DB61-D76D + + + Start on level 3-3 + DC61-D76D + + + Start on level 3-4 + D861-D76D + + + Start on level 4-1 + DA61-D76D + + + Start on level 4-2 + D261-D76D + + + Start on level 4-3 + D361-D76D + + + Start on level 4-4 + DE61-D76D + + + Start on level 5-1 + FD61-D76D + + + Start on level 5-2 + FF61-D76D + + + Start on level 5-3 + F461-D76D + + + Start on level 5-4 + F761-D76D + + + Start on level 6-1 + F061-D76D + + + Start on level 6-2 + F961-D76D + + + Start on level 6-3 + F161-D76D + + + Start on level 6-4 + F561-D76D + + + Start on level 7-1 + F661-D76D + + + Start on level 7-2 + FB61-D76D + + + Start on level 7-3 + FC61-D76D + + + Start on level 7-4 + F861-D76D + + + Start on level 8-1 + FA61-D76D + + + Start on level 8-2 + F261-D76D + + + Start on level 8-3 + F361-D76D + + + Start on level 8-4 + FE61-D76D + + + Start on level 9-1 + 4D61-D76D + + + Start on level 9-2 + 4F61-D76D + + + Start on level 9-3 + 4461-D76D + + + Start on level 9-4 + 4761-D76D + + + Start on level 10-1 + 4061-D76D + + + Start on level 10-2 + 4961-D76D + + + Start on level 10-3 + 4161-D76D + + + Start on level 10-4 + 4561-D76D + + + Start on level 11-1 + 4661-D76D + + + Start on level 11-2 + 4B61-D76D + + + Start on level 11-3 + 4C61-D76D + + + Start on level 11-4 + 4861-D76D + + + Start on level 12-1 + 4A61-D76D + + + Start on level 12-2 + 4261-D76D + + + Start on level 12-3 + 4361-D76D + + + Start on level 12-4 + 4E61-D76D + + + Start on level 13-1 + 7D61-D76D + + + Start on level 13-2 + 7F61-D76D + + + Start on level 13-3 + 7461-D76D + + + Start on level 13-4 + 7761-D76D + + + Start on level 14-1 + 7061-D76D + + + Start on level 14-2 + 7961-D76D + + + Start on level 14-3 + 7161-D76D + + + Start on level 14-4 + 7561-D76D + + + Start on level 15-1 + 7661-D76D + + + Start on level 15-2 + 7B61-D76D + + + Start on level 15-3 + 7C61-D76D + + + Start on level 15-4 + 7861-D76D + + + Start on level 16-1 + 7A61-D76D + + + Start on level 16-2 + 7261-D76D + + + Start on level 16-3 + 7361-D76D + + + Start on level 16-4 + 7E61-D76D + + + Start on level 17-1 + 0D61-D76D + + + Start on level 17-2 + 0F61-D76D + + + Start on level 17-3 + 0461-D76D + + + Start on level 17-4 + 0761-D76D + + + Start on level 18-1 + 0061-D76D + + + Start on level 18-2 + 0961-D76D + + + Start on level 18-3 + 0161-D76D + + + Start on level 18-4 + 0561-D76D + + + Start on level 19-1 + 0661-D76D + + + Start on level 19-2 + 0B61-D76D + + + Start on level 19-3 + 0C61-D76D + + + Start on level 19-4 + 0861-D76D + + + Start on level 20-1 + 0A61-D76D + + + Start on level 20-2 + 0261-D76D + + + Start on level 20-3 + 0361-D76D + + + Start on level 20-4 + 0E61-D76D + + + Start on level x1 + 9D61-D76D + + + Start on level x2 + 9F61-D76D + + + Start on level x3 + 9461-D76D + + + Start on level x4 + 9761-D76D + + + Start on level x5 + 9061-D76D + + + Start on level x6 + 9961-D76D + + + Start on level x7 + 9161-D76D + + + Start on level x8 + 9561-D76D + + + Start on level x9 + 9661-D76D + + + Start on level x10 + 9B61-D76D + + + Start on level x11 + 9C61-D76D + + + Start on level x12 + 9861-D76D + + + Start on level x13 + 9A61-D76D + + + Start on level x14 + 9261-D76D + + + Start on level x15 + 9361-D76D + + + Start on level x16 + 9E61-D76D + + + Start on level x17 + 1D61-D76D + + + Start on level x18 + 1F61-D76D + + + Start on level x19 + 1461-D76D + + + Start on level x20 + 1761-D76D + + + + Race Drivin' (USA) + + Infinite time + A266-07AD + + + Slow timer + 8066-04DD + + + Fast timer + 4266-04DD + + + Freeze lap timer + 2B6C-07AD + + + Slow lap timer + 1968-0DAD + + + + Radical Rex (USA) + + Infinite health + 89B4-C4D1 + + + Infinite roar + C28C-1FD5 + C2C9-D7A4 + + + Infinite lives + C221-3D94 + + + Don't loose breath level when you die + C2B2-4D04 + C2BA-4F04 + + + + Raiden Trad (USA) + + Invincibility - both players + DDEF-0F1B + + + Infinite lives - P1 + 3CBD-DDD7 + + + Infinite lives - P2 + 3CB5-0467 + + + Infinite bombs - both players + 3CEA-6D64 + + + Infinite bombs - P1 + EDE8-67A4 + D9EA-6DD4 + 3CEA-6D04 + 23EA-6DA4 + + + Infinite bombs - P2 + 2DE8-67A4 + D9EA-6DD4 + 3CEA-6D04 + 23EA-6DA4 + + + Start with 1 life - both players + B6BD-D76F + + + Start with 7 lives - both players + 8BBD-D70F + 60BD-D76F + + + Start with 9 lives - both players + 8FBD-D70F + 62BD-D76F + + + Start with 0 bombs - P1 + CEBF-D7AF + 62B4-DDDF + + + Start with 6 bombs - P1 + 91BF-D7AF + 6BB4-DDDF + + + Start with 9 bombs - P1 + 8FBF-D7AF + 62B4-DDDF + + + Start with 0 bombs - P2 + CEB7-D7DF + 62B7-D70F + + + Start with 6 bombs - P2 + 91B7-D7DF + 6BB7-D70F + + + Start with 9 bombs - P2 + 8FB7-D7DF + 62B7-D70F + + + Replacement planes carry 0 bombs - P1 + CEB7-DFD7 + 62B7-DF07 + + + Replacement planes carry 6 bombs - P1 + 91B7-DFD7 + 6BB7-DF07 + + + Replacement planes carry 9 bombs - P1 + 8FB7-DFD7 + 62B7-DF07 + + + Replacement planes carry 0 bombs - P2 + CEBC-0707 + 62BC-0767 + + + Replacement planes carry 6 bombs - P2 + 91BC-0707 + 6BBC-0767 + + + Replacement planes carry 9 bombs - P2 + 8FBC-0707 + 62BC-0767 + + + Start with 3 credits + D4BF-6F6F + + + Start with 4 credits + D7BF-6F6F + + + Start with 6 credits + D9BF-6F6F + + + Start with 8 credits + D5BF-6F6F + + + Start with 10 credits + DBBF-6F6F + + + Start with 1 credit + DDBF-6F6F + + + + Rampart (USA) + + Infinite continues + C284-DD07 + + + Infinite cannons + 3C6B-D467 + + + Start on battlefield 2 + CBAA-67DD + DDAA-676D + DFAA-670D + + + Start on battlefield 3 + CBAA-67DD + DDAA-676D + D4AA-670D + + + Start on battlefield 4 + CBAA-67DD + DDAA-676D + D7AA-670D + + + Start on battlefield 5 + CBAA-67DD + DDAA-676D + D0AA-670D + + + Start on battlefield 6 + CBAA-67DD + DDAA-676D + D9AA-670D + + + Start on battlefield 7 + CBAA-67DD + DDAA-676D + D1AA-670D + + + + Ranma 1-2 - Hard Battle (USA) + + Ranma moves faster + D7B4-0DA9 + EABF-04D9 + + + Ranma jumps faster + E8B7-07D9 + D0B7-0769 + + + Ranma's diagonal jumps are higher + E1B7-0769 + + + Ranma's diagonal kicks are harder + F6B7-AD60 + + + Ranma's dragon blast kills with 1 hit + 1DB1-D4D9 + + + Genma moves faster + D78F-6DD5 + EA8D-DFD5 + + + Genma's paternal anger (running at enemy) is faster + E48C-6DD5 + + + Genma's verbal punishment is stronger + 4689-0465 + + + Genma's verbal punishment kills with 1 hit + 1D89-0465 + + + Ryoga moves faster + EA81-6760 + D7B5-6460 + + + Ryoga jumps faster + EA8B-6D60 + D78B-6760 + + + Ryoga's bandana throw kills with 1 hit + 1DD8-DD05 + + + Shampoo moves faster + EAC9-D765 + D7C1-D465 + + + Shampoo's dragon sky kick is faster + E9CF-0765 + + + Shampoo's super fury charge goes farther + E9CE-D465 + + + Shampoo's fury charge 1 hit kill + 1DCB-A4A1 + + + Shampoo's kick is faster + 41C5-67D1 + + + Akane moves faster + EA84-D4D1 + D787-DFD1 + + + Akane jumps faster + E880-D7D1 + D089-6760 + + + Akane's 2-step whip kick is faster + E68E-DFD1 + + + Akane's 2-step whip kick is stronger + 418B-6D69 + + + Akane's 2-step whip kick kills with 1 hit + 1D8B-6D69 + + + Akane's dust devil uppercut is faster + 3E8A-DF61 + + + Akane's dust devil uppercut is faster + EE8A-D401 + + + Gosunkugi moves faster + ECC5-64D9 + D0C6-6FD9 + + + Gosunkugi jumps faster + E8CB-67D9 + D0CC-64D9 + + + Gosunkugi's straw man throw does more damage + 40D8-DD05 + + + Gosunkugi's straw man throw kills with 1 hit + 1DD8-DD05 + + + Ukkyo moves faster + ECB8-64D1 + D0BA-6FD1 + + + Ukkyo jumps faster + E8B2-67D1 + D0B3-64D1 + + + Mousse's flying egg bombs are faster + EBC5-0FD0 + + + Mousse's eagle claw strike - 1 hit kill + 1DB1-AF65 + + + Mousse's claw strike is quicker + D6C1-0460 + + + Every move kills every opponent with 1 hit + DDD7-8407 + + + No knock back when opponent is cornered + DD6B-D700 + + + + Realm (USA) + + Invincibility + 7E007D4F + + + Invincibility after first hit + C928-4DA7 + C92D-1DD7 + + + Almost invincible + enable stage skip (press Start + Select to skip) (enable code before title screen) + ED66-C54F + + + Almost invincible + enable stage skip (press Start + Select to skip) (enable code before title screen) (alt) + 7E0224FF + + + Infinite health + C2EB-4F15 + + + Infinite health (alt) + 7E132B06 + + + Infinite lives + C236-1DFE + + + Infinite lives (alt) + 7E133403 + + + Infinite ammo for all weapons + 7E00F509 + + + + Redline F-1 Racer (USA) + + Always in 1st place + C98E-6FDF + + + Instant 255 mph speed (best to get into 6th gear before activating this code, then you can go 357 mph) + CBC5 + D70F + EEC5 + D7AF + + + Don't lose speed when you get off accelerator button + C98C-6F0F + + + No loss of speed on grass + C9BD-0F04 + + + Infinite special fuel + 3CAA-AF04 + + + + Ren & Stimpy Show, The - Time Warp (USA) + + Infinite health + 82ED-4DD6 + + + Flash longer after you die + EE33-1F62 + + + Don't flash after you die + EE33-1F62 + + + Infinite lives + 3CB1-14AC + + + Don't have to charge special attack + CBBE-4468 + 6DBE-47D8 + DDBE-4768 + 62BE-47A8 + + + Energy never goes back up + 82EA-34D6 + + + 1 kitty gritty gives 99 + CBEF-440B + 17EF-446B + 3CEF-47DB + 3CEF-470B + + + Start with 1 lives + DD3A-1DA2 + + + Start with 5 lives + D03A-1DA2 + + + Start with 10 lives + DB3A-1DA2 + + + + Ren & Stimpy Show, The - Veediots! (USA) + + Infinite health + C2CD-0FA0 + + + Infinite lives + C2C5-0460 + + + Infinite time + C2CF-D7A9 + + + Powdered Toast Shield lasts 85x longer + EEE8-6DD6 + + + Socks power-up lasts 200x longer + EEEF-D7AB + + + Stimpy's mouth won't close + C2C5-0FD9 + + + Money is worth 10x more + ECBC-6DA5 + ECAB-DDA5 + + + + Rex Ronan - Experimental Surgeon (USA) (En,Es) + + Infinite health + 7E03C4FF + + + + Rise of the Robots (USA) + + No jumping allowed + CBA2-E4D4 + DDA2-E404 + + + Infinite time + DDAC-5767 + + + Win one round to advance + DF78-57AF + + + Everyone kills with one hit + CB34-570F + + + Every hit does more damage + 4D34-576F + 3CC7-E4A7 + DD34-57AF + + + + Rival Turf! (USA) + + Invincibility + C2BF-D0EB + + + Invincibility - P1 + 7E0208FF + + + Invincibility - P2 + 7E02D8FF + + + Infinite health + C965-DDDC + + + Infinite health - P1 + 7E0217FF + + + Infinite health - P2 + 7E02E7FF + + + Infinite points - P1 + 7E022470 + + + Infinite points - P2 + 7E02F470 + + + Infinite continues + C2C3-0F0D + + + Infinite continues (alt) + 7E10F505 + + + Start with 9 continues + DBB0-DF07 + + + Start with 1 continue + DFB0-DF07 + + + Infinite lives + C96C-0DAC + + + Infinite lives - P1 + 7E023F09 + + + Infinite lives - P2 + 7E030F09 + + + Start with 1 life + DDB7-D4A7 + + + Start with 8 lives + D5B7-D4A7 + + + Start with more health + EE64-646C + EE63-04A7 + EE68-A7A1 + + + Start with less health + FEC4-0D6F + FE64-646C + FE63-04A7 + FE68-A7A1 + + + Always angry - P1 + 7E024F03 + + + Always angry - P2 + 7E031F03 + + + No score lost when special attack is used + DD62-A7A6 + + + Full health from all food + DD6A-AD61 + + + One hit kills + 7E048700 + 7E055700 + 7E024F00 + 7E03B700 + + + Start on stage 2 - L.A. City Stadium + 7E012001 + + + Start on stage 3 - Things Are Looking Up + 7E012002 + + + Start on stage 4 - South Of The Border + 7E012003 + + + Start on stage 5 - Dockyard Brawl + 7E012004 + + + Start on stage 6 - Fight to the Finish + 7E012005 + + + Start on stage - Welcome To The Warp Room + 7E012006 + + + + Road Riot 4WD (USA) + + Races are 1 lap instead of 3 + DDBF-07DF + + + Races are 2 laps instead of 3 + DFBF-07DF + + + Races are 4 laps instead of 3 + D7BF-07DF + + + Races are 5 laps instead of 3 + D0BF-07DF + + + Races are 6 laps instead of 3 + D9BF-07DF + + + Races are 7 laps instead of 3 + D1BF-07DF + + + Beginner track has an extra lap + 3CB4-0DAF + + + + Road Runner's Death Valley Rally (USA) + + Protection against most hazards + C2AC-346F + C2C3-1D28 + + + Start with 2 lives + DFBC-3FD4 + + + Start with 4 lives + D7BC-3FD4 + + + Start with 6 lives + D9BC-3FD4 + + + Start with 8 lives + D5BC-3FD4 + + + Start with 10 lives + DBBC-3FD4 + + + Start with 21 lives + 4DBC-3FD4 + + + Start with 51 lives + 9DBC-3FD4 + + + Start with 76 lives + 59BC-3FD4 + + + Start with 100 lives + BBBC-3FD4 + + + Infinite lives + DDB2-4D64 + + + Stay invincible longer after getting hit (Road Runner blinks) + EE8C-C4DD + + + Stay invincible for less time after getting hit (Road Runner blinks) + 0D8C-C4DD + + + Stay invincible after getting hit until you fall and die (Road Runner blinks) + C2C5-C7AF + + + Stay invincible after getting hit until you fall and die (Road Runner does not blink) + 6DC5-C70F + + + Start with more birdseed on the turbo speed meter + 7DBD-44D7 + + + Start with less birdseed on the turbo speed meter + FDBD-44D7 + + + Eating birdseed restores turbo speed meter to maximum + 7D26-3404 + + + Eating birdseed does nothing + DD26-3404 + + + Using turbo speed does not use up bird seed + DDC6-3D67 + + + Stop timer + DDBB-4467 + + + Start timer at 3:00 instead of 5:00 + D7B0-346F + + + Start timer at 7:00 + D5B0-346F + + + Start timer at 9:00 + DBB0-346F + + + Hearts worth nothing + C229-C707 + + + 1-up worth nothing + DD33-4DDD + + + 1-up worth 2 + D433-4DDD + + + 1-up worth 3 + D733-4DDD + + + 1-up worth 4 + D033-4DDD + + + 1-up worth 5 + D933-4DDD + + + Bogus jump + 7D83-47DD + + + Better jump + FD83-47DD + + + Super-jump + DC83-47DD + + + Mega-jump + D983-47DD + + + Start on level 1, sub-level 2 + F3BB-3FA4 + 3FBB-3F64 + DFBB-3FD4 + + + Start on level 1, sub-level 3 + F3BB-3FA4 + 3FBB-3F64 + D4BB-3FD4 + + + Start on level 1, sub-level 4 + F3BB-3FA4 + 3FBB-3F64 + D7BB-3FD4 + + + Start on level 2, sub-level 1 + F3BB-3FA4 + 3FBB-3F64 + D0BB-3FD4 + + + Start on level 2, sub-level 2 + F3BB-3FA4 + 3FBB-3F64 + D9BB-3FD4 + + + Start on level 2, sub-level 3 + F3BB-3FA4 + 3FBB-3F64 + D1BB-3FD4 + + + Start on level 2, sub-level 4 + F3BB-3FA4 + 3FBB-3F64 + D5BB-3FD4 + + + Start on level 3, sub-level 1 + F3BB-3FA4 + 3FBB-3F64 + D6BB-3FD4 + + + Start on level 3, sub-level 2 + F3BB-3FA4 + 3FBB-3F64 + DBBB-3FD4 + + + Start on level 3, sub-level 3 + F3BB-3FA4 + 3FBB-3F64 + DCBB-3FD4 + + + Start on level 3, sub-level 4 + F3BB-3FA4 + 3FBB-3F64 + D8BB-3FD4 + + + Start on level 4, sub-level 1 + F3BB-3FA4 + 3FBB-3F64 + DABB-3FD4 + + + Start on level 4, sub-level 3 + F3BB-3FA4 + 3FBB-3F64 + D3BB-3FD4 + + + Start on level 4, sub-level 4 + F3BB-3FA4 + 3FBB-3F64 + DEBB-3FD4 + + + Start on level 5, sub-level 1 + F3BB-3FA4 + 3FBB-3F64 + FDBB-3FD4 + + + Start on level 5, sub-level 2 + F3BB-3FA4 + 3FBB-3F64 + FFBB-3FD4 + + + Start on level 5, sub-level 3 + F3BB-3FA4 + 3FBB-3F64 + F4BB-3FD4 + + + + RoboCop 3 (USA) + + Slower timer + 5D69-6D0F + + + Faster timer + FE69-6D0F + + + Infinite ammo (except flame thrower) + DDC7-A7A4 + + + Infinite lives + 4A6E-6FDD + + + Start with 1 life + DD62-D7DD + + + Start with 6 lives + D962-D7DD + + + Ammo pick-ups worth more + DFEC-DD67 + D4EC-DFD7 + + + Ammo pick-ups worth less + 7DEC-DD07 + DDEC-DFD7 + 7DEC-DDA7 + + + Faster Robocop - except on stages 3 and 5 + D4C7-64DD + E3C9-6DAD + + + Start on stage 2 + DF37-64A4 + + + Start on stage 3 + D437-64A4 + + + Start on stage 4 + D737-64A4 + + + Start on stage 5 + D037-64A4 + + + + RoboCop versus The Terminator (USA) + + Start with 1 life + DFB3-CD0D + + + Start with 9 lives + DBB3-CD0D + + + Start with 15 lives (ignore counter) + DEB3-CD0D + + + Infinite lives + DDBE-0D05 + + + Super-jump + DD37-C4D7 + + + Rockets do more damage + DE63-C460 + + + Normal pistol does more damage + DE60-4460 + + + Plasma Rifle does massive damage + 7D66-1F00 + + + Only 10 Terminators to kill on the 3-D Stage + FD64-446F + + + Only 30 Terminators to kill on the 3-D Stage + 7D64-446F + + + + Robotrek (USA) + + Get 9900 gold when you look into the robot book + BBB9-4D7D + + + Everything is free + C23C-CDC7 + + + Start at level 3 + CB34-3D47 + D734-3D17 + + + Start at level 10 + CB34-3D47 + DC34-3D17 + + + Start at level 20 + CB34-3D47 + F034-3D17 + + + Start at level 50 + CB34-3D47 + 7434-3D17 + + + More energy for robot energy + BDE6-1DC2 + + + Mean robot + CBEB-1FB9 + BBEB-1F29 + DDEB-14F9 + 3CEB-1499 + + + Infinite battle bonus time + 3CAA-3DFF + + + Infinite robot points + 6DCE-3D43 + + + Infinite vanish time + C234-3F3E + + + One-hit kills + CBE2-C74A + + + + Rocketeer, The (USA) + + Start with 1 chance instead of 3 + DF6C-07AF + + + Start with 2 chances + D46C-07AF + + + Start with 4 chances + D06C-07AF + + + Start with 5 chances + D96C-07AF + + + Start with 6 chances + D16C-07AF + + + Start with 7 chances + D56C-07AF + + + Start with 8 chances + D66C-07AF + + + Start with 9 chances + DB6C-07AF + + + Infinite chances + 8260-0FA7 + + + Automatically win first race at Bigelow + DD62-67AF + + + First race at Bigelow is 1 lap instead of 10 + DF62-67AF + + + First race at Bigelow is 5 laps + D962-67AF + + + First race at Bigelow is 15 laps + DE62-67AF + + + First race at Bigelow is 25 laps + FB62-67AF + + + First race at Bigelow is 50 laps + 7462-67AF + + + First race at Bigelow is 99 laps + 1762-67AF + + + Automatically win second race at Bigelow + DD63-6DDF + + + Second race at Bigelow is 1 lap + DF63-6DDF + + + Second race at Bigelow is 5 laps + D963-6DDF + + + Second race at Bigelow is 10 laps + DC63-6DDF + + + Second race at Bigelow is 25 laps + FB63-6DDF + + + Second race at Bigelow is 50 laps + 7463-6DDF + + + Second race at Bigelow is 99 laps + 1763-6DDF + + + Automatically win third race at Bigelow + DD63-6D0F + + + Third race at Bigelow is 1 lap instead of 10 + DF63-6D0F + + + Third race at Bigelow is 5 laps + D963-6D0F + + + Third race at Bigelow is 25 laps + FB63-6D0F + + + Third race at Bigelow is 50 laps + 7463-6D0F + + + Third race at Bigelow is 99 laps + 1763-6D0F + + + Protection against guns (only partly against grenades) (only in hangar) + C988-0FAD + + + Cliff starts with 2/3 normal energy in hangar + 0C6D-A4DF + + + Cliff starts with 1/3 normal energy in hangar + 496D-A4DF + + + Enemies start with 2/3 normal energy in hangar + 0C6D-A7AF + + + Enemies start with 1/3 normal energy in hangar + 496D-A7AF + + + Protection against Armored Flying Tank + C98C-DD0F + + + Infinite super shots on pick-up + C961-A767 + + + Super shots worth nothing on pick-up instead of 3 + DD6B-D76F + + + Super shots worth 6 on pick-up (cannot gain over 29) + D16B-D76F + + + Super shots worth 9 on pick-up (cannot gain over 29) + DB6B-D76F + + + Super shots worth 12 on pick-up (cannot gain over 29) + DA6B-D76F + + + Invincibility in the skies + C964-6FDD + + + Protection against enemy rocketmen on the Zeppelin + C9A0-A40F + + + Easily defeat enemy rocketmen on the Zeppelin + 10A8-DFDF + + + + Rock n' Roll Racing (USA) + + Start with $50,000 + D9CF-CDD5 + + + Start with $100,000 + FDCF-CDD5 + + + Start with $500,000 + 9DCF-CDD5 + + + Start with $990,000 + BBCF-CDD5 + + + Start with $5,020,000 + D9CF-CD05 + + + Buy items for free if you have enough money + C28C-CF69 + C28B-C4A9 + + + No points needed to advance to any level + BACB-C465 + + + Infinite forward weapons + C2BF-476F + + + Infinite power charges + C2BF-1FA4 + + + No damage from hitting other cars + 3CE5-CD67 + + + No damage from most mines + DD26-34D7 + + + More damage from mines + D126-34D7 + + + Red Cross packages worth nothing + DD36-4F0D + + + Red Cross packages can blow up + FD36-4F0D + + + + Rocky Rodent (USA) + + Infinite lives + 3CAD-4DA7 + + + Start with red hairdo + D4A8-17D4 + + + Start with purple hairdo + D0A8-17D4 + + + Start with corkscrew hairdo + D1A8-17D4 + + + Start with green ponytail hairdo + D6A8-17D4 + + + Start with birdnest hairdo + DCA8-17D4 + + + Keep hairdo after you die + C2C3-3DD5 + + + + Roger Clemens' MVP Baseball (USA) (Rev 1) + + Batter never walks + C22D-6FAD + + + 1 ball per walk + DF2D-676D + + + 2 balls per walk + D42D-676D + + + 3 balls per walk + D72D-676D + + + 5 balls per walk + D92D-676D + + + 6 balls per walk + D12D-676D + + + 7 balls per walk + D52D-676D + + + Batter never strikes out + C227-6D6D + + + 1 strike per out + DF27-640D + + + 2 strikes per out + D427-640D + + + 4 strikes per out + D027-640D + + + 5 strikes per out + D927-640D + + + Each run counts as 2 + 7665-0FD1 + 7669-0F01 + + + 1 out per inning per team + DFBF-07DF + + + 2 outs per inning per team + D4BF-07DF + + + + Romance of the Three Kingdoms II (USA) + + Start with 30,000 gold pieces (scenario 1) + 7DE7-A465 + 59E7-A4A5 + + + Start with 30,000 rice (scenario 1) + 7DE7-A765 + 59E7-A705 + + + Start with 30,000 population (scenario 1) + 7DE7-A765 + 59E7-A7A5 + + + Start with 30,000 gold pieces (scenario 2) + 7D67-A406 + 596D-A466 + + + Start with 30,000 rice (scenario 2) + 7D67-A4A6 + 596D-A7D6 + + + Start with 30,000 population (scenario 2) + 7D67-A706 + 596D-A766 + + + Start with 30,000 gold pieces (scenario 3) + 7D67-A7DB + 5967-A70B + + + Start with 30,000 rice (scenario 3) + 7D67-A76B + 5967-A7AB + + + Start with 30,000 population (scenario 3) + 7D60-ADDB + 5960-AD0B + + + Start with 30,000 gold pieces (scenario 4) + 7D67-A70C + 5967-A76C + + + Start with 30,000 rice (scenario 4) + 7D67-A7AC + 5960-ADDC + + + Start with 30,000 population (scenario 4) + 7D60-AD0C + 5960-AD6C + + + Start with 30,000 gold pieces (scenario 5) + 7DBB-D7D6 + 59BB-D706 + + + Start with 30,000 rice (scenario 5) + 7DBB-D766 + 59BB-D7A6 + + + Start with 30,000 population (scenario 5) + 7DBC-DDD6 + 59BC-DD06 + + + Start with 30,000 gold pieces (scenario 6) + 7DB9-6766 + 59B9-67A6 + + + Start with 30,000 rice (scenario 6) + 7DB1-6DD6 + 59B1-6D06 + + + Start with 30,000 population (scenario 6) + 7DB1-6D66 + 59B1-6DA6 + + + + R.P.M. Racing (USA) + + Sturdy tires are free + DDB8-0465 + + + 4-liter high output engine is free + DDB1-0F65 + + + Sell sturdy tires for $4,910 + 0BBA-0FA5 + + + Sell 4-liter high output engine for $9,925 + BBB5-0DA5 + + + Start new game with $9,910 + BBCB-DF61 + + + Start new game with $49,104,910 + 62CB-D701 + + + Start new game with $99,109,910 + BBCB-DF61 + 62CB-D701 + + + + R-Type III - The Third Lightning (USA) + + Invincibility + DD62-33DD + + + Infinite lives + C26B-C7D0 + + + Start at speed level 3 + DA6F-CE0D + + + Start at speed level 4 + FD6F-CE0D + + + Start at speed level 5 + F06F-CE0D + + + + Run Saber (USA) + + Almost invincible - P1 (disable if you fall into a pit) + C2B9-CDA4 + + + Almost invincible - P2 (disable if you fall into a pit) + C2B1-C4A4 + + + Almost invincible - both players (disable if you fall into a pit) + 18B0-C4A4 + + + Level select and 9 lives selectable on the option menu + DF3A-6454 + + + Infinite lives - P1 + DD21-1F6F + + + Infinite lives - P2 + DD26-1F6F + + + Start with no super bombs + DD29-0474 + + + Start with 1 super bomb + DF29-0474 + + + Start with 5 super bombs + D929-0474 + + + Start with 9 super bombs + DB29-0474 + + + Infinite super bombs - P1 + DDE4-39E3 + + + Infinite super bombs - P2 + DDEF-3073 + + + Bomb power-ups give no super bombs + DDE1-44B5 + + + Bomb power-ups give 2 super bombs + D4E1-44B5 + + + Start with 1 health + DF25-0D84 + + + Start with 4 health + D025-0D84 + D039-0454 + + + Start with 5 health + D925-0D84 + D939-0454 + + + Start with 8 health + D625-0D84 + D639-0454 + + + Start with no continues + DF83-AD84 + + + Start with 1 continue + D483-AD84 + + + Start with 5 continues + D183-AD84 + + + Start with 9 continues + DC83-AD84 + + + + Sailormoon (France) + + Infinite HP - P2 + 7E07C050 + + + Infinite Bombs + 7E075909 + + + Full charge meter + 7E075620 + + + + Samurai Shodown (USA) + + Infinite health - P1 + 7E621480 + + + Infinite health - P2 + 7E661480 + + + Infinite time + 7EBE9B63 + + + Max POW meter - P1 + 7E623D20 + + + Max POW meter - P2 + 7E663D20 + + + Max POW meter after one hit + DFE1-876D + + + One hit kills - P1 + 7E661401 + + + One hit kills - P2 + 7E621401 + + + Start with 1/2 health + 0D94-7401 + + + Start with 1/4 health + 4D94-7401 + + + Start with 33 seconds + 4F53-74A4 + + + + Sanrio World Smash Ball! (Japan) + + Always have strong smash - P1 + 7E0070A0 + + + Always Have Strong Smash - P2 + 7E0086A0 + + + Never have strong smash - 1P + 7E007000 + + + Never have strong smash - 2P + 7E008600 + + + + Saturday Night Slam Masters (USA) + + Stingray becomes Biff + DDC1-CF6F + + + Stingray becomes Gunloc + DFC1-CF6F + + + Stingray becomes Oni + D4C1-CF6F + + + Stingray becomes Titan + D7C1-CF6F + + + Stingray becomes Haggar + D9C1-CF6F + + + Stingray becomes Grater + D1C1-CF6F + + + Stingray becomes Rasta + D5C1-CF6F + + + Stingray becomes Jumbo + D6C1-CF6F + + + Stingray becomes Scorpion + DBC1-CF6F + + + Biff becomes Gunloc + DFC1-CD6F + + + Biff becomes Oni + D4C1-CD6F + + + Biff becomes Titan + D7C1-CD6F + + + Biff becomes Stingray + D0C1-CD6F + + + Biff becomes Haggar + D9C1-CD6F + + + Biff becomes Grater + D1C1-CD6F + + + Biff becomes Rasta + D5C1-CD6F + + + Biff becomes Jumbo + D6C1-CD6F + + + Biff becomes Scorpion + DBC1-CD6F + + + 14-second count outside ring + D3DB-5D01 + + + 10-second count outside ring + DCDB-5D01 + + + 9-second count for pin + DBD6-5DD1 + + + 6-second count for pin + D1D6-5DD1 + + + 1-second count for pin + DFD6-5DD1 + + + Faster timer + F31F-8F0D + + + Slower timer + 1D1F-8F0D + + + Stingray has faster jalepeno comet + D12D-5765 + EB2F-5F05 + + + Quicker 'pattycake slap' for Grater + 0C83-17D7 + D78E-1F67 + + + Quicker 'sonic fist' for Gunloc + 0C83-1FA7 + D78E-1D07 + + + Quicker 'sonic fist' for Biff + 0C83-1F67 + D78E-1D07 + + + Quicker 'jungle fever' for Rasta + 0C83-1707 + D48E-1FA7 + + + Able to pick the same characters + 1D79-EFD4 + 1D77-E404 + + + + Scooby-Doo Mystery (USA) + + Start with 1 life + DD60-1467 + + + Start with 5 lives + D060-1467 + + + Start with 7 lives + D160-1467 + + + Start with 10 lives + DB60-1467 + + + Infinite lives + C2BF-3DAD + + + Infinite energy + DDED-3F01 + + + Most enemies are more frightening + EEED-3F01 + + + Scooby snacks do nothing + C26D-1FD5 + + + Scooby snacks reduce more fright + EE64-1DD5 + + + + Secret of Evermore (USA) + + Have all weapons + 7E22DAFF + 7E22DBFF + + + Everyone is invincible, including enemies + C2A0-CD5A + 826B-41DF + D261-400F + + + Start with 99 attack points + 95B9-34ED + + + Start with a lot of attack points + EEB9-34ED + + + Start with 99 defense points + 17B5-C75D + + + Start with a lot of defense points + EEB5-C75D + + + Start with 99 magic defense points + 17B7-445F + + + Start with a lot of magic defense points + EEB7-445F + + + Start with 50 evade % points + 7464-CFE7 + + + Start with 99 evade % points + 1764-CFE7 + + + Start with 50 hit % points + 746D-3F57 + + + Start with 99 hit % points + 176D-3F57 + + + Start with 99 HP + 1786-CFEB + 17BB-17ED + + + Start with 255 HP + EE86-CFEB + EEBB-17ED + + + Your dog starts with 99 HP + 17BF-1FEF + + + Your dog starts with 255 HP + EEBF-1FEF + + + Infinite Alchemy ingredients + 8EA4-C905 + 8EAE-11D5 + + + Alchemy levels up on every use + DDA9-15D5 + + + View Boy's stats to get 131,074 Talons (don't use if you already have more than that) + CBC4-3DE0 + D4C4-3F70 + DDC4-3F50 + 62C4-3470 + + + + Secret of Mana (USA) + + Start new game with 255 GP + EE28-EDAF + + + Start new game with 32,768 GP + 6D28-EFDF + + + Start new game with 65,280 GP + EE28-EFDF + + + Start new game at Level 16 + 6F09-8707 + + + Strength for level 16 is 90 + 9C06-81AD + + + Agility for level 16 is 90 + 9C06-85DD + + + Constitution for level 16 is 90 + 9C06-850D + + + Intelligence for level 16 is 90 + 9C06-856D + + + Wisdom for level 16 is 90 + 9C06-85AD + + + Chest in elder's basement in Potos gives you 65,360 GP + EE6B-8738 + + + Staying at the inn in Potos is free if you have enough money + C274-8764 + C277-8DA4 + + + Items in the shop at Potos are free if you have enough money + CE5F-5767 + + + Candy costs nothing + DDEB-E544 + + + Overalls costs nothing + DDE3-E044 + + + Bandanna costs nothing + DDE8-E9C4 + + + Cup of wishes costs nothing + DDEC-E9C4 + + + Medical herb costs nothing + DDEC-E944 + + + Wristband costs nothing + DDE7-7047 + + + Hair ribbon costs nothing + DDE8-E144 + + + Rabite cap costs nothing + DDE8-E1C4 + + + Faerie walnut costs nothing + DDEC-E0C4 + DDEC-E034 + + + Royal jam costs nothing + DDEC-E044 + + + Chocolate costs nothing + DDEB-E5C4 + + + Staying at Neko's costs nothing instead of 30 + DDAB-E715 + + + Protection from most hits (Switch off to kill enemies) + 8208-776D + + + Change screens to max out Strength, Agility, Constitution, Intelligence and Wisdom + DD03-ED04 + + + + Shadowrun (USA) + + Start with computer firearms skills at level 2 + D4BE-4DA4 + + + Start with computer firearms skills at level 3 + D7BE-4DA4 + + + Start with computer firearms skills at level 4 + D0BE-4DA4 + + + Start with computer firearms skills at level 5 + D9BE-4DA4 + + + Start with computer firearms skills at level 6 + D1BE-4DA4 + + + Everything is free + 6DAE-4FA7 + FFAE-44D7 + + + Don't subtract karma for spells/skills (must have enough to advance) + CEEF-4DDD + + + Don't subtract karma for shooting people (ignore message saying you lost karma) + CE6D-47A4 + + + Don't subtract spell points (works for all spell casters) + 8E69-3DA4 + + + Start with 2 strength and charisma + D4BC-4404 + + + Start with 4 strength and charisma + D0BC-4404 + + + Start with 5 strength and charisma + D9BC-4404 + + + Start with 6 strength and charisma + D1BC-4404 + + + Start with 50 stamina + 74B8-4DA4 + + + Start with 100 stamina + 10B8-4DA4 + + + Going up 1 body point adds 20 stamina instead of 10 + F0E1-1FDD + + + Going up 1 body point adds 30 stamina instead of 10 + F3E1-1FDD + + + + Shadow, The (USA) (Proto) (Alt 1) + + Infinite health + 7E1E31FF + + + Infinite dash + 7E1876FF + + + Infinite time + 7E1B7609 + + + Enemy 1 has 0 health + 7E1B4A00 + + + Enemy 2 has 0 health + 7E1B4B00 + + + Enemy 3 has 0 health + 7E1B4C00 + + + Start on level 2 - Empire State + 7E1E2801 + + + Start on level 3 - Amusement Park + 7E1E2802 + + + Start on level 4 - The Museum + 7E1E2803 + + + Start on level 5 - The Federal Buildings + 7E1E2804 + + + Start on level 6 - The Bike Chase + 7E1E2805 + + + Start on level 7 - Maritech Labs + 7E1E2806 + + + Start on level 8 - China Town + 7E1E2807 + + + Start on level 9 - Hotel Monolith + 7E1E2808 + + + + Shadow, The (USA) (Proto) + + Infinite health + 7E1E31FF + + + Infinite dash + 7E1876FF + + + Infinite time + 7E1B7609 + + + Enemy 1 has 0 health + 7E1B4A00 + + + Enemy 2 has 0 health + 7E1B4B00 + + + Enemy 3 has 0 health + 7E1B4C00 + + + Start on level 2 - Empire State + 7E1E2801 + + + Start on level 3 - Amusement Park + 7E1E2802 + + + Start on level 4 - The Museum + 7E1E2803 + + + Start on level 5 - The Federal Buildings + 7E1E2804 + + + Start on level 6 - The Bike Chase + 7E1E2805 + + + Start on level 7 - Maritech Labs + 7E1E2806 + + + Start on level 8 - China Town + 7E1E2807 + + + Start on level 9 - Hotel Monolith + 7E1E2808 + + + + Shaq Fu (USA) + + Start with no continues + DDA6-5D07 + + + Start with 1 continues + DFA6-5D07 + + + Start with 5 continues + D9A6-5D07 + + + Start with 9 continues + DBA6-5D07 + + + Start with 15 continues + DEA6-5D07 + + + Infinite continues in duel mode + C269-EF0D + + + Blood + DDB6-57AF + DDB3-746F + + + + SimAnt (USA) + + Always have maximum energy + D88-0D0A + + + Yellow ant always wins + DDA7-6402 + + + + SimCity 2000 (USA) + + Start with $99,999,999 on all the maps except the Land Of Freedom + EEF3-8700 + 3DF3-8760 + E9FE-8D60 + D9FE-8DA0 + + + Start with $99,999,999 on the Land Of Freedom + EEF3-8D00 + 3DF3-8D60 + E9F3-8F60 + D9F3-8FA0 + + + + SimCity (USA) + + Money doesn't decrease for most types of spending + C28A-AD61 + + + Time goes faster + DD67-DFAA + + + Time goes slower + DE67-DFAA + + + Start easy game with $40,000 + 0DAB-6D02 + BAAB-6D62 + + + Start easy game with $60,000 + 1DAB-6D02 + 3CAB-6D62 + + + Start easy game with $3,000 + 86AB-6D02 + D8AB-6D62 + + + + SimEarth - The Living Planet (USA) + + Infinite Omega energy + DDB2-F35E + + + + Simpsons, The - Bart's Nightmare (USA) + + Infinite life + 7E09380A + + + Infinite hits + 7E05140B + + + Infinite 99 Watermelon Seeds left + 7E013763 + + + Infinite 99 Gum left + 7E013D63 + + + Infinite Bubbles and Seeds + 89CB-D9B5 + + + All Pages + 7E013F08 + + + No Pages + 7E013F00 + + + Start with 2 bubbles + D46A-D521 + + + Start with 9 bubbles + DB6A-D521 + + + Infinite lives (Bartman and Itchy and Scratchy sub-games) + C2BE-60EA + + + Infinite Z's (main game) + C2C3-6925 + C2C3-61B5 + + + + Skuljagger - Revolt of the Westicans (USA) + + Invincibility + 7E1A0208 + + + 10 Green Jemeralds gives an extra life + FDC3-6DA4 + + + 50 Green Jemeralds gives an extra life + 9DC3-6DA4 + + + 1 Green Jemerald gives an extra life + DDC3-6F04 + + + Infinite time + DD6B-DF07 + + + Infinite time (alt) + 7E02BEFF + + + Slower timer + 5D66-DFA7 + + + Faster timer + F366-DFA7 + + + Die when touched (regardless of Jemeralds) + 6DCB-A404 + 6DCC-A4D4 + + + Time goes by 2x as fast + D46B-DF07 + + + Time goes by 4x as fast + D06B-DF07 + + + Green Jemeralds worth 3 + D7C2-6704 + + + Green Jemeralds worth 9 + DBC2-6704 + + + Green Jemeralds worth 19 + FBC2-6704 + + + Green Jemeralds worth 25 (extra life on each one) + 49C2-6704 + + + Infinite lives + DDCA-AD04 + DDBB-6D61 + + + Start with 1 life instead of 5 + DF83-D765 + + + Start with 3 lives + D783-D765 + + + Start with 9 lives + DB83-D765 + + + Start with 19 lives + FB83-D765 + + + Start with 50 lives + 9D83-D765 + + + Start with 99 lives + BB83-D765 + + + Walk through enemies if you have no Red Jemeralds + 1DCC-A4D4 + + + Don't lose all Red Jemeralds when you get hit + D4CB-A7D4 + + + Don't lose Green Jemeralds when you fall and die + C2BB-6FA1 + + + No enemies or Jemeralds (good for exploring, disable to advance) + 8BAB-6DD9 + + + + Skyblazer (USA) + + Infinite energy (keep disabled until game start) + 7EF80108 + + + Infinite lives (keep disabled until game start) + 7E1F0009 + + + Infinite special power (keep disabled until game start) + 7E1F0D08 + + + + Smart Ball (USA) + + Start with 1 life instead of 3 + DF6D-676D + + + Start with 5 lives + D96D-676D + + + Start with 10 lives + DC6D-676D + + + Start with 25 lives + FB6D-676D + + + Start with 50 lives + 746D-676D + + + Start with 99 lives + 176D-676D + + + Infinite lives + C2B9-0F0D + + + Protection from most enemies (lose no hearts) + C2BE-A467 + + + Infinite red balls on pick-up - until continue + C266-04A7 + + + Go to any level + 7762-040D + DE62-0FAD + + + Super-jump + ECC3-DF6D + + + Mega-jump + E1C3-DF6D + + + + Soldiers of Fortune (USA) + + Infinite health - P1 + 7E40F064 + + + Infinite health - P2 or computer partner + 7E416564 + + + Infinite lives - P1 + 7E009004 + + + Infinite lives - P2 or computer partner + 7E009204 + + + Infinite special attacks - P1 + 7E40FF06 + + + Infinite special attacks - P2 or computer partner + 7E417406 + + + Smaller food power-ups heal twice as much + DCE0-87AD + + + Smaller food power-ups heal four times as much + F0E0-87AD + + + Large food power-ups heal twice as much + F3E9-8FDD + + + Large food power-ups heal four times as much + 7AE9-8FDD + + + Only 3 special powers can be stored instead of 6 (handicap) + D0EB-8DDD + + + Special power power-ups are worth 6 (always fill meter) + 6DEB-8D0D + + + Special powers aren't used up + 3CC6-870D + + + Infinite lives + CBC1-E46F + + + Mercenary starts with much more health + 1D4E-5475 + + + Brigand starts with much more health + 1D44-87E5 + + + Gentleman starts with much more health + 1D41-8F85 + + + Navvie starts with much more health + 1D4B-8755 + + + Thug starts with much more health + 1D42-8F75 + + + Scientist starts with much more health + 1D4D-E4E5 + + + Extra lives cost 244 instead of 500 + DDF6-5D50 + + + Skill power-ups cost 44 instead of 300 + DDF6-5DE0 + + + Health power-ups cost 1 instead of 75 + DFF6-5F70 + + + Health power-ups cost 25 instead of 75 + FBF6-5F70 + + + Speed power-ups cost 1 instead of 250 + DFF6-5F80 + + + Speed power-ups cost 100 instead of 250 + 10F6-5F80 + + + Wisdom power-ups cost 1 instead of 80 + DFF6-5470 + + + Wisdom power-ups cost 25 instead of 80 + FBF6-5470 + + + Special powers cost 1 instead of 150 + DFF6-5480 + + + Special powers cost 50 instead of 150 + 74F6-5480 + + + Weapon power-ups cost 1 instead of 250 + DFF6-5780 + + + Weapon power-ups cost 100 instead of 250 + 10F6-5780 + + + ??? (New Special powers costs 44 instead of 300) + DDF6-5750 + + + Brigand starts with Bomb special power + DF40-ED75 + + + Mercenary starts with Bomb special power + DF40-EF75 + + + Gentleman starts with Bomb special power + DF40-E475 + + + Navvie starts with Bomb special power + DF40-E775 + + + Thug starts with Bomb special power + DF49-ED75 + + + Scientist starts with Bomb special power + DF49-EF75 + + + Brigand starts with Shot Burst special power + D440-ED75 + + + Mercenary starts with Shot Burst special power + D440-EF75 + + + Gentleman starts with Shot Burst special power + D440-E475 + + + Navvie starts with Shot Burst special power + D440-E775 + + + Thug starts with Shot Burst special power + D449-ED75 + + + Scientist starts with Shot Burst special power + D449-EF75 + + + Brigand starts with Map special power (must still destroy nodes special power) + D740-ED75 + + + Mercenary starts with Map special power (must still destroy nodes special power) + D740-EF75 + + + Gentleman starts with Map special power (must still destroy nodes special power) + D740-E475 + + + Navvie starts with Map special power (must still destroy nodes special power) + D740-E775 + + + Thug starts with Map special power (must still destroy nodes special power) + D749-ED75 + + + Scientist starts with Map special power (must still destroy nodes special power) + D749-EF75 + + + Brigand starts with Destroy Nodes special power + D040-ED75 + + + Mercenary starts with Destroy Nodes special power + D040-EF75 + + + Gentleman starts with Destroy Nodes special power + D040-E475 + + + Navvie starts with Destroy Nodes special power + D040-E775 + + + Thug starts with Destroy Nodes special power + D049-ED75 + + + Scientist starts with Destroy Nodes special power + D049-EF75 + + + Brigand starts with Repel Monster special power + D940-ED75 + + + Mercenary starts with Repel Monster special power + D940-EF75 + + + Gentleman starts with Repel Monster special power + D940-E475 + + + Navvie starts with Repel Monster special power + D940-E775 + + + Thug starts with Repel Monster special power + D949-ED75 + + + Scientist starts with Repel Monster special power + D949-EF75 + + + Brigand starts with First Aid special power + D140-ED75 + + + Mercenary starts with First Aid special power + D140-EF75 + + + Gentleman starts with First Aid special power + D140-E475 + + + Navvie starts with First Aid special power + D140-E775 + + + Thug starts with First Aid special power + D149-ED75 + + + Scientist starts with First Aid special power + D149-EF75 + + + Brigand starts with Freeze Monster special power + D540-ED75 + + + Mercenary starts with Freeze Monster special power + D540-EF75 + + + Gentleman starts with Freeze Monster special power + D540-E475 + + + Navvie starts with Freeze Monster special power + D540-E775 + + + Thug starts with Freeze Monster special power + D549-ED75 + + + Scientist starts with Freeze Monster special power + D549-EF75 + + + Brigand starts with Shield special power + D640-ED75 + + + Mercenary starts with Shield special power + D640-EF75 + + + Gentleman starts with Shield special power + D640-E475 + + + Navvie starts with Shield special power + D640-E775 + + + Thug starts with Shield special power + D649-ED75 + + + Scientists starts with Shield special power + D649-EF75 + + + Brigand starts with Party Power special power + DB40-ED75 + + + Mercenary starts with Party Power special power + DB40-EF75 + + + Gentleman starts with Party Power special power + DB40-E475 + + + Navvie starts with Party Power special power + DB40-E775 + + + Thug starts with Party Power special power + DB49-ED75 + + + Scientist starts with Party Power special power + DB49-EF75 + + + Brigand starts with Air Burst special power + DC40-ED75 + + + Mercenary starts with Air Burst special power + DC40-EF75 + + + Gentleman starts with Air Burst special power + DC40-E475 + + + Navvie starts with Air Burst special power + DC40-E775 + + + Thug starts with Air Burst special power + DC49-ED75 + + + Scientist starts with Air Burst special power + DC49-EF75 + + + Brigand starts with Distract Monster special power + D840-ED75 + + + Mercenary starts with Distract Monster special power + D840-EF75 + + + Gentleman starts with Distract Monster special power + D840-E475 + + + Navvie starts with Distract Monster special power + D840-E775 + + + Thug starts with Distract Monster special power + D849-ED75 + + + Scientist starts with Distract Monster special power + D849-EF75 + + + Brigand starts with Molotov special power + DA40-ED75 + + + Mercenary starts with Molotov special power + DA40-EF75 + + + Gentleman starts with Molotov special power + DA40-E475 + + + Navvie starts with Molotov special power + DA40-E775 + + + Thug starts with Molotov special power + DA49-ED75 + + + Scientist starts with Molotov special power + DA49-EF75 + + + Brigand starts with Ground Mine special power + D240-ED75 + + + Mercenary starts with Ground Mine special power + D240-EF75 + + + Gentleman starts with Ground Mine special power + D240-E475 + + + Navvie starts with Ground Mine special power + D240-E775 + + + Thug starts with Ground Mine special power + D249-ED75 + + + Scientist starts with Ground Mine special power + D249-EF75 + + + Brigand starts with Dynamite special power + D340-ED75 + + + Mercenary starts with Dynamite special power + D340-EF75 + + + Gentleman starts with Dynamite special power + D340-E475 + + + Navvie starts with Dynamite special power + D340-E775 + + + Thug starts with Dynamite special power + D349-ED75 + + + Scientist starts with Dynamite special power + D349-EF75 + + + Brigand gets Party Power as a 4th special power + DB40-EDE5 + + + Mercenary gets Party Power as a 4th special power + DB40-EFE5 + + + Navvie gets Party Power as a 3rd special power + DB40-E785 + + + Thug gets Party Power as a 3rd special power + DB49-ED85 + + + + Sonic Blast Man II (USA) + + Invincibility + C206-5F64 + + + Infinite health + C20B-EFA7 + + + Infinite lives + C295-7F6F + + + Infinite health - P1 + 7E0DA5FF + + + Infinite health - P2 + 7E1DA7FF + + + Infinite Specials - P1 + 7E0DAD63 + + + Infinite Specials - P2 + 7E1DAF63 + + + Infinite lives - P1 + 7E0DA932 + + + Infinite lives - P2 + 7E0DAB32 + + + One hit kills on most enemies and bosses + 7E137700 + 7E139300 + 7E139500 + 7E139100 + 7E138F00 + + + Play as Sonic Blast Man - P1 + 7E0D8D00 + + + Play as Sonic Blast Man - P2 + 7E0D8F00 + + + Play as Sonia - P1 + 7E0D8D01 + + + Play as Sonia - P2 + 7E0D8F01 + + + Play as Captain Choyear - P1 + 7E0D8D02 + + + Play as Captain Choyear - P2 + 7E0D8F02 + + + + Sonic Blast Man (USA) + + Invincibility + 2DC2-07A7 + + + Infinite health + C2A9-04AD + + + Infinite health against most enemy hits + C2A9-04AD + + + Infinite health against hits on the head when you're being held + C2C3-0DAD + + + Infinite special + C2C3-0464 + + + Infinite Dynamite Punches + C2C3-0464 + + + Infinite lives + DDA5-6F60 + + + Infinite lives (alt) + C2A5-64D0 + + + Infinite credits + C2AC-A4A4 + + + Start with 11 lives + D76B-D46D + + + Start with 0 dynamite punches + DDAD-ADDF + + + Start with 5 dynamite punches + D9AD-ADDF + + + Start with 7 dynamite punches + D5AD-ADDF + + + Start with 9 dynamite punches + DBAD-ADDF + + + Start with 3/4 health + 7AB9-0DD7 + + + Start with 1/2 health + 46B9-0DD7 + + + Start with 1/4 health + F0B9-0DD7 + + + Continue with 3/4 health + 7AB5-A407 + + + Continue with 1/2 health + 46B5-A407 + + + Continue with 1/4 health + F0B5-A407 + + + Super glove worth nothing + C2A9-0F6F + + + Hamburger worth nothing + DDA4-070F + + + Hamburger fully restores health + 9DA4-070F + + + Apple worth nothing + DDAF-040F + + + Apple fully restores health + 9DAF-040F + + + Start on stage 2 + 33BC-0F0F + + + Start on stage 3 + CBBC-0D6F + 3CBC-0FDF + 62BC-0F0F + D4BC-0DAF + + + Start on stage 4 + CBBC-0D6F + 3CBC-0FDF + 62BC-0F0F + D7BC-0DAF + + + Start on stage 5 + CBBC-0D6F + 3CBC-0FDF + 62BC-0F0F + D0BC-0DAF + + + + Soul Blazer (USA) + + Invincibility + C26E-6DA7 + C223-0D07 + + + Infinite and max HP + 7E1B8864 + 7E1B8A64 + + + Have all spirits after obtaining the first one + FEC3-A7D2 + + + Get max level + DDEB-649F + + + Start with 4 HP (alt) + D0E6-0FB4 + + + Start with 15 HP + DEE6-0FB4 + + + Start with 25 HP + FBE6-0FB4 + + + Start with 50 HP + 74E6-0FB4 + + + Start with 75 HP + 08E6-0FB4 + + + Start with 100 HP + 10E6-0FB4 + + + Start with 127 HP + 5EE6-0FB4 + + + Gems set to 999,999 every time one is obtained + DDE8-64BF + + + Level up more quickly + 7E1B78FF + + + 10 EXP required instead of 100 for level 2 + FDE8-A761 + DDE8-A7A1 + + + 180 EXP required instead of 280 for level 3 + DFEA-ADA1 + + + 380 EXP required instead of 580 for level 4 + D7EA-AFA1 + + + 600 EXP required instead of 1,000 for level 5 + D1EA-A4A1 + + + 1,200 EXP required instead of 2,000 for level 6 + F4EA-A7A1 + + + 2,400 EXP required instead of 3,200 for level 7 + 40E2-ADA1 + + + 3,500 EXP required instead of 4,500 for level 8 + 79E2-AFA1 + + + 4,800 EXP required instead of 5,800 for level 9 + 06E2-A4A1 + + + 6,600 EXP required instead of 7,600 for level 10 + 11E2-A7A1 + + + 8,600 EXP required instead of 9,600 for level 11 + 61E3-ADA1 + + + 10,000 EXP required instead of 12,400 for level 12 + DDE3-AFA1 + + + 13,000 EXP required instead of 15,000 for level 13 + 7DE3-A4A1 + + + 15,000 EXP required instead of 19,000 for level 14 + 9DE3-A7A1 + + + + Space Football - One on One (USA) + + No pushback on firing + C2C9-D46F + + + Push forward on firing + 1BC9-DFAF + + + Instant acceleration + 1B26-A7D7 + + + Infinite energy + C2B9-D7AF + + + + Space Invaders - The Original Game (USA) + + Infinite lives + CB6F-37A9 + + + Enemies never move + 7E03D500 + + + Infinite credits + 7E03BF02 + + + + Space Megaforce (USA) + + Start with 0 bombs instead of 3 + DDC9-DD06 + + + Start with 7 bombs + D5C9-DD06 + + + Start with 10 bombs + FDC9-DD06 + + + Start with 25 bombs + 49C9-DD06 + + + Start with 50 bombs + 9DC9-DD06 + + + Start with 99 bombs + BBC9-DD06 + + + Infinite bombs + DD65-AFAB + + + Start with 2 ships + DFBE-A4A8 + + + Start with 8 ships + D5BE-A4A8 + + + Start with 11 ships + FDBE-A4A8 + + + Start with 26 ships + 49BE-A4A8 + + + Start with 51 ships + 9DBE-A4A8 + + + Start with 76 ships + 59BE-A4A8 + + + Start with 100 ships + BBBE-A4A8 + + + Infinite ships + DD6D-07AC + + + Each bomb capsule worth 0 + DDCE-D4D6 + + + Each bomb capsule worth 2 + D4CE-D4D6 + + + Each bomb capsule worth 4 + D0CE-D4D6 + + + Each bomb capsule worth 6 + D1CE-D4D6 + + + Protection against enemy hits, and weapon level goes to 2 when hit + CB68-D4AC + D168-D7DC + + + Protection against enemy hits, and weapon level goes to 6 when hit + CB68-D4AC + D168-D7DC + D16A-D4DC + + + Start in area 2 + CB6A-0D0D + D46A-0D6D + + + Start in area 3 + CB6A-0D0D + D76A-0D6D + + + Start in area 4 + CB6A-0D0D + D06A-0D6D + + + Start in area 5 + CB6A-0D0D + D96A-0D6D + + + Start in area 6 + CB6A-0D0D + D16A-0D6D + + + Start in area 7 + CB6A-0D0D + D56A-0D6D + + + Start in area 8 + CB6A-0D0D + D66A-0D6D + + + Start in area 9 + CB6A-0D0D + DB6A-0D6D + + + Start in area 10 + CB6A-0D0D + DC6A-0D6D + + + Start in area 11 + CB6A-0D0D + D86A-0D6D + + + Start in area 12 + CB6A-0D0D + DA6A-0D6D + + + All weapon capsules give you weapon type 1 + CBC4-0F06 + DDC4-0F66 + + + All weapon capsules give you weapon type 2 + CBC4-0F06 + DFC4-0F66 + + + All weapon capsules give you weapon type 3 + CBC4-0F06 + D4C4-0F66 + + + All weapon capsules give you weapon type 4 + CBC4-0F06 + D7C4-0F66 + + + All weapon capsules give you weapon type 5 + CBC4-0F06 + D0C4-0F66 + + + All weapon capsules give you weapon type 6 + CBC4-0F06 + D9C4-0F66 + + + Power shots (weapon type 6) last until you pick up another weapon or get hit (they normaly last only a couple of seconds) + 828E-AF6B + + + + Spanky's Quest (USA) + + Infinite lives + 40AC-DF08 + + + Start with 1 life + DD31-AFAD + + + Start with 6 lives + D931-AFAD + + + Start with 10 lives + DB31-AFAD + + + Start with 1 key in all areas after 1-1 + CB3F-0FDF + DF3F-0F0F + + + Start on area 2-1 + CB35-A7AD + DF36-ADDD + + + Start on area 3-1 + CB35-A7AD + D436-ADDD + + + Start on area 4-1 + CB35-A7AD + D736-ADDD + + + Start on area 5-1 + CB35-A7AD + D036-ADDD + + + + Spawn (USA) + + Invincibility + 7E1F561F + + + Invincibility after one hit (invisible) + C203-84D1 + + + Don't blink after getting hit + FDDB-5FB9 + + + Almost invincible (blinking) + 3C03-8F61 + + + Infinite health + 7E1F0063 + + + Infinite health (alt) + C208-87D1 + + + Start with 1/4 health + FDB0-E4DB + + + Start with 1/2 health + 4CB0-E4DB + + + Start with 3/4 health + 73B0-E4DB + + + Falling doesn't use life points + C2F4-7FD1 + + + Special moves don't use life points + C27D-8701 + + + Some bullets do 2x damage + D6D7-8F20 + + + Some bullets do no damage + DDD7-8F20 + + + Some bullets kill you + EED7-8F20 + + + Some enemy punches electrocute you + DB78-84B0 + + + Some enemy punches do no damage + DD78-84B0 + + + Some enemy punches kill you + EE78-84B0 + + + Guys with pipes do 2x damage + DBB0-EFA3 + DBCF-8763 + + + Guys with pipes do no damage + DDB0-EFA3 + DDCF-8763 + + + Guys with pipes kill + EEB0-EFA3 + EECF-8763 + + + Flaming bottles do 2x damage + DB4B-7DF1 + DB43-E4F9 + + + Flaming bottles do no damage + DD4B-7DF1 + DD43-E4F9 + + + + Spectre (USA) + + Infinite custom shield + 7E1B420A + + + Infinite custom speed + 7E1B440A + + + Infinite custom ammo + 7E1B460A + + + Infinite ammo + C2C8-D4DD + + + Infinite lives + E08F-D40D + + + Infinite health + E0C1-6707 + + + Infinite hyperspace + C2C0-DDDF + + + Freeze bonus timer + C232-ADA4 + + + + Speedy Gonzales - Los Gatos Bandidos (USA) (Rev 1) + + Infinite health + C2B4-CFAD + + + Infinite time + 3CA9-C76D + + + Infinite continues + C266-44A1 + + + Start with 99 lives + 176C-44DD + + + + SpellCraft (USA) (Proto) + + Infinite health + 7E018D99 + + + Quick enemy death + 7E019300 + + + Fast level up + 7E00FDFF + + + Infinite Stones + 7E029609 + + + Infinite Jewels + 7E029809 + + + Infinite Candles + 7E029A09 + + + Infinite Powders + 7E029C09 + + + + Spider-Man (USA) + + Stay invincible after death + C2CF-C70D + + + Infinite health + C9BB-3DD8 + + + Infinite lives + C2B1-3468 + + + Infinite webbing + C3CA-1F6F + C2CC-44A7 + C3CC-1FAF + C2CF-4707 + + + Gain webbing instead of losing it + 33CA-1F6F + 33CC-44A7 + 33CC-1FAF + 33CF-4707 + + + Increase diagnol webbing with R button + 33CA-1F6F + + + Increase straight webbing with X button + 33CC-44A7 + + + + Spider-Man-Venom - Maximum Carnage (USA) + + Invincibility + C264-CFD0 + + + Infinite health + C2A1-1F01 + + + Infinite health (alt) + 7E0B7C2C + + + Start with 2x health + 1DCC-C460 + + + Start with 3x health + BDCC-C460 + + + Infinite lives + C2BB-1D61 + + + Infinite lives (alt) + 7E099005 + + + Start with 1 life + DFC8-CDD0 + + + Start with 6 lives + D1C8-CDD0 + + + Start with 9 lives + DBC8-CDD0 + + + Start with 9 continues + DBC8-CF60 + + + Start with 6 continues + D1C8-CF60 + + + Infinite hero icons on pick up + 8220-47AB + + + Super punch + DBA6-17F5 + + + Infinite accuracy + 7E1CCA58 + + + 'Power Hit' lasts longer + D06A-4F09 + + + Jump higher + 7D80-3F61 + + + Have 7 Black Cats with infinite usage + 7E0B1807 + + + Have 7 Cloaks with infinite usage + 7E0B1A07 + + + Have 7 Dagger with infinite usage + 7E0B1C07 + + + Have 7 Morbius with infinite usage + 7E0B1E07 + + + Have 7 Firestar with infinite usage + 7E0B2007 + + + Have 7 Captain Americas with infinite usage + 7E0B2207 + + + Have 7 Iron Fist with infinite usage + 7E0B2407 + + + Have 7 Deathlok with infinite usage + 7E0B2607 + + + Have 7 Venom With Sonic Gun with infinite usage + 7E0B2807 + + + + Spider-Man-X-Men - Arcade's Revenge (USA) + + Invincibility - Spider-Man + 7E10F6FF + + + Invincibility after first hit (blinking) - Spider-Man + C261-A044 + + + Infinite health - Spider-Man + 7E10F8FF + + + Infinite health - Wolverine, Cyclops, Storm + 7E0B2964 + + + Infinite health - Gambit + 7E119E96 + + + Infinite lives - Everyone + 7E010009 + + + Infinite lives - Spider-Man + C266-D51D + + + Infinite lives - Gambit + C26D-090A + + + Infinite lives - Wolverine, Cyclops, Storm + C2C2-D767 + + + Start with 1 life instead of 3 + DD68-646D + + + Start with 5 lives + D068-646D + + + Start with 7 lives + D168-646D + + + Start with 10 lives + DB68-646D + + + Start with 26 lives + FB68-646D + + + Start with 51 lives + 7468-646D + + + Start with 100 lives + 1768-646D + + + Infinite multibolt - Storm + 7E14F201 + + + 99 stars - Gambit + 7E11AA63 + + + Infinite cards - Gambit + 7E11A032 + + + Infinite joker wild cards - Gambit + 7E11A209 + + + Stop giant spiked wheel in first stage - Gambit + 7E11F9FF + + + Spider-Man jumps higher (if you jump too high in some places you die) + CB69-0937 + E669-0147 + + + Protects Spider-Man from most hits (lose no energy) + DDCB-6144 + + + Protects Spider-Man from ground hazard (looks like silver weeds) + C2CC-A917 + + + + Spindizzy Worlds (USA) + + Faster G.E.R.A.L.D. + D46F-6FDD + + + Slower timer + D0BD-64DF + + + More fuel lost from falling off landscape + 4D6C-DFD7 + + + Less fuel lost from falling off landscape + D96C-DFD7 + + + Almost zero fuel lost from falling off landscape + DD6C-DFD7 + + + Don't lose fuel from anything + 4AEC-DDA4 + + + + Star Fox (USA) + + Invincibility + 79DB-2286 + + + Infinite health (Slippy) + 0DFC-FA8C + + + Infinite health (Falco) + 0DFC-FA5C + + + Infinite health (Peppy) + 0DFC-FA7C + + + Infinite lives + DBF3-BE8B + + + Infinite bombs + D9FC-9EEB + + + Infinite shield + 46DB-2286 + + + Double blasters + F4F2-F38B + DFF2-F35B + + + + Star Ocean (Japan) + + No random battles + 6D5D-7F66 + + + Fight one battle for max level/EXP + DD1E-E4D5 + + + Fight one battle for max Fol (alt) + DD1F-E465 + + + View status screen for max strength, constitution, agility and stamina (These affect the base stat, making it savable. Stamina won't appear updated until you turn the codes off and re-enter that character's status screen) + DD48-54CF + 9843-774D + 1F47-5F3D + 1243-5DCD + 2C4A-5F3D + + + Infinite items when using item creation skills + 8E23-87C6 + + + + Star Trek - Deep Space Nine - Crossroads of Time (USA) + + Invincibility + 3C3E-0915 + 3C3E-09C5 + + + Invincibility after first hit + C23E-0935 + + + Infinite energy + C23C-6545 + + + Start with 1/4 energy + FDBF-0F04 + FDBF-076F + + + Start with 1/2 energy + F2BF-0F04 + F2BF-076F + + + Start with 3/4 energy + 45BF-0F04 + 45BF-076F + + + Sisko looks like O'Brien + D0BF-0D6F + + + + Star Trek - The Next Generation - Future's Past (USA) + + Medical packs aren't used up + DD81-47DB + + + Medical packs aren't used up + DD88-4DDB + + + Start each away mission with 1 medical pack + DF2A-1DD7 + + + Start each away mission with 2 medical packs + D42A-1DD7 + + + Start each away mission with 4 medical packs (only 3 shown) + D02A-1DD7 + + + Start each away mission with 5 medical packs (only 3 shown) + D92A-1DD7 + + + Phaser power doesn't go down + DDAF-446C + + + Start away missions with phasers at 1/2 power + F62A-1467 + + + Start away missions with phasers at 3/4 power + 402A-1467 + + + Start away missions with phasers at 1/4 power + DA2A-1467 + + + Medical packs heal more + 6D86-4FAB + + + Medical packs heal twice as much + D486-44DB + + + Medical packs heal completely + D786-44DB + + + Crew members are immune to enemy fire + 8EA4-4FD6 + + + + Stone Protectors (USA) + + Infinite health - P1 + 7E13CCB2 + + + Don't lose health from special moves + 8281-0D67 + + + Infinite lives - P1 + C281-D467 + + + + Street Fighter II Turbo (USA) + + Infinite health - P1 + 7E053063 + + + No health (disable during match) - P2 + 7E073000 + + + Infinite time + DD05-7F04 + + + Infinite time (alt) + 7E18F399 + + + Select same character - both players + 7E184820 + + + Enable 10 star turbo mode + ADFC-E40D + F9FC-E46D + + + Enable 10 star turbo mode (alt) + 7E1C8732 + + + Start with 90 seconds + BDA3-176D + + + Start with 70 seconds + 5DA3-176D + + + Start with 50 seconds + 9DA3-176D + + + Start with 30 seconds + 7DA3-176D + + + Start with 10 seconds + FDA3-176D + + + Start with 3/4 health + 6091-E76D + + + Start with 1/2 health + 9691-E76D + + + Start with 1/4 health + 4A91-E76D + + + 1st bonus round is 99 seconds + BBAE-1DDD + + + 1st bonus round is 80 seconds + 6DAE-1DDD + + + 1st bonus round is 60 seconds + 1DAE-1DDD + + + 1st bonus round is 20 seconds + 4DAE-1DDD + + + 2nd bonus round is 99 seconds + BBAE-1D6D + + + 2nd bonus round is 80 seconds + 6DAE-1D6D + + + 2nd bonus round is 60 seconds + 1DAE-1D6D + + + 2nd bonus round is 20 seconds + 4DAE-1D6D + + + Dizzy from every knockdown - P1 + 7E05B301 + + + Dizzy from every knockdown - P2 + 7E07B301 + + + Some special moves can be performed in the air (don't perform Vega's wall leap) + DDF1-7D60 + + + Most attacks do no damage (throws still work) + 891F-84AD + + + Throws do no damage + C734-7405 + + + 1st throws do more damage (if you have enough health), others do less damage + F034-7405 + + + Players can walk through each other + DD3F-EFAD + + + 1st hit of any kind defeats opponent + DD18-570D + + + Winner of 2nd round wins the battle + DF04-5DAF + + + No charging required for special moves (except Balrog's turn punch power) + D071-E460 + + + Hard special moves become light + DD75-8460 + + + Hard special moves become medium + D475-8461 + + + Hard special moves become disabled + D675-8462 + + + Invisible players + 8ED2-87A9 + + + Most special moves go nowhere + C933-7DA9 + + + Fireballs go nowhere + C9B8-77A5 + + + Hard Hurricane Kicks go faster and farther (to the right only) + D039-14AD + + + Ryu's hard Dragon Punch doesn't go as far + DF30-1DAD + + + Ryu's hard Dragon Punch goes farther + D630-1DAD + + + Ryu's medium Dragon Punch doesn't go as far + DF30-1D0D + + + Ryu's medium Dragon Punch goes farther + D630-1D0D + + + Ryu's light Dragon Punch goes farther + D637-17AD + + + Ryu jumps backward farther + D526-1DAF + + + Ryu jumps forward farther + E525-14AF + + + Ken jumps backward farther + D52D-CDAF + + + Ken jumps forward farther + E52E-14AF + + + Ken's hard Dragon Punch doesn't go as far + DF30-17AD + + + Ken's hard Dragon Punch goes farther + D330-17AD + + + Ken's medium Dragon Punch doesn't go as far + DF30-170D + + + Ken's medium Dragon Punch goes farther + D830-170D + + + Ken's light Dragon Punch goes farther + D630-14AD + + + Hard projectiles go faster (except tiger shots) + 3E31-37AD + + + Hard projectiles go slower (except tiger shots) + EE31-37AD + + + Medium projectiles go faster (except tiger shots) + 3E31-370D + + + Medium projectiles go slower (except tiger shots) + EE31-370D + + + Light projectiles go faster (except tiger shots) + 3E31-34AD + + + Light projectiles go slower (except tiger shots) + EE31-34AD + + + Edmond Honda's hard Sumo Head Butts are faster + DE35-1FAD + + + Edmond Honda's hard Sumo Head Butts are slower + DF35-1FAD + + + Edmond Honda's medium Sumo Head Butts are faster + DE35-1F0D + + + Edmond Honda's medium Sumo Head Butts are slower + DF35-1F0D + + + Edmond Honda's light Sumo Head Butts are faster + DE35-1DAD + + + Edmond Honda's light Sumo Head Butts are slower + DF35-1DAD + + + Edmond Honda's hard Sumo Smashes are faster + F436-1DDD + + + Edmond Honda's medium Sumo Smashes are faster + F435-176D + + + Edmond Honda's light Sumo Smashes are faster + F435-17DD + + + Sagat's hard Tiger Uppercut goes farther + D63B-C70D + + + Sagat's medium Tiger Uppercut goes farther + D63B-C4AD + + + Sagat's light Tiger Uppercut goes farther + D63B-C40D + + + Sagat's high Tiger Shots are disabled (you can still do the move but no projectile comes out) + D439-340D + + + Sagat's hard Tiger Knee goes farther + D838-CF0D + + + Sagat's medium Tiger Knee goes farther + D83C-C70D + + + Sagat's light Tiger Knee goes farther + D83C-CF0D + + + M. Bison's hard Psycho Crusher goes slower + DF39-C40D + + + M. Bison's hard Psycho Crusher goes faster + DC39-C40D + + + M. Bison's medium Psycho Crusher goes slower + DF39-CFAD + + + M. Bison's medium Psycho Crusher goes faster + DC39-CFAD + + + M. Bison's light Psycho Crusher goes slower + DF39-CF0D + + + M. Bison's light Psycho Crusher goes faster + DC39-CF0D + + + M. Bison's hard Scissor Kick goes slower (not in normal mode) + DF31-CD6D + + + M. Bison's hard Scissor Kick goes faster (not in normal mode) + DC31-CD6D + + + M. Bison's medium Scissor Kick goes slower (not in normal mode) + DF31-CDDD + + + M. Bison's medium Scissor Kick goes faster (not in normal mode) + DC31-CDDD + + + M. Bison's light Scissor Kick goes slower (not in normal mode) + DF39-C76D + + + M. Bison's light Scissor Kick goes faster (not in normal mode) + DC39-C76D + + + Balrog's first Dash Punch goes slower + DF69-7DD1 + + + Balrog's first Dash Punch goes faster + D869-7DD1 + + + Balrog's first Turn Punch goes slower (and a little backward) + D432-CF0D + + + Balrog's first Turn Punch goes faster + DC32-CF0D + + + Chun Li's hard Whirlwind Kick goes farther + DC38-1F6D + + + Chun Li's medium Whirlwind Kick doesn't go as far + DF38-1FDD + + + Chun Li's medium Whirlwind Kick goes farther + DC38-1FDD + + + Chun Li's light Whirlwind Kick doesn't go as far + DF38-1D6D + + + Chun Li's light Whirlwind Kick goes farther + DC38-1D6D + + + Blanka's hard Rolling Attack goes slower + DF3B-14DD + + + Blanka's hard Rolling Attack goes faster + DC3B-14DD + + + Blanka's medium Rolling Attack goes slower + DF3B-1F6D + + + Blanka's medium Rolling Attack goes faster + DC3B-1F6D + + + Blanka's light Rolling Attack goes slower + DF3B-1FDD + + + Blanka's light Rolling Attack goes faster + DC3B-1FDD + + + Blanka's hard Vertical Rolling Attack doesn't go as far + DF3C-1D0D + + + Blanka's hard Vertical Rolling Attack goes out farther + DA3C-1D0D + + + Blanka's medium Vertical Rolling Attack doesn't go as far + DF3B-17AD + + + Blanka's medium Vertical Rolling Attack goes out farther + DA3B-17AD + + + Blanka's light Vertical Rolling Attack doesn't go as far + DF3B-170D + + + + Street Fighter II (USA) + + Championship mode on + 4DC6-6493 + + + 90 seconds per round instead of 99 + BD62-672A + + + 80 seconds per round + 6D62-672A + + + 70 seconds per round + 5D62-672A + + + 60 seconds per round + 1D62-672A + + + 50 seconds per round + 9D62-672A + + + 40 seconds per round + 0D62-672A + + + 30 seconds per round + 7D62-672A + + + 20 seconds per round + 4D62-672A + + + 10 seconds per round + FD62-672A + + + Win 1 bout to win the match instead of 2 out of 3 + DF80-AD64 + + + Dizziness wears off very quickly + EDBE-0F09 + + + Dizziness lasts longer + C9BE-0DA9 + + + 99 seconds in 1st bonus round instead of 40 + BB63-6D2A + + + 90 seconds in 1st bonus round + BD63-6D2A + + + 80 seconds in 1st bonus round + 6D63-6D2A + + + 70 seconds in 1st bonus round + 5D63-6D2A + + + 60 seconds in 1st bonus round + 1D63-6D2A + + + 50 seconds in 1st bonus round + 9D63-6D2A + + + 30 seconds in 1st bonus round + 7D63-6D2A + + + 20 seconds in 1st bonus round + 4D63-6D2A + + + 10 seconds in 1st bonus round + FD63-6D2A + + + Advance to next level when you continue (disable before you continue on M. Bison's stage) + 6DCF-D764 + FFCF-D7A4 + + + Always fight Ryu + CBA0-AF64 + EEA0-AFA4 + + + Always fight Honda + CBA0-AF64 + DDA0-AFA4 + + + Always fight Blanka + CBA0-AF64 + DFA0-AFA4 + + + Always fight Guile + CBA0-AF64 + D4A0-AFA4 + + + Always fight Ken + CBA0-AF64 + D7A0-AFA4 + + + Always fight Chun-Li + CBA0-AF64 + D0A0-AFA4 + + + Always fight Zangief + CBA0-AF64 + D9A0-AFA4 + + + Always fight Dhalsim + CBA0-AF64 + D1A0-AFA4 + + + Always fight Balrog + CBA0-AF64 + DBA0-AFA4 + + + Always fight Vega + CBA0-AF64 + DCA0-AFA4 + + + Always fight Sagat + CBA0-AF64 + D6A0-AFA4 + + + Fight M. Bison + B9A0-AF04 + + + Always fight on bonus stage 1 + DDA4-A404 + 6DA4-A764 + + + Always fight on bonus stage 2 + DDA7-AF04 + DDA7-A4A4 + + + High throw and grab damage + 3CA4-DD67 + FEA4-DFD7 + + + Minimum throw and grab damage + 3CA4-DD67 + EEA4-DFD7 + + + Die after 2 hits - both players + 503E-04DF + + + Start with 3/4 health (1/4 damage) - both players + 60AC-AFD4 + + + Start with 1/2 health (1/2 damage) - both players + 96AC-AFD4 + + + Start with 1/4 health (3/4 damage) - both players + 4AAC-AFD4 + + + Round number does not advance (can't fight to a draw) + C2CC-A7DF + + + 1 draw ends fight in VS. battle + DF81-A704 + + + Most punches and kicks do no damage + 893E-04DF + + + Start with no health - both players + DDAC-AFD4 + + + Start with no health - P1 + DDAC-AF64 + + + Players move faster + 1C65-DF00 + + + Some special moves are faster + D965-DF00 + + + Can do special moves in the air - both players + DD61-6DA9 + + + Dragon punch does not go as high + 73A5-DF60 + + + Dragon punch goes higher + 2AA5-DF60 + + + Some special moves are easier to perform + DD84-DD01 + + + No pause after throwing a Fireball + DFA0-DDA0 + ADA0-DFD0 + + + Players can hit each other no matter where they are + 6D25-A467 + 6F25-A4A7 + + + Do special moves by just pressing buttons (may make Fireballs lower) + DAB8-A761 + + + Fireballs are lower to the ground + DDB8-ADF3 + + + Fireballs are higher off the ground + 1DB8-ADF3 + + + Light Sumo Head Butts and Rolling Attacks are slower + DDB1-D4F3 + EEB1-D7B3 + + + Light Sumo Head Butts and Rolling Attacks are faster + DBB1-D4F3 + EBB1-D7B3 + + + Light Sumo Head Butts and Rolling Attacks are super fast + F9B1-D4F3 + EDB1-D7B3 + + + Medium Sumo Head Butts and Rolling Attacks are slower + DDB1-D4B3 + EEB5-DDF3 + + + Medium Sumo Head Butts and Rolling Attacks are faster + DCB1-D4B3 + E5B5-DDF3 + + + Medium Sumo Head Butts and Rolling Attacks are super fast + F1B1-D4B3 + 33B5-DDF3 + + + Hard Sumo Head Butts and Rolling Attacks are slower + DDB1-D7F3 + EEB5-DDB3 + + + Hard Sumo Head Butts and Rolling Attacks are faster + D8B1-D7F3 + E9B5-DDB3 + + + Hard Sumo Head Butts and Rolling Attacks are super fast + F5B1-D7F3 + 32B5-DDB3 + + + + Strike Gunner S.T.G (USA) + + Infinite lives - P1 + C2B4-076F + + + Infinite lives - P2 + C2B8-046F + + + Infinite continues + C262-D9E6 + + + Infinite special weapon energy - P1 + C2EA-D46D + + + Infinite special weapon energy - P2 + C2E4-0DAD + + + Start on stage 2 + CB69-D40D + DF69-D46D + 3C69-D4AD + + + Start on stage 3 + CB69-D40D + D469-D46D + 3C69-D4AD + + + Start on stage 4 + CB69-D40D + D769-D46D + 3C69-D4AD + + + Start on stage 5 + CB69-D40D + D069-D46D + 3C69-D4AD + + + Start on stage 6 + CB69-D40D + D969-D46D + 3C69-D4AD + + + P1's shot power goes to max on pick-up of 1 shot-power unit + CBAA-640A + DBAA-64AA + + + P2's shot power goes to max on pick-up of 1 shot-power unit + CBAA-640A + DBA2-64AA + + + + Stunt Race FX (USA) (Rev 1) + + Infinite lives + 7E0DF809 + + + Stop lap time minutes + 7E0E6600 + + + Stop lap time seconds + 7E0E6400 + + + Always first + 182E-07FE + + + Choose any car + 2DAE-AD42 + + + Infinite boost - P1 + 7E0E0548 + 7E0E0648 + + + Infinite time extended + 7E19EE99 + + + Have all stars collected + 7E19EC64 + + + Remove car body + 7E20055C + + + + Sunset Riders (USA) + + Invincibility + 3366-CD69 + + + Infinite lives + 8232-3D0F + + + + Super Adventure Island II (USA) + + Infinite health + C29B-EF0F + + + Almost invincible after one hit + C2D6-8FAB + + + Stacks of cash + CB45-ED6D + + + Small potions don't restore health + C2B4-7D8E + + + Fall slowly + DFF1-770B + + + Dont fall at all (disable to touch the ground again) + DDF1-770B + + + Have no Weapon + 7E044D01 + + + Have Silver Sword + 7E044E01 + + + Have Fire Sword + 7E044F01 + + + Have Ice Sword + 7E045001 + + + Have Thunder Sword + 7E045101 + + + Have Crystal Sword + 7E045201 + + + Have Power Sword + 7E045301 + + + Have Light Sword + 7E045401 + + + Have Dagger + 7E045501 + + + Have Fireballs + 7E045601 + + + Have Boomerang + 7E045701 + + + Have Ax + 7E045801 + + + Have Shovel + 7E045901 + + + Have no Armor + 7E045A01 + + + Have Fire Armor + 7E045B01 + + + Have Ice Armor + 7E045C01 + + + Have Aqua Armor + 7E045D01 + + + Have Light Armor + 7E045E01 + + + Have no Shield + 7E045F01 + + + Have Fire Shield + 7E046001 + + + Have Ice Shield + 7E046101 + + + Have Aqua Shield + 7E046201 + + + Have Light Shield + 7E046301 + + + Have no Equipment + 7E046501 + + + Have Magic Wand + 7E046401 + + + Have Ice Bell + 7E046601 + + + Have Sun Ring + 7E046701 + + + Have Power Fan + 7E046801 + + + Have Elven Flute + 7E046901 + + + Have Sky Bell + 7E046A01 + + + Have Light Stone + 7E046B01 + + + Have Sun Stone + 7E046C01 + + + Have Star Stone + 7E046D01 + + + Have Aqua Stone + 7E046E01 + + + Have Moon Stone + 7E046F01 + + + Have Thunder Spell + 7E047001 + + + Have Star Spell + 7E047101 + + + Have Sun Spell + 7E047201 + + + Have Aqua Spell + 7E047301 + + + Have Moon Spell + 7E047401 + + + Have Shove + 7E047D01 + + + Have Up Jab + 7E047E01 + + + Have Down Jab + 7E047F01 + + + Light Gate down + 7E013101 + + + Sun Gate down + 7E013201 + + + Star Gate down + 7E013301 + + + Aqua Gate down + 7E013401 + + + Moon Gate down + 7E013501 + + + + Super Adventure Island (USA) + + Invincibility and Infinite time + 7E0D6BFF + + + Invincibility and always have Skateboard (disable at end of level) + 7E0D6F01 + + + Infinite time (disable at end of level) + 7E0D6C11 + + + Infinite lives + C2B3-D46D + + + Infinite lives (alt) + 7E030D03 + + + Infinite credits + C2CD-0F0D + + + Start with 1 life instead of 3 + DD6A-646F + + + Start with 5 lives + D06A-646F + + + Start with 10 lives + DB6A-646F + + + Start with 15 lives + D36A-646F + + + Start with 25 lives + F66A-646F + + + Start with 50 lives + 7F6A-646F + + + Start with 99 lives + 146A-646F + + + Start with 1 credit + DD6A-67AF + + + Start with 6 credits + D96A-67AF + + + Fruit restores full time + CBBE-DF94 + FDBE-DFB4 + + + Super-jump (don't use the game's super-jump feature) + 798C-DF0D + + + Mega-jump (don't use the game's super-jump feature) + 408C-DF0D + + + Don't lose all weapon power when you die (may give you unusual weapons) + 79C0-A7DD + 79C6-A4DD + + + Have Boomerang after obtaining any weapon icon + 7E0D7501 + + + Have Fireball after obtaining any weapon icon + 7E0D7502 + + + Have Boomerang Fireball after obtaining any weapon icon + 7E0D7503 + + + Have Hammer after obtaining any weapon icon + 7E0D7504 + + + Start in area 1, stage 2 + D766-0FD7 + + + Start in area 1 bonus round + D966-0FD7 + + + Start in area 1, stage 3 + D566-0FD7 + + + Start in area 2, stage 1 + DC66-0FD7 + + + Start in area 2, stage 2 + DA66-0FD7 + + + Start in area 2 bonus round + D366-0FD7 + + + Start in area 2, stage 3 + FF66-0FD7 + + + Start in area 3, stage 1 + F066-0FD7 + + + Start in area 3, stage 2 + F666-0FD7 + + + Start in area 3, stage 3 + FC66-0FD7 + + + Start in area 4, stage 1 + F266-0FD7 + + + Start in area 4, stage 2 + FE66-0FD7 + + + Start in area 4 bonus round + 4D66-0FD7 + + + Start in area 4, stage 3 + 4066-0FD7 + + + Start in area 5, stage 1 + 4566-0FD7 + + + Start in area 5, stage 2 + 4B66-0FD7 + + + Start in area 5, stage 3 + 4866-0FD7 + + + Start in area 5, bonus round + 4266-0FD7 + + + Start on last boss + 008D8430 + + + + Super Back to the Future Part II (Japan) + + Invincibility + 7E1401FF + + + Infinite health + 7E009A03 + + + + Super Baseball Simulator 1.000 (USA) + + Infinite added points + DDCD-646C + + + Fewer HR points to distribute - standard game + 783E-DF6C + + + Fewer R points to distribute - standard game + 9D3E-D4DC + + + Fewer F points to distribute - standard game + F03E-D46C + + + More AV points to distribute - moderate game + DB3F-070C + + + More HR points to distribute - moderate game + DF3F-07AC + BD3F-076C + + + More R points to distribute - moderate game + 1634-0DDC + DF34-0D0C + + + + Super Bases Loaded 3 - License to Steal (USA) + + No strikes + C26E-4D01 + + + One strike to strike out + DF6E-44D1 + + + Ten strikes to strike out + DC6E-44D1 + + + Infinite strikes gives P1 a homerun + 556E-4D61 + + + Infinite strikes gives opponent a homerun + 566E-4D61 + + + Walk on one ball + DF6F-C461 + + + Walk on ten balls + DC6F-C461 + + + Infinite balls gives P1 a homerun + 556F-CFD1 + + + Infinite balls gives opponent a homerun + 566F-CFD1 + + + + Super Bases Loaded (USA) + + Game lasts 1 inning + DDA1-A46D + DFA0-A76D + DFE0-6F6D + + + Game lasts 2 innings + D4A1-A46D + D7A0-A76D + D7E0-6F6D + + + Game lasts 3 innings + D0A1-A46D + D9A0-A76D + D9E0-6F6D + + + Game lasts 5 innings + D6A1-A46D + DBA0-A76D + DBE0-6F6D + + + Game lasts 7 innings + DAA1-A46D + D2A0-A76D + D2E0-6F6D + + + 1 strike and batter is out + DFAF-6F67 + DDA2-07D7 + + + 2 strikes and batter is out + D4AF-6F67 + DFA2-07D7 + + + 4 strikes and batter is out + D0AF-6F67 + D7A2-07D7 + + + 5 strikes and batter is out + D9AF-6F67 + D0A2-07D7 + + + 7 strikes and batter is out + D5AF-6F67 + D1A2-07D7 + + + 9 strikes and batter is out + DBAF-6F67 + D6A2-07D7 + + + Batter never strikes out + C2E8-DF0D + + + Batter walks on 1 ball + DFA5-6F07 + DDA7-6767 + + + Batter walks on 2 balls + D4A5-6F07 + DFA7-6767 + + + Batter walks on 3 balls + D7A5-6F07 + D4A7-6767 + + + Batter walks on 5 balls + D9A5-6F07 + D0A7-6767 + + + Batter walks on 6 balls + D1A5-6F07 + D9A7-6767 + + + Batter walks on 9 balls + DBA5-6F07 + D6A7-6767 + + + Batter never walks + C2EA-D40D + + + 1 out per inning + DDE7-07AD + + + 2 outs per inning + DFE7-07AD + + + 4 outs per inning + D7E7-07AD + + + 5 outs per inning + D0E7-07AD + + + 7 outs per inning + D1E7-07AD + + + 9 outs per inning + D6E7-07AD + + + + Super Batter Up (USA) + + Batter never walks + C2B2-0D6A + + + 1 ball per walk + DFB2-040A + + + 2 balls per walk + D4B2-040A + + + 3 balls per walk + D7B2-040A + + + 5 balls per walk + D9B2-040A + + + 6 balls per walk + D1B2-040A + + + 7 balls per walk + D5B2-040A + + + Batter never strikes out + C2BD-64DA + + + 1 strike per out + DFBD-67AA + + + 2 strikes per out + D4BD-67AA + + + 4 strikes per out + D0BD-67AA + + + 5 strikes per out + D9BD-67AA + + + + Super Battletank 2 (USA) + + Infinite hits + 7E00AD00 + + + Infinite health in 3rd person mode + 7E0A2A00 + + + Infinite 120mm bullets + 7E10E309 + + + Infinite 120mm bullets in 3rd person mmode + 7E0A1009 + + + Infinite 7.62mm bullets + 7E10E709 + + + Infinite 7.62mm bullets in 3rd person mode + 7E0A0E09 + + + Infinite Phalanx + 7E10E809 + + + Infinite Scope + 7E10E909 + + + Infinite Smoke + 7E10E609 + + + Infinite LGM + 7E10E509 + + + Infinite Patriot + 7E10E409 + + + + Super Battletank - War in the Gulf (USA) + + Infinite health against most enemies and mines + C9AC-0D67 + + + Infinite health against most enemies and mines (alt) + 00CDA2A5 + + + Infinite weapon ammo (except Smoke Screens and Machine Gun) + 4ABD-DDA4 + + + More Machine Gun ammo on stages 1-4 + EE2E-D4D4 + + + Less Machine Gun ammo on stages 1-4 + 482E-D4D4 + + + More Cannon ammo on each mission + 1022-D7D4 + + + Less Cannon ammo on each mission + FB22-D7D4 + + + More Laser Shells on each mission + D923-DF04 + + + No Laser Shells on each mission + DD23-DF04 + + + More Smoke Screens on each mission + D923-D7A4 + + + No Smoke Screens on each mission + DD23-D7A4 + + + Infinite Fuel + 7E05C4FF + + + Infinite 120mm Cannon + 7E049E42 + + + Infinite Laser Missiles + 7E04A001 + + + Infinite Smoke Screens + 7E04A101 + + + Infinite 7.62mm Machine Gun + 7E04A296 + + + + Super Battletank - War in the Gulf (USA) (Rev 1) + + Infinite health against most enemies and mines + C9AC-0D67 + + + Infinite health against most enemies and mines (alt) + 00CDA2A5 + + + Infinite weapon ammo (except Smoke Screens or Machine Gun) + 4ABD-DDA4 + + + More Machine Gun ammo on stages 1-4 + EE2E-D4D4 + + + Less Machine Gun ammo on stages 1-4 + 482E-D4D4 + + + More Cannon ammo on each mission + 1022-D7D4 + + + Less Cannon ammo on each mission + FB22-D7D4 + + + More Laser Shells on each mission + D923-DF04 + + + No Laser Shells on each mission + DD23-DF04 + + + More Smoke Screens on each mission + D923-D7A4 + + + No Smoke Screens on each mission + DD23-D7A4 + + + Infinite Fuel + 7E05C4FF + + + Infinite 120mm Cannon + 7E049E42 + + + Infinite Laser Missiles + 7E04A001 + + + Infinite Smoke Screens + 7E04A101 + + + Infinite 7.62mm Machine Gun + 7E04A296 + + + + Super Bomberman 2 (USA) + + Invincibility - P1 + 7E80EF01 + + + Invincibility - P2 + 7E81EF01 + + + Invincibility - P3 + 7E82EF01 + + + Invincibility - P4 + 7E83EF01 + + + Infinite time + 7E5E123B + + + Infinite lives + 7E1C6C09 + + + Move fast + 7E80F002 + + + Move faster + 7E80F003 + + + Move fastest + 7E80F004 + + + Max bomb power - P1 + 7E80F209 + + + Max bomb power - P2 + 7E81F209 + + + Max bomb power - P3 + 7E82F209 + + + Max bomb power - P4 + 7E83F209 + + + Max bomb quantity - P1 + 7E80F109 + + + Max bomb quantity - P2 + 7E81F109 + + + Max bomb quantity - P3 + 7E82F109 + + + Max bomb quantity - P4 + 7E83F109 + + + Max speed - P1 + 7E80F006 + + + Max speed - P2 + 7E81F006 + + + Max speed - P3 + 7E82F006 + + + Max speed - P4 + 7E83F006 + + + Have Detonator - P1 + 7E80F301 + + + Have Detonator - P2 + 7E81F301 + + + Have Detonator - P3 + 7E82F301 + + + Have Detonator - P4 + 7E83F301 + + + Have Power Bombs - P1 + 7E80F302 + + + Have Power Bombs - P2 + 7E81F302 + + + Have Power Bombs - P3 + 7E82F302 + + + Have Power Bombs - P4 + 7E83F302 + + + Have Super Bombs - P1 + 7E80F304 + + + Have Super Bombs - P2 + 7E81F304 + + + Have Super Bombs - P3 + 7E82F304 + + + Have Super Bombs - P4 + 7E83F304 + + + Have Gel Bombs - P1 + 7E80F308 + + + Have Gel Bombs - P2 + 7E81F308 + + + Have Gel Bombs - P3 + 7E82F308 + + + Have Gel Bombs - P4 + 7E83F308 + + + Have Punch Glove - P1 + 7E80FE01 + + + Have Punch Glove - P2 + 7E81FE01 + + + Have Punch Glove - P3 + 7E82FE01 + + + Have Punch Glove - P4 + 7E83FE01 + + + Have Kick Bomb - P1 + 7E80FF01 + + + Have Kick Bomb - P2 + 7E81FF01 + + + Have Kick Bomb - P3 + 7E82FF01 + + + Have Kick Bomb - P4 + 7E83FF01 + + + Have Bomb Walk - P1 + 7E80FA01 + + + Have Bomb Walk - P2 + 7E81FA01 + + + Have Bomb Walk - P3 + 7E82FA01 + + + Have Bomb Walk - P4 + 7E83FA01 + + + Have Brick Walk - P1 + 7E80FB01 + + + Have Brick Walk - P2 + 7E81FB01 + + + Have Brick Walk - P3 + 7E82FB01 + + + Have Brick Walk - P4 + 7E83FB01 + + + Have Poison Status - P1 + 7E80F501 + + + Have Poison Status - P2 + 7E81F501 + + + Have Poison Status - P3 + 7E82F501 + + + Have Poison Status - P4 + 7E83F501 + + + Have 4,000,000 points - P1 + 7E5DEFA7 + + + Have 9,000,000 points - P2 + 7E0D9B09 + + + Jump ability in battle-mode - all players + 7E1C0002 + EFFF0432 + + + + Super Bomberman (USA) + + Invincibility (normal game) + 89FC-77FF + + + Infinite lives (normal game) + 89FE-57B4 + + + Invincibility - P1 + 7E0D7980 + + + Invincibility - P2 + 7E0DB980 + + + Invincibility - P3 + 7E0DF980 + + + Invincibility - P4 + 7E0E3980 + + + Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P1 + 7E0D79E3 + + + Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P2 + 7E0DB9E3 + + + Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P3 + 7E0DF9E3 + + + Invincibility, Kick Bomb, Punch Glove, Bomb Walk, Brick Walk - P4 + 7E0E39E3 + + + Infinite time + 7E0D3BFF + + + Infinite lives - P1 + 7E0D7D09 + + + Infinite lives - P2 + 7E0DBD09 + + + Max bomb power - P1 + 7E0D7109 + + + Max bomb power - P2 + 7E0DB109 + + + Max bomb power - P3 + 7E0DF109 + + + Max bomb power - P4 + 7E0E3109 + + + Max bomb quantity - P1 + 7E0D7009 + + + Max bomb quantity - P2 + 7E0DB009 + + + Max bomb quantity - P3 + 7E0DF009 + + + Max bomb quantity - P4 + 7E0E3009 + + + Max speed - P1 + 7E0D7209 + + + Max speed - P2 + 7E0DB209 + + + Max speed - P3 + 7E0DF209 + + + Max speed - P4 + 7E0E3209 + + + Have Detonator - P1 + 7E0D7309 + + + Have Detonator - P2 + 7E0DB309 + + + Have Detonator - P3 + 7E0DF309 + + + Have Detonator - P4 + 7E0E3309 + + + Have red bombs - P1 + 7E0D7809 + + + Have red bombs - P2 + 7E0DB809 + + + Have red bombs - P3 + 7E0DF809 + + + Have red bombs - P4 + 7E0E3809 + + + Have 9,000,000 points - P1 + 7E0D5B09 + + + Have 9,000,000 points - P2 + 7E0D9B09 + + + + Super Bonk (USA) + + Infinite max life + 7E101C1E + + + Max life + 7E101D1E + + + Always have 99 lives + 7E101E63 + + + Always have 99 Smileys + 7E102263 + + + Press up to fly on any level + CB31-4F08 + 3C31-4FA8 + + + + Super Bowling (USA) + + No spin on ball + 4ACA-0464 + + + Faster spin meter + D1C5-DDAD + + + Slower spin meter + D4C5-DDAD + + + Really slow spin meter + DFC5-DDAD + + + Faster power meter + D1C5-D4DD + + + Slower power meter + D4C5-D4DD + + + Really slow power meter + DFC5-D4DD + + + + Super Buster Bros. (USA) (Rev 1) + + Invincibility + 7E010005 + + + Infinite time + 7E01869A + 7E018709 + + + Shield always on + 7E013402 + + + Normal shot + 7E013100 + + + Double shot + 7E013102 + + + Grappling shot + 7E013104 + + + Gun shot + 7E013106 + + + Start with 2 lives + DF61-0DDA + + + Start with 3 lives + D461-0DDA + + + Start with 5 lives + D061-0DDA + + + Start with 6 lives + D961-0DDA + + + Start with 8 lives + D561-0DDA + + + Start with 10 lives + DB61-0DDA + + + Start with 1 life + DD61-0DDA + + + Infinite lives + DDB2-07A4 + + + Clock runs faster + FB83-0D64 + + + Clock runs slower + 1083-0D64 + + + Clock runs much slower + A683-0D64 + + + Clock is frozen (no time limit) + DD83-0704 + + + 1 credit + DD61-0D0A + + + 2 credits + DF61-0D0A + + + 3 credits + D461-0D0A + + + 4 credits + D761-0D0A + + + 6 credits + D961-0D0A + + + 8 credits + D561-0D0A + + + No credits + EE61-0D0A + + + Infinite credits + C9B9-6D04 + + + Extra credit after 2 food items instead of 10 + D42B-A7D0 + + + Extra credit after 4 food items + D02B-A7D0 + + + Extra credit after 6 food items + D12B-A7D0 + + + Extra credit after 8 food items + D62B-A7D0 + + + Food items never earn extra credit + 3C2B-A460 + + + Double harpoon pick-up gives you machine gun + D184-ADA8 + + + Retain weapon after dying or advancing thru stages + C96E-6FD6 + + + Panic mode has 2 levels instead of 99 + D780-DDD4 + D781-DF04 + + + Panic mode has 5 levels + D180-DDD4 + D181-DF04 + + + Panic mode has 10 levels + D880-DDD4 + D881-DF04 + + + Panic mode has 20 levels + F980-DDD4 + F981-DF04 + + + + Super Caesars Palace (USA) + + Infinite 999 gold chips + 7E188EE7 + 7E188F03 + + + Access all high roller areas + 7E0C300F + + + + Super Castlevania IV (USA) + + Invincibility + 608E-D7FB + C92C-6DD4 + + + Invincibility (blinking) + 7E00BC0A + + + Infinite health + 7E13F410 + + + Infinite hearts + 7E13F299 + + + Infinite time + 6D6D-DF06 + + + Infinite time (alt) + 7E13F099 + + + Fully powered whip with first power-up + DD24-AFD7 + + + No health lost when hit by some enemies + D22F-07D7 + + + Infinite lives - switch off effects to get a password + DD6C-DD66 + + + Start with 10 lives - first game only + FDB2-D4AF + + + Start with 1 life - first game only + DFB2-D4AF + + + Infinite shots for most weapons + A689-0FD7 + + + Start with and always keep Dagger + CBAA-6DAF + DFAA-6FDF + 69AA-6F6F + + + Start with and always keep Axe + CBAA-6DAF + D4AA-6FDF + 69AA-6F6F + + + Start with and always keep Holy Water + CBAA-6DAF + D7AA-6FDF + 69AA-6F6F + + + Start with and always keep Boomerang + CBAA-6DAF + D0AA-6FDF + 69AA-6F6F + + + Start with and always keep Stopwatch + CBAA-6DAF + D9AA-6FDF + 69AA-6F6F + + + Start with 99 hearts (1st life only) + BBB3-D40F + + + Start with 50 hearts (1st life only) + 9DB3-D40F + + + Increase heart capacity 2.5 times + EE2B-6DA7 + FC25-64D7 + EE26-6767 + + + Have maxed out hearts with each heart pick-up + DD2B-6D07 + + + Double Shot gives you a Triple Shot + EE2B-A767 + + + Slower timer + 5E6D-DDA6 + + + Faster timer + FE6D-DDA6 + + + Super-jump + FDC5-04D4 + + + Mega-jump + 4DC5-04D4 + + + Have best whip + 7E009202 + + + Have Dagger + 7E008E01 + + + Have Axe + 7E008E02 + + + Have Cross + 7E008E04 + + + Have Dagger + 7E008E01 + + + Have Holy Water + 7E008E03 + + + Have Stopwatch + 7E008E05 + + + Have Triple Shot + 7E009002 + + + + Super Chase H.Q. (USA) + + Infinite health + 7E127CFF + + + Infinite nitro + 7E126703 + + + Infinite time + 7E127B89 + + + + Super Double Dragon (USA) + + Invincibility + C267-0DD6 + + + Infinite health + 1D6F-0766 + + + Infinite lives + C286-6F05 + + + 1 extra credit - 2P game A + DF8C-070B + + + 9 lives - 1P game + DB86-070B + + + 6 lives - 1P game + D186-070B + + + 1 life - 1P game + DF86-070B + + + 9 lives - 2P game A + DB88-0D6B + + + 6 lives - 2P game A + D188-0D6B + + + 1 life - 2P game A + DF88-0D6B + + + Infinite lives - P1 + 4A86-6F05 + + + Dragon power increases faster + DDB3-A7F1 + + + Prolonged maximum dragon power + D7B2-A7B5 + + + + Super Ghouls'n Ghosts (USA) + + Invincibility (disable at end of first two stages of level 3, so you can trigger the hidden end of stage marker) + D4D5-B286 + + + Invincibility (alt) + DD21-0FD0 + + + Invincibility (alt 2) + 7E027602 + + + Never lose Armor + DFD0-F38B + DFF8-F38B + + + Never lose Armor (alt) + 7E044A01 + 7E14BA01 + + + Infinite lives + A2C1-AD01 + + + Infinite lives (alt) + 7E02A402 + + + Infinite time + A286-0F01 + + + Infinite time (alt) + 7E02A901 + + + Infinite double-jumps + C2A5-A4A5 + + + Infinite double-jumps (alt) + 7E14BC00 + + + Infinite shield hits + 6DE7-A468 + + + Infinite continues + DDB6-67FF + + + Start with 1 continue + DFC0-A401 + + + Start with 9 continues + DBC0-A401 + + + Slower timer + 9386-0D01 + + + Faster timer + FE86-0D01 + + + Start with 9 minutes + DBC3-0465 + + + Very few Zombies appear + C9BB-A460 + + + Most Zombies carry a basket + DF65-DFA8 + CBBD-AF98 + + + Super-jump + 7E04580F + + + Run faster + 7E045302 + + + 900,000 points + 7E029509 + + + Have no Armor + 7E14BA00 + + + Have regular Armor + 7E14BA01 + + + Have Green Armor + 7E14BA02 + + + Have Gold Armor + 7E14BA04 + + + Have Javelin + 7E14D300 + + + Have Blue Fire Javelin + 7E14D301 + + + Have Quick Dagger + 7E14D302 + + + Have Laser Dagger + 7E14D303 + + + Have Crossbow + 7E14D304 + + + Have Crossbow with Homing Arrows + 7E14D305 + + + Have Scythe + 7E14D306 + + + Have Scythe level 2 + 7E14D307 + + + Have Torch + 7E14D308 + + + Have Torch level 2 + 7E14D309 + + + Have Axe + 7E14D30A + + + Have Double Edge Axe + 7E14D30B + + + Have Dagger with L-shaped path + 7E14D30C + + + Have Shuriken with L-shaped path + 7E14D30D + + + Have Goddess Ring + 7E14D30E + + + + Super Mario All-Stars + Super Mario World (USA) + + (SMB) Invincibility + 292B-67DE + + + (SMB) Invincibility (alt) + 62E7-A7D2 + 2DE7-A7A2 + + + (SMB) Invincibility (Starman) + 7E07AF0F + + + (SMB) Infinite lives + 7E075A05 + + + (SMB) Play as Big Mario + 7E07AE05 + + + (SMB) Play as Big Mario (alt) + 23C2BB02 + + + (SMB) Play as Fire Mario + 23C2BB03 + + + (SMB) Multi-jump + 23C2BB02 + + + (SMB) Run without holding the dash button + DD8E-D702 + + + (LL) Infinite lives + C2B6-A455 + + + (LL) Multi-jump + DD86-6F80 + + + (SMB2) Invincibility + 7E00853B + + + (SMB2) Infinite lives + C26E-D5A6 + + + (SMB2) Never lose hearts + DD32-6966 + + + (SMB2) Always Big + 7E04C31F + + + (SMB2) Always Small + 7E04C30F + + + (SMB2) All characters have multi-jump + D966-6166 + + + (SMB2) All characters can float + 6267-A5A6 + + + (SMB2) All characters have infinite float time + 7E04CAFF + + + (SMB3) Enable debug mode (in game) + 7E016080 + + + (SMB3) Infinite lives + 20919ABD + + + (SMB3) Invincibility + 7E055280 + + + (SMB3) Invincibility (Starman) + 7E0553FF + + + (SMB3) Play as Small Mario + 7E00BB00 + + + (SMB3) Play as Big Mario + 7E00BB01 + + + (SMB3) Play as Fire Mario + 7E00BB02 + + + (SMB3) Play as Raccoon Mario + 7E00BB03 + + + (SMB3) Play as Frog Mario + 7E00BB04 + + + (SMB3) Play as Tanooki Mario + 7E00BB05 + + + (SMB3) Play as Hammer Bros Mario + 7E00BB06 + + + (SMB3) Have Magic Whistle + 7E1D800C + + + (SMB3) Raccoon and Tanooki have P-Wing + 7E056EFF + + + (SMB3) Fly at anytime (run meter always full) + 23CB1F00 + + + (SMB3) Fly for an unlimited amount of time + 23CB26FF + + + (SMW) Invincibility + 7E1497FF + + + (SMW) Invincible (Starman) + 7E1490FF + + + (SMW) Always Small Mario + 7E001900 + + + (SMW) Always Big Mario + 7E001901 + + + (SMW) Always Caped Mario + 7E001902 + + + (SMW) Always Fire Mario + 7E001903 + + + (SMW) Nintendo's debug + DDA6-DF07 + + + (SMW) Infinite time + C264-64D7 + + + (SMW) Infinite P-Balloon time + 7E1891FF + + + (SMW) Always have Yoshi + 7E0DC101 + + + (SMW) Yoshi is invincible + 89E4-AFD9 + 89C6-D4DB + + + (SMW) Infinite flying time for Yoshi + C2EC-0700 + + + (SMW) Collecting a Yoshi Coin gives you Yoshi's Wings + B9E5-A4AD + F8E5-A7DD + + + (SMW) Jump to automatically fly + 7E13E470 + + + + Super Mario All-Stars (USA) + + (SMB) Invincibility + 292B-67DE + + + (SMB) Invincibility (Starman) + 7E07AF0F + + + (SMB) Invincibility does not last as long + D62F-6DAE + + + (SMB) Invincibility lasts longer + 9D2F-6DAE + + + (SMB) Infinite lives (alt) + C2C1-D4AA + + + (SMB) Infinite lives + 7E075A05 + + + (SMB) Infinite time + 6D84-DF03 + + + (SMB) Play as Big Mario + 7E07AE05 + + + (SMB) Play as Fire Mario + 23C2BB03 + + + (SMB) Multi-jump + 23C2BB02 + + + (SMB) Run without holding the dash button + DD8E-D702 + + + (SMB) Start File A game with 2 lives + DFDF-FAAD + + + (SMB) Start File A game with 10 lives + DBDF-FAAD + + + (SMB) Start File A game with 50 lives + 7FDF-FAAD + + + (SMB) Start File A game with 100 lives + 17DF-FAAD + + + (SMB) 1-up worth nothing + C26B-0FBF + + + (SMB) Allows you to select any world for File A + D5DF-FADD + + + (SMB) Jump lower (switch off effects if you get stuck) + CB81-0D02 + E281-0D62 + 3C81-0DA2 + + + (SMB) Super-jump + CB81-0D02 + EC81-0D62 + 3C81-0DA2 + + + (SMB) Mega-jump + CB81-0D02 + E681-0D62 + 3C81-0DA2 + + + (LL) Start File A game with 2 lives + DFDF-FEDD + + + (LL) Start File A game with 10 lives + DBDF-FEDD + + + (LL) Start File A game with 50 lives + 7FDF-FEDD + + + (LL) Start File A game with 100 lives + 17DF-FEDD + + + (LL) Infinite lives + C2B6-A455 + + + (LL) Infinite time + 6D82-0F79 + + + (LL) Allows you to select any world or level for File A + DADF-F30D + D7DF-F36D + + + (LL) Infinite lives + C2B6-A455 + + + (LL) Multi-jump + DD86-6F80 + + + (SMB2) Invincibility + 7E00853B + + + (SMB2) Always big + 7E04C31F + + + (SMB2) Always small + 7E04C30F + + + (SMB2) All characters can multi-jump + D966-6166 + + + (SMB2) All characters can float + 6267-A5A6 + + + (SMB2) All characters have infinite float time + 7E04CAFF + + + (SMB2) 1 life after continue + DF61-05D0 + + + (SMB2) 9 lives after continue + DB61-05D0 + + + (SMB2) 25 lives after continue + FB61-05D0 + + + (SMB2) 50 lives after continue + 7461-05D0 + + + (SMB2) 99 lives after continue + 1761-05D0 + + + (SMB2) Infinite lives + C26E-D5A6 + + + (SMB2) Continue with 3 hearts instead of 2 + DF6B-A9A1 + + + (SMB2) Continue with 4 hearts + D46B-A9A1 + + + (SMB2) Never lose hearts + DD32-6966 + + + (SMB2) Jumping in place charges super jump + 7A60-A966 + + + (SMB2) Allows you to select any world for File A + D1D4-FA0D + + + (SMB3) Enable debug mode (in game) + 7E016080 + + + (SMB3) Invincibility + 7E055280 + + + (SMB3) Invincibility (Starman) + 7E0553FF + + + (SMB3) Infinite time + 6D3D-6619 + + + (SMB3) Play as Small Mario + 7E00BB00 + + + (SMB3) Play as Big Mario + 7E00BB01 + + + (SMB3) Play as Fire Mario + 7E00BB02 + + + (SMB3) Play as Raccoon Mario + 7E00BB03 + + + (SMB3) Play as Frog Mario + 7E00BB04 + + + (SMB3) Play as Tanooki Mario + 7E00BB05 + + + (SMB3) Play as Hammer Bros. Mario + 7E00BB06 + + + (SMB3) Have Magic Whistle + 7E1D800C + + + (SMB3) Raccoon and Tanooki have P-Wing + 7E056EFF + + + (SMB3) Multi-jump + 40AA-6803 + + + (SMB3) Fly at any time (run meter always full) + DDAF-A8A3 + + + (SMB3) Fly for an unlimited amount of time + EEA4-AB63 + + + (SMB3) Start and continue as Big Mario + E1A3-D60A + + + (SMB3) Change to Big Mario whenever you go to the map + CB69-AC07 + DF69-AC67 + + + (SMB3) Change to Fire Mario whenever you go to the map + CB69-AC07 + D469-AC67 + + + (SMB3) Change to Raccoon Mario whenever you go to the map + CB69-AC07 + D769-AC67 + + + (SMB3) Change to Frog Mario whenever you go to the map + CB69-AC07 + D069-AC67 + + + (SMB3) Change to Tanooki Mario whenever you go to the map + CB69-AC07 + D969-AC67 + + + (SMB3) Change to Sledgehammer Mario when you go to the map + CB69-AC07 + D169-AC67 + + + (SMB3) All power-ups turn you into Shoe Mario + D0A1-6C0A + E1A3-D60A + + + (SMB3) Collisions turn you into Big Mario + D4A8-6CAA + + + (SMB3) Collisions turn you into Fire Mario + D7A8-6CAA + + + (SMB3) Collisions turn you into Raccoon Mario + D0A8-6CAA + + + (SMB3) Collisions turn you into Frog Mario + D9A8-6CAA + + + (SMB3) Collisions turn you into Tanooki Mario + D1A8-6CAA + + + (SMB3) Collisions turn you into Sledgehammer Mario + D5A8-6CAA + + + (SMB3) After getting star, invincible until end of level (may have to disable to jump up) + C23B-680D + + + (SMB3) 1 life after continue + DFBB-DBAF + + + (SMB3) 10 lives after continue + DBBB-DBAF + + + (SMB3) 26 lives after continue + FBBB-DBAF + + + (SMB3) 51 lives after continue + 74BB-DBAF + + + (SMB3) 100 lives after continue + 17BB-DBAF + + + (SMB3) Infinite lives + 82BB-0C6D + + + (SMB3) Gain lots of lives with each 5 coins + D93E-6C49 + + + (SMB3) 5 coins needed for an extra life + D93E-6819 + + + (SMB3) 10 coins needed for an extra life + DC3E-6819 + + + (SMB3) 25 coins needed for an extra life + FB3E-6819 + + + (SMB3) 50 coins needed for an extra life + 743E-6819 + + + (SMB3) Power-jump + AD3E-6801 + + + (SMB3) Super-jump + 863E-6801 + + + (SMB3) Mega-jump + 8D3E-6801 + + + (SMB3) Ultra power-jump + C63E-6801 + + + (SMB3) Mega power-jump + DDA9-A603 + + + (SMB3) Select any world for File A game + D5D4-F36D + + + + Super Mario Kart (USA) + + Invincibility + 1A3E-CDA4 + + + Invincibility and have a Red Shell + 7E0D7028 + + + Always have Red Shell + 7E0D7005 + + + Always have item + 7E0D71C0 + + + All karts except yours do not move + 9980-44DD + + + Allows you to drive anywhere + 80FA9320 + + + Drive through walls + 4FEB-CDA4 + + + Mud and other land doesn't effect driving + 759DC8B4 + + + Special Cup enabled (1P time trial and 2P match race) + 7E1D2903 + + + + Super Mario RPG - Legend of the Seven Stars (USA) + + Infinite HP - Character 1 + 7EFA91FF + + + Infinite HP - Character 2 + 7EFB11FF + + + Infinite HP - Character 3 + 7EFB91FF + + + Max HP - Character 1 + 7EFA93FF + + + Max HP - Character 2 + 7EFB13FF + + + Max HP - Character 3 + 7EFB93FF + + + Max Flower Points + 7EFA0D63 + + + Infinite Flower Points (In Battle) + 7EFA0D63 + 7EFA0C63 + + + Infinite tries in action sequences + A98E-7707 + + + Mario consecutive super jumps modifier + 7FF8C064 + + + Mario - Level 30 + 7FF8001E + + + Mario - 999 HP + 7FF801E7 + 7FF80203 + + + Mario - 999 Max HP + 7FF803E7 + 7FF80403 + + + Mario - Max Speed + 7FF805FF + + + Mario - Max Attack + 7FF806FF + + + Mario - Max Defense + 7FF807FF + + + Mario - Max Magic Attack + 7FF808FF + + + Mario - Max Magic Defense + 7FF809FF + + + Mario - Max Experience + 7FF80A0F + 7FF80B27 + + + Mario - Equipped Weapon + 7FF80C1C + + + Mario - Equipped Armor + 7FF80D46 + + + Mario - Equipped Accessory + 7FF80E5E + + + Mario - Has all 'Correct' Spells + 7FF8103F + + + Mallow - Level 30 + 7FF8501E + + + Mallow - 999 HP + 7FF851E7 + 7FF85203 + + + Mallow - 999 Max HP + 7FF853E7 + 7FF85403 + + + Mallow - Max Speed + 7FF855FF + + + Mallow - Max Attack + 7FF856FF + + + Mallow - Max Defense + 7FF857FF + + + Mallow - Max Magic Attack + 7FF858FF + + + Mallow - Max Magic Defense + 7FF859FF + + + Mallow - Max Experience + 7FF85A0F + 7FF85B27 + + + Mallow - Equipped Weapon + 7FF85C20 + + + Mallow - Equipped Armor + 7FF85D46 + + + Mallow - Equipped Accessory + 7FF85E5E + + + Mallow - has all 'correct' spells + 7FF862E0 + 7FF86307 + + + Geno - Level 30 + 7FF83C1E + + + Geno - 999 HP + 7FF83DE7 + 7FF83E03 + + + Geno - 999 Max HP + 7FF83FE7 + 7FF84003 + + + Geno - Max Speed + 7FF841FF + + + Geno - Max Attack + 7FF842FF + + + Geno - Max Defense + 7FF843FF + + + Geno - Max Magic Attack + 7FF844FF + + + Geno - Max Magic Defense + 7FF845FF + + + Geno - Max Experience + 7FF8460F + 7FF84727 + + + Geno - Equipped Weapon + 7FF8481F + + + Geno - Equipped Armor + 7FF84946 + + + Geno - Equipped Accessory + 7FF84A5E + + + Geno - Has all 'correct' spells + 7FF84E1F + + + Bowser - Level 30 + 7FF8281E + + + Bowser - 999 HP + 7FF829E7 + 7FF82A03 + + + Bowser - 999 Max HP + 7FF82BE7 + 7FF82C03 + + + Bowser - Max Speed + 7FF82DFF + + + Bowser - Max Attack + 7FF82EFF + + + Bowser - Max Defense + 7FF82FFF + + + Bowser - Max Magic Attack + 7FF830FF + + + Bowser - Max Magic Defense + 7FF831FF + + + Bowser - Max Experience + 7FF8320F + 7FF83327 + + + Bowser - Equipped Weapon + 7FF8341E + + + Bowser - Equipped Armor + 7FF83546 + + + Bowser - Equipped Accessory + 7FF8365E + + + Bowser - Has all 'correct' spells + 7FF839F0 + + + Princess - Level 30 + 7FF8141E + + + Princess - 999 HP + 7FF815E7 + 7FF81603 + + + Princess - 999 Max HP + 7FF817E7 + 7FF81803 + + + Princess - Max Speed + 7FF819FF + + + Princess - Max Attack + 7FF81AFF + + + Princess - Max Defense + 7FF81BFF + + + Princess - Max Magic Attack + 7FF81CFF + + + Princess - Max Magic Defense + 7FF81DFF + + + Princess - Max Experience + 7FF81E0F + 7FF81F27 + + + Princess - Equipped Weapon + 7FF82022 + + + Princess - Equipped Armor + 7FF82146 + + + Princess - Equipped Accessory + 7FF8225E + + + Princess - Has all 'correct' spells + 7FF824C0 + 7FF8250F + + + + Super Mario World 2 - Yoshi's Island (USA) + + Infinite lives + C2EE-649F + + + Star timer doesn't decrease when hit + 7E039101 + 7E039200 + + + Start with 5 lives + D9B7-0023 + + + Start with 10 lives + DCB7-0023 + + + Start with 25 lives + FBB7-0023 + + + Start with 50 lives + 74B7-0023 + + + Start with 99 lives + 17B7-0023 + + + Continue with 5 lives + DC36-010D + + + Continue with 10 lives + FB36-010D + + + Continue with 25 lives + 7436-010D + + + Continue with 50 lives + 1736-010D + + + Continue with 99 lives + 1736-010D + + + All levels are completed with 100 points + CB69-006D + 3069-00AD + + + Always score 100 points + CB8A-64D5 + 108A-6405 + 3C8A-6465 + + + Power-ups don't get used up + 1D26-AFA1 + + + Have Stars +10 + 7E035701 + + + Have Stars +20 + 7E035802 + + + Have POW Block + 7E035903 + + + Have full Eggs + 7E035A04 + + + Have Magnifying Glass + 7E035B05 + + + Have Winged Cloud + 7E035C06 + + + Have Green Watermelon + 7E035D07 + + + Have Blue Watermelon + 7E035E08 + + + Have Red Watermelon + 7E035F09 + + + Hold B to float + 7E094500 + + + Unlock items in boss fights + 7E0B4800 + + + Mario's crying disabled + 44A0-672B + + + Horizontal one-way pinball doors open from both sides + 6DB6-6F55 + + + Infinite lives/Start at Middle Ring (when you die) + C2EE-64BF + + + After using the magnifying glass, red coins and hidden items are always revealed + C2C8-A465 + + + Infinite red switch time + 7E0CEC66 + + + Red switches stay on for over twice as long + D98A-AF7B + + + Red switches stay on for over four times as long + DB8A-AF7B + + + Star timer doesn't decrease when hit (alt) + 7E039101 + 7E039200 + + + Mario's crying disabled (alt) + 06C64F22 + + + Have Pink Yoshi + 7E038301 + + + Have Orange Yoshi + 7E038302 + + + Have Light Blue Yoshi + 7E038303 + + + Have Purple Yoshi + 7E038304 + + + Have Brown Yoshi + 7E038305 + + + Have Red Yoshi + 7E038306 + + + Have Dark Blue Yoshi + 7E038307 + + + Have Glow Red Yoshi + 7E038308 + + + Have Shadow Yoshi + 7E038309 + + + + Super Mario World 2 - Yoshi's Island (USA) (Rev 1) + + Infinite lives + C2EE-649F + + + Star timer doesn't decrease when hit + 7E039101 + 7E039200 + + + Hold B to float + 7E094500 + + + All levels are completed with 100 points + CB69-006D + 3069-00AD + + + Always score 100 points + CB8A-64D5 + 108A-6405 + 3C8A-6465 + + + Infinite power-up usage + 1D26-AFA1 + + + Unlock items in boss fights + 7E0B4800 + + + Mario's crying disabled + 44A0-672B + + + Mario's crying disabled (alt) + 06C64F22 + + + Horizontal one-way pinball doors open from both sides + 6DB6-6F55 + + + Infinite lives/Start at Middle Ring (when you die) + C2EE-64BF + + + After using the magnifying glass, red coins and hidden items are always revealed + C2C8-A465 + + + Infinite red switch time + 7E0CEC66 + + + Red switches stay on for over twice as long + D98A-AF7B + + + Red switches stay on for over four times as long + DB8A-AF7B + + + Have Stars +10 + 7E035701 + + + Have Stars +20 + 7E035802 + + + Have POW Block + 7E035903 + + + Have full Eggs + 7E035A04 + + + Have Magnifying Glass + 7E035B05 + + + Have Winged Cloud + 7E035C06 + + + Have Green Watermelon + 7E035D07 + + + Have Blue Watermelon + 7E035E08 + + + Have Red Watermelon + 7E035F09 + + + Have Pink Yoshi + 7E038301 + + + Have Orange Yoshi + 7E038302 + + + Have Light Blue Yoshi + 7E038303 + + + Have Purple Yoshi + 7E038304 + + + Have Brown Yoshi + 7E038305 + + + Have Red Yoshi + 7E038306 + + + Have Dark Blue Yoshi + 7E038307 + + + Have Glow Red Yoshi + 7E038308 + + + Have Shadow Yoshi + 7E038309 + + + + Super Mario World (USA) + + Invincibility + 7E1497FF + + + Invincibility (Starman) + 7E1490FF + + + Invincibility most of the time + DD32-6DAD + + + Invincibility - Yoshi + 89E4-AFD9 + 89C6-D4DB + + + Infinite flying time for Yoshi + C2EC-0700 + + + Infinite time (switch off for puzzles that use the timer) + C264-64D7 + + + Infinite P-Balloon time + 7E1891FF + + + Infinite lives + C222-D4DD + + + Start with 1 life instead of 5 + DDB4-6F07 + + + Start with 9 lives + D6B4-6F07 + + + Start with 15 lives + D3B4-6F07 + + + Start with 25 lives + F6B4-6F07 + + + Start with 50 lives + 7FB4-6F07 + + + Start with 99 lives + 14B4-6F07 + + + 1-up at 5 coins instead of 100 + D964-A7D7 + D967-AFA7 + + + 1-up at 10 coins + DC64-A7D7 + DC67-AFA7 + + + 1-up at 20 coins + F064-A7D7 + F067-AFA7 + + + 1-up at 50 coins + 7464-A7D7 + 7467-AFA7 + + + 1-up at 1 dragon coin instead of 5 + D2E5-A7AD + + + Low-jump + D02C-AF6F + + + Super-jump + D42C-AF6F + + + Mega-jump + DF2C-AF6F + + + Always Small Mario + 7E001900 + + + Always Big Mario + 7E001901 + + + Always Cape Mario + 7E001902 + + + Always Fire Mario + 7E001903 + + + Start as Super Mario + 31B7-6F07 + + + Start as Cape Mario + CBB7-6D67 + D4B7-6DA7 + 3CB7-6FD7 + 69B7-6F07 + + + Start as Fire Mario + CBB7-6D67 + D7B7-6DA7 + 3CB7-6FD7 + 69B7-6F07 + + + Always have Yoshi + 7E0DC101 + + + Little Yoshi grows after eating 1 enemy instead of 5 + DFCE-64A0 + + + Little Yoshi grows after eating 2 enemies + D4CE-64A0 + + + Little Yoshi grows after eating 3 enemies + D7CE-64A0 + + + Little Yoshi grows after eating 4 enemies + D0CE-64A0 + + + Nintendo's Debug + DDC1-64DD + DDC5-6DAD + + + Nintendo's Debug 2 + DDA6-DF07 + + + Power-up select + EDA5-0F6F + + + Shoot fireballs straight + DDEA-6F07 + DDB2-AFD8 + + + Activate green blocks (deactivate before entering the Green Switch Palace) + 7E1F2701 + + + Activate yellow blocks (deactivate before entering the Yellow Switch Palace) + 7E1F2801 + + + Activate red blocks (deactivate before entering the Red Switch Palace) + 7E1F2A01 + + + + Super Metroid (Japan, USA) (En,Ja) + + Skip intro and start on Planet Zebes on new game + DD38-C4A8 + + + Select area when loading saved game A (press right on map screen) + DDCF-4461 + 6DCC-47A1 + + + Switching areas fills the map + CE6B-1FAF + D76B-146F + + + Invincibility (except for acid and when bosses grab you) + 7E18A84C + + + Invincibility (except for acid and when bosses grab you) (alt) + DFFC-F37C + + + Infinite energy (can combine with invincibility code) + 7E09C263 + + + Infinite energy (except for acid) + C225-3005 + + + Super-jumps don't drain energy + C22A-456D + + + Kill most enemies on contact + 7E0A6E0F + + + Have all Guns except Charge Beam + 7E09A8FF + + + Have Charge Beam + 7E09A9FF + + + Have all suits and misc items (except Bombs) + 7E09A4FF + + + Have all boots and regular Bombs + 7E09A5FF + + + Have Missiles and Power Bombs (must obtain at least one Missile pack to finish game) + 7E09CE50 + + + Infinite Missiles + 7E09C6E7 + + + Almost infinite Super Missiles + C28A-C9D7 + + + Maximum 99 Super Missiles + 17DA-9E7C + + + Maximum 999 Missiles + 7E09C8E7 + 7E09C903 + + + Infinite 999 Missiles + 7E09C6E7 + 7E09C703 + + + Almost infinite Missiles + C288-C5A7 + + + Infinite Power Bombs + 7E09C703 + + + Almost infinite Power Bombs + 3CA4-450D + + + Maximum 99 Power Bombs + 17D2-9A7C + + + Infinite 99 Power Bombs + 17DA-9E8C + + + Maximum Missiles=10 + DCD7-F26D + + + Maximum Missiles=100 + 10D7-F26D + + + Maximum Missiles=125 + 52D7-F26D + + + Maximum Missiles=150 + B1D7-F26D + + + Maximum Missiles=175 + CED7-F26D + + + Maximum Missiles=200 + A6D7-F26D + + + Maximum Missiles=25 + FBD7-F26D + + + Maximum Missiles=50 + 74D7-F26D + + + Maximum Missiles=75 + 08D7-F26D + + + Maximum Power Bombs=10 + DCD7-FE6D + + + Maximum Power Bombs=25 + FBD7-FE6D + + + Maximum Power Bombs=5 + D9D7-FE6D + + + Maximum Power Bombs=50 + 74D7-FE6D + + + Maximum Super Missiles=10 + DCD7-F36D + + + Maximum Super Missiles=25 + FBD7-F36D + + + Maximum Super Missiles=5 + D9D7-F36D + + + Maximum Super Missiles=50 + 74D7-F36D + + + Start with about 500 Energy Tanks on saved game A + E7D7-FAAD + DFD7-FA6D + + + Start with about 700 Energy Tanks on saved game A + 88D7-FAAD + D4D7-FA6D + + + Start with about 1000 Energy Tanks on saved game A + 35D7-FAAD + D7D7-FA6D + + + Start with about 1200 Energy Tanks on saved game A + CED7-FAAD + D0D7-FA6D + + + Start with about 1500 Energy Tanks on saved game A + 28D7-FAAD + D9D7-FA6D + + + Brinstar mapped + EE2D-935C + + + Brinstar mapped (alt) + 7ED909FF + + + Crateria mapped + EE2D-937C + + + Crateria mapped (alt) + 7ED908FF + + + Maridia mapped + EE2D-9E7C + + + Maridia mapped (alt) + 7ED90CFF + + + Norfair mapped + EE2D-938C + + + Norfair mapped (alt) + EED9-936D + + + Tourain mapped + EE2D-9E5C + + + Tourian mapped (alt) + 7ED90DFF + + + Wrecked Ship mapped + EE2D-93EC + + + Wrecked Ship mapped (alt) + 7ED90BFF + + + Infinite time to escape ship + 7E094500 + 7E094600 + 7E094701 + + + Can access Tourain from sunken statues room + AF24-FA7C + FE24-FA5C + + + Moon-jump + 7E0B2D44 + 7E0B2E01 + + + 0 hours played + DDD0-FE6D + + + + Super Ninja Boy (USA) + + Protection from most hazards (makes some side-view enemies invincible) + 822E-07B0 + + + Start with 250 cash + EC81-AF69 + + + Start with 40,960 cash + 6981-A4D9 + + + Don't subtract money (must have enough to buy) + 1DAF-D4D6 + + + All stats are 20 (attack, defense, energy, max HP, max NP) + CB2F-A70C + 3C2F-A7AC + F02F-A76C + + + All stats for every level are 50 + CB2F-A70C + 3C2F-A7AC + 742F-A76C + + + All stats for every level are 100 + CB2F-A70C + 3C2F-A7AC + 102F-A76C + + + All stats for every level are 255 + CB2F-A70C + 3C2F-A7AC + EE2F-A76C + + + 1 experience point required for level 2 + DF24-A4AC + + + 1 experience point required for level 3 + DF24-A76C + + + 1 experience point required for level 4 + DF27-AD0C + + + 1 experience point required for level 5 + DF27-AFDC + + + Don't subtract M's for ninja cyclone attack + DD61-D725 + + + Don't subtract M's for mighty balls attack + DDA5-0421 + + + Skulls subtract 2 M's + D437-6420 + + + Skulls don't subtract an M + DD37-6420 + + + M power-ups worth nothing (handicap) + DD30-6720 + + + M power-ups worth 2 + D430-6720 + + + M power-ups worth 3 + D730-6720 + + + M power-ups worth 4 + D030-6720 + + + M power-ups worth 5 + D930-6720 + + + M power-ups set to 15 + F930-6720 + + + + Super Nova (USA) + + Invincibility + 0A84-C4A7 + 7984-C7D7 + 8384-C707 + + + Infinite lives + A268-4716 + + + + Super Off Road - The Baja (USA) + + Infinite nitros + 3CA0-CD6F + + + $9,000 for brakes + DBB6-1FDF + + + $2,000 for brakes + D4B6-1FDF + + + $9,000 for tires + DBB6-1F6F + + + $2,000 for tires + D4B6-1F6F + + + $2,000 for shocks + D4B6-14DF + + + $9,000 for shocks + DBB6-14DF + + + $2,000 for lights + D4B6-146F + + + $9,000 for lights + DBB6-146F + + + $2,000 for engine + D4B6-17DF + + + $4,000 for engine + D0B6-17DF + + + Indestructible engine + C283-34D7 + + + Indestructible shocks + C28A-3D67 + + + Indestructible tires + C28C-3DD7 + + + Vehicle can take only about 60% damage + 1D81-37D7 + + + Vehicle can take only about 35% damage + 7D81-37D7 + + + + Super Off Road (USA) + + Infinite nitros + D4B7-07AF + 22B0-0FDF + + + Infinite cash - P1 + 2BCA-6707 + + + Infinite cash - P2 + 2B84-DDDD + + + Start with $500,000 + D987-6D0F + + + Start with $900,000 + DB87-6D0F + + + + Super Play Action Football (USA) + + One timeout each team + DFB7-D4D7 + + + No timeouts - P1 + 10B7-D407 + + + No timeouts - P2 + 10B7-D4A7 + + + Infinite time to select play + 4067-6FDD + + + Less time to select play + F367-6D0D + + + + Super Punch-Out!! (USA) + + Infinite health against most punches + C2A4-DFD4 + + + Gain max health after connecting a hit - both players + D9AD-DDA4 + + + Infinite time + C9E3-64DD + + + Start on world circuit + DB8A-D4A1 + D48A-D7D1 + 3C8A-D701 + + + Most opponents stay down for the count + DFAB-AFDD + + + Some special attacks don't damage as much + C2AB-DFDF + + + Always have K.O. punch after first hit + CB34-AD07 + F834-AD67 + 3C34-ADA7 + + + Infinite rematches + C2B8-64A5 + + + No rematches + DDB7-0704 + + + Start with 5 rematches + D1B7-0704 + + + Start with 8 rematches + DBB7-0704 + + + Start with half health - both players + 49BC-6F6F + + + Start with very little health - both players + DFBC-6F6F + + + + Super R-Type (USA) + + Invincibility + 7E15BD00 + + + Start with 1 life instead of 3 + DF66-0F00 + CB66-0FD0 + DD66-0F60 + + + Start with 2 lives + D466-0F00 + CB66-0FD0 + DD66-0F60 + + + Start with 4 lives + D066-0F00 + CB66-0FD0 + DD66-0F60 + + + Start with 5 lives + D966-0F00 + CB66-0FD0 + DD66-0F60 + + + Start with 7 lives + D566-0F00 + CB66-0FD0 + DD66-0F60 + + + Start with 9 lives + DB66-0F00 + CB66-0FD0 + DD66-0F60 + + + Infinite lives + C2C7-6D0F + + + Continue with 1 life instead of 3 + DF6C-A709 + CB6C-A7D9 + DD6C-A769 + + + Continue with 2 lives + D46C-A709 + CB6C-A7D9 + DD6C-A769 + + + Continue with 4 lives + D06C-A709 + CB6C-A7D9 + DD6C-A769 + + + Continue with 5 lives + D96C-A709 + CB6C-A7D9 + DD6C-A769 + + + Continue with 7 lives + D56C-A709 + CB6C-A7D9 + DD6C-A769 + + + Continue with 9 lives + DB6C-A709 + CB6C-A7D9 + DD6C-A769 + + + Spiral motion gun takes less time to power up + 6D80-6DD1 + DD80-6D01 + + + Spiral motion gun takes much less time to power up + DD80-6DA1 + + + Spiral motion gun can't get over-charged + 6D84-6F01 + + + All FORCE satellites have 1 unit of power (but can't exceed 1 unit) + DD68-6DDB + CB6C-67AB + 7D68-6D6B + + + All FORCE satellites have 2 units of power (but can't exceed 2 units) + DF68-6DDB + CB6C-67AB + 7D68-6D6B + + + All FORCE satellites have 3 units of power + D468-6DDB + CB6C-67AB + 7D68-6D6B + + + Once FORCE has been obtained, keep it forever + C267-A4D9 + + + + Super Scope 6 (USA) + + Add 1 bullets at a time (Blastris A) + DFC6-05D4 + + + Add 3 bullets at a time (Blastris A) + D7C6-05D4 + + + Add 5 bullets at a time (Blastris A) + D9C6-05D4 + + + Add 7 bullets at a time (Blastris A) + D5C6-05D4 + + + Add 9 bullets at a time (Blastris A) + DBC6-05D4 + + + Infinite bullets (Blastris A) + C9C2-D16F + + + Clear 1 line instead of 5 to advance to next level (Blastris A) + DFC9-056F + + + Clear 2 lines to advance to next level (Blastris A) + D4C9-056F + + + Clear 3 lines to advance to next level (Blastris A) + D7C9-056F + + + Clear 4 lines to advance to next level (Blastris A) + D0C9-056F + + + Select low mode to start on level 5 (Blastris B, Type B) + D968-D100 + + + Select low mode to start on level 15 (Blastris B, Type B) + DE68-D100 + + + Select low mode to start on level 25 (Blastris B, Type B) + FB68-D100 + + + Select low mode to start on level 30 (Blastris B, Type B) + F368-D100 + + + Select low mode to start on level 35 (Blastris B, Type B) + 4768-D100 + + + Select low mode to start on level 40 (Blastris B, Type B) + 4668-D100 + + + Clear stage after 1 Molian is hit (Mole Patrol, Stage Mode) + BAA6-01DD + + + Take no damage (LazerBlazer, Type A) + 8262-64A1 + + + Take no damage (LazerBlazer Game, Type B) + 3CB0-670B + + + Take no damage (LazerBlazer Game, Type C) + C269-67DE + + + + Super Shadow of the Beast (USA) (Proto) + + Invincibility + C26F-0FA4 + 626E-DDA4 + 2D6D-0D64 + + + Infinite health + A964-0D04 + + + Infinite lives + C964-0D04 + + + Infinite credits + A965-046D + + + Moon-jump + C2B0-6D67 + C26B-6FA7 + + + + Super Smash T.V. (USA) + + Invincibility on mobile force field pick-up + 6D65-6403 + DF65-6463 + + + Weapons gauge doesn't lose power until you die (don't combine with don't lose weapon power code) + 8283-67D7 + + + Don't lose weapon power after death (don't combine with weapons gauge doesn't lose power code) + 6DB8-D404 + DFB8-D464 + + + Infinite continues (if continue timer runs out and player starts, a credit gets used) + C223-D78B + + + Infinite lives + 82BB-DD04 + + + Start with 3 lives + DD62-076D + + + Start with 4 lives + DF62-076D + + + Start with 5 lives + D462-076D + + + Start with 7 lives + D062-076D + + + Start with 8 lives + D962-076D + + + Start with 9 lives + D162-076D + + + Start with 10 lives + D562-076D + + + 2 lives after continue - P1 + EEB1-D7A4 + + + 3 lives after continue - P1 + DDB1-D7A4 + + + 4 lives after continue - P1 + DFB1-D7A4 + + + 5 lives after continue - P1 + D4B1-D7A4 + + + 7 lives after continue - P1 + D0B1-D7A4 + + + 8 lives after continue - P1 + D9B1-D7A4 + + + 9 lives after continue - P1 + D1B1-D7A4 + + + 10 lives after continue - P1 + D5B1-D7A4 + + + 2 lives after continue - P2 + EEB0-DDA4 + + + 3 lives after continue - P2 + DDB0-DDA4 + + + 4 lives after continue - P2 + DFB0-DDA4 + + + 5 lives after continue - P2 + D4B0-DDA4 + + + 7 lives after continue - P2 + D0B0-DDA4 + + + 8 lives after continue - P2 + D9B0-DDA4 + + + 9 lives after continue - P2 + D1B0-DDA4 + + + 10 lives after continue - P2 + D5B0-DDA4 + + + Bonus life worth nothing + 8284-AF03 + + + Start with 0 continues + DD62-0F0D + + + Start with 1 continue + DF62-0F0D + + + Start with 2 continues + D462-0F0D + + + Start with 3 continues + D762-0F0D + + + Start with 5 continues + D962-0F0D + + + Start with 6 continues + D162-0F0D + + + Start with 7 continues + D562-0F0D + + + Start with 8 continues + D662-0F0D + + + Start with 9 continues + DB62-0F0D + + + Join in with 2 lives - P1 + EEBF-D7A4 + + + Join in with 3 lives - P1 + DDBF-D7A4 + + + Join in with 4 lives - P1 + DFBF-D7A4 + + + Join in with 5 lives - P1 + D4BF-D7A4 + + + Join in with 7 lives - P1 + D0BF-D7A4 + + + Join in with 8 lives - P1 + D9BF-D7A4 + + + Join in with 9 lives - P1 + D1BF-D7A4 + + + + Super Soccer Champ (USA) + + Faster timer + F32B-D400 + + + Slower timer + 5D2B-D400 + + + Faster Brazil strikers + D4E7-6DEF + + + Faster USA strikers + D4E0-6DEF + + + Faster England strikers + D4ED-6DEF + + + Faster Germany strikers + D4E3-0DEF + + + Faster Italy strikers + D4EF-6DEF + + + Faster Holland strikers + D4E4-6DEF + + + Faster Argentina strikers + D4EE-0DEF + + + Faster France strikers + D4E9-6DEF + + + + Super Soccer (USA) + + Each goal worth 2 - P1 + FC2A-0F65 + 3C2A-0FA5 + + + Each goal worth 3 - P1 + FC2A-0F65 + FC2A-0FA5 + + + Each goal worth 4 - P1 + 1B2A-0F65 + D72A-0FA5 + + + Each goal worth 5 - P1 + 1B2A-0F65 + D02A-0FA5 + + + Each goal worth 6 - P1 + 1B2A-0F65 + D92A-0FA5 + + + Each goal worth 7 - P1 + 1B2A-0F65 + D12A-0FA5 + + + Each goal worth 8 - P1 + 1B2A-0F65 + D52A-0FA5 + + + Each goal worth 9 - P1 + 1B2A-0F65 + D62A-0FA5 + + + Each goal worth 2 - P2 + FC22-0465 + 3C22-04A5 + + + Each goal worth 3 - P2 + FC22-0465 + FC22-04A5 + + + Each goal worth 4 - P2 + 1B22-0465 + D722-04A5 + + + Each goal worth 5 - P2 + 1B22-0465 + D022-04A5 + + + Each goal worth 6 - P2 + 1B22-0465 + D922-04A5 + + + Each goal worth 7 - P2 + 1B22-0465 + D122-04A5 + + + Each goal worth 8 - P2 + 1B22-0465 + D522-04A5 + + + Each goal worth 9 - P2 + 1B22-0465 + D622-04A5 + + + Timer continues to count when it is normally stopped (pause can still stop time) + DDA6-0DD1 + + + + Super Star Wars - Return of the Jedi (USA) (Rev 1) + + Infinite lives + C230-CF0F + + + Infinite Force power when you use the Force Saber + C234-34AA + + + Always have shield + CB6E-4704 + + + Once you have thermal detonator you keep it (disable to use force power) + C222-3769 + + + Infinite Force power when you use the Freeze Force + C281-3DB9 + + + Finish the first level almost instantly + 1BBD-C703 + EEBD-C763 + EEBD-C7A3 + + + Start with 1 life + DD82-C7B1 + + + Start with 5 lives + D082-C7B1 + + + Start with 10 lives + DB82-C7B1 + + + Start with 25 lives + F682-C7B1 + + + Start with very little health + CB8E-3D21 + DF8E-3FF1 + DD8E-3F91 + + + Start with about 1/4 health + CB8E-3D21 + DE8E-3FF1 + DD8E-3F91 + + + Start with about 1/2 health + CB8E-3D21 + FD8E-3FF1 + DD8E-3F91 + + + Start with about 3/4 health + CB8E-3D21 + FE8E-3FF1 + DD8E-3F91 + + + + Super Star Wars - The Empire Strikes Back (USA) (Rev 1) + + Infinite thermal detonators + 6DE9-47AF + + + Start with all force abilities + 6D23-47F9 + + + Elevation and Freeze don't drain force bar + C229-14F9 + + + Saber control doesn't drain force bar + DDCC-1DDA + + + Mind control, Slow, Deflect and Invisible don't drain force bar + C22F-C7F9 + + + Infinite lives + C238-C70F + + + Continue with 2 lives on Easy + DF21-C465 + + + Continue with 6 lives on Easy + D921-C465 + + + Continue with 21 lives on Easy + F021-C465 + + + Continue with 51 lives on Easy + 7421-C465 + + + Start with 2 lives on Brave + DF21-C7D5 + + + Start with 6 lives on Brave + D921-C7D5 + + + Start with 21 lives on Brave + F021-C7D5 + + + Start with 100 lives on Brave + 1721-C7D5 + + + Continue with 2 lives on Jedi + DF21-C765 + + + Continue with 6 lives on Jedi + D921-C765 + + + Continue with 21 lives on Jedi + F021-C765 + + + Continue with 100 lives on Jedi + 1721-C765 + + + Start with 1/2 as much health on Easy + F425-CDD5 + + + Start with 3/4 as much health on Easy + F625-CDD5 + + + Start with more health on Easy + 4C25-CDD5 + + + Start with much more health on Easy + 7D25-CDD5 + + + Start with maximum health on Easy + 0025-CDD5 + + + Start with 1/2 as much health on Brave + FD25-CD65 + + + Start with 3/4 as much health on Brave + F625-CD65 + + + Start with more health on Brave + 4C25-CD65 + + + Start with much more health on Brave + 7D25-CD65 + + + Start with maximum health on Brave + 0025-CD65 + + + Start with half as much health on Jedi + D325-CFD5 + + + Start with 3/4 as much health on Jedi + F925-CFD5 + + + Almost invincible - except spikes (works for enemy too) + 483F-376F + + + Start with no continues + DD2C-CDA5 + + + Start with 1 continue + DF2C-CDA5 + + + Start with 5 continues + D92C-CDA5 + + + Start with 9 continues + DB2C-CDA5 + + + Infinite continues + C229-4DD1 + + + Tauntaun starts with 1/2 usual health + 4D20-CF2F + + + Tauntaun starts with 3/4 usual health + 7D20-CF2F + + + Tauntaun starts with a little more health than usual + 0020-CF2F + + + Start with Flame gun - 1st life only + 622C-47D0 + + + Keep gun power-ups after dying + C238-CD6F + + + Shield power-ups don't last as long + DD81-3DD4 + + + Shield power-ups last longer + D481-3DD4 + + + Shield power-ups last much longer + D781-3DD4 + + + Shield power-ups last a very long time + DE81-3DD4 + + + Health sword power-ups add 1/2 as much + D484-37A4 + + + Health sword power-ups add 2x as much + D684-37A4 + + + Health sword power-ups add 4x as much + FD84-37A4 + + + Force orbs add 1/2 as much + F68B-3764 + + + Force orbs add 2x as much + 1D8B-3764 + + + Force orbs fill force bar + EE8B-3764 + + + Small hearts heal less on Easy + DF2B-C465 + + + Small hearts heal 2x as much on Easy + D12B-C465 + + + Small hearts heal 4x as much on Easy + DA2B-C465 + + + Small hearts heal very much on Easy + 4D2B-C465 + + + Small hearts heal completely on Easy + 002B-C465 + + + Small hearts heal less on Brave level + DF2B-C7D5 + + + Small hearts heal 2x as much on Brave + D02B-C7D5 + + + Small hearts heal 4x as much on Brave + D62B-C7D5 + + + Small hearts heal very much on Brave + 4D2B-C7D5 + + + Small hearts heal completely on Brave + 002B-C7D5 + + + Small hearts heal less on Jedi level + DF2B-C765 + + + Small hearts heal 2x as much on Jedi + D02B-C765 + + + Small hearts heal 4x as much on Jedi + D62B-C765 + + + Small hearts heal very much on Jedi + 4D2B-C765 + + + Small hearts heal completely on Jedi + 002B-C765 + + + Big hearts heal 1/2 your health instead of 1/4 + 3C8D-3D04 + + + Big hearts heal completely + DC8D-3D04 + + + Start on level 1-2 + D469-1707 + + + Start on level 1-3 + D169-1707 + + + Start on level 1-4 + D769-1707 + + + Start on level 1-5 + D969-1707 + + + Start on level 1-6 + D069-1707 + + + Start on level 1-7 + DB69-1707 + + + Start on level 1-8 + F969-1707 + + + Start on level 1-10 + D569-1707 + + + Start on Hoth 3D level + D369-17D7 + DC69-1707 + + + Start on level 1-11 + D669-1707 + + + Start on Asteroids level + F469-17D7 + DD69-1707 + + + Start on level 3-1 + DA69-1707 + + + Start on level 3-2 + D269-1707 + + + Start on level 3-3 + D369-1707 + + + Start on Cloud City 3D level + D369-17D7 + FC69-1707 + + + Start on level 4-2 + DE69-1707 + + + Start on level 4-3 + F769-1707 + + + Start on level 4-4 + F469-1707 + + + Start on level 4-5 + FD69-1707 + + + Start on level 4-6 + F569-1707 + + + Start on level 4-7 + F669-1707 + + + Start on Darth Vader level + F169-1707 + + + + Super Star Wars (USA) (Rev 1) + + Protection against most damage + 1D34-C704 + + + Infinite lives + C232-14D4 + CB6C-3767 + + + Infinite continues + 4A21-14D5 + + + Start with 2 lives + DF35-CDA0 + + + Start with 6 lives + D935-CDA0 + + + Start with 8 lives + D535-CDA0 + + + Start with 11 lives + DC35-CDA0 + + + Start with 16 lives + DE35-CDA0 + + + Start with 26 lives + FB35-CDA0 + + + Start with 51 lives + 7435-CDA0 + + + Start with 100 lives + 1735-CDA0 + + + Start with no continues + DD3B-C760 + + + Start with 5 continues + D93B-C760 + + + Start with 7 continues + D53B-C760 + + + Start with 10 continues + DC3B-C760 + + + Start with 15 continues + DE3B-C760 + + + Start with 25 continues + FB3B-C760 + + + Start with 50 continues + 743B-C760 + + + Start with 99 continues + 173B-C760 + + + Start with 1/2 health (easy level) + F435-CFA0 + + + Start with 1/2 health (brave level) + FD35-C400 + + + Start with 1/2 health (Jedi level) + D335-C4A0 + + + Start with 2x health (easy level) + 0635-CFA0 + + + Start with 2x health (brave level) + 0D35-C400 + + + Start with 2x health (Jedi level) + 7635-C4A0 + + + Small hearts restore 1/2 health (easy level) + D43B-CF00 + + + Small hearts restore 1/2 health (brave level) + DF3B-CFA0 + + + Small hearts restore 1/2 health (Jedi level) + DF3B-C400 + + + Small hearts restore 2x health (easy level) + D13B-CF00 + + + Small hearts restore 2x health (brave level) + D03B-CFA0 + + + Small hearts restore 2x health (Jedi level) + D03B-C400 + + + Small hearts restore 4x health (easy level) + DA3B-CF00 + + + Small hearts restore 4x health (brave level) + D63B-CFA0 + + + Small hearts restore 4x health (Jedi level) + D63B-C400 + + + Begin the game with the lightsaber + DDB0-C767 + + + Han Solo and Chewbacca start with a blaster + DD88-37A5 + + + Han Solo and Chewbacca start with a seeker gun + D488-37A5 + + + Han Solo and Chewbacca start with a rapid ion gun + D788-37A5 + + + Han Solo and Chewbacca start with a plasma gun + D088-37A5 + + + Blaster power-ups remain after dying + 553A-1764 + + + All 3 characters selectable at the beginning of the game + DDB9-CF67 + + + Only 1 Jawa needed to pass landspeeder levels + DF67-4FAF + DF60-4D6F + + + Only 5 Jawas needed to pass landspeeder levels + D967-4FAF + D960-4D6F + + + Only 10 Jawas needed to pass landspeeder levels + DC67-4FAF + DC60-4D6F + + + 25 Jawas needed to pass landspeeder levels + FB67-4FAF + FB60-4D6F + + + 50 Jawas needed to pass landspeeder levels + 7467-4FAF + 7460-4D6F + + + Start with 1/2 fuel on landspeeder levels + F467-4D0F + + + Start with 2x fuel on landspeeder levels + 0667-4D0F + + + No fuel maximum for fuel power-ups + 6DA5-4D04 + + + Fuel power-ups completely refill the landspeeder + 40A1-47D4 + + + + Super Street Fighter II (USA) + + Infinite health - P1 + CB96-7DDD + 8D96-7D0D + 6296-7D6D + 7F96-7DAD + D996-7FDD + + + Infinite health - P1 (alt) + 7E0531B0 + + + Don't take damage except from throws or grabs - both players + 3C10-7467 + 3C10-74A7 + + + Infinite time + 7E192999 + + + Instant win - P1 + 7E0771FF + + + No charging required for some special moves + D002-EDD5 + + + Some special moves can be done in the air + DD47-8DD1 + + + 1st normal hit wins - except throws or grabs + DD10-7707 + + + Dizziness doesn't last + 1077-7F61 + + + Start with 1/4 health - both players + 4A9C-7FDF + + + Start with 1/2 health - both players + 969C-7FDF + + + Start with 3/4 health - both players + 609C-7FDF + + + Every hit sets opponent on fire + CB17-8FAD + 7D17-84DD + + + Every hit sets the opponent on fire and knocks him down + CB17-8FAD + F617-84DD + + + Every hit zaps the opponent and knocks him down + CB17-8FAD + FC17-84DD + + + Every hit knocks the opponent down + CB17-8FAD + FA17-84DD + + + Every hit is a hard hit - opponent almost never gets knocked down + CB17-8FAD + DC17-84DD + + + Players jump slower + CB79-EF61 + D579-EFA1 + + + Players jump faster + CB79-EF61 + D879-EFA1 + + + Each battle lasts only 1 round + DF81-E404 + + + Speed up timer + FE0C-7FDD + + + Slow down timer + 9C0C-7FDD + + + P2 starts right in front of P1 + F122-E760 + + + Balrog - Fierce charging punch, does heavy damage + 6E6A-EF90 + + + Balrog - Roundhouse charging uppercut, does heavy damage + 6E62-E790 + + + Balrog - Fierce shoulder butt, does heavy damage + 6E69-5799 + + + Balrog - Faster turn punch - roundhouse + D18C-74D5 + + + Balrog - Superfast turn punch - roundhouse + DB8C-74D5 + + + Blanka - Fierce forward ball, does heavy damage + 6E1C-E720 + + + Blanka - Beast leap, does heavy damage + 6E1B-7D29 + + + Blanka - Jab zap, does heavy damage + 6E15-ED20 + + + Cammy - Fierce spin knuckle, does heavy damage + 6EB3-5F20 + + + Cammy - Roundhouse front kick, does heavy damage + 6EBB-5720 + + + Cammy - Roundhouse cannon drill, does heavy damage from far away + 6EBF-5420 + + + Cammy - Erratic cannon drill + D1BE-E7A0 + + + Cammy - Superfast cannon drill + DDBE-E760 + + + Cammy - Superfast front kick - fierce + D620-17FA + + + Cammy - Superfast front kick - strong + D620-149A + + + Cammy - Superfast front kick - jab + D620-14FA + + + Chun-Li - Fierce fireball, does heavy damage + 6E5D-7D20 + + + Chun-Li - Down step, does heavy damage + DE10-5425 + + + Chun-Li - Short lightning kick, does heavy damage + 6E11-8425 + + + Chun Li - Faster whirlwind kick - roundhouse + D15E-8F60 + + + Chun Li - Superfast whirlwind kick - roundhouse + DB5E-8F60 + + + Dee Jay - Fierce hyper fist (1st hit), does heavy damage + 6EC5-EF99 + + + Dee Jay - Fierce Max Out, does heavy damage + 6ECF-7D91 + + + Dee Jay - Roundhouse dread kick + 6EC3-8F99 + + + Dee Jay - Dread kick is faster - fierce + DB23-179A + + + Dee Jay - Dread kick is faster - strong + DB23-1F9A + + + Dhalsim - Yoga spear, does heavy damage + DE5E-8729 + + + Dhalsim - Strong yoga flame (solid hit), does heavy damage + 6E5E-E429 + + + Dhalsim - Fierce yoga fire, does heavy damage + 6E58-E729 + + + E. Honda - Jab hundred-hand slap, does heavy damage + 6E99-8795 + + + E. Honda - Fierce torpedo, does heavy damage + 6E96-E495 + + + E. Honda - Fierce sumo splash, does heavy damage + 6E92-E795 + + + Fei Long - Fierce slide punch (1st hit), does heavy damage + 6EC7-5F20 + + + Fei Long - Fierce slide punch (2nd hit), does heavy damage + 6EC0-5D20 + + + Fei Long - Fierce slide punch (3rd hit), does heavy damage + 6EC0-5720 + + + Fei Long - Roundhouse dragon kick, does heavy damage + 6ECE-7420 + + + Fei Long - Superfast rekka-ken - strong + D528-1D2A + + + Fei Long - Ssuperfast rekka-ken - fierce + D627-1F2A + + + Guile - Fierce sonic boom, does heavy damage + 6E16-5491 + + + Guile - Roundhouse sonic kick, extremely close range, does heavy damage + 6E1E-7491 + + + Hawk - The Hawk, does heavy damage + 6EB3-5F91 + + + Ken - Fierce dragon punch, close to opponent, does heavy damage + 6E96-8721 + + + Ken - Fierce fireballs, close to opponent, does heavy damage + 6E92-8F21 + + + Ken - Roundhouse hurricane kick while on the ground, does heavy damage + 6E9A-5721 + + + Ken - Faster hurricane kicks - roundhouse + D1A9-1DBA + + + Ken - Super fast hurricane kicks - roundhouse + DBA9-1DBA + + + Ken - Hurricane kicks rise higher when done in mid-air + 1060-E405 + + + Ken - No delay after throwing fireball + 3169-57A5 + + + M. Bison - Super fast psycho crusher - fierce + DB2F-CD9A + + + M. Bison - Psycho crusher in one place - fierce + 1086-5D00 + + + Ryu - Jab dragon punch, close to opponent, does heavy damage + 6E9D-8729 + + + Ryu - Fierce red fireballs from far away, does heavy damage + 6E9B-E429 + + + Ryu - Roundhouse hurricane kick in the air + 6E9D-E429 + + + Ryu - Hurricane kicks rise higher when done in mid-air + 1060-E405 + + + Ryu - Faster hurricane kicks - roundhouse + D1A9-1DBA + + + Ryu - Super fast hurricane kicks - roundhouse + DBA9-1DBA + + + Ryu - No delay after throwing fireball + 3169-57A5 + + + Sagat - Roundhouse low tiger, from far away, does heavy damage + 6E64-5F20 + + + Sagat - Fierce high tiger, from far away, does heavy damage + 6E62-7720 + + + Sagat - Short tiger knee, does heavy damage + 6E53-ED25 + + + Sagat - Jab projectiles move slower for everyone but Sagat, does heavy damage + EE27-479E + + + Sagat - Jab projectiles move slower for Sagat, does heavy damage + EE20-4D2E + + + Sagat - Fierce projectiles move faster for everyone but Sagat, does heavy damage + EC20-4D9E + + + Sagat - Fierce projectiles move faster for Sagat, does heavy damage + E520-4F2E + + + Vega - Fierce claw dive, does heavy damage + AE6A-8491 + + + Vega - Rolling claw attack, does heavy damage + 6E62-8F91 + + + Vega - Claw thrust, does heavy damage + 6E6E-EF91 + + + Vega - Superfast claw roll + D553-5F00 + + + Vega - Claw roll in one place + 1053-5760 + + + Zangief - Double spinning lariat (only certain hits), does heavy damage + 6E51-EF90 + + + + Super Strike Eagle (USA) + + Start with 0 chaff instead of 12 + DD3F-0F61 + + + Start with 6 chaff + D13F-0F61 + + + Start with 50 chaff + 743F-0F61 + + + Start with 99 chaff + 173F-0F61 + + + Infinite chaff + 3C2A-4707 + + + Start with 0 flares instead of 12 + DD3F-04A1 + + + Start with 6 flares + D13F-04A1 + + + Start with 50 flares + 743F-04A1 + + + Start with 99 flares + 173F-04A1 + + + Infinite flares + 3C26-4FD7 + + + Start with 2 sidewinder missiles instead of 12 + D437-0401 + + + Start with 25 sidewinder missiles + FB37-0401 + + + Start with 50 sidewinder missiles + 7437-0401 + + + Start with 99 sidewinder missiles + 1737-0401 + + + Infinite sidewinder missiles + C92F-44A7 + + + Start with less fuel + 0D3D-0701 + + + Infinite fuel + C9BD-47A4 + + + Infinite maverick missiles + 82CD-3FD7 + + + Infinite ammo - air-to-air mode + DD2A-3D64 + + + Use up ammo faster - air-to-air mode + DC2A-3D64 + + + + Super Tennis (USA) + + Super speed - Matt + D060-AFAF + D761-AFAF + DD24-07A5 + + + Super speed - Amy + D060-AFAF + D761-AFAF + DD24-A7A5 + + + Super speed - Brian + D060-AFAF + D761-AFAF + DD27-07A5 + + + Super speed - Ki + D060-AFAF + D761-AFAF + DD27-A7A5 + + + Super speed - Phil + D060-AFAF + D761-AFAF + DD20-07A5 + + + Super speed - Lisa + D060-AFAF + D761-AFAF + DD20-A7A5 + + + Super speed - John + D060-AFAF + D761-AFAF + DD29-07A5 + + + Super speed - Erin + D060-AFAF + D761-AFAF + DD29-A7A5 + + + Super speed - Meyer + D060-AFAF + D761-AFAF + DD21-07A5 + + + Super speed - Donna + D060-AFAF + D761-AFAF + DD21-A7A5 + + + Super speed - Rich + D060-AFAF + D761-AFAF + DD25-07A5 + + + Super speed - Debbie + D060-AFAF + D761-AFAF + DD25-A7A5 + + + Super speed - Hiro + D060-AFAF + D761-AFAF + DD26-07A5 + + + Super speed - Colette + D060-AFAF + D761-AFAF + DD26-A7A5 + + + Super speed - Steve + D060-AFAF + D761-AFAF + DD2B-07A5 + + + Super speed - Nancy + D060-AFAF + D761-AFAF + DD2B-A7A5 + + + Super speed - Rob + D060-AFAF + D761-AFAF + DD2C-07A5 + + + Super speed - Yuka + D060-AFAF + D761-AFAF + DD2C-A7A5 + + + Super speed - Mar + D060-AFAF + D761-AFAF + DD28-07A5 + + + Super speed - Barb + D060-AFAF + D761-AFAF + DD28-A7A5 + + + + Super Troll Islands (USA) + + Infinite health (except spikes) + 7E215A04 + + + Max score + 7E200999 + 7E200A99 + 7E200B99 + 7E200C09 + + + Infinite whirlwinds + 7E207409 + + + Infinite cupcakes + 7E20F799 + + + Die after one hit + 7E215A00 + + + + Super Turrican 2 (USA) + + Infinite time + 7E0AEA03 + 7E0AEB55 + + + Infinite lives + 7E0AF202 + + + Infinite Bombs + 7E0AF403 + + + Have Missile sub-weapon + 7E034A01 + + + Start with Spread Shot + 7E033600 + + + Start with Rebound + 7E033610 + + + Start with Laser + 7E033616 + + + Start with Flamethrower + 7E033602 + + + Max Spread Shot level + 7E033C04 + + + Max Rebound level + 7E033E04 + + + Max Laser level + 7E034004 + + + Max Flamethrower level + 7E034204 + + + Start on level 2 + 7E007E02 + + + Start on level 3 + 7E007E03 + + + Start on level 4 + 7E007E04 + + + Start on level 5 + 7E007E05 + + + Start on level 6 + 7E007E06 + + + Start on level 7 + 7E007E07 + + + Start on level 8 + 7E007E08 + + + Start on level 9 + 7E007E09 + + + Start on level 10 + 7E007E0A + + + Start on level 11 + 7E007E0B + + + Start on level 12 + 7E007E0C + + + Start on level 13 + 7E007E0E + + + Start on level 14 + 7E007E0F + + + Start on level 15 + 7E007E10 + + + Start on level 16 + 7E007E11 + + + Start on level 17 + 7E007E12 + + + + Super Turrican (USA) + + Invincibility + C226-DDD4 + + + Infinite health + 7E04FF0C + + + Infinite time + 6D28-ADDF + + + Infinite time (alt) + 7E056C23 + + + Infinite Bombs + 7E050A04 + + + Infinite wheel time + C22D-0404 + + + Start with blue weapon + DF83-6D0D + + + Start with yellow weapon + D483-6D0D + + + Start with all weapons at maximum power (4 power-ups) + D083-6D0D + BA83-67DD + + + Don't decrease weapon power after dying + 6D22-640F + F122-646F + + + Never change weapon type + 4A82-AF0D + + + Start with 1 life - Normal/Hard only + DD61-6D0D + + + Start with 2 lives - Normal/Hard only + DF61-6D0D + + + Start with 5 lives - Normal/Hard only + D061-6D0D + + + Start with 10 lives - Normal/Hard only + DB61-6D0D + + + Start with 25 lives - Normal/Hard only + F661-6D0D + + + Start with 50 lives - Normal/Hard only + 7F61-6D0D + + + Start with 99 lives - Normal/Hard only + 1461-6D0D + + + Infinite lives + C22D-ADDF + + + Start with 1 continue - Easy/Normal only + DF6F-6DDD + + + Start with 2 continues - Easy/Normal only + D46F-6DDD + + + Start with 5 continues - Easy/Normal only + D96F-6DDD + + + Start with 10 continues - Easy/Normal only + DC6F-6DDD + + + Start with 25 continues - Easy/Normal only + FB6F-6DDD + + + Start with 50 continues - Easy/Normal only + 746F-6DDD + + + Start with 99 continues - Easy/Normal only + 176F-6DDD + + + Infinite continues + C266-DD6F + + + Start with no smart lines + DD8E-6DDD + + + Start with 1 smart line + DF8E-6DDD + + + Start with 2 smart lines + D48E-6DDD + + + Start with 4 smart lines - only 3 shown at once + D08E-6DDD + + + Start with 5 smart lines - only 3 shown at once + D98E-6DDD + + + Start with 10 smart lines - only 3 shown at once + DC8E-6DDD + + + Start with 25 smart lines - only 3 shown at once + FB8E-6DDD + + + Start with 50 smart lines - only 3 shown at once + 748E-6DDD + + + Start with 99 smart lines - only 3 shown at once + 178E-6DDD + + + Infinite smart lines + C226-D704 + + + Start on level 2 + D46D-64DD + + + Start on level 3 + D76D-64DD + + + Start on level 4 + D06D-64DD + + + Start on level 5 + D96D-64DD + + + Start on level 6 + D16D-64DD + + + Start on level 7 + D56D-64DD + + + Start on level 8 + D66D-64DD + + + Start on level 9 + DB6D-64DD + + + Start on level 10 + DC6D-64DD + + + Start on level 11 + D86D-64DD + + + Start on level 12 + DA6D-64DD + + + Start on level 13 + 7E049E0D + + + + Super Valis IV (USA) + + Infinite max health + 7E0FB540 + + + Highest max health + 7E0FB640 + + + Infinite item use + 7E0FAE09 + + + Have all items + 7E0FA701 + 7E0FA802 + 7E0FA903 + 7E0FAA04 + 7E0FAB05 + 7E0FAC06 + + + Allows you to select easy mode on the options screen + 042C-ADD7 + + + Infinite usage for all special attacks + DD66-A7A7 + + + Protection from most enemy attacks + C2AA-0DAF + + + Heart worth more + F684-0F0D + + + Heart worth much more + 4684-0F0D + + + Item is always search + CB62-6767 + D762-67A7 + + + Item is always three-way beam + CB62-6767 + DF62-67A7 + + + Item is always bomber + CB62-6767 + D462-67A7 + + + Item is always homing + CB62-6767 + D062-67A7 + + + Item is always heart + CB62-6767 + D962-67A7 + + + Item is always armor + CB62-6767 + D162-67A7 + + + Selecting an item does not remove it from the menu of available items + 826F-A467 + + + Enables level select + 3CAC-6407 + + + Infinite hits on armor + C2AA-0FAF + + + Get any score for maximum score + DDCB-D7A7 + + + + Super Widget (USA) + + Invincibility + DDB9-0F0D + + + Infinite lives + C268-AFDD + + + Infinite time + C26B-6D6D + + + 1 W gives 1 life + D7BA-D4D7 + + + + SWAT Kats - The Radical Squadron (USA) + + Invincibility after first hit + 829F-EDAD + + + Invincible while flying the jet + 18EB-5FD9 + 18E2-5FA9 + 18ED-84A9 + + + Almost infinite health + 70A9-7467 + + + Gain levels quickly + 1B71-5DD5 + + + World 5 - Dark Kat always enabled + D932-7F67 + + + + Syndicate (USA) + + Start with Mega-cash + 7DC3-1FDD + 7DC3-1F0D + + + + T2 - The Arcade Game (USA) + + Infinite health - P1 + 7E007F7F + + + Infinite health - P2 + 7E00817F + + + Infinite health (alt) - P1 + 6D33-47D6 + + + Infinite health (alt) - P2 + 6D3F-1DA6 + + + Infinite gunpower - P1 + C9B7-1407 + + + Infinite gunpower - P2 + C9B9-17D7 + + + Infinite missiles - P1 + DD2A-476B + + + Infinite missiles - P2 + DD2E-4DDB + + + Shields lasts longer + 5E27-44A7 + + + Plasma Pulse Energizer lasts longer - P1 + D62B-4F67 + + + Plasma Pulse Energizer lasts longer - P2 + D628-47D7 + + + Keep P.P.E. for that level once picked up - P1 + C267-47A5 + + + Keep P.P.E. for that level once picked up - P2 + C260-4765 + + + Get 6 missiles for each 1 - P1 + D12D-4707 + + + Get 9 missiles for each 1 - P1 + DB2D-4707 + + + Get 9 missiles for each 1 - P2 + D124-4D67 + + + Get 6 missiles for each 1 - P2 + DB24-4D67 + + + Gunpower replenishes slower - P1 + FDB3-476F + + + Gunpower replenishes slower - P2 + FDB0-1F0F + + + 10 credits + FD3E-C7A3 + + + 15 credits + F93E-C7A3 + + + 20 credits + 4D3E-C7A3 + + + P.P.E. does extra damage - P1 + D12B-44A7 + + + P.P.E. does massive damage - P1 + F42B-44A7 + + + + Taz-Mania (USA) (Rev 1) + + Infinite health + C935-40C0 + + + Start with 1/4 normal health + D522-3545 + + + Start with 1/2 normal health + DE22-3545 + + + Start with 3/4 normal health + F922-3545 + + + Each kiwi worth 2 + E389-319C + + + Each kiwi worth 4 + EA89-319C + + + Each kiwi worth 5 + E889-319C + + + Each kiwi worth 7 + EB89-319C + + + Advance to next level after getting 1 kiwi + 6089-319C + + + Start on act 1, level 2 + 4A36-1140 + 7D36-1110 + DF3F-15C0 + + + Start on act 1, level 3 + 4A36-1140 + 7D36-1110 + D43F-15C0 + + + Start on act 1 bonus level + 4A36-1140 + 7D36-1110 + + + Start on act 2, level 1 + 4A36-1140 + 7D36-1110 + D03F-15C0 + + + Start on act 2, level 2 + 4A36-1140 + 7D36-1110 + D93F-15C0 + + + Start on act 2, level 3 + 4A36-1140 + 7D36-1110 + D13F-15C0 + + + Start on act 2 bonus level + 4A36-1140 + 7D36-1110 + D53F-15C0 + + + Start on act 3, level 1 + 4A36-1140 + 7D36-1110 + D63F-15C0 + + + Start on act 3, level 2 + 4A36-1140 + 7D36-1110 + DB3F-15C0 + + + Start on act 3, level 3 + 4A36-1140 + 7D36-1110 + DC3F-15C0 + + + Start on act 3 bonus level + 4A36-1140 + 7D36-1110 + D83F-15C0 + + + Start on act 4, level 1 + 4A36-1140 + 7D36-1110 + DA3F-15C0 + + + Start on act 4, level 2 + 4A36-1140 + 7D36-1110 + D23F-15C0 + + + Start on act 4, level 3 + 4A36-1140 + 7D36-1110 + D33F-15C0 + + + Start on act 4 bonus level + 4A36-1140 + 7D36-1110 + DE3F-15C0 + + + Start on act 5, level 1 + 4A36-1140 + 7D36-1110 + FD3F-15C0 + + + Start on act 5, level 2 + 4A36-1140 + 7D36-1110 + FF3F-15C0 + + + Start on act 5, level 3 + 4A36-1140 + 7D36-1110 + F43F-15C0 + + + Start with 1 continue instead of 3 + DF3F-15C0 + + + Start with 5 continues + D93F-15C0 + + + Start with 7 continues + D53F-15C0 + + + Start with 9 continues + DB3F-15C0 + + + Start with 50 continues + 743F-15C0 + + + Start with 99 continues + 173F-15C0 + + + Infinite continues + C238-1140 + + + Infinite time + DD3B-C0C0 + + + Faster timer + D035-C540 + + + You have 1 minute to complete act 1, level 1 + DF64-41C0 + + + You have 5 minutes to complete act 1, level 1 + D964-41C0 + + + Red bird worth 0 seconds instead of 10 + DD30-C910 + + + Red bird worth 20 seconds + D430-C910 + + + Red bird worth 30 seconds + D730-C910 + + + Red bird worth 40 seconds + D030-C910 + + + Red bird worth 50 seconds + D930-C910 + + + + Tecmo Super Bowl III - Final Edition (USA) + + Infinite ability points in the edit menu + 3C38-C25D + + + + Tecmo Super Bowl (USA) + + P1 touchdowns worth 0 points + DD66-14AC + + + P1 touchdowns worth 3 points + D766-14AC + + + P1 touchdowns worth 5 points + D966-14AC + + + P1 touchdowns worth 8 points + D666-14AC + + + P1 extra points worth 0 points + DD61-34DC + + + P1 extra points worth 3 points + D761-34DC + + + P1 extra points worth 5 points + D961-34DC + + + P1 extra points worth 9 points + DB61-34DC + + + P1 field goals worth 0 points + DD63-37AB + + + P1 field goals worth 1 points + DF63-37AB + + + P1 field goals worth 5 points + D963-37AB + + + P1 field goals worth 9 points + DB63-37AB + + + P1 safeties worth 0 points + DDB0-17AB + + + P1 safeties worth 1 points + DFB0-17AB + + + P1 safeties worth 5 points + D9B0-17AB + + + P1 safeties worth 9 points + DBB0-17AB + + + P2 touchdowns worth 0 points + DDCE-34A8 + DDBB-176B + + + P2 touchdowns worth 3 points + D7CE-34A8 + D7BB-176B + + + P2 touchdowns worth 5 points + D9CE-34A8 + D9BB-176B + + + P2 touchdowns worth 9 points + DBCE-34A8 + DBBB-176B + + + P2 extra points worth 0 points + DDB5-34AB + + + P2 extra points worth 3 points + D7B5-34AB + + + P2 extra points worth 5 points + D9B5-34AB + + + P2 extra points worth 9 points + DBB5-34AB + + + P2 field goals worth 0 points + DDBD-4DDB + + + P2 field goals worth 1 points + DFBD-4DDB + + + P2 field goals worth 5 points + D9BD-4DDB + + + P2 field goals worth 9 points + DBBD-4DDB + + + P2 safeties worth 0 points + DD67-17DC + + + P2 safeties worth 1 points + DF67-17DC + + + P2 safeties worth 5 points + D967-17DC + + + P2 safeties worth 9 points + DB67-17DC + + + Both players get 0 timeouts for the first half + DDA5-1F2D + + + Both players get 2 timeouts for the first half + D4A5-1F2D + + + Both players get 7 timeouts for the first half + D5A5-1F2D + + + Both players get 9 timeouts for the first half + DBA5-1F2D + + + P1 gets 0 timeouts for the first half + 10A5-14FD + + + P2 gets 0 timeouts for the first half + 10A5-14BD + + + Both players get 0 timeouts for the second half + DDAA-14FD + + + Both players get 2 timeouts for the second half + D4AA-14FD + + + Both players get 7 timeouts for the second half + D5AA-14FD + + + Both players get 9 timeouts for the second half + DBAA-14FD + + + P1 gets 0 timeouts for the second half + 10AA-149D + + + P2 gets 0 timeouts for the second half + 10AA-142D + + + P1's timeouts are not reset at half-time + C9AA-149D + + + P2's timeouts are not reset at half-time + C9AA-142D + + + 1 play to get a 1st down + DFBA-170C + + + 2 plays to get a 1st down + D4BA-170C + + + 3 plays to get a 1st down + D7BA-170C + + + 5 plays to get a 1st down + D9BA-170C + + + 7 plays to get a 1st down + D5BA-170C + + + Always 1st down + C9BA-14DC + + + + Teenage Mutant Ninja Turtles IV - Turtles in Time (USA) + + Infinite health + 892F-0DD7 + + + Infinite health (alt) (enable after level starts) + 7E044A56 + + + Infinite lives + DDAC-6F67 + + + Start with 1 life instead of 3 + DD28-67D9 + + + Start with 5 lives + D028-67D9 + + + Start with 10 lives + DB28-67D9 + + + Start with 25 lives + 4028-67D9 + + + Start with 50 lives + 0B28-67D9 + + + Start with 75 lives + 5028-67D9 + + + Start with 100 lives + BB28-67D9 + + + Start on level 2 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + DFB8-A4BF + + + Start on level 4 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D7B8-A4BF + + + Start on level 5 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D0B8-A4BF + + + Start on level 6 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D9B8-A4BF + + + Start on level 7 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D1B8-A4BF + + + Start on level 8 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D5B8-A4BF + + + Start on level 9 + 69B8-A42F + 6FB8-A7FF + DDB8-A79F + D6B8-A4BF + + + + Teenage Mutant Ninja Turtles - Tournament Fighters (USA) + + Health doesn't decrease over time + DDC1-1D03 + + + Automatic and infinite continues + 82A6-4FA4 + + + Leonardo is replaced by Rat King + DCCA-1405 + + + Leonardo is replaced by Karai + D8CA-1405 + + + Raphael is replaced by Rat King + DCCA-14A5 + + + Raphael is replaced by Karai + D8CA-14A5 + + + Donatello is replaced by Rat King + DCCA-1705 + + + Donatello is replaced by Karai + D8CA-1705 + + + Start with 1/4 health - both players + F6E9-3D25 + + + Start with 1/2 health - both players + 7DE9-3D25 + + + Start with 3/4 health - both players + 06E9-3D25 + + + Start with no continues (leave menu option on 3) + DDB1-CF60 + + + Start with 1 continue + D4B1-CF60 + + + Start with 3 continues + D0B1-CF60 + + + Start with 5 continues + D1B1-CF60 + + + Start with 7 continues + D6B1-CF60 + + + Matches are 10 seconds long (leave menu option on 60) + FD86-4F00 + + + Matches are 15 seconds long (leave menu option on 60) + F986-4F00 + + + Matches are 20 seconds long (leave menu option on 60) + 4D86-4F00 + + + Matches are 75 seconds long (leave menu option on 60) + 5986-4F00 + + + Ultimate attack can be done any time the bar isn't empty + DFCA-44A3 + + + Ultimate attack can be done with about 1/4 health + F0CA-44A3 + + + Ultimate attack can be done with about 1/2 health + 46CA-44A3 + + + Ultimate attack can be done with about 3/4 health + 7ACA-44A3 + + + Health decreases twice as fast + D4C1-1D03 + + + After doing an ultimate attack, health bar goes to about 1/4 + F0C3-4463 + + + After doing an ultimate attack, health bar goes to about 1/2 + 46C3-4463 + + + After doing an ultimate attack, health bar goes to about 3/4 + 7AC3-4463 + + + + Tengai Makyou Zero (Japan) + + No random battles + 7E165908 + + + Infinite HP - character 1 + 7E1694E7 + 7E169503 + + + Infinite HP - character 2 + 7E1696E7 + 7E169703 + + + Infinite HP - character 3 + 7E1698E7 + 7E169903 + + + Infinite MP - character 1 + 7E16C8E7 + 7E16C903 + + + Infinite MP - character 2 + 7E16CAE7 + 7E16CB03 + + + Infinite MP - character 3 + 7E16CCE7 + 7E16CD03 + + + Fast level gain + 7E1950FF + 7E1951FF + + + + Terminator 2 - Judgment Day (USA) + + Infinite health (alt) + 7E1407C8 + + + Infinite health - John + 7E145264 + + + Infinite health - Sarah + 7E149D64 + + + Infinte ammo + 7E1407FF + + + + Terminator, The (USA) + + Infinite grenades + 4AA3-0F96 + + + Infinite missiles + C2A5-0D98 + + + 10 grenades on pick-up + DCAB-A7FC + + + 2 grenades on pick-up + D4AB-A7FC + + + Infinite lives (not on car stages) + C286-17DD + + + Longer invulnerability after being hit + EE81-0D9C + + + Shorter invulnerability after being hit + FE81-0D9C + + + Start with 9 lives + DBA2-C4AF + + + Start with 1 life + DFA2-C4AF + + + Don't lose grenades on dying + 4AA9-04F6 + + + Don't lose missiles on dying + 4AA9-0F96 + + + Get rapid fire on dying + D7A9-0D96 + + + Start with rapid fire + D767-CFAD + + + + Tetris 2 (USA) + + Select any round + 9DBD-3DF4 + + + Tile speed always at 0 + CBC5-4FDC + DDC5-4F0C + DDC5-4F6C + + + Tile speed always at 255 + CBC5-4FDC + EEC5-4F0C + DDC5-4F6C + + + More time to place the blocks where you want them + 6DB1-346B + + + + Tetris 2 (USA) (Rev 1) + + Select any round + 9DBD-3DF4 + + + Tile speed always at 0 + CBC5-4FDC + DDC5-4F0C + DDC5-4F6C + + + Tile speed always at 255 + CBC5-4FDC + EEC5-4F0C + DDC5-4F6C + + + More time to place the blocks where you want them + 6DB1-346B + + + + Tetris & Dr. Mario (USA) + + Tetris - Level never increases + 6DB4-1F65 + + + Tetris - After the first level your level increases every line + DFB4-1405 + + + Tetris - The same piece always drops + CBB7-C460 + D4B7-C4A0 + DDB7-C7D0 + + + Tetris - Always at high speed + CBB2-3DA9 + DCB2-3FD9 + 3CB2-3F09 + + + Tetris - Options menu (press Start at title screen) + 7E1E1B03 + + + Tetris 2 - Select any round - 1P (at round select meter, keep pressing right) + 9DBD-3DF4 + + + Tetris 2 - Tile speed always at 0 + CBC5-4FDC + DDC5-4F0C + DDC5-4F6C + + + Tetris 2 - Tile speed always at 255 + CBC5-4FDC + EEC5-4F0C + DDC5-4F6C + + + Tetris 2 - More time to place the blocks where you want them, even after they hit the ground (left and right only) + 6DB1-346B + + + Dr. Mario - The same piece always drops until you hit the change button + CBC9-4466 + DCC9-44A6 + 3CC9-47D6 + + + Dr. Mario - The same piece always drops + CB67-37DC + DC67-370C + 3C67-376C + + + Dr. Mario - Options menu (press Start at title screen) + 7E1E7203 + + + + Thunder Spirits (USA) + + Invincibility + 7E04187B + + + Stage modifier + 7E1A98?? + + + Start with 1 credit + C7BF-0DAD + + + Start with 2 credits + 84BF-0DAD + + + Start with 3 credits + B4BF-0DAD + + + Start with 5 credits + BEBF-0DAD + + + Start with 8 credits + 68BF-0D6D + C4BF-0DAD + + + Start with 12 credits + D0BF-0D6D + C3BF-0DAD + + + Infinite credits + 3CAC-67DF + + + Infinite credits (alt) + C2A8-8D0F + + + Start with 1 life + EEB3-DD0D + CBB3-DDDD + + + Start with 2 lives + DDB3-DD0D + CBB3-DDDD + + + Start with 5 lives + D7B3-DD0D + CBB3-DDDD + + + Start with 7 lives + D9B3-DD0D + CBB3-DDDD + + + Start with 9 lives + D5B3-DD0D + CBB3-DDDD + + + Start with 25 lives + F5B3-DD0D + CBB3-DDDD + + + Start with 50 lives + 7DB3-DD0D + CBB3-DDDD + + + Start with 100 lives + 14B3-DD0D + CBB3-DDDD + + + Infinite lives + CBCC-0407 + + + Infinite lives (alt) + C2CC-5407 + + + Continue with 1 life + BAAD-ADDF + + + Continue with 2 lives + DDAE-670F + CBAE-67DF + + + Continue with 5 lives + D7AE-670F + CBAE-67DF + + + Continue with 7 lives + D9AE-670F + CBAE-67DF + + + Continue with 9 lives + D5AE-670F + CBAE-67DF + + + Start on stage 2 + DF65-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 3 + D465-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 4 + D765-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 5 + D065-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 6 + D965-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 7 + D165-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Start on stage 8 + D565-67D4 + CB65-64A4 + DD65-6704 + 3C65-6764 + + + Keep captured weapon until game ends (except claw and shield) + C2C8-0407 + C2C8-0767 + + + + Tick, The (USA) + + Infinite lives + DDC7-1F6F + + + Most kicks are stronger + DA60-1352 + + + Most kicks kill most enemies + FE60-1352 + + + + Timecop (USA) + + Invincibility + DDBA-C4D7 + + + Don't flash when invincible + 6DB2-CD07 + + + + Time Slip (USA) + + Keep gun power-ups after dying + CD24-67A7 + CD24-6467 + + + Start with 16 lives + EE6B-670D + + + Infinite lives + C22E-04A7 + + + Infinite energy + C2B7-6DD0 + + + Start with 4 energy - after 1st life + DE2E-0F67 + + + Start with 3 energy - after 1st life + D52E-0F67 + + + Start with 4 energy - 1st life + DE6C-6F0D + + + Start with 3 energy - 1st life + D56C-6F0D + + + Invincibility + 3CC2-D769 + + + Flash 2x longer when hit + 6DB7-6460 + + + Barely flash at all + FDB7-6460 + + + Fewer enemies + C26F-6FD1 + C26C-07A1 + C26F-ADD1 + C26C-0FA1 + + + + Tinhead (Europe) (Proto) + + Infinite lives + C26E-AF6F + + + Infinite health + C2BD-DDA4 + + + Infinite Bombs + C2BE-ADDF + + + + Tin Star (USA) + + Infinite health + 7E09C8A0 + + + Infinite lives + 7E092809 + + + Bosses die automatically + 7E0B7800 + + + Gain money much faster + 7E182A50 + 7E182BC3 + + + Max money + 7E07DD09 + 7E07DC09 + 7E07DB09 + 7E07DA09 + 7E07D909 + 7E07D809 + + + Have $9,000,000 + 7E07D809 + + + + Tintin - Prisoners of the Sun (Europe) (En,Fr,De,Es) + + Invincibility + 2D67-C7DD + 2D6B-1D0B + + + Infinite health + A289-376C + + + Infinite health (alt) + 7E059B04 + + + Infinite time + CE89-C4A8 + + + Infinite time (alt) + 7F5B7F63 + + + Infinite lives + A285-37AC + + + + Tiny Toon Adventures - Buster Busts Loose! (USA) + + Start with 1 life + DF6F-14DF + + + Start with 5 lives + D96F-14DF + + + Start with 10 lives + FD6F-14DF + + + Start with 25 lives + 496F-14DF + + + Start with 50 lives + 9D6F-14DF + + + Start with 99 lives + BB6F-14DF + + + Continue with 1 life + DFC0-CFAF + + + Continue with 5 lives + D9C0-CFAF + + + Continue with 10 lives + FDC0-CFAF + + + Continue with 25 lives + 49C0-CFAF + + + Continue with 50 lives + 9DC0-CFAF + + + Continue with 99 lives + BBC0-CFAF + + + Infinite lives - except football level + DD34-37D7 + + + Infinite lives - football level + DDC0-3F07 + + + Start with no continues on normal level - handicap + DD6D-47D0 + + + Start with 7 continues on normal level + D56D-47D0 + + + Start with 9 continues on normal level + DB6D-47D0 + + + Start with no continues on challenge level + DD6D-4700 + + + Start with 5 continues on challenge level + D96D-4700 + + + Start with 7 continues on challenge level + D56D-4700 + + + Start with 9 continues on challenge level + DB6D-4700 + + + Start with 1 heart on Children or Normal difficulty levels (don't pick challenge level) + DFCD-4FAF + + + Start with 4 hearts on Children or Normal difficulty levels, 2 on Challenge + D0CD-4FAF + + + Start with 5 hearts on Children or Normal difficulty levels, 3 on Challenge + D9CD-4FAF + + + Infinite health (when hit, a fake empty heart appears) + 3CE9-448A + + + Five heart maximum on challenge level + D184-C4A1 + + + Dash meter doesn't go down + C927-47AD + + + 1-up gives 2-up (not on mystery weight challenge level, or by collecting stars) + D46B-CFAF + + + Small star worth 2 + D43E-C48E + + + Small star worth 5 + D93E-C48E + + + Small star worth 10 + FD3E-C48E + + + Gold Gogo Dodo Trophy lasts 1/2 as long + DF64-14AA + + + Gold Gogo Dodo Trophy lasts 2x as long + D064-14AA + + + Choose bonus level after completing a level + C9CE-1F0F + + + Passwords work on any difficulty level (not just Children level) + 7036-C001 + + + + TKO Super Championship Boxing (USA) + + 9 minutes per round + DB60-A7D4 + + + 6 minutes per round + D160-A7D4 + + + 1 minute per round + DF60-A7D4 + + + P1 allowed only 3 punches in punch meter + D7B4-0D6D + D765-A764 + + + P2 allowed only 3 punches in punch meter + D7B9-04DD + D765-A764 + + + Infinite punch meters - both players + 4088-AF00 + + + Infinite punch meter - P1 + 40BF-04DD + + + Infinite punch meter - P2 + 40B0-076D + + + + Top Gear 2 (USA) + + Start with 0 nitros + DD2A-4D6D + + + Start with 2 nitros + D42A-4D6D + + + Start with 4 nitros + D02A-4D6D + + + Start with 8 nitros + D62A-4D6D + + + Start with 10 nitros + DC2A-4D6D + + + Infinite nitros for P1 + C267-CD07 + + + Infinite nitros for P2 + C2CB-CF0F + + + Fuel never runs out + C9BD-1F04 + + + 1st place gives $50,000 instead of $10,000 + 7430-398E + + + 2nd place gives $50,000 instead of $6,000 + 7430-317E + + + 3rd place gives $50,000 instead of $4,000 + 7430-318E + + + 4th place gives $50,000 instead of $3,000 + 7430-357E + + + 5th place gives $50,000 instead of $2,000 + 7430-358E + + + 6th place gives $50,000 instead of $1,000 + 7439-307E + + + 7th place gives $50,000 instead of $0 + 7439-308E + + + 8th place gives $50,000 instead of $0 + 7439-397E + + + 9th place gives $50,000 instead of $0 + 7439-398E + + + 10th place gives $50,000 instead of $0 + 7439-317E + + + 1st place is worth 20 points instead of 10 + F039-355A + + + 2nd place is worth 20 points instead of 6 + F039-35EA + + + 3rd place is worth 20 points instead of 4 + F031-305A + + + 4th place is worth 20 points instead of 3 + F031-30EA + + + 5th place is worth 20 points instead of 2 + F031-395A + + + 6th place is worth 20 points instead of 1 + F031-39EA + + + 7th place is worth 20 points instead of 0 + F031-315A + + + 8th place is worth 20 points instead of 0 + F031-31EA + + + 9th place is worth 20 points instead of 0 + F031-355A + + + 10th place is worth 20 points instead of 0 + F031-35EA + + + Everything is free (must have enough to buy) + 0BC4-49EE + 52C3-3083 + + + 2nd engine costs $1K instead of $30K + DFC5-405E + + + 2nd engine costs $15K instead of $30K + DEC5-405E + + + 3rd engine costs $1K instead of $50K + DFC5-40EE + + + 3rd engine costs $25K instead of $50K + FBC5-40EE + + + 4th engine costs $1K instead of $80K + DFC5-495E + + + 4th engine costs $40K instead of $80K + 46C5-495E + + + 2nd wet tires are free + DDC5-415E + + + 3rd wet tires are free + DDC5-41EE + + + 4th wet tires are free + DDC5-455E + + + 2nd dry tires are free + DDC6-405E + + + 3rd dry tires are free + DDC6-40EE + + + 4th dry tires are free + DDC6-495E + + + 2nd gear box costs $1K instead of $10K + DFC6-415E + + + 2nd gear box costs $5K instead of $10K + D9C6-415E + + + 3rd gear box costs $1K instead of $30K + DFC6-41EE + + + 3rd gear box costs $15K instead of $30K + DEC6-41EE + + + 4th gear box costs $1K instead of $50K + DFC6-455E + + + 4th gear box costs $25K instead of $50K + FBC6-455E + + + 2nd nitro costs $1K instead of $5K + DFCB-405E + + + 2nd nitro costs $2K instead of $5K + D4CB-405E + + + 3rd nitro costs $1K instead of $15K + DFCB-40EE + + + 3rd nitro costs $7K instead of $15K + D5CB-40EE + + + 4th nitro costs $1K instead of $30K + DFCB-495E + + + 4th nitro costs $15K instead of $30K + DECB-495E + + + 2nd side armor costs $1K instead of $5K + DFCC-405E + + + 2nd side armor costs $2K instead of $5K + D4CC-405E + + + 3rd side armor costs $1K instead of $10K + DFCC-40EE + + + 3rd side armor costs $5K instead of $10K + D9CC-40EE + + + 4th side armor costs $1K instead of $20K + DFCC-495E + + + 4th side armor costs $10K instead of $20K + DCCC-495E + + + 2nd rear armor costs $1K instead of $5K + DFCC-415E + + + 2nd rear armor costs $2K instead of $5K + D4CC-415E + + + 3rd rear armor costs $1K instead of $10K + DFCC-41EE + + + 3rd rear armor costs $5K instead of $10K + D9CC-41EE + + + 4th rear armor costs $1K instead of $20K + DFCC-455E + + + 4th rear armor costs $10K instead of $20K + DCCC-455E + + + 2nd front armor costs $1K instead of $5K + DFC8-405E + + + 2nd front armor costs $2K instead of $5K + D4C8-405E + + + 3rd front armor costs $1K instead of $10K + DFC8-40EE + + + 3rd front armor costs $5K instead of $10K + D9C8-40EE + + + 4th front armor costs $1K instead of $20K + DFC8-495E + + + 4th front armor costs $10K instead of $20K + DCC8-495E + + + Infinite nitro + A267-CD07 + + + Infinite fuel + C2B7-C404 + + + Always finish first + 632E-C767 + + + Infinite money + 82C4-49EE + + + + Top Gear 3000 (USA) + + Always finish first + C3EC-1700 + + + Infinite time + 7E005B00 + + + Infinite fuel + C936-1D6E + + + Infinite Nitro + A930-3463 + + + Infinite money + 7E039075 + 7E038F30 + + + + Top Gear (USA) + + Start with 1/2 fuel + 972B-0F64 + + + Start with 3/4 fuel + 5A2B-0F64 + + + Infinite fuel - P1 + C225-6429 + + + Infinite fuel - P2 + C223-6D95 + + + Start with no nitro boosts instead of 3 + DD63-6DDD + + + Start with 1 nitro boost + DF63-6DDD + + + Start with 2 nitro boosts + D463-6DDD + + + Start with 6 nitro boosts + D163-6DDD + + + Start with 9 nitro boosts + DB63-6DDD + + + Infinite nitro boosts - P1 + 3C84-6D64 + + + Infinite nitro boosts - P2 + 3C86-64A4 + + + Nitro boost lasts until end of race - P1 + C280-6FA4 + + + Nitro boost lasts until end of race - P2 + C288-6DD4 + + + Race in any country + 6DB7-AFEA + + + Always finish first + F6CE-0D6D + + + + Total Carnage (USA) + + Invincibility + 6D27-441E + + + Invincibility (alt) + 8BDC3980 + + + Infinite lives + C932-341E + + + Infinite Time Bombs + 4029-3F12 + + + Start with 2 lives + DFC3-44D2 + + + Start with 10 lives + DBC3-44D2 + + + Start with 1 Time Bomb + DFCD-1DD2 + 40B5-1DD4 + + + Start with 9 Time Bombs + DBCD-1DD2 + + + Join in with 2 lives and 3 Time Bombs + DFBC-47D4 + + + Join in with 10 lives and 9 Time Bombs + DBBC-47D4 + + + Shields last longer + D6B3-C764 + + + Shields don't last last as long + DDB3-C764 + + + Weapons don't run out until you die or change weapons + C930-4D4A + + + + Toy Story (USA) + + Invincibility + C2B7-3914 + + + Infinite lives + CEB9-3914 + + + Start with 5 more lives than usual + D63D-C7BA + + + Start with 10 more lives than usual + DE3D-C7BA + + + Start with 25 more lives than usual + F33D-C7BA + + + Start with 50 more lives than usual + 753D-C7BA + + + Start on level 2 + DFA6-3DC4 + + + Start on level 3 + D4A6-3DC4 + + + Start on level 4 + D7A6-3DC4 + + + Start on level 5 + D0A6-3DC4 + + + Start on level 6 + D9A6-3DC4 + + + Start on level 7 + D1A6-3DC4 + + + Start on level 8 + D5A6-3DC4 + + + Start on level 9 + D6A6-3DC4 + + + Start on level 10 + DBA6-3DC4 + + + Start on level 11 + DCA6-3DC4 + + + Start on level 12 + D8A6-3DC4 + + + Start on level 13 + DAA6-3DC4 + + + Start on level 14 + D2A6-3DC4 + + + Start on level 15 + D3A6-3DC4 + + + Start on level 16 + DEA6-3DC4 + + + Start on level 17 + FDA6-3DC4 + + + + Toys (USA) + + Infinite lives + C261-3D7B + + + Start with 1 life + DF2D-37AC + + + Start with 9 lives + DB2D-37AC + + + Protection against most hazards + C2B6-3F5C + C2A4-3F8C + + + Fewer toys gained from floor boxes + DC85-4D34 + + + More toys gained from floor boxes + 1EB5-4D34 + EEB5-440F + + + Lots more toys gained from floor boxes + 7985-4D34 + EEB5-440F + + + Fewer toys gained from carousel + DC69-CF47 + + + More toys gained from carousel + 7969-CF47 + + + Lots more toys gained from carousel + 1E69-CF47 + + + + Troddlers (USA) + + Infinite time + C269-6464 + + + + True Golf Classics - Pebble Beach Golf Links (USA) + + All holes are par 4 + CE65-D763 + + + Course is generally harder (par goes down randomly for some holes) + 8665-D7A3 + D728-04DA + + + + True Golf Classics - Waialae Country Club (USA) + + Most holes have new par values + 1C6A-67D9 + D081-046A + + + All holes are par 5 + CE6A-64A9 + + + All holes are par 4 + CE6A-64A9 + 1A6A-67D9 + + + + Tuff E Nuff (USA) + + Invincibility + 6D6A-14A0 + + + One hit kills + CB67-1FA9 + EE67-1409 + + + Each round is 80 seconds + 6D65-14D4 + + + Each round is 60 seconds + 1D65-14D4 + + + Each round is 40 seconds + 0D65-14D4 + + + Each round is 20 seconds + 4D65-14D4 + + + Allows you to select same player vs. same player in a 1P vs. 2P game (must select 2nd player using right button) + DDAE-CDA5 + + + Allows you to select any character in a vs. computer game + EEA3-C7A1 + + + Start with 1/4 health - P1 only + F1CE-1FD9 + + + Start with 1/2 health - P1 only + 4ACE-1FD9 + + + Start with 3/4 health - P1 only + 04CE-1FD9 + + + Play stage 2 in story (brings you back to level 1) + D066-446F + + + Play stage 3 in story (brings you back to level 1) + D166-446F + + + Play stage 4 in story (brings you back to level 1) + D666-446F + + + Play stage 5 in story (brings you back to level 1) + DC66-446F + + + Play stage 6 in story (brings you back to level 1) + DA66-446F + + + Play stage 7 in story (brings you back to level 1) + D366-446F + + + Play stage 8 in story (brings you back to level 1) + FD66-446F + + + Play stage 9 in story (brings you back to level 1) + F466-446F + + + Play final stage in story (brings you back to level 1) + F066-446F + + + Syoh and Zazi's High Fist Thrust does more damage + F62E-46F3 + + + Syoh and Zazi's Sliding Heel Kick does more damage + 4024-3BF3 + + + Syoh and Zazi's Big Head Thrust Punch does more damage - from close up only + 402F-16FE + + + Syoh and Zazi's Big Head Thrust Punch does no damage + DD2F-16FE + + + Syoh and Zazi's Flying Side Kick does more damage - from close up only + 4020-CCBE + + + Syoh and Zazi's Ball of Energy does more damage + 4030-1B9A + + + Syoh and Zazi's Palm Hit Drop does more damage + 4C2E-1B2E + + + Zazi's Blue Thunder Punch and Syoh's Dragon Blade does more damage + 403D-3CFA + + + Kotono's Straight Line Slash does more damage + F322-3617 + + + Kotono's Sweeping Knee Kick does more damage + F623-CC17 + + + Kotono's Flying Swallow Double Drop does more damage + F339-3614 + + + Kotono's Flying Side Kick does more damage + F624-3C37 + + + Kotono's Flying Swallow Point Break does more damage + F332-3B44 + + + Kotono's Drawn Sword Mist Slash does more damage + F33E-1C3F + + + Kotono's Double Edge does more damage + F633-3B14 + + + Kotono's Special Kick does more damage + 403B-364F + + + Vortz's Middle Kick does more damage + 4C3B-4BC9 + + + Vortz's Low Kick does more damage + F630-4B49 + + + Vortz's Low Aerial Drop Kick does more damage + 4C3C-3830 + + + Vortz's Big Double Sledge Hammer does more damage + 4031-CB10 + + + Vortz's Diving Knee Pad does more damage + F33D-3C30 + + + Vortz's Diving Elbow does more damage + 4C3B-CB30 + + + Vortz's Lightning Tackle does more damage + 4C30-18C9 + + + Infinite health - P1 + 7E0FB758 + + + Infinite health - P2 + 7E101058 + + + Infinite time + 7E0B2799 + + + Powered moves - P1 + 7E0FB806 + + + Powered moves - P2 + 7E101106 + + + + Twisted Tales of Spike McFang, The (USA) + + Invincibility + CEA5-34DF + + + Infinite money + C260-3766 + + + Infinite HP + 7E4CE0FF + 7E4CE14F + + + Infinite money (alt) + 7E0A57E7 + 7E0A5803 + + + + Ultima - Runes of Virtue II (USA) + + Start with Crossbow instead of the Axe (Shamino in easy mode) + 7760-47D8 + + + Start with Longbow instead of the Axe (Shamino in easy mode) + 7060-47D8 + + + Start with Fireball wand instead of the Axe (Shamino in easy mode) + 7560-47D8 + + + Start with Boomerang instead of the Axe (Shamino in easy mode) + 7660-47D8 + + + Start with Shuriken instead of the Axe (Shamino in easy mode) + 4E60-47D8 + + + Start with 30 intelligence (Shamino in easy mode) + 7D60-4768 + + + Start with 5 intelligence (Shamino in easy mode) + D960-4768 + + + Infinite energy - makes enemies invincible too (Shamino in easy mode) + C2C3-47A7 + + + Start with less stars (Shamino in easy mode) + DF69-4FD8 + + + Stars never recharge (Shamino in easy mode) + CB3B-1464 + + + Almost infinite stars (Shamino in easy mode) + CB67-3764 + + + Start with a stronger armor (Shamino in easy mode) + CB6C-4D68 + 4A6C-4DA8 + + + + Ultimate Mortal Kombat 3 (USA) + + Infinite health - P1 + C172-B27B + + + Infinite health - P2 + C17B-F37C + + + Infinite run - P1 + 7D72-B37B + + + Infinite run - P2 + 7D7B-FE7C + + + First round / one button fatalities + 7E3BE301 + + + Max fatality time + DF73-2A7C + + + Blank versus screen + EE37-CF02 + + + Scrambled backgrounds + C2B1-1FBF + + + Black background + C2B6-1FFF + + + + Ultima VI - The False Prophet (USA) + + Infinite time + 89C8-D76D + + + Infinite Gold + 7E014BFF + 7E014CFF + + + Max Karma + 7E014A64 + + + Infinite energy (Avatar) + 7E8603F0 + + + Infinite energy (Shamino) + 7E8607F0 + + + Infinite energy (Iolo) + 7E8609F0 + + + Infinite energy (Dupre) + 7E8605F0 + + + Infinite energy (Jaana) + 7E867DF0 + + + Infinite energy (Gwenno) + 7E8685F0 + + + Infinite energy (Seggal) + 7E8741F0 + + + Infinite energy (Katrina) + 7E86C3F0 + + + Infinite energy (Sentri) + 7E874DF0 + + + Infinite energy (Leodon) + 7E86E3F0 + + + Infinite energy (Gorn) + 7E8757F0 + + + Infinite energy (Leonna) + 7E86E5F0 + + + Infinite energy (Blaine) + 7E870FF0 + + + Infinite energy (Beh Lem) + 7E875DF0 + + + Infinite energy (Julia) + 7E8687F0 + + + Infinite MP (Avatar) + 7E8C023C + + + Infinite MP (Shamino) + 7E8C063C + + + Infinite MP (Iolo) + 7E8C083C + + + Infinite MP (Dupre) + 7E8C043C + + + Infinite MP (Gwenno) + 7E8C843C + + + Infinite MP (Jaana) + 7E8C7C3C + + + Infinite MP (Julia) + 7E8C863C + + + Infinite MP (Katrina) + 7E8CC23C + + + Infinite MP (Seggal) + 7E8D403C + + + Infinite MP (Sentri) + 7E8D4C3C + + + Infinite MP (Gorn) + 7E8D563C + + + Infinite MP (Leodon) + 7E8CE23C + + + Infinite MP (Leonna) + 7E8CE43C + + + Infinite MP (Blaine) + 7E8D0E3C + + + Infinite MP (Beh Lem) + 7E8D5C3C + + + Max EXP (Avatar) + 7E88020F + 7E880327 + + + Max EXP (Dupre) + 7E88040F + 7E880527 + + + Max EXP (Shamino) + 7E88060F + 7E880727 + + + Max EXP (Iolo) + 7E88080F + 7E880927 + + + Max EXP (Gwenno) + 7E88840F + 7E888527 + + + Max EXP (Seggal) + 7E89400F + 7E894127 + + + Max EXP (Sentri) + 7E894C0F + 7E894D27 + + + Max EXP (Julia) + 7E88860F + 7E888727 + + + Max EXP (Katrina) + 7E88C20F + 7E88C327 + + + Max EXP (Jaana) + 7E887C0F + 7E887D27 + + + Max EXP (Blaine) + 7E890E0F + 7E890F27 + + + Max EXP (Beh Lem) + 7E895C0F + 7E895D27 + + + Max EXP (Gorn) + 7E89560F + 7E895727 + + + Max EXP (Leonna) + 7E88E40F + 7E88E527 + + + Max EXP (Leodon) + 7E88E20F + 7E88E327 + + + + Ultraman - Towards the Future (USA) + + Infinite chances + 4024-6FA7 + + + Start with 1 chance + DD6C-0467 + + + Start with 6 chances + D96C-0467 + + + Start with 9 chances + DB6C-0467 + + + 9 minutes per stage + DBB4-DD6D + + + 6 minutes per stage + D1B4-DD6D + + + 2 minutes per stage + D4B4-DD6D + + + Infinite energy + 4ABA-67DF + + + Weaker punch + DFAC-D76E + + + Weaker kick + DFA8-DDDE + + + Quicker energy replenishment + DD8F-DF0D + + + Less energy replenishment for enemies + 3C80-DDDD + + + + U.N. Squadron (USA) + + Invincibility + DD37-D76F + 6D34-07FF + + + Infinite lives + A923-DDDF + A923-DD6F + + + Infinite continues + AD2C-0D0F + + + Start with 1 life and 1 continue + DF89-040D + + + Start with 5 lives and 5 continues + D989-040D + + + Start with 9 lives and 9 continues + DB89-040D + + + Max power on first pellet pick-up + DDE5-A794 + + + Infinite shots for all weapons + 2238-A72F + + + Infinite money + A98E-07D4 + + + Start with no money + DD80-0DAD + + + Start with $9,000 + BD80-0DAD + + + + Utopia - The Creation of a Nation (USA) + + 1-day buildings + DDBB-6D0F + + + + Vegas Stakes (USA) + + P1 starts with $488 + DF81-A4D7 + + + P2 starts with $488 + DF8B-AF07 + + + P3 starts with $488 + DF8A-AD67 + + + P4 starts with $488 + DF83-A7A7 + + + P1 starts with $2280 + D681-A4D7 + + + P2 starts with $2280 + D68B-AF07 + + + P3 starts with $2280 + D68A-AD67 + + + P4 starts with $2280 + D683-A7A7 + + + P1 starts with $9960 + 4181-A4D7 + + + P2 starts with $9960 + 418B-AF07 + + + P3 starts with $9960 + 418A-AD67 + + + P4 starts with $9960 + 4183-A7A7 + + + P1 starts with $132,072 (highroller status) + D481-A707 + + + P2 starts with $132,072 + D48B-A467 + + + P3 starts with $132,072 + D48A-AFA7 + + + P4 starts with $132,072 + D48E-AFD7 + + + You only need $34,464 to get highroller status (glitchy) + DDA0-A4AD + + + You only need $38,527 to win the game instead of $10 million + DDA8-640D + + + You only need $5,019,263 to win the game + 0AA8-640D + + + Player wins pushes in blackjack + DD87-04EC + + + Dealer wins pushes in blackjack + DF87-04EC + + + + Venom-Spider-Man - Separation Anxiety (USA) + + Infinite health - P1 + 8935-1FD6 + + + Infinite health - P2 + 7E0A5A99 + + + Infinite lives - P1 + 5BC9-1FD9 + + + Infinite lives - P2 + 7E1A8B06 + + + Stage select enabled + 7E1C40FF + + + Hard mode enabled + 7E1C3CFF + + + Use helpers multiple times + 7E1BC400 + + + Infinite Captain America hero icons + 7E1BC505 + + + Infinite Ghost Rider hero icons + 7E1BC705 + + + Infinite Daredevil hero icons + 7E1BC905 + + + Infinite Hawkeye hero icons + 7E1BCB05 + + + Infinite Vault Guardsman hero icon + 7E1BCD05 + + + One hit kills for most enemies and some bosses + 7E0AD300 + 7E0B4C00 + 7E0BC500 + 7E0C3E00 + 7E0CB700 + + + + Virtual Bart (USA) + + Infinite time + C239-37AF + + + Infinite health and Tomatoes (Baby Bart takes damage when he walks on grass) + 053E-44A4 + + + Infinite continues + C238-44A4 + + + Infinite lives + C23C-4704 + + + + Warlock (USA) + + Invincibility + CBBE-A4D7 + 33CC-DD64 + + + Infinite items on pick-up + 3C65-D46C + + + Enter the password GRKKL to go to the final battle + 7FAC-DD2F + + + Enter the password GRKKL to go to the ending + 74AC-DD2F + + + + Wayne's World (USA) + + Start with 1 life + DFAA-A764 + + + Start with 3 lives + D7AA-A764 + + + Start with 7 lives + D5AA-A764 + + + Start with 9 lives + DBAA-A764 + + + Infinite lives + C28F-0704 + + + Start with 1 Worthiness point + DF87-0764 + + + Start with 3 Worthiness points + D787-0764 + + + Start with 7 Worthiness points + D587-0764 + + + Start with 9 Worthiness points + DB87-0764 + + + Infinite Worthiness + C2BC-D728 + + + Worthiness item worth nothing on pick-up + C2B5-04BC + + + Schwing item worth nothing on pick-up + C2B0-04BC + + + Infinite Schwings if you have at least 1 + C269-0DBB + + + Invincibility lasts longer after getting hit + EEB3-DF98 + + + Invincibility does not last as long after getting hit + FDB3-DF98 + + + Invincibility lasts forever after getting hit (Wayne blinks) + 82BB-0FF8 + + + Invincibility (Wayne doesn't blink) + 6DBB-D428 + + + Amp power-up worth nothing on pick-up + DDBB-D4BC + + + Amp power-up gives you Distortion-type chords + D0BB-D4BC + + + Amp power-up gives you Mega-Amp-type chords + D4BB-D4BC + + + Amp power-up gives you Chorus-type chords + D7BB-D4BC + + + Amp power-up gives you Homer-type chords + D9BB-D4BC + + + Distortion power-up worth nothing on pick-up + DDBD-0DFC + + + Distortion power-up gives you Amp-type chords + DFBD-0DFC + + + Distortion power-up gives you Mega-Amp-type chords + D4BD-0DFC + + + Distortion power-up gives you Chorus-type-chords + D7BD-0DFC + + + Distortion power-up gives you Homer-type-chords + D9BD-0DFC + + + Heart item worth nothing + C2BB-079C + + + + WeaponLord (USA) + + Play as Zarak in story mode + D13C-561B + + + Infinite health - P1 + 5C1A-7B3B + + + Infinite health - both players + C21A-7BCB + + + + We're Back! - A Dinosaur's Story (USA) + + Infinite health + C2B2-C54B + + + Infinite health (alt) + 9A96DCAD + + + Infinite lives + C265-41CB + + + Infinite lives (alt) + 9A847AAD + + + Super-jump + FEB1-C14C + + + Super-jump (alt) + 9A9A681F + + + Mega-jump + 4EB1-C14C + + + Mega-jump (alt) + 9A9A682F + + + 9 lives + DB8B-C030 + + + 6 lives + D18B-C030 + + + 1 life + DF8B-C030 + + + Start with less health + D48B-C110 + D466-49CC + + + Less grain to get for tail swipe + D76D-111C + + + Less grain to get for stomp + DB6D-103C + + + Infinite Vorb on pick-up for the rest of the stage + C2C6-C148 + + + Infinite Elsa on pick-up for the rest of the stage + C2C1-301B + + + Infinite Dweebs on pick-up for the rest of the stage + C2C5-4038 + + + Infinite Woog on pick-up + C2C1-194C + + + Start on Manhattan - Zone 2 + CB85-1530 + D486-1040 + DD86-1010 + + + Start on the Subway + CB85-1530 + D786-1040 + DD86-1010 + + + Start on Crazy Crane + CB85-1530 + D086-1040 + DD86-1010 + + + Start on Construction in the City + CB85-1530 + D186-1040 + DD86-1010 + + + Start on Thanksgiving - Zone 1 + CB85-1530 + D586-1040 + DD86-1010 + + + Start on Thanksgiving - Zone 2 + CB85-1530 + D686-1040 + DD86-1010 + + + Start on Balloon Blow-out + CB85-1530 + DB86-1040 + DD86-1010 + + + Start on Central Park - Zone 1 + CB85-1530 + D886-1040 + DD86-1010 + + + Start on Central Park - Zone 2 + CB85-1530 + DA86-1040 + DD86-1010 + + + Start on the Zoo + CB85-1530 + D286-1040 + DD86-1010 + + + Start on Prehistoric Panic + CB85-1530 + D386-1040 + DD86-1010 + + + Start on Outside the Circus + CB85-1530 + FD86-1040 + DD86-1010 + + + Start on Circus - Zone 1 + CB85-1530 + FF86-1040 + DD86-1010 + + + Start on Circus - Zone 2 + CB85-1530 + F486-1040 + DD86-1010 + + + Start on Jack in the Box + CB85-1530 + F786-1040 + DD86-1010 + + + Start on Empire State Building + CB85-1530 + F986-1040 + DD86-1010 + + + Start on Spaceship - Zone 1 + CB85-1530 + F186-1040 + DD86-1010 + + + + Wheel of Fortune (USA) + + 3/4 of normal time to choose + F3B1-DF64 + + + 1/2 of normal time to choose + F0B1-DF64 + + + 1/4 of normal time to choose + DCB1-DF64 + + + Infinite time to choose + C264-DF0F + + + Vowels are free is you have at least $250 + DD62-DF07 + + + Vowels cost $50 if you have at least $250 + 7462-DF07 + + + Vowels cost $100 if you have at least $250 + 1062-DF07 + + + Vowels cost $150 if you have at least $250 + B162-DF07 + + + Vowels cost $200 if you have at least $250 + A662-DF07 + + + Don't lose money when landing on bankrupt + C2BE-DFDF + + + + Wing Commander - The Secret Missions (USA) + + Infinite blaster power + C2A6-4D0D + + + Infinite fuel + C2C8-14AD + + + Start on mission 8 + D668-C402 + + + Start on mission 4 + D068-C402 + + + Infinite missiles + 3C66-C7A1 + + + + Wing Commander (USA) + + Increase front shield on Hornet + 7ABC-3713 + + + Increase rear shield on Hornet + 7AB4-4D1E + + + Increase front armor on Hornet + 0DBB-4F1E + + + Increase rear armor on Hornet + 0DBD-141E + + + Increase left side armor on Hornet + 0DBE-1D1E + + + Increase right side armor on Hornet + 0DB5-171E + + + Increase front shield on Scimitar + 17B8-3D13 + + + Increase rear shield on Scimitar + 17B4-4F1E + + + Increase front armor on Scimitar + 17BB-441E + + + Increase rear armor on Scimitar + 17BD-171E + + + Increase left side armor on Scimitar + 17BE-1F1E + + + Increase right side armor on Scimitar + 17B6-1D1E + + + Mega front shields on Hornet + EEBC-37C3 + + + Mega rear shields on Hornet + EEB4-4DCE + + + Mega front shields on Scimitar + 99B8-3DC3 + + + Mega rear shields on Scimitar + 99B4-4FCE + + + + Wings 2 - Aces High (USA) + + Infinite lives - all pilots (you can still get fired) + 828A-040B + + + Infinite power-ups + C2C6-DDD8 + + + + Wizardry VI - Kindan no Mahitsu (Japan) + + The whole party doesn't take damage from normal enemy attacks + 8288-A491 + + + Create a character and he has a lot of gold + 4DBF-DD27 + + + + Wolfchild (USA) + + Invincibility + 3CA3-DFAF + + + Start with 254 lives and 255 bombs + E366-D7A4 + + + Infinite continues + C2EC-6FAD + + + Infinite lives + C9A6-A4AD + + + Infinite bombs + C9A3-DD0F + + + Stay in wolf form until next continue + C2AE-A4DD + C2AE-A4AD + + + Start at final boss + D866-DFA4 + + + + Wolfenstein 3D (USA) + + Infinite health + C2CC-5D64 + + + Infinite ammo + C28D-7D0F + + + Infinite lives + C228-E7D4 + + + Start with 6 lives + D125-84D4 + + + Start with 9 lives + DB25-84D4 + + + Start with more ammo + 1729-8704 + 1728-74D4 + + + Start with chain gun + 622C-7764 + + + Start with machine gun + 622C-74A4 + + + Start with special weapon 1 (super machine gun) and ammo after first life + 622A-7DD4 + D02C-7DA4 + + + Start with special weapon 2 (rocket launcher) and ammo after first life + 6228-7704 + D92C-7DAF + + + Infinite ammo for special weapon 1 after first life + C289-77DF + + + + Wolverine - Adamantium Rage (USA) + + Infinite health + C9ED-3FAF + + + No enemies to kill + 69E9-3A1F + + + Infinite time + 2DA8-3AA5 + + + + World Heroes 2 (USA) + + Infinite health - P1 + 7E057480 + + + No health - P2 + 7E057600 + + + Infinite time + 7E052C99 + + + One win wins the match - P1 + 7E057002 + + + + World Heroes (USA) + + Infinite health - P1 + 4008-8FAF + + + Always win - P1 + 7B86-84A4 + + + Start with more health - P1 + 5349-87D4 + + + Start with 1/2 health - P1 + 7D49-87D4 + + + Start with very little health - P1 + DF49-87D4 + + + Start with more health - P2/CPU + 534A-8F64 + + + Start with half health - P2/CPU + 7D4A-8F64 + + + Start with very little health - P2/CPU + DF4A-8F64 + + + Win a draw - P1 + D409-8F04 + + + Win a draw - P2 + D509-8F04 + + + Slow timer down by half + CD07-84AF + + + 3 hits to win round - either player + FB0C-7D64 + DD0B-77A4 + + + 2 hits to win round - either player + 7F0C-7D64 + DD0B-77A4 + + + 1 hit to win (sudden death) - either player + 1F0C-7D64 + DD0B-77A4 + + + + World League Soccer (USA) + + Each goal worth 2 - P1 + D4AC-ADA3 + + + Each goal worth 3 - P1 + D7AC-ADA3 + + + Each goal worth 4 - P1 + D0AC-ADA3 + + + Each goal worth 5 - P1 + D9AC-ADA3 + + + Each goal worth 6 - P1 + D1AC-ADA3 + + + Each goal worth 7 - P1 + D5AC-ADA3 + + + Each goal worth 8 - P1 + D6AC-ADA3 + + + Each goal worth 9 - P1 + DBAC-ADA3 + + + Each goal worth 2 - P2 + D4AD-D7DE + + + Each goal worth 3 - P2 + D7AD-D7DE + + + Each goal worth 4 - P2 + D0AD-D7DE + + + Each goal worth 5 - P2 + D9AD-D7DE + + + Each goal worth 6 - P2 + D1AD-D7DE + + + Each goal worth 7 - P2 + D5AD-D7DE + + + Each goal worth 8 - P2 + D6AD-D7DE + + + Each goal worth 9 - P2 + DBAD-D7DE + + + + WWF Raw (USA) + + Infinite health - P1 + 7E0A78A0 + + + Two punch knockouts + 7E0F4401 + + + Max grapple meter - P1 + 7E0B44BE + 7E0B4502 + 7E0B4600 + + + Start with half health + D7ED-1C7D + + + Nobody gets hurt + C231-36E3 + + + No out of ring timer + C2E3-C653 + + + + WWF Royal Rumble (USA) + + Infinite health + 9W2A-BGGG + HL2A-AAGJ + 982A-AAGL + 2R2A-BB0N + + + Max grapple meter - P1 + 7E06DEFF + 7E06DF02 + 7E06E000 + + + Two punch knockouts + 7E092C01 + + + + WWF Super WrestleMania (USA) + + Infinite health + 9WHT-FGP4 + ECHT-ECF6 + 98HT-EAF8 + 9LHT-FVRA + + + Start with 1/4 health - both players + DAC6-6FDD + + + Start with 1/2 health - both players + F6C6-6FDD + + + Start with 3/4 health - both players + 40C6-6FDD + + + Punches and kicks (except flying drop kick) do no damage + DDB1-DF07 + + + Punches and kicks (except flying drop kick) do more damage + D7B1-DF07 + + + Punches and kicks (except flying drop kick) do a lot more damage + D1B1-DF07 + + + Stomps do no damage + DDB0-0FA7 + + + Stomps do more damage + D7B0-0FA7 + + + Stomps do a lot more damage + D1B0-0FA7 + + + Elbow drops do no damage + DDEE-DF91 + + + Elbow drops do more damage + D9EE-DF91 + + + Elbow drops do a lot more damage + D6EE-DF91 + + + Flying elbow drops do no damage + DDEE-DF21 + + + Flying elbow drops do more damage + D5EE-DF21 + + + Flying elbow drops do a lot more damage + DCEE-DF21 + + + Headbutts do no damage + DDBB-0407 + + + Headbutts do more damage + D1BB-0407 + + + Headbutts do a lot more damage + DBBB-0407 + + + + WWF WrestleMania - The Arcade Game (USA) + + Infinite time + 3CF0-7B91 + + + Do mega damage and don't die + C9D2-8FDA + + + Everyone starts with 1/4 health + 4DD0-7D0A + 4DD2-740A + + + Everyone starts with 1/2 health + 0ED2-740A + + + Everyone starts with 3/4 health + 56D0-7D0A + 56D2-740A + + + Opponent starts with 1/4 health + 4DDF-7D6A + + + Opponent starts with 1/2 health + 0EDF-7D6A + + + Opponent starts with 3/4 health + 56DF-7D6A + + + Combo meter is at max + CBF0-84DE + 6DF0-84AE + + + + Xardion (USA) + + Immune to most collisions + 4A25-0FB4 + + + Immune to most bullets + 4A31-6DFD + + + Start characters at level 12 + DDE2-07CD + + + + X-Men - Mutant Apocalypse (USA) + + Untouchable + 7E0C4C21 + + + Infinite health + 33DB-E407 + + + Infinite health (alt) + 7E008B41 + 7E0C3541 + + + Infinite lives - training mode + C2D1-8F67 + + + Infinite lives - mission mode + C2D7-5F64 + + + Infinite lives - Wolverine + 7E0B7E08 + + + Infinite lives - Cyclops + 7E0B7F08 + + + Infinite lives - Beast + 7E0B8208 + + + Infinite lives - Psylocke + 7E0B8008 + + + Infinite lives - Gambit + 7E0B8108 + + + Easy specials (press X) + 3344-E701 + + + Use 1 button specials from practice mode in mission mode + 7E0B8901 + + + + Yoshi's Cookie (USA) + + In Action mode, passing a stage advances to the next round + 6D8F-DF3B + + + Immediately complete current action level whenever effects switch is turned on + D48D-AD36 + + + All 99 Action rounds available without the secret code + 14C6-0436 + + + In VS mode, only 1 win is required instead of 3. P2 always wins the set (2P only) + DF86-A71C + + + In VS mode, the fuses don't count down + C2A0-DF48 + + + In VS mode, play against tougher opponents without the secret code + D685-A766 + DD86-AF66 + + + In Puzzle mode, passing a stage advances to the next round + DD3C-6738 + + + Unlimited moves in puzzle mode + C2EA-671B + + + + Yoshi's Safari (USA) + + Almost infinite health + C221-116D + C283-4FAE + + + Infinite power + DD6B-1D00 + DD26-11AF + + + Infinite time + C2E9-47DE + + + 1 minute for stage 1 instead of 4 + DFC9-4F82 + + + 9 minutes for stage 1 + DBC9-4F82 + + + 1 minute for stage 2 instead of 4 + DFC9-4472 + + + 9 minutes for stage 2 + DBC9-4472 + + + Lose power more quickly + DF6B-1D60 + DF26-15DF + + + Lose power more slowly + D96B-1D00 + D926-11AF + + + Gain power more quickly + DF6C-1460 + DF2B-156F + + + Gain power more slowly + 4D6C-1400 + 4D2B-150F + + + 1-up with every coin after you get 10 + DBEF-1D6E + + + 1-up with every coin after you get 30 + F3EF-1D6E + + + 1-up with every coin after you get 99 + 14EF-1D6E + + + Start with 1 life + DD67-1D50 + + + Start with 5 lives + D067-1D50 + + + Start with 10 lives + DB67-1D50 + + + Infinite lives + C228-376D + + + Don't lose coins when you miss a jump + C28F-3D02 + + + + Young Merlin (USA) + + Faster Merlin + D9B7-14F9 + + + Slower mine cart + D46B-1030 + + + Start with 6 heart containers (new game only) + D186-C1D1 + + + Start with 8 heart containers (new game only) + D686-C1D1 + + + 2 energy hearts from rainbow water bottle + D4C0-CD6F + + + 3 energy hearts from rainbow water bottle + D7C0-CD6F + + + + Ys III - Wanderers from Ys (USA) + + Untouchable by enemies or their weapons + D6FEBE7C + + + Protection from most enemies + C2B3-D092 + + + Start with 488 gold instead of 1,000 + DF8E-00BE + + + Start with 2,024 gold + D58E-00BE + + + Start with 9,704 gold + 498E-00BE + + + Start with 20,200 gold + 038E-00BE + + + Start with 40,168 gold + BA8E-00BE + + + Start with 65,512 gold + EE8E-00BE + + + Gain experience quicker + CBBB-A192 + + + Gain experience much quicker + CBBB-A192 + 79BB-A1B2 + + + Start with 100 hit points instead of 20 + 1082-012E + + + Start with 200 hit points + A682-012E + + + Items are free if you have enough money + 6DEB-D46F + DCEB-D4AF + + + Infinite Amulet shots + D7F32358 + + + Kill every boss with one hit (except final boss) + DDF32A5B + + + + Zero the Kamikaze Squirrel (USA) + + Invincibility + 7E0E2C02 + + + Infinite health + 7E167404 + + + Infinite lives + 7E167206 + + + Infinite Shurikens + 7E167699 + + + + Zombies Ate My Neighbors (USA) + + Infinite health + 3C20-4D0D + + + Infinite health - P1 + 7E1CB80A + + + Infinite health - P2 + 7E1CBA0A + + + Infinite weapons + DD30-1FA7 + + + Infinite Keys on pick-up + DD3F-1DD4 + + + Infinite lives + 82AA-CF07 + + + Infinite lives - P1 + 7E1D4C03 + + + Infinite lives - P2 + 7E1D4E03 + + + Start with 10 lives + DB66-4DD4 + + + Start with 7 lives + D166-4DD4 + + + Start with 1 life + DD66-4DD4 + + + Skip Konami and LucasArts intro screens + 7E0C7C01 + + + Always have Shoes effect - P1 + 7E0155FF + + + Always have Shoes effect - P2 + 7E02D5FF + + + Infinite Bazooka - P1 + 7E1CD650 + + + Infinite Bazooka - P2 + 7E1CF650 + + + Infinite Berries - P1 + 7E1CDA50 + + + Infinite Berries - P2 + 7E1CFA50 + + + Infinite Cold Potion - P1 + 7E1D1209 + + + Infinite Cold Potion - P2 + 7E1D3209 + + + Infinite Dummy Clown - P1 + 7E1D2009 + + + Infinite Dummy Clown - P2 + 7E1D4009 + + + Infinite Extinguisher - P1 + 7E1CCE50 + + + Infinite Extinguisher - P2 + 7E1CEE50 + + + Infinite Flamethrower - P1 + 7E1CE650 + + + Infinite Flamethrower - P2 + 7E1D0650 + + + Infinite Footballs - P1 + 7E1CE450 + + + Infinite Footballs - P2 + 7E1D0450 + + + Infinite Holy Cross - P1 + 7E1CD450 + + + Infinite Holy Cross - P2 + 7E1CF450 + + + Infinite Keys - P1 + 7E1D0C09 + + + Infinite Keys - P2 + 7E1D2C09 + + + Infinite Martian Gun - P1 + 7E1CD050 + + + Infinite Martian Gun - P2 + 7E1CF050 + + + Infinite Medical Kit - P1 + 7E1D1A09 + + + Infinite Medical Kit - P2 + 7E1D3A09 + + + Infinite Monster Potion - P1 + 7E1D1009 + + + Infinite Monster Potion - P2 + 7E1D3009 + + + Infinite Pandoras Box - P1 + 7E1D1C09 + + + Infinite Pandoras Box - P2 + 7E1D3C09 + + + Infinite Plates - P1 + 7E1CE050 + + + Infinite Plates - P2 + 7E1D0050 + + + Infinite Popsicles - P1 + 7E1CDC50 + + + Infinite Popsicles - P2 + 7E1CFC50 + + + Infinite Random A Potion - P1 + 7E1D1409 + + + Infinite Random A Potion - P2 + 7E1D3409 + + + Infinite Random B Potion - P1 + 7E1D1609 + + + Infinite Random B Potion - P2 + 7E1D3609 + + + Infinite Shoes - P1 + 7E1D0E09 + + + Infinite Shoes - P2 + 7E1D2E09 + + + Infinite Silverware - P1 + 7E1CE250 + + + Infinite Silverware - P2 + 7E1D0250 + + + Infinite Skeleton Key - P1 + 7E1D1E09 + + + Infinite Skeleton Key - P2 + 7E1D3E09 + + + Infinite Soda Bombs - P1 + 7E1CD850 + + + Infinite Soda Bombs - P2 + 7E1CF850 + + + Infinite Squirt Gun - P1 + 7E1CCC50 + + + Infinite Squirt Gun - P2 + 7E1CEC50 + + + Infinite Weed Wacker - P1 + 7E1CD250 + + + Infinite Weed Wacker - P2 + 7E1CF250 + + + Start with 50 shots in Squirtgun + DD6B-4DA4 + + + Start with 100 shots in Squirtgun + DD6B-4D64 + + + Start with 550 shots in Squirtgun + D96B-4DA4 + + + Start with 950 shots in Squirtgun + DB6B-4DA4 + + + Start with soda pop cans Instead of Squirtguns (Press B or Y to get item) + 266B-4704 + + + Start with Bazookas (Press B or Y to get item) + 216B-4704 + + + Start with Tomatoes (Press B or Y to get item) + 2C6B-4704 + + + Start with Fire Extinguishers (Press B or Y to get item) + A36B-4704 + + + Start with Ice Pops (Press B or Y to get item) + 2A6B-4704 + + + Start with Peppers (Press B or Y to get item) + 236B-4704 + + + Start with Martian Bubble Guns (Press B or Y to get item) + 2D6B-4704 + + + Start with Weed-eaters (Press B or Y to get item) + 246B-4704 + + + Start with Ancient Artifacts (Press B or Y to get item) + 206B-4704 + + + Start with Plates (Press B or Y to get item) + 3D6B-4704 + + + Start with Silverware (Press B or Y to get item) + 346B-4704 + + + Start with Footballs (Press B or Y to get item) + 306B-4704 + + + Start with 9 First Aid Kits instead of 1 + DB6B-4F04 + + + Start with Speed Shoes instead of First Aid Kit (Press B or Y to get item) + D36C-4DD4 + + + Start with a Monster Potion (Press B or Y to get item) + FD6C-4DD4 + + + Start with a Ghost Potion (Press B or Y to get item) + F46C-4DD4 + + + Start with a Random Potion (Press B or Y to get item) + F06C-4DD4 + + + Start with a Pandora's box (Press B or Y to get item) + FA6C-4DD4 + + + Start with a Skeleton key (Press B or Y to get item) + F36C-4DD4 + + + Start with a Decoy (Press B or Y to get item) + 4D6C-4DD4 + + + Infinite special items (except Keys and random Potions) + DD39-34D4 + + + Package of 99 Squirtgun shots worth 999 + DBEC-4704 + + + Package of 20 Soda Pop Cans worth 99 + BBE8-44D4 + + + Package of 20 Tomatoes worth 99 + BBE8-4464 + + + Package of 5 Bazookas worth 999 + BBE8-4FA4 + + + Each First Aid Kit worth 9 on pick up + DBEF-1F04 + + + Each Key worth 9 on pick up + DBED-1FA4 + + + Start with 1/2 health + D965-4464 + + + Continue with 1/2 health + D921-1DD4 + + + Only 1 victim to rescue per level (no bonus for rescuing all victims, game is over if Zombie eats a victim) + DF63-14DF + + + Can advance to next level after getting 1 victim (no bonus for rescuing all victims, game is over if Zombie eats a victim) + BAA1-44A4 + + + Only 1 victim to rescue to advance + 7E1D5201 + + + Start on level 2 + D46E-1D0F + + + Start on level 3 + D76E-1D0F + + + Start on level 4 + D06E-1D0F + + + Start on level 5 + D96E-1D0F + + + Start on level 6 + D16E-1D0F + + + Start on level 7 + D56E-1D0F + + + Start on level 8 + D66E-1D0F + + + Start on level 9 + DB6E-1D0F + + + Start on level 10 + DC6E-1D0F + + + Start on level 11 + D86E-1D0F + + + Start on level 12 + DA6E-1D0F + + + Start on level 13 + D26E-1D0F + + + Start on level 14 + D36E-1D0F + + + Start on level 15 + DE6E-1D0F + + + Start on level 16 + FD6E-1D0F + + + Start on level 17 + FF6E-1D0F + + + Start on level 18 + F46E-1D0F + + + Start on level 19 + F76E-1D0F + + + Start on level 20 + F06E-1D0F + + + Start on level 21 + F96E-1D0F + + + Start on level 22 + F16E-1D0F + + + Start on level 23 + F56E-1D0F + + + Start on level 24 + F66E-1D0F + + + Start on level 25 + FB6E-1D0F + + + Start on level 26 + FC6E-1D0F + + + Start on level 27 + F86E-1D0F + + + Start on level 28 + FA6E-1D0F + + + Start on level 29 + F26E-1D0F + + + Start on level 30 + F36E-1D0F + + + Start on level 31 + FE6E-1D0F + + + Start on level 32 + 4D6E-1D0F + + + Start on level 33 + 4F6E-1D0F + + + + Zool - Ninja of the Nth Dimension (USA) + + Invincibility (blinking) + 7E1D8B49 + + + diff --git a/src/data/documentation.html b/bsnes/data/documentation.html similarity index 100% rename from src/data/documentation.html rename to bsnes/data/documentation.html diff --git a/src/data/icons-16x16/accessories-text-editor.png b/bsnes/data/icons-16x16/accessories-text-editor.png similarity index 100% rename from src/data/icons-16x16/accessories-text-editor.png rename to bsnes/data/icons-16x16/accessories-text-editor.png diff --git a/src/data/icons-16x16/applications-multimedia.png b/bsnes/data/icons-16x16/applications-multimedia.png similarity index 100% rename from src/data/icons-16x16/applications-multimedia.png rename to bsnes/data/icons-16x16/applications-multimedia.png diff --git a/src/data/icons-16x16/appointment-new.png b/bsnes/data/icons-16x16/appointment-new.png similarity index 100% rename from src/data/icons-16x16/appointment-new.png rename to bsnes/data/icons-16x16/appointment-new.png diff --git a/src/data/icons-16x16/audio-volume-high.png b/bsnes/data/icons-16x16/audio-volume-high.png similarity index 100% rename from src/data/icons-16x16/audio-volume-high.png rename to bsnes/data/icons-16x16/audio-volume-high.png diff --git a/src/data/icons-16x16/document-open.png b/bsnes/data/icons-16x16/document-open.png similarity index 100% rename from src/data/icons-16x16/document-open.png rename to bsnes/data/icons-16x16/document-open.png diff --git a/src/data/icons-16x16/folder-new.png b/bsnes/data/icons-16x16/folder-new.png similarity index 100% rename from src/data/icons-16x16/folder-new.png rename to bsnes/data/icons-16x16/folder-new.png diff --git a/src/data/icons-16x16/folder.png b/bsnes/data/icons-16x16/folder.png similarity index 100% rename from src/data/icons-16x16/folder.png rename to bsnes/data/icons-16x16/folder.png diff --git a/src/data/icons-16x16/go-up.png b/bsnes/data/icons-16x16/go-up.png similarity index 100% rename from src/data/icons-16x16/go-up.png rename to bsnes/data/icons-16x16/go-up.png diff --git a/src/data/icons-16x16/help-browser.png b/bsnes/data/icons-16x16/help-browser.png similarity index 100% rename from src/data/icons-16x16/help-browser.png rename to bsnes/data/icons-16x16/help-browser.png diff --git a/src/data/icons-16x16/image-x-generic.png b/bsnes/data/icons-16x16/image-x-generic.png similarity index 100% rename from src/data/icons-16x16/image-x-generic.png rename to bsnes/data/icons-16x16/image-x-generic.png diff --git a/src/data/icons-16x16/input-gaming.png b/bsnes/data/icons-16x16/input-gaming.png similarity index 100% rename from src/data/icons-16x16/input-gaming.png rename to bsnes/data/icons-16x16/input-gaming.png diff --git a/src/data/icons-16x16/item-check-off.png b/bsnes/data/icons-16x16/item-check-off.png similarity index 100% rename from src/data/icons-16x16/item-check-off.png rename to bsnes/data/icons-16x16/item-check-off.png diff --git a/src/data/icons-16x16/item-check-on.png b/bsnes/data/icons-16x16/item-check-on.png similarity index 100% rename from src/data/icons-16x16/item-check-on.png rename to bsnes/data/icons-16x16/item-check-on.png diff --git a/src/data/icons-16x16/item-radio-off.png b/bsnes/data/icons-16x16/item-radio-off.png similarity index 100% rename from src/data/icons-16x16/item-radio-off.png rename to bsnes/data/icons-16x16/item-radio-off.png diff --git a/src/data/icons-16x16/item-radio-on.png b/bsnes/data/icons-16x16/item-radio-on.png similarity index 100% rename from src/data/icons-16x16/item-radio-on.png rename to bsnes/data/icons-16x16/item-radio-on.png diff --git a/src/data/icons-16x16/media-playback-start.png b/bsnes/data/icons-16x16/media-playback-start.png similarity index 100% rename from src/data/icons-16x16/media-playback-start.png rename to bsnes/data/icons-16x16/media-playback-start.png diff --git a/src/data/icons-16x16/media-playback-stop.png b/bsnes/data/icons-16x16/media-playback-stop.png similarity index 100% rename from src/data/icons-16x16/media-playback-stop.png rename to bsnes/data/icons-16x16/media-playback-stop.png diff --git a/src/data/icons-16x16/media-record.png b/bsnes/data/icons-16x16/media-record.png similarity index 100% rename from src/data/icons-16x16/media-record.png rename to bsnes/data/icons-16x16/media-record.png diff --git a/src/data/icons-16x16/preferences-desktop.png b/bsnes/data/icons-16x16/preferences-desktop.png similarity index 100% rename from src/data/icons-16x16/preferences-desktop.png rename to bsnes/data/icons-16x16/preferences-desktop.png diff --git a/src/data/icons-16x16/preferences-system.png b/bsnes/data/icons-16x16/preferences-system.png similarity index 100% rename from src/data/icons-16x16/preferences-system.png rename to bsnes/data/icons-16x16/preferences-system.png diff --git a/src/data/icons-16x16/process-stop.png b/bsnes/data/icons-16x16/process-stop.png similarity index 100% rename from src/data/icons-16x16/process-stop.png rename to bsnes/data/icons-16x16/process-stop.png diff --git a/src/data/icons-16x16/system-file-manager.png b/bsnes/data/icons-16x16/system-file-manager.png similarity index 100% rename from src/data/icons-16x16/system-file-manager.png rename to bsnes/data/icons-16x16/system-file-manager.png diff --git a/src/data/icons-16x16/system-search.png b/bsnes/data/icons-16x16/system-search.png similarity index 100% rename from src/data/icons-16x16/system-search.png rename to bsnes/data/icons-16x16/system-search.png diff --git a/src/data/icons-16x16/text-x-generic.png b/bsnes/data/icons-16x16/text-x-generic.png similarity index 100% rename from src/data/icons-16x16/text-x-generic.png rename to bsnes/data/icons-16x16/text-x-generic.png diff --git a/src/data/icons-16x16/utilities-terminal.png b/bsnes/data/icons-16x16/utilities-terminal.png similarity index 100% rename from src/data/icons-16x16/utilities-terminal.png rename to bsnes/data/icons-16x16/utilities-terminal.png diff --git a/src/data/icons-16x16/video-display.png b/bsnes/data/icons-16x16/video-display.png similarity index 100% rename from src/data/icons-16x16/video-display.png rename to bsnes/data/icons-16x16/video-display.png diff --git a/src/data/icons-16x16/view-refresh.png b/bsnes/data/icons-16x16/view-refresh.png similarity index 100% rename from src/data/icons-16x16/view-refresh.png rename to bsnes/data/icons-16x16/view-refresh.png diff --git a/src/data/license.html b/bsnes/data/license.html similarity index 100% rename from src/data/license.html rename to bsnes/data/license.html diff --git a/src/data/logo.png b/bsnes/data/logo.png similarity index 100% rename from src/data/logo.png rename to bsnes/data/logo.png diff --git a/src/dsp/adsp/adsp.cpp b/bsnes/dsp/adsp/adsp.cpp similarity index 100% rename from src/dsp/adsp/adsp.cpp rename to bsnes/dsp/adsp/adsp.cpp diff --git a/src/dsp/adsp/adsp.hpp b/bsnes/dsp/adsp/adsp.hpp similarity index 100% rename from src/dsp/adsp/adsp.hpp rename to bsnes/dsp/adsp/adsp.hpp diff --git a/src/dsp/adsp/adsp_tables.cpp b/bsnes/dsp/adsp/adsp_tables.cpp similarity index 100% rename from src/dsp/adsp/adsp_tables.cpp rename to bsnes/dsp/adsp/adsp_tables.cpp diff --git a/src/dsp/dsp-debugger.cpp b/bsnes/dsp/dsp-debugger.cpp similarity index 75% rename from src/dsp/dsp-debugger.cpp rename to bsnes/dsp/dsp-debugger.cpp index 64389fd6..958e0fc7 100644 --- a/src/dsp/dsp-debugger.cpp +++ b/bsnes/dsp/dsp-debugger.cpp @@ -7,17 +7,17 @@ bool DSPDebugger::property(unsigned id, string &name, string &value) { if(id == n++) { name = "Main Volume - Right"; value = main_volume_right(); return true; } if(id == n++) { name = "Echo Volume - Left"; value = echo_volume_left(); return true; } if(id == n++) { name = "Echo Volume - Right"; value = echo_volume_right(); return true; } - if(id == n++) { name = "Key On"; value = string::printf("0x%.2x", key_on()); return true; } - if(id == n++) { name = "Key Off"; value = string::printf("0x%.2x", key_off()); return true; } + if(id == n++) { name = "Key On"; value = sprint("0x$", strhex<2>(key_on())); return true; } + if(id == n++) { name = "Key Off"; value = sprint("0x$", strhex<2>(key_off())); return true; } if(id == n++) { name = "Flag - Reset"; value = flag_reset(); return true; } if(id == n++) { name = "Flag - Mute"; value = flag_mute(); return true; } if(id == n++) { name = "Flag - Echo Disable"; value = flag_echo_disable(); return true; } if(id == n++) { name = "Flag - Noise Clock"; value = flag_noise_clock(); return true; } if(id == n++) { name = "Source End Block"; value = source_end_block(); return true; } if(id == n++) { name = "Echo Feedback"; value = echo_feedback(); return true; } - if(id == n++) { name = "Pitch Modulation Enable"; value = string::printf("0x%.2x", pitch_modulation_enable()); return true; } - if(id == n++) { name = "Noise Enable"; value = string::printf("0x%.2x", noise_enable()); return true; } - if(id == n++) { name = "Echo Enable"; value = string::printf("0x%.2x", echo_enable()); return true; } + if(id == n++) { name = "Pitch Modulation Enable"; value = sprint("0x$", strhex<2>(pitch_modulation_enable())); return true; } + if(id == n++) { name = "Noise Enable"; value = sprint("0x$", strhex<2>(noise_enable())); return true; } + if(id == n++) { name = "Echo Enable"; value = sprint("0x$", strhex<2>(echo_enable())); return true; } if(id == n++) { name = "Source Directory"; value = source_directory(); return true; } if(id == n++) { name = "Echo Start Address"; value = echo_start_address(); return true; } if(id == n++) { name = "Echo Directory"; value = echo_directory(); return true; } @@ -25,7 +25,7 @@ bool DSPDebugger::property(unsigned id, string &name, string &value) { for(unsigned i = 0; i < 8; i++) { if(id == n++) { name = string() << "Coefficient " << i; - value = string::printf("0x%.2x", echo_filter_coefficient(i)); + value = sprint("0x$", strhex<2>(echo_filter_coefficient(i))); return true; } } @@ -39,7 +39,7 @@ bool DSPDebugger::property(unsigned id, string &name, string &value) { if(id == n++) { name = "Volume - Left"; value = voice_volume_left(i); return true; } if(id == n++) { name = "Volume - Right"; value = voice_volume_right(i); return true; } - if(id == n++) { name = "Pitch Height"; value = string::printf("0x%.4x", voice_pitch_height(i)); return true; } + if(id == n++) { name = "Pitch Height"; value = sprint("0x$", strhex<4>(voice_pitch_height(i))); return true; } if(id == n++) { name = "Source Number"; value = voice_source_number(i); return true; } if(id == n++) { name = "ADSR1"; value = voice_adsr1(i); return true; } if(id == n++) { name = "ADSR2"; value = voice_adsr2(i); return true; } diff --git a/src/dsp/dsp-debugger.hpp b/bsnes/dsp/dsp-debugger.hpp similarity index 100% rename from src/dsp/dsp-debugger.hpp rename to bsnes/dsp/dsp-debugger.hpp diff --git a/src/dsp/dsp.cpp b/bsnes/dsp/dsp.cpp similarity index 100% rename from src/dsp/dsp.cpp rename to bsnes/dsp/dsp.cpp diff --git a/src/dsp/dsp.hpp b/bsnes/dsp/dsp.hpp similarity index 100% rename from src/dsp/dsp.hpp rename to bsnes/dsp/dsp.hpp diff --git a/src/dsp/sdsp/brr.cpp b/bsnes/dsp/sdsp/brr.cpp similarity index 100% rename from src/dsp/sdsp/brr.cpp rename to bsnes/dsp/sdsp/brr.cpp diff --git a/src/dsp/sdsp/counter.cpp b/bsnes/dsp/sdsp/counter.cpp similarity index 100% rename from src/dsp/sdsp/counter.cpp rename to bsnes/dsp/sdsp/counter.cpp diff --git a/src/dsp/sdsp/debugger/debugger.cpp b/bsnes/dsp/sdsp/debugger/debugger.cpp similarity index 100% rename from src/dsp/sdsp/debugger/debugger.cpp rename to bsnes/dsp/sdsp/debugger/debugger.cpp diff --git a/src/dsp/sdsp/debugger/debugger.hpp b/bsnes/dsp/sdsp/debugger/debugger.hpp similarity index 100% rename from src/dsp/sdsp/debugger/debugger.hpp rename to bsnes/dsp/sdsp/debugger/debugger.hpp diff --git a/src/dsp/sdsp/echo.cpp b/bsnes/dsp/sdsp/echo.cpp similarity index 100% rename from src/dsp/sdsp/echo.cpp rename to bsnes/dsp/sdsp/echo.cpp diff --git a/src/dsp/sdsp/envelope.cpp b/bsnes/dsp/sdsp/envelope.cpp similarity index 100% rename from src/dsp/sdsp/envelope.cpp rename to bsnes/dsp/sdsp/envelope.cpp diff --git a/src/dsp/sdsp/gaussian.cpp b/bsnes/dsp/sdsp/gaussian.cpp similarity index 100% rename from src/dsp/sdsp/gaussian.cpp rename to bsnes/dsp/sdsp/gaussian.cpp diff --git a/src/dsp/sdsp/misc.cpp b/bsnes/dsp/sdsp/misc.cpp similarity index 100% rename from src/dsp/sdsp/misc.cpp rename to bsnes/dsp/sdsp/misc.cpp diff --git a/src/dsp/sdsp/sdsp.cpp b/bsnes/dsp/sdsp/sdsp.cpp similarity index 92% rename from src/dsp/sdsp/sdsp.cpp rename to bsnes/dsp/sdsp/sdsp.cpp index b78a6bbe..707f4b5a 100644 --- a/src/dsp/sdsp/sdsp.cpp +++ b/bsnes/dsp/sdsp/sdsp.cpp @@ -21,8 +21,8 @@ namespace SNES { #if !defined(DSP_STATE_MACHINE) #define phase_start() while(true) { \ - if(scheduler.sync == Scheduler::SyncAll) { \ - scheduler.exit(Scheduler::SynchronizeEvent); \ + if(scheduler.sync == Scheduler::SynchronizeMode::All) { \ + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); \ } #define phase(n) #define tick() scheduler.addclocks_dsp(3 * 8); scheduler.sync_dspsmp() @@ -321,11 +321,11 @@ void sDSP::reset() { } sDSP::sDSP() { - static_assert= 32 / 8>(); //int >= 32-bits - static_assert<(int8)0x80 == -0x80>(); //8-bit sign extension - static_assert<(int16)0x8000 == -0x8000>(); //16-bit sign extension - static_assert<(uint16)0xffff0000 == 0>(); //16-bit unsigned clip - static_assert<(-1 >> 1) == -1>(); //arithmetic shift right + static_assert(sizeof(int) >= 32 / 8, "int >= 32-bits"); + static_assert((int8)0x80 == -0x80, "8-bit sign extension"); + static_assert((int16)0x8000 == -0x8000, "16-bit sign extension"); + static_assert((uint16)0xffff0000 == 0, "16-bit unsigned clip"); + static_assert((-1 >> 1) == -1, "arithmetic shift right"); //-0x8000 <= n <= +0x7fff assert(sclamp<16>(+0x8000) == +0x7fff); diff --git a/src/dsp/sdsp/sdsp.hpp b/bsnes/dsp/sdsp/sdsp.hpp similarity index 100% rename from src/dsp/sdsp/sdsp.hpp rename to bsnes/dsp/sdsp/sdsp.hpp diff --git a/src/dsp/sdsp/serialization.cpp b/bsnes/dsp/sdsp/serialization.cpp similarity index 100% rename from src/dsp/sdsp/serialization.cpp rename to bsnes/dsp/sdsp/serialization.cpp diff --git a/src/dsp/sdsp/voice.cpp b/bsnes/dsp/sdsp/voice.cpp similarity index 100% rename from src/dsp/sdsp/voice.cpp rename to bsnes/dsp/sdsp/voice.cpp diff --git a/src/interface.hpp b/bsnes/interface.hpp similarity index 82% rename from src/interface.hpp rename to bsnes/interface.hpp index 136be569..07aa20a4 100644 --- a/src/interface.hpp +++ b/bsnes/interface.hpp @@ -34,6 +34,11 @@ namespace SNES { #include "memory/memory-inline.hpp" #include "ppu/ppu-inline.hpp" #include "cheat/cheat-inline.hpp" -}; +} + +namespace nall { + template<> struct has_size { enum { value = true }; }; + template<> struct has_size { enum { value = true }; }; +} #undef debugvirtual diff --git a/src/lib/libco/amd64.c b/bsnes/lib/libco/amd64.c similarity index 100% rename from src/lib/libco/amd64.c rename to bsnes/lib/libco/amd64.c diff --git a/src/lib/libco/fiber.c b/bsnes/lib/libco/fiber.c similarity index 100% rename from src/lib/libco/fiber.c rename to bsnes/lib/libco/fiber.c diff --git a/src/lib/libco/libco.c b/bsnes/lib/libco/libco.c similarity index 100% rename from src/lib/libco/libco.c rename to bsnes/lib/libco/libco.c diff --git a/src/lib/libco/libco.h b/bsnes/lib/libco/libco.h similarity index 100% rename from src/lib/libco/libco.h rename to bsnes/lib/libco/libco.h diff --git a/src/lib/libco/ppc-elf.c b/bsnes/lib/libco/ppc-elf.c similarity index 100% rename from src/lib/libco/ppc-elf.c rename to bsnes/lib/libco/ppc-elf.c diff --git a/src/lib/libco/ppc.s b/bsnes/lib/libco/ppc.s similarity index 100% rename from src/lib/libco/ppc.s rename to bsnes/lib/libco/ppc.s diff --git a/src/lib/libco/ppc64.s b/bsnes/lib/libco/ppc64.s similarity index 100% rename from src/lib/libco/ppc64.s rename to bsnes/lib/libco/ppc64.s diff --git a/src/lib/libco/sjlj.c b/bsnes/lib/libco/sjlj.c similarity index 100% rename from src/lib/libco/sjlj.c rename to bsnes/lib/libco/sjlj.c diff --git a/src/lib/libco/ucontext.c b/bsnes/lib/libco/ucontext.c similarity index 100% rename from src/lib/libco/ucontext.c rename to bsnes/lib/libco/ucontext.c diff --git a/src/lib/libco/x86.c b/bsnes/lib/libco/x86.c similarity index 100% rename from src/lib/libco/x86.c rename to bsnes/lib/libco/x86.c diff --git a/src/lib/nall/Makefile b/bsnes/lib/nall/Makefile similarity index 100% rename from src/lib/nall/Makefile rename to bsnes/lib/nall/Makefile diff --git a/src/lib/nall/algorithm.hpp b/bsnes/lib/nall/algorithm.hpp similarity index 71% rename from src/lib/nall/algorithm.hpp rename to bsnes/lib/nall/algorithm.hpp index 98b39528..cdc48dcf 100644 --- a/src/lib/nall/algorithm.hpp +++ b/bsnes/lib/nall/algorithm.hpp @@ -5,11 +5,11 @@ #undef max namespace nall { - template T min(const T& t, const U& u) { + template T min(const T &t, const U &u) { return t < u ? t : u; } - template T max(const T& t, const U& u) { + template T max(const T &t, const U &u) { return t > u ? t : u; } diff --git a/src/lib/nall/any.hpp b/bsnes/lib/nall/any.hpp similarity index 100% rename from src/lib/nall/any.hpp rename to bsnes/lib/nall/any.hpp diff --git a/src/lib/nall/array.hpp b/bsnes/lib/nall/array.hpp similarity index 75% rename from src/lib/nall/array.hpp rename to bsnes/lib/nall/array.hpp index 50a03f66..392b5bc0 100644 --- a/src/lib/nall/array.hpp +++ b/bsnes/lib/nall/array.hpp @@ -2,8 +2,11 @@ #define NALL_ARRAY_HPP #include +#include #include #include +#include +#include namespace nall { //dynamic vector array @@ -57,18 +60,18 @@ namespace nall { memset(pool, 0, buffersize * sizeof(T)); } - array() { - pool = 0; - poolsize = 0; - buffersize = 0; + array() : pool(0), poolsize(0), buffersize(0) { } - ~array() { reset(); } - - array(const array &source) : pool(0) { - operator=(source); + array(std::initializer_list list) : pool(0), poolsize(0), buffersize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); } + ~array() { + reset(); + } + + //copy array& operator=(const array &source) { if(pool) free(pool); buffersize = source.buffersize; @@ -78,6 +81,25 @@ namespace nall { return *this; } + array(const array &source) : pool(0) { + operator=(source); + } + + //move + array& operator=(array &&source) { + if(pool) free(pool); + pool = source.pool; + poolsize = source.poolsize; + buffersize = source.buffersize; + source.pool = 0; + return *this; + } + + array(array &&source) { + operator=(move(source)); + } + + //index inline T& operator[](unsigned index) { if(index >= buffersize) resize(index + 1); if(index >= buffersize) throw "array[] out of bounds"; @@ -89,6 +111,8 @@ namespace nall { return pool[index]; } }; + + template struct has_size> { enum { value = true }; }; } #endif diff --git a/src/lib/nall/base64.hpp b/bsnes/lib/nall/base64.hpp similarity index 100% rename from src/lib/nall/base64.hpp rename to bsnes/lib/nall/base64.hpp diff --git a/src/lib/nall/bit.hpp b/bsnes/lib/nall/bit.hpp similarity index 100% rename from src/lib/nall/bit.hpp rename to bsnes/lib/nall/bit.hpp diff --git a/bsnes/lib/nall/concept.hpp b/bsnes/lib/nall/concept.hpp new file mode 100644 index 00000000..2949cd5e --- /dev/null +++ b/bsnes/lib/nall/concept.hpp @@ -0,0 +1,15 @@ +#ifndef NALL_CONCEPT_HPP +#define NALL_CONCEPT_HPP + +namespace nall { + //unsigned count() const; + template struct has_count { enum { value = false }; }; + + //unsigned length() const; + template struct has_length { enum { value = false }; }; + + //unsigned size() const; + template struct has_size { enum { value = false }; }; +} + +#endif diff --git a/src/lib/nall/config.hpp b/bsnes/lib/nall/config.hpp similarity index 99% rename from src/lib/nall/config.hpp rename to bsnes/lib/nall/config.hpp index 10494e65..31ae4e00 100644 --- a/src/lib/nall/config.hpp +++ b/bsnes/lib/nall/config.hpp @@ -53,7 +53,7 @@ namespace nall { } } }; - vector list; + linear_vector list; template void attach(T &data, const char *name, const char *desc = "") { diff --git a/src/lib/nall/crc32.hpp b/bsnes/lib/nall/crc32.hpp similarity index 100% rename from src/lib/nall/crc32.hpp rename to bsnes/lib/nall/crc32.hpp diff --git a/src/lib/nall/detect.hpp b/bsnes/lib/nall/detect.hpp similarity index 100% rename from src/lib/nall/detect.hpp rename to bsnes/lib/nall/detect.hpp diff --git a/src/lib/nall/dictionary.hpp b/bsnes/lib/nall/dictionary.hpp similarity index 92% rename from src/lib/nall/dictionary.hpp rename to bsnes/lib/nall/dictionary.hpp index 35128c2f..f14e2095 100644 --- a/src/lib/nall/dictionary.hpp +++ b/bsnes/lib/nall/dictionary.hpp @@ -6,7 +6,7 @@ #include namespace nall { - class dictionary : noncopyable { + class dictionary { public: string operator[](const char *input) { for(unsigned i = 0; i < index_input.size(); i++) { @@ -64,6 +64,9 @@ namespace nall { reset(); } + dictionary& operator=(const dictionary&) = delete; + dictionary(const dictionary&) = delete; + protected: lstring index_input; lstring index_output; diff --git a/src/lib/nall/dl.hpp b/bsnes/lib/nall/dl.hpp similarity index 96% rename from src/lib/nall/dl.hpp rename to bsnes/lib/nall/dl.hpp index 088b91e9..22acf51f 100644 --- a/src/lib/nall/dl.hpp +++ b/bsnes/lib/nall/dl.hpp @@ -16,7 +16,7 @@ #endif namespace nall { - struct library : noncopyable { + struct library { bool opened() const { return handle; } bool open(const char*); void* sym(const char*); @@ -25,6 +25,9 @@ namespace nall { library() : handle(0) {} ~library() { close(); } + library& operator=(const library&) = delete; + library(const library&) = delete; + private: uintptr_t handle; }; diff --git a/src/lib/nall/endian.hpp b/bsnes/lib/nall/endian.hpp similarity index 100% rename from src/lib/nall/endian.hpp rename to bsnes/lib/nall/endian.hpp diff --git a/src/lib/nall/file.hpp b/bsnes/lib/nall/file.hpp similarity index 98% rename from src/lib/nall/file.hpp rename to bsnes/lib/nall/file.hpp index 29be589c..4c8ca8ee 100644 --- a/src/lib/nall/file.hpp +++ b/bsnes/lib/nall/file.hpp @@ -23,7 +23,7 @@ namespace nall { #endif } - class file : noncopyable { + class file { public: enum FileMode { mode_read, mode_write, mode_readwrite, mode_writeread }; enum SeekMode { seek_absolute, seek_relative }; @@ -218,6 +218,9 @@ namespace nall { close(); } + file& operator=(const file&) = delete; + file(const file&) = delete; + private: enum { buffer_size = 1 << 12, buffer_mask = buffer_size - 1 }; char buffer[buffer_size]; diff --git a/src/lib/nall/filemap.hpp b/bsnes/lib/nall/filemap.hpp similarity index 100% rename from src/lib/nall/filemap.hpp rename to bsnes/lib/nall/filemap.hpp diff --git a/bsnes/lib/nall/foreach.hpp b/bsnes/lib/nall/foreach.hpp new file mode 100644 index 00000000..39ca7f5f --- /dev/null +++ b/bsnes/lib/nall/foreach.hpp @@ -0,0 +1,31 @@ +#ifndef NALL_FOREACH_HPP +#define NALL_FOREACH_HPP + +#undef foreach +#define foreach(iter, object) \ + for(unsigned foreach_counter = 0, foreach_limit = foreach_size(object), foreach_once = 0, foreach_broken = 0; foreach_counter < foreach_limit && foreach_broken == 0; foreach_counter++, foreach_once = 0) \ + for(auto &iter = object[foreach_counter]; foreach_once == 0 && (foreach_broken = 1); foreach_once++, foreach_broken = 0) + +#include +#include +#include + +namespace nall { + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.count(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.length(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.size(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return sizeof(T) / sizeof(typename remove_extent::type); + } +} + +#endif diff --git a/src/lib/nall/function.hpp b/bsnes/lib/nall/function.hpp similarity index 100% rename from src/lib/nall/function.hpp rename to bsnes/lib/nall/function.hpp diff --git a/src/lib/nall/input.hpp b/bsnes/lib/nall/input.hpp similarity index 100% rename from src/lib/nall/input.hpp rename to bsnes/lib/nall/input.hpp diff --git a/src/lib/nall/lzss.hpp b/bsnes/lib/nall/lzss.hpp similarity index 100% rename from src/lib/nall/lzss.hpp rename to bsnes/lib/nall/lzss.hpp diff --git a/src/lib/nall/moduloarray.hpp b/bsnes/lib/nall/moduloarray.hpp similarity index 100% rename from src/lib/nall/moduloarray.hpp rename to bsnes/lib/nall/moduloarray.hpp diff --git a/src/lib/nall/platform.hpp b/bsnes/lib/nall/platform.hpp similarity index 100% rename from src/lib/nall/platform.hpp rename to bsnes/lib/nall/platform.hpp diff --git a/src/lib/nall/priorityqueue.hpp b/bsnes/lib/nall/priorityqueue.hpp similarity index 94% rename from src/lib/nall/priorityqueue.hpp rename to bsnes/lib/nall/priorityqueue.hpp index 7f33e23b..7104e791 100644 --- a/src/lib/nall/priorityqueue.hpp +++ b/bsnes/lib/nall/priorityqueue.hpp @@ -14,7 +14,7 @@ namespace nall { //O(1) find (tick) //O(log n) insert (enqueue) //O(log n) remove (dequeue) - template class priority_queue : noncopyable { + template class priority_queue { public: inline void tick(unsigned ticks) { basecounter += ticks; @@ -86,6 +86,9 @@ namespace nall { delete[] heap; } + priority_queue& operator=(const priority_queue&) = delete; + priority_queue(const priority_queue&) = delete; + private: function callback; unsigned basecounter; diff --git a/src/lib/nall/property.hpp b/bsnes/lib/nall/property.hpp similarity index 100% rename from src/lib/nall/property.hpp rename to bsnes/lib/nall/property.hpp diff --git a/src/lib/nall/qt/Makefile b/bsnes/lib/nall/qt/Makefile similarity index 100% rename from src/lib/nall/qt/Makefile rename to bsnes/lib/nall/qt/Makefile diff --git a/src/lib/nall/qt/check-action.moc.hpp b/bsnes/lib/nall/qt/check-action.moc.hpp similarity index 100% rename from src/lib/nall/qt/check-action.moc.hpp rename to bsnes/lib/nall/qt/check-action.moc.hpp diff --git a/bsnes/lib/nall/qt/concept.hpp b/bsnes/lib/nall/qt/concept.hpp new file mode 100644 index 00000000..51cacef4 --- /dev/null +++ b/bsnes/lib/nall/qt/concept.hpp @@ -0,0 +1,10 @@ +#ifndef NALL_QT_CONCEPT_HPP +#define NALL_QT_CONCEPT_HPP + +#include + +namespace nall { + template struct has_count> { enum { value = true }; }; +} + +#endif diff --git a/src/lib/nall/qt/file-dialog.moc.hpp b/bsnes/lib/nall/qt/file-dialog.moc.hpp similarity index 100% rename from src/lib/nall/qt/file-dialog.moc.hpp rename to bsnes/lib/nall/qt/file-dialog.moc.hpp diff --git a/src/lib/nall/qt/hex-editor.moc.hpp b/bsnes/lib/nall/qt/hex-editor.moc.hpp similarity index 76% rename from src/lib/nall/qt/hex-editor.moc.hpp rename to bsnes/lib/nall/qt/hex-editor.moc.hpp index 7fb0c6c5..d59f4be9 100644 --- a/src/lib/nall/qt/hex-editor.moc.hpp +++ b/bsnes/lib/nall/qt/hex-editor.moc.hpp @@ -11,15 +11,14 @@ class HexEditor : public QTextEdit { Q_OBJECT public: - enum { - LineWidth = 59, - }; - function reader; function writer; + void setColumns(unsigned columns); + void setRows(unsigned rows); void setOffset(unsigned offset); void setSize(unsigned size); + unsigned lineWidth() const; void refresh(); HexEditor(); @@ -30,6 +29,8 @@ protected slots: protected: QHBoxLayout *layout; QScrollBar *scrollBar; + unsigned editorColumns; + unsigned editorRows; unsigned editorOffset; unsigned editorSize; bool lock; @@ -39,8 +40,8 @@ protected: inline void HexEditor::keyPressEvent(QKeyEvent *event) { QTextCursor cursor = textCursor(); - unsigned x = cursor.position() % LineWidth; - unsigned y = cursor.position() / LineWidth; + unsigned x = cursor.position() % lineWidth(); + unsigned y = cursor.position() / lineWidth(); int hexCode = -1; switch(event->key()) { @@ -66,7 +67,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { bool cursorOffsetValid = (x >= 11 && ((x - 11) % 3) != 2); if(cursorOffsetValid) { bool nibble = (x - 11) % 3; //0 = top nibble, 1 = bottom nibble - unsigned cursorOffset = y * 16 + ((x - 11) / 3); + unsigned cursorOffset = y * editorColumns + ((x - 11) / 3); unsigned effectiveOffset = editorOffset + cursorOffset; if(effectiveOffset >= editorSize) effectiveOffset %= editorSize; @@ -76,7 +77,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { if(writer) writer(effectiveOffset, data); refresh(); - cursor.setPosition(y * LineWidth + x + 1); //advance cursor + cursor.setPosition(y * lineWidth() + x + 1); //advance cursor setTextCursor(cursor); } } else { @@ -87,16 +88,30 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { } } +inline void HexEditor::setColumns(unsigned columns) { + editorColumns = columns; +} + +inline void HexEditor::setRows(unsigned rows) { + editorRows = rows; + scrollBar->setPageStep(editorRows); +} + inline void HexEditor::setOffset(unsigned offset) { lock = true; editorOffset = offset; - scrollBar->setSliderPosition(editorOffset / 16); + scrollBar->setSliderPosition(editorOffset / editorColumns); lock = false; } inline void HexEditor::setSize(unsigned size) { editorSize = size; - scrollBar->setRange(0, editorSize / 16 - 16); + bool indivisible = (editorSize % editorColumns) != 0; //add one for incomplete row + scrollBar->setRange(0, editorSize / editorColumns + indivisible - editorRows); +} + +inline unsigned HexEditor::lineWidth() const { + return 11 + 3 * editorColumns; } inline void HexEditor::refresh() { @@ -104,20 +119,20 @@ inline void HexEditor::refresh() { char temp[256]; unsigned offset = editorOffset; - for(unsigned y = 0; y < 16; y++) { + for(unsigned y = 0; y < editorRows; y++) { if(offset >= editorSize) break; sprintf(temp, "%.4x:%.4x", (offset >> 16) & 0xffff, (offset >> 0) & 0xffff); output << "" << temp << "  "; - for(unsigned x = 0; x < 16; x++) { + for(unsigned x = 0; x < editorColumns; x++) { if(offset >= editorSize) break; sprintf(temp, "%.2x", reader ? reader(offset) : 0x00); offset++; output << "" << temp << ""; - if(x != 15) output << " "; + if(x != (editorColumns - 1)) output << " "; } - if(y != 15) output << "
"; + if(y != (editorRows - 1)) output << "
"; } setHtml(output); @@ -126,7 +141,7 @@ inline void HexEditor::refresh() { inline void HexEditor::scrolled() { if(lock) return; unsigned offset = scrollBar->sliderPosition(); - editorOffset = offset * 16; + editorOffset = offset * editorColumns; refresh(); } @@ -142,12 +157,13 @@ inline HexEditor::HexEditor() { scrollBar = new QScrollBar(Qt::Vertical); scrollBar->setSingleStep(1); - scrollBar->setPageStep(16); layout->addWidget(scrollBar); lock = false; connect(scrollBar, SIGNAL(actionTriggered(int)), this, SLOT(scrolled())); + setColumns(16); + setRows(16); setSize(0); setOffset(0); } diff --git a/src/lib/nall/qt/radio-action.moc.hpp b/bsnes/lib/nall/qt/radio-action.moc.hpp similarity index 100% rename from src/lib/nall/qt/radio-action.moc.hpp rename to bsnes/lib/nall/qt/radio-action.moc.hpp diff --git a/src/lib/nall/qt/window.moc.hpp b/bsnes/lib/nall/qt/window.moc.hpp similarity index 100% rename from src/lib/nall/qt/window.moc.hpp rename to bsnes/lib/nall/qt/window.moc.hpp diff --git a/src/lib/nall/serial.hpp b/bsnes/lib/nall/serial.hpp similarity index 100% rename from src/lib/nall/serial.hpp rename to bsnes/lib/nall/serial.hpp diff --git a/src/lib/nall/serializer.hpp b/bsnes/lib/nall/serializer.hpp similarity index 90% rename from src/lib/nall/serializer.hpp rename to bsnes/lib/nall/serializer.hpp index 521e7d2e..49b0964e 100644 --- a/src/lib/nall/serializer.hpp +++ b/bsnes/lib/nall/serializer.hpp @@ -6,7 +6,6 @@ #include namespace nall { - //serializer: a class designed to save and restore the state of classes. // //benefits: @@ -17,7 +16,6 @@ namespace nall { //caveats: //- only plain-old-data can be stored. complex classes must provide serialize(serializer&); //- floating-point usage is not portable across platforms - class serializer { public: enum mode_t { Load, Save, Size }; @@ -73,6 +71,7 @@ namespace nall { for(unsigned n = 0; n < size; n++) integer(array[n]); } + //copy serializer& operator=(const serializer &s) { if(idata) delete[] idata; @@ -89,6 +88,24 @@ namespace nall { operator=(s); } + //move + serializer& operator=(serializer &&s) { + if(idata) delete[] idata; + + imode = s.imode; + idata = s.idata; + isize = s.isize; + icapacity = s.icapacity; + + s.idata = 0; + return *this; + } + + serializer(serializer &&s) { + operator=(move(s)); + } + + //construction serializer() { imode = Size; idata = 0; diff --git a/src/lib/nall/sha256.hpp b/bsnes/lib/nall/sha256.hpp similarity index 100% rename from src/lib/nall/sha256.hpp rename to bsnes/lib/nall/sha256.hpp diff --git a/src/lib/nall/sort.hpp b/bsnes/lib/nall/sort.hpp similarity index 100% rename from src/lib/nall/sort.hpp rename to bsnes/lib/nall/sort.hpp diff --git a/bsnes/lib/nall/static.hpp b/bsnes/lib/nall/static.hpp new file mode 100644 index 00000000..4acb9fd0 --- /dev/null +++ b/bsnes/lib/nall/static.hpp @@ -0,0 +1,20 @@ +#ifndef NALL_STATIC_HPP +#define NALL_STATIC_HPP + +namespace nall { + template struct static_if { typedef T type; }; + template struct static_if { typedef F type; }; + template struct mp_static_if { typedef typename static_if::type type; }; + + template struct static_and { enum { value = false }; }; + template<> struct static_and { enum { value = true }; }; + template struct mp_static_and { enum { value = static_and::value }; }; + + template struct static_or { enum { value = false }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template struct mp_static_or { enum { value = static_or::value }; }; +} + +#endif diff --git a/src/lib/nall/stdint.hpp b/bsnes/lib/nall/stdint.hpp similarity index 52% rename from src/lib/nall/stdint.hpp rename to bsnes/lib/nall/stdint.hpp index 7e2c7a46..d8b6c788 100644 --- a/src/lib/nall/stdint.hpp +++ b/bsnes/lib/nall/stdint.hpp @@ -30,15 +30,15 @@ #endif namespace nall { - static static_assert int8_t_assert; - static static_assert int16_t_assert; - static static_assert int32_t_assert; - static static_assert int64_t_assert; + static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); - static static_assert uint8_t_assert; - static static_assert uint16_t_assert; - static static_assert uint32_t_assert; - static static_assert uint64_t_assert; + static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size"); } #endif diff --git a/src/lib/nall/string.hpp b/bsnes/lib/nall/string.hpp similarity index 66% rename from src/lib/nall/string.hpp rename to bsnes/lib/nall/string.hpp index 94e65b68..65a4a4b8 100644 --- a/src/lib/nall/string.hpp +++ b/bsnes/lib/nall/string.hpp @@ -1,6 +1,7 @@ #ifndef NALL_STRING_HPP #define NALL_STRING_HPP +#include #include #include #include @@ -14,5 +15,12 @@ #include #include #include +#include +#include + +namespace nall { + template<> struct has_length { enum { value = true }; }; + template<> struct has_size { enum { value = true }; }; +} #endif diff --git a/src/lib/nall/string/base.hpp b/bsnes/lib/nall/string/base.hpp similarity index 82% rename from src/lib/nall/string/base.hpp rename to bsnes/lib/nall/string/base.hpp index e5851b00..b9230fe4 100644 --- a/src/lib/nall/string/base.hpp +++ b/bsnes/lib/nall/string/base.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -26,11 +27,6 @@ inline intmax_t strsigned (const char *str); inline uintmax_t strunsigned(const char *str); inline uintmax_t strbin (const char *str); inline double strdouble (const char *str); -inline size_t strhex (char *str, uintmax_t value, size_t length = 0); -inline size_t strsigned (char *str, intmax_t value, size_t length = 0); -inline size_t strunsigned(char *str, uintmax_t value, size_t length = 0); -inline size_t strbin (char *str, uintmax_t value, size_t length = 0); -inline size_t strdouble (char *str, double value, size_t length = 0); inline bool match(const char *pattern, const char *str); inline bool strint (const char *str, int &result); inline bool strmath(const char *str, int &result); @@ -49,8 +45,6 @@ namespace nall { class string { public: - static string printf(const char*, ...); - inline void reserve(size_t); inline unsigned length() const; @@ -73,7 +67,9 @@ namespace nall { inline string(); inline string(const char*); inline string(const string&); + inline string(string&&); inline string& operator=(const string&); + inline string& operator=(string&&); inline ~string(); inline bool readfile(const char*); @@ -90,18 +86,25 @@ namespace nall { #endif }; - class lstring : public vector { + class lstring : public linear_vector { public: template inline lstring& operator<<(T value); inline int find(const char*); inline void split (const char*, const char*, unsigned = 0); inline void qsplit(const char*, const char*, unsigned = 0); + + lstring(); + lstring(std::initializer_list); }; + + template inline string sprint(const char *s, Args... args); + template inline void print(const char *s, Args... args); }; inline size_t strlcpy(nall::string &dest, const char *src, size_t length); inline size_t strlcat(nall::string &dest, const char *src, size_t length); + inline nall::string& strlower(nall::string &str); inline nall::string& strupper(nall::string &str); inline nall::string& strtr(nall::string &dest, const char *before, const char *after); @@ -113,10 +116,11 @@ inline nall::string& rtrim_once(nall::string &str, const char *key = " "); inline nall::string& trim_once (nall::string &str, const char *key = " "); inline nall::string substr(const char *src, size_t start = 0, size_t length = 0); -inline nall::string strhex (uintmax_t value); -inline nall::string strsigned (intmax_t value); -inline nall::string strunsigned(uintmax_t value); -inline nall::string strbin (uintmax_t value); -inline nall::string strdouble (double value); +template inline nall::string strhex(uintmax_t value); +template inline nall::string strsigned(intmax_t value); +template inline nall::string strunsigned(uintmax_t value); +template inline nall::string strbin(uintmax_t value); +inline size_t strdouble(char *str, double value); +inline nall::string strdouble(double value); #endif diff --git a/src/lib/nall/string/cast.hpp b/bsnes/lib/nall/string/cast.hpp similarity index 87% rename from src/lib/nall/string/cast.hpp rename to bsnes/lib/nall/string/cast.hpp index 0b490917..7433073d 100644 --- a/src/lib/nall/string/cast.hpp +++ b/bsnes/lib/nall/string/cast.hpp @@ -2,8 +2,7 @@ #define NALL_STRING_CAST_HPP namespace nall { - //this is needed, as C++98 does not support explicit template specialization inside classes; - //redundant memory allocation should hopefully be avoided via compiler optimizations. + //this is needed, as C++0x does not support explicit template specialization inside classes template<> inline string to_string (bool v) { return v ? "true" : "false"; } template<> inline string to_string (signed int v) { return strsigned(v); } template<> inline string to_string (unsigned int v) { return strunsigned(v); } @@ -25,6 +24,6 @@ namespace nall { template<> inline string to_string(const QString &v) { return v.toUtf8().constData(); } string::operator QString() const { return QString::fromUtf8(*this); } #endif -}; +} #endif diff --git a/src/lib/nall/string/compare.hpp b/bsnes/lib/nall/string/compare.hpp similarity index 100% rename from src/lib/nall/string/compare.hpp rename to bsnes/lib/nall/string/compare.hpp diff --git a/bsnes/lib/nall/string/convert.hpp b/bsnes/lib/nall/string/convert.hpp new file mode 100644 index 00000000..a34c3f14 --- /dev/null +++ b/bsnes/lib/nall/string/convert.hpp @@ -0,0 +1,149 @@ +#ifndef NALL_STRING_CONVERT_HPP +#define NALL_STRING_CONVERT_HPP + +char* strlower(char *str) { + if(!str) return 0; + int i = 0; + while(str[i]) { + str[i] = chrlower(str[i]); + i++; + } + return str; +} + +char* strupper(char *str) { + if(!str) return 0; + int i = 0; + while(str[i]) { + str[i] = chrupper(str[i]); + i++; + } + return str; +} + +char* strtr(char *dest, const char *before, const char *after) { + if(!dest || !before || !after) return dest; + int sl = strlen(dest), bsl = strlen(before), asl = strlen(after); + + if(bsl != asl || bsl == 0) return dest; //patterns must be the same length for 1:1 replace + for(unsigned i = 0; i < sl; i++) { + for(unsigned l = 0; l < bsl; l++) { + if(dest[i] == before[l]) { + dest[i] = after[l]; + break; + } + } + } + + return dest; +} + +uintmax_t strhex(const char *str) { + if(!str) return 0; + uintmax_t result = 0; + + //skip hex identifiers 0x and $, if present + if(*str == '0' && (*(str + 1) == 'X' || *(str + 1) == 'x')) str += 2; + else if(*str == '$') str++; + + while(*str) { + uint8_t x = *str++; + if(x >= '0' && x <= '9') x -= '0'; + else if(x >= 'A' && x <= 'F') x -= 'A' - 10; + else if(x >= 'a' && x <= 'f') x -= 'a' - 10; + else break; //stop at first invalid character + result = result * 16 + x; + } + + return result; +} + +intmax_t strsigned(const char *str) { + if(!str) return 0; + intmax_t result = 0; + bool negate = false; + + //check for negation + if(*str == '-') { + negate = true; + str++; + } + + while(*str) { + uint8_t x = *str++; + if(x >= '0' && x <= '9') x -= '0'; + else break; //stop at first invalid character + result = result * 10 + x; + } + + return !negate ? result : -result; +} + +uintmax_t strunsigned(const char *str) { + if(!str) return 0; + uintmax_t result = 0; + + while(*str) { + uint8_t x = *str++; + if(x >= '0' && x <= '9') x -= '0'; + else break; //stop at first invalid character + result = result * 10 + x; + } + + return result; +} + +uintmax_t strbin(const char *str) { + if(!str) return 0; + uintmax_t result = 0; + + //skip bin identifiers 0b and %, if present + if(*str == '0' && (*(str + 1) == 'B' || *(str + 1) == 'b')) str += 2; + else if(*str == '%') str++; + + while(*str) { + uint8_t x = *str++; + if(x == '0' || x == '1') x -= '0'; + else break; //stop at first invalid character + result = result * 2 + x; + } + + return result; +} + +double strdouble(const char *str) { + if(!str) return 0.0; + bool negate = false; + + //check for negation + if(*str == '-') { + negate = true; + str++; + } + + intmax_t result_integral = 0; + while(*str) { + uint8_t x = *str++; + if(x >= '0' && x <= '9') x -= '0'; + else if(x == '.') break; //break loop and read fractional part + else return (double)result_integral; //invalid value, assume no fractional part + result_integral = result_integral * 10 + x; + } + + intmax_t result_fractional = 0; + while(*str) { + uint8_t x = *str++; + if(x >= '0' && x <= '9') x -= '0'; + else break; //stop at first invalid character + result_fractional = result_fractional * 10 + x; + } + + //calculate fractional portion + double result = (double)result_fractional; + while((uintmax_t)result > 0) result /= 10.0; + result += (double)result_integral; + + return !negate ? result : -result; +} + +#endif diff --git a/src/lib/nall/string/core.hpp b/bsnes/lib/nall/string/core.hpp similarity index 83% rename from src/lib/nall/string/core.hpp rename to bsnes/lib/nall/string/core.hpp index 29ca7173..5881018b 100644 --- a/src/lib/nall/string/core.hpp +++ b/bsnes/lib/nall/string/core.hpp @@ -3,15 +3,6 @@ namespace nall { -inline string string::printf(const char *fmt, ...) { - static char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - return text; -} - void string::reserve(size_t size_) { if(size_ > size) { size = size_; @@ -74,11 +65,25 @@ string::string(const string &value) { data = strdup(value); } +string::string(string &&source) { + size = source.size; + data = source.data; + source.data = 0; +} + string& string::operator=(const string &value) { assign(value); return *this; } +string& string::operator=(string &&source) { + if(data) free(data); + size = source.size; + data = source.data; + source.data = 0; + return *this; +} + string::~string() { free(data); } @@ -113,6 +118,15 @@ int lstring::find(const char *key) { return -1; } -}; +inline lstring::lstring() { +} + +inline lstring::lstring(std::initializer_list list) { + for(const string *s = list.begin(); s != list.end(); ++s) { + operator<<(*s); + } +} + +} #endif diff --git a/src/lib/nall/string/filename.hpp b/bsnes/lib/nall/string/filename.hpp similarity index 100% rename from src/lib/nall/string/filename.hpp rename to bsnes/lib/nall/string/filename.hpp diff --git a/src/lib/nall/string/match.hpp b/bsnes/lib/nall/string/match.hpp similarity index 100% rename from src/lib/nall/string/match.hpp rename to bsnes/lib/nall/string/match.hpp diff --git a/src/lib/nall/string/math.hpp b/bsnes/lib/nall/string/math.hpp similarity index 100% rename from src/lib/nall/string/math.hpp rename to bsnes/lib/nall/string/math.hpp diff --git a/src/lib/nall/string/replace.hpp b/bsnes/lib/nall/string/replace.hpp similarity index 100% rename from src/lib/nall/string/replace.hpp rename to bsnes/lib/nall/string/replace.hpp diff --git a/src/lib/nall/string/split.hpp b/bsnes/lib/nall/string/split.hpp similarity index 100% rename from src/lib/nall/string/split.hpp rename to bsnes/lib/nall/string/split.hpp diff --git a/src/lib/nall/string/strl.hpp b/bsnes/lib/nall/string/strl.hpp similarity index 100% rename from src/lib/nall/string/strl.hpp rename to bsnes/lib/nall/string/strl.hpp diff --git a/src/lib/nall/string/trim.hpp b/bsnes/lib/nall/string/trim.hpp similarity index 100% rename from src/lib/nall/string/trim.hpp rename to bsnes/lib/nall/string/trim.hpp diff --git a/bsnes/lib/nall/string/utility.hpp b/bsnes/lib/nall/string/utility.hpp new file mode 100644 index 00000000..c050446b --- /dev/null +++ b/bsnes/lib/nall/string/utility.hpp @@ -0,0 +1,165 @@ +#ifndef NALL_STRING_UTILITY_HPP +#define NALL_STRING_UTILITY_HPP + +size_t strlcpy(nall::string &dest, const char *src, size_t length) { + dest.reserve(length); + return strlcpy(dest(), src, length); +} + +size_t strlcat(nall::string &dest, const char *src, size_t length) { + dest.reserve(length); + return strlcat(dest(), src, length); +} + +nall::string substr(const char *src, size_t start, size_t length) { + nall::string dest; + if(length == 0) { + //copy entire string + dest = src + start; + } else { + //copy partial string + strlcpy(dest, src + start, length + 1); + } + return dest; +} + +/* very simplistic wrappers to return nall::string& instead of char* type */ + +nall::string& strlower(nall::string &str) { strlower(str()); return str; } +nall::string& strupper(nall::string &str) { strupper(str()); return str; } +nall::string& strtr(nall::string &dest, const char *before, const char *after) { strtr(dest(), before, after); return dest; } +nall::string& ltrim(nall::string &str, const char *key) { ltrim(str(), key); return str; } +nall::string& rtrim(nall::string &str, const char *key) { rtrim(str(), key); return str; } +nall::string& trim (nall::string &str, const char *key) { trim (str(), key); return str; } +nall::string& ltrim_once(nall::string &str, const char *key) { ltrim_once(str(), key); return str; } +nall::string& rtrim_once(nall::string &str, const char *key) { rtrim_once(str(), key); return str; } +nall::string& trim_once (nall::string &str, const char *key) { trim_once (str(), key); return str; } + +/* arithmetic <> string */ + +template nall::string strhex(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + //render string backwards, as we do not know its length yet + do { + unsigned n = value & 15; + output[offset++] = n < 10 ? '0' + n : 'a' + n - 10; + value >>= 4; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + //reverse the string in-place + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +template nall::string strsigned(intmax_t value) { + nall::string output; + unsigned offset = 0; + + bool negative = value < 0; + if(negative) value = abs(value); + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + if(negative) output[offset++] = '-'; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +template nall::string strunsigned(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +template nall::string strbin(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value & 1; + output[offset++] = '0' + n; + value >>= 1; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +//using sprintf is certainly not the most ideal method to convert +//a double to a string ... but attempting to parse a double by +//hand, digit-by-digit, results in subtle rounding errors. +size_t strdouble(char *str, double value) { + char buffer[256]; + sprintf(buffer, "%f", value); + + //remove excess 0's in fraction (2.500000 -> 2.5) + for(char *p = buffer; *p; p++) { + if(*p == '.') { + char *p = buffer + strlen(buffer) - 1; + while(*p == '0') { + if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. + p--; + } + break; + } + } + + unsigned length = strlen(buffer); + if(str) strcpy(str, buffer); + return length + 1; +} + +nall::string strdouble(double value) { + nall::string temp; + temp.reserve(strdouble(0, value)); + strdouble(temp(), value); + return temp; +} + +#endif diff --git a/bsnes/lib/nall/string/variadic.hpp b/bsnes/lib/nall/string/variadic.hpp new file mode 100644 index 00000000..e707b487 --- /dev/null +++ b/bsnes/lib/nall/string/variadic.hpp @@ -0,0 +1,37 @@ +#ifndef NALL_STRING_VARIADIC_HPP +#define NALL_STRING_VARIADIC_HPP + +namespace nall { + static void sprint(string &output, unsigned &offset, const char *&s) { + while(*s) output[offset++] = *s++; + } + + template + static void sprint(string &output, unsigned &offset, const char *&s, T value, Args... args) { + while(*s) { + if(*s == '$') { + string data = to_string(value); + unsigned i = 0; + while(data[i]) output[offset++] = data[i++]; + sprint(output, offset, ++s, args...); + return; + } else { + output[offset++] = *s++; + } + } + } + + template inline string sprint(const char *s, Args... args) { + string output; + unsigned offset = 0; + sprint(output, offset, s, args...); + output[offset] = 0; + return output; + } + + template inline void print(const char *s, Args... args) { + printf("%s", (const char*)sprint(s, args...)); + } +} + +#endif diff --git a/bsnes/lib/nall/string/xml.hpp b/bsnes/lib/nall/string/xml.hpp new file mode 100644 index 00000000..30d6bae6 --- /dev/null +++ b/bsnes/lib/nall/string/xml.hpp @@ -0,0 +1,268 @@ +#ifndef NALL_STRING_XML_HPP +#define NALL_STRING_XML_HPP + +//XML subset parser +//version 0.04 + +#include + +namespace nall { + +struct xml_attribute { + string name; + string content; + virtual string parse() const; +}; + +struct xml_element : xml_attribute { + string parse() const; + array attribute; + array element; + ~xml_element(); + +protected: + void parse_doctype(const char *&data); + bool parse_head(string data); + bool parse_body(const char *&data); + friend xml_element *xml_parse(const char *data); +}; + +inline string xml_attribute::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline string xml_element::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + source += pos + 3; + continue; + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + string cdata = substr(source, 9, pos - 9); + data << cdata; + offset += strlen(cdata); + + source += offset + 3; + continue; + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline void xml_element::parse_doctype(const char *&data) { + name = "!DOCTYPE"; + const char *content_begin = data; + + signed counter = 0; + while(*data) { + char value = *data++; + if(value == '<') counter++; + if(value == '>') counter--; + if(counter < 0) { + content = substr(content_begin, 0, data - content_begin - 1); + return; + } + } + throw "..."; +} + +inline bool xml_element::parse_head(string data) { + data.qreplace("\t", " "); + data.qreplace("\r", " "); + data.qreplace("\n", " "); + while(qstrpos(data, " ") >= 0) data.qreplace(" ", " "); + data.qreplace(" =", "="); + data.qreplace("= ", "="); + rtrim(data); + + lstring part; + part.qsplit(" ", data); + + name = part[0]; + if(name == "") throw "..."; + + for(unsigned i = 1; i < part.size(); i++) { + lstring side; + side.qsplit("=", part[i]); + if(side.size() != 2) throw "..."; + + xml_attribute *attr = new xml_attribute; + attr->name = side[0]; + attr->content = side[1]; + if(strbegin(attr->content, "\"") && strend(attr->content, "\"")) trim_once(attr->content, "\""); + else if(strbegin(attr->content, "'") && strend(attr->content, "'")) trim_once(attr->content, "'"); + else throw "..."; + attribute.add(attr); + } +} + +inline bool xml_element::parse_body(const char *&data) { + while(true) { + if(!*data) return false; + if(*data++ != '<') continue; + if(*data == '/') return false; + + if(strbegin(data, "!DOCTYPE") == true) { + parse_doctype(data); + return true; + } + + if(strbegin(data, "!--")) { + signed offset = strpos(data, "-->"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + if(strbegin(data, "![CDATA[")) { + signed offset = strpos(data, "]]>"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + signed offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + string tag = substr(data, 0, offset); + data += offset + 1; + const char *content_begin = data; + + bool self_terminating = false; + + if(strend(tag, "?") == true) { + self_terminating = true; + rtrim_once(tag, "?"); + } else if(strend(tag, "/") == true) { + self_terminating = true; + rtrim_once(tag, "/"); + } + + parse_head(tag); + if(self_terminating) return true; + + while(*data) { + unsigned index = element.size(); + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + + if(*data == '/') { + signed length = data - content_begin - 1; + if(length > 0) content = substr(content_begin, 0, length); + + data++; + offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + tag = substr(data, 0, offset); + data += offset + 1; + + tag.replace("\t", " "); + tag.replace("\r", " "); + tag.replace("\n", " "); + while(strpos(tag, " ") >= 0) tag.replace(" ", " "); + rtrim(tag); + + if(name != tag) throw "..."; + return true; + } + } else { + element.add(elem); + } + } + } +} + +inline xml_element::~xml_element() { + for(unsigned i = 0; i < attribute.size(); i++) delete attribute[i]; + for(unsigned i = 0; i < element.size(); i++) delete element[i]; +} + +//ensure there is only one root element +inline bool xml_validate(xml_element *document) { + unsigned root_counter = 0; + + for(unsigned i = 0; i < document->element.size(); i++) { + string &name = document->element[i]->name; + if(strbegin(name, "?")) continue; + if(strbegin(name, "!")) continue; + if(++root_counter > 1) return false; + } + + return true; +} + +inline xml_element* xml_parse(const char *data) { + xml_element *self = new xml_element; + + try { + while(*data) { + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + break; + } else { + self->element.add(elem); + } + } + + if(xml_validate(self) == false) throw "..."; + return self; + } catch(const char*) { + delete self; + return 0; + } +} + +} + +#endif diff --git a/src/lib/nall/traits.hpp b/bsnes/lib/nall/traits.hpp similarity index 100% rename from src/lib/nall/traits.hpp rename to bsnes/lib/nall/traits.hpp diff --git a/src/lib/nall/ups.hpp b/bsnes/lib/nall/ups.hpp similarity index 100% rename from src/lib/nall/ups.hpp rename to bsnes/lib/nall/ups.hpp diff --git a/src/lib/nall/utf8.hpp b/bsnes/lib/nall/utf8.hpp similarity index 100% rename from src/lib/nall/utf8.hpp rename to bsnes/lib/nall/utf8.hpp diff --git a/bsnes/lib/nall/utility.hpp b/bsnes/lib/nall/utility.hpp new file mode 100644 index 00000000..c15945e1 --- /dev/null +++ b/bsnes/lib/nall/utility.hpp @@ -0,0 +1,41 @@ +#ifndef NALL_UTILITY_HPP +#define NALL_UTILITY_HPP + +#include + +namespace nall { + template struct identity { + typedef T type; + }; + + template typename remove_reference::type&& move(T &&value) { + return value; + } + + template T&& forward(typename identity::type &&value) { + return value; + } + + template struct enable_if { typedef T type; }; + template struct enable_if {}; + template struct mp_enable_if : enable_if {}; + + template inline void swap(T &x, T &y) { + T temp(move(x)); + x = move(y); + y = move(temp); + } + + template struct base_from_member { + T value; + base_from_member(T value_) : value(value_) {} + }; + + template inline T* allocate(size_t size, const T &value) { + T *array = new T[size]; + for(size_t i = 0; i < size; i++) array[i] = value; + return array; + } +} + +#endif diff --git a/src/lib/nall/varint.hpp b/bsnes/lib/nall/varint.hpp similarity index 100% rename from src/lib/nall/varint.hpp rename to bsnes/lib/nall/varint.hpp diff --git a/src/lib/nall/vector.hpp b/bsnes/lib/nall/vector.hpp similarity index 66% rename from src/lib/nall/vector.hpp rename to bsnes/lib/nall/vector.hpp index aeff81c0..8885f93d 100644 --- a/src/lib/nall/vector.hpp +++ b/bsnes/lib/nall/vector.hpp @@ -1,9 +1,12 @@ #ifndef NALL_VECTOR_HPP #define NALL_VECTOR_HPP +#include #include #include #include +#include +#include #include namespace nall { @@ -19,7 +22,7 @@ namespace nall { //if objects hold memory address references to themselves (introspection), a //valid copy constructor will be needed to keep pointers valid. - template class linear_vector : noncopyable { + template class linear_vector { protected: T *pool; unsigned poolsize, objectsize; @@ -79,8 +82,43 @@ namespace nall { return pool[index]; } - linear_vector() : pool(0), poolsize(0), objectsize(0) {} - ~linear_vector() { reset(); } + //copy + inline linear_vector& operator=(const linear_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + linear_vector(const linear_vector &source) { + operator=(source); + } + + //move + inline linear_vector& operator=(linear_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + linear_vector(linear_vector &&source) { + operator=(move(source)); + } + + //construction + linear_vector() : pool(0), poolsize(0), objectsize(0) { + } + + linear_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~linear_vector() { + reset(); + } }; //pointer_vector @@ -93,7 +131,7 @@ namespace nall { //by guaranteeing that the base memory address of each objects never changes, //this avoids the need for an object to have a valid copy constructor. - template class pointer_vector : noncopyable { + template class pointer_vector { protected: T **pool; unsigned poolsize, objectsize; @@ -151,12 +189,47 @@ namespace nall { return *pool[index]; } - pointer_vector() : pool(0), poolsize(0), objectsize(0) {} - ~pointer_vector() { reset(); } + //copy + inline pointer_vector& operator=(const pointer_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + pointer_vector(const pointer_vector &source) { + operator=(source); + } + + //move + inline pointer_vector& operator=(pointer_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + pointer_vector(pointer_vector &&source) { + operator=(move(source)); + } + + //construction + pointer_vector() : pool(0), poolsize(0), objectsize(0) { + } + + pointer_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~pointer_vector() { + reset(); + } }; - //default vector type - template class vector : public linear_vector {}; + template struct has_size> { enum { value = true }; }; + template struct has_size> { enum { value = true }; }; } #endif diff --git a/src/lib/ruby/audio.hpp b/bsnes/lib/ruby/audio.hpp similarity index 100% rename from src/lib/ruby/audio.hpp rename to bsnes/lib/ruby/audio.hpp diff --git a/src/lib/ruby/audio/alsa.cpp b/bsnes/lib/ruby/audio/alsa.cpp similarity index 100% rename from src/lib/ruby/audio/alsa.cpp rename to bsnes/lib/ruby/audio/alsa.cpp diff --git a/src/lib/ruby/audio/ao.cpp b/bsnes/lib/ruby/audio/ao.cpp similarity index 100% rename from src/lib/ruby/audio/ao.cpp rename to bsnes/lib/ruby/audio/ao.cpp diff --git a/src/lib/ruby/audio/directsound.cpp b/bsnes/lib/ruby/audio/directsound.cpp similarity index 100% rename from src/lib/ruby/audio/directsound.cpp rename to bsnes/lib/ruby/audio/directsound.cpp diff --git a/src/lib/ruby/audio/openal.cpp b/bsnes/lib/ruby/audio/openal.cpp similarity index 100% rename from src/lib/ruby/audio/openal.cpp rename to bsnes/lib/ruby/audio/openal.cpp diff --git a/src/lib/ruby/audio/oss.cpp b/bsnes/lib/ruby/audio/oss.cpp similarity index 100% rename from src/lib/ruby/audio/oss.cpp rename to bsnes/lib/ruby/audio/oss.cpp diff --git a/src/lib/ruby/audio/pulseaudio.cpp b/bsnes/lib/ruby/audio/pulseaudio.cpp similarity index 100% rename from src/lib/ruby/audio/pulseaudio.cpp rename to bsnes/lib/ruby/audio/pulseaudio.cpp diff --git a/src/lib/ruby/audio/pulseaudiosimple.cpp b/bsnes/lib/ruby/audio/pulseaudiosimple.cpp similarity index 100% rename from src/lib/ruby/audio/pulseaudiosimple.cpp rename to bsnes/lib/ruby/audio/pulseaudiosimple.cpp diff --git a/src/lib/ruby/input.hpp b/bsnes/lib/ruby/input.hpp similarity index 100% rename from src/lib/ruby/input.hpp rename to bsnes/lib/ruby/input.hpp diff --git a/src/lib/ruby/input/carbon.cpp b/bsnes/lib/ruby/input/carbon.cpp similarity index 100% rename from src/lib/ruby/input/carbon.cpp rename to bsnes/lib/ruby/input/carbon.cpp diff --git a/src/lib/ruby/input/directinput.cpp b/bsnes/lib/ruby/input/directinput.cpp similarity index 100% rename from src/lib/ruby/input/directinput.cpp rename to bsnes/lib/ruby/input/directinput.cpp diff --git a/src/lib/ruby/input/rawinput.cpp b/bsnes/lib/ruby/input/rawinput.cpp similarity index 99% rename from src/lib/ruby/input/rawinput.cpp rename to bsnes/lib/ruby/input/rawinput.cpp index fa3951fe..d54826da 100644 --- a/src/lib/ruby/input/rawinput.cpp +++ b/bsnes/lib/ruby/input/rawinput.cpp @@ -236,9 +236,9 @@ public: uint16_t productId; }; - vector lkeyboard; - vector lmouse; - vector lgamepad; + linear_vector lkeyboard; + linear_vector lmouse; + linear_vector lgamepad; LRESULT window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { if(msg == WM_INPUT) { @@ -444,7 +444,7 @@ public: } }; - vector lgamepad; + linear_vector lgamepad; void poll() { if(!pXInputGetState) return; @@ -538,7 +538,7 @@ public: for(unsigned n = 0; n < 128; n++) button[n] = false; } }; - vector lgamepad; + linear_vector lgamepad; void poll() { for(unsigned i = 0; i < lgamepad.size(); i++) { diff --git a/src/lib/ruby/input/sdl.cpp b/bsnes/lib/ruby/input/sdl.cpp similarity index 100% rename from src/lib/ruby/input/sdl.cpp rename to bsnes/lib/ruby/input/sdl.cpp diff --git a/src/lib/ruby/input/x.cpp b/bsnes/lib/ruby/input/x.cpp similarity index 100% rename from src/lib/ruby/input/x.cpp rename to bsnes/lib/ruby/input/x.cpp diff --git a/src/lib/ruby/input/xlibkeys.hpp b/bsnes/lib/ruby/input/xlibkeys.hpp similarity index 100% rename from src/lib/ruby/input/xlibkeys.hpp rename to bsnes/lib/ruby/input/xlibkeys.hpp diff --git a/src/lib/ruby/ruby.cpp b/bsnes/lib/ruby/ruby.cpp similarity index 100% rename from src/lib/ruby/ruby.cpp rename to bsnes/lib/ruby/ruby.cpp diff --git a/src/lib/ruby/ruby.hpp b/bsnes/lib/ruby/ruby.hpp similarity index 100% rename from src/lib/ruby/ruby.hpp rename to bsnes/lib/ruby/ruby.hpp diff --git a/src/lib/ruby/ruby_audio.cpp b/bsnes/lib/ruby/ruby_audio.cpp similarity index 100% rename from src/lib/ruby/ruby_audio.cpp rename to bsnes/lib/ruby/ruby_audio.cpp diff --git a/src/lib/ruby/ruby_impl.cpp b/bsnes/lib/ruby/ruby_impl.cpp similarity index 100% rename from src/lib/ruby/ruby_impl.cpp rename to bsnes/lib/ruby/ruby_impl.cpp diff --git a/src/lib/ruby/video.hpp b/bsnes/lib/ruby/video.hpp similarity index 100% rename from src/lib/ruby/video.hpp rename to bsnes/lib/ruby/video.hpp diff --git a/src/lib/ruby/video/direct3d.cpp b/bsnes/lib/ruby/video/direct3d.cpp similarity index 100% rename from src/lib/ruby/video/direct3d.cpp rename to bsnes/lib/ruby/video/direct3d.cpp diff --git a/src/lib/ruby/video/directdraw.cpp b/bsnes/lib/ruby/video/directdraw.cpp similarity index 100% rename from src/lib/ruby/video/directdraw.cpp rename to bsnes/lib/ruby/video/directdraw.cpp diff --git a/src/lib/ruby/video/gdi.cpp b/bsnes/lib/ruby/video/gdi.cpp similarity index 100% rename from src/lib/ruby/video/gdi.cpp rename to bsnes/lib/ruby/video/gdi.cpp diff --git a/src/lib/ruby/video/glx.cpp b/bsnes/lib/ruby/video/glx.cpp similarity index 100% rename from src/lib/ruby/video/glx.cpp rename to bsnes/lib/ruby/video/glx.cpp diff --git a/src/lib/ruby/video/opengl.hpp b/bsnes/lib/ruby/video/opengl.hpp similarity index 97% rename from src/lib/ruby/video/opengl.hpp rename to bsnes/lib/ruby/video/opengl.hpp index 5db2fd50..4be24f06 100644 --- a/src/lib/ruby/video/opengl.hpp +++ b/bsnes/lib/ruby/video/opengl.hpp @@ -70,15 +70,15 @@ public: glUseProgram(glprogram); GLint location; - float inputSize[2] = { inwidth, inheight }; + float inputSize[2] = { (float)inwidth, (float)inheight }; location = glGetUniformLocation(glprogram, "rubyInputSize"); glUniform2fv(location, 1, inputSize); - float outputSize[2] = { outwidth, outheight }; + float outputSize[2] = { (float)outwidth, (float)outheight }; location = glGetUniformLocation(glprogram, "rubyOutputSize"); glUniform2fv(location, 1, outputSize); - float textureSize[2] = { iwidth, iheight }; + float textureSize[2] = { (float)iwidth, (float)iheight }; location = glGetUniformLocation(glprogram, "rubyTextureSize"); glUniform2fv(location, 1, textureSize); } diff --git a/src/lib/ruby/video/qtopengl.cpp b/bsnes/lib/ruby/video/qtopengl.cpp similarity index 100% rename from src/lib/ruby/video/qtopengl.cpp rename to bsnes/lib/ruby/video/qtopengl.cpp diff --git a/src/lib/ruby/video/qtraster.cpp b/bsnes/lib/ruby/video/qtraster.cpp similarity index 100% rename from src/lib/ruby/video/qtraster.cpp rename to bsnes/lib/ruby/video/qtraster.cpp diff --git a/src/lib/ruby/video/sdl.cpp b/bsnes/lib/ruby/video/sdl.cpp similarity index 100% rename from src/lib/ruby/video/sdl.cpp rename to bsnes/lib/ruby/video/sdl.cpp diff --git a/src/lib/ruby/video/wgl.cpp b/bsnes/lib/ruby/video/wgl.cpp similarity index 100% rename from src/lib/ruby/video/wgl.cpp rename to bsnes/lib/ruby/video/wgl.cpp diff --git a/src/lib/ruby/video/xv.cpp b/bsnes/lib/ruby/video/xv.cpp similarity index 100% rename from src/lib/ruby/video/xv.cpp rename to bsnes/lib/ruby/video/xv.cpp diff --git a/src/lib/sync.bat b/bsnes/lib/sync.bat similarity index 100% rename from src/lib/sync.bat rename to bsnes/lib/sync.bat diff --git a/src/lib/sync.sh b/bsnes/lib/sync.sh similarity index 100% rename from src/lib/sync.sh rename to bsnes/lib/sync.sh diff --git a/src/memory/memory-inline.hpp b/bsnes/memory/memory-inline.hpp similarity index 100% rename from src/memory/memory-inline.hpp rename to bsnes/memory/memory-inline.hpp diff --git a/src/memory/memory.cpp b/bsnes/memory/memory.cpp similarity index 97% rename from src/memory/memory.cpp rename to bsnes/memory/memory.cpp index 14dc996f..f01eff25 100644 --- a/src/memory/memory.cpp +++ b/bsnes/memory/memory.cpp @@ -73,7 +73,7 @@ void Bus::map( unsigned index = 0; switch(mode) { - case MapDirect: { + case MapMode::Direct: { for(unsigned bank = bank_lo; bank <= bank_hi; bank++) { for(unsigned page = page_lo; page <= page_hi; page++) { map((bank << 16) + (page << 8), access, (bank << 16) + (page << 8)); @@ -81,7 +81,7 @@ void Bus::map( } } break; - case MapLinear: { + case MapMode::Linear: { for(unsigned bank = bank_lo; bank <= bank_hi; bank++) { for(unsigned page = page_lo; page <= page_hi; page++) { map((bank << 16) + (page << 8), access, mirror(offset + index, access.size())); @@ -91,7 +91,7 @@ void Bus::map( } } break; - case MapShadow: { + case MapMode::Shadow: { for(unsigned bank = bank_lo; bank <= bank_hi; bank++) { index += page_lo * 256; if(size) index %= size; diff --git a/src/memory/memory.hpp b/bsnes/memory/memory.hpp similarity index 97% rename from src/memory/memory.hpp rename to bsnes/memory/memory.hpp index 745f62a5..fbf8a2d6 100644 --- a/src/memory/memory.hpp +++ b/bsnes/memory/memory.hpp @@ -68,7 +68,7 @@ struct MMIOAccess : Memory { struct Bus { unsigned mirror(unsigned addr, unsigned size); void map(unsigned addr, Memory &access, unsigned offset); - enum MapMode { MapDirect, MapLinear, MapShadow }; + enum class MapMode : unsigned { Direct, Linear, Shadow }; void map(MapMode mode, uint8 bank_lo, uint8 bank_hi, uint16 addr_lo, uint16 addr_hi, diff --git a/src/memory/smemory/serialization.cpp b/bsnes/memory/smemory/serialization.cpp similarity index 100% rename from src/memory/smemory/serialization.cpp rename to bsnes/memory/smemory/serialization.cpp diff --git a/bsnes/memory/smemory/smemory.cpp b/bsnes/memory/smemory/smemory.cpp new file mode 100644 index 00000000..01679a0f --- /dev/null +++ b/bsnes/memory/smemory/smemory.cpp @@ -0,0 +1,58 @@ +#include <../base.hpp> + +#define SMEMORY_CPP +namespace SNES { + +sBus bus; + +#include "serialization.cpp" + +void sBus::power() { + foreach(n, memory::wram) n = config.cpu.wram_init_value; +} + +void sBus::reset() { +} + +bool sBus::load_cart() { + if(cartridge.loaded() == true) return false; + + map_reset(); + map_xml(); + map_system(); + return true; +} + +void sBus::unload_cart() { +} + +void sBus::map_reset() { + map(MapMode::Direct, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); + map(MapMode::Direct, 0x00, 0x3f, 0x2000, 0x5fff, memory::mmio); + map(MapMode::Direct, 0x80, 0xbf, 0x2000, 0x5fff, memory::mmio); + for(unsigned i = 0x2000; i <= 0x5fff; i++) memory::mmio.map(i, memory::mmio_unmapped); +} + +void sBus::map_xml() { + foreach(m, cartridge.mapping) { + if(m.memory) { + map(m.mode, m.banklo, m.bankhi, m.addrlo, m.addrhi, *m.memory, m.offset, m.size); + } else if(m.mmio) { + for(unsigned i = m.addrlo; i <= m.addrhi; i++) memory::mmio.map(i, *m.mmio); + } + } +} + +void sBus::map_system() { + map(MapMode::Linear, 0x00, 0x3f, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); + map(MapMode::Linear, 0x80, 0xbf, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); + map(MapMode::Linear, 0x7e, 0x7f, 0x0000, 0xffff, memory::wram); +} + +sBus::sBus() { +} + +sBus::~sBus() { +} + +}; diff --git a/src/memory/smemory/smemory.hpp b/bsnes/memory/smemory/smemory.hpp similarity index 82% rename from src/memory/smemory/smemory.hpp rename to bsnes/memory/smemory/smemory.hpp index 5b5d1a19..47ff753e 100644 --- a/src/memory/smemory/smemory.hpp +++ b/bsnes/memory/smemory/smemory.hpp @@ -12,9 +12,8 @@ public: private: void map_reset(); + void map_xml(); void map_system(); - void map_generic(); - void map_generic_sram(); }; extern sBus bus; diff --git a/src/ppu/bppu/bppu.cpp b/bsnes/ppu/bppu/bppu.cpp similarity index 97% rename from src/ppu/bppu/bppu.cpp rename to bsnes/ppu/bppu/bppu.cpp index 17c59963..3ca0ef2e 100644 --- a/src/ppu/bppu/bppu.cpp +++ b/bsnes/ppu/bppu/bppu.cpp @@ -17,8 +17,8 @@ namespace SNES { void bPPU::enter() { while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } //H = 0 (initialize) @@ -118,7 +118,7 @@ void bPPU::power() { for(unsigned i = 0; i < memory::cgram.size(); i++) memory::cgram[i] = 0x00; flush_tiledata_cache(); - region = (system.region() == System::NTSC ? 0 : 1); //0 = NTSC, 1 = PAL + region = (system.region() == System::Region::NTSC ? 0 : 1); //0 = NTSC, 1 = PAL //$2100 regs.display_disabled = true; diff --git a/src/ppu/bppu/bppu.hpp b/bsnes/ppu/bppu/bppu.hpp similarity index 100% rename from src/ppu/bppu/bppu.hpp rename to bsnes/ppu/bppu/bppu.hpp diff --git a/src/ppu/bppu/debugger/debugger.cpp b/bsnes/ppu/bppu/debugger/debugger.cpp similarity index 94% rename from src/ppu/bppu/debugger/debugger.cpp rename to bsnes/ppu/bppu/debugger/debugger.cpp index 2d015e9f..c4272914 100644 --- a/src/ppu/bppu/debugger/debugger.cpp +++ b/bsnes/ppu/bppu/debugger/debugger.cpp @@ -4,35 +4,35 @@ uint8 bPPUDebugger::vram_mmio_read(uint16 addr) { uint8 data = bPPU::vram_mmio_read(addr); - debugger.breakpoint_test(Debugger::Breakpoint::VRAM, Debugger::Breakpoint::Read, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::VRAM, Debugger::Breakpoint::Mode::Read, addr, data); return data; } void bPPUDebugger::vram_mmio_write(uint16 addr, uint8 data) { bPPU::vram_mmio_write(addr, data); - debugger.breakpoint_test(Debugger::Breakpoint::VRAM, Debugger::Breakpoint::Write, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::VRAM, Debugger::Breakpoint::Mode::Write, addr, data); } uint8 bPPUDebugger::oam_mmio_read(uint16 addr) { uint8 data = bPPU::oam_mmio_read(addr); - debugger.breakpoint_test(Debugger::Breakpoint::OAM, Debugger::Breakpoint::Read, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::OAM, Debugger::Breakpoint::Mode::Read, addr, data); return data; } void bPPUDebugger::oam_mmio_write(uint16 addr, uint8 data) { bPPU::oam_mmio_write(addr, data); - debugger.breakpoint_test(Debugger::Breakpoint::OAM, Debugger::Breakpoint::Write, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::OAM, Debugger::Breakpoint::Mode::Write, addr, data); } uint8 bPPUDebugger::cgram_mmio_read(uint16 addr) { uint8 data = bPPU::cgram_mmio_read(addr); - debugger.breakpoint_test(Debugger::Breakpoint::CGRAM, Debugger::Breakpoint::Read, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::CGRAM, Debugger::Breakpoint::Mode::Read, addr, data); return data; } void bPPUDebugger::cgram_mmio_write(uint16 addr, uint8 data) { bPPU::cgram_mmio_write(addr, data); - debugger.breakpoint_test(Debugger::Breakpoint::CGRAM, Debugger::Breakpoint::Write, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::CGRAM, Debugger::Breakpoint::Mode::Write, addr, data); } bPPUDebugger::bPPUDebugger() { diff --git a/src/ppu/bppu/debugger/debugger.hpp b/bsnes/ppu/bppu/debugger/debugger.hpp similarity index 100% rename from src/ppu/bppu/debugger/debugger.hpp rename to bsnes/ppu/bppu/debugger/debugger.hpp diff --git a/src/ppu/bppu/debugger/render.cpp b/bsnes/ppu/bppu/debugger/render.cpp similarity index 100% rename from src/ppu/bppu/debugger/render.cpp rename to bsnes/ppu/bppu/debugger/render.cpp diff --git a/src/ppu/bppu/memory/memory.cpp b/bsnes/ppu/bppu/memory/memory.cpp similarity index 98% rename from src/ppu/bppu/memory/memory.cpp rename to bsnes/ppu/bppu/memory/memory.cpp index 36becbc9..4ed8ca3f 100644 --- a/src/ppu/bppu/memory/memory.cpp +++ b/bsnes/ppu/bppu/memory/memory.cpp @@ -30,7 +30,7 @@ uint8 bPPU::vram_mmio_read(uint16 addr) { } else { uint16 v = cpu.vcounter(); uint16 h = cpu.hcounter(); - uint16 ls = ((system.region() == System::NTSC ? 525 : 625) >> 1) - 1; + uint16 ls = ((system.region() == System::Region::NTSC ? 525 : 625) >> 1) - 1; if(interlace() && !cpu.field()) ls++; if(v == ls && h == 1362) { diff --git a/src/ppu/bppu/memory/memory.hpp b/bsnes/ppu/bppu/memory/memory.hpp similarity index 100% rename from src/ppu/bppu/memory/memory.hpp rename to bsnes/ppu/bppu/memory/memory.hpp diff --git a/src/ppu/bppu/mmio/mmio.cpp b/bsnes/ppu/bppu/mmio/mmio.cpp similarity index 100% rename from src/ppu/bppu/mmio/mmio.cpp rename to bsnes/ppu/bppu/mmio/mmio.cpp diff --git a/src/ppu/bppu/mmio/mmio.hpp b/bsnes/ppu/bppu/mmio/mmio.hpp similarity index 100% rename from src/ppu/bppu/mmio/mmio.hpp rename to bsnes/ppu/bppu/mmio/mmio.hpp diff --git a/src/ppu/bppu/render/addsub.cpp b/bsnes/ppu/bppu/render/addsub.cpp similarity index 100% rename from src/ppu/bppu/render/addsub.cpp rename to bsnes/ppu/bppu/render/addsub.cpp diff --git a/src/ppu/bppu/render/bg.cpp b/bsnes/ppu/bppu/render/bg.cpp similarity index 100% rename from src/ppu/bppu/render/bg.cpp rename to bsnes/ppu/bppu/render/bg.cpp diff --git a/src/ppu/bppu/render/cache.cpp b/bsnes/ppu/bppu/render/cache.cpp similarity index 100% rename from src/ppu/bppu/render/cache.cpp rename to bsnes/ppu/bppu/render/cache.cpp diff --git a/src/ppu/bppu/render/line.cpp b/bsnes/ppu/bppu/render/line.cpp similarity index 100% rename from src/ppu/bppu/render/line.cpp rename to bsnes/ppu/bppu/render/line.cpp diff --git a/src/ppu/bppu/render/mode7.cpp b/bsnes/ppu/bppu/render/mode7.cpp similarity index 100% rename from src/ppu/bppu/render/mode7.cpp rename to bsnes/ppu/bppu/render/mode7.cpp diff --git a/src/ppu/bppu/render/oam.cpp b/bsnes/ppu/bppu/render/oam.cpp similarity index 98% rename from src/ppu/bppu/render/oam.cpp rename to bsnes/ppu/bppu/render/oam.cpp index 59c7845d..b6c9336d 100644 --- a/src/ppu/bppu/render/oam.cpp +++ b/bsnes/ppu/bppu/render/oam.cpp @@ -106,7 +106,7 @@ void bPPU::load_oam_tiles() { //ignore sprites that are offscreen, x==256 is a special case that loads all tiles in OBJ if(x != 256 && sx >= 256 && (sx + 7) < 512) continue; - if(regs.oam_tilecount++ > 34) break; + if(regs.oam_tilecount++ >= 34) break; unsigned n = regs.oam_tilecount - 1; oam_tilelist[n].x = sx; oam_tilelist[n].y = y; @@ -157,7 +157,7 @@ void bPPU::render_line_oam_rto() { for(int s = 0; s < 128; s++) { active_sprite = (s + regs.oam_firstsprite) & 127; if(is_sprite_on_scanline() == false) continue; - if(regs.oam_itemcount++ > 32) break; + if(regs.oam_itemcount++ >= 32) break; oam_itemlist[regs.oam_itemcount - 1] = (s + regs.oam_firstsprite) & 127; } diff --git a/src/ppu/bppu/render/render.cpp b/bsnes/ppu/bppu/render/render.cpp similarity index 100% rename from src/ppu/bppu/render/render.cpp rename to bsnes/ppu/bppu/render/render.cpp diff --git a/src/ppu/bppu/render/render.hpp b/bsnes/ppu/bppu/render/render.hpp similarity index 100% rename from src/ppu/bppu/render/render.hpp rename to bsnes/ppu/bppu/render/render.hpp diff --git a/src/ppu/bppu/render/windows.cpp b/bsnes/ppu/bppu/render/windows.cpp similarity index 100% rename from src/ppu/bppu/render/windows.cpp rename to bsnes/ppu/bppu/render/windows.cpp diff --git a/src/ppu/bppu/serialization.cpp b/bsnes/ppu/bppu/serialization.cpp similarity index 100% rename from src/ppu/bppu/serialization.cpp rename to bsnes/ppu/bppu/serialization.cpp diff --git a/src/ppu/ppu-debugger.cpp b/bsnes/ppu/ppu-debugger.cpp similarity index 90% rename from src/ppu/ppu-debugger.cpp rename to bsnes/ppu/ppu-debugger.cpp index df06f222..ba54baaa 100644 --- a/src/ppu/ppu-debugger.cpp +++ b/bsnes/ppu/ppu-debugger.cpp @@ -4,8 +4,8 @@ bool PPUDebugger::property(unsigned id, string &name, string &value) { unsigned n = 0; //internal - if(id == n++) { name = "S-PPU1 MDR"; value = string::printf("0x%.2x", ppu1_mdr()); return true; } - if(id == n++) { name = "S-PPU2 MDR"; value = string::printf("0x%.2x", ppu2_mdr()); return true; } + if(id == n++) { name = "S-PPU1 MDR"; value = sprint("0x$", strhex<2>(ppu1_mdr())); return true; } + if(id == n++) { name = "S-PPU2 MDR"; value = sprint("0x$", strhex<2>(ppu2_mdr())); return true; } //$2100 if(id == n++) { name = "$2100"; value = ""; return true; } @@ -16,11 +16,11 @@ bool PPUDebugger::property(unsigned id, string &name, string &value) { if(id == n++) { name = "$2101"; value = ""; return true; } if(id == n++) { name = "OAM Base Size"; value = oam_base_size(); return true; } if(id == n++) { name = "OAM Name Select"; value = oam_name_select(); return true; } - if(id == n++) { name = "OAM Name Base Address"; value = string::printf("0x%.4x", oam_name_base_address()); return true; } + if(id == n++) { name = "OAM Name Base Address"; value = sprint("0x$", strhex<4>(oam_name_base_address())); return true; } //$2102-$2103 if(id == n++) { name = "$2102-$2103"; value = ""; return true; } - if(id == n++) { name = "OAM Base Address"; value = string::printf("0x%.4x", oam_base_address()); return true; } + if(id == n++) { name = "OAM Base Address"; value = sprint("0x$", strhex<4>(oam_base_address())); return true; } if(id == n++) { name = "OAM Priority"; value = oam_priority(); return true; } //$2105 @@ -44,33 +44,33 @@ bool PPUDebugger::property(unsigned id, string &name, string &value) { //$2107 if(id == n++) { name = "$2107"; value = ""; return true; } - if(id == n++) { name = "BG1 Screen Address"; value = string::printf("0x%.4x", bg1_screen_address()); return true; } + if(id == n++) { name = "BG1 Screen Address"; value = sprint("0x$", strhex<4>(bg1_screen_address())); return true; } if(id == n++) { name = "BG1 Screen Size"; value = screen_size[bg1_screen_size()]; return true; } //$2108 if(id == n++) { name = "$2108"; value = ""; return true; } - if(id == n++) { name = "BG2 Screen Address"; value = string::printf("0x%.4x", bg2_screen_address()); return true; } + if(id == n++) { name = "BG2 Screen Address"; value = sprint("0x$", strhex<4>(bg2_screen_address())); return true; } if(id == n++) { name = "BG2 Screen Size"; value = screen_size[bg2_screen_size()]; return true; } //$2109 if(id == n++) { name = "$2109"; value = ""; return true; } - if(id == n++) { name = "BG3 Screen Address"; value = string::printf("0x%.4x", bg3_screen_address()); return true; } + if(id == n++) { name = "BG3 Screen Address"; value = sprint("0x$", strhex<4>(bg3_screen_address())); return true; } if(id == n++) { name = "BG3 Screen Size"; value = screen_size[bg3_screen_size()]; return true; } //$210a if(id == n++) { name = "$210a"; value = ""; return true; } - if(id == n++) { name = "BG4 Screen Address"; value = string::printf("0x%.4x", bg4_screen_address()); return true; } + if(id == n++) { name = "BG4 Screen Address"; value = sprint("0x$", strhex<4>(bg4_screen_address())); return true; } if(id == n++) { name = "BG4 Screen Size"; value = screen_size[bg4_screen_size()]; return true; } //$210b if(id == n++) { name = "$210b"; value = ""; return true; } - if(id == n++) { name = "BG1 Name Base Address"; value = string::printf("0x%.4x", bg1_name_base_address()); return true; } - if(id == n++) { name = "BG2 Name Base Address"; value = string::printf("0x%.4x", bg2_name_base_address()); return true; } + if(id == n++) { name = "BG1 Name Base Address"; value = sprint("0x$", strhex<4>(bg1_name_base_address())); return true; } + if(id == n++) { name = "BG2 Name Base Address"; value = sprint("0x$", strhex<4>(bg2_name_base_address())); return true; } //$210c if(id == n++) { name = "$210c"; value = ""; return true; } - if(id == n++) { name = "BG3 Name Base Address"; value = string::printf("0x%.4x", bg3_name_base_address()); return true; } - if(id == n++) { name = "BG4 Name Base Address"; value = string::printf("0x%.4x", bg4_name_base_address()); return true; } + if(id == n++) { name = "BG3 Name Base Address"; value = sprint("0x$", strhex<4>(bg3_name_base_address())); return true; } + if(id == n++) { name = "BG4 Name Base Address"; value = sprint("0x$", strhex<4>(bg4_name_base_address())); return true; } //$210d if(id == n++) { name = "$210d"; value = ""; return true; } @@ -114,7 +114,7 @@ bool PPUDebugger::property(unsigned id, string &name, string &value) { //$2116-$2117 if(id == n++) { name = "$2116-$2117"; value = ""; return true; } - if(id == n++) { name = "VRAM Address"; value = string::printf("0x%.4x", vram_address()); return true; } + if(id == n++) { name = "VRAM Address"; value = sprint("0x$", strhex<4>(vram_address())); return true; } //$211a if(id == n++) { name = "$211a"; value = ""; return true; } @@ -148,7 +148,7 @@ bool PPUDebugger::property(unsigned id, string &name, string &value) { //$2121 if(id == n++) { name = "$2121"; value = ""; return true; } - if(id == n++) { name = "CGRAM Address"; value = string::printf("0x%.4x", cgram_address()); return true; } + if(id == n++) { name = "CGRAM Address"; value = sprint("0x$", strhex<4>(cgram_address())); return true; } //$2123 if(id == n++) { name = "$2123"; value = ""; return true; } diff --git a/src/ppu/ppu-debugger.hpp b/bsnes/ppu/ppu-debugger.hpp similarity index 100% rename from src/ppu/ppu-debugger.hpp rename to bsnes/ppu/ppu-debugger.hpp diff --git a/src/ppu/ppu-inline.hpp b/bsnes/ppu/ppu-inline.hpp similarity index 72% rename from src/ppu/ppu-inline.hpp rename to bsnes/ppu/ppu-inline.hpp index 489b429e..2c21b6d1 100644 --- a/src/ppu/ppu-inline.hpp +++ b/bsnes/ppu/ppu-inline.hpp @@ -27,12 +27,12 @@ void PPUcounter::tick(unsigned clocks) { void PPUcounter::vcounter_tick() { if(++status.vcounter == 128) status.interlace = ppu.interlace(); - if((system.region() == System::NTSC && status.interlace == false && status.vcounter == 262) - || (system.region() == System::NTSC && status.interlace == true && status.vcounter == 263) - || (system.region() == System::NTSC && status.interlace == true && status.vcounter == 262 && status.field == 1) - || (system.region() == System::PAL && status.interlace == false && status.vcounter == 312) - || (system.region() == System::PAL && status.interlace == true && status.vcounter == 313) - || (system.region() == System::PAL && status.interlace == true && status.vcounter == 312 && status.field == 1) + if((system.region() == System::Region::NTSC && status.interlace == false && status.vcounter == 262) + || (system.region() == System::Region::NTSC && status.interlace == true && status.vcounter == 263) + || (system.region() == System::Region::NTSC && status.interlace == true && status.vcounter == 262 && status.field == 1) + || (system.region() == System::Region::PAL && status.interlace == false && status.vcounter == 312) + || (system.region() == System::Region::PAL && status.interlace == true && status.vcounter == 313) + || (system.region() == System::Region::PAL && status.interlace == true && status.vcounter == 312 && status.field == 1) ) { status.vcounter = 0; status.field = !status.field; @@ -58,7 +58,7 @@ uint16 PPUcounter::hcounter(unsigned offset) const { return history.hcounter[(hi //dot 327 range = { 1310, 1312, 1314 } uint16 PPUcounter::hdot() const { - if(system.region() == System::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) { + if(system.region() == System::Region::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) { return (hcounter() >> 2); } else { return (hcounter() - ((hcounter() > 1292) << 1) - ((hcounter() > 1310) << 1)) >> 2; @@ -66,7 +66,7 @@ uint16 PPUcounter::hdot() const { } uint16 PPUcounter::lineclocks() const { - if(system.region() == System::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) return 1360; + if(system.region() == System::Region::NTSC && status.interlace == false && vcounter() == 240 && field() == 1) return 1360; return 1364; } diff --git a/src/ppu/ppu.cpp b/bsnes/ppu/ppu.cpp similarity index 100% rename from src/ppu/ppu.cpp rename to bsnes/ppu/ppu.cpp diff --git a/src/ppu/ppu.hpp b/bsnes/ppu/ppu.hpp similarity index 100% rename from src/ppu/ppu.hpp rename to bsnes/ppu/ppu.hpp diff --git a/src/ppu/serialization.cpp b/bsnes/ppu/serialization.cpp similarity index 100% rename from src/ppu/serialization.cpp rename to bsnes/ppu/serialization.cpp diff --git a/src/smp/core/algorithms.cpp b/bsnes/smp/core/algorithms.cpp similarity index 100% rename from src/smp/core/algorithms.cpp rename to bsnes/smp/core/algorithms.cpp diff --git a/src/smp/core/core.cpp b/bsnes/smp/core/core.cpp similarity index 100% rename from src/smp/core/core.cpp rename to bsnes/smp/core/core.cpp diff --git a/src/smp/core/core.hpp b/bsnes/smp/core/core.hpp similarity index 100% rename from src/smp/core/core.hpp rename to bsnes/smp/core/core.hpp diff --git a/src/smp/core/disassembler/disassembler.cpp b/bsnes/smp/core/disassembler/disassembler.cpp similarity index 88% rename from src/smp/core/disassembler/disassembler.cpp rename to bsnes/smp/core/disassembler/disassembler.cpp index f636144a..ee5663a3 100644 --- a/src/smp/core/disassembler/disassembler.cpp +++ b/bsnes/smp/core/disassembler/disassembler.cpp @@ -1,6 +1,18 @@ #ifdef SMPCORE_CPP -uint16 SMPcore::__relb(int8 offset, int op_len) { +uint8 SMPcore::disassemble_read(uint16 addr) { + if(addr >= 0xffc0) { + #if defined(DEBUGGER) + if(smp.iplrom_enable()) return smp.iplrom[addr & 0x3f]; + #else + //unable to determine if IPLROM is enabled, assume that it is + return smp.iplrom[addr & 0x3f]; + #endif + } + return memory::apuram[addr]; +} + +uint16 SMPcore::relb(int8 offset, int op_len) { uint16 pc = regs.pc + op_len; return pc + offset; } @@ -13,10 +25,9 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { sprintf(s, "..%.4x ", addr); - //TODO: read from IPLROM when applicable - op = memory::apuram[(uint16)(addr + 0)]; - op0 = memory::apuram[(uint16)(addr + 1)]; - op1 = memory::apuram[(uint16)(addr + 2)]; + op = disassemble_read(addr + 0); + op0 = disassemble_read(addr + 1); + op1 = disassemble_read(addr + 2); opw = (op0) | (op1 << 8); opdp0 = ((unsigned)regs.p.p << 8) + op0; opdp1 = ((unsigned)regs.p.p << 8) + op1; @@ -27,7 +38,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x00: sprintf(t, "nop"); break; case 0x01: sprintf(t, "tcall 0"); break; case 0x02: sprintf(t, "set0 $%.3x", opdp0); break; - case 0x03: sprintf(t, "bbs0 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x03: sprintf(t, "bbs0 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x04: sprintf(t, "or a,$%.3x", opdp0); break; case 0x05: sprintf(t, "or a,$%.4x", opw); break; case 0x06: sprintf(t, "or a,(x)"); break; @@ -40,10 +51,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x0d: sprintf(t, "push p"); break; case 0x0e: sprintf(t, "tset $%.4x,a", opw); break; case 0x0f: sprintf(t, "brk"); break; - case 0x10: sprintf(t, "bpl $%.4x", __relb(op0, 2)); break; + case 0x10: sprintf(t, "bpl $%.4x", relb(op0, 2)); break; case 0x11: sprintf(t, "tcall 1"); break; case 0x12: sprintf(t, "clr0 $%.3x", opdp0); break; - case 0x13: sprintf(t, "bbc0 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x13: sprintf(t, "bbc0 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x14: sprintf(t, "or a,$%.3x+x", opdp0); break; case 0x15: sprintf(t, "or a,$%.4x+x", opw); break; case 0x16: sprintf(t, "or a,$%.4x+y", opw); break; @@ -59,7 +70,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x20: sprintf(t, "clrp"); break; case 0x21: sprintf(t, "tcall 2"); break; case 0x22: sprintf(t, "set1 $%.3x", opdp0); break; - case 0x23: sprintf(t, "bbs1 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x23: sprintf(t, "bbs1 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x24: sprintf(t, "and a,$%.3x", opdp0); break; case 0x25: sprintf(t, "and a,$%.4x", opw); break; case 0x26: sprintf(t, "and a,(x)"); break; @@ -70,12 +81,12 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x2b: sprintf(t, "rol $%.3x", opdp0); break; case 0x2c: sprintf(t, "rol $%.4x", opw); break; case 0x2d: sprintf(t, "push a"); break; - case 0x2e: sprintf(t, "cbne $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; - case 0x2f: sprintf(t, "bra $%.4x", __relb(op0, 2)); break; - case 0x30: sprintf(t, "bmi $%.4x", __relb(op0, 2)); break; + case 0x2e: sprintf(t, "cbne $%.3x,$%.4x", opdp0, relb(op1, 3)); break; + case 0x2f: sprintf(t, "bra $%.4x", relb(op0, 2)); break; + case 0x30: sprintf(t, "bmi $%.4x", relb(op0, 2)); break; case 0x31: sprintf(t, "tcall 3"); break; case 0x32: sprintf(t, "clr1 $%.3x", opdp0); break; - case 0x33: sprintf(t, "bbc1 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x33: sprintf(t, "bbc1 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x34: sprintf(t, "and a,$%.3x+x", opdp0); break; case 0x35: sprintf(t, "and a,$%.4x+x", opw); break; case 0x36: sprintf(t, "and a,$%.4x+y", opw); break; @@ -91,7 +102,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x40: sprintf(t, "setp"); break; case 0x41: sprintf(t, "tcall 4"); break; case 0x42: sprintf(t, "set2 $%.3x", opdp0); break; - case 0x43: sprintf(t, "bbs2 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x43: sprintf(t, "bbs2 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x44: sprintf(t, "eor a,$%.3x", opdp0); break; case 0x45: sprintf(t, "eor a,$%.4x", opw); break; case 0x46: sprintf(t, "eor a,(x)"); break; @@ -104,10 +115,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x4d: sprintf(t, "push x"); break; case 0x4e: sprintf(t, "tclr $%.4x,a", opw); break; case 0x4f: sprintf(t, "pcall $ff%.2x", op0); break; - case 0x50: sprintf(t, "bvc $%.4x", __relb(op0, 2)); break; + case 0x50: sprintf(t, "bvc $%.4x", relb(op0, 2)); break; case 0x51: sprintf(t, "tcall 5"); break; case 0x52: sprintf(t, "clr2 $%.3x", opdp0); break; - case 0x53: sprintf(t, "bbc2 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x53: sprintf(t, "bbc2 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x54: sprintf(t, "eor a,$%.3x+x", opdp0); break; case 0x55: sprintf(t, "eor a,$%.4x+x", opw); break; case 0x56: sprintf(t, "eor a,$%.4x+y", opw); break; @@ -123,7 +134,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x60: sprintf(t, "clrc"); break; case 0x61: sprintf(t, "tcall 6"); break; case 0x62: sprintf(t, "set3 $%.3x", opdp0); break; - case 0x63: sprintf(t, "bbs3 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x63: sprintf(t, "bbs3 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x64: sprintf(t, "cmp a,$%.3x", opdp0); break; case 0x65: sprintf(t, "cmp a,$%.4x", opw); break; case 0x66: sprintf(t, "cmp a,(x)"); break; @@ -134,12 +145,12 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x6b: sprintf(t, "ror $%.3x", opdp0); break; case 0x6c: sprintf(t, "ror $%.4x", opw); break; case 0x6d: sprintf(t, "push y"); break; - case 0x6e: sprintf(t, "dbnz $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x6e: sprintf(t, "dbnz $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x6f: sprintf(t, "ret"); break; - case 0x70: sprintf(t, "bvs $%.4x", __relb(op0, 2)); break; + case 0x70: sprintf(t, "bvs $%.4x", relb(op0, 2)); break; case 0x71: sprintf(t, "tcall 7"); break; case 0x72: sprintf(t, "clr3 $%.3x", opdp0); break; - case 0x73: sprintf(t, "bbc3 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x73: sprintf(t, "bbc3 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x74: sprintf(t, "cmp a,$%.3x+x", opdp0); break; case 0x75: sprintf(t, "cmp a,$%.4x+x", opw); break; case 0x76: sprintf(t, "cmp a,$%.4x+y", opw); break; @@ -155,7 +166,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x80: sprintf(t, "setc"); break; case 0x81: sprintf(t, "tcall 8"); break; case 0x82: sprintf(t, "set4 $%.3x", opdp0); break; - case 0x83: sprintf(t, "bbs4 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x83: sprintf(t, "bbs4 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x84: sprintf(t, "adc a,$%.3x", opdp0); break; case 0x85: sprintf(t, "adc a,$%.4x", opw); break; case 0x86: sprintf(t, "adc a,(x)"); break; @@ -168,10 +179,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0x8d: sprintf(t, "mov y,#$%.2x", op0); break; case 0x8e: sprintf(t, "pop p"); break; case 0x8f: sprintf(t, "mov $%.3x,#$%.2x", opdp1, op0); break; - case 0x90: sprintf(t, "bcc $%.4x", __relb(op0, 2)); break; + case 0x90: sprintf(t, "bcc $%.4x", relb(op0, 2)); break; case 0x91: sprintf(t, "tcall 9"); break; case 0x92: sprintf(t, "clr4 $%.3x", opdp0); break; - case 0x93: sprintf(t, "bbc4 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0x93: sprintf(t, "bbc4 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0x94: sprintf(t, "adc a,$%.3x+x", opdp0); break; case 0x95: sprintf(t, "adc a,$%.4x+x", opw); break; case 0x96: sprintf(t, "adc a,$%.4x+y", opw); break; @@ -187,7 +198,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xa0: sprintf(t, "ei"); break; case 0xa1: sprintf(t, "tcall 10"); break; case 0xa2: sprintf(t, "set5 $%.3x", opdp0); break; - case 0xa3: sprintf(t, "bbs5 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xa3: sprintf(t, "bbs5 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xa4: sprintf(t, "sbc a,$%.3x", opdp0); break; case 0xa5: sprintf(t, "sbc a,$%.4x", opw); break; case 0xa6: sprintf(t, "sbc a,(x)"); break; @@ -200,10 +211,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xad: sprintf(t, "cmp y,#$%.2x", op0); break; case 0xae: sprintf(t, "pop a"); break; case 0xaf: sprintf(t, "mov (x)+,a"); break; - case 0xb0: sprintf(t, "bcs $%.4x", __relb(op0, 2)); break; + case 0xb0: sprintf(t, "bcs $%.4x", relb(op0, 2)); break; case 0xb1: sprintf(t, "tcall 11"); break; case 0xb2: sprintf(t, "clr5 $%.3x", opdp0); break; - case 0xb3: sprintf(t, "bbc5 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xb3: sprintf(t, "bbc5 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xb4: sprintf(t, "sbc a,$%.3x+x", opdp0); break; case 0xb5: sprintf(t, "sbc a,$%.4x+x", opw); break; case 0xb6: sprintf(t, "sbc a,$%.4x+y", opw); break; @@ -219,7 +230,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xc0: sprintf(t, "di"); break; case 0xc1: sprintf(t, "tcall 12"); break; case 0xc2: sprintf(t, "set6 $%.3x", opdp0); break; - case 0xc3: sprintf(t, "bbs6 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xc3: sprintf(t, "bbs6 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xc4: sprintf(t, "mov $%.3x,a", opdp0); break; case 0xc5: sprintf(t, "mov $%.4x,a", opw); break; case 0xc6: sprintf(t, "mov (x),a"); break; @@ -232,10 +243,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xcd: sprintf(t, "mov x,#$%.2x", op0); break; case 0xce: sprintf(t, "pop x"); break; case 0xcf: sprintf(t, "mul ya"); break; - case 0xd0: sprintf(t, "bne $%.4x", __relb(op0, 2)); break; + case 0xd0: sprintf(t, "bne $%.4x", relb(op0, 2)); break; case 0xd1: sprintf(t, "tcall 13"); break; case 0xd2: sprintf(t, "clr6 $%.3x", opdp0); break; - case 0xd3: sprintf(t, "bbc6 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xd3: sprintf(t, "bbc6 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xd4: sprintf(t, "mov $%.3x+x,a", opdp0); break; case 0xd5: sprintf(t, "mov $%.4x+x,a", opw); break; case 0xd6: sprintf(t, "mov $%.4x+y,a", opw); break; @@ -246,12 +257,12 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xdb: sprintf(t, "mov $%.3x+x,y", opdp0); break; case 0xdc: sprintf(t, "dec y"); break; case 0xdd: sprintf(t, "mov a,y"); break; - case 0xde: sprintf(t, "cbne $%.3x+x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xde: sprintf(t, "cbne $%.3x+x,$%.4x", opdp0, relb(op1, 3)); break; case 0xdf: sprintf(t, "daa a"); break; case 0xe0: sprintf(t, "clrv"); break; case 0xe1: sprintf(t, "tcall 14"); break; case 0xe2: sprintf(t, "set7 $%.3x", opdp0); break; - case 0xe3: sprintf(t, "bbs7 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xe3: sprintf(t, "bbs7 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xe4: sprintf(t, "mov a,$%.3x", opdp0); break; case 0xe5: sprintf(t, "mov a,$%.4x", opw); break; case 0xe6: sprintf(t, "mov a,(x)"); break; @@ -264,10 +275,10 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xed: sprintf(t, "notc"); break; case 0xee: sprintf(t, "pop y"); break; case 0xef: sprintf(t, "sleep"); break; - case 0xf0: sprintf(t, "beq $%.4x", __relb(op0, 2)); break; + case 0xf0: sprintf(t, "beq $%.4x", relb(op0, 2)); break; case 0xf1: sprintf(t, "tcall 15"); break; case 0xf2: sprintf(t, "clr7 $%.3x", opdp0); break; - case 0xf3: sprintf(t, "bbc7 $%.3x,$%.4x", opdp0, __relb(op1, 3)); break; + case 0xf3: sprintf(t, "bbc7 $%.3x,$%.4x", opdp0, relb(op1, 3)); break; case 0xf4: sprintf(t, "mov a,$%.3x+x", opdp0); break; case 0xf5: sprintf(t, "mov a,$%.4x+x", opw); break; case 0xf6: sprintf(t, "mov a,$%.4x+y", opw); break; @@ -278,7 +289,7 @@ void SMPcore::disassemble_opcode(char *output, uint16 addr) { case 0xfb: sprintf(t, "mov y,$%.3x+x", opdp0); break; case 0xfc: sprintf(t, "inc y"); break; case 0xfd: sprintf(t, "mov y,a"); break; - case 0xfe: sprintf(t, "dbnz y,$%.4x", __relb(op0, 2)); break; + case 0xfe: sprintf(t, "dbnz y,$%.4x", relb(op0, 2)); break; case 0xff: sprintf(t, "stop"); break; } diff --git a/bsnes/smp/core/disassembler/disassembler.hpp b/bsnes/smp/core/disassembler/disassembler.hpp new file mode 100644 index 00000000..a6e78e09 --- /dev/null +++ b/bsnes/smp/core/disassembler/disassembler.hpp @@ -0,0 +1,3 @@ +void disassemble_opcode(char *output, uint16 addr); +inline uint8 disassemble_read(uint16 addr); +inline uint16 relb(int8 offset, int op_len); diff --git a/src/smp/core/memory.hpp b/bsnes/smp/core/memory.hpp similarity index 100% rename from src/smp/core/memory.hpp rename to bsnes/smp/core/memory.hpp diff --git a/src/smp/core/opcode_misc.cpp b/bsnes/smp/core/opcode_misc.cpp similarity index 100% rename from src/smp/core/opcode_misc.cpp rename to bsnes/smp/core/opcode_misc.cpp diff --git a/src/smp/core/opcode_mov.cpp b/bsnes/smp/core/opcode_mov.cpp similarity index 100% rename from src/smp/core/opcode_mov.cpp rename to bsnes/smp/core/opcode_mov.cpp diff --git a/src/smp/core/opcode_pc.cpp b/bsnes/smp/core/opcode_pc.cpp similarity index 100% rename from src/smp/core/opcode_pc.cpp rename to bsnes/smp/core/opcode_pc.cpp diff --git a/src/smp/core/opcode_read.cpp b/bsnes/smp/core/opcode_read.cpp similarity index 100% rename from src/smp/core/opcode_read.cpp rename to bsnes/smp/core/opcode_read.cpp diff --git a/src/smp/core/opcode_rmw.cpp b/bsnes/smp/core/opcode_rmw.cpp similarity index 100% rename from src/smp/core/opcode_rmw.cpp rename to bsnes/smp/core/opcode_rmw.cpp diff --git a/src/smp/core/registers.hpp b/bsnes/smp/core/registers.hpp similarity index 100% rename from src/smp/core/registers.hpp rename to bsnes/smp/core/registers.hpp diff --git a/src/smp/core/serialization.cpp b/bsnes/smp/core/serialization.cpp similarity index 100% rename from src/smp/core/serialization.cpp rename to bsnes/smp/core/serialization.cpp diff --git a/src/smp/core/table.cpp b/bsnes/smp/core/table.cpp similarity index 100% rename from src/smp/core/table.cpp rename to bsnes/smp/core/table.cpp diff --git a/src/smp/smp-debugger.cpp b/bsnes/smp/smp-debugger.cpp similarity index 86% rename from src/smp/smp-debugger.cpp rename to bsnes/smp/smp-debugger.cpp index 8ba9f7dc..44ef4a77 100644 --- a/src/smp/smp-debugger.cpp +++ b/bsnes/smp/smp-debugger.cpp @@ -15,7 +15,7 @@ bool SMPDebugger::property(unsigned id, string &name, string &value) { //$00f2 if(id == n++) { name = "$00f2"; value = ""; return true; } - if(id == n++) { name = "DSP Address"; value = string::printf("0x%.2x", dsp_address()); return true; } + if(id == n++) { name = "DSP Address"; value = sprint("0x$", strhex<2>(dsp_address())); return true; } return false; } diff --git a/src/smp/smp-debugger.hpp b/bsnes/smp/smp-debugger.hpp similarity index 100% rename from src/smp/smp-debugger.hpp rename to bsnes/smp/smp-debugger.hpp diff --git a/src/smp/smp.cpp b/bsnes/smp/smp.cpp similarity index 98% rename from src/smp/smp.cpp rename to bsnes/smp/smp.cpp index 815b2a40..dda432fa 100644 --- a/src/smp/smp.cpp +++ b/bsnes/smp/smp.cpp @@ -12,7 +12,7 @@ namespace SNES { //all writes are instead mapped to the extended //RAM region, accessible when $f1.d7 is clear. -const uint8_t SMP::iplrom[64] = { +const uint8 SMP::iplrom[64] = { /*ffc0*/ 0xcd, 0xef, //mov x,#$ef /*ffc2*/ 0xbd, //mov sp,x /*ffc3*/ 0xe8, 0x00, //mov a,#$00 diff --git a/src/smp/smp.hpp b/bsnes/smp/smp.hpp similarity index 92% rename from src/smp/smp.hpp rename to bsnes/smp/smp.hpp index 5d2223bf..60195723 100644 --- a/src/smp/smp.hpp +++ b/bsnes/smp/smp.hpp @@ -5,7 +5,7 @@ class SMP { public: virtual void enter() = 0; - static const uint8_t iplrom[64]; + static const uint8 iplrom[64]; virtual uint8 ram_read(uint16 addr) = 0; virtual void ram_write(uint16 addr, uint8 value) = 0; diff --git a/src/smp/ssmp/debugger/debugger.cpp b/bsnes/smp/ssmp/debugger/debugger.cpp similarity index 70% rename from src/smp/ssmp/debugger/debugger.cpp rename to bsnes/smp/ssmp/debugger/debugger.cpp index 74f03a5f..513eb097 100644 --- a/src/smp/ssmp/debugger/debugger.cpp +++ b/bsnes/smp/ssmp/debugger/debugger.cpp @@ -7,10 +7,10 @@ void sSMPDebugger::op_step() { opcode_pc = regs.pc; if(debugger.step_smp) { - debugger.break_event = Debugger::SMPStep; - scheduler.exit(Scheduler::DebuggerEvent); + debugger.break_event = Debugger::BreakEvent::SMPStep; + scheduler.exit(Scheduler::ExitReason::DebuggerEvent); } else { - debugger.breakpoint_test(Debugger::Breakpoint::APURAM, Debugger::Breakpoint::Exec, regs.pc, 0x00); + debugger.breakpoint_test(Debugger::Breakpoint::Source::APURAM, Debugger::Breakpoint::Mode::Exec, regs.pc, 0x00); } if(step_event) step_event(); @@ -21,7 +21,7 @@ void sSMPDebugger::op_step() { uint8 sSMPDebugger::op_read(uint16 addr) { uint8 data = sSMP::op_read(addr); usage[addr] |= UsageRead; - debugger.breakpoint_test(Debugger::Breakpoint::APURAM, Debugger::Breakpoint::Read, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::APURAM, Debugger::Breakpoint::Mode::Read, addr, data); return data; } @@ -29,7 +29,7 @@ void sSMPDebugger::op_write(uint16 addr, uint8 data) { sSMP::op_write(addr, data); usage[addr] |= UsageWrite; usage[addr] &= ~UsageExec; - debugger.breakpoint_test(Debugger::Breakpoint::APURAM, Debugger::Breakpoint::Write, addr, data); + debugger.breakpoint_test(Debugger::Breakpoint::Source::APURAM, Debugger::Breakpoint::Mode::Write, addr, data); } sSMPDebugger::sSMPDebugger() { diff --git a/src/smp/ssmp/debugger/debugger.hpp b/bsnes/smp/ssmp/debugger/debugger.hpp similarity index 100% rename from src/smp/ssmp/debugger/debugger.hpp rename to bsnes/smp/ssmp/debugger/debugger.hpp diff --git a/src/smp/ssmp/memory/memory.cpp b/bsnes/smp/ssmp/memory/memory.cpp similarity index 100% rename from src/smp/ssmp/memory/memory.cpp rename to bsnes/smp/ssmp/memory/memory.cpp diff --git a/src/smp/ssmp/memory/memory.hpp b/bsnes/smp/ssmp/memory/memory.hpp similarity index 100% rename from src/smp/ssmp/memory/memory.hpp rename to bsnes/smp/ssmp/memory/memory.hpp diff --git a/src/smp/ssmp/serialization.cpp b/bsnes/smp/ssmp/serialization.cpp similarity index 100% rename from src/smp/ssmp/serialization.cpp rename to bsnes/smp/ssmp/serialization.cpp diff --git a/src/smp/ssmp/ssmp.cpp b/bsnes/smp/ssmp/ssmp.cpp similarity index 91% rename from src/smp/ssmp/ssmp.cpp rename to bsnes/smp/ssmp/ssmp.cpp index fb4575f5..dbb310a2 100644 --- a/src/smp/ssmp/ssmp.cpp +++ b/bsnes/smp/ssmp/ssmp.cpp @@ -16,8 +16,8 @@ namespace SNES { void sSMP::enter() { while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } op_step(); diff --git a/src/smp/ssmp/ssmp.hpp b/bsnes/smp/ssmp/ssmp.hpp similarity index 100% rename from src/smp/ssmp/ssmp.hpp rename to bsnes/smp/ssmp/ssmp.hpp diff --git a/src/smp/ssmp/timing/timing.cpp b/bsnes/smp/ssmp/timing/timing.cpp similarity index 100% rename from src/smp/ssmp/timing/timing.cpp rename to bsnes/smp/ssmp/timing/timing.cpp diff --git a/src/smp/ssmp/timing/timing.hpp b/bsnes/smp/ssmp/timing/timing.hpp similarity index 100% rename from src/smp/ssmp/timing/timing.hpp rename to bsnes/smp/ssmp/timing/timing.hpp diff --git a/src/system/audio/audio.cpp b/bsnes/system/audio/audio.cpp similarity index 97% rename from src/system/audio/audio.cpp rename to bsnes/system/audio/audio.cpp index e2c6ec07..a74fd073 100644 --- a/src/system/audio/audio.cpp +++ b/bsnes/system/audio/audio.cpp @@ -14,7 +14,7 @@ void Audio::coprocessor_enable(bool state) { void Audio::coprocessor_frequency(double input_frequency) { double output_frequency; - if(system.region() == System::NTSC) { + if(system.region() == System::Region::NTSC) { output_frequency = config.smp.ntsc_clock_rate / 768.0; } else /* (system.region() == System::PAL) */ { output_frequency = config.smp.pal_clock_rate / 768.0; diff --git a/src/system/audio/audio.hpp b/bsnes/system/audio/audio.hpp similarity index 100% rename from src/system/audio/audio.hpp rename to bsnes/system/audio/audio.hpp diff --git a/src/system/config/config.cpp b/bsnes/system/config/config.cpp similarity index 71% rename from src/system/config/config.cpp rename to bsnes/system/config/config.cpp index 5c6624cc..cd86a1a2 100644 --- a/src/system/config/config.cpp +++ b/bsnes/system/config/config.cpp @@ -3,10 +3,10 @@ Configuration config; Configuration::Configuration() { - controller_port1 = Input::DeviceJoypad; - controller_port2 = Input::DeviceJoypad; - expansion_port = System::ExpansionBSX; - region = System::Autodetect; + controller_port1 = Input::Device::Joypad; + controller_port2 = Input::Device::Joypad; + expansion_port = System::ExpansionPortDevice::BSX; + region = System::Region::Autodetect; cpu.version = 2; cpu.ntsc_clock_rate = 21477272; diff --git a/src/system/config/config.hpp b/bsnes/system/config/config.hpp similarity index 78% rename from src/system/config/config.hpp rename to bsnes/system/config/config.hpp index d28f8928..54adbc3b 100644 --- a/src/system/config/config.hpp +++ b/bsnes/system/config/config.hpp @@ -1,8 +1,8 @@ struct Configuration { - unsigned controller_port1; - unsigned controller_port2; - unsigned expansion_port; - unsigned region; + Input::Device controller_port1; + Input::Device controller_port2; + System::ExpansionPortDevice expansion_port; + System::Region region; struct CPU { unsigned version; diff --git a/src/system/debugger/debugger.cpp b/bsnes/system/debugger/debugger.cpp similarity index 80% rename from src/system/debugger/debugger.cpp rename to bsnes/system/debugger/debugger.cpp index a1bb2a0e..5498ba14 100644 --- a/src/system/debugger/debugger.cpp +++ b/bsnes/system/debugger/debugger.cpp @@ -7,7 +7,7 @@ void Debugger::breakpoint_test(Debugger::Breakpoint::Source source, Debugger::Br if(breakpoint[i].enabled == false) continue; //shadow S-CPU WRAM addresses ($00-3f|80-bf:0000-1fff mirrors $7e:0000-1fff) - if(source == Debugger::Breakpoint::CPUBus && ( + if(source == Debugger::Breakpoint::Source::CPUBus && ( ((breakpoint[i].addr & 0x40e000) == 0x000000) || //$00-3f|80-bf:0000-1fff ((breakpoint[i].addr & 0xffe000) == 0x7e0000) //$7e:0000-1fff ) @@ -23,34 +23,34 @@ void Debugger::breakpoint_test(Debugger::Breakpoint::Source source, Debugger::Br breakpoint[i].counter++; breakpoint_hit = i; - break_event = BreakpointHit; - scheduler.exit(Scheduler::DebuggerEvent); + break_event = BreakEvent::BreakpointHit; + scheduler.exit(Scheduler::ExitReason::DebuggerEvent); break; } } uint8 Debugger::read(Debugger::MemorySource source, unsigned addr) { switch(source) { - case CPUBus: { + case MemorySource::CPUBus: { //do not read from memory-mapped registers that could affect program behavior if(((addr - 0x2000) & 0x40c000) == 0x000000) break; //$00-3f:2000-5fff MMIO return bus.read(addr & 0xffffff); } break; - case APURAM: { + case MemorySource::APURAM: { return memory::apuram.read(addr & 0xffff); } break; - case VRAM: { + case MemorySource::VRAM: { return memory::vram.read(addr & 0xffff); } break; - case OAM: { + case MemorySource::OAM: { if(addr & 0x0200) return memory::oam.read(0x0200 + (addr & 0x1f)); return memory::oam.read(addr & 0x01ff); } break; - case CGRAM: { + case MemorySource::CGRAM: { return memory::cgram.read(addr & 0x01ff); } break; } @@ -60,7 +60,7 @@ uint8 Debugger::read(Debugger::MemorySource source, unsigned addr) { void Debugger::write(Debugger::MemorySource source, unsigned addr, uint8 data) { switch(source) { - case CPUBus: { + case MemorySource::CPUBus: { //do not write to memory-mapped registers that could affect program behavior if(((addr - 0x2000) & 0x40c000) == 0x000000) break; //$00-3f:2000-5fff MMIO memory::cartrom.write_protect(false); @@ -68,34 +68,34 @@ void Debugger::write(Debugger::MemorySource source, unsigned addr, uint8 data) { memory::cartrom.write_protect(true); } break; - case APURAM: { + case MemorySource::APURAM: { memory::apuram.write(addr & 0xffff, data); } break; - case VRAM: { + case MemorySource::VRAM: { memory::vram.write(addr & 0xffff, data); } break; - case OAM: { + case MemorySource::OAM: { if(addr & 0x0200) memory::oam.write(0x0200 + (addr & 0x1f), data); else memory::oam.write(addr & 0x01ff, data); } break; - case CGRAM: { + case MemorySource::CGRAM: { memory::cgram.write(addr & 0x01ff, data); } break; } } Debugger::Debugger() { - break_event = None; + break_event = BreakEvent::None; for(unsigned n = 0; n < Breakpoints; n++) { breakpoint[n].enabled = false; breakpoint[n].addr = 0; breakpoint[n].data = -1; - breakpoint[n].mode = Breakpoint::Exec; - breakpoint[n].source = Breakpoint::CPUBus; + breakpoint[n].mode = Breakpoint::Mode::Exec; + breakpoint[n].source = Breakpoint::Source::CPUBus; breakpoint[n].counter = 0; } breakpoint_hit = 0; diff --git a/src/system/debugger/debugger.hpp b/bsnes/system/debugger/debugger.hpp similarity index 71% rename from src/system/debugger/debugger.hpp rename to bsnes/system/debugger/debugger.hpp index f2228734..28ee52eb 100644 --- a/src/system/debugger/debugger.hpp +++ b/bsnes/system/debugger/debugger.hpp @@ -1,6 +1,6 @@ class Debugger { public: - enum BreakEvent { + enum class BreakEvent : unsigned { None, BreakpointHit, CPUStep, @@ -12,8 +12,8 @@ public: bool enabled; unsigned addr; signed data; //-1 = unused - enum Mode { Exec, Read, Write } mode; - enum Source { CPUBus, APURAM, VRAM, OAM, CGRAM } source; + enum class Mode : unsigned { Exec, Read, Write } mode; + enum class Source : unsigned { CPUBus, APURAM, VRAM, OAM, CGRAM } source; unsigned counter; //number of times breakpoint has been hit since being set } breakpoint[Breakpoints]; unsigned breakpoint_hit; @@ -22,7 +22,7 @@ public: bool step_cpu; bool step_smp; - enum MemorySource { CPUBus, APURAM, VRAM, OAM, CGRAM }; + enum class MemorySource : unsigned { CPUBus, APURAM, VRAM, OAM, CGRAM }; uint8 read(MemorySource, unsigned addr); void write(MemorySource, unsigned addr, uint8 data); diff --git a/src/system/input/input.cpp b/bsnes/system/input/input.cpp similarity index 81% rename from src/system/input/input.cpp rename to bsnes/system/input/input.cpp index afa60d80..ac2e59cc 100644 --- a/src/system/input/input.cpp +++ b/bsnes/system/input/input.cpp @@ -6,12 +6,12 @@ uint8 Input::port_read(bool portnumber) { port_t &p = port[portnumber]; switch(p.device) { - case DeviceJoypad: { + case Device::Joypad: { if(p.counter0 >= 16) return 1; return system.interface->input_poll(portnumber, p.device, 0, p.counter0++); - } //case DeviceJoypad + } //case Device::Joypad - case DeviceMultitap: { + case Device::Multitap: { if(cpu.joylatch()) return 2; //when latch is high -- data2 = 1, data1 = 0 unsigned deviceidx, deviceindex0, deviceindex1; @@ -35,13 +35,13 @@ uint8 Input::port_read(bool portnumber) { return (system.interface->input_poll(portnumber, p.device, deviceindex0, deviceidx) << 0) | (system.interface->input_poll(portnumber, p.device, deviceindex1, deviceidx) << 1); - } //case DeviceMultitap + } //case Device::Multitap - case DeviceMouse: { + case Device::Mouse: { if(p.counter0 >= 32) return 1; - int position_x = system.interface->input_poll(portnumber, p.device, 0, MouseX); //-n = left, 0 = center, +n = right - int position_y = system.interface->input_poll(portnumber, p.device, 0, MouseY); //-n = up, 0 = center, +n = right + int position_x = system.interface->input_poll(portnumber, p.device, 0, (unsigned)MouseID::X); //-n = left, 0 = center, +n = right + int position_y = system.interface->input_poll(portnumber, p.device, 0, (unsigned)MouseID::Y); //-n = up, 0 = center, +n = right bool direction_x = position_x < 0; //0 = right, 1 = left bool direction_y = position_y < 0; //0 = down, 1 = up @@ -62,8 +62,8 @@ uint8 Input::port_read(bool portnumber) { case 6: return 0; case 7: return 0; - case 8: return system.interface->input_poll(portnumber, p.device, 0, MouseRight); - case 9: return system.interface->input_poll(portnumber, p.device, 0, MouseLeft); + case 8: return system.interface->input_poll(portnumber, p.device, 0, (unsigned)MouseID::Right); + case 9: return system.interface->input_poll(portnumber, p.device, 0, (unsigned)MouseID::Left); case 10: return 0; //speed (0 = slow, 1 = normal, 2 = fast, 3 = unused) case 11: return 0; // || @@ -90,15 +90,15 @@ uint8 Input::port_read(bool portnumber) { case 30: return (position_x >> 1) & 1; case 31: return (position_x >> 0) & 1; } - } //case DeviceMouse + } //case Device::Mouse - case DeviceSuperScope: { + case Device::SuperScope: { if(portnumber == 0) break; //Super Scope in port 1 not supported ... if(p.counter0 >= 8) return 1; if(p.counter0 == 0) { //turbo is a switch; toggle is edge sensitive - bool turbo = system.interface->input_poll(portnumber, p.device, 0, SuperScopeTurbo); + bool turbo = system.interface->input_poll(portnumber, p.device, 0, (unsigned)SuperScopeID::Turbo); if(turbo && !p.superscope.turbolock) { p.superscope.turbo = !p.superscope.turbo; //toggle state p.superscope.turbolock = true; @@ -109,7 +109,7 @@ uint8 Input::port_read(bool portnumber) { //trigger is a button //if turbo is active, trigger is level sensitive; otherwise it is edge sensitive p.superscope.trigger = false; - bool trigger = system.interface->input_poll(portnumber, p.device, 0, SuperScopeTrigger); + bool trigger = system.interface->input_poll(portnumber, p.device, 0, (unsigned)SuperScopeID::Trigger); if(trigger && (p.superscope.turbo || !p.superscope.triggerlock)) { p.superscope.trigger = true; p.superscope.triggerlock = true; @@ -118,11 +118,11 @@ uint8 Input::port_read(bool portnumber) { } //cursor is a button; it is always level sensitive - p.superscope.cursor = system.interface->input_poll(portnumber, p.device, 0, SuperScopeCursor); + p.superscope.cursor = system.interface->input_poll(portnumber, p.device, 0, (unsigned)SuperScopeID::Cursor); //pause is a button; it is always edge sensitive p.superscope.pause = false; - bool pause = system.interface->input_poll(portnumber, p.device, 0, SuperScopePause); + bool pause = system.interface->input_poll(portnumber, p.device, 0, (unsigned)SuperScopeID::Pause); if(pause && !p.superscope.pauselock) { p.superscope.pause = true; p.superscope.pauselock = true; @@ -145,20 +145,20 @@ uint8 Input::port_read(bool portnumber) { case 6: return p.superscope.offscreen; case 7: return 0; //noise (1 = yes) } - } //case DeviceSuperScope + } //case Device::SuperScope - case DeviceJustifier: - case DeviceJustifiers: { + case Device::Justifier: + case Device::Justifiers: { if(portnumber == 0) break; //Justifier in port 1 not supported ... if(p.counter0 >= 32) return 1; if(p.counter0 == 0) { - p.justifier.trigger1 = system.interface->input_poll(portnumber, p.device, 0, JustifierTrigger); - p.justifier.start1 = system.interface->input_poll(portnumber, p.device, 0, JustifierStart); + p.justifier.trigger1 = system.interface->input_poll(portnumber, p.device, 0, (unsigned)JustifierID::Trigger); + p.justifier.start1 = system.interface->input_poll(portnumber, p.device, 0, (unsigned)JustifierID::Start); - if(p.device == DeviceJustifiers) { - p.justifier.trigger2 = system.interface->input_poll(portnumber, p.device, 1, JustifierTrigger); - p.justifier.start2 = system.interface->input_poll(portnumber, p.device, 1, JustifierStart); + if(p.device == Device::Justifiers) { + p.justifier.trigger2 = system.interface->input_poll(portnumber, p.device, 1, (unsigned)JustifierID::Trigger); + p.justifier.start2 = system.interface->input_poll(portnumber, p.device, 1, (unsigned)JustifierID::Start); } else { p.justifier.x2 = -1; p.justifier.y2 = -1; @@ -206,7 +206,7 @@ uint8 Input::port_read(bool portnumber) { case 30: return 0; case 31: return 0; } - } //case DeviceJustifier(s) + } //case Device::Justifier(s) } //switch(p.device) //no device connected @@ -219,9 +219,9 @@ void Input::update() { port_t &p = port[1]; switch(p.device) { - case DeviceSuperScope: { - int x = system.interface->input_poll(1, p.device, 0, SuperScopeX); - int y = system.interface->input_poll(1, p.device, 0, SuperScopeY); + case Device::SuperScope: { + int x = system.interface->input_poll(1, p.device, 0, (unsigned)SuperScopeID::X); + int y = system.interface->input_poll(1, p.device, 0, (unsigned)SuperScopeID::Y); x += p.superscope.x; y += p.superscope.y; p.superscope.x = max(-16, min(256 + 16, x)); @@ -231,17 +231,17 @@ void Input::update() { latchy = p.superscope.y; } break; - case DeviceJustifier: - case DeviceJustifiers: { - int x1 = system.interface->input_poll(1, p.device, 0, JustifierX); - int y1 = system.interface->input_poll(1, p.device, 0, JustifierY); + case Device::Justifier: + case Device::Justifiers: { + int x1 = system.interface->input_poll(1, p.device, 0, (unsigned)JustifierID::X); + int y1 = system.interface->input_poll(1, p.device, 0, (unsigned)JustifierID::Y); x1 += p.justifier.x1; y1 += p.justifier.y1; p.justifier.x1 = max(-16, min(256 + 16, x1)); p.justifier.y1 = max(-16, min(240 + 16, y1)); - int x2 = system.interface->input_poll(1, p.device, 1, JustifierX); - int y2 = system.interface->input_poll(1, p.device, 1, JustifierY); + int x2 = system.interface->input_poll(1, p.device, 1, (unsigned)JustifierID::X); + int y2 = system.interface->input_poll(1, p.device, 1, (unsigned)JustifierID::Y); x2 += p.justifier.x2; y2 += p.justifier.y2; p.justifier.x2 = max(-16, min(256 + 16, x2)); @@ -251,8 +251,8 @@ void Input::update() { latchx = p.justifier.x1; latchy = p.justifier.y1; } else { - latchx = (p.device == DeviceJustifiers ? p.justifier.x2 : -1); - latchy = (p.device == DeviceJustifiers ? p.justifier.y2 : -1); + latchx = (p.device == Device::Justifiers ? p.justifier.x2 : -1); + latchy = (p.device == Device::Justifiers ? p.justifier.y2 : -1); } } break; } @@ -269,7 +269,7 @@ void Input::update() { } } -void Input::port_set_device(bool portnumber, unsigned device) { +void Input::port_set_device(bool portnumber, Device device) { port_t &p = port[portnumber]; p.device = device; @@ -277,13 +277,13 @@ void Input::port_set_device(bool portnumber, unsigned device) { p.counter1 = 0; //set iobit to true if device is capable of latching PPU counters - iobit = port[1].device == DeviceSuperScope - || port[1].device == DeviceJustifier - || port[1].device == DeviceJustifiers; + iobit = port[1].device == Device::SuperScope + || port[1].device == Device::Justifier + || port[1].device == Device::Justifiers; latchx = -1; latchy = -1; - if(device == DeviceSuperScope) { + if(device == Device::SuperScope) { p.superscope.x = 256 / 2; p.superscope.y = 240 / 2; @@ -296,7 +296,7 @@ void Input::port_set_device(bool portnumber, unsigned device) { p.superscope.turbolock = false; p.superscope.triggerlock = false; p.superscope.pauselock = false; - } else if(device == DeviceJustifier) { + } else if(device == Device::Justifier) { p.justifier.active = 0; p.justifier.x1 = 256 / 2; p.justifier.y1 = 240 / 2; @@ -307,7 +307,7 @@ void Input::port_set_device(bool portnumber, unsigned device) { p.justifier.trigger2 = false; p.justifier.start1 = false; p.justifier.start2 = false; - } else if(device == DeviceJustifiers) { + } else if(device == Device::Justifiers) { p.justifier.active = 0; p.justifier.x1 = 256 / 2 - 16; p.justifier.y1 = 240 / 2; diff --git a/src/system/input/input.hpp b/bsnes/system/input/input.hpp similarity index 59% rename from src/system/input/input.hpp rename to bsnes/system/input/input.hpp index 80d8d4ad..e24ac2ed 100644 --- a/src/system/input/input.hpp +++ b/bsnes/system/input/input.hpp @@ -1,42 +1,35 @@ class Input { public: - enum Device { - DeviceNone, - DeviceJoypad, - DeviceMultitap, - DeviceMouse, - DeviceSuperScope, - DeviceJustifier, - DeviceJustifiers, + enum class Device : unsigned { + None, + Joypad, + Multitap, + Mouse, + SuperScope, + Justifier, + Justifiers, }; - enum JoypadID { - JoypadB = 0, JoypadY = 1, - JoypadSelect = 2, JoypadStart = 3, - JoypadUp = 4, JoypadDown = 5, - JoypadLeft = 6, JoypadRight = 7, - JoypadA = 8, JoypadX = 9, - JoypadL = 10, JoypadR = 11, + enum class JoypadID : unsigned { + B = 0, Y = 1, Select = 2, Start = 3, + Up = 4, Down = 5, Left = 6, Right = 7, + A = 8, X = 9, L = 10, R = 11, }; - enum MouseID { - MouseX = 0, MouseY = 1, - MouseLeft = 2, MouseRight = 3, + enum class MouseID : unsigned { + X = 0, Y = 1, Left = 2, Right = 3, }; - enum SuperScopeID { - SuperScopeX = 0, SuperScopeY = 1, - SuperScopeTrigger = 2, SuperScopeCursor = 3, - SuperScopeTurbo = 4, SuperScopePause = 5, + enum class SuperScopeID : unsigned { + X = 0, Y = 1, Trigger = 2, Cursor = 3, Turbo = 4, Pause = 5, }; - enum JustifierID { - JustifierX = 0, JustifierY = 1, - JustifierTrigger = 2, JustifierStart = 3, + enum class JustifierID : unsigned { + X = 0, Y = 1, Trigger = 2, Start = 3, }; uint8 port_read(bool port); - void port_set_device(bool port, unsigned device); + void port_set_device(bool port, Device device); void init(); void poll(); void update(); @@ -58,7 +51,7 @@ private: int16_t latchx, latchy; struct port_t { - unsigned device; + Device device; unsigned counter0; //read counters unsigned counter1; diff --git a/src/system/interface/interface.hpp b/bsnes/system/interface/interface.hpp similarity index 69% rename from src/system/interface/interface.hpp rename to bsnes/system/interface/interface.hpp index 49518709..a4814884 100644 --- a/src/system/interface/interface.hpp +++ b/bsnes/system/interface/interface.hpp @@ -3,5 +3,5 @@ public: virtual void video_refresh(uint16_t *data, unsigned pitch, unsigned *line, unsigned width, unsigned height) {} virtual void audio_sample(uint16_t l_sample, uint16_t r_sample) {} virtual void input_poll() {} - virtual int16_t input_poll(bool port, unsigned device, unsigned index, unsigned id) { return 0; } + virtual int16_t input_poll(bool port, Input::Device device, unsigned index, unsigned id) { return 0; } }; diff --git a/src/system/scheduler/scheduler.cpp b/bsnes/system/scheduler/scheduler.cpp similarity index 91% rename from src/system/scheduler/scheduler.cpp rename to bsnes/system/scheduler/scheduler.cpp index 9c4ddce1..3ebb3be3 100644 --- a/src/system/scheduler/scheduler.cpp +++ b/bsnes/system/scheduler/scheduler.cpp @@ -22,10 +22,10 @@ Scheduler::ExitReason Scheduler::exit_reason() const { } void Scheduler::init() { - clock.cpu_freq = system.region() == System::NTSC + clock.cpu_freq = system.region() == System::Region::NTSC ? config.cpu.ntsc_clock_rate : config.cpu.pal_clock_rate; - clock.smp_freq = system.region() == System::NTSC + clock.smp_freq = system.region() == System::Region::NTSC ? config.smp.ntsc_clock_rate : config.smp.pal_clock_rate; clock.cop_freq = clock.cpu_freq; @@ -61,7 +61,7 @@ Scheduler::Scheduler() { thread_dsp = 0; thread_active = 0; - exit_reason_ = UnknownEvent; + exit_reason_ = ExitReason::UnknownEvent; } #endif diff --git a/src/system/scheduler/scheduler.hpp b/bsnes/system/scheduler/scheduler.hpp similarity index 85% rename from src/system/scheduler/scheduler.hpp rename to bsnes/system/scheduler/scheduler.hpp index ac7b8dfe..ee8a4bcd 100644 --- a/src/system/scheduler/scheduler.hpp +++ b/bsnes/system/scheduler/scheduler.hpp @@ -5,6 +5,9 @@ class Scheduler { public: + enum class SynchronizeMode : unsigned { None, CPU, All } sync; + enum class ExitReason : unsigned { UnknownEvent, FrameEvent, SynchronizeEvent, DebuggerEvent }; + cothread_t thread_snes; cothread_t thread_cpu; //S-CPU (5a22) cothread_t thread_cop; //cartridge co-processor (SuperFX, SA-1, ...) @@ -24,8 +27,6 @@ public: int64 smpdsp; } clock; - enum sync_t { SyncNone, SyncCpu, SyncAll } sync; - //========== //CPU <> COP //========== @@ -38,7 +39,7 @@ public: } alwaysinline void sync_copcpu() { - if(clock.cpucop >= 0 && sync != SyncAll) { + if(clock.cpucop >= 0 && sync != SynchronizeMode::All) { thread_active = thread_cpu; co_switch(thread_cpu); } @@ -56,7 +57,7 @@ public: } alwaysinline void sync_ppucpu() { - if(clock.cpuppu >= 0 && sync != SyncAll) { + if(clock.cpuppu >= 0 && sync != SynchronizeMode::All) { thread_active = thread_cpu; co_switch(thread_cpu); } @@ -74,7 +75,7 @@ public: } alwaysinline void sync_smpcpu() { - if(clock.cpusmp >= 0 && sync != SyncAll) { + if(clock.cpusmp >= 0 && sync != SynchronizeMode::All) { thread_active = thread_cpu; co_switch(thread_cpu); } @@ -85,14 +86,14 @@ public: //========== alwaysinline void sync_smpdsp() { - if(clock.smpdsp < 0 && sync != SyncAll) { + if(clock.smpdsp < 0 && sync != SynchronizeMode::All) { thread_active = thread_dsp; co_switch(thread_dsp); } } alwaysinline void sync_dspsmp() { - if(clock.smpdsp >= 0 && sync != SyncAll) { + if(clock.smpdsp >= 0 && sync != SynchronizeMode::All) { thread_active = thread_smp; co_switch(thread_smp); } @@ -125,8 +126,6 @@ public: clock.smpdsp += clocks; } - enum ExitReason { UnknownEvent, FrameEvent, SynchronizeEvent, DebuggerEvent }; - void enter(); void exit(ExitReason); ExitReason exit_reason() const; diff --git a/src/system/serialization.cpp b/bsnes/system/serialization.cpp similarity index 92% rename from src/system/serialization.cpp rename to bsnes/system/serialization.cpp index 09029c5a..7995b52a 100644 --- a/src/system/serialization.cpp +++ b/bsnes/system/serialization.cpp @@ -60,7 +60,7 @@ void System::serialize_all(serializer &s) { ppu.serialize(s); dsp.serialize(s); - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.serialize(s); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.serialize(s); if(cartridge.has_superfx()) superfx.serialize(s); if(cartridge.has_sa1()) sa1.serialize(s); @@ -71,8 +71,8 @@ void System::serialize_all(serializer &s) { if(cartridge.has_dsp1()) dsp1.serialize(s); if(cartridge.has_dsp2()) dsp2.serialize(s); if(cartridge.has_obc1()) obc1.serialize(s); - if(cartridge.has_st010()) st010.serialize(s); - if(cartridge.has_msu()) msu.serialize(s); + if(cartridge.has_st0010()) st0010.serialize(s); + if(cartridge.has_msu1()) msu1.serialize(s); } //called once upon cartridge load event: perform dry-run state save. diff --git a/src/system/system.cpp b/bsnes/system/system.cpp similarity index 65% rename from src/system/system.cpp rename to bsnes/system/system.cpp index 3e8078ed..d6f99685 100644 --- a/src/system/system.cpp +++ b/bsnes/system/system.cpp @@ -15,14 +15,14 @@ System system; #include "input/input.cpp" void System::coprocessor_enter() { - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.enter(); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.enter(); if(cartridge.has_superfx()) superfx.enter(); if(cartridge.has_sa1()) sa1.enter(); - if(cartridge.has_msu()) msu.enter(); + if(cartridge.has_msu1()) msu1.enter(); while(true) { - if(scheduler.sync == Scheduler::SyncAll) { - scheduler.exit(Scheduler::SynchronizeEvent); + if(scheduler.sync == Scheduler::SynchronizeMode::All) { + scheduler.exit(Scheduler::ExitReason::SynchronizeEvent); } scheduler.addclocks_cop(64 * 1024 * 1024); @@ -31,17 +31,17 @@ void System::coprocessor_enter() { } void System::run() { - scheduler.sync = Scheduler::SyncNone; + scheduler.sync = Scheduler::SynchronizeMode::None; scheduler.enter(); - if(scheduler.exit_reason() == Scheduler::FrameEvent) { + if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { input.update(); video.update(); } } void System::runtosave() { - scheduler.sync = Scheduler::SyncCpu; + scheduler.sync = Scheduler::SynchronizeMode::CPU; runthreadtosave(); scheduler.thread_active = scheduler.thread_cop; @@ -62,8 +62,8 @@ void System::runtosave() { void System::runthreadtosave() { while(true) { scheduler.enter(); - if(scheduler.exit_reason() == Scheduler::SynchronizeEvent) break; - if(scheduler.exit_reason() == Scheduler::FrameEvent) { + if(scheduler.exit_reason() == Scheduler::ExitReason::SynchronizeEvent) break; + if(scheduler.exit_reason() == Scheduler::ExitReason::FrameEvent) { input.update(); video.update(); } @@ -89,10 +89,10 @@ void System::init(Interface *interface_) { dsp3.init(); dsp4.init(); obc1.init(); - st010.init(); - st011.init(); - st018.init(); - msu.init(); + st0010.init(); + st0011.init(); + st0018.init(); + msu1.init(); video.init(); audio.init(); @@ -103,11 +103,11 @@ void System::term() { } void System::power() { - region = max(0, min(2, config.region)); - expansion = max(0, min(1, config.expansion_port)); + region = config.region; + expansion = config.expansion_port; - if(region == Autodetect) { - region = (cartridge.region() == Cartridge::NTSC ? NTSC : PAL); + if(region == Region::Autodetect) { + region = (cartridge.region() == Cartridge::Region::NTSC ? Region::NTSC : Region::PAL); } audio.coprocessor_enable(false); @@ -122,10 +122,10 @@ void System::power() { for(unsigned i = 0x4200; i <= 0x421f; i++) memory::mmio.map(i, cpu); for(unsigned i = 0x4300; i <= 0x437f; i++) memory::mmio.map(i, cpu); - if(expansion() == ExpansionBSX) bsxbase.enable(); + if(expansion() == ExpansionPortDevice::BSX) bsxbase.enable(); if(memory::bsxflash.data()) bsxflash.enable(); - if(cartridge.mode() == Cartridge::ModeBsx) bsxcart.enable(); - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.enable(); + if(cartridge.mode() == Cartridge::Mode::Bsx) bsxcart.enable(); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.enable(); if(cartridge.has_superfx()) superfx.enable(); if(cartridge.has_sa1()) sa1.enable(); @@ -138,15 +138,15 @@ void System::power() { if(cartridge.has_dsp3()) dsp3.enable(); if(cartridge.has_dsp4()) dsp4.enable(); if(cartridge.has_obc1()) obc1.enable(); - if(cartridge.has_st010()) st010.enable(); - if(cartridge.has_st011()) st011.enable(); - if(cartridge.has_st018()) st018.enable(); - if(cartridge.has_msu()) msu.enable(); + if(cartridge.has_st0010()) st0010.enable(); + if(cartridge.has_st0011()) st0011.enable(); + if(cartridge.has_st0018()) st0018.enable(); + if(cartridge.has_msu1()) msu1.enable(); - if(expansion() == ExpansionBSX) bsxbase.power(); + if(expansion() == ExpansionPortDevice::BSX) bsxbase.power(); if(memory::bsxflash.data()) bsxflash.power(); - if(cartridge.mode() == Cartridge::ModeBsx) bsxcart.power(); - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.power(); + if(cartridge.mode() == Cartridge::Mode::Bsx) bsxcart.power(); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.power(); if(cartridge.has_superfx()) superfx.power(); if(cartridge.has_sa1()) sa1.power(); @@ -159,10 +159,10 @@ void System::power() { if(cartridge.has_dsp3()) dsp3.power(); if(cartridge.has_dsp4()) dsp4.power(); if(cartridge.has_obc1()) obc1.power(); - if(cartridge.has_st010()) st010.power(); - if(cartridge.has_st011()) st011.power(); - if(cartridge.has_st018()) st018.power(); - if(cartridge.has_msu()) msu.power(); + if(cartridge.has_st0010()) st0010.power(); + if(cartridge.has_st0011()) st0011.power(); + if(cartridge.has_st0018()) st0018.power(); + if(cartridge.has_msu1()) msu1.power(); cpu.power(); smp.power(); @@ -184,10 +184,10 @@ void System::reset() { ppu.reset(); bus.reset(); - if(expansion() == ExpansionBSX) bsxbase.reset(); + if(expansion() == ExpansionPortDevice::BSX) bsxbase.reset(); if(memory::bsxflash.data()) bsxflash.reset(); - if(cartridge.mode() == Cartridge::ModeBsx) bsxcart.reset(); - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.reset(); + if(cartridge.mode() == Cartridge::Mode::Bsx) bsxcart.reset(); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.reset(); if(cartridge.has_superfx()) superfx.reset(); if(cartridge.has_sa1()) sa1.reset(); @@ -200,10 +200,10 @@ void System::reset() { if(cartridge.has_dsp3()) dsp3.reset(); if(cartridge.has_dsp4()) dsp4.reset(); if(cartridge.has_obc1()) obc1.reset(); - if(cartridge.has_st010()) st010.reset(); - if(cartridge.has_st011()) st011.reset(); - if(cartridge.has_st018()) st018.reset(); - if(cartridge.has_msu()) msu.reset(); + if(cartridge.has_st0010()) st0010.reset(); + if(cartridge.has_st0011()) st0011.reset(); + if(cartridge.has_st0018()) st0018.reset(); + if(cartridge.has_msu1()) msu1.reset(); input.port_set_device(0, config.controller_port1); input.port_set_device(1, config.controller_port2); @@ -212,20 +212,20 @@ void System::reset() { } void System::unload() { - if(cartridge.mode() == Cartridge::ModeSuperGameBoy) supergameboy.unload(); + if(cartridge.mode() == Cartridge::Mode::SuperGameBoy) supergameboy.unload(); } void System::scanline() { video.scanline(); - if(cpu.vcounter() == 241) scheduler.exit(Scheduler::FrameEvent); + if(cpu.vcounter() == 241) scheduler.exit(Scheduler::ExitReason::FrameEvent); } void System::frame() { } System::System() : interface(0) { - region = NTSC; - expansion = ExpansionNone; + region = Region::NTSC; + expansion = ExpansionPortDevice::None; } }; diff --git a/src/system/system.hpp b/bsnes/system/system.hpp similarity index 81% rename from src/system/system.hpp rename to bsnes/system/system.hpp index 406277e7..fd03f870 100644 --- a/src/system/system.hpp +++ b/bsnes/system/system.hpp @@ -1,17 +1,9 @@ -#include "config/config.hpp" -#include "debugger/debugger.hpp" -#include "interface/interface.hpp" -#include "scheduler/scheduler.hpp" - -#include "video/video.hpp" -#include "audio/audio.hpp" -#include "input/input.hpp" +class Interface; class System : property { public: - enum Region { NTSC = 0, PAL = 1 }; - enum RegionAutodetect { Autodetect = 2 }; - enum ExpansionPortDevice { ExpansionNone = 0, ExpansionBSX = 1 }; + enum class Region : unsigned { NTSC = 0, PAL = 1, Autodetect = 2 }; + enum class ExpansionPortDevice : unsigned { None = 0, BSX = 1 }; void run(); void runtosave(); @@ -26,8 +18,8 @@ public: void scanline(); //return *active* system information (settings are cached upon power-on) - readonly region; - readonly expansion; + readonly region; + readonly expansion; readonly serialize_size; serializer serialize(); @@ -53,4 +45,13 @@ private: friend void threadentry_cop(); }; +#include "video/video.hpp" +#include "audio/audio.hpp" +#include "input/input.hpp" + +#include "config/config.hpp" +#include "debugger/debugger.hpp" +#include "interface/interface.hpp" +#include "scheduler/scheduler.hpp" + extern System system; diff --git a/src/system/video/video.cpp b/bsnes/system/video/video.cpp similarity index 81% rename from src/system/video/video.cpp rename to bsnes/system/video/video.cpp index 9b97b36f..d1557746 100644 --- a/src/system/video/video.cpp +++ b/bsnes/system/video/video.cpp @@ -51,17 +51,17 @@ void Video::update() { unsigned width, height; switch(input.port[1].device) { - case Input::DeviceSuperScope: draw_cursor(0x001f, input.port[1].superscope.x, input.port[1].superscope.y); break; - case Input::DeviceJustifiers: draw_cursor(0x02e0, input.port[1].justifier.x2, input.port[1].justifier.y2); //fallthrough - case Input::DeviceJustifier: draw_cursor(0x001f, input.port[1].justifier.x1, input.port[1].justifier.y1); break; + case Input::Device::SuperScope: draw_cursor(0x001f, input.port[1].superscope.x, input.port[1].superscope.y); break; + case Input::Device::Justifiers: draw_cursor(0x02e0, input.port[1].justifier.x2, input.port[1].justifier.y2); //fallthrough + case Input::Device::Justifier: draw_cursor(0x001f, input.port[1].justifier.x1, input.port[1].justifier.y1); break; } unsigned yoffset = 1; //scanline 0 is always black, skip this line for video output - if(mode == ModeNTSC && ppu.overscan()) yoffset += 8; //NTSC overscan centers x240 height image + if(mode == Mode::NTSC && ppu.overscan()) yoffset += 8; //NTSC overscan centers x240 height image switch(mode) { default: - case ModeNTSC: { width = 256; height = 224; } break; - case ModePAL: { width = 256; height = 239; } break; + case Mode::NTSC: { width = 256; height = 224; } break; + case Mode::PAL: { width = 256; height = 239; } break; } if(frame_hires) width <<= 1; @@ -99,7 +99,7 @@ void Video::init() { for(unsigned i = 0; i < 480; i++) iline_width[i] = 256; frame_hires = false; frame_interlace = false; - set_mode(ModeNTSC); + set_mode(Mode::NTSC); } #endif diff --git a/src/system/video/video.hpp b/bsnes/system/video/video.hpp similarity index 89% rename from src/system/video/video.hpp rename to bsnes/system/video/video.hpp index e93fa247..f81a1e40 100644 --- a/src/system/video/video.hpp +++ b/bsnes/system/video/video.hpp @@ -1,9 +1,6 @@ class Video { public: - enum Mode { - ModeNTSC, - ModePAL, - }; + enum class Mode : unsigned { NTSC, PAL }; void set_mode(Mode); private: diff --git a/src/ui_qt/Makefile b/bsnes/ui_qt/Makefile similarity index 100% rename from src/ui_qt/Makefile rename to bsnes/ui_qt/Makefile diff --git a/src/ui_qt/application/application.cpp b/bsnes/ui_qt/application/application.cpp similarity index 96% rename from src/ui_qt/application/application.cpp rename to bsnes/ui_qt/application/application.cpp index 0cef3ad2..8fdcdc8c 100644 --- a/src/ui_qt/application/application.cpp +++ b/bsnes/ui_qt/application/application.cpp @@ -131,12 +131,12 @@ void Application::run() { if(SNES::cartridge.loaded() && !pause && !autopause && (!debug || debugrun)) { SNES::system.run(); #if defined(DEBUGGER) - if(SNES::debugger.break_event != SNES::Debugger::None) { + if(SNES::debugger.break_event != SNES::Debugger::BreakEvent::None) { debug = true; debugrun = false; debugger->synchronize(); debugger->event(); - SNES::debugger.break_event = SNES::Debugger::None; + SNES::debugger.break_event = SNES::Debugger::BreakEvent::None; } #endif } else { diff --git a/src/ui_qt/application/application.moc.hpp b/bsnes/ui_qt/application/application.moc.hpp similarity index 100% rename from src/ui_qt/application/application.moc.hpp rename to bsnes/ui_qt/application/application.moc.hpp diff --git a/src/ui_qt/application/init.cpp b/bsnes/ui_qt/application/init.cpp similarity index 100% rename from src/ui_qt/application/init.cpp rename to bsnes/ui_qt/application/init.cpp diff --git a/src/ui_qt/base/about.cpp b/bsnes/ui_qt/base/about.cpp similarity index 73% rename from src/ui_qt/base/about.cpp rename to bsnes/ui_qt/base/about.cpp index bb9c059a..cfa67a33 100644 --- a/src/ui_qt/base/about.cpp +++ b/bsnes/ui_qt/base/about.cpp @@ -18,11 +18,11 @@ AboutWindow::AboutWindow() { layout->addWidget(logo); info = new QLabel(string() << - "" - "" - "" - "" - "
Version: " << bsnesVersion << "
Author: byuu
Homepage: http://byuu.org/
" + "" + "" + "" + "" + "
Version: " << bsnesVersion << "Author: byuuHomepage: http://byuu.org
" ); layout->addWidget(info); } diff --git a/src/ui_qt/base/about.moc.hpp b/bsnes/ui_qt/base/about.moc.hpp similarity index 100% rename from src/ui_qt/base/about.moc.hpp rename to bsnes/ui_qt/base/about.moc.hpp diff --git a/src/ui_qt/base/base.cpp b/bsnes/ui_qt/base/base.cpp similarity index 100% rename from src/ui_qt/base/base.cpp rename to bsnes/ui_qt/base/base.cpp diff --git a/src/ui_qt/base/filebrowser.cpp b/bsnes/ui_qt/base/filebrowser.cpp similarity index 100% rename from src/ui_qt/base/filebrowser.cpp rename to bsnes/ui_qt/base/filebrowser.cpp diff --git a/src/ui_qt/base/filebrowser.moc.hpp b/bsnes/ui_qt/base/filebrowser.moc.hpp similarity index 100% rename from src/ui_qt/base/filebrowser.moc.hpp rename to bsnes/ui_qt/base/filebrowser.moc.hpp diff --git a/src/ui_qt/base/htmlviewer.cpp b/bsnes/ui_qt/base/htmlviewer.cpp similarity index 100% rename from src/ui_qt/base/htmlviewer.cpp rename to bsnes/ui_qt/base/htmlviewer.cpp diff --git a/src/ui_qt/base/htmlviewer.moc.hpp b/bsnes/ui_qt/base/htmlviewer.moc.hpp similarity index 100% rename from src/ui_qt/base/htmlviewer.moc.hpp rename to bsnes/ui_qt/base/htmlviewer.moc.hpp diff --git a/src/ui_qt/base/loader.cpp b/bsnes/ui_qt/base/loader.cpp similarity index 92% rename from src/ui_qt/base/loader.cpp rename to bsnes/ui_qt/base/loader.cpp index f68390fd..41bf85e3 100644 --- a/src/ui_qt/base/loader.cpp +++ b/bsnes/ui_qt/base/loader.cpp @@ -88,7 +88,7 @@ void LoaderWindow::loadBsxSlottedCartridge(const char *filebase, const char *fil slot1File->setText(fileSlot1); syncUi(); - mode = SNES::Cartridge::ModeBsxSlotted; + mode = SNES::Cartridge::Mode::BsxSlotted; showWindow("Load BS-X Slotted Cartridge"); } @@ -104,7 +104,7 @@ void LoaderWindow::loadBsxCartridge(const char *fileBase, const char *fileSlot1) slot1File->setText(fileSlot1); syncUi(); - mode = SNES::Cartridge::ModeBsx; + mode = SNES::Cartridge::Mode::Bsx; showWindow("Load BS-X Cartridge"); } @@ -122,7 +122,7 @@ void LoaderWindow::loadSufamiTurboCartridge(const char *fileBase, const char *fi slot2File->setText(fileSlot2); syncUi(); - mode = SNES::Cartridge::ModeSufamiTurbo; + mode = SNES::Cartridge::Mode::SufamiTurbo; showWindow("Load Sufami Turbo Cartridge"); } @@ -138,7 +138,7 @@ void LoaderWindow::loadSuperGameBoyCartridge(const char *fileBase, const char *f slot1File->setText(fileSlot1); syncUi(); - mode = SNES::Cartridge::ModeSuperGameBoy; + mode = SNES::Cartridge::Mode::SuperGameBoy; showWindow("Load Super Game Boy Cartridge"); } @@ -176,16 +176,16 @@ void LoaderWindow::clearBaseCartridge() { void LoaderWindow::selectSlot1Cartridge() { switch(mode) { - case SNES::Cartridge::ModeBsx: - case SNES::Cartridge::ModeBsxSlotted: + case SNES::Cartridge::Mode::Bsx: + case SNES::Cartridge::Mode::BsxSlotted: fileBrowser->setWindowTitle("Load BS-X Cartridge"); fileBrowser->loadCartridge(FileBrowser::LoadSlot1, 1); break; - case SNES::Cartridge::ModeSufamiTurbo: + case SNES::Cartridge::Mode::SufamiTurbo: fileBrowser->setWindowTitle("Load Sufami Turbo Cartridge A"); fileBrowser->loadCartridge(FileBrowser::LoadSlot1, 2); break; - case SNES::Cartridge::ModeSuperGameBoy: + case SNES::Cartridge::Mode::SuperGameBoy: fileBrowser->setWindowTitle("Load Game Boy Cartridge"); fileBrowser->loadCartridge(FileBrowser::LoadSlot1, 3); break; @@ -214,21 +214,21 @@ void LoaderWindow::onLoad() { string slot2 = slot2File->text().toUtf8().data(); switch(mode) { - case SNES::Cartridge::ModeBsxSlotted: { + case SNES::Cartridge::Mode::BsxSlotted: { cartridge.loadBsxSlotted(base, slot1); } break; - case SNES::Cartridge::ModeBsx: { + case SNES::Cartridge::Mode::Bsx: { config().path.bsx = base; cartridge.loadBsx(base, slot1); } break; - case SNES::Cartridge::ModeSufamiTurbo: { + case SNES::Cartridge::Mode::SufamiTurbo: { config().path.st = base; cartridge.loadSufamiTurbo(base, slot1, slot2); } break; - case SNES::Cartridge::ModeSuperGameBoy: { + case SNES::Cartridge::Mode::SuperGameBoy: { config().path.sgb = base; cartridge.loadSuperGameBoy(base, slot1); } break; diff --git a/src/ui_qt/base/loader.moc.hpp b/bsnes/ui_qt/base/loader.moc.hpp similarity index 100% rename from src/ui_qt/base/loader.moc.hpp rename to bsnes/ui_qt/base/loader.moc.hpp diff --git a/src/ui_qt/base/main.cpp b/bsnes/ui_qt/base/main.cpp similarity index 96% rename from src/ui_qt/base/main.cpp rename to bsnes/ui_qt/base/main.cpp index 29caf705..ce227893 100644 --- a/src/ui_qt/base/main.cpp +++ b/bsnes/ui_qt/base/main.cpp @@ -420,79 +420,79 @@ void MainWindow::reset() { void MainWindow::setPort1None() { config().input.port1 = ControllerPort1::None; - SNES::config.controller_port1 = SNES::Input::DeviceNone; + SNES::config.controller_port1 = SNES::Input::Device::None; utility.updateControllers(); } void MainWindow::setPort1Gamepad() { config().input.port1 = ControllerPort1::Gamepad; - SNES::config.controller_port1 = SNES::Input::DeviceJoypad; + SNES::config.controller_port1 = SNES::Input::Device::Joypad; utility.updateControllers(); } void MainWindow::setPort1Asciipad() { config().input.port1 = ControllerPort1::Asciipad; - SNES::config.controller_port1 = SNES::Input::DeviceJoypad; + SNES::config.controller_port1 = SNES::Input::Device::Joypad; utility.updateControllers(); } void MainWindow::setPort1Multitap() { config().input.port1 = ControllerPort1::Multitap; - SNES::config.controller_port1 = SNES::Input::DeviceMultitap; + SNES::config.controller_port1 = SNES::Input::Device::Multitap; utility.updateControllers(); } void MainWindow::setPort1Mouse() { config().input.port1 = ControllerPort1::Mouse; - SNES::config.controller_port1 = SNES::Input::DeviceMouse; + SNES::config.controller_port1 = SNES::Input::Device::Mouse; utility.updateControllers(); } void MainWindow::setPort2None() { config().input.port2 = ControllerPort2::None; - SNES::config.controller_port2 = SNES::Input::DeviceNone; + SNES::config.controller_port2 = SNES::Input::Device::None; utility.updateControllers(); } void MainWindow::setPort2Gamepad() { config().input.port2 = ControllerPort2::Gamepad; - SNES::config.controller_port2 = SNES::Input::DeviceJoypad; + SNES::config.controller_port2 = SNES::Input::Device::Joypad; utility.updateControllers(); } void MainWindow::setPort2Asciipad() { config().input.port2 = ControllerPort2::Asciipad; - SNES::config.controller_port2 = SNES::Input::DeviceJoypad; + SNES::config.controller_port2 = SNES::Input::Device::Joypad; utility.updateControllers(); } void MainWindow::setPort2Multitap() { config().input.port2 = ControllerPort2::Multitap; - SNES::config.controller_port2 = SNES::Input::DeviceMultitap; + SNES::config.controller_port2 = SNES::Input::Device::Multitap; utility.updateControllers(); } void MainWindow::setPort2Mouse() { config().input.port2 = ControllerPort2::Mouse; - SNES::config.controller_port2 = SNES::Input::DeviceMouse; + SNES::config.controller_port2 = SNES::Input::Device::Mouse; utility.updateControllers(); } void MainWindow::setPort2SuperScope() { config().input.port2 = ControllerPort2::SuperScope; - SNES::config.controller_port2 = SNES::Input::DeviceSuperScope; + SNES::config.controller_port2 = SNES::Input::Device::SuperScope; utility.updateControllers(); } void MainWindow::setPort2Justifier() { config().input.port2 = ControllerPort2::Justifier; - SNES::config.controller_port2 = SNES::Input::DeviceJustifier; + SNES::config.controller_port2 = SNES::Input::Device::Justifier; utility.updateControllers(); } void MainWindow::setPort2Justifiers() { config().input.port2 = ControllerPort2::Justifiers; - SNES::config.controller_port2 = SNES::Input::DeviceJustifiers; + SNES::config.controller_port2 = SNES::Input::Device::Justifiers; utility.updateControllers(); } diff --git a/src/ui_qt/base/main.moc.hpp b/bsnes/ui_qt/base/main.moc.hpp similarity index 100% rename from src/ui_qt/base/main.moc.hpp rename to bsnes/ui_qt/base/main.moc.hpp diff --git a/src/ui_qt/cartridge/cartridge.cpp b/bsnes/ui_qt/cartridge/cartridge.cpp similarity index 82% rename from src/ui_qt/cartridge/cartridge.cpp rename to bsnes/ui_qt/cartridge/cartridge.cpp index 77fdd962..6703f176 100644 --- a/src/ui_qt/cartridge/cartridge.cpp +++ b/bsnes/ui_qt/cartridge/cartridge.cpp @@ -43,21 +43,23 @@ bool Cartridge::information(const char *filename, Cartridge::Information &info) } bool Cartridge::saveStatesSupported() { - if(SNES::cartridge.mode() == SNES::Cartridge::ModeBsx) return false; + if(SNES::cartridge.mode() == SNES::Cartridge::Mode::Bsx) return false; - if(SNES::cartridge.has_dsp3()) return false; - if(SNES::cartridge.has_dsp4()) return false; - if(SNES::cartridge.has_st011()) return false; - if(SNES::cartridge.has_st018()) return false; + if(SNES::cartridge.has_dsp3()) return false; + if(SNES::cartridge.has_dsp4()) return false; + if(SNES::cartridge.has_st0011()) return false; + if(SNES::cartridge.has_st0018()) return false; return true; } bool Cartridge::loadNormal(const char *base) { unload(); - if(loadCartridge(baseName = base, SNES::memory::cartrom) == false) return false; - SNES::msu.base(nall::basename(baseName)); - SNES::cartridge.load(SNES::Cartridge::ModeNormal); + if(loadCartridge(baseName = base, cartridge.baseXml, SNES::memory::cartrom) == false) return false; + SNES::msu1.base(nall::basename(baseName)); + + SNES::cartridge.load(SNES::Cartridge::Mode::Normal, + lstring() << cartridge.baseXml); loadMemory(baseName, ".srm", SNES::memory::cartram); loadMemory(baseName, ".rtc", SNES::memory::cartrtc); @@ -71,9 +73,10 @@ bool Cartridge::loadNormal(const char *base) { bool Cartridge::loadBsxSlotted(const char *base, const char *slot) { unload(); - if(loadCartridge(baseName = base, SNES::memory::cartrom) == false) return false; - loadCartridge(slotAName = slot, SNES::memory::bsxflash); - SNES::cartridge.load(SNES::Cartridge::ModeBsxSlotted); + if(loadCartridge(baseName = base, cartridge.baseXml, SNES::memory::cartrom) == false) return false; + loadCartridge(slotAName = slot, cartridge.slotAXml, SNES::memory::bsxflash); + SNES::cartridge.load(SNES::Cartridge::Mode::BsxSlotted, + lstring() << cartridge.baseXml << cartridge.slotAXml); loadMemory(baseName, ".srm", SNES::memory::cartram); loadMemory(baseName, ".rtc", SNES::memory::cartrtc); @@ -88,9 +91,10 @@ bool Cartridge::loadBsxSlotted(const char *base, const char *slot) { bool Cartridge::loadBsx(const char *base, const char *slot) { unload(); - if(loadCartridge(baseName = base, SNES::memory::cartrom) == false) return false; - loadCartridge(slotAName = slot, SNES::memory::bsxflash); - SNES::cartridge.load(SNES::Cartridge::ModeBsx); + if(loadCartridge(baseName = base, cartridge.baseXml, SNES::memory::cartrom) == false) return false; + loadCartridge(slotAName = slot, cartridge.slotAXml, SNES::memory::bsxflash); + SNES::cartridge.load(SNES::Cartridge::Mode::Bsx, + lstring() << cartridge.baseXml << cartridge.slotAXml); loadMemory(baseName, ".srm", SNES::memory::bsxram ); loadMemory(baseName, ".psr", SNES::memory::bsxpram); @@ -106,10 +110,11 @@ bool Cartridge::loadBsx(const char *base, const char *slot) { bool Cartridge::loadSufamiTurbo(const char *base, const char *slotA, const char *slotB) { unload(); - if(loadCartridge(baseName = base, SNES::memory::cartrom) == false) return false; - loadCartridge(slotAName = slotA, SNES::memory::stArom); - loadCartridge(slotBName = slotB, SNES::memory::stBrom); - SNES::cartridge.load(SNES::Cartridge::ModeSufamiTurbo); + if(loadCartridge(baseName = base, cartridge.baseXml, SNES::memory::cartrom) == false) return false; + loadCartridge(slotAName = slotA, cartridge.slotAXml, SNES::memory::stArom); + loadCartridge(slotBName = slotB, cartridge.slotBXml, SNES::memory::stBrom); + SNES::cartridge.load(SNES::Cartridge::Mode::SufamiTurbo, + lstring() << cartridge.baseXml << cartridge.slotAXml << cartridge.slotBXml); loadMemory(slotAName, ".srm", SNES::memory::stAram); loadMemory(slotBName, ".srm", SNES::memory::stBram); @@ -126,9 +131,10 @@ bool Cartridge::loadSufamiTurbo(const char *base, const char *slotA, const char bool Cartridge::loadSuperGameBoy(const char *base, const char *slot) { unload(); - if(loadCartridge(baseName = base, SNES::memory::cartrom) == false) return false; - loadCartridge(slotAName = slot, SNES::memory::gbrom); - SNES::cartridge.load(SNES::Cartridge::ModeSuperGameBoy); + if(loadCartridge(baseName = base, cartridge.baseXml, SNES::memory::cartrom) == false) return false; + loadCartridge(slotAName = slot, cartridge.slotAXml, SNES::memory::gbrom); + SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, + lstring() << cartridge.baseXml << cartridge.slotAXml); loadMemory(slotAName, ".sav", SNES::memory::gbram); loadMemory(slotBName, ".rtc", SNES::memory::gbrtc); @@ -146,23 +152,23 @@ void Cartridge::saveMemory() { if(SNES::cartridge.loaded() == false) return; switch(SNES::cartridge.mode()) { - case SNES::Cartridge::ModeNormal: - case SNES::Cartridge::ModeBsxSlotted: { + case SNES::Cartridge::Mode::Normal: + case SNES::Cartridge::Mode::BsxSlotted: { saveMemory(baseName, ".srm", SNES::memory::cartram); saveMemory(baseName, ".rtc", SNES::memory::cartrtc); } break; - case SNES::Cartridge::ModeBsx: { + case SNES::Cartridge::Mode::Bsx: { saveMemory(baseName, ".srm", SNES::memory::bsxram ); saveMemory(baseName, ".psr", SNES::memory::bsxpram); } break; - case SNES::Cartridge::ModeSufamiTurbo: { + case SNES::Cartridge::Mode::SufamiTurbo: { saveMemory(slotAName, ".srm", SNES::memory::stAram); saveMemory(slotBName, ".srm", SNES::memory::stBram); } break; - case SNES::Cartridge::ModeSuperGameBoy: { + case SNES::Cartridge::Mode::SuperGameBoy: { saveMemory(slotAName, ".sav", SNES::memory::gbram); saveMemory(slotAName, ".rtc", SNES::memory::gbrtc); } break; @@ -192,16 +198,19 @@ void Cartridge::saveCheats() { //private functions //================= -bool Cartridge::loadCartridge(string &filename, SNES::MappedRAM &memory) { +bool Cartridge::loadCartridge(string &filename, string &xml, SNES::MappedRAM &memory) { if(file::exists(filename) == false) return false; uint8_t *data; unsigned size; audio.clear(); - if(reader.load(filename, data, size) == false) return false; + if(reader.load(filename, xml, data, size) == false) return false; + + string name; + name = string() << nall::basename(filename) << ".xml"; + if(file::exists(name)) xml.readfile(name); patchApplied = false; - string name; name << filepath(nall::basename(filename), config().path.patch); name << ".ups"; diff --git a/src/ui_qt/cartridge/cartridge.hpp b/bsnes/ui_qt/cartridge/cartridge.hpp similarity index 90% rename from src/ui_qt/cartridge/cartridge.hpp rename to bsnes/ui_qt/cartridge/cartridge.hpp index 12545233..0c4c6910 100644 --- a/src/ui_qt/cartridge/cartridge.hpp +++ b/bsnes/ui_qt/cartridge/cartridge.hpp @@ -7,6 +7,10 @@ public: string slotBName; //Sufami Turbo slot B file name bool patchApplied; //true if UPS patch was applied to image + string baseXml; + string slotAXml; + string slotBXml; + struct Information { string name; string region; @@ -29,7 +33,7 @@ public: void saveCheats(); private: - bool loadCartridge(string&, SNES::MappedRAM&); + bool loadCartridge(string&, string&, SNES::MappedRAM&); bool loadMemory(const char*, const char*, SNES::MappedRAM&); bool saveMemory(const char*, const char*, SNES::MappedRAM&); string decodeShiftJIS(const char*); diff --git a/src/ui_qt/config.cpp b/bsnes/ui_qt/config.cpp similarity index 87% rename from src/ui_qt/config.cpp rename to bsnes/ui_qt/config.cpp index e0a5b607..918a0996 100644 --- a/src/ui_qt/config.cpp +++ b/bsnes/ui_qt/config.cpp @@ -15,10 +15,10 @@ Configuration::Configuration() { //external //======== - attach(SNES::config.controller_port1 = SNES::Input::DeviceJoypad, "snes.controllerPort1"); - attach(SNES::config.controller_port2 = SNES::Input::DeviceJoypad, "snes.controllerPort2"); - attach(SNES::config.expansion_port = SNES::System::ExpansionBSX, "snes.expansionPort"); - attach(SNES::config.region = SNES::System::Autodetect, "snes.region"); + attach(SNES::config.controller_port1 = SNES::Input::Device::Joypad, "snes.controllerPort1"); + attach(SNES::config.controller_port2 = SNES::Input::Device::Joypad, "snes.controllerPort2"); + attach(SNES::config.expansion_port = SNES::System::ExpansionPortDevice::BSX, "snes.expansionPort"); + attach(SNES::config.region = SNES::System::Region::Autodetect, "snes.region"); attach(SNES::config.cpu.version = 2, "cpu.version", "Valid version(s) are: 1, 2"); attach(SNES::config.cpu.ntsc_clock_rate = 21477272, "cpu.ntscClockRate"); @@ -123,14 +123,15 @@ Configuration::Configuration() { attach(debugger.cacheUsageToDisk = false, "debugger.cacheUsageToDisk"); - attach(geometry.mainWindow = "", "geometry.mainWindow"); - attach(geometry.loaderWindow = "", "geometry.loaderWindow"); - attach(geometry.htmlViewerWindow = "", "geometry.htmlViewerWindow"); - attach(geometry.aboutWindow = "", "geometry.aboutWindow"); - attach(geometry.fileBrowser = "", "geometry.fileBrowser"); - attach(geometry.folderCreator = "", "geometry.folderCreator"); - attach(geometry.settingsWindow = "", "geometry.settingsWindow"); - attach(geometry.toolsWindow = "", "geometry.toolsWindow"); + attach(geometry.mainWindow = "", "geometry.mainWindow"); + attach(geometry.loaderWindow = "", "geometry.loaderWindow"); + attach(geometry.htmlViewerWindow = "", "geometry.htmlViewerWindow"); + attach(geometry.aboutWindow = "", "geometry.aboutWindow"); + attach(geometry.fileBrowser = "", "geometry.fileBrowser"); + attach(geometry.folderCreator = "", "geometry.folderCreator"); + attach(geometry.settingsWindow = "", "geometry.settingsWindow"); + attach(geometry.toolsWindow = "", "geometry.toolsWindow"); + attach(geometry.cheatImportWindow = "", "geometry.cheatImportWindow"); attach(geometry.debugger = "", "geometry.debugger"); attach(geometry.disassembler = "", "geometry.disassembler"); diff --git a/src/ui_qt/config.hpp b/bsnes/ui_qt/config.hpp similarity index 98% rename from src/ui_qt/config.hpp rename to bsnes/ui_qt/config.hpp index 3b7d88ce..49f17f67 100644 --- a/src/ui_qt/config.hpp +++ b/bsnes/ui_qt/config.hpp @@ -83,6 +83,7 @@ public: string folderCreator; string settingsWindow; string toolsWindow; + string cheatImportWindow; string debugger; string disassembler; diff --git a/src/ui_qt/debugger/debugger.cpp b/bsnes/ui_qt/debugger/debugger.cpp similarity index 96% rename from src/ui_qt/debugger/debugger.cpp rename to bsnes/ui_qt/debugger/debugger.cpp index e5818579..f82cc4e2 100644 --- a/src/ui_qt/debugger/debugger.cpp +++ b/bsnes/ui_qt/debugger/debugger.cpp @@ -187,11 +187,11 @@ void Debugger::event() { char t[256]; switch(SNES::debugger.break_event) { - case SNES::Debugger::BreakpointHit: { + case SNES::Debugger::BreakEvent::BreakpointHit: { unsigned n = SNES::debugger.breakpoint_hit; echo(string() << "Breakpoint " << n << " hit (" << SNES::debugger.breakpoint[n].counter << ").
"); - if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::CPUBus) { + if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::Source::CPUBus) { SNES::debugger.step_cpu = true; SNES::cpu.disassemble_opcode(t, SNES::cpu.opcode_pc); string s = t; @@ -200,7 +200,7 @@ void Debugger::event() { disassembler->refresh(Disassembler::CPU, SNES::cpu.opcode_pc); } - if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::APURAM) { + if(SNES::debugger.breakpoint[n].source == SNES::Debugger::Breakpoint::Source::APURAM) { SNES::debugger.step_smp = true; SNES::smp.disassemble_opcode(t, SNES::smp.opcode_pc); string s = t; @@ -210,7 +210,7 @@ void Debugger::event() { } } break; - case SNES::Debugger::CPUStep: { + case SNES::Debugger::BreakEvent::CPUStep: { SNES::cpu.disassemble_opcode(t, SNES::cpu.regs.pc); string s = t; s.replace(" ", " "); @@ -218,7 +218,7 @@ void Debugger::event() { disassembler->refresh(Disassembler::CPU, SNES::cpu.regs.pc); } break; - case SNES::Debugger::SMPStep: { + case SNES::Debugger::BreakEvent::SMPStep: { SNES::smp.disassemble_opcode(t, SNES::smp.regs.pc); string s = t; s.replace(" ", " "); @@ -232,7 +232,7 @@ void Debugger::event() { //called once every time a video frame is rendered, used to update "auto refresh" tool windows void Debugger::frameTick() { - if(++frameCounter >= (SNES::system.region() == SNES::System::NTSC ? 60 : 50)) { + if(++frameCounter >= (SNES::system.region() == SNES::System::Region::NTSC ? 60 : 50)) { frameCounter = 0; autoUpdate(); } diff --git a/src/ui_qt/debugger/debugger.moc.hpp b/bsnes/ui_qt/debugger/debugger.moc.hpp similarity index 100% rename from src/ui_qt/debugger/debugger.moc.hpp rename to bsnes/ui_qt/debugger/debugger.moc.hpp diff --git a/src/ui_qt/debugger/misc/debugger-options.cpp b/bsnes/ui_qt/debugger/misc/debugger-options.cpp similarity index 100% rename from src/ui_qt/debugger/misc/debugger-options.cpp rename to bsnes/ui_qt/debugger/misc/debugger-options.cpp diff --git a/src/ui_qt/debugger/misc/debugger-options.moc.hpp b/bsnes/ui_qt/debugger/misc/debugger-options.moc.hpp similarity index 100% rename from src/ui_qt/debugger/misc/debugger-options.moc.hpp rename to bsnes/ui_qt/debugger/misc/debugger-options.moc.hpp diff --git a/src/ui_qt/debugger/ppu/cgram-viewer.cpp b/bsnes/ui_qt/debugger/ppu/cgram-viewer.cpp similarity index 100% rename from src/ui_qt/debugger/ppu/cgram-viewer.cpp rename to bsnes/ui_qt/debugger/ppu/cgram-viewer.cpp diff --git a/src/ui_qt/debugger/ppu/cgram-viewer.moc.hpp b/bsnes/ui_qt/debugger/ppu/cgram-viewer.moc.hpp similarity index 100% rename from src/ui_qt/debugger/ppu/cgram-viewer.moc.hpp rename to bsnes/ui_qt/debugger/ppu/cgram-viewer.moc.hpp diff --git a/src/ui_qt/debugger/ppu/layer-toggle.cpp b/bsnes/ui_qt/debugger/ppu/layer-toggle.cpp similarity index 100% rename from src/ui_qt/debugger/ppu/layer-toggle.cpp rename to bsnes/ui_qt/debugger/ppu/layer-toggle.cpp diff --git a/src/ui_qt/debugger/ppu/layer-toggle.moc.hpp b/bsnes/ui_qt/debugger/ppu/layer-toggle.moc.hpp similarity index 100% rename from src/ui_qt/debugger/ppu/layer-toggle.moc.hpp rename to bsnes/ui_qt/debugger/ppu/layer-toggle.moc.hpp diff --git a/src/ui_qt/debugger/ppu/oam-viewer.cpp b/bsnes/ui_qt/debugger/ppu/oam-viewer.cpp similarity index 100% rename from src/ui_qt/debugger/ppu/oam-viewer.cpp rename to bsnes/ui_qt/debugger/ppu/oam-viewer.cpp diff --git a/src/ui_qt/debugger/ppu/oam-viewer.moc.hpp b/bsnes/ui_qt/debugger/ppu/oam-viewer.moc.hpp similarity index 100% rename from src/ui_qt/debugger/ppu/oam-viewer.moc.hpp rename to bsnes/ui_qt/debugger/ppu/oam-viewer.moc.hpp diff --git a/src/ui_qt/debugger/ppu/vram-viewer.cpp b/bsnes/ui_qt/debugger/ppu/vram-viewer.cpp similarity index 100% rename from src/ui_qt/debugger/ppu/vram-viewer.cpp rename to bsnes/ui_qt/debugger/ppu/vram-viewer.cpp diff --git a/src/ui_qt/debugger/ppu/vram-viewer.moc.hpp b/bsnes/ui_qt/debugger/ppu/vram-viewer.moc.hpp similarity index 100% rename from src/ui_qt/debugger/ppu/vram-viewer.moc.hpp rename to bsnes/ui_qt/debugger/ppu/vram-viewer.moc.hpp diff --git a/src/ui_qt/debugger/tools/breakpoint.cpp b/bsnes/ui_qt/debugger/tools/breakpoint.cpp similarity index 100% rename from src/ui_qt/debugger/tools/breakpoint.cpp rename to bsnes/ui_qt/debugger/tools/breakpoint.cpp diff --git a/src/ui_qt/debugger/tools/breakpoint.moc.hpp b/bsnes/ui_qt/debugger/tools/breakpoint.moc.hpp similarity index 100% rename from src/ui_qt/debugger/tools/breakpoint.moc.hpp rename to bsnes/ui_qt/debugger/tools/breakpoint.moc.hpp diff --git a/src/ui_qt/debugger/tools/disassembler.cpp b/bsnes/ui_qt/debugger/tools/disassembler.cpp similarity index 100% rename from src/ui_qt/debugger/tools/disassembler.cpp rename to bsnes/ui_qt/debugger/tools/disassembler.cpp diff --git a/src/ui_qt/debugger/tools/disassembler.moc.hpp b/bsnes/ui_qt/debugger/tools/disassembler.moc.hpp similarity index 100% rename from src/ui_qt/debugger/tools/disassembler.moc.hpp rename to bsnes/ui_qt/debugger/tools/disassembler.moc.hpp diff --git a/src/ui_qt/debugger/tools/memory.cpp b/bsnes/ui_qt/debugger/tools/memory.cpp similarity index 88% rename from src/ui_qt/debugger/tools/memory.cpp rename to bsnes/ui_qt/debugger/tools/memory.cpp index 84057d82..71811212 100644 --- a/src/ui_qt/debugger/tools/memory.cpp +++ b/bsnes/ui_qt/debugger/tools/memory.cpp @@ -16,10 +16,10 @@ MemoryEditor::MemoryEditor() { editor->reader = bind(&MemoryEditor::reader, this); editor->writer = bind(&MemoryEditor::writer, this); editor->setFont(QFont(Style::Monospace)); - editor->setMinimumWidth((HexEditor::LineWidth + 3) * editor->fontMetrics().width(' ')); + editor->setMinimumWidth((editor->lineWidth() + 3) * editor->fontMetrics().width(' ')); editor->setMinimumHeight((16 + 1) * editor->fontMetrics().height()); editor->setSize(16 * 1024 * 1024); - memorySource = SNES::Debugger::CPUBus; + memorySource = SNES::Debugger::MemorySource::CPUBus; layout->addWidget(editor); controlLayout = new QVBoxLayout; @@ -92,11 +92,11 @@ void MemoryEditor::show() { void MemoryEditor::sourceChanged(int index) { switch(index) { default: - case 0: memorySource = SNES::Debugger::CPUBus; editor->setSize(16 * 1024 * 1024); break; - case 1: memorySource = SNES::Debugger::APURAM; editor->setSize(64 * 1024); break; - case 2: memorySource = SNES::Debugger::VRAM; editor->setSize(64 * 1024); break; - case 3: memorySource = SNES::Debugger::OAM; editor->setSize(544); break; - case 4: memorySource = SNES::Debugger::CGRAM; editor->setSize(512); break; + case 0: memorySource = SNES::Debugger::MemorySource::CPUBus; editor->setSize(16 * 1024 * 1024); break; + case 1: memorySource = SNES::Debugger::MemorySource::APURAM; editor->setSize(64 * 1024); break; + case 2: memorySource = SNES::Debugger::MemorySource::VRAM; editor->setSize(64 * 1024); break; + case 3: memorySource = SNES::Debugger::MemorySource::OAM; editor->setSize(544); break; + case 4: memorySource = SNES::Debugger::MemorySource::CGRAM; editor->setSize(512); break; } editor->setOffset(strhex(addr->text().toUtf8().data())); diff --git a/src/ui_qt/debugger/tools/memory.moc.hpp b/bsnes/ui_qt/debugger/tools/memory.moc.hpp similarity index 100% rename from src/ui_qt/debugger/tools/memory.moc.hpp rename to bsnes/ui_qt/debugger/tools/memory.moc.hpp diff --git a/src/ui_qt/debugger/tools/properties.cpp b/bsnes/ui_qt/debugger/tools/properties.cpp similarity index 100% rename from src/ui_qt/debugger/tools/properties.cpp rename to bsnes/ui_qt/debugger/tools/properties.cpp diff --git a/src/ui_qt/debugger/tools/properties.moc.hpp b/bsnes/ui_qt/debugger/tools/properties.moc.hpp similarity index 100% rename from src/ui_qt/debugger/tools/properties.moc.hpp rename to bsnes/ui_qt/debugger/tools/properties.moc.hpp diff --git a/src/ui_qt/debugger/tracer.cpp b/bsnes/ui_qt/debugger/tracer.cpp similarity index 100% rename from src/ui_qt/debugger/tracer.cpp rename to bsnes/ui_qt/debugger/tracer.cpp diff --git a/src/ui_qt/debugger/tracer.moc.hpp b/bsnes/ui_qt/debugger/tracer.moc.hpp similarity index 100% rename from src/ui_qt/debugger/tracer.moc.hpp rename to bsnes/ui_qt/debugger/tracer.moc.hpp diff --git a/src/ui_qt/input/controller.cpp b/bsnes/ui_qt/input/controller.cpp similarity index 80% rename from src/ui_qt/input/controller.cpp rename to bsnes/ui_qt/input/controller.cpp index e69887cf..22d6ab68 100644 --- a/src/ui_qt/input/controller.cpp +++ b/bsnes/ui_qt/input/controller.cpp @@ -22,23 +22,23 @@ int16_t Gamepad::status(unsigned index, unsigned id) const { //block up+down and left+right combinations: //a real gamepad has a pivot in the D-pad that makes this impossible; //some software titles will crash if up+down or left+right are detected - if(id == SNES::Input::JoypadDown && up.cachedState) return 0; - if(id == SNES::Input::JoypadRight && left.cachedState) return 0; + if(id == (unsigned)SNES::Input::JoypadID::Down && up.cachedState) return 0; + if(id == (unsigned)SNES::Input::JoypadID::Right && left.cachedState) return 0; } switch(id) { - case SNES::Input::JoypadUp: return up.cachedState; - case SNES::Input::JoypadDown: return down.cachedState; - case SNES::Input::JoypadLeft: return left.cachedState; - case SNES::Input::JoypadRight: return right.cachedState; - case SNES::Input::JoypadA: return a.cachedState | turboA.cachedState; - case SNES::Input::JoypadB: return b.cachedState | turboB.cachedState; - case SNES::Input::JoypadX: return x.cachedState | turboX.cachedState; - case SNES::Input::JoypadY: return y.cachedState | turboY.cachedState; - case SNES::Input::JoypadL: return l.cachedState | turboL.cachedState; - case SNES::Input::JoypadR: return r.cachedState | turboR.cachedState; - case SNES::Input::JoypadSelect: return select.cachedState; - case SNES::Input::JoypadStart: return start.cachedState; + case SNES::Input::JoypadID::Up: return up.cachedState; + case SNES::Input::JoypadID::Down: return down.cachedState; + case SNES::Input::JoypadID::Left: return left.cachedState; + case SNES::Input::JoypadID::Right: return right.cachedState; + case SNES::Input::JoypadID::A: return a.cachedState | turboA.cachedState; + case SNES::Input::JoypadID::B: return b.cachedState | turboB.cachedState; + case SNES::Input::JoypadID::X: return x.cachedState | turboX.cachedState; + case SNES::Input::JoypadID::Y: return y.cachedState | turboY.cachedState; + case SNES::Input::JoypadID::L: return l.cachedState | turboL.cachedState; + case SNES::Input::JoypadID::R: return r.cachedState | turboR.cachedState; + case SNES::Input::JoypadID::Select: return select.cachedState; + case SNES::Input::JoypadID::Start: return start.cachedState; } return 0; } @@ -186,23 +186,23 @@ DigitalInput(label, configName) { int16_t Asciipad::status(unsigned index, unsigned id) const { if(config().input.allowInvalidInput == false) { - if(id == SNES::Input::JoypadDown && up.cachedState) return 0; - if(id == SNES::Input::JoypadRight && left.cachedState) return 0; + if(id == (unsigned)SNES::Input::JoypadID::Down && up.cachedState) return 0; + if(id == (unsigned)SNES::Input::JoypadID::Right && left.cachedState) return 0; } switch(id) { - case SNES::Input::JoypadUp: return up.cachedState; - case SNES::Input::JoypadDown: return down.cachedState; - case SNES::Input::JoypadLeft: return left.cachedState; - case SNES::Input::JoypadRight: return right.cachedState; - case SNES::Input::JoypadA: return a.cachedState; - case SNES::Input::JoypadB: return b.cachedState; - case SNES::Input::JoypadX: return x.cachedState; - case SNES::Input::JoypadY: return y.cachedState; - case SNES::Input::JoypadL: return l.cachedState; - case SNES::Input::JoypadR: return r.cachedState; - case SNES::Input::JoypadSelect: return select.cachedState; - case SNES::Input::JoypadStart: return start.cachedState | slowMotion.cachedState; + case SNES::Input::JoypadID::Up: return up.cachedState; + case SNES::Input::JoypadID::Down: return down.cachedState; + case SNES::Input::JoypadID::Left: return left.cachedState; + case SNES::Input::JoypadID::Right: return right.cachedState; + case SNES::Input::JoypadID::A: return a.cachedState; + case SNES::Input::JoypadID::B: return b.cachedState; + case SNES::Input::JoypadID::X: return x.cachedState; + case SNES::Input::JoypadID::Y: return y.cachedState; + case SNES::Input::JoypadID::L: return l.cachedState; + case SNES::Input::JoypadID::R: return r.cachedState; + case SNES::Input::JoypadID::Select: return select.cachedState; + case SNES::Input::JoypadID::Start: return start.cachedState | slowMotion.cachedState; } return 0; } @@ -261,10 +261,10 @@ slowMotion("Slow Motion", string() << "input." << configName << ".slowMotion") { int16_t Mouse::status(unsigned index, unsigned id) const { switch(id) { - case SNES::Input::MouseX: return x.cachedState; - case SNES::Input::MouseY: return y.cachedState; - case SNES::Input::MouseLeft: return left.cachedState; - case SNES::Input::MouseRight: return right.cachedState; + case SNES::Input::MouseID::X: return x.cachedState; + case SNES::Input::MouseID::Y: return y.cachedState; + case SNES::Input::MouseID::Left: return left.cachedState; + case SNES::Input::MouseID::Right: return right.cachedState; } return 0; } @@ -287,12 +287,12 @@ right("Right Button", string() << "input." << configName << ".right") { int16_t SuperScope::status(unsigned index, unsigned id) const { switch(id) { - case SNES::Input::SuperScopeX: return x.cachedState; - case SNES::Input::SuperScopeY: return y.cachedState; - case SNES::Input::SuperScopeTrigger: return trigger.cachedState; - case SNES::Input::SuperScopeCursor: return cursor.cachedState; - case SNES::Input::SuperScopeTurbo: return turbo.cachedState; - case SNES::Input::SuperScopePause: return pause.cachedState; + case SNES::Input::SuperScopeID::X: return x.cachedState; + case SNES::Input::SuperScopeID::Y: return y.cachedState; + case SNES::Input::SuperScopeID::Trigger: return trigger.cachedState; + case SNES::Input::SuperScopeID::Cursor: return cursor.cachedState; + case SNES::Input::SuperScopeID::Turbo: return turbo.cachedState; + case SNES::Input::SuperScopeID::Pause: return pause.cachedState; } return 0; } @@ -320,10 +320,10 @@ pause("Pause", string() << "input." << configName << ".pause") { int16_t Justifier::status(unsigned index, unsigned id) const { switch(id) { - case SNES::Input::JustifierX: return x.cachedState; - case SNES::Input::JustifierY: return y.cachedState; - case SNES::Input::JustifierTrigger: return trigger.cachedState; - case SNES::Input::JustifierStart: return start.cachedState; + case SNES::Input::JustifierID::X: return x.cachedState; + case SNES::Input::JustifierID::Y: return y.cachedState; + case SNES::Input::JustifierID::Trigger: return trigger.cachedState; + case SNES::Input::JustifierID::Start: return start.cachedState; } return 0; } diff --git a/src/ui_qt/input/controller.hpp b/bsnes/ui_qt/input/controller.hpp similarity index 100% rename from src/ui_qt/input/controller.hpp rename to bsnes/ui_qt/input/controller.hpp diff --git a/src/ui_qt/input/input.cpp b/bsnes/ui_qt/input/input.cpp similarity index 98% rename from src/ui_qt/input/input.cpp rename to bsnes/ui_qt/input/input.cpp index aa9ce855..7add4f38 100644 --- a/src/ui_qt/input/input.cpp +++ b/bsnes/ui_qt/input/input.cpp @@ -229,7 +229,7 @@ void InputMapper::cache() { } } -int16_t InputMapper::status(bool port, unsigned device, unsigned index, unsigned id) { +int16_t InputMapper::status(bool port, SNES::Input::Device device, unsigned index, unsigned id) { int16_t result = 0; if(port == InputCategory::Port1 && port1) result = port1->status(index, id); diff --git a/src/ui_qt/input/input.hpp b/bsnes/ui_qt/input/input.hpp similarity index 96% rename from src/ui_qt/input/input.hpp rename to bsnes/ui_qt/input/input.hpp index 02c7c7dd..c08271bc 100644 --- a/src/ui_qt/input/input.hpp +++ b/bsnes/ui_qt/input/input.hpp @@ -74,7 +74,7 @@ struct InputMapper : public array { void bind(); void poll(); void cache(); - int16_t status(bool, unsigned, unsigned, unsigned); + int16_t status(bool, SNES::Input::Device, unsigned, unsigned); string modifierString() const; int16_t state(uint16_t) const; diff --git a/src/ui_qt/input/userinterface-emulationspeed.cpp b/bsnes/ui_qt/input/userinterface-emulationspeed.cpp similarity index 100% rename from src/ui_qt/input/userinterface-emulationspeed.cpp rename to bsnes/ui_qt/input/userinterface-emulationspeed.cpp diff --git a/src/ui_qt/input/userinterface-general.cpp b/bsnes/ui_qt/input/userinterface-general.cpp similarity index 87% rename from src/ui_qt/input/userinterface-general.cpp rename to bsnes/ui_qt/input/userinterface-general.cpp index 82892c7d..e8a5d535 100644 --- a/src/ui_qt/input/userinterface-general.cpp +++ b/bsnes/ui_qt/input/userinterface-general.cpp @@ -26,11 +26,12 @@ struct ToggleStatusbar : HotkeyInput { struct ToggleCheatSystem : HotkeyInput { void pressed() { - if(SNES::cheat.enabled() == false) { - SNES::cheat.enable(true); + //there is a signal attached to cheatEnableBox that will update SNES::cheat.enable(bool); + if(cheatEditorWindow->cheatEnableBox->isChecked() == false) { + cheatEditorWindow->cheatEnableBox->setChecked(true); utility.showMessage("Cheat system enabled."); } else { - SNES::cheat.enable(false); + cheatEditorWindow->cheatEnableBox->setChecked(false); utility.showMessage("Cheat system disabled."); } } diff --git a/src/ui_qt/input/userinterface-states.cpp b/bsnes/ui_qt/input/userinterface-states.cpp similarity index 100% rename from src/ui_qt/input/userinterface-states.cpp rename to bsnes/ui_qt/input/userinterface-states.cpp diff --git a/src/ui_qt/input/userinterface-system.cpp b/bsnes/ui_qt/input/userinterface-system.cpp similarity index 100% rename from src/ui_qt/input/userinterface-system.cpp rename to bsnes/ui_qt/input/userinterface-system.cpp diff --git a/src/ui_qt/input/userinterface-videosettings.cpp b/bsnes/ui_qt/input/userinterface-videosettings.cpp similarity index 100% rename from src/ui_qt/input/userinterface-videosettings.cpp rename to bsnes/ui_qt/input/userinterface-videosettings.cpp diff --git a/src/ui_qt/input/userinterface.hpp b/bsnes/ui_qt/input/userinterface.hpp similarity index 100% rename from src/ui_qt/input/userinterface.hpp rename to bsnes/ui_qt/input/userinterface.hpp diff --git a/src/ui_qt/interface.cpp b/bsnes/ui_qt/interface.cpp similarity index 95% rename from src/ui_qt/interface.cpp rename to bsnes/ui_qt/interface.cpp index 8dcf4dd8..49fca028 100644 --- a/src/ui_qt/interface.cpp +++ b/bsnes/ui_qt/interface.cpp @@ -37,7 +37,7 @@ void Interface::input_poll() { mapper().cache(); } -int16_t Interface::input_poll(bool port, unsigned device, unsigned index, unsigned id) { +int16_t Interface::input_poll(bool port, SNES::Input::Device device, unsigned index, unsigned id) { return mapper().status(port, device, index, id); } diff --git a/src/ui_qt/interface.hpp b/bsnes/ui_qt/interface.hpp similarity index 80% rename from src/ui_qt/interface.hpp rename to bsnes/ui_qt/interface.hpp index a3cb1ed6..8a5296c2 100644 --- a/src/ui_qt/interface.hpp +++ b/bsnes/ui_qt/interface.hpp @@ -3,7 +3,7 @@ public: void video_refresh(uint16_t *data, unsigned pitch, unsigned *line, unsigned width, unsigned height); void audio_sample(uint16_t left, uint16_t right); void input_poll(); - int16_t input_poll(bool port, unsigned device, unsigned index, unsigned id); + int16_t input_poll(bool port, SNES::Input::Device device, unsigned index, unsigned id); Interface(); void captureScreenshot(uint32_t*, unsigned, unsigned, unsigned); diff --git a/src/ui_qt/link/filter.cpp b/bsnes/ui_qt/link/filter.cpp similarity index 100% rename from src/ui_qt/link/filter.cpp rename to bsnes/ui_qt/link/filter.cpp diff --git a/src/ui_qt/link/filter.hpp b/bsnes/ui_qt/link/filter.hpp similarity index 100% rename from src/ui_qt/link/filter.hpp rename to bsnes/ui_qt/link/filter.hpp diff --git a/src/ui_qt/link/reader.cpp b/bsnes/ui_qt/link/reader.cpp similarity index 90% rename from src/ui_qt/link/reader.cpp rename to bsnes/ui_qt/link/reader.cpp index e5f9d43f..4498b9a8 100644 --- a/src/ui_qt/link/reader.cpp +++ b/bsnes/ui_qt/link/reader.cpp @@ -4,7 +4,7 @@ const char* Reader::direct_supported() { return ""; } -bool Reader::direct_load(string &filename, uint8_t *&data, unsigned &size) { +bool Reader::direct_load(string &filename, string &xml, uint8_t *&data, unsigned &size) { if(file::exists(filename) == false) return false; file fp; @@ -17,6 +17,7 @@ bool Reader::direct_load(string &filename, uint8_t *&data, unsigned &size) { //remove copier header, if it exists if((size & 0x7fff) == 512) memmove(data, data + 512, size -= 512); + xml = ""; return true; } diff --git a/src/ui_qt/link/reader.hpp b/bsnes/ui_qt/link/reader.hpp similarity index 62% rename from src/ui_qt/link/reader.hpp rename to bsnes/ui_qt/link/reader.hpp index 1cc93411..2863d667 100644 --- a/src/ui_qt/link/reader.hpp +++ b/bsnes/ui_qt/link/reader.hpp @@ -4,10 +4,10 @@ public: string extensionList; function supported; - function load; + function load; const char* direct_supported(); - bool direct_load(string&, uint8_t*&, unsigned&); + bool direct_load(string&, string&, uint8_t*&, unsigned&); Reader(); }; diff --git a/src/ui_qt/main.cpp b/bsnes/ui_qt/main.cpp similarity index 100% rename from src/ui_qt/main.cpp rename to bsnes/ui_qt/main.cpp diff --git a/src/ui_qt/movie/movie.cpp b/bsnes/ui_qt/movie/movie.cpp similarity index 100% rename from src/ui_qt/movie/movie.cpp rename to bsnes/ui_qt/movie/movie.cpp diff --git a/src/ui_qt/movie/movie.hpp b/bsnes/ui_qt/movie/movie.hpp similarity index 100% rename from src/ui_qt/movie/movie.hpp rename to bsnes/ui_qt/movie/movie.hpp diff --git a/src/ui_qt/platform/platform_osx.cpp b/bsnes/ui_qt/platform/platform_osx.cpp similarity index 100% rename from src/ui_qt/platform/platform_osx.cpp rename to bsnes/ui_qt/platform/platform_osx.cpp diff --git a/src/ui_qt/platform/platform_win.cpp b/bsnes/ui_qt/platform/platform_win.cpp similarity index 100% rename from src/ui_qt/platform/platform_win.cpp rename to bsnes/ui_qt/platform/platform_win.cpp diff --git a/src/ui_qt/platform/platform_x.cpp b/bsnes/ui_qt/platform/platform_x.cpp similarity index 100% rename from src/ui_qt/platform/platform_x.cpp rename to bsnes/ui_qt/platform/platform_x.cpp diff --git a/src/ui_qt/resource/resource.qrc b/bsnes/ui_qt/resource/resource.qrc similarity index 97% rename from src/ui_qt/resource/resource.qrc rename to bsnes/ui_qt/resource/resource.qrc index 0156d64b..6dbd37c1 100644 --- a/src/ui_qt/resource/resource.qrc +++ b/bsnes/ui_qt/resource/resource.qrc @@ -5,6 +5,7 @@ ../../data/logo.png ../../data/documentation.html ../../data/license.html + ../../data/cheats.xml ../../data/icons-16x16/item-check-on.png ../../data/icons-16x16/item-check-off.png diff --git a/src/ui_qt/resource/resource.rc b/bsnes/ui_qt/resource/resource.rc similarity index 100% rename from src/ui_qt/resource/resource.rc rename to bsnes/ui_qt/resource/resource.rc diff --git a/src/ui_qt/settings/advanced.cpp b/bsnes/ui_qt/settings/advanced.cpp similarity index 92% rename from src/ui_qt/settings/advanced.cpp rename to bsnes/ui_qt/settings/advanced.cpp index f28fb2f4..f25bd1e8 100644 --- a/src/ui_qt/settings/advanced.cpp +++ b/bsnes/ui_qt/settings/advanced.cpp @@ -149,12 +149,12 @@ void AdvancedSettingsWindow::initializeUi() { if(part[i] == config().system.input) inputDriver->setCurrentIndex(i); } - regionAuto->setChecked(SNES::config.region == SNES::System::Autodetect); - regionNTSC->setChecked(SNES::config.region == SNES::System::NTSC); - regionPAL->setChecked (SNES::config.region == SNES::System::PAL); + regionAuto->setChecked(SNES::config.region == SNES::System::Region::Autodetect); + regionNTSC->setChecked(SNES::config.region == SNES::System::Region::NTSC); + regionPAL->setChecked (SNES::config.region == SNES::System::Region::PAL); - portSatellaview->setChecked(SNES::config.expansion_port == SNES::System::ExpansionBSX); - portNone->setChecked (SNES::config.expansion_port == SNES::System::ExpansionNone); + portSatellaview->setChecked(SNES::config.expansion_port == SNES::System::ExpansionPortDevice::BSX); + portNone->setChecked (SNES::config.expansion_port == SNES::System::ExpansionPortDevice::None); focusPause->setChecked (config().input.focusPolicy == Configuration::Input::FocusPolicyPauseEmulation); focusIgnore->setChecked(config().input.focusPolicy == Configuration::Input::FocusPolicyIgnoreInput); @@ -175,12 +175,12 @@ void AdvancedSettingsWindow::inputDriverChange(int index) { if(index >= 0) config().system.input = inputDriver->itemText(index).toUtf8().data(); } -void AdvancedSettingsWindow::setRegionAuto() { SNES::config.region = SNES::System::Autodetect; } -void AdvancedSettingsWindow::setRegionNTSC() { SNES::config.region = SNES::System::NTSC; } -void AdvancedSettingsWindow::setRegionPAL() { SNES::config.region = SNES::System::PAL; } +void AdvancedSettingsWindow::setRegionAuto() { SNES::config.region = SNES::System::Region::Autodetect; } +void AdvancedSettingsWindow::setRegionNTSC() { SNES::config.region = SNES::System::Region::NTSC; } +void AdvancedSettingsWindow::setRegionPAL() { SNES::config.region = SNES::System::Region::PAL; } -void AdvancedSettingsWindow::setPortSatellaview() { SNES::config.expansion_port = SNES::System::ExpansionBSX; } -void AdvancedSettingsWindow::setPortNone() { SNES::config.expansion_port = SNES::System::ExpansionNone; } +void AdvancedSettingsWindow::setPortSatellaview() { SNES::config.expansion_port = SNES::System::ExpansionPortDevice::BSX; } +void AdvancedSettingsWindow::setPortNone() { SNES::config.expansion_port = SNES::System::ExpansionPortDevice::None; } void AdvancedSettingsWindow::pauseWithoutFocus() { config().input.focusPolicy = Configuration::Input::FocusPolicyPauseEmulation; } void AdvancedSettingsWindow::ignoreInputWithoutFocus() { config().input.focusPolicy = Configuration::Input::FocusPolicyIgnoreInput; } diff --git a/src/ui_qt/settings/advanced.moc.hpp b/bsnes/ui_qt/settings/advanced.moc.hpp similarity index 100% rename from src/ui_qt/settings/advanced.moc.hpp rename to bsnes/ui_qt/settings/advanced.moc.hpp diff --git a/src/ui_qt/settings/audio.cpp b/bsnes/ui_qt/settings/audio.cpp similarity index 100% rename from src/ui_qt/settings/audio.cpp rename to bsnes/ui_qt/settings/audio.cpp diff --git a/src/ui_qt/settings/audio.moc.hpp b/bsnes/ui_qt/settings/audio.moc.hpp similarity index 100% rename from src/ui_qt/settings/audio.moc.hpp rename to bsnes/ui_qt/settings/audio.moc.hpp diff --git a/src/ui_qt/settings/input.cpp b/bsnes/ui_qt/settings/input.cpp similarity index 100% rename from src/ui_qt/settings/input.cpp rename to bsnes/ui_qt/settings/input.cpp diff --git a/src/ui_qt/settings/input.moc.hpp b/bsnes/ui_qt/settings/input.moc.hpp similarity index 100% rename from src/ui_qt/settings/input.moc.hpp rename to bsnes/ui_qt/settings/input.moc.hpp diff --git a/src/ui_qt/settings/paths.cpp b/bsnes/ui_qt/settings/paths.cpp similarity index 100% rename from src/ui_qt/settings/paths.cpp rename to bsnes/ui_qt/settings/paths.cpp diff --git a/src/ui_qt/settings/paths.moc.hpp b/bsnes/ui_qt/settings/paths.moc.hpp similarity index 100% rename from src/ui_qt/settings/paths.moc.hpp rename to bsnes/ui_qt/settings/paths.moc.hpp diff --git a/src/ui_qt/settings/settings.cpp b/bsnes/ui_qt/settings/settings.cpp similarity index 100% rename from src/ui_qt/settings/settings.cpp rename to bsnes/ui_qt/settings/settings.cpp diff --git a/src/ui_qt/settings/settings.moc.hpp b/bsnes/ui_qt/settings/settings.moc.hpp similarity index 100% rename from src/ui_qt/settings/settings.moc.hpp rename to bsnes/ui_qt/settings/settings.moc.hpp diff --git a/src/ui_qt/settings/video.cpp b/bsnes/ui_qt/settings/video.cpp similarity index 100% rename from src/ui_qt/settings/video.cpp rename to bsnes/ui_qt/settings/video.cpp diff --git a/src/ui_qt/settings/video.moc.hpp b/bsnes/ui_qt/settings/video.moc.hpp similarity index 100% rename from src/ui_qt/settings/video.moc.hpp rename to bsnes/ui_qt/settings/video.moc.hpp diff --git a/src/ui_qt/state/state.cpp b/bsnes/ui_qt/state/state.cpp similarity index 96% rename from src/ui_qt/state/state.cpp rename to bsnes/ui_qt/state/state.cpp index a35c9141..6422e4ea 100644 --- a/src/ui_qt/state/state.cpp +++ b/bsnes/ui_qt/state/state.cpp @@ -52,7 +52,7 @@ void State::frame() { if(!config().system.rewindEnabled) return; //if a full second has passed, automatically capture state - if(++frameCounter >= (SNES::system.region() == SNES::System::NTSC ? 60 : 50)) { + if(++frameCounter >= (SNES::system.region() == SNES::System::Region::NTSC ? 60 : 50)) { frameCounter = 0; historyIndex = (historyIndex + 1) % historySize; historyCount = min(historyCount + 1, historySize); diff --git a/src/ui_qt/state/state.hpp b/bsnes/ui_qt/state/state.hpp similarity index 100% rename from src/ui_qt/state/state.hpp rename to bsnes/ui_qt/state/state.hpp diff --git a/src/ui_qt/tools/cheateditor.cpp b/bsnes/ui_qt/tools/cheateditor.cpp similarity index 50% rename from src/ui_qt/tools/cheateditor.cpp rename to bsnes/ui_qt/tools/cheateditor.cpp index c1e20291..65850051 100644 --- a/src/ui_qt/tools/cheateditor.cpp +++ b/bsnes/ui_qt/tools/cheateditor.cpp @@ -1,8 +1,10 @@ #include "cheateditor.moc" CheatEditorWindow *cheatEditorWindow; +CheatImportWindow *cheatImportWindow; CheatEditorWindow::CheatEditorWindow() { lock = false; + document = 0; layout = new QVBoxLayout; layout->setMargin(Style::WindowMargin); @@ -38,23 +40,37 @@ CheatEditorWindow::CheatEditorWindow() { gridLayout->addWidget(descEdit, 1, 1); controlLayout = new QHBoxLayout; - controlLayout->setAlignment(Qt::AlignRight); layout->addLayout(controlLayout); + cheatEnableBox = new QCheckBox("Enable Cheat Engine"); + cheatEnableBox->setToolTip("Unchecking this disables all cheat codes"); + cheatEnableBox->setChecked(SNES::cheat.enabled()); + controlLayout->addWidget(cheatEnableBox); + + spacer = new QWidget; + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + controlLayout->addWidget(spacer); + + findButton = new QPushButton("Find Cheat Codes ..."); + controlLayout->addWidget(findButton); + clearButton = new QPushButton("Clear Selected"); controlLayout->addWidget(clearButton); + cheatImportWindow = new CheatImportWindow; synchronize(); connect(list, SIGNAL(itemSelectionChanged()), this, SLOT(listChanged())); connect(list, SIGNAL(itemChanged(QTreeWidgetItem*, int)), this, SLOT(bind())); connect(codeEdit, SIGNAL(textEdited(const QString&)), this, SLOT(codeEdited())); connect(descEdit, SIGNAL(textEdited(const QString&)), this, SLOT(descEdited())); + connect(cheatEnableBox, SIGNAL(stateChanged(int)), this, SLOT(toggleCheatEnable())); + connect(findButton, SIGNAL(released()), this, SLOT(findCheatCodes())); connect(clearButton, SIGNAL(released()), this, SLOT(clearSelected())); } void CheatEditorWindow::synchronize() { - QList items = list->selectedItems(); + auto items = list->selectedItems(); if(items.count() == 1) { descEdit->setEnabled(true); codeEdit->setEnabled(true); @@ -65,6 +81,8 @@ void CheatEditorWindow::synchronize() { codeEdit->setEnabled(false); } clearButton->setEnabled(items.count() > 0); + findButton->setEnabled(SNES::cartridge.loaded()); + if(SNES::cartridge.loaded() == false && cheatImportWindow->isVisible()) cheatImportWindow->close(); } void CheatEditorWindow::load(const char *filename) { @@ -90,9 +108,9 @@ void CheatEditorWindow::load(const char *filename) { trim(part[2], "\""); part[2].replace("\\q", "\""); - QTreeWidgetItem *item = new QTreeWidgetItem(list); + auto item = new QTreeWidgetItem(list); item->setData(0, Qt::UserRole, QVariant(i)); - item->setText(0, string::printf("%3u", i + 1)); + item->setText(0, strunsigned<3, ' '>(i + 1)); item->setCheckState(0, part[0] == "enabled" ? Qt::Checked : Qt::Unchecked); item->setText(1, part[1]); item->setText(2, part[2]); @@ -111,9 +129,8 @@ void CheatEditorWindow::save(const char *filename) { bool empty = true; string data[128]; - QList items = list->findItems("", Qt::MatchContains); - for(unsigned i = 0; i < items.count(); i++) { - QTreeWidgetItem *item = items[i]; + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) { unsigned index = item->data(0, Qt::UserRole).toUInt(); string code = item->text(1).toUtf8().constData(); string desc = item->text(2).toUtf8().constData(); @@ -148,9 +165,8 @@ void CheatEditorWindow::save(const char *filename) { } void CheatEditorWindow::update() { - QList items = list->findItems("", Qt::MatchContains); - for(unsigned i = 0; i < items.count(); i++) { - QTreeWidgetItem *item = items[i]; + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) { string code = item->text(1).toUtf8().constData(); string desc = item->text(2).toUtf8().constData(); if((code != "") || (desc != "")) { @@ -173,9 +189,8 @@ void CheatEditorWindow::update() { void CheatEditorWindow::bind() { if(lock) return; - QList items = list->findItems("", Qt::MatchContains); - for(unsigned i = 0; i < items.count(); i++) { - QTreeWidgetItem *item = items[i]; + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) { unsigned index = item->data(0, Qt::UserRole).toUInt(); SNES::cheat[index] = item->text(1).toUtf8().constData(); SNES::cheat[index].enabled = item->checkState(0) == Qt::Checked; @@ -186,9 +201,9 @@ void CheatEditorWindow::bind() { void CheatEditorWindow::listChanged() { if(lock) return; - QList items = list->selectedItems(); + auto items = list->selectedItems(); if(items.count() > 0) { - QTreeWidgetItem *item = items[0]; + auto item = items[0]; codeEdit->setText(item->text(1)); descEdit->setText(item->text(2)); } @@ -198,9 +213,9 @@ void CheatEditorWindow::listChanged() { void CheatEditorWindow::codeEdited() { if(lock) return; - QList items = list->selectedItems(); + auto items = list->selectedItems(); if(items.count() == 1) { - QTreeWidgetItem *item = items[0]; + auto item = items[0]; item->setText(1, codeEdit->text()); } bind(); @@ -210,20 +225,52 @@ void CheatEditorWindow::codeEdited() { void CheatEditorWindow::descEdited() { if(lock) return; - QList items = list->selectedItems(); + auto items = list->selectedItems(); if(items.count() == 1) { - QTreeWidgetItem *item = items[0]; + auto item = items[0]; item->setText(2, descEdit->text()); } update(); } +void CheatEditorWindow::toggleCheatEnable() { + SNES::cheat.enable(cheatEnableBox->isChecked()); +} + +void CheatEditorWindow::findCheatCodes() { + string data; + QFile file(":/cheats.xml"); + if(file.open(QIODevice::ReadOnly | QIODevice::Text)) { + data = file.readAll().constData(); + file.close(); + } + + signed position = strpos(data, SNES::cartridge.sha256()) - 19; + if(position >= 0) { + const char *block = (const char*)data + position; + position = strpos(block, "
"); + if(position >= 0) { + xml_element *document = xml_parse(substr(block, 0, position + 12)); + if(!document) return; + + cheatImportWindow->refresh(document->element[0]); + cheatImportWindow->show(); + return; + } + } + + audio.clear(); + QMessageBox::information(toolsWindow, "Cheat Code Importer", + "Sorry, no cheat codes were found for the currently loaded cartridge." + ); +} + void CheatEditorWindow::clearSelected() { if(lock) return; - QList items = list->selectedItems(); - for(unsigned i = 0; i < items.count(); i++) { - QTreeWidgetItem *item = items[i]; + auto items = list->selectedItems(); + foreach(item, items) { + item->setCheckState(0, Qt::Unchecked); item->setText(1, ""); item->setText(2, ""); } @@ -232,3 +279,114 @@ void CheatEditorWindow::clearSelected() { bind(); update(); } + +//================= +//CheatImportWindow +//================= + +void CheatImportWindow::refresh(xml_element *root) { + list->clear(); + + foreach(node, root->element) { + if(node->name == "name") { + title->setText(string() << "Name: " << node->parse()); + } else if(node->name == "cheat") { + string description = ""; + string code = ""; + + foreach(leaf, node->element) { + if(leaf->name == "description") { + description = leaf->parse(); + } else if(leaf->name == "code") { + if(code != "") code << "+"; + code << leaf->content; + } + } + + auto item = new QTreeWidgetItem(list); + item->setCheckState(0, Qt::Unchecked); + item->setText(0, string() << description); + QString qcode = code; + item->setData(0, Qt::UserRole, QVariant(qcode)); + } + } +} + +CheatImportWindow::CheatImportWindow() { + resize(640, 360); + + setObjectName("cheat-import-window"); + setWindowTitle("Cheat Code Importer"); + setGeometryString(&config().geometry.cheatImportWindow); + application.windowList.add(this); + + layout = new QVBoxLayout; + layout->setMargin(Style::WindowMargin); + layout->setSpacing(Style::WidgetSpacing); + setLayout(layout); + + title = new QLabel("Test"); + layout->addWidget(title); + + list = new QTreeWidget; + list->setColumnCount(1); + list->setAllColumnsShowFocus(true); + list->setRootIsDecorated(false); + list->setHeaderHidden(true); + layout->addWidget(list); + + controlLayout = new QHBoxLayout; + layout->addLayout(controlLayout); + + selectAllButton = new QPushButton("Select All"); + controlLayout->addWidget(selectAllButton); + + clearAllButton = new QPushButton("Clear All"); + controlLayout->addWidget(clearAllButton); + + spacer = new QWidget; + spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + controlLayout->addWidget(spacer); + + okButton = new QPushButton("Ok"); + controlLayout->addWidget(okButton); + + cancelButton = new QPushButton("Cancel"); + controlLayout->addWidget(cancelButton); + + connect(selectAllButton, SIGNAL(released()), this, SLOT(selectAllCodes())); + connect(clearAllButton, SIGNAL(released()), this, SLOT(clearAllCodes())); + connect(okButton, SIGNAL(released()), this, SLOT(addSelectedCodes())); + connect(cancelButton, SIGNAL(released()), this, SLOT(close())); +} + +void CheatImportWindow::selectAllCodes() { + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) item->setCheckState(0, Qt::Checked); +} + +void CheatImportWindow::clearAllCodes() { + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) item->setCheckState(0, Qt::Unchecked); +} + +void CheatImportWindow::addSelectedCodes() { + auto items = list->findItems("", Qt::MatchContains); + foreach(item, items) { + if(item->checkState(0) == Qt::Checked) { + auto codeslots = cheatEditorWindow->list->findItems("", Qt::MatchContains); + foreach(codeslot, codeslots) { + if(codeslot->text(1) == "" && codeslot->text(2) == "") { + codeslot->setCheckState(0, Qt::Unchecked); + codeslot->setText(1, item->data(0, Qt::UserRole).toString()); + codeslot->setText(2, item->text(0)); + break; + } + } + } + } + + cheatEditorWindow->bind(); + cheatEditorWindow->update(); + close(); +} diff --git a/bsnes/ui_qt/tools/cheateditor.moc.hpp b/bsnes/ui_qt/tools/cheateditor.moc.hpp new file mode 100644 index 00000000..1764ed6c --- /dev/null +++ b/bsnes/ui_qt/tools/cheateditor.moc.hpp @@ -0,0 +1,65 @@ +class CheatEditorWindow : public QWidget { + Q_OBJECT + +public: + QVBoxLayout *layout; + QTreeWidget *list; + QGridLayout *gridLayout; + QLabel *codeLabel; + QLineEdit *codeEdit; + QLabel *descLabel; + QLineEdit *descEdit; + QHBoxLayout *controlLayout; + QCheckBox *cheatEnableBox; + QWidget *spacer; + QPushButton *findButton; + QPushButton *clearButton; + + void load(const char *filename); + void save(const char *filename); + void update(); + + void synchronize(); + CheatEditorWindow(); + +private slots: + void bind(); + void listChanged(); + void codeEdited(); + void descEdited(); + void toggleCheatEnable(); + void findCheatCodes(); + void clearSelected(); + +private: + bool lock; + xml_element *document; + friend class CheatImportWindow; +}; + +class CheatImportWindow : public Window { + Q_OBJECT + +public: + QVBoxLayout *layout; + QLabel *title; + QTreeWidget *list; + QHBoxLayout *controlLayout; + QPushButton *selectAllButton; + QPushButton *clearAllButton; + QWidget *spacer; + QPushButton *okButton; + QPushButton *cancelButton; + + void refresh(xml_element*); + + CheatImportWindow(); + +private slots: + void selectAllCodes(); + void clearAllCodes(); + void addSelectedCodes(); +}; + +extern CheatEditorWindow *cheatEditorWindow; +extern CheatImportWindow *cheatImportWindow; diff --git a/src/ui_qt/tools/cheatfinder.cpp b/bsnes/ui_qt/tools/cheatfinder.cpp similarity index 100% rename from src/ui_qt/tools/cheatfinder.cpp rename to bsnes/ui_qt/tools/cheatfinder.cpp diff --git a/src/ui_qt/tools/cheatfinder.moc.hpp b/bsnes/ui_qt/tools/cheatfinder.moc.hpp similarity index 100% rename from src/ui_qt/tools/cheatfinder.moc.hpp rename to bsnes/ui_qt/tools/cheatfinder.moc.hpp diff --git a/src/ui_qt/tools/statemanager.cpp b/bsnes/ui_qt/tools/statemanager.cpp similarity index 100% rename from src/ui_qt/tools/statemanager.cpp rename to bsnes/ui_qt/tools/statemanager.cpp diff --git a/src/ui_qt/tools/statemanager.moc.hpp b/bsnes/ui_qt/tools/statemanager.moc.hpp similarity index 100% rename from src/ui_qt/tools/statemanager.moc.hpp rename to bsnes/ui_qt/tools/statemanager.moc.hpp diff --git a/src/ui_qt/tools/tools.cpp b/bsnes/ui_qt/tools/tools.cpp similarity index 100% rename from src/ui_qt/tools/tools.cpp rename to bsnes/ui_qt/tools/tools.cpp diff --git a/src/ui_qt/tools/tools.moc.hpp b/bsnes/ui_qt/tools/tools.moc.hpp similarity index 100% rename from src/ui_qt/tools/tools.moc.hpp rename to bsnes/ui_qt/tools/tools.moc.hpp diff --git a/src/ui_qt/ui-base.hpp b/bsnes/ui_qt/ui-base.hpp similarity index 98% rename from src/ui_qt/ui-base.hpp rename to bsnes/ui_qt/ui-base.hpp index 0761c8b5..6d02aa56 100644 --- a/src/ui_qt/ui-base.hpp +++ b/bsnes/ui_qt/ui-base.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/src/ui_qt/utility/system-state.cpp b/bsnes/ui_qt/utility/system-state.cpp similarity index 94% rename from src/ui_qt/utility/system-state.cpp rename to bsnes/ui_qt/utility/system-state.cpp index 8db0f8d4..03067875 100644 --- a/src/ui_qt/utility/system-state.cpp +++ b/bsnes/ui_qt/utility/system-state.cpp @@ -19,9 +19,9 @@ void Utility::modifySystemState(system_state_t systemState) { //warn if unsupported hardware detected string chip; if(0); - else if(SNES::cartridge.has_dsp3()) chip = "DSP3"; - else if(SNES::cartridge.has_st011()) chip = "ST011"; - else if(SNES::cartridge.has_st018()) chip = "ST018"; + else if(SNES::cartridge.has_dsp3()) chip = "DSP-3"; + else if(SNES::cartridge.has_st0011()) chip = "ST-0011"; + else if(SNES::cartridge.has_st0018()) chip = "ST-0018"; if(chip != "") { QMessageBox::warning(mainWindow, "Warning", string() << "

Warning:
The " << chip << " chip was detected, which is not fully emulated yet.
" diff --git a/src/ui_qt/utility/utility.cpp b/bsnes/ui_qt/utility/utility.cpp similarity index 90% rename from src/ui_qt/utility/utility.cpp rename to bsnes/ui_qt/utility/utility.cpp index 4228d4ca..ef6448f4 100644 --- a/src/ui_qt/utility/utility.cpp +++ b/bsnes/ui_qt/utility/utility.cpp @@ -44,11 +44,11 @@ void Utility::updateSystemState() { void Utility::acquireMouse() { if(SNES::cartridge.loaded()) { - if(SNES::config.controller_port1 == SNES::Input::DeviceMouse - || SNES::config.controller_port2 == SNES::Input::DeviceMouse - || SNES::config.controller_port2 == SNES::Input::DeviceSuperScope - || SNES::config.controller_port2 == SNES::Input::DeviceJustifier - || SNES::config.controller_port2 == SNES::Input::DeviceJustifiers + if(SNES::config.controller_port1 == SNES::Input::Device::Mouse + || SNES::config.controller_port2 == SNES::Input::Device::Mouse + || SNES::config.controller_port2 == SNES::Input::Device::SuperScope + || SNES::config.controller_port2 == SNES::Input::Device::Justifier + || SNES::config.controller_port2 == SNES::Input::Device::Justifiers ) input.acquire(); } } @@ -64,9 +64,9 @@ void Utility::updateAvSync() { void Utility::updateVideoMode() { if(config().video.context->region == 0) { - SNES::video.set_mode(SNES::Video::ModeNTSC); + SNES::video.set_mode(SNES::Video::Mode::NTSC); } else { - SNES::video.set_mode(SNES::Video::ModePAL); + SNES::video.set_mode(SNES::Video::Mode::PAL); } } diff --git a/src/ui_qt/utility/utility.hpp b/bsnes/ui_qt/utility/utility.hpp similarity index 100% rename from src/ui_qt/utility/utility.hpp rename to bsnes/ui_qt/utility/utility.hpp diff --git a/src/ui_qt/utility/window.cpp b/bsnes/ui_qt/utility/window.cpp similarity index 100% rename from src/ui_qt/utility/window.cpp rename to bsnes/ui_qt/utility/window.cpp diff --git a/libgomp-1.dll b/libgomp-1.dll new file mode 100644 index 00000000..3bb99f0f Binary files /dev/null and b/libgomp-1.dll differ diff --git a/mingwm10.dll b/mingwm10.dll new file mode 100644 index 00000000..83923d7f Binary files /dev/null and b/mingwm10.dll differ diff --git a/pthreadGC2.dll b/pthreadGC2.dll new file mode 100644 index 00000000..bfdf4fd9 Binary files /dev/null and b/pthreadGC2.dll differ diff --git a/snesfilter.dll b/snesfilter.dll new file mode 100644 index 00000000..cd250ff8 Binary files /dev/null and b/snesfilter.dll differ diff --git a/snesfilter/Makefile b/snesfilter/Makefile index dddd36b7..089b86ee 100644 --- a/snesfilter/Makefile +++ b/snesfilter/Makefile @@ -3,8 +3,8 @@ include nall/Makefile qtlibs := QtCore QtGui include nall/qt/Makefile -c := $(compiler) -cpp := $(subst cc,++,$(compiler)) +c := $(compiler) -std=gnu99 +cpp := $(subst cc,++,$(compiler)) -std=gnu++0x flags := -O3 -I. -Iobj -fomit-frame-pointer $(qtinc) link := diff --git a/snesfilter/nall/algorithm.hpp b/snesfilter/nall/algorithm.hpp index 98b39528..cdc48dcf 100644 --- a/snesfilter/nall/algorithm.hpp +++ b/snesfilter/nall/algorithm.hpp @@ -5,11 +5,11 @@ #undef max namespace nall { - template T min(const T& t, const U& u) { + template T min(const T &t, const U &u) { return t < u ? t : u; } - template T max(const T& t, const U& u) { + template T max(const T &t, const U &u) { return t > u ? t : u; } diff --git a/snesfilter/nall/array.hpp b/snesfilter/nall/array.hpp index 50a03f66..392b5bc0 100644 --- a/snesfilter/nall/array.hpp +++ b/snesfilter/nall/array.hpp @@ -2,8 +2,11 @@ #define NALL_ARRAY_HPP #include +#include #include #include +#include +#include namespace nall { //dynamic vector array @@ -57,18 +60,18 @@ namespace nall { memset(pool, 0, buffersize * sizeof(T)); } - array() { - pool = 0; - poolsize = 0; - buffersize = 0; + array() : pool(0), poolsize(0), buffersize(0) { } - ~array() { reset(); } - - array(const array &source) : pool(0) { - operator=(source); + array(std::initializer_list list) : pool(0), poolsize(0), buffersize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); } + ~array() { + reset(); + } + + //copy array& operator=(const array &source) { if(pool) free(pool); buffersize = source.buffersize; @@ -78,6 +81,25 @@ namespace nall { return *this; } + array(const array &source) : pool(0) { + operator=(source); + } + + //move + array& operator=(array &&source) { + if(pool) free(pool); + pool = source.pool; + poolsize = source.poolsize; + buffersize = source.buffersize; + source.pool = 0; + return *this; + } + + array(array &&source) { + operator=(move(source)); + } + + //index inline T& operator[](unsigned index) { if(index >= buffersize) resize(index + 1); if(index >= buffersize) throw "array[] out of bounds"; @@ -89,6 +111,8 @@ namespace nall { return pool[index]; } }; + + template struct has_size> { enum { value = true }; }; } #endif diff --git a/snesfilter/nall/concept.hpp b/snesfilter/nall/concept.hpp new file mode 100644 index 00000000..2949cd5e --- /dev/null +++ b/snesfilter/nall/concept.hpp @@ -0,0 +1,15 @@ +#ifndef NALL_CONCEPT_HPP +#define NALL_CONCEPT_HPP + +namespace nall { + //unsigned count() const; + template struct has_count { enum { value = false }; }; + + //unsigned length() const; + template struct has_length { enum { value = false }; }; + + //unsigned size() const; + template struct has_size { enum { value = false }; }; +} + +#endif diff --git a/snesfilter/nall/config.hpp b/snesfilter/nall/config.hpp index 10494e65..31ae4e00 100644 --- a/snesfilter/nall/config.hpp +++ b/snesfilter/nall/config.hpp @@ -53,7 +53,7 @@ namespace nall { } } }; - vector list; + linear_vector list; template void attach(T &data, const char *name, const char *desc = "") { diff --git a/snesfilter/nall/dictionary.hpp b/snesfilter/nall/dictionary.hpp index 35128c2f..f14e2095 100644 --- a/snesfilter/nall/dictionary.hpp +++ b/snesfilter/nall/dictionary.hpp @@ -6,7 +6,7 @@ #include namespace nall { - class dictionary : noncopyable { + class dictionary { public: string operator[](const char *input) { for(unsigned i = 0; i < index_input.size(); i++) { @@ -64,6 +64,9 @@ namespace nall { reset(); } + dictionary& operator=(const dictionary&) = delete; + dictionary(const dictionary&) = delete; + protected: lstring index_input; lstring index_output; diff --git a/snesfilter/nall/dl.hpp b/snesfilter/nall/dl.hpp index 088b91e9..22acf51f 100644 --- a/snesfilter/nall/dl.hpp +++ b/snesfilter/nall/dl.hpp @@ -16,7 +16,7 @@ #endif namespace nall { - struct library : noncopyable { + struct library { bool opened() const { return handle; } bool open(const char*); void* sym(const char*); @@ -25,6 +25,9 @@ namespace nall { library() : handle(0) {} ~library() { close(); } + library& operator=(const library&) = delete; + library(const library&) = delete; + private: uintptr_t handle; }; diff --git a/snesfilter/nall/file.hpp b/snesfilter/nall/file.hpp index 29be589c..4c8ca8ee 100644 --- a/snesfilter/nall/file.hpp +++ b/snesfilter/nall/file.hpp @@ -23,7 +23,7 @@ namespace nall { #endif } - class file : noncopyable { + class file { public: enum FileMode { mode_read, mode_write, mode_readwrite, mode_writeread }; enum SeekMode { seek_absolute, seek_relative }; @@ -218,6 +218,9 @@ namespace nall { close(); } + file& operator=(const file&) = delete; + file(const file&) = delete; + private: enum { buffer_size = 1 << 12, buffer_mask = buffer_size - 1 }; char buffer[buffer_size]; diff --git a/snesfilter/nall/foreach.hpp b/snesfilter/nall/foreach.hpp new file mode 100644 index 00000000..39ca7f5f --- /dev/null +++ b/snesfilter/nall/foreach.hpp @@ -0,0 +1,31 @@ +#ifndef NALL_FOREACH_HPP +#define NALL_FOREACH_HPP + +#undef foreach +#define foreach(iter, object) \ + for(unsigned foreach_counter = 0, foreach_limit = foreach_size(object), foreach_once = 0, foreach_broken = 0; foreach_counter < foreach_limit && foreach_broken == 0; foreach_counter++, foreach_once = 0) \ + for(auto &iter = object[foreach_counter]; foreach_once == 0 && (foreach_broken = 1); foreach_once++, foreach_broken = 0) + +#include +#include +#include + +namespace nall { + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.count(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.length(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.size(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return sizeof(T) / sizeof(typename remove_extent::type); + } +} + +#endif diff --git a/snesfilter/nall/priorityqueue.hpp b/snesfilter/nall/priorityqueue.hpp index 7f33e23b..7104e791 100644 --- a/snesfilter/nall/priorityqueue.hpp +++ b/snesfilter/nall/priorityqueue.hpp @@ -14,7 +14,7 @@ namespace nall { //O(1) find (tick) //O(log n) insert (enqueue) //O(log n) remove (dequeue) - template class priority_queue : noncopyable { + template class priority_queue { public: inline void tick(unsigned ticks) { basecounter += ticks; @@ -86,6 +86,9 @@ namespace nall { delete[] heap; } + priority_queue& operator=(const priority_queue&) = delete; + priority_queue(const priority_queue&) = delete; + private: function callback; unsigned basecounter; diff --git a/snesfilter/nall/qt/concept.hpp b/snesfilter/nall/qt/concept.hpp new file mode 100644 index 00000000..51cacef4 --- /dev/null +++ b/snesfilter/nall/qt/concept.hpp @@ -0,0 +1,10 @@ +#ifndef NALL_QT_CONCEPT_HPP +#define NALL_QT_CONCEPT_HPP + +#include + +namespace nall { + template struct has_count> { enum { value = true }; }; +} + +#endif diff --git a/snesfilter/nall/qt/hex-editor.moc.hpp b/snesfilter/nall/qt/hex-editor.moc.hpp index 7fb0c6c5..d59f4be9 100644 --- a/snesfilter/nall/qt/hex-editor.moc.hpp +++ b/snesfilter/nall/qt/hex-editor.moc.hpp @@ -11,15 +11,14 @@ class HexEditor : public QTextEdit { Q_OBJECT public: - enum { - LineWidth = 59, - }; - function reader; function writer; + void setColumns(unsigned columns); + void setRows(unsigned rows); void setOffset(unsigned offset); void setSize(unsigned size); + unsigned lineWidth() const; void refresh(); HexEditor(); @@ -30,6 +29,8 @@ protected slots: protected: QHBoxLayout *layout; QScrollBar *scrollBar; + unsigned editorColumns; + unsigned editorRows; unsigned editorOffset; unsigned editorSize; bool lock; @@ -39,8 +40,8 @@ protected: inline void HexEditor::keyPressEvent(QKeyEvent *event) { QTextCursor cursor = textCursor(); - unsigned x = cursor.position() % LineWidth; - unsigned y = cursor.position() / LineWidth; + unsigned x = cursor.position() % lineWidth(); + unsigned y = cursor.position() / lineWidth(); int hexCode = -1; switch(event->key()) { @@ -66,7 +67,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { bool cursorOffsetValid = (x >= 11 && ((x - 11) % 3) != 2); if(cursorOffsetValid) { bool nibble = (x - 11) % 3; //0 = top nibble, 1 = bottom nibble - unsigned cursorOffset = y * 16 + ((x - 11) / 3); + unsigned cursorOffset = y * editorColumns + ((x - 11) / 3); unsigned effectiveOffset = editorOffset + cursorOffset; if(effectiveOffset >= editorSize) effectiveOffset %= editorSize; @@ -76,7 +77,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { if(writer) writer(effectiveOffset, data); refresh(); - cursor.setPosition(y * LineWidth + x + 1); //advance cursor + cursor.setPosition(y * lineWidth() + x + 1); //advance cursor setTextCursor(cursor); } } else { @@ -87,16 +88,30 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { } } +inline void HexEditor::setColumns(unsigned columns) { + editorColumns = columns; +} + +inline void HexEditor::setRows(unsigned rows) { + editorRows = rows; + scrollBar->setPageStep(editorRows); +} + inline void HexEditor::setOffset(unsigned offset) { lock = true; editorOffset = offset; - scrollBar->setSliderPosition(editorOffset / 16); + scrollBar->setSliderPosition(editorOffset / editorColumns); lock = false; } inline void HexEditor::setSize(unsigned size) { editorSize = size; - scrollBar->setRange(0, editorSize / 16 - 16); + bool indivisible = (editorSize % editorColumns) != 0; //add one for incomplete row + scrollBar->setRange(0, editorSize / editorColumns + indivisible - editorRows); +} + +inline unsigned HexEditor::lineWidth() const { + return 11 + 3 * editorColumns; } inline void HexEditor::refresh() { @@ -104,20 +119,20 @@ inline void HexEditor::refresh() { char temp[256]; unsigned offset = editorOffset; - for(unsigned y = 0; y < 16; y++) { + for(unsigned y = 0; y < editorRows; y++) { if(offset >= editorSize) break; sprintf(temp, "%.4x:%.4x", (offset >> 16) & 0xffff, (offset >> 0) & 0xffff); output << "" << temp << "  "; - for(unsigned x = 0; x < 16; x++) { + for(unsigned x = 0; x < editorColumns; x++) { if(offset >= editorSize) break; sprintf(temp, "%.2x", reader ? reader(offset) : 0x00); offset++; output << "" << temp << ""; - if(x != 15) output << " "; + if(x != (editorColumns - 1)) output << " "; } - if(y != 15) output << "
"; + if(y != (editorRows - 1)) output << "
"; } setHtml(output); @@ -126,7 +141,7 @@ inline void HexEditor::refresh() { inline void HexEditor::scrolled() { if(lock) return; unsigned offset = scrollBar->sliderPosition(); - editorOffset = offset * 16; + editorOffset = offset * editorColumns; refresh(); } @@ -142,12 +157,13 @@ inline HexEditor::HexEditor() { scrollBar = new QScrollBar(Qt::Vertical); scrollBar->setSingleStep(1); - scrollBar->setPageStep(16); layout->addWidget(scrollBar); lock = false; connect(scrollBar, SIGNAL(actionTriggered(int)), this, SLOT(scrolled())); + setColumns(16); + setRows(16); setSize(0); setOffset(0); } diff --git a/snesfilter/nall/serializer.hpp b/snesfilter/nall/serializer.hpp index 521e7d2e..49b0964e 100644 --- a/snesfilter/nall/serializer.hpp +++ b/snesfilter/nall/serializer.hpp @@ -6,7 +6,6 @@ #include namespace nall { - //serializer: a class designed to save and restore the state of classes. // //benefits: @@ -17,7 +16,6 @@ namespace nall { //caveats: //- only plain-old-data can be stored. complex classes must provide serialize(serializer&); //- floating-point usage is not portable across platforms - class serializer { public: enum mode_t { Load, Save, Size }; @@ -73,6 +71,7 @@ namespace nall { for(unsigned n = 0; n < size; n++) integer(array[n]); } + //copy serializer& operator=(const serializer &s) { if(idata) delete[] idata; @@ -89,6 +88,24 @@ namespace nall { operator=(s); } + //move + serializer& operator=(serializer &&s) { + if(idata) delete[] idata; + + imode = s.imode; + idata = s.idata; + isize = s.isize; + icapacity = s.icapacity; + + s.idata = 0; + return *this; + } + + serializer(serializer &&s) { + operator=(move(s)); + } + + //construction serializer() { imode = Size; idata = 0; diff --git a/snesfilter/nall/static.hpp b/snesfilter/nall/static.hpp index 00c3664c..4acb9fd0 100644 --- a/snesfilter/nall/static.hpp +++ b/snesfilter/nall/static.hpp @@ -2,16 +2,19 @@ #define NALL_STATIC_HPP namespace nall { - template struct static_assert; - template<> struct static_assert {}; + template struct static_if { typedef T type; }; + template struct static_if { typedef F type; }; + template struct mp_static_if { typedef typename static_if::type type; }; - template struct static_if { - typedef true_type type; - }; + template struct static_and { enum { value = false }; }; + template<> struct static_and { enum { value = true }; }; + template struct mp_static_and { enum { value = static_and::value }; }; - template struct static_if { - typedef false_type type; - }; + template struct static_or { enum { value = false }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template struct mp_static_or { enum { value = static_or::value }; }; } #endif diff --git a/snesfilter/nall/stdint.hpp b/snesfilter/nall/stdint.hpp index 7e2c7a46..d8b6c788 100644 --- a/snesfilter/nall/stdint.hpp +++ b/snesfilter/nall/stdint.hpp @@ -30,15 +30,15 @@ #endif namespace nall { - static static_assert int8_t_assert; - static static_assert int16_t_assert; - static static_assert int32_t_assert; - static static_assert int64_t_assert; + static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); - static static_assert uint8_t_assert; - static static_assert uint16_t_assert; - static static_assert uint32_t_assert; - static static_assert uint64_t_assert; + static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size"); } #endif diff --git a/snesfilter/nall/string.hpp b/snesfilter/nall/string.hpp index 94e65b68..65a4a4b8 100644 --- a/snesfilter/nall/string.hpp +++ b/snesfilter/nall/string.hpp @@ -1,6 +1,7 @@ #ifndef NALL_STRING_HPP #define NALL_STRING_HPP +#include #include #include #include @@ -14,5 +15,12 @@ #include #include #include +#include +#include + +namespace nall { + template<> struct has_length { enum { value = true }; }; + template<> struct has_size { enum { value = true }; }; +} #endif diff --git a/snesfilter/nall/string/base.hpp b/snesfilter/nall/string/base.hpp index e5851b00..b9230fe4 100644 --- a/snesfilter/nall/string/base.hpp +++ b/snesfilter/nall/string/base.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -26,11 +27,6 @@ inline intmax_t strsigned (const char *str); inline uintmax_t strunsigned(const char *str); inline uintmax_t strbin (const char *str); inline double strdouble (const char *str); -inline size_t strhex (char *str, uintmax_t value, size_t length = 0); -inline size_t strsigned (char *str, intmax_t value, size_t length = 0); -inline size_t strunsigned(char *str, uintmax_t value, size_t length = 0); -inline size_t strbin (char *str, uintmax_t value, size_t length = 0); -inline size_t strdouble (char *str, double value, size_t length = 0); inline bool match(const char *pattern, const char *str); inline bool strint (const char *str, int &result); inline bool strmath(const char *str, int &result); @@ -49,8 +45,6 @@ namespace nall { class string { public: - static string printf(const char*, ...); - inline void reserve(size_t); inline unsigned length() const; @@ -73,7 +67,9 @@ namespace nall { inline string(); inline string(const char*); inline string(const string&); + inline string(string&&); inline string& operator=(const string&); + inline string& operator=(string&&); inline ~string(); inline bool readfile(const char*); @@ -90,18 +86,25 @@ namespace nall { #endif }; - class lstring : public vector { + class lstring : public linear_vector { public: template inline lstring& operator<<(T value); inline int find(const char*); inline void split (const char*, const char*, unsigned = 0); inline void qsplit(const char*, const char*, unsigned = 0); + + lstring(); + lstring(std::initializer_list); }; + + template inline string sprint(const char *s, Args... args); + template inline void print(const char *s, Args... args); }; inline size_t strlcpy(nall::string &dest, const char *src, size_t length); inline size_t strlcat(nall::string &dest, const char *src, size_t length); + inline nall::string& strlower(nall::string &str); inline nall::string& strupper(nall::string &str); inline nall::string& strtr(nall::string &dest, const char *before, const char *after); @@ -113,10 +116,11 @@ inline nall::string& rtrim_once(nall::string &str, const char *key = " "); inline nall::string& trim_once (nall::string &str, const char *key = " "); inline nall::string substr(const char *src, size_t start = 0, size_t length = 0); -inline nall::string strhex (uintmax_t value); -inline nall::string strsigned (intmax_t value); -inline nall::string strunsigned(uintmax_t value); -inline nall::string strbin (uintmax_t value); -inline nall::string strdouble (double value); +template inline nall::string strhex(uintmax_t value); +template inline nall::string strsigned(intmax_t value); +template inline nall::string strunsigned(uintmax_t value); +template inline nall::string strbin(uintmax_t value); +inline size_t strdouble(char *str, double value); +inline nall::string strdouble(double value); #endif diff --git a/snesfilter/nall/string/cast.hpp b/snesfilter/nall/string/cast.hpp index 0b490917..7433073d 100644 --- a/snesfilter/nall/string/cast.hpp +++ b/snesfilter/nall/string/cast.hpp @@ -2,8 +2,7 @@ #define NALL_STRING_CAST_HPP namespace nall { - //this is needed, as C++98 does not support explicit template specialization inside classes; - //redundant memory allocation should hopefully be avoided via compiler optimizations. + //this is needed, as C++0x does not support explicit template specialization inside classes template<> inline string to_string (bool v) { return v ? "true" : "false"; } template<> inline string to_string (signed int v) { return strsigned(v); } template<> inline string to_string (unsigned int v) { return strunsigned(v); } @@ -25,6 +24,6 @@ namespace nall { template<> inline string to_string(const QString &v) { return v.toUtf8().constData(); } string::operator QString() const { return QString::fromUtf8(*this); } #endif -}; +} #endif diff --git a/snesfilter/nall/string/convert.hpp b/snesfilter/nall/string/convert.hpp index da90bb09..a34c3f14 100644 --- a/snesfilter/nall/string/convert.hpp +++ b/snesfilter/nall/string/convert.hpp @@ -146,140 +146,4 @@ double strdouble(const char *str) { return !negate ? result : -result; } -// - -size_t strhex(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length -= 1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 16) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = value % 16; - value /= 16; - *--str = x < 10 ? (x + '0') : (x + 'a' - 10); //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strsigned(char *str, intmax_t value_, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - bool negate = value_ < 0; - uintmax_t value = value_ >= 0 ? value_ : -value_; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = (negate ? 1 : 0) + digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - while(length && digits_integral--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - length--; - } - - if(length && negate) { - *--str = '-'; - } - - return nall::min(initial_length, digits + 1); -} - -size_t strunsigned(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = digits_integral; - if(!str) return digits_integral + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strbin(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 2) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 2); - value /= 2; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -//using sprintf is certainly not the most ideal method to convert -//a double to a string ... but attempting to parse a double by -//hand, digit-by-digit, results in subtle rounding errors. -// -//note: length parameter is currently ignored. -//it remains for consistency and possible future support. -size_t strdouble(char *str, double value, size_t length /* = 0 */) { - char buffer[256]; - sprintf(buffer, "%f", value); - - //remove excess 0's in fraction (2.500000 -> 2.5) - for(char *p = buffer; *p; p++) { - if(*p == '.') { - char *p = buffer + strlen(buffer) - 1; - while(*p == '0') { - if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. - p--; - } - break; - } - } - - length = strlen(buffer); - if(str) strcpy(str, buffer); - return length + 1; -} - #endif diff --git a/snesfilter/nall/string/core.hpp b/snesfilter/nall/string/core.hpp index 29ca7173..5881018b 100644 --- a/snesfilter/nall/string/core.hpp +++ b/snesfilter/nall/string/core.hpp @@ -3,15 +3,6 @@ namespace nall { -inline string string::printf(const char *fmt, ...) { - static char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - return text; -} - void string::reserve(size_t size_) { if(size_ > size) { size = size_; @@ -74,11 +65,25 @@ string::string(const string &value) { data = strdup(value); } +string::string(string &&source) { + size = source.size; + data = source.data; + source.data = 0; +} + string& string::operator=(const string &value) { assign(value); return *this; } +string& string::operator=(string &&source) { + if(data) free(data); + size = source.size; + data = source.data; + source.data = 0; + return *this; +} + string::~string() { free(data); } @@ -113,6 +118,15 @@ int lstring::find(const char *key) { return -1; } -}; +inline lstring::lstring() { +} + +inline lstring::lstring(std::initializer_list list) { + for(const string *s = list.begin(); s != list.end(); ++s) { + operator<<(*s); + } +} + +} #endif diff --git a/snesfilter/nall/string/utility.hpp b/snesfilter/nall/string/utility.hpp index 1300d326..c050446b 100644 --- a/snesfilter/nall/string/utility.hpp +++ b/snesfilter/nall/string/utility.hpp @@ -37,32 +37,122 @@ nall::string& trim_once (nall::string &str, const char *key) { trim_once (str(), /* arithmetic <> string */ -nall::string strhex(uintmax_t value) { - nall::string temp; - temp.reserve(strhex(0, value)); - strhex(temp(), value); - return temp; +template nall::string strhex(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + //render string backwards, as we do not know its length yet + do { + unsigned n = value & 15; + output[offset++] = n < 10 ? '0' + n : 'a' + n - 10; + value >>= 4; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + //reverse the string in-place + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strsigned(intmax_t value) { - nall::string temp; - temp.reserve(strsigned(0, value)); - strsigned(temp(), value); - return temp; +template nall::string strsigned(intmax_t value) { + nall::string output; + unsigned offset = 0; + + bool negative = value < 0; + if(negative) value = abs(value); + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + if(negative) output[offset++] = '-'; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strunsigned(uintmax_t value) { - nall::string temp; - temp.reserve(strunsigned(0, value)); - strunsigned(temp(), value); - return temp; +template nall::string strunsigned(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strbin(uintmax_t value) { - nall::string temp; - temp.reserve(strbin(0, value)); - strbin(temp(), value); - return temp; +template nall::string strbin(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value & 1; + output[offset++] = '0' + n; + value >>= 1; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +//using sprintf is certainly not the most ideal method to convert +//a double to a string ... but attempting to parse a double by +//hand, digit-by-digit, results in subtle rounding errors. +size_t strdouble(char *str, double value) { + char buffer[256]; + sprintf(buffer, "%f", value); + + //remove excess 0's in fraction (2.500000 -> 2.5) + for(char *p = buffer; *p; p++) { + if(*p == '.') { + char *p = buffer + strlen(buffer) - 1; + while(*p == '0') { + if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. + p--; + } + break; + } + } + + unsigned length = strlen(buffer); + if(str) strcpy(str, buffer); + return length + 1; } nall::string strdouble(double value) { diff --git a/snesfilter/nall/string/variadic.hpp b/snesfilter/nall/string/variadic.hpp new file mode 100644 index 00000000..e707b487 --- /dev/null +++ b/snesfilter/nall/string/variadic.hpp @@ -0,0 +1,37 @@ +#ifndef NALL_STRING_VARIADIC_HPP +#define NALL_STRING_VARIADIC_HPP + +namespace nall { + static void sprint(string &output, unsigned &offset, const char *&s) { + while(*s) output[offset++] = *s++; + } + + template + static void sprint(string &output, unsigned &offset, const char *&s, T value, Args... args) { + while(*s) { + if(*s == '$') { + string data = to_string(value); + unsigned i = 0; + while(data[i]) output[offset++] = data[i++]; + sprint(output, offset, ++s, args...); + return; + } else { + output[offset++] = *s++; + } + } + } + + template inline string sprint(const char *s, Args... args) { + string output; + unsigned offset = 0; + sprint(output, offset, s, args...); + output[offset] = 0; + return output; + } + + template inline void print(const char *s, Args... args) { + printf("%s", (const char*)sprint(s, args...)); + } +} + +#endif diff --git a/snesfilter/nall/string/xml.hpp b/snesfilter/nall/string/xml.hpp new file mode 100644 index 00000000..30d6bae6 --- /dev/null +++ b/snesfilter/nall/string/xml.hpp @@ -0,0 +1,268 @@ +#ifndef NALL_STRING_XML_HPP +#define NALL_STRING_XML_HPP + +//XML subset parser +//version 0.04 + +#include + +namespace nall { + +struct xml_attribute { + string name; + string content; + virtual string parse() const; +}; + +struct xml_element : xml_attribute { + string parse() const; + array attribute; + array element; + ~xml_element(); + +protected: + void parse_doctype(const char *&data); + bool parse_head(string data); + bool parse_body(const char *&data); + friend xml_element *xml_parse(const char *data); +}; + +inline string xml_attribute::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline string xml_element::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + source += pos + 3; + continue; + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + string cdata = substr(source, 9, pos - 9); + data << cdata; + offset += strlen(cdata); + + source += offset + 3; + continue; + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline void xml_element::parse_doctype(const char *&data) { + name = "!DOCTYPE"; + const char *content_begin = data; + + signed counter = 0; + while(*data) { + char value = *data++; + if(value == '<') counter++; + if(value == '>') counter--; + if(counter < 0) { + content = substr(content_begin, 0, data - content_begin - 1); + return; + } + } + throw "..."; +} + +inline bool xml_element::parse_head(string data) { + data.qreplace("\t", " "); + data.qreplace("\r", " "); + data.qreplace("\n", " "); + while(qstrpos(data, " ") >= 0) data.qreplace(" ", " "); + data.qreplace(" =", "="); + data.qreplace("= ", "="); + rtrim(data); + + lstring part; + part.qsplit(" ", data); + + name = part[0]; + if(name == "") throw "..."; + + for(unsigned i = 1; i < part.size(); i++) { + lstring side; + side.qsplit("=", part[i]); + if(side.size() != 2) throw "..."; + + xml_attribute *attr = new xml_attribute; + attr->name = side[0]; + attr->content = side[1]; + if(strbegin(attr->content, "\"") && strend(attr->content, "\"")) trim_once(attr->content, "\""); + else if(strbegin(attr->content, "'") && strend(attr->content, "'")) trim_once(attr->content, "'"); + else throw "..."; + attribute.add(attr); + } +} + +inline bool xml_element::parse_body(const char *&data) { + while(true) { + if(!*data) return false; + if(*data++ != '<') continue; + if(*data == '/') return false; + + if(strbegin(data, "!DOCTYPE") == true) { + parse_doctype(data); + return true; + } + + if(strbegin(data, "!--")) { + signed offset = strpos(data, "-->"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + if(strbegin(data, "![CDATA[")) { + signed offset = strpos(data, "]]>"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + signed offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + string tag = substr(data, 0, offset); + data += offset + 1; + const char *content_begin = data; + + bool self_terminating = false; + + if(strend(tag, "?") == true) { + self_terminating = true; + rtrim_once(tag, "?"); + } else if(strend(tag, "/") == true) { + self_terminating = true; + rtrim_once(tag, "/"); + } + + parse_head(tag); + if(self_terminating) return true; + + while(*data) { + unsigned index = element.size(); + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + + if(*data == '/') { + signed length = data - content_begin - 1; + if(length > 0) content = substr(content_begin, 0, length); + + data++; + offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + tag = substr(data, 0, offset); + data += offset + 1; + + tag.replace("\t", " "); + tag.replace("\r", " "); + tag.replace("\n", " "); + while(strpos(tag, " ") >= 0) tag.replace(" ", " "); + rtrim(tag); + + if(name != tag) throw "..."; + return true; + } + } else { + element.add(elem); + } + } + } +} + +inline xml_element::~xml_element() { + for(unsigned i = 0; i < attribute.size(); i++) delete attribute[i]; + for(unsigned i = 0; i < element.size(); i++) delete element[i]; +} + +//ensure there is only one root element +inline bool xml_validate(xml_element *document) { + unsigned root_counter = 0; + + for(unsigned i = 0; i < document->element.size(); i++) { + string &name = document->element[i]->name; + if(strbegin(name, "?")) continue; + if(strbegin(name, "!")) continue; + if(++root_counter > 1) return false; + } + + return true; +} + +inline xml_element* xml_parse(const char *data) { + xml_element *self = new xml_element; + + try { + while(*data) { + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + break; + } else { + self->element.add(elem); + } + } + + if(xml_validate(self) == false) throw "..."; + return self; + } catch(const char*) { + delete self; + return 0; + } +} + +} + +#endif diff --git a/snesfilter/nall/utility.hpp b/snesfilter/nall/utility.hpp index fa73f8cb..c15945e1 100644 --- a/snesfilter/nall/utility.hpp +++ b/snesfilter/nall/utility.hpp @@ -1,32 +1,37 @@ #ifndef NALL_UTILITY_HPP #define NALL_UTILITY_HPP +#include + namespace nall { - template - inline void swap(T &x, T &y) { - T temp(x); - x = y; - y = temp; + template struct identity { + typedef T type; + }; + + template typename remove_reference::type&& move(T &&value) { + return value; } - template - struct base_from_member { + template T&& forward(typename identity::type &&value) { + return value; + } + + template struct enable_if { typedef T type; }; + template struct enable_if {}; + template struct mp_enable_if : enable_if {}; + + template inline void swap(T &x, T &y) { + T temp(move(x)); + x = move(y); + y = move(temp); + } + + template struct base_from_member { T value; base_from_member(T value_) : value(value_) {} }; - class noncopyable { - protected: - noncopyable() {} - ~noncopyable() {} - - private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); - }; - - template - inline T* allocate(size_t size, const T &value) { + template inline T* allocate(size_t size, const T &value) { T *array = new T[size]; for(size_t i = 0; i < size; i++) array[i] = value; return array; diff --git a/snesfilter/nall/vector.hpp b/snesfilter/nall/vector.hpp index aeff81c0..8885f93d 100644 --- a/snesfilter/nall/vector.hpp +++ b/snesfilter/nall/vector.hpp @@ -1,9 +1,12 @@ #ifndef NALL_VECTOR_HPP #define NALL_VECTOR_HPP +#include #include #include #include +#include +#include #include namespace nall { @@ -19,7 +22,7 @@ namespace nall { //if objects hold memory address references to themselves (introspection), a //valid copy constructor will be needed to keep pointers valid. - template class linear_vector : noncopyable { + template class linear_vector { protected: T *pool; unsigned poolsize, objectsize; @@ -79,8 +82,43 @@ namespace nall { return pool[index]; } - linear_vector() : pool(0), poolsize(0), objectsize(0) {} - ~linear_vector() { reset(); } + //copy + inline linear_vector& operator=(const linear_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + linear_vector(const linear_vector &source) { + operator=(source); + } + + //move + inline linear_vector& operator=(linear_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + linear_vector(linear_vector &&source) { + operator=(move(source)); + } + + //construction + linear_vector() : pool(0), poolsize(0), objectsize(0) { + } + + linear_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~linear_vector() { + reset(); + } }; //pointer_vector @@ -93,7 +131,7 @@ namespace nall { //by guaranteeing that the base memory address of each objects never changes, //this avoids the need for an object to have a valid copy constructor. - template class pointer_vector : noncopyable { + template class pointer_vector { protected: T **pool; unsigned poolsize, objectsize; @@ -151,12 +189,47 @@ namespace nall { return *pool[index]; } - pointer_vector() : pool(0), poolsize(0), objectsize(0) {} - ~pointer_vector() { reset(); } + //copy + inline pointer_vector& operator=(const pointer_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + pointer_vector(const pointer_vector &source) { + operator=(source); + } + + //move + inline pointer_vector& operator=(pointer_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + pointer_vector(pointer_vector &&source) { + operator=(move(source)); + } + + //construction + pointer_vector() : pool(0), poolsize(0), objectsize(0) { + } + + pointer_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~pointer_vector() { + reset(); + } }; - //default vector type - template class vector : public linear_vector {}; + template struct has_size> { enum { value = true }; }; + template struct has_size> { enum { value = true }; }; } #endif diff --git a/snesreader.dll b/snesreader.dll new file mode 100644 index 00000000..82c010a3 Binary files /dev/null and b/snesreader.dll differ diff --git a/snesreader/Makefile b/snesreader/Makefile index 172d1428..aff4cc62 100644 --- a/snesreader/Makefile +++ b/snesreader/Makefile @@ -3,8 +3,8 @@ include nall/Makefile qtlibs := QtCore QtGui include nall/qt/Makefile -c := $(compiler) -cpp := $(subst cc,++,$(compiler)) +c := $(compiler) -std=gnu99 +cpp := $(subst cc,++,$(compiler)) -std=gnu++0x flags := -O3 -I. -Iobj -fomit-frame-pointer link := diff --git a/snesreader/nall/algorithm.hpp b/snesreader/nall/algorithm.hpp index 98b39528..cdc48dcf 100644 --- a/snesreader/nall/algorithm.hpp +++ b/snesreader/nall/algorithm.hpp @@ -5,11 +5,11 @@ #undef max namespace nall { - template T min(const T& t, const U& u) { + template T min(const T &t, const U &u) { return t < u ? t : u; } - template T max(const T& t, const U& u) { + template T max(const T &t, const U &u) { return t > u ? t : u; } diff --git a/snesreader/nall/array.hpp b/snesreader/nall/array.hpp index 50a03f66..392b5bc0 100644 --- a/snesreader/nall/array.hpp +++ b/snesreader/nall/array.hpp @@ -2,8 +2,11 @@ #define NALL_ARRAY_HPP #include +#include #include #include +#include +#include namespace nall { //dynamic vector array @@ -57,18 +60,18 @@ namespace nall { memset(pool, 0, buffersize * sizeof(T)); } - array() { - pool = 0; - poolsize = 0; - buffersize = 0; + array() : pool(0), poolsize(0), buffersize(0) { } - ~array() { reset(); } - - array(const array &source) : pool(0) { - operator=(source); + array(std::initializer_list list) : pool(0), poolsize(0), buffersize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); } + ~array() { + reset(); + } + + //copy array& operator=(const array &source) { if(pool) free(pool); buffersize = source.buffersize; @@ -78,6 +81,25 @@ namespace nall { return *this; } + array(const array &source) : pool(0) { + operator=(source); + } + + //move + array& operator=(array &&source) { + if(pool) free(pool); + pool = source.pool; + poolsize = source.poolsize; + buffersize = source.buffersize; + source.pool = 0; + return *this; + } + + array(array &&source) { + operator=(move(source)); + } + + //index inline T& operator[](unsigned index) { if(index >= buffersize) resize(index + 1); if(index >= buffersize) throw "array[] out of bounds"; @@ -89,6 +111,8 @@ namespace nall { return pool[index]; } }; + + template struct has_size> { enum { value = true }; }; } #endif diff --git a/snesreader/nall/concept.hpp b/snesreader/nall/concept.hpp new file mode 100644 index 00000000..2949cd5e --- /dev/null +++ b/snesreader/nall/concept.hpp @@ -0,0 +1,15 @@ +#ifndef NALL_CONCEPT_HPP +#define NALL_CONCEPT_HPP + +namespace nall { + //unsigned count() const; + template struct has_count { enum { value = false }; }; + + //unsigned length() const; + template struct has_length { enum { value = false }; }; + + //unsigned size() const; + template struct has_size { enum { value = false }; }; +} + +#endif diff --git a/snesreader/nall/config.hpp b/snesreader/nall/config.hpp index 10494e65..31ae4e00 100644 --- a/snesreader/nall/config.hpp +++ b/snesreader/nall/config.hpp @@ -53,7 +53,7 @@ namespace nall { } } }; - vector list; + linear_vector list; template void attach(T &data, const char *name, const char *desc = "") { diff --git a/snesreader/nall/dictionary.hpp b/snesreader/nall/dictionary.hpp index 35128c2f..f14e2095 100644 --- a/snesreader/nall/dictionary.hpp +++ b/snesreader/nall/dictionary.hpp @@ -6,7 +6,7 @@ #include namespace nall { - class dictionary : noncopyable { + class dictionary { public: string operator[](const char *input) { for(unsigned i = 0; i < index_input.size(); i++) { @@ -64,6 +64,9 @@ namespace nall { reset(); } + dictionary& operator=(const dictionary&) = delete; + dictionary(const dictionary&) = delete; + protected: lstring index_input; lstring index_output; diff --git a/snesreader/nall/dl.hpp b/snesreader/nall/dl.hpp index 088b91e9..22acf51f 100644 --- a/snesreader/nall/dl.hpp +++ b/snesreader/nall/dl.hpp @@ -16,7 +16,7 @@ #endif namespace nall { - struct library : noncopyable { + struct library { bool opened() const { return handle; } bool open(const char*); void* sym(const char*); @@ -25,6 +25,9 @@ namespace nall { library() : handle(0) {} ~library() { close(); } + library& operator=(const library&) = delete; + library(const library&) = delete; + private: uintptr_t handle; }; diff --git a/snesreader/nall/file.hpp b/snesreader/nall/file.hpp index 29be589c..4c8ca8ee 100644 --- a/snesreader/nall/file.hpp +++ b/snesreader/nall/file.hpp @@ -23,7 +23,7 @@ namespace nall { #endif } - class file : noncopyable { + class file { public: enum FileMode { mode_read, mode_write, mode_readwrite, mode_writeread }; enum SeekMode { seek_absolute, seek_relative }; @@ -218,6 +218,9 @@ namespace nall { close(); } + file& operator=(const file&) = delete; + file(const file&) = delete; + private: enum { buffer_size = 1 << 12, buffer_mask = buffer_size - 1 }; char buffer[buffer_size]; diff --git a/snesreader/nall/foreach.hpp b/snesreader/nall/foreach.hpp new file mode 100644 index 00000000..39ca7f5f --- /dev/null +++ b/snesreader/nall/foreach.hpp @@ -0,0 +1,31 @@ +#ifndef NALL_FOREACH_HPP +#define NALL_FOREACH_HPP + +#undef foreach +#define foreach(iter, object) \ + for(unsigned foreach_counter = 0, foreach_limit = foreach_size(object), foreach_once = 0, foreach_broken = 0; foreach_counter < foreach_limit && foreach_broken == 0; foreach_counter++, foreach_once = 0) \ + for(auto &iter = object[foreach_counter]; foreach_once == 0 && (foreach_broken = 1); foreach_once++, foreach_broken = 0) + +#include +#include +#include + +namespace nall { + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.count(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.length(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.size(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return sizeof(T) / sizeof(typename remove_extent::type); + } +} + +#endif diff --git a/snesreader/nall/priorityqueue.hpp b/snesreader/nall/priorityqueue.hpp index 7f33e23b..7104e791 100644 --- a/snesreader/nall/priorityqueue.hpp +++ b/snesreader/nall/priorityqueue.hpp @@ -14,7 +14,7 @@ namespace nall { //O(1) find (tick) //O(log n) insert (enqueue) //O(log n) remove (dequeue) - template class priority_queue : noncopyable { + template class priority_queue { public: inline void tick(unsigned ticks) { basecounter += ticks; @@ -86,6 +86,9 @@ namespace nall { delete[] heap; } + priority_queue& operator=(const priority_queue&) = delete; + priority_queue(const priority_queue&) = delete; + private: function callback; unsigned basecounter; diff --git a/snesreader/nall/qt/concept.hpp b/snesreader/nall/qt/concept.hpp new file mode 100644 index 00000000..51cacef4 --- /dev/null +++ b/snesreader/nall/qt/concept.hpp @@ -0,0 +1,10 @@ +#ifndef NALL_QT_CONCEPT_HPP +#define NALL_QT_CONCEPT_HPP + +#include + +namespace nall { + template struct has_count> { enum { value = true }; }; +} + +#endif diff --git a/snesreader/nall/qt/hex-editor.moc.hpp b/snesreader/nall/qt/hex-editor.moc.hpp index 7fb0c6c5..d59f4be9 100644 --- a/snesreader/nall/qt/hex-editor.moc.hpp +++ b/snesreader/nall/qt/hex-editor.moc.hpp @@ -11,15 +11,14 @@ class HexEditor : public QTextEdit { Q_OBJECT public: - enum { - LineWidth = 59, - }; - function reader; function writer; + void setColumns(unsigned columns); + void setRows(unsigned rows); void setOffset(unsigned offset); void setSize(unsigned size); + unsigned lineWidth() const; void refresh(); HexEditor(); @@ -30,6 +29,8 @@ protected slots: protected: QHBoxLayout *layout; QScrollBar *scrollBar; + unsigned editorColumns; + unsigned editorRows; unsigned editorOffset; unsigned editorSize; bool lock; @@ -39,8 +40,8 @@ protected: inline void HexEditor::keyPressEvent(QKeyEvent *event) { QTextCursor cursor = textCursor(); - unsigned x = cursor.position() % LineWidth; - unsigned y = cursor.position() / LineWidth; + unsigned x = cursor.position() % lineWidth(); + unsigned y = cursor.position() / lineWidth(); int hexCode = -1; switch(event->key()) { @@ -66,7 +67,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { bool cursorOffsetValid = (x >= 11 && ((x - 11) % 3) != 2); if(cursorOffsetValid) { bool nibble = (x - 11) % 3; //0 = top nibble, 1 = bottom nibble - unsigned cursorOffset = y * 16 + ((x - 11) / 3); + unsigned cursorOffset = y * editorColumns + ((x - 11) / 3); unsigned effectiveOffset = editorOffset + cursorOffset; if(effectiveOffset >= editorSize) effectiveOffset %= editorSize; @@ -76,7 +77,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { if(writer) writer(effectiveOffset, data); refresh(); - cursor.setPosition(y * LineWidth + x + 1); //advance cursor + cursor.setPosition(y * lineWidth() + x + 1); //advance cursor setTextCursor(cursor); } } else { @@ -87,16 +88,30 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { } } +inline void HexEditor::setColumns(unsigned columns) { + editorColumns = columns; +} + +inline void HexEditor::setRows(unsigned rows) { + editorRows = rows; + scrollBar->setPageStep(editorRows); +} + inline void HexEditor::setOffset(unsigned offset) { lock = true; editorOffset = offset; - scrollBar->setSliderPosition(editorOffset / 16); + scrollBar->setSliderPosition(editorOffset / editorColumns); lock = false; } inline void HexEditor::setSize(unsigned size) { editorSize = size; - scrollBar->setRange(0, editorSize / 16 - 16); + bool indivisible = (editorSize % editorColumns) != 0; //add one for incomplete row + scrollBar->setRange(0, editorSize / editorColumns + indivisible - editorRows); +} + +inline unsigned HexEditor::lineWidth() const { + return 11 + 3 * editorColumns; } inline void HexEditor::refresh() { @@ -104,20 +119,20 @@ inline void HexEditor::refresh() { char temp[256]; unsigned offset = editorOffset; - for(unsigned y = 0; y < 16; y++) { + for(unsigned y = 0; y < editorRows; y++) { if(offset >= editorSize) break; sprintf(temp, "%.4x:%.4x", (offset >> 16) & 0xffff, (offset >> 0) & 0xffff); output << "" << temp << "  "; - for(unsigned x = 0; x < 16; x++) { + for(unsigned x = 0; x < editorColumns; x++) { if(offset >= editorSize) break; sprintf(temp, "%.2x", reader ? reader(offset) : 0x00); offset++; output << "" << temp << ""; - if(x != 15) output << " "; + if(x != (editorColumns - 1)) output << " "; } - if(y != 15) output << "
"; + if(y != (editorRows - 1)) output << "
"; } setHtml(output); @@ -126,7 +141,7 @@ inline void HexEditor::refresh() { inline void HexEditor::scrolled() { if(lock) return; unsigned offset = scrollBar->sliderPosition(); - editorOffset = offset * 16; + editorOffset = offset * editorColumns; refresh(); } @@ -142,12 +157,13 @@ inline HexEditor::HexEditor() { scrollBar = new QScrollBar(Qt::Vertical); scrollBar->setSingleStep(1); - scrollBar->setPageStep(16); layout->addWidget(scrollBar); lock = false; connect(scrollBar, SIGNAL(actionTriggered(int)), this, SLOT(scrolled())); + setColumns(16); + setRows(16); setSize(0); setOffset(0); } diff --git a/snesreader/nall/serializer.hpp b/snesreader/nall/serializer.hpp index 521e7d2e..49b0964e 100644 --- a/snesreader/nall/serializer.hpp +++ b/snesreader/nall/serializer.hpp @@ -6,7 +6,6 @@ #include namespace nall { - //serializer: a class designed to save and restore the state of classes. // //benefits: @@ -17,7 +16,6 @@ namespace nall { //caveats: //- only plain-old-data can be stored. complex classes must provide serialize(serializer&); //- floating-point usage is not portable across platforms - class serializer { public: enum mode_t { Load, Save, Size }; @@ -73,6 +71,7 @@ namespace nall { for(unsigned n = 0; n < size; n++) integer(array[n]); } + //copy serializer& operator=(const serializer &s) { if(idata) delete[] idata; @@ -89,6 +88,24 @@ namespace nall { operator=(s); } + //move + serializer& operator=(serializer &&s) { + if(idata) delete[] idata; + + imode = s.imode; + idata = s.idata; + isize = s.isize; + icapacity = s.icapacity; + + s.idata = 0; + return *this; + } + + serializer(serializer &&s) { + operator=(move(s)); + } + + //construction serializer() { imode = Size; idata = 0; diff --git a/snesreader/nall/static.hpp b/snesreader/nall/static.hpp index 00c3664c..4acb9fd0 100644 --- a/snesreader/nall/static.hpp +++ b/snesreader/nall/static.hpp @@ -2,16 +2,19 @@ #define NALL_STATIC_HPP namespace nall { - template struct static_assert; - template<> struct static_assert {}; + template struct static_if { typedef T type; }; + template struct static_if { typedef F type; }; + template struct mp_static_if { typedef typename static_if::type type; }; - template struct static_if { - typedef true_type type; - }; + template struct static_and { enum { value = false }; }; + template<> struct static_and { enum { value = true }; }; + template struct mp_static_and { enum { value = static_and::value }; }; - template struct static_if { - typedef false_type type; - }; + template struct static_or { enum { value = false }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template struct mp_static_or { enum { value = static_or::value }; }; } #endif diff --git a/snesreader/nall/stdint.hpp b/snesreader/nall/stdint.hpp index 7e2c7a46..d8b6c788 100644 --- a/snesreader/nall/stdint.hpp +++ b/snesreader/nall/stdint.hpp @@ -30,15 +30,15 @@ #endif namespace nall { - static static_assert int8_t_assert; - static static_assert int16_t_assert; - static static_assert int32_t_assert; - static static_assert int64_t_assert; + static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); - static static_assert uint8_t_assert; - static static_assert uint16_t_assert; - static static_assert uint32_t_assert; - static static_assert uint64_t_assert; + static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size"); } #endif diff --git a/snesreader/nall/string.hpp b/snesreader/nall/string.hpp index 94e65b68..65a4a4b8 100644 --- a/snesreader/nall/string.hpp +++ b/snesreader/nall/string.hpp @@ -1,6 +1,7 @@ #ifndef NALL_STRING_HPP #define NALL_STRING_HPP +#include #include #include #include @@ -14,5 +15,12 @@ #include #include #include +#include +#include + +namespace nall { + template<> struct has_length { enum { value = true }; }; + template<> struct has_size { enum { value = true }; }; +} #endif diff --git a/snesreader/nall/string/base.hpp b/snesreader/nall/string/base.hpp index e5851b00..b9230fe4 100644 --- a/snesreader/nall/string/base.hpp +++ b/snesreader/nall/string/base.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -26,11 +27,6 @@ inline intmax_t strsigned (const char *str); inline uintmax_t strunsigned(const char *str); inline uintmax_t strbin (const char *str); inline double strdouble (const char *str); -inline size_t strhex (char *str, uintmax_t value, size_t length = 0); -inline size_t strsigned (char *str, intmax_t value, size_t length = 0); -inline size_t strunsigned(char *str, uintmax_t value, size_t length = 0); -inline size_t strbin (char *str, uintmax_t value, size_t length = 0); -inline size_t strdouble (char *str, double value, size_t length = 0); inline bool match(const char *pattern, const char *str); inline bool strint (const char *str, int &result); inline bool strmath(const char *str, int &result); @@ -49,8 +45,6 @@ namespace nall { class string { public: - static string printf(const char*, ...); - inline void reserve(size_t); inline unsigned length() const; @@ -73,7 +67,9 @@ namespace nall { inline string(); inline string(const char*); inline string(const string&); + inline string(string&&); inline string& operator=(const string&); + inline string& operator=(string&&); inline ~string(); inline bool readfile(const char*); @@ -90,18 +86,25 @@ namespace nall { #endif }; - class lstring : public vector { + class lstring : public linear_vector { public: template inline lstring& operator<<(T value); inline int find(const char*); inline void split (const char*, const char*, unsigned = 0); inline void qsplit(const char*, const char*, unsigned = 0); + + lstring(); + lstring(std::initializer_list); }; + + template inline string sprint(const char *s, Args... args); + template inline void print(const char *s, Args... args); }; inline size_t strlcpy(nall::string &dest, const char *src, size_t length); inline size_t strlcat(nall::string &dest, const char *src, size_t length); + inline nall::string& strlower(nall::string &str); inline nall::string& strupper(nall::string &str); inline nall::string& strtr(nall::string &dest, const char *before, const char *after); @@ -113,10 +116,11 @@ inline nall::string& rtrim_once(nall::string &str, const char *key = " "); inline nall::string& trim_once (nall::string &str, const char *key = " "); inline nall::string substr(const char *src, size_t start = 0, size_t length = 0); -inline nall::string strhex (uintmax_t value); -inline nall::string strsigned (intmax_t value); -inline nall::string strunsigned(uintmax_t value); -inline nall::string strbin (uintmax_t value); -inline nall::string strdouble (double value); +template inline nall::string strhex(uintmax_t value); +template inline nall::string strsigned(intmax_t value); +template inline nall::string strunsigned(uintmax_t value); +template inline nall::string strbin(uintmax_t value); +inline size_t strdouble(char *str, double value); +inline nall::string strdouble(double value); #endif diff --git a/snesreader/nall/string/cast.hpp b/snesreader/nall/string/cast.hpp index 0b490917..7433073d 100644 --- a/snesreader/nall/string/cast.hpp +++ b/snesreader/nall/string/cast.hpp @@ -2,8 +2,7 @@ #define NALL_STRING_CAST_HPP namespace nall { - //this is needed, as C++98 does not support explicit template specialization inside classes; - //redundant memory allocation should hopefully be avoided via compiler optimizations. + //this is needed, as C++0x does not support explicit template specialization inside classes template<> inline string to_string (bool v) { return v ? "true" : "false"; } template<> inline string to_string (signed int v) { return strsigned(v); } template<> inline string to_string (unsigned int v) { return strunsigned(v); } @@ -25,6 +24,6 @@ namespace nall { template<> inline string to_string(const QString &v) { return v.toUtf8().constData(); } string::operator QString() const { return QString::fromUtf8(*this); } #endif -}; +} #endif diff --git a/snesreader/nall/string/convert.hpp b/snesreader/nall/string/convert.hpp index da90bb09..a34c3f14 100644 --- a/snesreader/nall/string/convert.hpp +++ b/snesreader/nall/string/convert.hpp @@ -146,140 +146,4 @@ double strdouble(const char *str) { return !negate ? result : -result; } -// - -size_t strhex(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length -= 1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 16) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = value % 16; - value /= 16; - *--str = x < 10 ? (x + '0') : (x + 'a' - 10); //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strsigned(char *str, intmax_t value_, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - bool negate = value_ < 0; - uintmax_t value = value_ >= 0 ? value_ : -value_; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = (negate ? 1 : 0) + digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - while(length && digits_integral--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - length--; - } - - if(length && negate) { - *--str = '-'; - } - - return nall::min(initial_length, digits + 1); -} - -size_t strunsigned(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = digits_integral; - if(!str) return digits_integral + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strbin(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 2) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 2); - value /= 2; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -//using sprintf is certainly not the most ideal method to convert -//a double to a string ... but attempting to parse a double by -//hand, digit-by-digit, results in subtle rounding errors. -// -//note: length parameter is currently ignored. -//it remains for consistency and possible future support. -size_t strdouble(char *str, double value, size_t length /* = 0 */) { - char buffer[256]; - sprintf(buffer, "%f", value); - - //remove excess 0's in fraction (2.500000 -> 2.5) - for(char *p = buffer; *p; p++) { - if(*p == '.') { - char *p = buffer + strlen(buffer) - 1; - while(*p == '0') { - if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. - p--; - } - break; - } - } - - length = strlen(buffer); - if(str) strcpy(str, buffer); - return length + 1; -} - #endif diff --git a/snesreader/nall/string/core.hpp b/snesreader/nall/string/core.hpp index 29ca7173..5881018b 100644 --- a/snesreader/nall/string/core.hpp +++ b/snesreader/nall/string/core.hpp @@ -3,15 +3,6 @@ namespace nall { -inline string string::printf(const char *fmt, ...) { - static char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - return text; -} - void string::reserve(size_t size_) { if(size_ > size) { size = size_; @@ -74,11 +65,25 @@ string::string(const string &value) { data = strdup(value); } +string::string(string &&source) { + size = source.size; + data = source.data; + source.data = 0; +} + string& string::operator=(const string &value) { assign(value); return *this; } +string& string::operator=(string &&source) { + if(data) free(data); + size = source.size; + data = source.data; + source.data = 0; + return *this; +} + string::~string() { free(data); } @@ -113,6 +118,15 @@ int lstring::find(const char *key) { return -1; } -}; +inline lstring::lstring() { +} + +inline lstring::lstring(std::initializer_list list) { + for(const string *s = list.begin(); s != list.end(); ++s) { + operator<<(*s); + } +} + +} #endif diff --git a/snesreader/nall/string/utility.hpp b/snesreader/nall/string/utility.hpp index 1300d326..c050446b 100644 --- a/snesreader/nall/string/utility.hpp +++ b/snesreader/nall/string/utility.hpp @@ -37,32 +37,122 @@ nall::string& trim_once (nall::string &str, const char *key) { trim_once (str(), /* arithmetic <> string */ -nall::string strhex(uintmax_t value) { - nall::string temp; - temp.reserve(strhex(0, value)); - strhex(temp(), value); - return temp; +template nall::string strhex(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + //render string backwards, as we do not know its length yet + do { + unsigned n = value & 15; + output[offset++] = n < 10 ? '0' + n : 'a' + n - 10; + value >>= 4; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + //reverse the string in-place + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strsigned(intmax_t value) { - nall::string temp; - temp.reserve(strsigned(0, value)); - strsigned(temp(), value); - return temp; +template nall::string strsigned(intmax_t value) { + nall::string output; + unsigned offset = 0; + + bool negative = value < 0; + if(negative) value = abs(value); + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + if(negative) output[offset++] = '-'; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strunsigned(uintmax_t value) { - nall::string temp; - temp.reserve(strunsigned(0, value)); - strunsigned(temp(), value); - return temp; +template nall::string strunsigned(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strbin(uintmax_t value) { - nall::string temp; - temp.reserve(strbin(0, value)); - strbin(temp(), value); - return temp; +template nall::string strbin(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value & 1; + output[offset++] = '0' + n; + value >>= 1; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +//using sprintf is certainly not the most ideal method to convert +//a double to a string ... but attempting to parse a double by +//hand, digit-by-digit, results in subtle rounding errors. +size_t strdouble(char *str, double value) { + char buffer[256]; + sprintf(buffer, "%f", value); + + //remove excess 0's in fraction (2.500000 -> 2.5) + for(char *p = buffer; *p; p++) { + if(*p == '.') { + char *p = buffer + strlen(buffer) - 1; + while(*p == '0') { + if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. + p--; + } + break; + } + } + + unsigned length = strlen(buffer); + if(str) strcpy(str, buffer); + return length + 1; } nall::string strdouble(double value) { diff --git a/snesreader/nall/string/variadic.hpp b/snesreader/nall/string/variadic.hpp new file mode 100644 index 00000000..e707b487 --- /dev/null +++ b/snesreader/nall/string/variadic.hpp @@ -0,0 +1,37 @@ +#ifndef NALL_STRING_VARIADIC_HPP +#define NALL_STRING_VARIADIC_HPP + +namespace nall { + static void sprint(string &output, unsigned &offset, const char *&s) { + while(*s) output[offset++] = *s++; + } + + template + static void sprint(string &output, unsigned &offset, const char *&s, T value, Args... args) { + while(*s) { + if(*s == '$') { + string data = to_string(value); + unsigned i = 0; + while(data[i]) output[offset++] = data[i++]; + sprint(output, offset, ++s, args...); + return; + } else { + output[offset++] = *s++; + } + } + } + + template inline string sprint(const char *s, Args... args) { + string output; + unsigned offset = 0; + sprint(output, offset, s, args...); + output[offset] = 0; + return output; + } + + template inline void print(const char *s, Args... args) { + printf("%s", (const char*)sprint(s, args...)); + } +} + +#endif diff --git a/snesreader/nall/string/xml.hpp b/snesreader/nall/string/xml.hpp new file mode 100644 index 00000000..30d6bae6 --- /dev/null +++ b/snesreader/nall/string/xml.hpp @@ -0,0 +1,268 @@ +#ifndef NALL_STRING_XML_HPP +#define NALL_STRING_XML_HPP + +//XML subset parser +//version 0.04 + +#include + +namespace nall { + +struct xml_attribute { + string name; + string content; + virtual string parse() const; +}; + +struct xml_element : xml_attribute { + string parse() const; + array attribute; + array element; + ~xml_element(); + +protected: + void parse_doctype(const char *&data); + bool parse_head(string data); + bool parse_body(const char *&data); + friend xml_element *xml_parse(const char *data); +}; + +inline string xml_attribute::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline string xml_element::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + source += pos + 3; + continue; + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + string cdata = substr(source, 9, pos - 9); + data << cdata; + offset += strlen(cdata); + + source += offset + 3; + continue; + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline void xml_element::parse_doctype(const char *&data) { + name = "!DOCTYPE"; + const char *content_begin = data; + + signed counter = 0; + while(*data) { + char value = *data++; + if(value == '<') counter++; + if(value == '>') counter--; + if(counter < 0) { + content = substr(content_begin, 0, data - content_begin - 1); + return; + } + } + throw "..."; +} + +inline bool xml_element::parse_head(string data) { + data.qreplace("\t", " "); + data.qreplace("\r", " "); + data.qreplace("\n", " "); + while(qstrpos(data, " ") >= 0) data.qreplace(" ", " "); + data.qreplace(" =", "="); + data.qreplace("= ", "="); + rtrim(data); + + lstring part; + part.qsplit(" ", data); + + name = part[0]; + if(name == "") throw "..."; + + for(unsigned i = 1; i < part.size(); i++) { + lstring side; + side.qsplit("=", part[i]); + if(side.size() != 2) throw "..."; + + xml_attribute *attr = new xml_attribute; + attr->name = side[0]; + attr->content = side[1]; + if(strbegin(attr->content, "\"") && strend(attr->content, "\"")) trim_once(attr->content, "\""); + else if(strbegin(attr->content, "'") && strend(attr->content, "'")) trim_once(attr->content, "'"); + else throw "..."; + attribute.add(attr); + } +} + +inline bool xml_element::parse_body(const char *&data) { + while(true) { + if(!*data) return false; + if(*data++ != '<') continue; + if(*data == '/') return false; + + if(strbegin(data, "!DOCTYPE") == true) { + parse_doctype(data); + return true; + } + + if(strbegin(data, "!--")) { + signed offset = strpos(data, "-->"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + if(strbegin(data, "![CDATA[")) { + signed offset = strpos(data, "]]>"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + signed offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + string tag = substr(data, 0, offset); + data += offset + 1; + const char *content_begin = data; + + bool self_terminating = false; + + if(strend(tag, "?") == true) { + self_terminating = true; + rtrim_once(tag, "?"); + } else if(strend(tag, "/") == true) { + self_terminating = true; + rtrim_once(tag, "/"); + } + + parse_head(tag); + if(self_terminating) return true; + + while(*data) { + unsigned index = element.size(); + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + + if(*data == '/') { + signed length = data - content_begin - 1; + if(length > 0) content = substr(content_begin, 0, length); + + data++; + offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + tag = substr(data, 0, offset); + data += offset + 1; + + tag.replace("\t", " "); + tag.replace("\r", " "); + tag.replace("\n", " "); + while(strpos(tag, " ") >= 0) tag.replace(" ", " "); + rtrim(tag); + + if(name != tag) throw "..."; + return true; + } + } else { + element.add(elem); + } + } + } +} + +inline xml_element::~xml_element() { + for(unsigned i = 0; i < attribute.size(); i++) delete attribute[i]; + for(unsigned i = 0; i < element.size(); i++) delete element[i]; +} + +//ensure there is only one root element +inline bool xml_validate(xml_element *document) { + unsigned root_counter = 0; + + for(unsigned i = 0; i < document->element.size(); i++) { + string &name = document->element[i]->name; + if(strbegin(name, "?")) continue; + if(strbegin(name, "!")) continue; + if(++root_counter > 1) return false; + } + + return true; +} + +inline xml_element* xml_parse(const char *data) { + xml_element *self = new xml_element; + + try { + while(*data) { + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + break; + } else { + self->element.add(elem); + } + } + + if(xml_validate(self) == false) throw "..."; + return self; + } catch(const char*) { + delete self; + return 0; + } +} + +} + +#endif diff --git a/snesreader/nall/utility.hpp b/snesreader/nall/utility.hpp index fa73f8cb..c15945e1 100644 --- a/snesreader/nall/utility.hpp +++ b/snesreader/nall/utility.hpp @@ -1,32 +1,37 @@ #ifndef NALL_UTILITY_HPP #define NALL_UTILITY_HPP +#include + namespace nall { - template - inline void swap(T &x, T &y) { - T temp(x); - x = y; - y = temp; + template struct identity { + typedef T type; + }; + + template typename remove_reference::type&& move(T &&value) { + return value; } - template - struct base_from_member { + template T&& forward(typename identity::type &&value) { + return value; + } + + template struct enable_if { typedef T type; }; + template struct enable_if {}; + template struct mp_enable_if : enable_if {}; + + template inline void swap(T &x, T &y) { + T temp(move(x)); + x = move(y); + y = move(temp); + } + + template struct base_from_member { T value; base_from_member(T value_) : value(value_) {} }; - class noncopyable { - protected: - noncopyable() {} - ~noncopyable() {} - - private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); - }; - - template - inline T* allocate(size_t size, const T &value) { + template inline T* allocate(size_t size, const T &value) { T *array = new T[size]; for(size_t i = 0; i < size; i++) array[i] = value; return array; diff --git a/snesreader/nall/vector.hpp b/snesreader/nall/vector.hpp index aeff81c0..8885f93d 100644 --- a/snesreader/nall/vector.hpp +++ b/snesreader/nall/vector.hpp @@ -1,9 +1,12 @@ #ifndef NALL_VECTOR_HPP #define NALL_VECTOR_HPP +#include #include #include #include +#include +#include #include namespace nall { @@ -19,7 +22,7 @@ namespace nall { //if objects hold memory address references to themselves (introspection), a //valid copy constructor will be needed to keep pointers valid. - template class linear_vector : noncopyable { + template class linear_vector { protected: T *pool; unsigned poolsize, objectsize; @@ -79,8 +82,43 @@ namespace nall { return pool[index]; } - linear_vector() : pool(0), poolsize(0), objectsize(0) {} - ~linear_vector() { reset(); } + //copy + inline linear_vector& operator=(const linear_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + linear_vector(const linear_vector &source) { + operator=(source); + } + + //move + inline linear_vector& operator=(linear_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + linear_vector(linear_vector &&source) { + operator=(move(source)); + } + + //construction + linear_vector() : pool(0), poolsize(0), objectsize(0) { + } + + linear_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~linear_vector() { + reset(); + } }; //pointer_vector @@ -93,7 +131,7 @@ namespace nall { //by guaranteeing that the base memory address of each objects never changes, //this avoids the need for an object to have a valid copy constructor. - template class pointer_vector : noncopyable { + template class pointer_vector { protected: T **pool; unsigned poolsize, objectsize; @@ -151,12 +189,47 @@ namespace nall { return *pool[index]; } - pointer_vector() : pool(0), poolsize(0), objectsize(0) {} - ~pointer_vector() { reset(); } + //copy + inline pointer_vector& operator=(const pointer_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + pointer_vector(const pointer_vector &source) { + operator=(source); + } + + //move + inline pointer_vector& operator=(pointer_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + pointer_vector(pointer_vector &&source) { + operator=(move(source)); + } + + //construction + pointer_vector() : pool(0), poolsize(0), objectsize(0) { + } + + pointer_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~pointer_vector() { + reset(); + } }; - //default vector type - template class vector : public linear_vector {}; + template struct has_size> { enum { value = true }; }; + template struct has_size> { enum { value = true }; }; } #endif diff --git a/snesreader/snesreader.cpp b/snesreader/snesreader.cpp index fe0a2b7b..ed996fd3 100644 --- a/snesreader/snesreader.cpp +++ b/snesreader/snesreader.cpp @@ -17,6 +17,8 @@ extern "C" char* uncompressStream(int, int); //micro-bunzip #include using namespace nall; +#include "xml.cpp" + dllexport const char* snesreader_supported() { //libjma does not work on 64-bit architectures #if !defined(__amd64) && !defined(_M_X64) @@ -197,8 +199,9 @@ bool snesreader_load_jma(const char *filename, uint8_t *&data, unsigned &size) { } } -dllexport bool snesreader_load(string &filename, uint8_t *&data, unsigned &size) { +dllexport bool snesreader_load(string &filename, string &xmldata, uint8_t *&data, unsigned &size) { if(file::exists(filename) == false) return false; + xmldata = ""; bool success = false; if(striend(filename, ".zip") @@ -228,5 +231,6 @@ dllexport bool snesreader_load(string &filename, uint8_t *&data, unsigned &size) //remove copier header, if it exists if((size & 0x7fff) == 512) memmove(data, data + 512, size -= 512); + xml.generate(xmldata, data, size); return true; } diff --git a/snesreader/snesreader.hpp b/snesreader/snesreader.hpp index 1935b43a..e3c31078 100644 --- a/snesreader/snesreader.hpp +++ b/snesreader/snesreader.hpp @@ -3,5 +3,5 @@ namespace nall { class string; } extern "C" { const char* snesreader_supported(); - bool snesreader_load(nall::string &filename, uint8_t *&data, unsigned &size); + bool snesreader_load(nall::string &filename, nall::string &xml, uint8_t *&data, unsigned &size); } diff --git a/snesreader/xml.cpp b/snesreader/xml.cpp new file mode 100644 index 00000000..edd986c6 --- /dev/null +++ b/snesreader/xml.cpp @@ -0,0 +1,750 @@ +#include "xml.hpp" +XML xml; + +typedef uint8_t uint8; +typedef uint16_t uint16; +typedef uint32_t uint32; +typedef uint64_t uint64; + +void XML::generate(string &xml, const uint8_t *data, unsigned size) { + read_header(data, size); + + xml = "\n"; + + if(type == TypeBsx) { + xml << ""; + return; + } else if(type == TypeSufamiTurbo) { + xml << ""; + return; + } else if(type == TypeGameBoy) { + xml << "\n"; + if(gameboy_ram_size(data, size) > 0) { + xml << " \n"; + } + xml << "\n"; + return; + } + + xml << "\n"; + + if(type == TypeSuperGameBoy1Bios) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(type == TypeSuperGameBoy2Bios) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(has_sdd1) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + + if(ram_size > 0) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(has_spc7110) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + if(has_spc7110rtc) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == LoROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + + if(ram_size > 0) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + if((rom_size > 0x200000) || (ram_size > 32 * 1024)) { + xml << " \n"; + xml << " \n"; + } else { + xml << " \n"; + xml << " \n"; + } + xml << " \n"; + } + } else if(mapper == HiROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + + if(ram_size > 0) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + if((rom_size > 0x200000) || (ram_size > 32 * 1024)) { + xml << " \n"; + } else { + xml << " \n"; + } + xml << " \n"; + } + } else if(mapper == ExHiROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + + if(ram_size > 0) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + if((rom_size > 0x200000) || (ram_size > 32 * 1024)) { + xml << " \n"; + } else { + xml << " \n"; + } + xml << " \n"; + } + } else if(mapper == SuperFXROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == SA1ROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == BSCLoROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == BSCHiROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == BSXROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(mapper == STROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_srtc) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_cx4) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_dsp1) { + xml << " \n"; + if(dsp1_mapper == DSP1LoROM1MB) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(dsp1_mapper == DSP1LoROM2MB) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } else if(dsp1_mapper == DSP1HiROM) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + xml << " \n"; + } + + if(has_dsp2) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_dsp3) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_dsp4) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_obc1) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_st010) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_st011) { + //ST-0011 addresses not verified; chip is unsupported + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + if(has_st018) { + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + xml << " \n"; + } + + xml << "\n"; +} + +void XML::read_header(const uint8_t *data, unsigned size) { + type = TypeUnknown; + mapper = LoROM; + dsp1_mapper = DSP1Unmapped; + region = NTSC; + rom_size = size; + ram_size = 0; + + has_bsx_slot = false; + has_superfx = false; + has_sa1 = false; + has_srtc = false; + has_sdd1 = false; + has_spc7110 = false; + has_spc7110rtc = false; + has_cx4 = false; + has_dsp1 = false; + has_dsp2 = false; + has_dsp3 = false; + has_dsp4 = false; + has_obc1 = false; + has_st010 = false; + has_st011 = false; + has_st018 = false; + + //===================== + //detect Game Boy carts + //===================== + + if(size >= 0x0140) { + if(data[0x0104] == 0xce && data[0x0105] == 0xed && data[0x0106] == 0x66 && data[0x0107] == 0x66 + && data[0x0108] == 0xcc && data[0x0109] == 0x0d && data[0x010a] == 0x00 && data[0x010b] == 0x0b) { + type = TypeGameBoy; + return; + } + } + + const unsigned index = find_header(data, size); + const uint8 mapperid = data[index + Mapper]; + const uint8 rom_type = data[index + RomType]; + const uint8 rom_size = data[index + RomSize]; + const uint8 company = data[index + Company]; + const uint8 regionid = data[index + CartRegion] & 0x7f; + + ram_size = 1024 << (data[index + RamSize] & 7); + if(ram_size == 1024) ram_size = 0; //no RAM present + + //0, 1, 13 = NTSC; 2 - 12 = PAL + region = (regionid <= 1 || regionid >= 13) ? NTSC : PAL; + + //======================= + //detect BS-X flash carts + //======================= + + if(data[index + 0x13] == 0x00 || data[index + 0x13] == 0xff) { + if(data[index + 0x14] == 0x00) { + const uint8_t n15 = data[index + 0x15]; + if(n15 == 0x00 || n15 == 0x80 || n15 == 0x84 || n15 == 0x9c || n15 == 0xbc || n15 == 0xfc) { + if(data[index + 0x1a] == 0x33 || data[index + 0x1a] == 0xff) { + type = TypeBsx; + mapper = BSXROM; + region = NTSC; //BS-X only released in Japan + return; + } + } + } + } + + //========================= + //detect Sufami Turbo carts + //========================= + + if(!memcmp(data, "BANDAI SFC-ADX", 14)) { + if(!memcmp(data + 16, "SFC-ADX BACKUP", 14)) { + type = TypeSufamiTurboBios; + } else { + type = TypeSufamiTurbo; + } + mapper = STROM; + region = NTSC; //Sufami Turbo only released in Japan + return; //RAM size handled outside this routine + } + + //========================== + //detect Super Game Boy BIOS + //========================== + + if(!memcmp(data + index, "Super GAMEBOY2", 14)) { + type = TypeSuperGameBoy2Bios; + return; + } + + if(!memcmp(data + index, "Super GAMEBOY", 13)) { + type = TypeSuperGameBoy1Bios; + return; + } + + //===================== + //detect standard carts + //===================== + + //detect presence of BS-X flash cartridge connector (reads extended header information) + if(data[index - 14] == 'Z') { + if(data[index - 11] == 'J') { + uint8 n13 = data[index - 13]; + if((n13 >= 'A' && n13 <= 'Z') || (n13 >= '0' && n13 <= '9')) { + if(company == 0x33 || (data[index - 10] == 0x00 && data[index - 4] == 0x00)) { + has_bsx_slot = true; + } + } + } + } + + if(has_bsx_slot) { + if(!memcmp(data + index, "Satellaview BS-X ", 21)) { + //BS-X base cart + type = TypeBsxBios; + mapper = BSXROM; + region = NTSC; //BS-X only released in Japan + return; //RAM size handled internally by load_cart_bsx() -> BSXCart class + } else { + type = TypeBsxSlotted; + mapper = (index == 0x7fc0 ? BSCLoROM : BSCHiROM); + region = NTSC; //BS-X slotted cartridges only released in Japan + } + } else { + //standard cart + type = TypeNormal; + + if(index == 0x7fc0 && size >= 0x401000) { + mapper = ExLoROM; + } else if(index == 0x7fc0 && mapperid == 0x32) { + mapper = ExLoROM; + } else if(index == 0x7fc0) { + mapper = LoROM; + } else if(index == 0xffc0) { + mapper = HiROM; + } else { //index == 0x40ffc0 + mapper = ExHiROM; + } + } + + if(mapperid == 0x20 && (rom_type == 0x13 || rom_type == 0x14 || rom_type == 0x15 || rom_type == 0x1a)) { + has_superfx = true; + mapper = SuperFXROM; + ram_size = 1024 << (data[index - 3] & 7); + if(ram_size == 1024) ram_size = 0; + } + + if(mapperid == 0x23 && (rom_type == 0x32 || rom_type == 0x34 || rom_type == 0x35)) { + has_sa1 = true; + mapper = SA1ROM; + } + + if(mapperid == 0x35 && rom_type == 0x55) { + has_srtc = true; + } + + if(mapperid == 0x32 && (rom_type == 0x43 || rom_type == 0x45)) { + has_sdd1 = true; + } + + if(mapperid == 0x3a && (rom_type == 0xf5 || rom_type == 0xf9)) { + has_spc7110 = true; + has_spc7110rtc = (rom_type == 0xf9); + mapper = SPC7110ROM; + } + + if(mapperid == 0x20 && rom_type == 0xf3) { + has_cx4 = true; + } + + if((mapperid == 0x20 || mapperid == 0x21) && rom_type == 0x03) { + has_dsp1 = true; + } + + if(mapperid == 0x30 && rom_type == 0x05 && company != 0xb2) { + has_dsp1 = true; + } + + if(mapperid == 0x31 && (rom_type == 0x03 || rom_type == 0x05)) { + has_dsp1 = true; + } + + if(has_dsp1 == true) { + if((mapperid & 0x2f) == 0x20 && size <= 0x100000) { + dsp1_mapper = DSP1LoROM1MB; + } else if((mapperid & 0x2f) == 0x20) { + dsp1_mapper = DSP1LoROM2MB; + } else if((mapperid & 0x2f) == 0x21) { + dsp1_mapper = DSP1HiROM; + } + } + + if(mapperid == 0x20 && rom_type == 0x05) { + has_dsp2 = true; + } + + if(mapperid == 0x30 && rom_type == 0x05 && company == 0xb2) { + has_dsp3 = true; + } + + if(mapperid == 0x30 && rom_type == 0x03) { + has_dsp4 = true; + } + + if(mapperid == 0x30 && rom_type == 0x25) { + has_obc1 = true; + } + + if(mapperid == 0x30 && rom_type == 0xf6 && rom_size >= 10) { + has_st010 = true; + } + + if(mapperid == 0x30 && rom_type == 0xf6 && rom_size < 10) { + has_st011 = true; + } + + if(mapperid == 0x30 && rom_type == 0xf5) { + has_st018 = true; + } +} + +unsigned XML::find_header(const uint8_t *data, unsigned size) const { + unsigned score_lo = score_header(data, size, 0x007fc0); + unsigned score_hi = score_header(data, size, 0x00ffc0); + unsigned score_ex = score_header(data, size, 0x40ffc0); + if(score_ex) score_ex += 4; //favor ExHiROM on images > 32mbits + + if(score_lo >= score_hi && score_lo >= score_ex) { + return 0x007fc0; + } else if(score_hi >= score_ex) { + return 0x00ffc0; + } else { + return 0x40ffc0; + } +} + +unsigned XML::score_header(const uint8_t *data, unsigned size, unsigned addr) const { + if(size < addr + 64) return 0; //image too small to contain header at this location? + int score = 0; + + uint16 resetvector = data[addr + ResetVector] | (data[addr + ResetVector + 1] << 8); + uint16 checksum = data[addr + Checksum ] | (data[addr + Checksum + 1] << 8); + uint16 complement = data[addr + Complement ] | (data[addr + Complement + 1] << 8); + + uint8 resetop = data[(addr & ~0x7fff) | (resetvector & 0x7fff)]; //first opcode executed upon reset + uint8 mapper = data[addr + Mapper] & ~0x10; //mask off irrelevent FastROM-capable bit + + //$00:[000-7fff] contains uninitialized RAM and MMIO. + //reset vector must point to ROM at $00:[8000-ffff] to be considered valid. + if(resetvector < 0x8000) return 0; + + //some images duplicate the header in multiple locations, and others have completely + //invalid header information that cannot be relied upon. + //below code will analyze the first opcode executed at the specified reset vector to + //determine the probability that this is the correct header. + + //most likely opcodes + if(resetop == 0x78 //sei + || resetop == 0x18 //clc (clc; xce) + || resetop == 0x38 //sec (sec; xce) + || resetop == 0x9c //stz $nnnn (stz $4200) + || resetop == 0x4c //jmp $nnnn + || resetop == 0x5c //jml $nnnnnn + ) score += 8; + + //plausible opcodes + if(resetop == 0xc2 //rep #$nn + || resetop == 0xe2 //sep #$nn + || resetop == 0xad //lda $nnnn + || resetop == 0xae //ldx $nnnn + || resetop == 0xac //ldy $nnnn + || resetop == 0xaf //lda $nnnnnn + || resetop == 0xa9 //lda #$nn + || resetop == 0xa2 //ldx #$nn + || resetop == 0xa0 //ldy #$nn + || resetop == 0x20 //jsr $nnnn + || resetop == 0x22 //jsl $nnnnnn + ) score += 4; + + //implausible opcodes + if(resetop == 0x40 //rti + || resetop == 0x60 //rts + || resetop == 0x6b //rtl + || resetop == 0xcd //cmp $nnnn + || resetop == 0xec //cpx $nnnn + || resetop == 0xcc //cpy $nnnn + ) score -= 4; + + //least likely opcodes + if(resetop == 0x00 //brk #$nn + || resetop == 0x02 //cop #$nn + || resetop == 0xdb //stp + || resetop == 0x42 //wdm + || resetop == 0xff //sbc $nnnnnn,x + ) score -= 8; + + //at times, both the header and reset vector's first opcode will match ... + //fallback and rely on info validity in these cases to determine more likely header. + + //a valid checksum is the biggest indicator of a valid header. + if((checksum + complement) == 0xffff && (checksum != 0) && (complement != 0)) score += 4; + + if(addr == 0x007fc0 && mapper == 0x20) score += 2; //0x20 is usually LoROM + if(addr == 0x00ffc0 && mapper == 0x21) score += 2; //0x21 is usually HiROM + if(addr == 0x007fc0 && mapper == 0x22) score += 2; //0x22 is usually ExLoROM + if(addr == 0x40ffc0 && mapper == 0x25) score += 2; //0x25 is usually ExHiROM + + if(data[addr + Company] == 0x33) score += 2; //0x33 indicates extended header + if(data[addr + RomType] < 0x08) score++; + if(data[addr + RomSize] < 0x10) score++; + if(data[addr + RamSize] < 0x08) score++; + if(data[addr + CartRegion] < 14) score++; + + if(score < 0) score = 0; + return score; +} + +unsigned XML::gameboy_ram_size(const uint8_t *data, unsigned size) const { + if(size < 512) return 0; + switch(data[0x0149]) { + case 0x00: return 0 * 1024; + case 0x01: return 8 * 1024; + case 0x02: return 8 * 1024; + case 0x03: return 32 * 1024; + case 0x04: return 128 * 1024; + case 0x05: return 128 * 1024; + default: return 128 * 1024; + } +} + +bool XML::gameboy_has_rtc(const uint8_t *data, unsigned size) const { + if(size < 512) return false; + if(data[0x0147] == 0x0f ||data[0x0147] == 0x10) return true; + return false; +} diff --git a/snesreader/xml.hpp b/snesreader/xml.hpp new file mode 100644 index 00000000..c75f8e11 --- /dev/null +++ b/snesreader/xml.hpp @@ -0,0 +1,103 @@ +class XML { +public: + void generate(nall::string &xml, const uint8_t *data, unsigned size); + +private: + void read_header(const uint8_t *data, unsigned size); + unsigned find_header(const uint8_t *data, unsigned size) const; + unsigned score_header(const uint8_t *data, unsigned size, unsigned addr) const; + + unsigned gameboy_ram_size(const uint8_t *data, unsigned size) const; + bool gameboy_has_rtc(const uint8_t *data, unsigned size) const; + + enum HeaderField { + CartName = 0x00, + Mapper = 0x15, + RomType = 0x16, + RomSize = 0x17, + RamSize = 0x18, + CartRegion = 0x19, + Company = 0x1a, + Version = 0x1b, + Complement = 0x1c, //inverse checksum + Checksum = 0x1e, + ResetVector = 0x3c, + }; + + enum Mode { + ModeNormal, + ModeBsxSlotted, + ModeBsx, + ModeSufamiTurbo, + ModeSuperGameBoy, + }; + + enum Type { + TypeNormal, + TypeBsxSlotted, + TypeBsxBios, + TypeBsx, + TypeSufamiTurboBios, + TypeSufamiTurbo, + TypeSuperGameBoy1Bios, + TypeSuperGameBoy2Bios, + TypeGameBoy, + TypeUnknown, + }; + + enum Region { + NTSC, + PAL, + }; + + enum MemoryMapper { + LoROM, + HiROM, + ExLoROM, + ExHiROM, + SuperFXROM, + SA1ROM, + SPC7110ROM, + BSCLoROM, + BSCHiROM, + BSXROM, + STROM, + }; + + enum DSP1MemoryMapper { + DSP1Unmapped, + DSP1LoROM1MB, + DSP1LoROM2MB, + DSP1HiROM, + }; + + bool loaded; //is a base cartridge inserted? + unsigned crc32; //crc32 of all cartridges (base+slot(s)) + unsigned rom_size; + unsigned ram_size; + + Mode mode; + Type type; + Region region; + MemoryMapper mapper; + DSP1MemoryMapper dsp1_mapper; + + bool has_bsx_slot; + bool has_superfx; + bool has_sa1; + bool has_srtc; + bool has_sdd1; + bool has_spc7110; + bool has_spc7110rtc; + bool has_cx4; + bool has_dsp1; + bool has_dsp2; + bool has_dsp3; + bool has_dsp4; + bool has_obc1; + bool has_st010; + bool has_st011; + bool has_st018; +}; + +extern XML xml; diff --git a/src/cartridge/cartridge.hpp b/src/cartridge/cartridge.hpp deleted file mode 100644 index 487463f2..00000000 --- a/src/cartridge/cartridge.hpp +++ /dev/null @@ -1,116 +0,0 @@ -class Cartridge : property { -public: - enum Mode { - ModeNormal, - ModeBsxSlotted, - ModeBsx, - ModeSufamiTurbo, - ModeSuperGameBoy, - }; - - enum Type { - TypeNormal, - TypeBsxSlotted, - TypeBsxBios, - TypeBsx, - TypeSufamiTurboBios, - TypeSufamiTurbo, - TypeSuperGameBoy1Bios, - TypeSuperGameBoy2Bios, - TypeGameBoy, - TypeUnknown, - }; - - enum Region { - NTSC, - PAL, - }; - - enum MemoryMapper { - LoROM, - HiROM, - ExLoROM, - ExHiROM, - SuperFXROM, - SA1ROM, - SPC7110ROM, - BSCLoROM, - BSCHiROM, - BSXROM, - STROM, - }; - - enum DSP1MemoryMapper { - DSP1Unmapped, - DSP1LoROM1MB, - DSP1LoROM2MB, - DSP1HiROM, - }; - - readonly loaded; //is a base cartridge inserted? - readonly crc32; //crc32 of all cartridges (base+slot(s)) - - readonly mode; - readonly type; - readonly region; - readonly mapper; - readonly dsp1_mapper; - - readonly has_bsx_slot; - readonly has_superfx; - readonly has_sa1; - readonly has_srtc; - readonly has_sdd1; - readonly has_spc7110; - readonly has_spc7110rtc; - readonly has_cx4; - readonly has_dsp1; - readonly has_dsp2; - readonly has_dsp3; - readonly has_dsp4; - readonly has_obc1; - readonly has_st010; - readonly has_st011; - readonly has_st018; - bool has_msu() const; - - void load(Mode); - void unload(); - - void serialize(serializer&); - Cartridge(); - ~Cartridge(); - -private: - enum HeaderField { - CartName = 0x00, - Mapper = 0x15, - RomType = 0x16, - RomSize = 0x17, - RamSize = 0x18, - CartRegion = 0x19, - Company = 0x1a, - Version = 0x1b, - Complement = 0x1c, //inverse checksum - Checksum = 0x1e, - ResetVector = 0x3c, - }; - - unsigned ram_size; - void read_header(const uint8_t *data, unsigned size); - unsigned find_header(const uint8_t *data, unsigned size) const; - unsigned score_header(const uint8_t *data, unsigned size, unsigned addr) const; - - unsigned gameboy_ram_size() const; - unsigned gameboy_rtc_size() const; -}; - -namespace memory { - extern MappedRAM cartrom, cartram, cartrtc; - extern MappedRAM bsxflash, bsxram, bsxpram; - extern MappedRAM stArom, stAram; - extern MappedRAM stBrom, stBram; - extern MappedRAM gbrom, gbram, gbrtc; -}; - -extern Cartridge cartridge; diff --git a/src/cartridge/gameboyheader.cpp b/src/cartridge/gameboyheader.cpp deleted file mode 100644 index 2bc9f8ff..00000000 --- a/src/cartridge/gameboyheader.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifdef CARTRIDGE_CPP - -unsigned Cartridge::gameboy_ram_size() const { - if(memory::gbrom.size() < 512) return 0; - switch(memory::gbrom[0x0149]) { - case 0x00: return 0 * 1024; - case 0x01: return 8 * 1024; - case 0x02: return 8 * 1024; - case 0x03: return 32 * 1024; - case 0x04: return 128 * 1024; - case 0x05: return 128 * 1024; - default: return 128 * 1024; - } -} - -unsigned Cartridge::gameboy_rtc_size() const { - if(memory::gbrom.size() < 512) return 0; - if(memory::gbrom[0x0147] == 0x0f || memory::gbrom[0x0147] == 0x10) return 4; - return 0; -} - -#endif diff --git a/src/cartridge/header.cpp b/src/cartridge/header.cpp deleted file mode 100644 index 805029ad..00000000 --- a/src/cartridge/header.cpp +++ /dev/null @@ -1,321 +0,0 @@ -#ifdef CARTRIDGE_CPP - -void Cartridge::read_header(const uint8_t *data, unsigned size) { - type = TypeUnknown; - mapper = LoROM; - dsp1_mapper = DSP1Unmapped; - region = NTSC; - ram_size = 0; - - has_bsx_slot = false; - has_superfx = false; - has_sa1 = false; - has_srtc = false; - has_sdd1 = false; - has_spc7110 = false; - has_spc7110rtc = false; - has_cx4 = false; - has_dsp1 = false; - has_dsp2 = false; - has_dsp3 = false; - has_dsp4 = false; - has_obc1 = false; - has_st010 = false; - has_st011 = false; - has_st018 = false; - - //===================== - //detect Game Boy carts - //===================== - - if(size >= 0x0140) { - if(data[0x0104] == 0xce && data[0x0105] == 0xed && data[0x0106] == 0x66 && data[0x0107] == 0x66 - && data[0x0108] == 0xcc && data[0x0109] == 0x0d && data[0x010a] == 0x00 && data[0x010b] == 0x0b) { - type = TypeGameBoy; - return; - } - } - - const unsigned index = find_header(data, size); - const uint8 mapperid = data[index + Mapper]; - const uint8 rom_type = data[index + RomType]; - const uint8 rom_size = data[index + RomSize]; - const uint8 company = data[index + Company]; - const uint8 regionid = data[index + CartRegion] & 0x7f; - - ram_size = 1024 << (data[index + RamSize] & 7); - if(ram_size == 1024) ram_size = 0; //no RAM present - - //0, 1, 13 = NTSC; 2 - 12 = PAL - region = (regionid <= 1 || regionid >= 13) ? NTSC : PAL; - - //======================= - //detect BS-X flash carts - //======================= - - if(data[index + 0x13] == 0x00 || data[index + 0x13] == 0xff) { - if(data[index + 0x14] == 0x00) { - const uint8_t n15 = data[index + 0x15]; - if(n15 == 0x00 || n15 == 0x80 || n15 == 0x84 || n15 == 0x9c || n15 == 0xbc || n15 == 0xfc) { - if(data[index + 0x1a] == 0x33 || data[index + 0x1a] == 0xff) { - type = TypeBsx; - mapper = BSXROM; - region = NTSC; //BS-X only released in Japan - return; - } - } - } - } - - //========================= - //detect Sufami Turbo carts - //========================= - - if(!memcmp(data, "BANDAI SFC-ADX", 14)) { - if(!memcmp(data + 16, "SFC-ADX BACKUP", 14)) { - type = TypeSufamiTurboBios; - } else { - type = TypeSufamiTurbo; - } - mapper = STROM; - region = NTSC; //Sufami Turbo only released in Japan - return; //RAM size handled outside this routine - } - - //========================== - //detect Super Game Boy BIOS - //========================== - - if(!memcmp(data + index, "Super GAMEBOY2", 14)) { - type = TypeSuperGameBoy2Bios; - return; - } - - if(!memcmp(data + index, "Super GAMEBOY", 13)) { - type = TypeSuperGameBoy1Bios; - return; - } - - //===================== - //detect standard carts - //===================== - - //detect presence of BS-X flash cartridge connector (reads extended header information) - if(data[index - 14] == 'Z') { - if(data[index - 11] == 'J') { - uint8 n13 = data[index - 13]; - if((n13 >= 'A' && n13 <= 'Z') || (n13 >= '0' && n13 <= '9')) { - if(company == 0x33 || (data[index - 10] == 0x00 && data[index - 4] == 0x00)) { - has_bsx_slot = true; - } - } - } - } - - if(has_bsx_slot) { - if(!memcmp(data + index, "Satellaview BS-X ", 21)) { - //BS-X base cart - type = TypeBsxBios; - mapper = BSXROM; - region = NTSC; //BS-X only released in Japan - return; //RAM size handled internally by load_cart_bsx() -> BSXCart class - } else { - type = TypeBsxSlotted; - mapper = (index == 0x7fc0 ? BSCLoROM : BSCHiROM); - region = NTSC; //BS-X slotted cartridges only released in Japan - } - } else { - //standard cart - type = TypeNormal; - - if(index == 0x7fc0 && size >= 0x401000) { - mapper = ExLoROM; - } else if(index == 0x7fc0 && mapperid == 0x32) { - mapper = ExLoROM; - } else if(index == 0x7fc0) { - mapper = LoROM; - } else if(index == 0xffc0) { - mapper = HiROM; - } else { //index == 0x40ffc0 - mapper = ExHiROM; - } - } - - if(mapperid == 0x20 && (rom_type == 0x13 || rom_type == 0x14 || rom_type == 0x15 || rom_type == 0x1a)) { - has_superfx = true; - mapper = SuperFXROM; - ram_size = 1024 << (data[index - 3] & 7); - if(ram_size == 1024) ram_size = 0; - } - - if(mapperid == 0x23 && (rom_type == 0x32 || rom_type == 0x34 || rom_type == 0x35)) { - has_sa1 = true; - mapper = SA1ROM; - } - - if(mapperid == 0x35 && rom_type == 0x55) { - has_srtc = true; - } - - if(mapperid == 0x32 && (rom_type == 0x43 || rom_type == 0x45)) { - has_sdd1 = true; - } - - if(mapperid == 0x3a && (rom_type == 0xf5 || rom_type == 0xf9)) { - has_spc7110 = true; - has_spc7110rtc = (rom_type == 0xf9); - mapper = SPC7110ROM; - } - - if(mapperid == 0x20 && rom_type == 0xf3) { - has_cx4 = true; - } - - if((mapperid == 0x20 || mapperid == 0x21) && rom_type == 0x03) { - has_dsp1 = true; - } - - if(mapperid == 0x30 && rom_type == 0x05 && company != 0xb2) { - has_dsp1 = true; - } - - if(mapperid == 0x31 && (rom_type == 0x03 || rom_type == 0x05)) { - has_dsp1 = true; - } - - if(has_dsp1 == true) { - if((mapperid & 0x2f) == 0x20 && size <= 0x100000) { - dsp1_mapper = DSP1LoROM1MB; - } else if((mapperid & 0x2f) == 0x20) { - dsp1_mapper = DSP1LoROM2MB; - } else if((mapperid & 0x2f) == 0x21) { - dsp1_mapper = DSP1HiROM; - } - } - - if(mapperid == 0x20 && rom_type == 0x05) { - has_dsp2 = true; - } - - if(mapperid == 0x30 && rom_type == 0x05 && company == 0xb2) { - has_dsp3 = true; - } - - if(mapperid == 0x30 && rom_type == 0x03) { - has_dsp4 = true; - } - - if(mapperid == 0x30 && rom_type == 0x25) { - has_obc1 = true; - } - - if(mapperid == 0x30 && rom_type == 0xf6 && rom_size >= 10) { - has_st010 = true; - } - - if(mapperid == 0x30 && rom_type == 0xf6 && rom_size < 10) { - has_st011 = true; - } - - if(mapperid == 0x30 && rom_type == 0xf5) { - has_st018 = true; - } -} - -unsigned Cartridge::find_header(const uint8_t *data, unsigned size) const { - unsigned score_lo = score_header(data, size, 0x007fc0); - unsigned score_hi = score_header(data, size, 0x00ffc0); - unsigned score_ex = score_header(data, size, 0x40ffc0); - if(score_ex) score_ex += 4; //favor ExHiROM on images > 32mbits - - if(score_lo >= score_hi && score_lo >= score_ex) { - return 0x007fc0; - } else if(score_hi >= score_ex) { - return 0x00ffc0; - } else { - return 0x40ffc0; - } -} - -unsigned Cartridge::score_header(const uint8_t *data, unsigned size, unsigned addr) const { - if(size < addr + 64) return 0; //image too small to contain header at this location? - int score = 0; - - uint16 resetvector = data[addr + ResetVector] | (data[addr + ResetVector + 1] << 8); - uint16 checksum = data[addr + Checksum ] | (data[addr + Checksum + 1] << 8); - uint16 complement = data[addr + Complement ] | (data[addr + Complement + 1] << 8); - - uint8 resetop = data[(addr & ~0x7fff) | (resetvector & 0x7fff)]; //first opcode executed upon reset - uint8 mapper = data[addr + Mapper] & ~0x10; //mask off irrelevent FastROM-capable bit - - //$00:[000-7fff] contains uninitialized RAM and MMIO. - //reset vector must point to ROM at $00:[8000-ffff] to be considered valid. - if(resetvector < 0x8000) return 0; - - //some images duplicate the header in multiple locations, and others have completely - //invalid header information that cannot be relied upon. - //below code will analyze the first opcode executed at the specified reset vector to - //determine the probability that this is the correct header. - - //most likely opcodes - if(resetop == 0x78 //sei - || resetop == 0x18 //clc (clc; xce) - || resetop == 0x38 //sec (sec; xce) - || resetop == 0x9c //stz $nnnn (stz $4200) - || resetop == 0x4c //jmp $nnnn - || resetop == 0x5c //jml $nnnnnn - ) score += 8; - - //plausible opcodes - if(resetop == 0xc2 //rep #$nn - || resetop == 0xe2 //sep #$nn - || resetop == 0xad //lda $nnnn - || resetop == 0xae //ldx $nnnn - || resetop == 0xac //ldy $nnnn - || resetop == 0xaf //lda $nnnnnn - || resetop == 0xa9 //lda #$nn - || resetop == 0xa2 //ldx #$nn - || resetop == 0xa0 //ldy #$nn - || resetop == 0x20 //jsr $nnnn - || resetop == 0x22 //jsl $nnnnnn - ) score += 4; - - //implausible opcodes - if(resetop == 0x40 //rti - || resetop == 0x60 //rts - || resetop == 0x6b //rtl - || resetop == 0xcd //cmp $nnnn - || resetop == 0xec //cpx $nnnn - || resetop == 0xcc //cpy $nnnn - ) score -= 4; - - //least likely opcodes - if(resetop == 0x00 //brk #$nn - || resetop == 0x02 //cop #$nn - || resetop == 0xdb //stp - || resetop == 0x42 //wdm - || resetop == 0xff //sbc $nnnnnn,x - ) score -= 8; - - //at times, both the header and reset vector's first opcode will match ... - //fallback and rely on info validity in these cases to determine more likely header. - - //a valid checksum is the biggest indicator of a valid header. - if((checksum + complement) == 0xffff && (checksum != 0) && (complement != 0)) score += 4; - - if(addr == 0x007fc0 && mapper == 0x20) score += 2; //0x20 is usually LoROM - if(addr == 0x00ffc0 && mapper == 0x21) score += 2; //0x21 is usually HiROM - if(addr == 0x007fc0 && mapper == 0x22) score += 2; //0x22 is usually ExLoROM - if(addr == 0x40ffc0 && mapper == 0x25) score += 2; //0x25 is usually ExHiROM - - if(data[addr + Company] == 0x33) score += 2; //0x33 indicates extended header - if(data[addr + RomType] < 0x08) score++; - if(data[addr + RomSize] < 0x10) score++; - if(data[addr + RamSize] < 0x08) score++; - if(data[addr + CartRegion] < 14) score++; - - if(score < 0) score = 0; - return score; -} - -#endif diff --git a/src/chip/dsp1/dsp1.cpp b/src/chip/dsp1/dsp1.cpp deleted file mode 100644 index 8fe22b3e..00000000 --- a/src/chip/dsp1/dsp1.cpp +++ /dev/null @@ -1,83 +0,0 @@ -#include <../base.hpp> - -#define DSP1_CPP -namespace SNES { - -DSP1 dsp1; - -#include "serialization.cpp" -#include "dsp1emu.cpp" - -void DSP1::init() { -} - -void DSP1::enable() { - switch(cartridge.dsp1_mapper()) { - case Cartridge::DSP1LoROM1MB: { - bus.map(Bus::MapDirect, 0x20, 0x3f, 0x8000, 0xffff, *this); - bus.map(Bus::MapDirect, 0xa0, 0xbf, 0x8000, 0xffff, *this); - } break; - - case Cartridge::DSP1LoROM2MB: { - bus.map(Bus::MapDirect, 0x60, 0x6f, 0x0000, 0x7fff, *this); - bus.map(Bus::MapDirect, 0xe0, 0xef, 0x0000, 0x7fff, *this); - } break; - - case Cartridge::DSP1HiROM: { - bus.map(Bus::MapDirect, 0x00, 0x1f, 0x6000, 0x7fff, *this); - bus.map(Bus::MapDirect, 0x80, 0x9f, 0x6000, 0x7fff, *this); - } break; - } -} - -void DSP1::power() { - reset(); -} - -void DSP1::reset() { - dsp1.reset(); -} - -/***** - * addr_decode() - * determine whether address is accessing - * data register (DR) or status register (SR) - * -- 0 (false) = DR - * -- 1 (true ) = SR - * - * note: there is no need to bounds check addresses, - * as memory mapper will not allow DSP1 accesses outside - * of expected ranges - *****/ -bool DSP1::addr_decode(uint16 addr) { - switch(cartridge.dsp1_mapper()) { - case Cartridge::DSP1LoROM1MB: { - //$[20-3f]:[8000-bfff] = DR, $[20-3f]:[c000-ffff] = SR - return (addr >= 0xc000); - } - - case Cartridge::DSP1LoROM2MB: { - //$[60-6f]:[0000-3fff] = DR, $[60-6f]:[4000-7fff] = SR - return (addr >= 0x4000); - } - - case Cartridge::DSP1HiROM: { - //$[00-1f]:[6000-6fff] = DR, $[00-1f]:[7000-7fff] = SR - return (addr >= 0x7000); - } - } - - return 0; -} - -uint8 DSP1::read(unsigned addr) { - return (addr_decode(addr) == 0) ? dsp1.getDr() : dsp1.getSr(); -} - -void DSP1::write(unsigned addr, uint8 data) { - if(addr_decode(addr) == 0) { - dsp1.setDr(data); - } -} - -}; diff --git a/src/chip/st010/serialization.cpp b/src/chip/st010/serialization.cpp deleted file mode 100644 index 8c0a67c8..00000000 --- a/src/chip/st010/serialization.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef ST010_CPP - -void ST010::serialize(serializer &s) { - s.array(ram); -} - -#endif diff --git a/src/chip/st011/st011.cpp b/src/chip/st011/st011.cpp deleted file mode 100644 index 2ec90f40..00000000 --- a/src/chip/st011/st011.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include <../base.hpp> - -#define ST011_CPP -namespace SNES { - -ST011 st011; - -void ST011::init() { -} - -void ST011::enable() { -} - -void ST011::power() { -} - -void ST011::reset() { -} - -}; diff --git a/src/lib/nall/static.hpp b/src/lib/nall/static.hpp deleted file mode 100644 index 00c3664c..00000000 --- a/src/lib/nall/static.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef NALL_STATIC_HPP -#define NALL_STATIC_HPP - -namespace nall { - template struct static_assert; - template<> struct static_assert {}; - - template struct static_if { - typedef true_type type; - }; - - template struct static_if { - typedef false_type type; - }; -} - -#endif diff --git a/src/lib/nall/string/convert.hpp b/src/lib/nall/string/convert.hpp deleted file mode 100644 index da90bb09..00000000 --- a/src/lib/nall/string/convert.hpp +++ /dev/null @@ -1,285 +0,0 @@ -#ifndef NALL_STRING_CONVERT_HPP -#define NALL_STRING_CONVERT_HPP - -char* strlower(char *str) { - if(!str) return 0; - int i = 0; - while(str[i]) { - str[i] = chrlower(str[i]); - i++; - } - return str; -} - -char* strupper(char *str) { - if(!str) return 0; - int i = 0; - while(str[i]) { - str[i] = chrupper(str[i]); - i++; - } - return str; -} - -char* strtr(char *dest, const char *before, const char *after) { - if(!dest || !before || !after) return dest; - int sl = strlen(dest), bsl = strlen(before), asl = strlen(after); - - if(bsl != asl || bsl == 0) return dest; //patterns must be the same length for 1:1 replace - for(unsigned i = 0; i < sl; i++) { - for(unsigned l = 0; l < bsl; l++) { - if(dest[i] == before[l]) { - dest[i] = after[l]; - break; - } - } - } - - return dest; -} - -uintmax_t strhex(const char *str) { - if(!str) return 0; - uintmax_t result = 0; - - //skip hex identifiers 0x and $, if present - if(*str == '0' && (*(str + 1) == 'X' || *(str + 1) == 'x')) str += 2; - else if(*str == '$') str++; - - while(*str) { - uint8_t x = *str++; - if(x >= '0' && x <= '9') x -= '0'; - else if(x >= 'A' && x <= 'F') x -= 'A' - 10; - else if(x >= 'a' && x <= 'f') x -= 'a' - 10; - else break; //stop at first invalid character - result = result * 16 + x; - } - - return result; -} - -intmax_t strsigned(const char *str) { - if(!str) return 0; - intmax_t result = 0; - bool negate = false; - - //check for negation - if(*str == '-') { - negate = true; - str++; - } - - while(*str) { - uint8_t x = *str++; - if(x >= '0' && x <= '9') x -= '0'; - else break; //stop at first invalid character - result = result * 10 + x; - } - - return !negate ? result : -result; -} - -uintmax_t strunsigned(const char *str) { - if(!str) return 0; - uintmax_t result = 0; - - while(*str) { - uint8_t x = *str++; - if(x >= '0' && x <= '9') x -= '0'; - else break; //stop at first invalid character - result = result * 10 + x; - } - - return result; -} - -uintmax_t strbin(const char *str) { - if(!str) return 0; - uintmax_t result = 0; - - //skip bin identifiers 0b and %, if present - if(*str == '0' && (*(str + 1) == 'B' || *(str + 1) == 'b')) str += 2; - else if(*str == '%') str++; - - while(*str) { - uint8_t x = *str++; - if(x == '0' || x == '1') x -= '0'; - else break; //stop at first invalid character - result = result * 2 + x; - } - - return result; -} - -double strdouble(const char *str) { - if(!str) return 0.0; - bool negate = false; - - //check for negation - if(*str == '-') { - negate = true; - str++; - } - - intmax_t result_integral = 0; - while(*str) { - uint8_t x = *str++; - if(x >= '0' && x <= '9') x -= '0'; - else if(x == '.') break; //break loop and read fractional part - else return (double)result_integral; //invalid value, assume no fractional part - result_integral = result_integral * 10 + x; - } - - intmax_t result_fractional = 0; - while(*str) { - uint8_t x = *str++; - if(x >= '0' && x <= '9') x -= '0'; - else break; //stop at first invalid character - result_fractional = result_fractional * 10 + x; - } - - //calculate fractional portion - double result = (double)result_fractional; - while((uintmax_t)result > 0) result /= 10.0; - result += (double)result_integral; - - return !negate ? result : -result; -} - -// - -size_t strhex(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length -= 1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 16) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = value % 16; - value /= 16; - *--str = x < 10 ? (x + '0') : (x + 'a' - 10); //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strsigned(char *str, intmax_t value_, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - bool negate = value_ < 0; - uintmax_t value = value_ >= 0 ? value_ : -value_; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = (negate ? 1 : 0) + digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - while(length && digits_integral--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - length--; - } - - if(length && negate) { - *--str = '-'; - } - - return nall::min(initial_length, digits + 1); -} - -size_t strunsigned(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = digits_integral; - if(!str) return digits_integral + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strbin(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 2) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 2); - value /= 2; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -//using sprintf is certainly not the most ideal method to convert -//a double to a string ... but attempting to parse a double by -//hand, digit-by-digit, results in subtle rounding errors. -// -//note: length parameter is currently ignored. -//it remains for consistency and possible future support. -size_t strdouble(char *str, double value, size_t length /* = 0 */) { - char buffer[256]; - sprintf(buffer, "%f", value); - - //remove excess 0's in fraction (2.500000 -> 2.5) - for(char *p = buffer; *p; p++) { - if(*p == '.') { - char *p = buffer + strlen(buffer) - 1; - while(*p == '0') { - if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. - p--; - } - break; - } - } - - length = strlen(buffer); - if(str) strcpy(str, buffer); - return length + 1; -} - -#endif diff --git a/src/lib/nall/string/utility.hpp b/src/lib/nall/string/utility.hpp deleted file mode 100644 index 1300d326..00000000 --- a/src/lib/nall/string/utility.hpp +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef NALL_STRING_UTILITY_HPP -#define NALL_STRING_UTILITY_HPP - -size_t strlcpy(nall::string &dest, const char *src, size_t length) { - dest.reserve(length); - return strlcpy(dest(), src, length); -} - -size_t strlcat(nall::string &dest, const char *src, size_t length) { - dest.reserve(length); - return strlcat(dest(), src, length); -} - -nall::string substr(const char *src, size_t start, size_t length) { - nall::string dest; - if(length == 0) { - //copy entire string - dest = src + start; - } else { - //copy partial string - strlcpy(dest, src + start, length + 1); - } - return dest; -} - -/* very simplistic wrappers to return nall::string& instead of char* type */ - -nall::string& strlower(nall::string &str) { strlower(str()); return str; } -nall::string& strupper(nall::string &str) { strupper(str()); return str; } -nall::string& strtr(nall::string &dest, const char *before, const char *after) { strtr(dest(), before, after); return dest; } -nall::string& ltrim(nall::string &str, const char *key) { ltrim(str(), key); return str; } -nall::string& rtrim(nall::string &str, const char *key) { rtrim(str(), key); return str; } -nall::string& trim (nall::string &str, const char *key) { trim (str(), key); return str; } -nall::string& ltrim_once(nall::string &str, const char *key) { ltrim_once(str(), key); return str; } -nall::string& rtrim_once(nall::string &str, const char *key) { rtrim_once(str(), key); return str; } -nall::string& trim_once (nall::string &str, const char *key) { trim_once (str(), key); return str; } - -/* arithmetic <> string */ - -nall::string strhex(uintmax_t value) { - nall::string temp; - temp.reserve(strhex(0, value)); - strhex(temp(), value); - return temp; -} - -nall::string strsigned(intmax_t value) { - nall::string temp; - temp.reserve(strsigned(0, value)); - strsigned(temp(), value); - return temp; -} - -nall::string strunsigned(uintmax_t value) { - nall::string temp; - temp.reserve(strunsigned(0, value)); - strunsigned(temp(), value); - return temp; -} - -nall::string strbin(uintmax_t value) { - nall::string temp; - temp.reserve(strbin(0, value)); - strbin(temp(), value); - return temp; -} - -nall::string strdouble(double value) { - nall::string temp; - temp.reserve(strdouble(0, value)); - strdouble(temp(), value); - return temp; -} - -#endif diff --git a/src/lib/nall/utility.hpp b/src/lib/nall/utility.hpp deleted file mode 100644 index fa73f8cb..00000000 --- a/src/lib/nall/utility.hpp +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef NALL_UTILITY_HPP -#define NALL_UTILITY_HPP - -namespace nall { - template - inline void swap(T &x, T &y) { - T temp(x); - x = y; - y = temp; - } - - template - struct base_from_member { - T value; - base_from_member(T value_) : value(value_) {} - }; - - class noncopyable { - protected: - noncopyable() {} - ~noncopyable() {} - - private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); - }; - - template - inline T* allocate(size_t size, const T &value) { - T *array = new T[size]; - for(size_t i = 0; i < size; i++) array[i] = value; - return array; - } -} - -#endif diff --git a/src/memory/smemory/generic.cpp b/src/memory/smemory/generic.cpp deleted file mode 100644 index 92c45883..00000000 --- a/src/memory/smemory/generic.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#ifdef SMEMORY_CPP - -void sBus::map_generic() { - switch(cartridge.mapper()) { - case Cartridge::LoROM: { - map(MapLinear, 0x00, 0x7f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x80, 0xff, 0x8000, 0xffff, memory::cartrom); - map_generic_sram(); - } break; - - case Cartridge::HiROM: { - map(MapShadow, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x40, 0x7f, 0x0000, 0xffff, memory::cartrom); - map(MapShadow, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom); - map_generic_sram(); - } break; - - case Cartridge::ExLoROM: { - map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x40, 0x7f, 0x0000, 0xffff, memory::cartrom); - map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom); - map_generic_sram(); - } break; - - case Cartridge::ExHiROM: { - map(MapShadow, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom, 0x400000); - map(MapLinear, 0x40, 0x7f, 0x0000, 0xffff, memory::cartrom, 0x400000); - map(MapShadow, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom, 0x000000); - map(MapLinear, 0xc0, 0xff, 0x0000, 0xffff, memory::cartrom, 0x000000); - map_generic_sram(); - } break; - - case Cartridge::SuperFXROM: { - //mapped via SuperFXBus::init(); - } break; - - case Cartridge::SA1ROM: { - //mapped via SA1Bus::init(); - } break; - - case Cartridge::SPC7110ROM: { - map(MapDirect, 0x00, 0x00, 0x6000, 0x7fff, spc7110); //save RAM w/custom logic - map(MapShadow, 0x00, 0x0f, 0x8000, 0xffff, memory::cartrom); //program ROM - map(MapDirect, 0x30, 0x30, 0x6000, 0x7fff, spc7110); //save RAM w/custom logic - map(MapDirect, 0x50, 0x50, 0x0000, 0xffff, spc7110); //decompression MMIO port - map(MapShadow, 0x80, 0x8f, 0x8000, 0xffff, memory::cartrom); //program ROM - map(MapLinear, 0xc0, 0xcf, 0x0000, 0xffff, memory::cartrom); //program ROM - map(MapDirect, 0xd0, 0xff, 0x0000, 0xffff, spc7110); //MMC-controlled data ROM - } break; - - case Cartridge::BSXROM: { - //full map is dynamically mapped by: - //src/chip/bsx/bsx_cart.cpp : BSXCart::update_memory_map(); - map(MapLinear, 0x00, 0x3f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x80, 0xbf, 0x8000, 0xffff, memory::cartrom); - } break; - - case Cartridge::BSCLoROM: { - map(MapLinear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom, 0x000000); - map(MapLinear, 0x20, 0x3f, 0x8000, 0xffff, memory::cartrom, 0x100000); - map(MapLinear, 0x70, 0x7f, 0x0000, 0x7fff, memory::cartram, 0x000000); - map(MapLinear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom, 0x200000); - map(MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, memory::cartrom, 0x100000); - map(MapLinear, 0xc0, 0xef, 0x0000, 0xffff, bsxflash); - map(MapLinear, 0xf0, 0xff, 0x0000, 0x7fff, memory::cartram, 0x000000); - } break; - - case Cartridge::BSCHiROM: { - map(MapShadow, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x20, 0x3f, 0x6000, 0x7fff, memory::cartram); - map(MapShadow, 0x20, 0x3f, 0x8000, 0xffff, bsxflash); - map(MapLinear, 0x40, 0x5f, 0x0000, 0xffff, memory::cartrom); - map(MapLinear, 0x60, 0x7f, 0x0000, 0xffff, bsxflash); - map(MapShadow, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xa0, 0xbf, 0x6000, 0x7fff, memory::cartram); - map(MapShadow, 0xa0, 0xbf, 0x8000, 0xffff, bsxflash); - map(MapLinear, 0xc0, 0xdf, 0x0000, 0xffff, memory::cartrom); - map(MapLinear, 0xe0, 0xff, 0x0000, 0xffff, bsxflash); - } break; - - case Cartridge::STROM: { - map(MapLinear, 0x00, 0x1f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0x20, 0x3f, 0x8000, 0xffff, memory::stArom); - map(MapLinear, 0x40, 0x5f, 0x8000, 0xffff, memory::stBrom); - map(MapLinear, 0x60, 0x63, 0x8000, 0xffff, memory::stAram); - map(MapLinear, 0x70, 0x73, 0x8000, 0xffff, memory::stBram); - map(MapLinear, 0x80, 0x9f, 0x8000, 0xffff, memory::cartrom); - map(MapLinear, 0xa0, 0xbf, 0x8000, 0xffff, memory::stArom); - map(MapLinear, 0xc0, 0xdf, 0x8000, 0xffff, memory::stBrom); - map(MapLinear, 0xe0, 0xe3, 0x8000, 0xffff, memory::stAram); - map(MapLinear, 0xf0, 0xf3, 0x8000, 0xffff, memory::stBram); - } break; - } -} - -void sBus::map_generic_sram() { - if(memory::cartram.size() == 0 || memory::cartram.size() == -1U) { return; } - - map(MapLinear, 0x20, 0x3f, 0x6000, 0x7fff, memory::cartram); - map(MapLinear, 0xa0, 0xbf, 0x6000, 0x7fff, memory::cartram); - - //research shows only games with very large ROM/RAM sizes require MAD-1 memory mapping of RAM - //otherwise, default to safer, larger RAM address window - uint16 addr_hi = (memory::cartrom.size() > 0x200000 || memory::cartram.size() > 32 * 1024) ? 0x7fff : 0xffff; - map(MapLinear, 0x70, 0x7f, 0x0000, addr_hi, memory::cartram); - if(cartridge.mapper() != Cartridge::LoROM) return; - map(MapLinear, 0xf0, 0xff, 0x0000, addr_hi, memory::cartram); -} - -#endif diff --git a/src/memory/smemory/smemory.cpp b/src/memory/smemory/smemory.cpp deleted file mode 100644 index c14a38a4..00000000 --- a/src/memory/smemory/smemory.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include <../base.hpp> - -#define SMEMORY_CPP -namespace SNES { - -sBus bus; - -#include "system.cpp" -#include "generic.cpp" -#include "serialization.cpp" - -void sBus::power() { - for(unsigned i = 0x2000; i <= 0x5fff; i++) memory::mmio.map(i, memory::mmio_unmapped); - for(unsigned i = 0; i < memory::wram.size(); i++) memory::wram[i] = config.cpu.wram_init_value; -} - -void sBus::reset() { -} - -bool sBus::load_cart() { - if(cartridge.loaded() == true) return false; - - map_reset(); - map_generic(); - map_system(); - return true; -} - -void sBus::unload_cart() { -} - -sBus::sBus() { -} - -sBus::~sBus() { -} - -}; diff --git a/src/memory/smemory/system.cpp b/src/memory/smemory/system.cpp deleted file mode 100644 index 1612b9fe..00000000 --- a/src/memory/smemory/system.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#ifdef SMEMORY_CPP - -void sBus::map_reset() { - map(MapDirect, 0x00, 0xff, 0x0000, 0xffff, memory::memory_unmapped); - for(unsigned i = 0x2000; i <= 0x5fff; i++) memory::mmio.map(i, memory::mmio_unmapped); -} - -void sBus::map_system() { - map(MapDirect, 0x00, 0x3f, 0x2000, 0x5fff, memory::mmio); - map(MapDirect, 0x80, 0xbf, 0x2000, 0x5fff, memory::mmio); - - map(MapLinear, 0x00, 0x3f, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); - map(MapLinear, 0x80, 0xbf, 0x0000, 0x1fff, memory::wram, 0x000000, 0x002000); - - map(MapLinear, 0x7e, 0x7f, 0x0000, 0xffff, memory::wram); -} - -#endif diff --git a/src/smp/core/disassembler/disassembler.hpp b/src/smp/core/disassembler/disassembler.hpp deleted file mode 100644 index abb8982f..00000000 --- a/src/smp/core/disassembler/disassembler.hpp +++ /dev/null @@ -1,2 +0,0 @@ -void disassemble_opcode(char *output, uint16 addr); -inline uint16 __relb(int8 offset, int op_len); diff --git a/src/ui_qt/tools/cheateditor.moc.hpp b/src/ui_qt/tools/cheateditor.moc.hpp deleted file mode 100644 index 193981dc..00000000 --- a/src/ui_qt/tools/cheateditor.moc.hpp +++ /dev/null @@ -1,33 +0,0 @@ -class CheatEditorWindow : public QWidget { - Q_OBJECT - -public: - QVBoxLayout *layout; - QTreeWidget *list; - QGridLayout *gridLayout; - QLabel *codeLabel; - QLineEdit *codeEdit; - QLabel *descLabel; - QLineEdit *descEdit; - QHBoxLayout *controlLayout; - QPushButton *clearButton; - - void load(const char *filename); - void save(const char *filename); - void update(); - - void synchronize(); - CheatEditorWindow(); - -private slots: - void bind(); - void listChanged(); - void codeEdited(); - void descEdited(); - void clearSelected(); - -private: - bool lock; -}; - -extern CheatEditorWindow *cheatEditorWindow; diff --git a/supergameboy.dll b/supergameboy.dll new file mode 100644 index 00000000..d7595f68 Binary files /dev/null and b/supergameboy.dll differ diff --git a/supergameboy/Makefile b/supergameboy/Makefile index 4f4ff428..60409afa 100644 --- a/supergameboy/Makefile +++ b/supergameboy/Makefile @@ -1,7 +1,7 @@ include nall/Makefile -c := $(compiler) -cpp := $(subst cc,++,$(compiler)) +c := $(compiler) -std=gnu99 +cpp := $(subst cc,++,$(compiler)) -std=gnu++0x flags := -O3 -fomit-frame-pointer -I. -Icommon -Ilibgambatte/include -Ilibgambatte/src link := diff --git a/supergameboy/libgambatte/src/statesaver.cpp b/supergameboy/libgambatte/src/statesaver.cpp index 9b113ee6..c157129d 100644 --- a/supergameboy/libgambatte/src/statesaver.cpp +++ b/supergameboy/libgambatte/src/statesaver.cpp @@ -378,7 +378,7 @@ bool StateSaver::loadState(SaveState &state, const char *filename) { file.ignore(get24(file)); Array labelbuf(list.maxLabelsize()); - const Saver labelbufSaver = { label: labelbuf, save: 0, load: 0, labelsize: list.maxLabelsize() }; + const Saver labelbufSaver = { label: labelbuf, save: 0, load: 0, labelsize: (unsigned char)list.maxLabelsize() }; SaverList::const_iterator done = list.begin(); diff --git a/supergameboy/nall/algorithm.hpp b/supergameboy/nall/algorithm.hpp index 98b39528..cdc48dcf 100644 --- a/supergameboy/nall/algorithm.hpp +++ b/supergameboy/nall/algorithm.hpp @@ -5,11 +5,11 @@ #undef max namespace nall { - template T min(const T& t, const U& u) { + template T min(const T &t, const U &u) { return t < u ? t : u; } - template T max(const T& t, const U& u) { + template T max(const T &t, const U &u) { return t > u ? t : u; } diff --git a/supergameboy/nall/array.hpp b/supergameboy/nall/array.hpp index 50a03f66..392b5bc0 100644 --- a/supergameboy/nall/array.hpp +++ b/supergameboy/nall/array.hpp @@ -2,8 +2,11 @@ #define NALL_ARRAY_HPP #include +#include #include #include +#include +#include namespace nall { //dynamic vector array @@ -57,18 +60,18 @@ namespace nall { memset(pool, 0, buffersize * sizeof(T)); } - array() { - pool = 0; - poolsize = 0; - buffersize = 0; + array() : pool(0), poolsize(0), buffersize(0) { } - ~array() { reset(); } - - array(const array &source) : pool(0) { - operator=(source); + array(std::initializer_list list) : pool(0), poolsize(0), buffersize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); } + ~array() { + reset(); + } + + //copy array& operator=(const array &source) { if(pool) free(pool); buffersize = source.buffersize; @@ -78,6 +81,25 @@ namespace nall { return *this; } + array(const array &source) : pool(0) { + operator=(source); + } + + //move + array& operator=(array &&source) { + if(pool) free(pool); + pool = source.pool; + poolsize = source.poolsize; + buffersize = source.buffersize; + source.pool = 0; + return *this; + } + + array(array &&source) { + operator=(move(source)); + } + + //index inline T& operator[](unsigned index) { if(index >= buffersize) resize(index + 1); if(index >= buffersize) throw "array[] out of bounds"; @@ -89,6 +111,8 @@ namespace nall { return pool[index]; } }; + + template struct has_size> { enum { value = true }; }; } #endif diff --git a/supergameboy/nall/concept.hpp b/supergameboy/nall/concept.hpp new file mode 100644 index 00000000..2949cd5e --- /dev/null +++ b/supergameboy/nall/concept.hpp @@ -0,0 +1,15 @@ +#ifndef NALL_CONCEPT_HPP +#define NALL_CONCEPT_HPP + +namespace nall { + //unsigned count() const; + template struct has_count { enum { value = false }; }; + + //unsigned length() const; + template struct has_length { enum { value = false }; }; + + //unsigned size() const; + template struct has_size { enum { value = false }; }; +} + +#endif diff --git a/supergameboy/nall/config.hpp b/supergameboy/nall/config.hpp index 10494e65..31ae4e00 100644 --- a/supergameboy/nall/config.hpp +++ b/supergameboy/nall/config.hpp @@ -53,7 +53,7 @@ namespace nall { } } }; - vector list; + linear_vector list; template void attach(T &data, const char *name, const char *desc = "") { diff --git a/supergameboy/nall/dictionary.hpp b/supergameboy/nall/dictionary.hpp index 35128c2f..f14e2095 100644 --- a/supergameboy/nall/dictionary.hpp +++ b/supergameboy/nall/dictionary.hpp @@ -6,7 +6,7 @@ #include namespace nall { - class dictionary : noncopyable { + class dictionary { public: string operator[](const char *input) { for(unsigned i = 0; i < index_input.size(); i++) { @@ -64,6 +64,9 @@ namespace nall { reset(); } + dictionary& operator=(const dictionary&) = delete; + dictionary(const dictionary&) = delete; + protected: lstring index_input; lstring index_output; diff --git a/supergameboy/nall/dl.hpp b/supergameboy/nall/dl.hpp index 088b91e9..22acf51f 100644 --- a/supergameboy/nall/dl.hpp +++ b/supergameboy/nall/dl.hpp @@ -16,7 +16,7 @@ #endif namespace nall { - struct library : noncopyable { + struct library { bool opened() const { return handle; } bool open(const char*); void* sym(const char*); @@ -25,6 +25,9 @@ namespace nall { library() : handle(0) {} ~library() { close(); } + library& operator=(const library&) = delete; + library(const library&) = delete; + private: uintptr_t handle; }; diff --git a/supergameboy/nall/file.hpp b/supergameboy/nall/file.hpp index 29be589c..4c8ca8ee 100644 --- a/supergameboy/nall/file.hpp +++ b/supergameboy/nall/file.hpp @@ -23,7 +23,7 @@ namespace nall { #endif } - class file : noncopyable { + class file { public: enum FileMode { mode_read, mode_write, mode_readwrite, mode_writeread }; enum SeekMode { seek_absolute, seek_relative }; @@ -218,6 +218,9 @@ namespace nall { close(); } + file& operator=(const file&) = delete; + file(const file&) = delete; + private: enum { buffer_size = 1 << 12, buffer_mask = buffer_size - 1 }; char buffer[buffer_size]; diff --git a/supergameboy/nall/foreach.hpp b/supergameboy/nall/foreach.hpp new file mode 100644 index 00000000..39ca7f5f --- /dev/null +++ b/supergameboy/nall/foreach.hpp @@ -0,0 +1,31 @@ +#ifndef NALL_FOREACH_HPP +#define NALL_FOREACH_HPP + +#undef foreach +#define foreach(iter, object) \ + for(unsigned foreach_counter = 0, foreach_limit = foreach_size(object), foreach_once = 0, foreach_broken = 0; foreach_counter < foreach_limit && foreach_broken == 0; foreach_counter++, foreach_once = 0) \ + for(auto &iter = object[foreach_counter]; foreach_once == 0 && (foreach_broken = 1); foreach_once++, foreach_broken = 0) + +#include +#include +#include + +namespace nall { + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.count(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.length(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return object.size(); + } + + template unsigned foreach_size(const T& object, typename mp_enable_if>::type = 0) { + return sizeof(T) / sizeof(typename remove_extent::type); + } +} + +#endif diff --git a/supergameboy/nall/priorityqueue.hpp b/supergameboy/nall/priorityqueue.hpp index 7f33e23b..7104e791 100644 --- a/supergameboy/nall/priorityqueue.hpp +++ b/supergameboy/nall/priorityqueue.hpp @@ -14,7 +14,7 @@ namespace nall { //O(1) find (tick) //O(log n) insert (enqueue) //O(log n) remove (dequeue) - template class priority_queue : noncopyable { + template class priority_queue { public: inline void tick(unsigned ticks) { basecounter += ticks; @@ -86,6 +86,9 @@ namespace nall { delete[] heap; } + priority_queue& operator=(const priority_queue&) = delete; + priority_queue(const priority_queue&) = delete; + private: function callback; unsigned basecounter; diff --git a/supergameboy/nall/qt/concept.hpp b/supergameboy/nall/qt/concept.hpp new file mode 100644 index 00000000..51cacef4 --- /dev/null +++ b/supergameboy/nall/qt/concept.hpp @@ -0,0 +1,10 @@ +#ifndef NALL_QT_CONCEPT_HPP +#define NALL_QT_CONCEPT_HPP + +#include + +namespace nall { + template struct has_count> { enum { value = true }; }; +} + +#endif diff --git a/supergameboy/nall/qt/hex-editor.moc.hpp b/supergameboy/nall/qt/hex-editor.moc.hpp index 7fb0c6c5..d59f4be9 100644 --- a/supergameboy/nall/qt/hex-editor.moc.hpp +++ b/supergameboy/nall/qt/hex-editor.moc.hpp @@ -11,15 +11,14 @@ class HexEditor : public QTextEdit { Q_OBJECT public: - enum { - LineWidth = 59, - }; - function reader; function writer; + void setColumns(unsigned columns); + void setRows(unsigned rows); void setOffset(unsigned offset); void setSize(unsigned size); + unsigned lineWidth() const; void refresh(); HexEditor(); @@ -30,6 +29,8 @@ protected slots: protected: QHBoxLayout *layout; QScrollBar *scrollBar; + unsigned editorColumns; + unsigned editorRows; unsigned editorOffset; unsigned editorSize; bool lock; @@ -39,8 +40,8 @@ protected: inline void HexEditor::keyPressEvent(QKeyEvent *event) { QTextCursor cursor = textCursor(); - unsigned x = cursor.position() % LineWidth; - unsigned y = cursor.position() / LineWidth; + unsigned x = cursor.position() % lineWidth(); + unsigned y = cursor.position() / lineWidth(); int hexCode = -1; switch(event->key()) { @@ -66,7 +67,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { bool cursorOffsetValid = (x >= 11 && ((x - 11) % 3) != 2); if(cursorOffsetValid) { bool nibble = (x - 11) % 3; //0 = top nibble, 1 = bottom nibble - unsigned cursorOffset = y * 16 + ((x - 11) / 3); + unsigned cursorOffset = y * editorColumns + ((x - 11) / 3); unsigned effectiveOffset = editorOffset + cursorOffset; if(effectiveOffset >= editorSize) effectiveOffset %= editorSize; @@ -76,7 +77,7 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { if(writer) writer(effectiveOffset, data); refresh(); - cursor.setPosition(y * LineWidth + x + 1); //advance cursor + cursor.setPosition(y * lineWidth() + x + 1); //advance cursor setTextCursor(cursor); } } else { @@ -87,16 +88,30 @@ inline void HexEditor::keyPressEvent(QKeyEvent *event) { } } +inline void HexEditor::setColumns(unsigned columns) { + editorColumns = columns; +} + +inline void HexEditor::setRows(unsigned rows) { + editorRows = rows; + scrollBar->setPageStep(editorRows); +} + inline void HexEditor::setOffset(unsigned offset) { lock = true; editorOffset = offset; - scrollBar->setSliderPosition(editorOffset / 16); + scrollBar->setSliderPosition(editorOffset / editorColumns); lock = false; } inline void HexEditor::setSize(unsigned size) { editorSize = size; - scrollBar->setRange(0, editorSize / 16 - 16); + bool indivisible = (editorSize % editorColumns) != 0; //add one for incomplete row + scrollBar->setRange(0, editorSize / editorColumns + indivisible - editorRows); +} + +inline unsigned HexEditor::lineWidth() const { + return 11 + 3 * editorColumns; } inline void HexEditor::refresh() { @@ -104,20 +119,20 @@ inline void HexEditor::refresh() { char temp[256]; unsigned offset = editorOffset; - for(unsigned y = 0; y < 16; y++) { + for(unsigned y = 0; y < editorRows; y++) { if(offset >= editorSize) break; sprintf(temp, "%.4x:%.4x", (offset >> 16) & 0xffff, (offset >> 0) & 0xffff); output << "" << temp << "  "; - for(unsigned x = 0; x < 16; x++) { + for(unsigned x = 0; x < editorColumns; x++) { if(offset >= editorSize) break; sprintf(temp, "%.2x", reader ? reader(offset) : 0x00); offset++; output << "" << temp << ""; - if(x != 15) output << " "; + if(x != (editorColumns - 1)) output << " "; } - if(y != 15) output << "
"; + if(y != (editorRows - 1)) output << "
"; } setHtml(output); @@ -126,7 +141,7 @@ inline void HexEditor::refresh() { inline void HexEditor::scrolled() { if(lock) return; unsigned offset = scrollBar->sliderPosition(); - editorOffset = offset * 16; + editorOffset = offset * editorColumns; refresh(); } @@ -142,12 +157,13 @@ inline HexEditor::HexEditor() { scrollBar = new QScrollBar(Qt::Vertical); scrollBar->setSingleStep(1); - scrollBar->setPageStep(16); layout->addWidget(scrollBar); lock = false; connect(scrollBar, SIGNAL(actionTriggered(int)), this, SLOT(scrolled())); + setColumns(16); + setRows(16); setSize(0); setOffset(0); } diff --git a/supergameboy/nall/serializer.hpp b/supergameboy/nall/serializer.hpp index 521e7d2e..49b0964e 100644 --- a/supergameboy/nall/serializer.hpp +++ b/supergameboy/nall/serializer.hpp @@ -6,7 +6,6 @@ #include namespace nall { - //serializer: a class designed to save and restore the state of classes. // //benefits: @@ -17,7 +16,6 @@ namespace nall { //caveats: //- only plain-old-data can be stored. complex classes must provide serialize(serializer&); //- floating-point usage is not portable across platforms - class serializer { public: enum mode_t { Load, Save, Size }; @@ -73,6 +71,7 @@ namespace nall { for(unsigned n = 0; n < size; n++) integer(array[n]); } + //copy serializer& operator=(const serializer &s) { if(idata) delete[] idata; @@ -89,6 +88,24 @@ namespace nall { operator=(s); } + //move + serializer& operator=(serializer &&s) { + if(idata) delete[] idata; + + imode = s.imode; + idata = s.idata; + isize = s.isize; + icapacity = s.icapacity; + + s.idata = 0; + return *this; + } + + serializer(serializer &&s) { + operator=(move(s)); + } + + //construction serializer() { imode = Size; idata = 0; diff --git a/supergameboy/nall/static.hpp b/supergameboy/nall/static.hpp index 00c3664c..4acb9fd0 100644 --- a/supergameboy/nall/static.hpp +++ b/supergameboy/nall/static.hpp @@ -2,16 +2,19 @@ #define NALL_STATIC_HPP namespace nall { - template struct static_assert; - template<> struct static_assert {}; + template struct static_if { typedef T type; }; + template struct static_if { typedef F type; }; + template struct mp_static_if { typedef typename static_if::type type; }; - template struct static_if { - typedef true_type type; - }; + template struct static_and { enum { value = false }; }; + template<> struct static_and { enum { value = true }; }; + template struct mp_static_and { enum { value = static_and::value }; }; - template struct static_if { - typedef false_type type; - }; + template struct static_or { enum { value = false }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template<> struct static_or { enum { value = true }; }; + template struct mp_static_or { enum { value = static_or::value }; }; } #endif diff --git a/supergameboy/nall/stdint.hpp b/supergameboy/nall/stdint.hpp index 7e2c7a46..d8b6c788 100644 --- a/supergameboy/nall/stdint.hpp +++ b/supergameboy/nall/stdint.hpp @@ -30,15 +30,15 @@ #endif namespace nall { - static static_assert int8_t_assert; - static static_assert int16_t_assert; - static static_assert int32_t_assert; - static static_assert int64_t_assert; + static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size"); - static static_assert uint8_t_assert; - static static_assert uint16_t_assert; - static static_assert uint32_t_assert; - static static_assert uint64_t_assert; + static_assert(sizeof(uint8_t) == 1, "int8_t is not of the correct size" ); + static_assert(sizeof(uint16_t) == 2, "int16_t is not of the correct size"); + static_assert(sizeof(uint32_t) == 4, "int32_t is not of the correct size"); + static_assert(sizeof(uint64_t) == 8, "int64_t is not of the correct size"); } #endif diff --git a/supergameboy/nall/string.hpp b/supergameboy/nall/string.hpp index 94e65b68..65a4a4b8 100644 --- a/supergameboy/nall/string.hpp +++ b/supergameboy/nall/string.hpp @@ -1,6 +1,7 @@ #ifndef NALL_STRING_HPP #define NALL_STRING_HPP +#include #include #include #include @@ -14,5 +15,12 @@ #include #include #include +#include +#include + +namespace nall { + template<> struct has_length { enum { value = true }; }; + template<> struct has_size { enum { value = true }; }; +} #endif diff --git a/supergameboy/nall/string/base.hpp b/supergameboy/nall/string/base.hpp index e5851b00..b9230fe4 100644 --- a/supergameboy/nall/string/base.hpp +++ b/supergameboy/nall/string/base.hpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -26,11 +27,6 @@ inline intmax_t strsigned (const char *str); inline uintmax_t strunsigned(const char *str); inline uintmax_t strbin (const char *str); inline double strdouble (const char *str); -inline size_t strhex (char *str, uintmax_t value, size_t length = 0); -inline size_t strsigned (char *str, intmax_t value, size_t length = 0); -inline size_t strunsigned(char *str, uintmax_t value, size_t length = 0); -inline size_t strbin (char *str, uintmax_t value, size_t length = 0); -inline size_t strdouble (char *str, double value, size_t length = 0); inline bool match(const char *pattern, const char *str); inline bool strint (const char *str, int &result); inline bool strmath(const char *str, int &result); @@ -49,8 +45,6 @@ namespace nall { class string { public: - static string printf(const char*, ...); - inline void reserve(size_t); inline unsigned length() const; @@ -73,7 +67,9 @@ namespace nall { inline string(); inline string(const char*); inline string(const string&); + inline string(string&&); inline string& operator=(const string&); + inline string& operator=(string&&); inline ~string(); inline bool readfile(const char*); @@ -90,18 +86,25 @@ namespace nall { #endif }; - class lstring : public vector { + class lstring : public linear_vector { public: template inline lstring& operator<<(T value); inline int find(const char*); inline void split (const char*, const char*, unsigned = 0); inline void qsplit(const char*, const char*, unsigned = 0); + + lstring(); + lstring(std::initializer_list); }; + + template inline string sprint(const char *s, Args... args); + template inline void print(const char *s, Args... args); }; inline size_t strlcpy(nall::string &dest, const char *src, size_t length); inline size_t strlcat(nall::string &dest, const char *src, size_t length); + inline nall::string& strlower(nall::string &str); inline nall::string& strupper(nall::string &str); inline nall::string& strtr(nall::string &dest, const char *before, const char *after); @@ -113,10 +116,11 @@ inline nall::string& rtrim_once(nall::string &str, const char *key = " "); inline nall::string& trim_once (nall::string &str, const char *key = " "); inline nall::string substr(const char *src, size_t start = 0, size_t length = 0); -inline nall::string strhex (uintmax_t value); -inline nall::string strsigned (intmax_t value); -inline nall::string strunsigned(uintmax_t value); -inline nall::string strbin (uintmax_t value); -inline nall::string strdouble (double value); +template inline nall::string strhex(uintmax_t value); +template inline nall::string strsigned(intmax_t value); +template inline nall::string strunsigned(uintmax_t value); +template inline nall::string strbin(uintmax_t value); +inline size_t strdouble(char *str, double value); +inline nall::string strdouble(double value); #endif diff --git a/supergameboy/nall/string/cast.hpp b/supergameboy/nall/string/cast.hpp index 0b490917..7433073d 100644 --- a/supergameboy/nall/string/cast.hpp +++ b/supergameboy/nall/string/cast.hpp @@ -2,8 +2,7 @@ #define NALL_STRING_CAST_HPP namespace nall { - //this is needed, as C++98 does not support explicit template specialization inside classes; - //redundant memory allocation should hopefully be avoided via compiler optimizations. + //this is needed, as C++0x does not support explicit template specialization inside classes template<> inline string to_string (bool v) { return v ? "true" : "false"; } template<> inline string to_string (signed int v) { return strsigned(v); } template<> inline string to_string (unsigned int v) { return strunsigned(v); } @@ -25,6 +24,6 @@ namespace nall { template<> inline string to_string(const QString &v) { return v.toUtf8().constData(); } string::operator QString() const { return QString::fromUtf8(*this); } #endif -}; +} #endif diff --git a/supergameboy/nall/string/convert.hpp b/supergameboy/nall/string/convert.hpp index da90bb09..a34c3f14 100644 --- a/supergameboy/nall/string/convert.hpp +++ b/supergameboy/nall/string/convert.hpp @@ -146,140 +146,4 @@ double strdouble(const char *str) { return !negate ? result : -result; } -// - -size_t strhex(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length -= 1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 16) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = value % 16; - value /= 16; - *--str = x < 10 ? (x + '0') : (x + 'a' - 10); //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strsigned(char *str, intmax_t value_, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - bool negate = value_ < 0; - uintmax_t value = value_ >= 0 ? value_ : -value_; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = (negate ? 1 : 0) + digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - while(length && digits_integral--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - length--; - } - - if(length && negate) { - *--str = '-'; - } - - return nall::min(initial_length, digits + 1); -} - -size_t strunsigned(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 10) digits_integral++; - - int digits = digits_integral; - if(!str) return digits_integral + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 10); - value /= 10; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -size_t strbin(char *str, uintmax_t value, size_t length /* = 0 */) { - if(length == 0) length = -1U; //"infinite" length - size_t initial_length = length; - - //count number of digits in value - int digits_integral = 1; - uintmax_t digits_integral_ = value; - while(digits_integral_ /= 2) digits_integral++; - - int digits = digits_integral; - if(!str) return digits + 1; //only computing required length? - - length = nall::min(digits, length - 1); - str += length; //seek to end of target string - *str = 0; //set null terminator - - while(length--) { - uint8_t x = '0' + (value % 2); - value /= 2; - *--str = x; //iterate backwards to write string - } - - return nall::min(initial_length, digits + 1); -} - -//using sprintf is certainly not the most ideal method to convert -//a double to a string ... but attempting to parse a double by -//hand, digit-by-digit, results in subtle rounding errors. -// -//note: length parameter is currently ignored. -//it remains for consistency and possible future support. -size_t strdouble(char *str, double value, size_t length /* = 0 */) { - char buffer[256]; - sprintf(buffer, "%f", value); - - //remove excess 0's in fraction (2.500000 -> 2.5) - for(char *p = buffer; *p; p++) { - if(*p == '.') { - char *p = buffer + strlen(buffer) - 1; - while(*p == '0') { - if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. - p--; - } - break; - } - } - - length = strlen(buffer); - if(str) strcpy(str, buffer); - return length + 1; -} - #endif diff --git a/supergameboy/nall/string/core.hpp b/supergameboy/nall/string/core.hpp index 29ca7173..5881018b 100644 --- a/supergameboy/nall/string/core.hpp +++ b/supergameboy/nall/string/core.hpp @@ -3,15 +3,6 @@ namespace nall { -inline string string::printf(const char *fmt, ...) { - static char text[4096]; - va_list args; - va_start(args, fmt); - vsprintf(text, fmt, args); - va_end(args); - return text; -} - void string::reserve(size_t size_) { if(size_ > size) { size = size_; @@ -74,11 +65,25 @@ string::string(const string &value) { data = strdup(value); } +string::string(string &&source) { + size = source.size; + data = source.data; + source.data = 0; +} + string& string::operator=(const string &value) { assign(value); return *this; } +string& string::operator=(string &&source) { + if(data) free(data); + size = source.size; + data = source.data; + source.data = 0; + return *this; +} + string::~string() { free(data); } @@ -113,6 +118,15 @@ int lstring::find(const char *key) { return -1; } -}; +inline lstring::lstring() { +} + +inline lstring::lstring(std::initializer_list list) { + for(const string *s = list.begin(); s != list.end(); ++s) { + operator<<(*s); + } +} + +} #endif diff --git a/supergameboy/nall/string/utility.hpp b/supergameboy/nall/string/utility.hpp index 1300d326..c050446b 100644 --- a/supergameboy/nall/string/utility.hpp +++ b/supergameboy/nall/string/utility.hpp @@ -37,32 +37,122 @@ nall::string& trim_once (nall::string &str, const char *key) { trim_once (str(), /* arithmetic <> string */ -nall::string strhex(uintmax_t value) { - nall::string temp; - temp.reserve(strhex(0, value)); - strhex(temp(), value); - return temp; +template nall::string strhex(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + //render string backwards, as we do not know its length yet + do { + unsigned n = value & 15; + output[offset++] = n < 10 ? '0' + n : 'a' + n - 10; + value >>= 4; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + //reverse the string in-place + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strsigned(intmax_t value) { - nall::string temp; - temp.reserve(strsigned(0, value)); - strsigned(temp(), value); - return temp; +template nall::string strsigned(intmax_t value) { + nall::string output; + unsigned offset = 0; + + bool negative = value < 0; + if(negative) value = abs(value); + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + if(negative) output[offset++] = '-'; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strunsigned(uintmax_t value) { - nall::string temp; - temp.reserve(strunsigned(0, value)); - strunsigned(temp(), value); - return temp; +template nall::string strunsigned(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value % 10; + output[offset++] = '0' + n; + value /= 10; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; } -nall::string strbin(uintmax_t value) { - nall::string temp; - temp.reserve(strbin(0, value)); - strbin(temp(), value); - return temp; +template nall::string strbin(uintmax_t value) { + nall::string output; + unsigned offset = 0; + + do { + unsigned n = value & 1; + output[offset++] = '0' + n; + value >>= 1; + } while(value); + + while(offset < length) output[offset++] = padding; + output[offset--] = 0; + + for(unsigned i = 0; i < (offset + 1) >> 1; i++) { + char temp = output[i]; + output[i] = output[offset - i]; + output[offset - i] = temp; + } + + return output; +} + +//using sprintf is certainly not the most ideal method to convert +//a double to a string ... but attempting to parse a double by +//hand, digit-by-digit, results in subtle rounding errors. +size_t strdouble(char *str, double value) { + char buffer[256]; + sprintf(buffer, "%f", value); + + //remove excess 0's in fraction (2.500000 -> 2.5) + for(char *p = buffer; *p; p++) { + if(*p == '.') { + char *p = buffer + strlen(buffer) - 1; + while(*p == '0') { + if(*(p - 1) != '.') *p = 0; //... but not for eg 1.0 -> 1. + p--; + } + break; + } + } + + unsigned length = strlen(buffer); + if(str) strcpy(str, buffer); + return length + 1; } nall::string strdouble(double value) { diff --git a/supergameboy/nall/string/variadic.hpp b/supergameboy/nall/string/variadic.hpp new file mode 100644 index 00000000..e707b487 --- /dev/null +++ b/supergameboy/nall/string/variadic.hpp @@ -0,0 +1,37 @@ +#ifndef NALL_STRING_VARIADIC_HPP +#define NALL_STRING_VARIADIC_HPP + +namespace nall { + static void sprint(string &output, unsigned &offset, const char *&s) { + while(*s) output[offset++] = *s++; + } + + template + static void sprint(string &output, unsigned &offset, const char *&s, T value, Args... args) { + while(*s) { + if(*s == '$') { + string data = to_string(value); + unsigned i = 0; + while(data[i]) output[offset++] = data[i++]; + sprint(output, offset, ++s, args...); + return; + } else { + output[offset++] = *s++; + } + } + } + + template inline string sprint(const char *s, Args... args) { + string output; + unsigned offset = 0; + sprint(output, offset, s, args...); + output[offset] = 0; + return output; + } + + template inline void print(const char *s, Args... args) { + printf("%s", (const char*)sprint(s, args...)); + } +} + +#endif diff --git a/supergameboy/nall/string/xml.hpp b/supergameboy/nall/string/xml.hpp new file mode 100644 index 00000000..30d6bae6 --- /dev/null +++ b/supergameboy/nall/string/xml.hpp @@ -0,0 +1,268 @@ +#ifndef NALL_STRING_XML_HPP +#define NALL_STRING_XML_HPP + +//XML subset parser +//version 0.04 + +#include + +namespace nall { + +struct xml_attribute { + string name; + string content; + virtual string parse() const; +}; + +struct xml_element : xml_attribute { + string parse() const; + array attribute; + array element; + ~xml_element(); + +protected: + void parse_doctype(const char *&data); + bool parse_head(string data); + bool parse_body(const char *&data); + friend xml_element *xml_parse(const char *data); +}; + +inline string xml_attribute::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline string xml_element::parse() const { + string data; + unsigned offset = 0; + + const char *source = content; + while(*source) { + if(*source == '&') { + if(strbegin(source, "<")) { data[offset++] = '<'; source += 4; continue; } + if(strbegin(source, ">")) { data[offset++] = '>'; source += 4; continue; } + if(strbegin(source, "&")) { data[offset++] = '&'; source += 5; continue; } + if(strbegin(source, "'")) { data[offset++] = '\''; source += 6; continue; } + if(strbegin(source, """)) { data[offset++] = '"'; source += 6; continue; } + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + source += pos + 3; + continue; + } + + if(strbegin(source, ""); + if(pos == -1) return ""; + string cdata = substr(source, 9, pos - 9); + data << cdata; + offset += strlen(cdata); + + source += offset + 3; + continue; + } + + //reject illegal characters + if(*source == '&') return ""; + if(*source == '<') return ""; + if(*source == '>') return ""; + + data[offset++] = *source++; + } + + data[offset] = 0; + return data; +} + +inline void xml_element::parse_doctype(const char *&data) { + name = "!DOCTYPE"; + const char *content_begin = data; + + signed counter = 0; + while(*data) { + char value = *data++; + if(value == '<') counter++; + if(value == '>') counter--; + if(counter < 0) { + content = substr(content_begin, 0, data - content_begin - 1); + return; + } + } + throw "..."; +} + +inline bool xml_element::parse_head(string data) { + data.qreplace("\t", " "); + data.qreplace("\r", " "); + data.qreplace("\n", " "); + while(qstrpos(data, " ") >= 0) data.qreplace(" ", " "); + data.qreplace(" =", "="); + data.qreplace("= ", "="); + rtrim(data); + + lstring part; + part.qsplit(" ", data); + + name = part[0]; + if(name == "") throw "..."; + + for(unsigned i = 1; i < part.size(); i++) { + lstring side; + side.qsplit("=", part[i]); + if(side.size() != 2) throw "..."; + + xml_attribute *attr = new xml_attribute; + attr->name = side[0]; + attr->content = side[1]; + if(strbegin(attr->content, "\"") && strend(attr->content, "\"")) trim_once(attr->content, "\""); + else if(strbegin(attr->content, "'") && strend(attr->content, "'")) trim_once(attr->content, "'"); + else throw "..."; + attribute.add(attr); + } +} + +inline bool xml_element::parse_body(const char *&data) { + while(true) { + if(!*data) return false; + if(*data++ != '<') continue; + if(*data == '/') return false; + + if(strbegin(data, "!DOCTYPE") == true) { + parse_doctype(data); + return true; + } + + if(strbegin(data, "!--")) { + signed offset = strpos(data, "-->"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + if(strbegin(data, "![CDATA[")) { + signed offset = strpos(data, "]]>"); + if(offset == -1) throw "..."; + data += offset + 3; + continue; + } + + signed offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + string tag = substr(data, 0, offset); + data += offset + 1; + const char *content_begin = data; + + bool self_terminating = false; + + if(strend(tag, "?") == true) { + self_terminating = true; + rtrim_once(tag, "?"); + } else if(strend(tag, "/") == true) { + self_terminating = true; + rtrim_once(tag, "/"); + } + + parse_head(tag); + if(self_terminating) return true; + + while(*data) { + unsigned index = element.size(); + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + + if(*data == '/') { + signed length = data - content_begin - 1; + if(length > 0) content = substr(content_begin, 0, length); + + data++; + offset = strpos(data, ">"); + if(offset == -1) throw "..."; + + tag = substr(data, 0, offset); + data += offset + 1; + + tag.replace("\t", " "); + tag.replace("\r", " "); + tag.replace("\n", " "); + while(strpos(tag, " ") >= 0) tag.replace(" ", " "); + rtrim(tag); + + if(name != tag) throw "..."; + return true; + } + } else { + element.add(elem); + } + } + } +} + +inline xml_element::~xml_element() { + for(unsigned i = 0; i < attribute.size(); i++) delete attribute[i]; + for(unsigned i = 0; i < element.size(); i++) delete element[i]; +} + +//ensure there is only one root element +inline bool xml_validate(xml_element *document) { + unsigned root_counter = 0; + + for(unsigned i = 0; i < document->element.size(); i++) { + string &name = document->element[i]->name; + if(strbegin(name, "?")) continue; + if(strbegin(name, "!")) continue; + if(++root_counter > 1) return false; + } + + return true; +} + +inline xml_element* xml_parse(const char *data) { + xml_element *self = new xml_element; + + try { + while(*data) { + xml_element *elem = new xml_element; + if(elem->parse_body(data) == false) { + delete elem; + break; + } else { + self->element.add(elem); + } + } + + if(xml_validate(self) == false) throw "..."; + return self; + } catch(const char*) { + delete self; + return 0; + } +} + +} + +#endif diff --git a/supergameboy/nall/utility.hpp b/supergameboy/nall/utility.hpp index fa73f8cb..c15945e1 100644 --- a/supergameboy/nall/utility.hpp +++ b/supergameboy/nall/utility.hpp @@ -1,32 +1,37 @@ #ifndef NALL_UTILITY_HPP #define NALL_UTILITY_HPP +#include + namespace nall { - template - inline void swap(T &x, T &y) { - T temp(x); - x = y; - y = temp; + template struct identity { + typedef T type; + }; + + template typename remove_reference::type&& move(T &&value) { + return value; } - template - struct base_from_member { + template T&& forward(typename identity::type &&value) { + return value; + } + + template struct enable_if { typedef T type; }; + template struct enable_if {}; + template struct mp_enable_if : enable_if {}; + + template inline void swap(T &x, T &y) { + T temp(move(x)); + x = move(y); + y = move(temp); + } + + template struct base_from_member { T value; base_from_member(T value_) : value(value_) {} }; - class noncopyable { - protected: - noncopyable() {} - ~noncopyable() {} - - private: - noncopyable(const noncopyable&); - const noncopyable& operator=(const noncopyable&); - }; - - template - inline T* allocate(size_t size, const T &value) { + template inline T* allocate(size_t size, const T &value) { T *array = new T[size]; for(size_t i = 0; i < size; i++) array[i] = value; return array; diff --git a/supergameboy/nall/vector.hpp b/supergameboy/nall/vector.hpp index aeff81c0..8885f93d 100644 --- a/supergameboy/nall/vector.hpp +++ b/supergameboy/nall/vector.hpp @@ -1,9 +1,12 @@ #ifndef NALL_VECTOR_HPP #define NALL_VECTOR_HPP +#include #include #include #include +#include +#include #include namespace nall { @@ -19,7 +22,7 @@ namespace nall { //if objects hold memory address references to themselves (introspection), a //valid copy constructor will be needed to keep pointers valid. - template class linear_vector : noncopyable { + template class linear_vector { protected: T *pool; unsigned poolsize, objectsize; @@ -79,8 +82,43 @@ namespace nall { return pool[index]; } - linear_vector() : pool(0), poolsize(0), objectsize(0) {} - ~linear_vector() { reset(); } + //copy + inline linear_vector& operator=(const linear_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + linear_vector(const linear_vector &source) { + operator=(source); + } + + //move + inline linear_vector& operator=(linear_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + linear_vector(linear_vector &&source) { + operator=(move(source)); + } + + //construction + linear_vector() : pool(0), poolsize(0), objectsize(0) { + } + + linear_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~linear_vector() { + reset(); + } }; //pointer_vector @@ -93,7 +131,7 @@ namespace nall { //by guaranteeing that the base memory address of each objects never changes, //this avoids the need for an object to have a valid copy constructor. - template class pointer_vector : noncopyable { + template class pointer_vector { protected: T **pool; unsigned poolsize, objectsize; @@ -151,12 +189,47 @@ namespace nall { return *pool[index]; } - pointer_vector() : pool(0), poolsize(0), objectsize(0) {} - ~pointer_vector() { reset(); } + //copy + inline pointer_vector& operator=(const pointer_vector &source) { + reset(); + reserve(source.capacity()); + for(unsigned i = 0; i < source.size(); i++) add(source[i]); + return *this; + } + + pointer_vector(const pointer_vector &source) { + operator=(source); + } + + //move + inline pointer_vector& operator=(pointer_vector &&source) { + reset(); + pool = source.pool; + poolsize = source.poolsize; + objectsize = source.objectsize; + source.pool = 0; + return *this; + } + + pointer_vector(pointer_vector &&source) { + operator=(move(source)); + } + + //construction + pointer_vector() : pool(0), poolsize(0), objectsize(0) { + } + + pointer_vector(std::initializer_list list) : pool(0), poolsize(0), objectsize(0) { + for(const T *p = list.begin(); p != list.end(); ++p) add(*p); + } + + ~pointer_vector() { + reset(); + } }; - //default vector type - template class vector : public linear_vector {}; + template struct has_size> { enum { value = true }; }; + template struct has_size> { enum { value = true }; }; } #endif