puae 2.3.1

parent 0aecfd53
......@@ -4,7 +4,8 @@
#
# this is the main script to build (and test) PUAE
#
base=" --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --enable-drvsnd --with-qt "
base=" --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --enable-drvsnd "
wiqt=" --with-qt "
cd32=" --enable-cd32 "
a600=" --enable-gayle "
scsi=" --enable-scsi-device --enable-ncr --enable-a2091 "
......
......@@ -546,9 +546,12 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
#ifdef DEBUGGER
cfgfile_write_bool (f, "use_debugger", p->start_debugger);
#endif
cfgfile_write_rom (f, p->path_rom, p->romfile, "kickstart_rom_file");
cfgfile_write_rom (f, p->path_rom, p->romextfile, "kickstart_ext_rom_file");
if (p->romextfile2addr) {
cfgfile_write (f, "kickstart_ext_rom_file2_address", "%x", p->romextfile2addr);
cfgfile_write_rom (f, p->path_rom, p->romextfile2, "kickstart_ext_rom_file2");
}
if (p->romident[0])
cfgfile_dwrite_str (f, "kickstart_rom", p->romident);
if (p->romextident[0])
......@@ -765,22 +768,6 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
uf = &uaefilters[i];
if (uf->type == p->gfx_filter) {
cfgfile_dwrite_str (f, "gfx_filter", uf->cfgname);
if (uf->type == p->gfx_filter) {
if (uf->x[0]) {
cfgfile_dwrite_str (f, "gfx_filter_mode", filtermode2[1]);
} else {
int mt[4], i = 0;
if (uf->x[1])
mt[i++] = 1;
if (uf->x[2])
mt[i++] = 2;
if (uf->x[3])
mt[i++] = 3;
if (uf->x[4])
mt[i++] = 4;
cfgfile_dwrite (f, "gfx_filter_mode", "%dx", mt[p->gfx_filter_filtermode]);
}
}
}
i++;
}
......@@ -991,6 +978,7 @@ int cfgfile_intval2 (const TCHAR *option, const TCHAR *value, const TCHAR *name,
}
return 1;
}
int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale)
{
unsigned int v = 0;
......@@ -1001,8 +989,6 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name,
return r;
}
int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more)
{
int val;
......@@ -2632,6 +2618,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
subst (p->path_floppy, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR));
subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR));
subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR));
subst (p->path_rom, p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR));
return 1;
}
......@@ -3238,8 +3225,10 @@ int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max)
j++;
}
if (doout) {
outp[cnt++] = my_strdup (tmp1);
outp[cnt] = 0;
if (_tcslen (tmp1) > 0) {
outp[cnt++] = my_strdup (tmp1);
outp[cnt] = 0;
}
tmp1[0] = 0;
doout = 0;
j = 0;
......@@ -3382,7 +3371,9 @@ uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR *out, u
for (i = 0; i < argv; i++) {
if (i + 2 <= argv) {
if (!inputdevice_uaelib (argc[i], argc[i + 1])) {
if (!_tcsicmp (argc[i], "dbg")) {
debug_parser (argc[i + 1], out, outsize);
} else if (!inputdevice_uaelib (argc[i], argc[i + 1])) {
if (!cfgfile_parse_option (&changed_prefs, argc[i], argc[i + 1], 0)) {
err = 5;
break;
......
......@@ -2193,13 +2193,14 @@ static void memwatch (TCHAR **c)
{
int num;
struct memwatch_node *mwn;
TCHAR nc;
TCHAR nc, *cp;
if (!memwatch_enabled) {
initialize_memwatch (0);
console_out ("Memwatch breakpoints enabled\n");
}
cp = *c;
ignore_ws (c);
if (!more_params (c)) {
memwatch_dump (-1);
......@@ -2240,7 +2241,8 @@ static void memwatch (TCHAR **c)
}
return;
}
num = nc - '0';
*c = cp;
num = readint (c);
if (num < 0 || num >= MEMWATCH_TOTAL)
return;
mwn = &mwnodes[num];
......@@ -3130,35 +3132,18 @@ static void m68k_modify (TCHAR **inptr)
}
}
static void debug_1 (void)
{
TCHAR input[MAX_LINEWIDTH];
uaecptr nxdis, nxmem, addr;
m68k_dumpstate (stdout, &nextpc);
nxdis = nextpc; nxmem = 0;
debugger_active = 1;
static uaecptr nxdis, nxmem;
for (;;) {
TCHAR cmd, *inptr;
int v;
static bool debug_line (TCHAR *input)
{
TCHAR cmd, *inptr;
uaecptr addr;
if (!debugger_active)
return;
//update_debug_info ();
console_out (">");
console_flush ();
debug_linecounter = 0;
v = console_get (input, MAX_LINEWIDTH);
if (v < 0)
return;
if (v == 0)
continue;
inptr = input;
cmd = next_char (&inptr);
inptr = input;
cmd = next_char (&inptr);
switch (cmd)
{
switch (cmd)
{
case 'c': dumpcia (); dumpdisk (); dumpcustom (); break;
case 'i':
{
......@@ -3269,13 +3254,13 @@ static void debug_1 (void)
}
set_special (SPCFLAG_BRK);
exception_debugging = 1;
return;
return true;
case 'z':
skipaddr_start = nextpc;
skipaddr_doskip = 1;
do_skip = 1;
exception_debugging = 1;
return;
return true;
case 'f':
if (inptr[0] == 'a') {
......@@ -3284,17 +3269,17 @@ static void debug_1 (void)
} else if (inptr[0] == 'p') {
inptr++;
if (process_breakpoint (&inptr))
return;
return true;
} else {
if (instruction_breakpoint (&inptr))
return;
return true;
}
break;
case 'q':
uae_quit();
deactivate_debugger();
return;
return true;
case 'g':
if (more_params (&inptr)) {
......@@ -3302,7 +3287,7 @@ static void debug_1 (void)
fill_prefetch ();
}
deactivate_debugger();
return;
return true;
case 'x':
if (_totupper(inptr[0]) == 'X') {
......@@ -3310,7 +3295,7 @@ static void debug_1 (void)
} else {
deactivate_debugger();
close_console();
return;
return true;
}
break;
......@@ -3431,7 +3416,7 @@ static void debug_1 (void)
if (copper_debugger (&inptr)) {
debugger_active = 0;
debugging = 0;
return;
return true;
}
break;
}
......@@ -3439,7 +3424,7 @@ static void debug_1 (void)
break;
case 'b':
if (staterecorder (&inptr))
return;
return true;
break;
case 'U':
if (currprefs.cpu_model && more_params (&inptr)) {
......@@ -3475,7 +3460,34 @@ static void debug_1 (void)
else
debug_help ();
break;
}
}
return false;
}
static void debug_1 (void)
{
TCHAR input[MAX_LINEWIDTH];
m68k_dumpstate (stdout, &nextpc);
nxdis = nextpc; nxmem = 0;
debugger_active = 1;
for (;;) {
int v;
if (!debugger_active)
return;
update_debug_info ();
console_out (">");
console_flush ();
debug_linecounter = 0;
v = console_get (input, MAX_LINEWIDTH);
if (v < 0)
return;
if (v == 0)
continue;
if (debug_line (input))
return;
}
}
......@@ -4023,3 +4035,16 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2)
set_special (SPCFLAG_BRK);
return 1;
}
void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize)
{
TCHAR empty[2] = { 0 };
TCHAR *input = my_strdup (cmd);
if (out == NULL || outsize == 0)
setconsolemode (empty, 1);
else
setconsolemode (out, outsize);
debug_line (input);
setconsolemode (NULL, 0);
xfree (input);
}
......@@ -327,6 +327,12 @@ extern int firstword_bplcon1;
static int gclow, gcloh, gclox, gcloy;
void get_custom_topedge (int *x, int *y)
{
*x = visible_left_border;
*y = minfirstline << currprefs.gfx_vresolution;
}
static void reset_custom_limits (void)
{
gclow = gcloh = gclox = gcloy = 0;
......@@ -2179,7 +2185,7 @@ static void center_image (void)
if (visible_left_border < prev_x_adjust && prev_x_adjust < min_diwstart && min_diwstart - visible_left_border <= 32)
visible_left_border = prev_x_adjust;
}
} else if ((beamcon0 & 0x80) && max_diwstop > 0) {
} else if ((beamcon0 & 0x80) && max_diwstop > 0 && !currprefs.gfx_filter_autoscale) {
int w = gfxvidinfo.width;
if (max_diwstop - min_diwstart < w)
visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart;
......@@ -2189,20 +2195,6 @@ static void center_image (void)
visible_left_border = max_diwlastword - gfxvidinfo.width;
}
if (currprefs.gfx_xcenter_pos >= 0 && !currprefs.gfx_filter_autoscale) {
int val = currprefs.gfx_xcenter_pos >> RES_MAX;
#if 0
if (currprefs.gfx_xcenter_size > 0) {
int diff = ((gfxvidinfo.width << (RES_MAX - currprefs.gfx_resolution)) - currprefs.gfx_xcenter_size) / 1;
write_log ("%d %d\n", currprefs.gfx_xcenter_size, gfxvidinfo.width);
val -= diff >> RES_MAX;
}
#endif
if (val < 56)
val = 56;
visible_left_border = val + (DIW_DDF_OFFSET << currprefs.gfx_resolution) - (DISPLAY_LEFT_SHIFT * 2 - (DISPLAY_LEFT_SHIFT << currprefs.gfx_resolution));
}
if (visible_left_border > max_diwlastword - 32)
visible_left_border = max_diwlastword - 32;
if (visible_left_border < 0)
......@@ -2232,25 +2224,13 @@ static void center_image (void)
thisframe_y_adjust = prev_y_adjust;
}
}
if (currprefs.gfx_ycenter_pos >= 0 && !currprefs.gfx_filter_autoscale) {
thisframe_y_adjust = currprefs.gfx_ycenter_pos >> 1;
#if 0
if (currprefs.gfx_ycenter_size > 0) {
int diff = (currprefs.gfx_ycenter_size - (gfxvidinfo.height << (linedbl ? 0 : 1))) / 2;
thisframe_y_adjust += diff >> 1;
}
#endif
if (thisframe_y_adjust + max_drawn_amiga_line > 2 * maxvpos_nom)
thisframe_y_adjust = 2 * maxvpos_nom - max_drawn_amiga_line;
if (thisframe_y_adjust < 0)
thisframe_y_adjust = 0;
} else {
/* Make sure the value makes sense */
if (thisframe_y_adjust + max_drawn_amiga_line > maxvpos_nom)
thisframe_y_adjust = maxvpos_nom - max_drawn_amiga_line;
if (thisframe_y_adjust < minfirstline)
thisframe_y_adjust = minfirstline;
}
if (thisframe_y_adjust + max_drawn_amiga_line > maxvpos_nom)
thisframe_y_adjust = maxvpos_nom - max_drawn_amiga_line;
if (thisframe_y_adjust < minfirstline)
thisframe_y_adjust = minfirstline;
thisframe_y_adjust_real = thisframe_y_adjust << linedbl;
tmp = (maxvpos_nom - thisframe_y_adjust) << linedbl;
if (tmp != max_ypos_thisframe) {
......
......@@ -298,17 +298,15 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value)
// Z3 P96 RAM
p2 = p96ram_start >> 16;
}
if (value != p2) {
put_word (regs.regs[11] + 0x20, p2);
put_word (regs.regs[11] + 0x28, p2);
}
put_word (regs.regs[11] + 0x20, p2);
put_word (regs.regs[11] + 0x28, p2);
// -Bernd Roesch
expamem_hi = p2;
(*card_map[ecard]) ();
ecard++;
if (value != p2)
if (p1 != p2)
write_log (" Card %d remapped %04x0000 -> %04x0000\n", ecard, p1, p2);
write_log (" Card %d (Zorro%s) done.\n", ecard, expamem_type () == 0xc0 ? "II" : "III");
write_log (" Card %d (Zorro%s) done.\n", ecard, expamem_type () == 0xc0 ? L"II" : L"III");
if (ecard < cardno)
(*card_init[ecard]) ();
else
......
......@@ -3701,9 +3701,6 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb
TRACE(("fh=%x lock=%x name=%x\n", fh, lock, name));
DUMPLOCK(unit, lock);
if (!_tcsicmp(bstr(unit,name), "Nù"))
activate_debugger();
aino = find_aino (unit, lock, bstr (unit, name), &err);
if (aino == 0 || (err != 0 && err != ERROR_OBJECT_NOT_AROUND)) {
......
......@@ -113,15 +113,21 @@ float fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000;
#define MAKE_FPSR(r) (regs).fp_result=(r)
static __inline__ void native_set_fpucw (uae_u32 m68k_cw)
{
#ifdef _WIN32
// RN, RZ, RM, RP
static unsigned int fp87_round[4] = { _RC_NEAR, _RC_CHOP, _RC_DOWN, _RC_UP };
// X, S, D, U
static unsigned int fp87_prec[4] = { _PC_64 , _PC_24 , _PC_53, 0 };
_control87(fp87_round[(m68k_cw >> 4) & 3] | fp87_prec[(m68k_cw >> 6) & 3], _MCW_RC | _MCW_PC);
#else
static uae_u16 x87_cw_tab[] = {
0x137f, 0x1f7f, 0x177f, 0x1b7f, /* Extended */
0x107f, 0x1c7f, 0x147f, 0x187f, /* Single */
0x127f, 0x1e7f, 0x167f, 0x1a7f, /* Double */
0x137f, 0x1f7f, 0x177f, 0x1b7f /* undefined */
};
/* Nearest, toZero, Down, Up */
static __inline__ void native_set_fpucw (uae_u32 m68k_cw)
{
#if USE_X86_FPUCW
uae_u16 x87_cw = x87_cw_tab[(m68k_cw >> 4) & 0xf];
......@@ -133,6 +139,7 @@ static __inline__ void native_set_fpucw (uae_u32 m68k_cw)
__asm__ ("fldcw %0" : : "m" (*&x87_cw));
#endif
#endif
#endif
}
#if defined(uae_s64) /* Close enough for government work? */
......
......@@ -40,15 +40,16 @@ extern void update_debug_info (void);
extern int instruction_breakpoint (TCHAR **c);
extern int debug_bankchange (int);
extern void log_dma_record (void);
extern void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize);
#define BREAKPOINT_TOTAL 8
#define BREAKPOINT_TOTAL 20
struct breakpoint_node {
uaecptr addr;
int enabled;
};
extern struct breakpoint_node bpnodes[BREAKPOINT_TOTAL];
#define MEMWATCH_TOTAL 8
#define MEMWATCH_TOTAL 20
struct memwatch_node {
uaecptr addr;
int size;
......
......@@ -277,6 +277,7 @@ extern void notice_interlace_seen (void);
extern void frame_drawn (void);
extern void redraw_frame (void);
extern int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy);
extern void get_custom_topedge (int *x, int *y);
extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq);
/* Finally, stuff that shouldn't really be shared. */
......
......@@ -235,7 +235,7 @@ extern int jsem_isjoy (int port, const struct uae_prefs *p);
extern int jsem_ismouse (int port, const struct uae_prefs *p);
extern int jsem_iskbdjoy (int port, const struct uae_prefs *p);
extern int inputdevice_uaelib (TCHAR *, TCHAR *);
extern int inputdevice_uaelib (const TCHAR *, const TCHAR *);
extern int inputdevice_testread (int*, int*, int*);
extern int inputdevice_istest (void);
......
......@@ -134,6 +134,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000,
#define AUTOSCALE_NORMAL 4
#define AUTOSCALE_RESIZE 5
#define AUTOSCALE_CENTER 6
#define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos
struct uae_prefs {
......@@ -313,6 +314,8 @@ struct uae_prefs {
TCHAR romfile[MAX_DPATH];
TCHAR romident[256];
TCHAR romextfile[MAX_DPATH];
uae_u32 romextfile2addr;
TCHAR romextfile2[MAX_DPATH];
TCHAR romextident[256];
TCHAR keyfile[256];
TCHAR flashfile[MAX_DPATH];
......
......@@ -139,7 +139,7 @@ static int isdevice (struct uae_input_device *id)
return 0;
}
int inputdevice_uaelib (TCHAR *s, TCHAR *parm)
int inputdevice_uaelib (const TCHAR *s, const TCHAR *parm)
{
int i;
......
......@@ -1318,3 +1318,8 @@ int D3D_goodenough (void)
{
return 0;
}
//debug_win32
void update_debug_info(void)
{
}
......@@ -99,4 +99,20 @@ void flush_log (void)
void write_dlog (const char *format, ...)
{
}
\ No newline at end of file
}
static char *console_buffer;
static int console_buffer_size;
char *setconsolemode (char *buffer, int maxlen)
{
char *ret = NULL;
if (buffer) {
console_buffer = buffer;
console_buffer_size = maxlen;
} else {
ret = console_buffer;
console_buffer = NULL;
}
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment