Merge pull request #128 from rzumer/map-ram-banks

Update GBC memory map
This commit is contained in:
Twinaphex 2019-06-21 13:07:23 +02:00 committed by GitHub
commit 3fb9e9592e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 3 deletions

View File

@ -134,6 +134,7 @@ public:
void *vram_ptr() const;
void *rambank0_ptr() const;
void *rambank1_ptr() const;
void *rambank2_ptr() const;
void *bankedram_ptr() const;
void *rombank0_ptr() const;
void *rombank1_ptr() const;

View File

@ -987,14 +987,14 @@ bool retro_load_game(const struct retro_game_info *info)
struct retro_memory_descriptor descs[] =
{
{ mainram, gb.rambank0_ptr(), 0, 0xC000, 0, 0, 0x1000, NULL },
{ mainram, gb.bankedram_ptr(), 0, 0xD000, 0, 0, 0x1000, NULL },
{ mainram, gb.rambank1_ptr(), 0, 0xD000, 0, 0, 0x1000, NULL },
{ mainram, gb.zeropage_ptr(), 0, 0xFF80, 0, 0, 0x0080, NULL },
{ mainram, gb.rambank1_ptr(), 0, 0x10000, 0, 0, gb.isCgb() ? 0x7000 : 0, NULL },
{ 0, gb.savedata_ptr(), 0, 0xA000, (size_t)~0x1FFF, 0, sramlen, NULL },
{ 0, gb.vram_ptr(), 0, 0x8000, 0, 0, 0x2000, NULL },
{ 0, gb.oamram_ptr(), 0, 0xFE00, 0, 0, 0x00A0, NULL },
{ rom, gb.rombank0_ptr(), 0, 0x0000, 0, 0, 0x4000, NULL },
{ rom, gb.rombank1_ptr(), 0, 0x4000, 0, 0, 0x4000, NULL },
{ 0, gb.savedata_ptr(), 0, 0xA000, (size_t)~0x1FFF, 0, sramlen, NULL },
{ mainram, gb.rambank2_ptr(), 0, 0x10000, 0, 0, gb.isCgb() ? 0x6000 : 0, NULL },
};
struct retro_memory_map mmaps =

View File

@ -50,6 +50,7 @@ public:
void *vram_ptr() const { return mem_.vram_ptr(); }
void *rambank0_ptr() const { return mem_.rambank0_ptr(); }
void *rambank1_ptr() const { return mem_.rambank1_ptr(); }
void *rambank2_ptr() const { return mem_.rambank2_ptr(); }
void *bankedram_ptr() const { return mem_.bankedram_ptr(); }
void *rombank0_ptr() const { return mem_.rombank0_ptr(); }
void *rombank1_ptr() const { return mem_.rombank1_ptr(); }

View File

@ -56,6 +56,7 @@ public:
void *vram_ptr() const { return cart_.vramdata(); }
void *rambank0_ptr() const { return cart_.wramdata(0); }
void *rambank1_ptr() const { return cart_.wramdata(0) + 0x1000; }
void *rambank2_ptr() const { return cart_.wramdata(0) + 0x2000; }
void *bankedram_ptr() const { return cart_.wramdata(1); }
void *rombank0_ptr() const { return cart_.romdata(0); }
void *rombank1_ptr() const { return cart_.romdata(0) + 0x4000; }

View File

@ -196,6 +196,10 @@ void *GB::rambank1_ptr() const {
return p_->cpu.rambank1_ptr();
}
void *GB::rambank2_ptr() const {
return p_->cpu.rambank2_ptr();
}
void *GB::bankedram_ptr() const {
return p_->cpu.bankedram_ptr();
}