A7800: fix Basketbrawl and summer games

This commit is contained in:
alyosha-tas 2021-11-17 18:49:51 -05:00
parent de1a312262
commit 51e8ef94d0
7 changed files with 43 additions and 26 deletions

View File

@ -16,7 +16,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF; return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -27,7 +27,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsbios[addr - 0x3000]; return Core._hsbios[addr - 0x3000];
} }
return Core.RAM[0x800 + addr & 0x7FF]; return 0;
// return Core.RAM[0x800 + addr & 0x7FF];
} }
if (addr < 0x8000 && Core.is_pokey) if (addr < 0x8000 && Core.is_pokey)
@ -47,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._bios[addr - (0x10000 - Core._bios.Length)]; return Core._bios[addr - (0x10000 - Core._bios.Length)];
} }
return 0x00; return 0;
} }
public override void WriteMemory(ushort addr, byte value) public override void WriteMemory(ushort addr, byte value)
@ -68,7 +69,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // no mirror here on hardware
// Core.RAM[0x800 + addr & 0x7FF] = value;
} }
} }
else if (addr < 0x8000 && Core.is_pokey) else if (addr < 0x8000 && Core.is_pokey)

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF; return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -29,7 +29,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsbios[addr - 0x3000]; return Core._hsbios[addr - 0x3000];
} }
return Core.RAM[0x800 + addr & 0x7FF]; return 0;
//return Core.RAM[0x800 + addr & 0x7FF];
} }
// cartridge and other OPSYS // cartridge and other OPSYS
@ -68,7 +69,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // no mirror here on hardware
// Core.RAM[0x800 + addr & 0x7FF] = value;
} }
} }
else else

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF; return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -29,7 +29,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsbios[addr - 0x3000]; return Core._hsbios[addr - 0x3000];
} }
return Core.RAM[0x800 + addr & 0x7FF]; return 0;
// return Core.RAM[0x800 + addr & 0x7FF];
} }
// cartridge and other OPSYS // cartridge and other OPSYS
@ -52,7 +53,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return RAM[(tempRet1 << 8) + tempRet2]; return RAM[(tempRet1 << 8) + tempRet2];
} }
return 0x00; return 0;
} }
public override void WriteMemory(ushort addr, byte value) public override void WriteMemory(ushort addr, byte value)
@ -73,7 +74,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // no mirror here on hardware
// Core.RAM[0x800 + addr & 0x7FF] = value;
} }
} }
else else

View File

@ -18,7 +18,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF; return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -29,7 +29,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsbios[addr - 0x3000]; return Core._hsbios[addr - 0x3000];
} }
return Core.RAM[0x800 + addr & 0x7FF]; return 0;
// return Core.RAM[0x800 + addr & 0x7FF];
} }
// cartridge and other OPSYS // cartridge and other OPSYS
@ -93,7 +94,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // no mirror here on hardware
// Core.RAM[0x800 + addr & 0x7FF] = value;
} }
} }
else else

View File

@ -1,5 +1,6 @@
using BizHawk.Common; using BizHawk.Common;
using BizHawk.Common.NumberExtensions; using BizHawk.Common.NumberExtensions;
using System;
namespace BizHawk.Emulation.Cores.Atari.A7800Hawk namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
{ {
@ -18,7 +19,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
{ {
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF;
return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -37,7 +39,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return 0; return 0;
} }
return Core.RAM[0x800 + addr & 0x7FF]; // This RAm mirror doesn't exist, otherwise Sumer Games has graphics glitches
return 0;
} }
// cartridge and other OPSYS // cartridge and other OPSYS
@ -74,8 +77,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._rom[tempAddr + 2 * 0x4000]; return Core._rom[tempAddr + 2 * 0x4000];
} }
// Should never get here, but in case we do just return FF // Should never get here, but in case we do just return 0
return 0xFF; return 0;
} }
if (Core.cart_RAM > 0) if (Core.cart_RAM > 0)
@ -92,8 +95,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
// this would correspond to reading from 0x4000-0x5FFF with only 8k of RAM // this would correspond to reading from 0x4000-0x5FFF with only 8k of RAM
// Let's just return FF for now // Let's just return 0 for now
return 0xFF; return 0;
} }
if (Core.is_pokey) if (Core.is_pokey)
@ -101,7 +104,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core.pokey.ReadReg(addr & 0xF); return Core.pokey.ReadReg(addr & 0xF);
} }
return 0xFF; return 0;
} }
public override void WriteMemory(ushort addr, byte value) public override void WriteMemory(ushort addr, byte value)
@ -119,6 +122,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
// could be either RAM mirror or ROM // could be either RAM mirror or ROM
if (addr >= 0x3000 && Core._hsbios != null) if (addr >= 0x3000 && Core._hsbios != null)
{ {
} }
else if (Core.is_pokey_450 && (addr >= 0x450) && (addr < 0x480)) else if (Core.is_pokey_450 && (addr >= 0x450) && (addr < 0x480))
{ {
@ -129,7 +133,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // This mirror doesn't exist, otherwise Summer Games has graphics glitches
} }
} }
else else

View File

@ -19,7 +19,7 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core._hsram[addr - 0x1000]; return Core._hsram[addr - 0x1000];
} }
return 0xFF; return 0;
} }
if (addr < 0x4000) if (addr < 0x4000)
@ -35,7 +35,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
return Core.pokey.ReadReg(addr & 0xF); return Core.pokey.ReadReg(addr & 0xF);
} }
return Core.RAM[0x800 + addr & 0x7FF]; return 0;
//return Core.RAM[0x800 + addr & 0x7FF];
} }
// cartridge and other OPSYS // cartridge and other OPSYS
@ -92,7 +93,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
} }
else else
{ {
Core.RAM[0x800 + addr & 0x7FF] = value; // no mirror here on hardware
// Core.RAM[0x800 + addr & 0x7FF] = value;
} }
} }
else else

View File

@ -12,6 +12,8 @@ SHADOW
7. RAM 001X X000 0000 0000 - 001X X111 1111 1111 7. RAM 001X X000 0000 0000 - 001X X111 1111 1111
*/ */
using System;
namespace BizHawk.Emulation.Cores.Atari.A7800Hawk namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
{ {
public partial class A7800Hawk public partial class A7800Hawk
@ -81,7 +83,8 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk
if ((addr >= 0x2800) && (addr < 0x3000)) if ((addr >= 0x2800) && (addr < 0x3000))
{ {
// this mirror evidently does not exist on hardware despite being in the documentation // this mirror evidently does not exist on hardware despite being in the documentation
return 0xFF;// RAM[(addr & 0x7FF) + 0x800]; // must return 0 or Summer Games will deadlock at event start screen
return 0x0;// RAM[(addr & 0x7FF) + 0x800];
} }
if ((addr >= 0x3000) && (addr < 0x4000)) if ((addr >= 0x3000) && (addr < 0x4000))