vgbc/memory/bank.h

23 lines
370 B
C++

#pragma once
#include <memory/device.h>
#include <map>
class Bank : public Mem_device {
private:
Mem_device* current_bank;
std::map<u8, Mem_device*> banks;
public:
Bank();
void addBank(u8 idx, Mem_device* dev);
void setBank(u8 bank);
void write8(u16 addr, u8 data);
u8 read8(u16 addr);
void write16(u16 addr, u16 data);
u16 read16(u16 addr);
};