Skip to content

Commit

Permalink
Reset memory to zeros
Browse files Browse the repository at this point in the history
  • Loading branch information
Eeems committed Jan 12, 2024
1 parent ae1e841 commit 336cfd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/vendor/libqboy/gbgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "libqboy_global.h"
#include "z80mmu.h"
#include <vector>

const int _GBGPU_W = 160;
const int _GBGPU_H = 144;
Expand Down
12 changes: 8 additions & 4 deletions src/vendor/libqboy/z80mmu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

z80mmu::z80mmu() {
mbc = 0;
wram.resize(0x2000, 0);
vram.resize(0x2000, 0);
voam.resize(0xA0, 0);
zram.resize(0x100, 0);
reset();
}

Expand All @@ -13,10 +17,10 @@ z80mmu::~z80mmu() {
}

void z80mmu::reset() {
wram.resize(0x2000, 0);
vram.resize(0x2000, 0);
voam.resize(0xA0, 0);
zram.resize(0x100, 0);
std::fill(wram.begin(), wram.end(), 0);
std::fill(vram.begin(), vram.end(), 0);
std::fill(voam.begin(), voam.end(), 0);
std::fill(zram.begin(), zram.end(), 0);
if (mbc != 0) delete mbc;
mbc = 0;

Expand Down

0 comments on commit 336cfd8

Please sign in to comment.