cfgfile_write_bool (f, _T("rtg_nocustom"), p->picasso96_nocustom);
cfgfile_write (f, _T("rtg_modes"), _T("0x%x"), p->picasso96_modeflags);
- cfgfile_write_bool (f, _T("log_illegal_mem"), p->illegal_mem);
+ cfgfile_write_bool(f, _T("debug_mem"), p->debug_mem);
+ cfgfile_write_bool(f, _T("log_illegal_mem"), p->illegal_mem);
#if 0
if (p->catweasel >= 100)
|| cfgfile_yesno(option, value, _T("sound_volcnt"), &p->sound_volcnt)
|| cfgfile_yesno(option, value, _T("sound_stereo_swap_paula"), &p->sound_stereo_swap_paula)
|| cfgfile_yesno(option, value, _T("sound_stereo_swap_ahi"), &p->sound_stereo_swap_ahi)
+ || cfgfile_yesno(option, value, _T("debug_mem"), &p->debug_mem)
|| cfgfile_yesno(option, value, _T("log_illegal_mem"), &p->illegal_mem)
|| cfgfile_yesno(option, value, _T("filesys_no_fsdb"), &p->filesys_no_uaefsdb)
|| cfgfile_yesno(option, value, _T("gfx_monochrome"), &p->gfx_grayscale)
p->mountitems = 0;
+ p->debug_mem = false;
+
target_default_options (p, 1);
cfgfile_compatibility_romtype(p);
}
mwn->reg = 0xffffffff;
mwn->frozen = 0;
mwn->modval_written = 0;
+ mwn->mustchange = 0;
mwn->bus_error = 0;
ignore_ws (c);
if (more_params (c)) {
};
static dsprintfstack debugsprintf_stack[DEBUGSPRINTF_SIZE];
static uae_u16 debugsprintf_latch, debugsprintf_latched;
+static uae_u32 debugsprintf_cycles, debugsprintf_cycles_set;
static void read_bstring(char *out, int max, uae_u32 addr)
{
}
}
+static char *parse_custom(char *p, char *d)
+{
+ if (!strcmp(p, "CYCLES")) {
+ if (debugsprintf_cycles_set) {
+ uae_u32 c = (get_cycles() - debugsprintf_cycles) / CYCLE_UNIT;
+ sprintf(d, "%u", c);
+ } else {
+ strcpy(d, "-");
+ }
+ d += strlen(d);
+ }
+ return d;
+}
+
static void debug_sprintf_do(uae_u32 s)
{
int cnt = 0;
sprintf(d, "%d", stack->val);
} else if (cn == 'u') {
sprintf(d, "%u", stack->val);
+ } else if (cn == '[') {
+ char *next = strchr(p, ']');
+ if (next) {
+ p++;
+ *next = 0;
+ d = parse_custom(p, d);
+ p = next + 1;
+ }
} else {
d[0] = '?';
d[1] = 0;
bool debug_sprintf(uaecptr addr, uae_u32 val, int size)
{
- if (currprefs.uaeboard < 2)
+ if (!currprefs.debug_mem)
return false;
uae_u32 v = val;
debug_sprintf_do(v);
debugsprintf_cnt = 0;
debugsprintf_latched = 0;
+ debugsprintf_cycles = get_cycles();
+ debugsprintf_cycles_set = 1;
} else {
if (debugsprintf_cnt < DEBUGSPRINTF_SIZE) {
debugsprintf_stack[debugsprintf_cnt].val = v;
TCHAR config_window_title[256];
bool illegal_mem;
+ bool debug_mem;
bool use_serial;
bool serial_demand;
bool serial_hwctsrts;
extern FILE *log_open (const TCHAR *name, int append, int bootlog, TCHAR*);
extern void log_close (FILE *f);
extern TCHAR *write_log_get_ts(void);
+extern bool is_console_open(void);
extern bool use_long_double;
{ 0, 1, _T("Native on-screen display"), NULL, &workprefs.leds_on_screen, STATUSLINE_CHIPSET, STATUSLINE_CHIPSET },
{ 0, 1, _T("RTG on-screen display"), NULL, &workprefs.leds_on_screen, STATUSLINE_RTG, STATUSLINE_RTG },
{ 0, 0, _T("Create winuaelog.txt log"), &workprefs.win32_logfile },
- { 0, 0, _T("Log illegal memory accesses"), &workprefs.illegal_mem },
+ { 0, 1, _T("Log illegal memory accesses"), &workprefs.illegal_mem },
{ 0, 0, _T("Blank unused displays"), &workprefs.win32_blankmonitors },
{ 0, 0, _T("Start mouse uncaptured"), &workprefs.win32_start_uncaptured },
{ 0, 0, _T("Start minimized"), &workprefs.win32_start_minimized },
{ 0, 1, _T("Warn when attempting to close window"), &workprefs.win32_warn_exit },
{ 0, 1, _T("Power led dims when audio filter is disabled"), NULL, &workprefs.power_led_dim, 128, 0 },
{ 0, 1, _T("Automatically capture mouse when window is activated"), &workprefs.win32_capture_always },
+ { 0, 0, _T("Debug memory space"), &workprefs.debug_mem },
{ 0, NULL }
};
/* console functions for debugger */
+bool is_console_open(void)
+{
+ return consoleopen;
+}
+
static HWND myGetConsoleWindow (void)
{
return GetConsoleWindow ();