Fixes para que compile de nuevo
authorslack <slack@ommadawn.(none)>
Tue, 10 Jun 2008 20:27:57 +0000 (22:27 +0200)
committerslack <slack@ommadawn.(none)>
Tue, 10 Jun 2008 20:27:57 +0000 (22:27 +0200)
GBMemory.cc
GBVideo.h
gbcore.cc
gbcore.h

index 26994ef31ebe8fada29dcaf0ae2fdd3588ce2c31..d9dd16046210d31232d3c9cd006ff79182e71692 100644 (file)
@@ -9,12 +9,12 @@
 void GBMemory::write(int addr, u8 value)
 {
        if (addr < 0x8000)      mbc->write(addr, value);
-       else if (addr < 0xA000) core->video->write_VRAM(addr, value);
+       else if (addr < 0xA000) core->video.write_VRAM(addr, value);
        else if (addr < 0xC000) mbc->write(addr, value);
        else if (addr < 0xD000) WRAM0[addr - WRAM0_BASE] = value;
        else if (addr < 0xE000) WRAM1[addr - WRAM1_BASE] = value;
        else if (addr < 0xFDFF) write(addr-0x2000, value);
-       else if (addr < 0xFEA0) core->video->write_OAM (addr, value);
+       else if (addr < 0xFEA0) core->video.write_OAM (addr, value);
        else if (addr >= 0xFF00 && addr <= 0xFF7F) {
                IO.write(addr,value);
        }
@@ -33,12 +33,12 @@ void GBMemory::write(int addr, u8 value)
 u8  GBMemory::read(int addr) const
 {
        if (addr < 0x8000)      return mbc->read(addr);
-       else if (addr < 0xA000) return core->video->read_VRAM(addr);
+       else if (addr < 0xA000) return core->video.read_VRAM(addr);
        else if (addr < 0xC000) return mbc->read(addr);
        else if (addr < 0xD000) return WRAM0[addr - WRAM0_BASE];
        else if (addr < 0xE000) return WRAM1[addr - WRAM1_BASE];
        else if (addr < 0xFDFF) return read(addr-0x2000);
-       else if (addr < 0xFEA0) return core->video->read_OAM (addr);
+       else if (addr < 0xFEA0) return core->video.read_OAM (addr);
        else if (addr >= 0xFF00 && addr <= 0xFF7F) 
                return IO.read(addr);
        else if (addr >= 0xFF80 && addr <= 0xFFFE) return HRAM[addr - HRAM_BASE];
index 8ae19a9cdce63b135f6f2b6a7e099816f2685f4b..8f0df09a7bbf8797212fecef3c0a3beab72767f7 100644 (file)
--- a/GBVideo.h
+++ b/GBVideo.h
@@ -5,6 +5,11 @@ class GBVideo
        u8 VRAM[8192];
        u8 OAM[];
 
+       public:
+       u8   read_VRAM (int addr) const;
+       u8   read_OAM  (int addr) const;
+       void write_VRAM(int addr, u8 value);
+       void write_OAM (int addr, u8 value);
 };
 
 
index 5603e40c81313591fb2b691751e88d08ab412454..392afcc9f97426ce5ac3dca1350650774843109f 100644 (file)
--- a/gbcore.cc
+++ b/gbcore.cc
@@ -11,6 +11,7 @@
 GameBoy::GameBoy(std::string rom_name, GameBoyType type):
        gameboy_type(type),
        memory(this),
+       video(),
        rom(0),
        regs(),
        IME(1),
index 09295232252ef0ccbf433e6c9ad7fac34d12c364..3ee274a3e8d4fc33b70c4d75c6af13e079eff06d 100644 (file)
--- a/gbcore.h
+++ b/gbcore.h
@@ -3,6 +3,7 @@
 
 #include "sized_types.h"
 #include "GBMemory.h"
+#include "GBVideo.h"
 #include <string>
 
 union GBRom;
@@ -29,6 +30,7 @@ class GameBoy
 
        friend class GBMemory;
        GBMemory memory;
+       GBVideo video;
        GBRom *rom;
 
        // CPU Registers