File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,6 +58,17 @@ u8 MBC1MemoryRule::PerformRead(u16 address)
5858{
5959 switch (address & 0xE000 )
6060 {
61+ case 0x0000 :
62+ case 0x2000 :
63+ {
64+ if (m_iMode == 1 )
65+ {
66+ u8 * pROM = m_pCartridge->GetTheROM ();
67+ int bank0 = (m_HigherRomBankBits << 5 ) & (m_pCartridge->GetROMBankCount () - 1 );
68+ return pROM[(bank0 * 0x4000 ) + address];
69+ }
70+ return m_pMemory->Retrieve (address);
71+ }
6172 case 0x4000 :
6273 case 0x6000 :
6374 {
@@ -276,11 +287,19 @@ int MBC1MemoryRule::GetCurrentRomBank1Index()
276287
277288u8 * MBC1MemoryRule::GetRomBank0 ()
278289{
290+ if (m_iMode == 1 )
291+ {
292+ u8 * pROM = m_pCartridge->GetTheROM ();
293+ int bank0 = (m_HigherRomBankBits << 5 ) & (m_pCartridge->GetROMBankCount () - 1 );
294+ return pROM + (bank0 * 0x4000 );
295+ }
279296 return m_pMemory->GetMemoryMap () + 0x0000 ;
280297}
281298
282299int MBC1MemoryRule::GetCurrentRomBank0Index ()
283300{
301+ if (m_iMode == 1 )
302+ return (m_HigherRomBankBits << 5 ) & (m_pCartridge->GetROMBankCount () - 1 );
284303 return 0 ;
285304}
286305
You can’t perform that action at this time.
0 commit comments