mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 15:27:46 -04:00
core, fix crash bug in DrZ80 (SP wrap)
This commit is contained in:
parent
83025d7abe
commit
02d578601b
2 changed files with 3 additions and 1 deletions
|
@ -208,6 +208,7 @@ z80_xmap_read16: @ addr
|
||||||
bl z80_xmap_read8
|
bl z80_xmap_read8
|
||||||
mov r9,r0
|
mov r9,r0
|
||||||
add r0,r8,#1
|
add r0,r8,#1
|
||||||
|
bic r0,r0,#1<<16
|
||||||
bl z80_xmap_read8
|
bl z80_xmap_read8
|
||||||
orr r0,r9,r0,lsl #8
|
orr r0,r9,r0,lsl #8
|
||||||
ldmfd sp!,{r2,r8,r9,pc}
|
ldmfd sp!,{r2,r8,r9,pc}
|
||||||
|
@ -236,6 +237,7 @@ z80_xmap_write16: @ data, addr
|
||||||
bl z80_xmap_write8
|
bl z80_xmap_write8
|
||||||
mov r0,r8,lsr #8
|
mov r0,r8,lsr #8
|
||||||
add r1,r9,#1
|
add r1,r9,#1
|
||||||
|
bic r1,r1,#1<<16
|
||||||
bl z80_xmap_write8
|
bl z80_xmap_write8
|
||||||
ldmfd sp!,{r2,r8,r9,pc}
|
ldmfd sp!,{r2,r8,r9,pc}
|
||||||
|
|
||||||
|
|
|
@ -675,7 +675,7 @@ static void PicoWrite16_sram(u32 a, u32 d)
|
||||||
static u32 PicoRead8_z80(u32 a)
|
static u32 PicoRead8_z80(u32 a)
|
||||||
{
|
{
|
||||||
u32 d = 0xff;
|
u32 d = 0xff;
|
||||||
if ((Pico.m.z80Run | Pico.m.z80_reset | (z80_cycles_from_68k() < Pico.t.z80c_cnt)) && !(PicoIn.quirks & PQUIRK_NO_Z80_BUS_LOCK)) {
|
if ((Pico.m.z80Run | Pico.m.z80_reset) && !(PicoIn.quirks & PQUIRK_NO_Z80_BUS_LOCK)) {
|
||||||
elprintf(EL_ANOMALY, "68k z80 read with no bus! [%06x] @ %06x", a, SekPc);
|
elprintf(EL_ANOMALY, "68k z80 read with no bus! [%06x] @ %06x", a, SekPc);
|
||||||
// open bus. Pulled down if MegaCD2 is attached.
|
// open bus. Pulled down if MegaCD2 is attached.
|
||||||
return (PicoIn.AHW & PAHW_MCD ? 0 : d);
|
return (PicoIn.AHW & PAHW_MCD ? 0 : d);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue