Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bsnes/snes/cartridge/cartridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ void Cartridge::load(Mode cartridge_mode, const lstring &xml_list) {
has_msu1 = false;
has_serial = false;
has_dos = false;
dos_mapped = false;

parse_xml(xml_list);
//print(xml_list[0], "\n\n");
Expand Down
9 changes: 0 additions & 9 deletions bsnes/snes/cartridge/xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ void Cartridge::parse_xml_cartridge(const char *data) {
}
}
}

// set dos mapping here if no mapping given. Fix later?
if (!dos_mapped) {
has_dos = true;
dos_mapped = true;
bus.map(Bus::MapMode::Direct, 0x00, 0x3f, 0x5f00, 0x5fff, dos);
bus.map(Bus::MapMode::Direct, 0x80, 0xbf, 0x5f00, 0x5fff, dos);
}
}

void Cartridge::parse_xml_bsx(const char *data) {
Expand Down Expand Up @@ -571,7 +563,6 @@ void Cartridge::xml_parse_dos(xml_element& root) {
foreach(attr, node.attribute) {
if (attr.name == "address") {
xml_parse_address(m, attr.content);
dos_mapped = true;
}
}
mapping.append(m);
Expand Down
11 changes: 11 additions & 0 deletions common/nall/snes/cartridge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class SNESCartridge {
bool has_st010;
bool has_st011;
bool has_st018;
bool has_dos;
};

SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
Expand Down Expand Up @@ -508,6 +509,15 @@ SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
xml << " </setarisc>\n";
}

// always set dos default mapping if none applied
has_dos = true;
if (has_dos) {
xml << " <dos>\n";
xml << " <map address='00-3f:5f00-5fff'/>\n";
xml << " <map address='80-bf:5f00-5fff'/>\n";
xml << " </dos>\n";
}

xml << "</cartridge>\n";
xmlMemoryMap = xml;
}
Expand All @@ -532,6 +542,7 @@ void SNESCartridge::read_header(const uint8_t *data, unsigned size) {
has_st010 = false;
has_st011 = false;
has_st018 = false;
has_dos = false;

//=====================
//detect Game Boy carts
Expand Down