From: Jorge Gorbe Moya Date: Mon, 16 Jun 2008 13:38:20 +0000 (+0200) Subject: Moved read/write to .cc X-Git-Tag: v0.1~54 X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=4738358f717ad0d1d7a4b5b2115a17cefeede3fc;p=wenboi.git Moved read/write to .cc --- diff --git a/GBMemory.cc b/GBMemory.cc index 6c5b770..e5015be 100644 --- a/GBMemory.cc +++ b/GBMemory.cc @@ -5,6 +5,16 @@ #include #include #include + +u8 GBIO::read(int addr) const +{ + return ports[addr-IO_BASE]; +} + +void GBIO::write(int addr, u8 value) +{ + ports[addr-IO_BASE] = value; +} void GBMemory::write(int addr, u8 value) { diff --git a/GBMemory.h b/GBMemory.h index 9c55749..55563f1 100644 --- a/GBMemory.h +++ b/GBMemory.h @@ -25,8 +25,8 @@ class GBIO static const u16 OBP1 = 0xFF49; // Object Pallete 1 data(R/W) static const u16 DMA = 0xFF46; // DMA Transfer & Start addr (W) - u8 read(int addr) const { return ports[addr-IO_BASE]; } - void write(int addr, u8 value) { ports[addr-IO_BASE] = value; } + u8 read(int addr) const; + void write(int addr, u8 value); };