Skip to content

Commit

Permalink
Now fix it the right way.. no MBUS error interrupt on diag reads
Browse files Browse the repository at this point in the history
  • Loading branch information
pkooiman committed Jun 28, 2024
1 parent 3f31edc commit 6c81416
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Musashi/m68kcpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ static inline void m68ki_exception_bus_error(void)
m68ki_jump_vector(EXCEPTION_BUS_ERROR);

CPU_RUN_MODE = RUN_MODE_BERR_AERR_RESET;
FLAG_INT_MASK = 0x0700;


longjmp(m68ki_bus_error_jmp_buf, 1);
}
Expand Down
3 changes: 2 additions & 1 deletion csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ void csr_set_access_error(csr_t *csr, int cpu, int type, int addr, int is_write)
if (type&ACCESS_ERROR_MBTO) {
v|=ERR_MBTO;
if (emu_get_mb_diag()) {
emu_raise_int(INT_VECT_MB_IF_ERR, INT_LEVEL_MB_IF_ERR, 1);
if (is_write)
emu_raise_int(INT_VECT_MB_IF_ERR, INT_LEVEL_MB_IF_ERR, 1);
csr->reg[CSR_I_MBERR/2]=(addr>>11)&0xfe;
if (!is_write) csr->reg[CSR_I_MBERR/2]|=0x1;
}
Expand Down
4 changes: 2 additions & 2 deletions mbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ unsigned int mbus_read8(void *obj, unsigned int a) {
MBUS_LOG_DEBUG("MBUS: rb %x->%x\n", a, a+0x780000);
if (!emu_get_mb_diag()) return 0;
//Mbus in diag modes errors with a MBTO.
emu_mbus_error(a|EMU_MBUS_BUSERROR);
emu_mbus_error(a|EMU_MBUS_ERROR_READ|EMU_MBUS_BUSERROR);
return 0;
}

unsigned int mbus_read16(void *obj, unsigned int a) {
MBUS_LOG_DEBUG("MBUS: rw %x->%x\n", a, a+0x780000);
if (!emu_get_mb_diag()) return 0;
//Mbus in diag modes errors with a MBTO.
emu_mbus_error(a|EMU_MBUS_BUSERROR);
emu_mbus_error(a|EMU_MBUS_ERROR_READ|EMU_MBUS_BUSERROR);
return 0;
}

Expand Down

0 comments on commit 6c81416

Please sign in to comment.