Skip to content

Commit

Permalink
Don't forget to actually support expansion hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
SolraBizna committed Oct 5, 2017
1 parent 12fb420 commit 7ef4234
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/cartridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "cartridge.hh"
#include "mappers.hh"
#include "localquery.hh"
#include "expansions.hh"

using namespace ARS;

Expand Down Expand Up @@ -127,6 +128,7 @@ std::unique_ptr<Cartridge> Cartridge::load(GameFolder& gamefolder,
throw sn.Get("BOARD_EXPANSION_ADDRESS_INVALID"_Key);
}
else addr = 0; // will be interpreted as "use default address"
ARS::map_expansion(addr, expansion.data());
}
// Mapper
auto mapper_tag = *LocalizedQuery(board->query("mapper"));
Expand Down
2 changes: 1 addition & 1 deletion src/expansions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace {
}

void ARS::map_expansion(uint16_t addr, const std::string& type) {
if(addr < 0x240 || addr > 0x247)
if(addr != 0 && (addr < 0x240 || addr > 0x247))
die("INTERNAL ERROR: Expansion IO address out of range");
if(type == "debug") {
if(addr == 0) addr = 0x247;
Expand Down

0 comments on commit 7ef4234

Please sign in to comment.