aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTa180m2020-05-17 21:32:52 -0500
committerTa180m2020-05-17 21:32:52 -0500
commit26ac5cad9d0d3fcf9b29f25b58809c77cd4c4cbb (patch)
tree046c1b31fa1ca201cb1c3b90e06b43ba8988b0be
parent24c463c819d878041c3221837a09ead3f7bd1682 (diff)
Update main.cpp
-rw-r--r--main.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/main.cpp b/main.cpp
index 4c6760c..f7a6044 100644
--- a/main.cpp
+++ b/main.cpp
@@ -123,17 +123,12 @@ template <int pageKBs> void Mapper::map_prg(int slot, int bank) {
if (bank < 0) bank = (prgSize / (0x400*pageKBs)) + bank;
for (int i = 0; i < (pageKBs/8); i++) prgMap[(pageKBs/8) * slot + i] = (pageKBs*0x400*bank + 0x2000*i) % prgSize;
}
-template void Mapper::map_prg<32>(int, int);
-template void Mapper::map_prg<16>(int, int);
-template void Mapper::map_prg<8> (int, int);
+template void Mapper::map_prg<32>(int, int); template void Mapper::map_prg<16>(int, int); template void Mapper::map_prg<8> (int, int);
// CHR mapping functions
template <int pageKBs> void Mapper::map_chr(int slot, int bank) {
for (int i = 0; i < pageKBs; i++) chrMap[pageKBs*slot + i] = (pageKBs*0x400*bank + 0x400*i) % chrSize;
}
-template void Mapper::map_chr<8>(int, int);
-template void Mapper::map_chr<4>(int, int);
-template void Mapper::map_chr<2>(int, int);
-template void Mapper::map_chr<1>(int, int);
+template void Mapper::map_chr<8>(int, int); template void Mapper::map_chr<4>(int, int); template void Mapper::map_chr<2>(int, int); template void Mapper::map_chr<1>(int, int);
class Mapper0 : public Mapper {
public: Mapper0(u8* rom) : Mapper(rom) { map_prg<32>(0, 0); map_chr<8> (0, 0); }
};
@@ -535,7 +530,8 @@ namespace PPU {
case 4: res = oamMem[oamAddr]; break; // OAMDATA ($2004)
case 7: // PPUDATA ($2007)
if (vAddr.addr <= 0x3EFF) res = buffer, buffer = rd(vAddr.addr);
- else res = buffer = rd(vAddr.addr), vAddr.addr += ctrl.incr ? 32 : 1;
+ else res = buffer = rd(vAddr.addr);
+ vAddr.addr += ctrl.incr ? 32 : 1;
}
}
return res;
@@ -799,7 +795,4 @@ namespace GUI {
}
}
-int main(int argc, char *argv[]) {
- GUI::init();
- GUI::run(argv[1]);
-} \ No newline at end of file
+int main(int argc, char *argv[]) { GUI::init(); GUI::run(argv[1]); } \ No newline at end of file