- now uses "mon" if present (currently on breakpoints only)

This commit is contained in:
cebix 1999-10-25 08:07:58 +00:00
parent 6d8e94c1dd
commit 04199a0f56
8 changed files with 235 additions and 159 deletions

View File

@ -42,6 +42,9 @@
// ExtFS is supported
#define SUPPORTS_EXTFS 1
// mon is not supported
#define ENABLE_MON 0
// Data types
typedef unsigned char uint8;
typedef signed char int8;

View File

@ -43,6 +43,9 @@
// ExtFS is supported
#define SUPPORTS_EXTFS 1
// mon is not supported
#define ENABLE_MON 0
// Time data type for Time Manager emulation
typedef bigtime_t tm_time_t;

File diff suppressed because it is too large Load Diff

View File

@ -22,6 +22,19 @@ AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl We use mon if possible.
MONSRCS=
AC_MSG_CHECKING(for mon)
if grep mon_init ../../../mon/src/mon.h >/dev/null 2>/dev/null; then
AC_MSG_RESULT(yes)
DEFINES="$DEFINES -DENABLE_MON=1"
MONSRCS="../../../mon/src/mon.cpp ../../../mon/src/mon_6502.cpp ../../../mon/src/mon_68k.cpp ../../../mon/src/mon_8080.cpp ../../../mon/src/mon_cmd.cpp ../../../mon/src/mon_ppc.cpp ../../../mon/src/mon_x86.cpp"
CXXFLAGS="$CXXFLAGS -I../../../mon/src"
else
AC_MSG_RESULT(no)
DEFINES="$DEFINES -DENABLE_MON=0"
fi
dnl Checks for libraries.
AC_CHECK_LIB(posix4, sem_init)
@ -176,7 +189,7 @@ if MACHINE=`uname -a 2>/dev/null`; then
;;
esac
fi
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS"
SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS $MONSRCS"
dnl Check for i386 CPU.
HAVE_I386=no

View File

@ -42,6 +42,10 @@
#include "extfs.h"
#include "emul_op.h"
#if ENABLE_MON
#include "mon.h"
#endif
#define DEBUG 0
#include "debug.h"
@ -64,6 +68,12 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7],
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
r->sr);
#if ENABLE_MON
char *arg[2];
arg[0] = "rmon";
arg[1] = NULL;
mon(1, arg);
#endif
QuitEmulator();
break;
}

View File

@ -41,6 +41,20 @@
#define DEBUG 0
#include "debug.h"
#if ENABLE_MON
#include "mon.h"
static uint32 mon_read_byte_b2(uint32 adr)
{
return ReadMacInt8(adr);
}
static void mon_write_byte_b2(uint32 adr, uint32 b)
{
WriteMacInt8(adr, b);
}
#endif
/*
* Initialize everything, returns false on error
@ -130,6 +144,14 @@ bool InitAll(void)
ErrorAlert(GetString(STR_UNSUPPORTED_ROM_TYPE_ERR));
return false;
}
#if ENABLE_MON
// Initialize mon
mon_init();
mon_read_byte = mon_read_byte_b2;
mon_write_byte = mon_write_byte_b2;
#endif
return true;
}
@ -140,6 +162,11 @@ bool InitAll(void)
void ExitAll(void)
{
#if ENABLE_MON
// Deinitialize mon
mon_exit();
#endif
// Save XPRAM
XPRAMExit();

View File

@ -34,7 +34,7 @@
#include "prefs.h"
#include "rom_patches.h"
#define DEBUG 0
#define DEBUG 1
#include "debug.h"
@ -1157,13 +1157,20 @@ static bool patch_rom_32(void)
*wp++ = htons(M68K_NOP);
*wp = htons(M68K_NOP);
// Fix logical/physical RAM size (CompBootStack) (must be done after InitMemMgr!)
static const uint8 fix_memsize_dat[] = {0x4e, 0x75};
if ((base = find_rom_data(0x490, 0x4b0, fix_memsize_dat, sizeof(fix_memsize_dat))) == 0) return false;
D(bug("fix_memsize %08lx\n", base));
wp = (uint16 *)(ROMBaseHost + base);
// Compute boot stack pointer and fix logical/physical RAM size (CompBootStack) (must be done after InitMemMgr!)
wp = (uint16 *)(ROMBaseHost + 0x490);
*wp++ = htons(0x2038); // move.l $10c,d0
*wp++ = htons(0x010c);
*wp++ = htons(0xd0b8); // add.l $2a6,d0
*wp++ = htons(0x02a6);
*wp++ = htons(0xe288); // lsr.l #1,d0
*wp++ = htons(0x0880); // bclr #0,d0
*wp++ = htons(0x0000);
*wp++ = htons(0x0440); // subi.w #$400,d0
*wp++ = htons(0x0400);
*wp++ = htons(0x2040); // move.l d0,a0
*wp++ = htons(M68K_EMUL_OP_FIX_MEMSIZE);
*wp = htons(M68K_RTS);
*wp++ = htons(M68K_RTS);
static const uint8 fix_memsize2_dat[] = {0x22, 0x30, 0x81, 0xe2, 0x0d, 0xdc, 0xff, 0xba, 0xd2, 0xb0, 0x81, 0xe2, 0x0d, 0xdc, 0xff, 0xec, 0x21, 0xc1, 0x1e, 0xf8};
base = find_rom_data(0x4c000, 0x4c080, fix_memsize2_dat, sizeof(fix_memsize2_dat));

View File

@ -39,7 +39,7 @@
#include "prefs.h"
#include "sony.h"
#define DEBUG 0
#define DEBUG 1
#include "debug.h"
#ifdef AMIGA