syncing 2.3.0

parent 332ed3d1
...@@ -226,7 +226,7 @@ static int mungepacket (uae_u8 *packet, int len) ...@@ -226,7 +226,7 @@ static int mungepacket (uae_u8 *packet, int len)
return ret; return ret;
} }
static int getfunc (struct devstruct *dev, uae_u8 *d, int *len) static int getfunc (struct s2devstruct *dev, uae_u8 *d, int *len)
{ {
int tlen; int tlen;
...@@ -250,7 +250,7 @@ static int mcfilter (const uae_u8 *data) ...@@ -250,7 +250,7 @@ static int mcfilter (const uae_u8 *data)
return 1; // just allow everything return 1; // just allow everything
} }
static void gotfunc (struct devstruct *dev, const uae_u8 *data2, int len) static void gotfunc (struct s2devstruct *dev, const uae_u8 *data2, int len)
{ {
int i; int i;
int size, insize, first; int size, insize, first;
......
...@@ -1226,23 +1226,23 @@ static void freenativescsi (void) ...@@ -1226,23 +1226,23 @@ static void freenativescsi (void)
static void addnativescsi (void) static void addnativescsi (void)
{ {
int i, j; int i, j;
int devices[MAX_TOTAL_DEVICES]; int devices[MAX_TOTAL_SCSI_DEVICES];
int types[MAX_TOTAL_DEVICES]; int types[MAX_TOTAL_SCSI_DEVICES];
struct device_info dis[MAX_TOTAL_DEVICES]; struct device_info dis[MAX_TOTAL_SCSI_DEVICES];
freenativescsi (); freenativescsi ();
i = 0; i = 0;
while (i < MAX_TOTAL_DEVICES) { while (i < MAX_TOTAL_SCSI_DEVICES) {
types[i] = -1; types[i] = -1;
devices[i] = -1; devices[i] = -1;
if (sys_command_open (DF_SCSI, i)) { if (sys_command_open (i)) {
if (sys_command_info (DF_SCSI, i, &dis[i])) { if (sys_command_info (i, &dis[i], 0)) {
devices[i] = i; devices[i] = i;
types[i] = 100 - i; types[i] = 100 - i;
if (dis[i].type == INQ_ROMD) if (dis[i].type == INQ_ROMD)
types[i] = 1000 - i; types[i] = 1000 - i;
} }
sys_command_close (DF_SCSI, i); sys_command_close (i);
} }
i++; i++;
} }
......
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* Arcadia emulation * Arcadia emulation
* *
* Copyright 2005-2007 Toni Wilen * Copyright 2005-2007 Toni Wilen
* *
* *
*/ */
#ifdef ARCADIA #ifdef ARCADIA
#include "sysconfig.h" #include "sysconfig.h"
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#define MAX_EV ~0ul #define MAX_EV ~0ul
//#define DEBUG_AUDIO //#define DEBUG_AUDIO
#define DEBUG_CHANNEL_MASK 2 #define DEBUG_CHANNEL_MASK 15
//#define TEST_AUDIO //#define TEST_AUDIO
#define PERIOD_MIN 4 #define PERIOD_MIN 4
...@@ -64,7 +64,7 @@ static bool debugchannel (int ch) ...@@ -64,7 +64,7 @@ static bool debugchannel (int ch)
STATIC_INLINE bool usehacks (void) STATIC_INLINE bool usehacks (void)
{ {
return currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact; return currprefs.cpu_model >= 68020 || currprefs.m68k_speed != 0;
} }
#define SINC_QUEUE_MAX_AGE 2048 #define SINC_QUEUE_MAX_AGE 2048
...@@ -204,8 +204,10 @@ void audio_sampleripper (int mode) ...@@ -204,8 +204,10 @@ void audio_sampleripper (int mode)
rs->changed = 0; rs->changed = 0;
fetch_ripperpath (path, sizeof (path)); fetch_ripperpath (path, sizeof (path));
name[0] = 0; name[0] = 0;
if (currprefs.dfxtype[0] >= 0) if (currprefs.floppyslots[0].dfxtype >= 0)
_tcscpy (name, currprefs.df[0]); _tcscpy (name, currprefs.floppyslots[0].df);
else if (currprefs.cdslots[0].inuse)
_tcscpy (name, currprefs.cdslots[0].name);
if (!name[0]) if (!name[0])
underline[0] = 0; underline[0] = 0;
namesplit (name); namesplit (name);
...@@ -1036,13 +1038,18 @@ static int audio_work_to_do; ...@@ -1036,13 +1038,18 @@ static int audio_work_to_do;
static void zerostate (int nr) static void zerostate (int nr)
{ {
struct audio_channel_data *cdp = audio_channel + nr; struct audio_channel_data *cdp = audio_channel + nr;
#ifdef DEBUG_AUDIO
write_log ("%d: ZEROSTATE\n", nr);
#endif
cdp->state = 0; cdp->state = 0;
cdp->evtime = MAX_EV; cdp->evtime = MAX_EV;
cdp->intreq2 = 0; cdp->intreq2 = 0;
cdp->dsr = cdp->dr = false; cdp->dsr = cdp->dr = false;
cdp->dmaenstore = false;
#ifdef TEST_AUDIO #ifdef TEST_AUDIO
cdp->have_dat = false; cdp->have_dat = false;
#endif #endif
} }
static void schedule_audio (void) static void schedule_audio (void)
...@@ -1262,33 +1269,56 @@ static void audio_state_channel2 (int nr, bool perfin) ...@@ -1262,33 +1269,56 @@ static void audio_state_channel2 (int nr, bool perfin)
{ {
struct audio_channel_data *cdp = audio_channel + nr; struct audio_channel_data *cdp = audio_channel + nr;
bool chan_ena = (dmacon & DMA_MASTER) && (dmacon & (1 << nr)); bool chan_ena = (dmacon & DMA_MASTER) && (dmacon & (1 << nr));
bool old_dma = cdp->dmaenstore;
int audav = adkcon & (0x01 << nr); int audav = adkcon & (0x01 << nr);
int audap = adkcon & (0x10 << nr); int audap = adkcon & (0x10 << nr);
int napnav = (!audav && !audap) || audav; int napnav = (!audav && !audap) || audav;
int hpos = current_hpos (); int hpos = current_hpos ();
#ifdef DEBUG_AUDIO
if (debugchannel (nr)) {
if (cdp->dmaenstore != chan_ena) {
cdp->dmaenstore = chan_ena; cdp->dmaenstore = chan_ena;
write_log ("%d:DMA=%d IRQ=%d PC=%08x\n", nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC);
} if (currprefs.produce_sound == 0) {
zerostate (nr);
return;
} }
audio_activate ();
if ((cdp->state == 2 || cdp->state == 3) && usehacks () && !chan_ena && old_dma) {
// DMA switched off, state=2/3 and "too fast CPU": kill DMA instantly
// or CPU timed DMA wait routines in common tracker players will lose notes
#ifdef DEBUG_AUDIO
write_log ("%d: INSTADMAOFF\n", nr, M68K_GETPC);
#endif #endif
if (currprefs.produce_sound == 0) { newsample (nr, (cdp->dat2 >> 0) & 0xff);
if (napnav)
setirq (nr, 91);
zerostate (nr); zerostate (nr);
return; return;
} }
#ifdef DEBUG_AUDIO
if (debugchannel (nr) && old_dma != chan_ena) {
write_log ("%d:DMA=%d IRQ=%d PC=%08x\n", nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC);
}
#endif
switch (cdp->state) switch (cdp->state)
{ {
case 0: case 0:
if (chan_ena) { if (chan_ena) {
cdp->evtime = MAX_EV; cdp->evtime = MAX_EV;
cdp->state = 1; cdp->state = 1;
cdp->dsr = true;
cdp->dr = true; cdp->dr = true;
cdp->drhpos = hpos; cdp->drhpos = hpos;
cdp->wlen = cdp->len; cdp->wlen = cdp->len;
// too fast CPU and some tracker players: enable DMA, CPU delay, update AUDxPT with loop position
if (usehacks ()) {
// copy AUDxPT - 2 to internal latch instantly
cdp->pt = cdp->lc - 2;
cdp->dsr = false;
} else {
// normal hardware behavior: latch it after first DMA fetch comes
cdp->dsr = true;
}
#ifdef TEST_AUDIO #ifdef TEST_AUDIO
cdp->have_dat = false; cdp->have_dat = false;
#endif #endif
...@@ -1300,7 +1330,7 @@ static void audio_state_channel2 (int nr, bool perfin) ...@@ -1300,7 +1330,7 @@ static void audio_state_channel2 (int nr, bool perfin)
cdp->state = 2; cdp->state = 2;
setirq (nr, 0); setirq (nr, 0);
loaddat (nr); loaddat (nr);
if (currprefs.cpu_model >= 68020 && !currprefs.cpu_cycle_exact && cdp->per < 10 * CYCLE_UNIT) { if (usehacks () && cdp->per < 10 * CYCLE_UNIT) {
// make sure audio.device AUDxDAT startup returns to idle state before DMA is enabled // make sure audio.device AUDxDAT startup returns to idle state before DMA is enabled
newsample (nr, (cdp->dat2 >> 0) & 0xff); newsample (nr, (cdp->dat2 >> 0) & 0xff);
zerostate (nr); zerostate (nr);
...@@ -1314,6 +1344,7 @@ static void audio_state_channel2 (int nr, bool perfin) ...@@ -1314,6 +1344,7 @@ static void audio_state_channel2 (int nr, bool perfin)
} }
break; break;
case 1: case 1:
cdp->evtime = MAX_EV;
if (!cdp->dat_written) if (!cdp->dat_written)
return; return;
#ifdef TEST_AUDIO #ifdef TEST_AUDIO
...@@ -1322,13 +1353,14 @@ static void audio_state_channel2 (int nr, bool perfin) ...@@ -1322,13 +1353,14 @@ static void audio_state_channel2 (int nr, bool perfin)
cdp->have_dat = false; cdp->have_dat = false;
cdp->losample = cdp->hisample = false; cdp->losample = cdp->hisample = false;
#endif #endif
setirq (nr, 1); setirq (nr, 10);
setdr (nr); setdr (nr);
if (cdp->wlen != 1) if (cdp->wlen != 1)
cdp->wlen = (cdp->wlen - 1) & 0xffff; cdp->wlen = (cdp->wlen - 1) & 0xffff;
cdp->state = 5; cdp->state = 5;
break; break;
case 5: case 5:
cdp->evtime = MAX_EV;
if (!cdp->dat_written) if (!cdp->dat_written)
return; return;
#ifdef DEBUG_AUDIO #ifdef DEBUG_AUDIO
...@@ -1650,11 +1682,13 @@ void set_audio (void) ...@@ -1650,11 +1682,13 @@ void set_audio (void)
sample_prehandler = anti_prehandler; sample_prehandler = anti_prehandler;
} }
audio_activate ();
if (currprefs.produce_sound == 0) { if (currprefs.produce_sound == 0) {
eventtab[ev_audio].active = 0; eventtab[ev_audio].active = 0;
events_schedule (); events_schedule ();
} else {
audio_activate ();
schedule_audio ();
events_schedule ();
} }
config_changed = 1; config_changed = 1;
} }
...@@ -1740,8 +1774,13 @@ void update_audio (void) ...@@ -1740,8 +1774,13 @@ void update_audio (void)
} }
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (audio_channel[i].evtime == 0) if (audio_channel[i].evtime == 0) {
audio_state_channel (i, true); audio_state_channel (i, true);
if (audio_channel[i].evtime == 0) {
write_log ("evtime==0 sound bug channel %d\n");
audio_channel[i].evtime = MAX_EV;
}
}
} }
} }
end: end:
...@@ -1922,7 +1961,6 @@ int init_audio (void) ...@@ -1922,7 +1961,6 @@ int init_audio (void)
return init_sound (); return init_sound ();
} }
void led_filter_audio (void) void led_filter_audio (void)
{ {
led_filter_on = 0; led_filter_on = 0;
...@@ -1930,13 +1968,53 @@ void led_filter_audio (void) ...@@ -1930,13 +1968,53 @@ void led_filter_audio (void)
led_filter_on = 1; led_filter_on = 1;
} }
void audio_vsync (void)
{
#if SOUNDSTUFF > 0
int max, min;
int vsync = isfullscreen () > 0 && currprefs.gfx_avsync;
static int lastdir;
if (!vsync) {
extrasamples = 0;
return;
}
min = -10 * 10;
max = vsync ? 10 * 10 : 20 * 10;
extrasamples = 0;
if (gui_data.sndbuf < min) { // +1
extrasamples = (min - gui_data.sndbuf) / 10;
lastdir = 1;
} else if (gui_data.sndbuf > max) { // -1
extrasamples = (max - gui_data.sndbuf) / 10;
} else if (gui_data.sndbuf > 1 * 50 && lastdir < 0) {
extrasamples--;
} else if (gui_data.sndbuf < -1 * 50 && lastdir > 0) {
extrasamples++;
} else {
lastdir = 0;
}
if (extrasamples > 99)
extrasamples = 99;
if (extrasamples < -99)
extrasamples = -99;
#endif
}
int audio_setup (void) { return setup_sound (); }
void audio_close (void) { close_sound (); }
void audio_pause (void) { pause_sound (); }
void audio_resume (void) { resume_sound (); }
void audio_volume (int volume) { sound_volume (volume); }
#ifdef SAVESTATE #ifdef SAVESTATE
uae_u8 *restore_audio (int i, uae_u8 *src) uae_u8 *restore_audio (int nr, uae_u8 *src)
{ {
struct audio_channel_data *acd; struct audio_channel_data *acd = audio_channel + nr;
uae_u16 p; uae_u16 p;
acd = audio_channel + i;
acd->state = restore_u8 (); acd->state = restore_u8 ();
acd->vol = restore_u8 (); acd->vol = restore_u8 ();
acd->intreq2 = restore_u8 () ? true : false; acd->intreq2 = restore_u8 () ? true : false;
...@@ -1951,37 +2029,34 @@ uae_u8 *restore_audio (int i, uae_u8 *src) ...@@ -1951,37 +2029,34 @@ uae_u8 *restore_audio (int i, uae_u8 *src)
acd->wlen = restore_u16 (); acd->wlen = restore_u16 ();
p = restore_u16 (); p = restore_u16 ();
acd->per = p ? p * CYCLE_UNIT : PERIOD_MAX; acd->per = p ? p * CYCLE_UNIT : PERIOD_MAX;
p = restore_u16 (); acd->dat = acd->dat2 = restore_u16 ();
acd->lc = restore_u32 (); acd->lc = restore_u32 ();
acd->pt = restore_u32 (); acd->pt = restore_u32 ();
acd->evtime = restore_u32 (); acd->evtime = restore_u32 ();
last_cycles = get_cycles () - 1; acd->dmaenstore = (dmacon & DMA_MASTER) && (dmacon & (1 << nr));
return src; return src;
} }
#endif /* SAVESTATE */ #endif /* SAVESTATE */
#if defined SAVESTATE || defined DEBUGGER #if defined SAVESTATE || defined DEBUGGER
uae_u8 *save_audio (int i, int *len, uae_u8 *dstptr) uae_u8 *save_audio (int nr, int *len, uae_u8 *dstptr)
{ {
struct audio_channel_data *acd; struct audio_channel_data *acd = audio_channel + nr;
uae_u8 *dst, *dstbak; uae_u8 *dst, *dstbak;
uae_u16 p;
if (dstptr) if (dstptr)
dstbak = dst = dstptr; dstbak = dst = dstptr;
else else
dstbak = dst = (uae_u8*)malloc (100); dstbak = dst = xmalloc (uae_u8, 100);
acd = audio_channel + i; save_u8 (acd->state);
save_u8 ((uae_u8)acd->state);
save_u8 (acd->vol); save_u8 (acd->vol);
save_u8 (acd->intreq2); save_u8 (acd->intreq2);
save_u8 ((acd->dr ? 1 : 0) | (acd->dsr ? 2 : 0)); save_u8 ((acd->dr ? 1 : 0) | (acd->dsr ? 2 : 0));
save_u16 (acd->len); save_u16 (acd->len);
save_u16 (acd->wlen); save_u16 (acd->wlen);
p = acd->per == PERIOD_MAX ? 0 : acd->per / CYCLE_UNIT; save_u16 (acd->per == PERIOD_MAX ? 0 : acd->per / CYCLE_UNIT);
save_u16 (p); save_u16 (acd->dat);
save_u16 (acd->dat2);
save_u32 (acd->lc); save_u32 (acd->lc);
save_u32 (acd->pt); save_u32 (acd->pt);
save_u32 (acd->evtime); save_u32 (acd->evtime);
...@@ -1989,63 +2064,3 @@ uae_u8 *save_audio (int i, int *len, uae_u8 *dstptr) ...@@ -1989,63 +2064,3 @@ uae_u8 *save_audio (int i, int *len, uae_u8 *dstptr)
return dstbak; return dstbak;
} }
#endif /* SAVESTATE || DEBUGGER */ #endif /* SAVESTATE || DEBUGGER */
void audio_vsync (void)
{
#if SOUNDSTUFF > 0
int max, min;
int vsync = isfullscreen () > 0 && currprefs.gfx_avsync;
static int lastdir;
if (!vsync) {
extrasamples = 0;
return;
}
min = -10 * 10;
max = vsync ? 10 * 10 : 20 * 10;
extrasamples = 0;
if (gui_data.sndbuf < min) { // +1
extrasamples = (min - gui_data.sndbuf) / 10;
lastdir = 1;
} else if (gui_data.sndbuf > max) { // -1
extrasamples = (max - gui_data.sndbuf) / 10;
} else if (gui_data.sndbuf > 1 * 50 && lastdir < 0) {
extrasamples--;
} else if (gui_data.sndbuf < -1 * 50 && lastdir > 0) {
extrasamples++;
} else {
lastdir = 0;
}
if (extrasamples > 99)
extrasamples = 99;
if (extrasamples < -99)
extrasamples = -99;
#endif
}
int audio_setup (void)
{
return setup_sound ();
}
void audio_close (void)
{
close_sound ();
}
void audio_pause (void)
{
pause_sound ();
}
void audio_resume (void)
{
resume_sound ();
}
void audio_volume (int volume)
{
sound_volume (volume);
}
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* AutoConfig devices * AutoConfig devices
* *
* Copyright 1995, 1996 Bernd Schmidt * Copyright 1995, 1996 Bernd Schmidt
* Copyright 1996 Ed Hanway * Copyright 1996 Ed Hanway
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
......
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* bsdsocket.library emulation machine-independent part * bsdsocket.library emulation machine-independent part
* *
* Copyright 1997, 1998 Mathias Ortmann * Copyright 1997, 1998 Mathias Ortmann
* *
* Library initialization code (c) Tauno Taipaleenmaki * Library initialization code (c) Tauno Taipaleenmaki
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
...@@ -38,9 +38,9 @@ static uae_u32 SockLibBase; ...@@ -38,9 +38,9 @@ static uae_u32 SockLibBase;
/* ObtainSocket()/ReleaseSocket() public socket pool */ /* ObtainSocket()/ReleaseSocket() public socket pool */
struct sockd { struct sockd {
long sockpoolids[SOCKPOOLSIZE]; long sockpoolids[SOCKPOOLSIZE];
SOCKET_TYPE sockpoolsocks[SOCKPOOLSIZE]; SOCKET_TYPE sockpoolsocks[SOCKPOOLSIZE];
uae_u32 sockpoolflags[SOCKPOOLSIZE]; uae_u32 sockpoolflags[SOCKPOOLSIZE];
}; };
static long curruniqid = 65536; static long curruniqid = 65536;
...@@ -110,7 +110,7 @@ void bsdsocklib_seterrno (SB, int sb_errno) ...@@ -110,7 +110,7 @@ void bsdsocklib_seterrno (SB, int sb_errno)
{ {
sb->sb_errno = sb_errno; sb->sb_errno = sb_errno;
if (sb->sb_errno >= 1001 && sb->sb_errno <= 1005) if (sb->sb_errno >= 1001 && sb->sb_errno <= 1005)
bsdsocklib_setherrno (sb, sb->sb_errno - 1000); bsdsocklib_setherrno(sb,sb->sb_errno-1000);
if (sb->errnoptr) { if (sb->errnoptr) {
switch (sb->errnosize) { switch (sb->errnosize) {
case 1: case 1:
...@@ -143,17 +143,17 @@ void bsdsocklib_setherrno (SB, int sb_herrno) ...@@ -143,17 +143,17 @@ void bsdsocklib_setherrno (SB, int sb_herrno)
} }
} }
BOOL checksd (SB, int sd) BOOL checksd(SB, int sd)
{ {
int iCounter; int iCounter;
SOCKET s; SOCKET s;
s = getsock (sb, sd); s = getsock(sb,sd);
if (s != INVALID_SOCKET) { if (s != INVALID_SOCKET) {
for (iCounter = 1; iCounter <= sb->dtablesize; iCounter++) { for (iCounter = 1; iCounter <= sb->dtablesize; iCounter++) {
if (iCounter != sd) { if (iCounter != sd) {
if (getsock (sb, iCounter) == s) { if (getsock(sb,iCounter) == s) {
releasesock (sb, sd); releasesock(sb,sd);
return 1; return 1;
} }
} }
......
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* CD32 FMV cartridge * CD32 FMV cartridge
* *
* Copyright 2008 Toni Wilen * Copyright 2008-2010 Toni Wilen
* *
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
...@@ -19,35 +19,48 @@ ...@@ -19,35 +19,48 @@
#include "cd32_fmv.h" #include "cd32_fmv.h"
#include "uae.h" #include "uae.h"
//#define FMV_DEBUG #define FMV_DEBUG 1
/*
0x200000 - 0x23FFFF ROM
0x240000 io/status (single word register?)
0x2500xx L64111 audio decoder (word registers)
0x2700xx CL450 video decoder (word registers)
0x280000 - 0x2FFFFF RAM
*/
#define FMV_BASE 0x40000 #define IO_BASE 0x040000
#define AUDIO_BASE 0x50000 #define L64111_BASE 0x050000
#define VIDEO_BASE 0x70000 #define CL450_BASE 0x070000
#define VIDEO_RAM 0x80000 #define VRAM_BASE 0x080000
#define BANK_MASK 0x0F0000
#define IO_IRQ_L641111 0x4000
#define IO_IRQ_CL450 0x8000
// L64111 registers (from datasheet) // L64111 registers (from datasheet)
#define A_DATA 0 #define A_DATA 0 //0
#define A_CONTROL1 2 #define A_CONTROL1 1 //2
#define A_CONTROL2 4 #define A_CONTROL2 2 //4
#define A_CONTROL3 6 #define A_CONTROL3 3 //6
#define A_INT1 8 #define A_INT1 4 //8
#define A_INT2 10 #define A_INT2 5 //10
#define A_TCR 12 #define A_TCR 6 //12
#define A_TORH 14 #define A_TORH 7 //14
#define A_TORL 16 #define A_TORL 8 //16
#define A_PARAM1 18 #define A_PARAM1 9 //18
#define A_PARAM2 20 #define A_PARAM2 10 //20
#define A_PARAM3 22 #define A_PARAM3 11 //22
#define A_PRESENT1 24 #define A_PRESENT1 12 //24
#define A_PRESENT2 26 #define A_PRESENT2 13 //26
#define A_PRESENT3 28 #define A_PRESENT3 14 //28
#define A_PRESENT4 30 #define A_PRESENT4 15 //30
#define A_PRESENT5 32 #define A_PRESENT5 16 //32
#define A_FIFO 34 #define A_FIFO 17 //34
#define A_CB_STATUS 36 #define A_CB_STATUS 18 //36
#define A_CB_WRITE 38 #define A_CB_WRITE 19 //38
#define A_CB_READ 40 #define A_CB_READ 20 //40
static int fmv_mask; static int fmv_mask;
static uae_u8 *rom; static uae_u8 *rom;
...@@ -55,51 +68,191 @@ static int rom_size = 262144; ...@@ -55,51 +68,191 @@ static int rom_size = 262144;
static uaecptr fmv_start = 0x00200000; static uaecptr fmv_start = 0x00200000;
static int fmv_size = 1048576; static int fmv_size = 1048576;
static uae_u8 fmv_bget2 (uaecptr addr) static uae_u16 l64111regs[32];
static uae_u16 l64111intmask1, l64111intmask2, l64111intstatus1, l64111intstatus2;
static uae_u16 io_reg;
static int isdebug (uaecptr addr)
{ {
#ifdef FMV_DEBUG #if FMV_DEBUG > 2
write_log ("fmv_bget2 %08X PC=%8X\n", addr, M68K_GETPC); if (M68K_GETPC >= 0x200100)
return 1;
return 0;
#endif
#if (FMV_DEBUG == 2)
if (M68K_GETPC >= 0x200100 && (addr & fmv_mask) >= VRAM_BASE)
return 1;
return 0;
#endif #endif
if (addr >= rom_size && addr < 0x80000) {
write_log ("fmv_bget2 %08X PC=%8X\n", addr, M68K_GETPC);
return 0; return 0;
}
static uae_u8 io_bget (uaecptr addr)
{
addr &= 0xffff;
write_log ("FMV: IO byte read access %08x!\n", addr);
return 0;
}
static uae_u16 io_wget (uaecptr addr)
{
addr &= 0xffff;
if (addr != 0)
return 0;
return io_reg;
}
static void io_bput (uaecptr addr, uae_u8 v)
{
addr &= 0xffff;
write_log ("FMV: IO byte write access %08x!\n", addr);
}
static void io_wput (uaecptr addr, uae_u16 v)
{
addr &= 0xffff;
if (addr != 0)
return;
write_log ("FMV: IO=%04x\n", v);
io_reg = v;
}
static uae_u8 l64111_bget (uaecptr addr)
{
write_log ("FMV: L64111 byte read access %08x!\n", addr);
return 0;
}
static void l64111_bput (uaecptr addr, uae_u8 v)
{
write_log ("FMV: L64111 byte write access %08x!\n", addr);
}
static uae_u16 l64111_wget (uaecptr addr)
{
addr >>= 1;
addr &= 31;
#if FMV_DEBUG > 0
write_log ("FMV: L64111 read reg %d -> %04x\n", addr, l64111regs[addr]);
#endif
if (addr == 4)
return l64111intstatus1;
if (addr == 5)
return l64111intstatus1;
return l64111regs[addr];
}
static void l64111_wput (uaecptr addr, uae_u16 v)
{
addr >>= 1;
addr &= 31;
#if FMV_DEBUG > 0
write_log ("FMV: L64111 write reg %d = %04x\n", addr, v);
#endif
if (addr == 4) {
l64111intmask1 = v;
return;
}
if (addr == 5) {
l64111intmask2 = v;
return;
} }
l64111regs[addr] = v;
}
static uae_u8 cl450_bget (uaecptr addr)
{
addr &= 0xff;
write_log ("FMV: CL450 byte read access %08x!\n", addr);
return 0;
}
static uae_u16 cl450_wget (uaecptr addr)
{
addr &= 0xff;
addr >>= 1;
write_log ("FMV: CL450 read reg %d\n", addr);
return 0;
}
static void cl450_bput (uaecptr addr, uae_u8 v)
{
addr &= 0xff;
write_log ("FMV: CL450 byte write access %08x!\n", addr);
}
static void cl450_wput (uaecptr addr, uae_u16 v)
{
addr &= 0xff;
write_log ("FMV: CL450 write reg %d = %04x\n", addr, v);
}
static uae_u8 romram_bget (uaecptr addr)
{
#ifdef FMV_DEBUG
if (isdebug (addr))
write_log ("romram_bget %08X PC=%08X\n", addr, M68K_GETPC);
#endif
if (addr >= IO_BASE && addr < VRAM_BASE)
return 0;
return rom[addr]; return rom[addr];
} }
static void fmv_bput2 (uaecptr addr, uae_u8 v) static uae_u16 romram_wget (uaecptr addr)
{
#ifdef FMV_DEBUG
if (isdebug (addr))
write_log ("romram_wget %08X PC=%08X\n", addr, M68K_GETPC);
#endif
if (addr >= IO_BASE && addr < VRAM_BASE)
return 0;
return (rom[addr] << 8) | (rom[addr + 1] << 0);
}
static void ram_bput (uaecptr addr, uae_u8 v)
{ {
if (addr >= rom_size && addr < 0x80000) { if (addr < VRAM_BASE)
write_log ("fmv_bput2 %08X=%02X PC=%8X\n", addr, v & 0xff, M68K_GETPC); return;
rom[addr] = v;
if (isdebug (addr)) {
write_log ("ram_bput %08X=%02X PC=%08X\n", addr, v & 0xff, M68K_GETPC);
}
}
static void ram_wput (uaecptr addr, uae_u16 v)
{
if (addr < VRAM_BASE)
return;
rom[addr + 0] = v >> 8;
rom[addr + 1] = v >> 0;
if (isdebug (addr)) {
write_log ("ram_wput %08X=%04X PC=%08X\n", addr, v & 0xffff, M68K_GETPC);
} }
} }
static uae_u32 REGPARAM2 fmv_lget (uaecptr addr) static uae_u32 REGPARAM2 fmv_wget (uaecptr addr)
{ {
uae_u32 v; uae_u32 v;
#ifdef JIT
special_mem |= S_READ;
#endif
addr -= fmv_start & fmv_mask; addr -= fmv_start & fmv_mask;
addr &= fmv_mask; addr &= fmv_mask;
v = (fmv_bget2 (addr) << 24) | (fmv_bget2 (addr + 1) << 16) | int mask = addr & BANK_MASK;
(fmv_bget2 (addr + 2) << 8) | (fmv_bget2 (addr + 3)); if (mask == L64111_BASE)
v = l64111_wget (addr);
else if (mask == CL450_BASE)
v = cl450_wget (addr);
else if (mask == IO_BASE)
v = io_wget (addr);
else
v = romram_wget (addr);
#ifdef FMV_DEBUG #ifdef FMV_DEBUG
write_log ("fmv_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC); if (isdebug (addr))
write_log ("fmv_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC);
#endif #endif
return v; return v;
} }
static uae_u32 REGPARAM2 fmv_wget (uaecptr addr) static uae_u32 REGPARAM2 fmv_lget (uaecptr addr)
{ {
uae_u32 v; uae_u32 v;
#ifdef JIT v = (fmv_wget (addr) << 16) | (fmv_wget (addr + 2) << 0);
special_mem |= S_READ;
#endif
addr -= fmv_start & fmv_mask;
addr &= fmv_mask;
v = (fmv_bget2 (addr) << 8) | fmv_bget2 (addr + 1);
#ifdef FMV_DEBUG #ifdef FMV_DEBUG
write_log ("fmv_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC); if (isdebug (addr))
write_log ("fmv_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC);
#endif #endif
return v; return v;
} }
...@@ -107,55 +260,64 @@ static uae_u32 REGPARAM2 fmv_wget (uaecptr addr) ...@@ -107,55 +260,64 @@ static uae_u32 REGPARAM2 fmv_wget (uaecptr addr)
static uae_u32 REGPARAM2 fmv_bget (uaecptr addr) static uae_u32 REGPARAM2 fmv_bget (uaecptr addr)
{ {
uae_u32 v; uae_u32 v;
#ifdef JIT
special_mem |= S_READ;
#endif
addr -= fmv_start & fmv_mask; addr -= fmv_start & fmv_mask;
addr &= fmv_mask; addr &= fmv_mask;
v = fmv_bget2 (addr); int mask = addr & BANK_MASK;
if (mask == L64111_BASE)
v = l64111_bget (addr);
else if (mask == CL450_BASE)
v = cl450_bget (addr);
else if (mask == IO_BASE)
v = io_bget (addr);
else
v = romram_bget (addr);
return v; return v;
} }
static void REGPARAM2 fmv_lput (uaecptr addr, uae_u32 l) static void REGPARAM2 fmv_wput (uaecptr addr, uae_u32 w)
{ {
#ifdef JIT
special_mem |= S_WRITE;
#endif
addr -= fmv_start & fmv_mask; addr -= fmv_start & fmv_mask;
addr &= fmv_mask; addr &= fmv_mask;
#ifdef FMV_DEBUG #ifdef FMV_DEBUG
write_log ("fmv_lput %08X=%08X PC=%08X\n", addr, l, M68K_GETPC); if (isdebug (addr))
write_log ("fmv_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC);
#endif #endif
fmv_bput2 (addr, l >> 24); int mask = addr & BANK_MASK;
fmv_bput2 (addr + 1, l >> 16); if (mask == L64111_BASE)
fmv_bput2 (addr + 2, l >> 8); l64111_wput (addr, w);
fmv_bput2 (addr + 3, l); else if (mask == CL450_BASE)
cl450_wput (addr, w);
else if (mask == IO_BASE)
io_wput (addr, w);
else
ram_wput (addr, w);
} }
static void REGPARAM2 fmv_wput (uaecptr addr, uae_u32 w) static void REGPARAM2 fmv_lput (uaecptr addr, uae_u32 w)
{ {
#ifdef JIT
special_mem |= S_WRITE;
#endif
addr -= fmv_start & fmv_mask;
addr &= fmv_mask;
#ifdef FMV_DEBUG #ifdef FMV_DEBUG
write_log ("fmv_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC); if (isdebug (addr))
write_log ("fmv_lput %08X=%08X PC=%08X\n", addr, w, M68K_GETPC);
#endif #endif
fmv_bput2 (addr, w >> 8); fmv_wput (addr + 0, w >> 16);
fmv_bput2 (addr + 1, w); fmv_wput (addr + 2, w >> 0);
} }
//extern addrbank fmv_bank; extern addrbank fmv_bank;
static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 b) static void REGPARAM2 fmv_bput (uaecptr addr, uae_u32 w)
{ {
#ifdef JIT
special_mem |= S_WRITE;
#endif
addr -= fmv_start & fmv_mask; addr -= fmv_start & fmv_mask;
addr &= fmv_mask; addr &= fmv_mask;
fmv_bput2 (addr, b); int mask = addr & BANK_MASK;
if (mask == L64111_BASE)
l64111_bput (addr, w);
else if (mask == CL450_BASE)
cl450_bput (addr, w);
else if (mask == IO_BASE)
io_bput (addr, w);
else
ram_bput (addr, w);
} }
static uae_u32 REGPARAM2 fmv_wgeti (uaecptr addr) static uae_u32 REGPARAM2 fmv_wgeti (uaecptr addr)
...@@ -208,7 +370,7 @@ static uae_u8 *REGPARAM2 fmv_xlate (uaecptr addr) ...@@ -208,7 +370,7 @@ static uae_u8 *REGPARAM2 fmv_xlate (uaecptr addr)
return rom + addr; return rom + addr;
} }
static addrbank fmv_bank = { addrbank fmv_bank = {
fmv_lget, fmv_wget, fmv_bget, fmv_lget, fmv_wget, fmv_bget,
fmv_lput, fmv_wput, fmv_bput, fmv_lput, fmv_wput, fmv_bput,
fmv_xlate, fmv_check, NULL, "CD32 FMV module", fmv_xlate, fmv_check, NULL, "CD32 FMV module",
...@@ -240,6 +402,5 @@ void cd32_fmv_init (uaecptr start) ...@@ -240,6 +402,5 @@ void cd32_fmv_init (uaecptr start)
} }
fmv_mask = fmv_size - 1; fmv_mask = fmv_size - 1;
fmv_bank.baseaddr = rom; fmv_bank.baseaddr = rom;
rom[0x282] = 0;
map_banks (&fmv_bank, start >> 16, fmv_size >> 16, 0); map_banks (&fmv_bank, start >> 16, fmv_size >> 16, 0);
} }
This diff is collapsed.
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* CIA chip support * CIA chip support
* *
* Copyright 1995 Bernd Schmidt, Alessandro Bissacco * Copyright 1995 Bernd Schmidt, Alessandro Bissacco
* Copyright 1996, 1997 Stefan Reinauer, Christian Schmitt * Copyright 1996, 1997 Stefan Reinauer, Christian Schmitt
*/ */
#include "sysconfig.h" #include "sysconfig.h"
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
#include "zfile.h" #include "zfile.h"
#include "ar.h" #include "ar.h"
#ifdef PARALLEL_PORT #ifdef PARALLEL_PORT
# include "parallel.h" #include "parallel.h"
#endif #endif
#ifdef CD32 #ifdef CD32
# include "akiko.h" #include "akiko.h"
#include "cdtv.h"
#endif #endif
#include "debug.h" #include "debug.h"
#ifdef ARCADIA #ifdef ARCADIA
# include "arcadia.h" #include "arcadia.h"
#endif #endif
#include "keyboard.h" #include "keyboard.h"
#include "uae.h" #include "uae.h"
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
/* FIXME: Add configure support to enable this. */ /* FIXME: Add configure support to enable this. */
#ifdef HAVE_GETTIMEOFDAY #ifdef HAVE_GETTIMEOFDAY
# define TOD_HACK #define TOD_HACK
#endif #endif
#define DIV10 (10 * CYCLE_UNIT / 2) /* Yes, a bad identifier. */ #define DIV10 (10 * CYCLE_UNIT / 2) /* Yes, a bad identifier. */
...@@ -1218,7 +1219,7 @@ void CIA_reset (void) ...@@ -1218,7 +1219,7 @@ void CIA_reset (void)
DISK_select (ciabprb); DISK_select (ciabprb);
} }
#ifdef CD32 #ifdef CD32
if (savestate_state != STATE_RESTORE) { if (savestate_state != STATE_RESTORE && savestate_state != STATE_DORESTORE) {
akiko_reset (); akiko_reset ();
if (!akiko_init ()) if (!akiko_init ())
currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0; currprefs.cs_cd32cd = changed_prefs.cs_cd32cd = 0;
......
...@@ -56,8 +56,8 @@ const int tune_alignment = 1; // Tune code alignments for running CPU ? ...@@ -56,8 +56,8 @@ const int tune_alignment = 1; // Tune code alignments for running CPU ?
const int tune_nop_fillers = 1; // Tune no-op fillers for architecture const int tune_nop_fillers = 1; // Tune no-op fillers for architecture
static int setzflg_uses_bsf = 0; // setzflg virtual instruction can use native BSF instruction correctly? static int setzflg_uses_bsf = 0; // setzflg virtual instruction can use native BSF instruction correctly?
static int align_loops = 32;// Align the start of loops static int align_loops = 32; // Align the start of loops
static int align_jumps = 32;// Align the start of jumps static int align_jumps = 32; // Align the start of jumps
void* pushall_call_handler=NULL; void* pushall_call_handler=NULL;
static void* popall_do_nothing=NULL; static void* popall_do_nothing=NULL;
...@@ -508,38 +508,6 @@ bool check_prefs_changed_comp (void) ...@@ -508,38 +508,6 @@ bool check_prefs_changed_comp (void)
currprefs.comptrustbyte, currprefs.comptrustword, currprefs.comptrustlong, currprefs.comptrustbyte, currprefs.comptrustword, currprefs.comptrustlong,
currprefs.compfpu, currprefs.compnf, currprefs.comp_constjump, currprefs.comp_hardflush); currprefs.compfpu, currprefs.compnf, currprefs.comp_constjump, currprefs.comp_hardflush);
#if 0
if (!currprefs.compforcesettings) {
int stop=0;
if (currprefs.comptrustbyte!=0 && currprefs.comptrustbyte!=3)
stop = 1, write_log ("JIT: comptrustbyte is not 'direct' or 'afterpic'\n");
if (currprefs.comptrustword!=0 && currprefs.comptrustword!=3)
stop = 1, write_log ("JIT: comptrustword is not 'direct' or 'afterpic'\n");
if (currprefs.comptrustlong!=0 && currprefs.comptrustlong!=3)
stop = 1, write_log ("JIT: comptrustlong is not 'direct' or 'afterpic'\n");
if (currprefs.comptrustnaddr!=0 && currprefs.comptrustnaddr!=3)
stop = 1, write_log ("JIT: comptrustnaddr is not 'direct' or 'afterpic'\n");
if (currprefs.compnf!=1)
stop = 1, write_log ("JIT: compnf is not 'yes'\n");
if (currprefs.cachesize<1024)
stop = 1, write_log ("JIT: cachesize is less than 1024\n");
if (currprefs.comp_hardflush)
stop = 1, write_log ("JIT: comp_flushmode is 'hard'\n");
if (!canbang)
stop = 1, write_log ("JIT: Cannot use most direct memory access,\n"
" and unable to recover from failed guess!\n");
if (stop) {
gui_message("JIT: Configuration problems were detected!\n"
"JIT: These will adversely affect performance, and should\n"
"JIT: not be used. For more info, please see README.JIT-tuning\n"
"JIT: in the UAE documentation directory. You can force\n"
"JIT: your settings to be used by setting\n"
"JIT: 'compforcesettings=yes'\n"
"JIT: in your config file\n");
exit(1);
}
}
#endif
return changed; return changed;
} }
...@@ -577,7 +545,7 @@ STATIC_INLINE void emit_long(uae_u32 x) ...@@ -577,7 +545,7 @@ STATIC_INLINE void emit_long(uae_u32 x)
target+=4; target+=4;
} }
STATIC_INLINE uae_u32 reverse32 (uae_u32 oldv) STATIC_INLINE uae_u32 reverse32(uae_u32 oldv)
{ {
return ((oldv>>24)&0xff) | ((oldv>>8)&0xff00) | return ((oldv>>24)&0xff) | ((oldv>>8)&0xff00) |
((oldv<<8)&0xff0000) | ((oldv<<24)&0xff000000); ((oldv<<8)&0xff0000) | ((oldv<<24)&0xff000000);
...@@ -632,7 +600,7 @@ static void make_flags_live_internal(void) ...@@ -632,7 +600,7 @@ static void make_flags_live_internal(void)
return; return;
} }
jit_abort ("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n", jit_abort ("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n",
live.flags_in_flags, live.flags_on_stack); live.flags_in_flags,live.flags_on_stack);
} }
static void flags_to_stack(void) static void flags_to_stack(void)
......
...@@ -42,7 +42,7 @@ void consolehook_config (struct uae_prefs *p) ...@@ -42,7 +42,7 @@ void consolehook_config (struct uae_prefs *p)
p->fastmem_size = 0x00800000; p->fastmem_size = 0x00800000;
p->bogomem_size = 0; p->bogomem_size = 0;
p->nr_floppies = 1; p->nr_floppies = 1;
p->dfxtype[1] = DRV_NONE; p->floppyslots[1].dfxtype = DRV_NONE;
p->floppy_speed = 0; p->floppy_speed = 0;
p->start_gui = 0; p->start_gui = 0;
p->gfx_size_win.width = 320; p->gfx_size_win.width = 320;
......
...@@ -2504,6 +2504,7 @@ static void finish_decisions (void) ...@@ -2504,6 +2504,7 @@ static void finish_decisions (void)
decide_line (hpos); decide_line (hpos);
decide_fetch (hpos); decide_fetch (hpos);
record_color_change2 (hsyncstartpos, 0xffff, 0);
if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) {
if (fetch_state != fetch_not_started) { if (fetch_state != fetch_not_started) {
write_log ("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n", write_log ("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n",
...@@ -2747,7 +2748,7 @@ void init_hz (void) ...@@ -2747,7 +2748,7 @@ void init_hz (void)
hzc = 1; hzc = 1;
if (beamcon0 != new_beamcon0) { if (beamcon0 != new_beamcon0) {
write_log ("BEAMCON0 %04x -> %04x\n", beamcon0, new_beamcon0); write_log ("BEAMCON0 %04x -> %04x\n", beamcon0, new_beamcon0);
vpos_count = 0; vpos_count = vpos_count_prev = 0;
} }
beamcon0 = new_beamcon0; beamcon0 = new_beamcon0;
isntsc = (beamcon0 & 0x20) ? 0 : 1; isntsc = (beamcon0 & 0x20) ? 0 : 1;
...@@ -2774,7 +2775,7 @@ void init_hz (void) ...@@ -2774,7 +2775,7 @@ void init_hz (void)
if (vpos_count < 10) if (vpos_count < 10)
vpos_count = 10; vpos_count = 10;
vblank_hz = (15600 + vpos_count - 1) / vpos_count; vblank_hz = (15600 + vpos_count - 1) / vpos_count;
maxvpos_nom = vpos_count; maxvpos_nom = vpos_count - (lof_current ? 1 : 0);
reset_drawing (); reset_drawing ();
} }
if (beamcon0 & 0x80) { if (beamcon0 & 0x80) {
...@@ -2816,7 +2817,7 @@ void init_hz (void) ...@@ -2816,7 +2817,7 @@ void init_hz (void)
else else
hsyncstartpos = maxhpos + hbstrt; hsyncstartpos = maxhpos + hbstrt;
} else { } else {
hsyncstartpos = maxhpos_short + 7; hsyncstartpos = maxhpos_short + 13;
} }
eventtab[ev_hsync].oldcycles = get_cycles (); eventtab[ev_hsync].oldcycles = get_cycles ();
eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME; eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME;
...@@ -3120,7 +3121,8 @@ STATIC_INLINE uae_u16 VHPOSR (void) ...@@ -3120,7 +3121,8 @@ STATIC_INLINE uae_u16 VHPOSR (void)
static int test_copper_dangerous (unsigned int address) static int test_copper_dangerous (unsigned int address)
{ {
if ((address & 0x1fe) < ((copcon & 2) ? ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 0 : 0x40) : 0x80)) { int addr = address & 0x01fe;
if (addr < ((copcon & 2) ? ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 0 : 0x40) : 0x80)) {
cop_state.state = COP_stop; cop_state.state = COP_stop;
copper_enabled_thisline = 0; copper_enabled_thisline = 0;
unset_special (SPCFLAG_COPPER); unset_special (SPCFLAG_COPPER);
...@@ -4250,7 +4252,7 @@ static int custom_wput_copper (int hpos, uaecptr addr, uae_u32 value, int noget) ...@@ -4250,7 +4252,7 @@ static int custom_wput_copper (int hpos, uaecptr addr, uae_u32 value, int noget)
int v; int v;
#ifdef DEBUG #ifdef DEBUG
debug_wputpeekdma (0xdff000 + addr, value); value = debug_wputpeekdma (0xdff000 + addr, value);
#endif #endif
copper_access = 1; copper_access = 1;
v = custom_wput_1 (hpos, addr, value, noget); v = custom_wput_1 (hpos, addr, value, noget);
...@@ -5110,6 +5112,7 @@ static void vsync_handler (void) ...@@ -5110,6 +5112,7 @@ static void vsync_handler (void)
picasso_handle_vsync (); picasso_handle_vsync ();
#endif #endif
audio_vsync (); audio_vsync ();
blkdev_vsync ();
if (quit_program > 0) { if (quit_program > 0) {
/* prevent possible infinite loop at wait_cycles().. */ /* prevent possible infinite loop at wait_cycles().. */
...@@ -5378,6 +5381,8 @@ static void events_dmal (int hp) ...@@ -5378,6 +5381,8 @@ static void events_dmal (int hp)
} }
event2_newevent2 (hp, dmal_hpos + ((dmal & 2) ? 1 : 0), dmal_func); event2_newevent2 (hp, dmal_hpos + ((dmal & 2) ? 1 : 0), dmal_func);
dmal &= ~3; dmal &= ~3;
} else if (currprefs.cachesize) {
dmal_func2 (0);
} else { } else {
event2_newevent2 (hp, 17, dmal_func2); event2_newevent2 (hp, 17, dmal_func2);
} }
...@@ -5642,9 +5647,9 @@ static void hsync_handler (void) ...@@ -5642,9 +5647,9 @@ static void hsync_handler (void)
} }
while (input_recording < 0 && inprec_pstart (INPREC_DISKINSERT)) { while (input_recording < 0 && inprec_pstart (INPREC_DISKINSERT)) {
int drv = inprec_pu8 (); int drv = inprec_pu8 ();
inprec_pstr (currprefs.df[drv]); inprec_pstr (currprefs.floppyslots[drv].df);
_tcscpy (changed_prefs.df[drv], currprefs.df[drv]); _tcscpy (changed_prefs.floppyslots[drv].df, currprefs.floppyslots[drv].df);
disk_insert_force (drv, currprefs.df[drv]); disk_insert_force (drv, currprefs.floppyslots[drv].df);
inprec_pend (); inprec_pend ();
} }
#endif #endif
...@@ -5830,6 +5835,7 @@ void customreset (int hardreset) ...@@ -5830,6 +5835,7 @@ void customreset (int hardreset)
unset_special (~(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE)); unset_special (~(SPCFLAG_BRK | SPCFLAG_MODE_CHANGE));
vpos = 0; vpos = 0;
vpos_count = vpos_count_prev = 0;
inputdevice_reset (); inputdevice_reset ();
timehack_alive = 0; timehack_alive = 0;
...@@ -5848,7 +5854,6 @@ void customreset (int hardreset) ...@@ -5848,7 +5854,6 @@ void customreset (int hardreset)
diwstate = DIW_waiting_start; diwstate = DIW_waiting_start;
set_cycles (0); set_cycles (0);
vpos_count = vpos_count_prev = 0;
dmal = 0; dmal = 0;
init_hz (); init_hz ();
vpos_lpen = -1; vpos_lpen = -1;
......
...@@ -337,6 +337,28 @@ static int checkvaltype (TCHAR **c, uae_u32 *val) ...@@ -337,6 +337,28 @@ static int checkvaltype (TCHAR **c, uae_u32 *val)
return 0; return 0;
} }
static int readsize (int val, TCHAR **c)
{
if ((*c)[0] == '.') {
(*c)++;
TCHAR cc = _totupper ((*c)[0]);
(*c)++;
if (cc == 'B')
return 1;
if (cc == 'W')
return 2;
if (cc == '3')
return 3;
if (cc == 'L')
return 4;
}
if (val > 255 || val < -127)
return 2;
if (val > 65535 || val < -32767)
return 4;
return 1;
}
static uae_u32 readint (TCHAR **c) static uae_u32 readint (TCHAR **c)
{ {
uae_u32 val; uae_u32 val;
...@@ -351,6 +373,18 @@ static uae_u32 readhex (TCHAR **c) ...@@ -351,6 +373,18 @@ static uae_u32 readhex (TCHAR **c)
return val; return val;
return readhexx (c); return readhexx (c);
} }
static uae_u32 readint_s (TCHAR **c, int *size)
{
uae_u32 val = readint (c);
*size = readsize (val, c);
return val;
}
static uae_u32 readhex_s (TCHAR **c, int *size)
{
uae_u32 val = readhex (c);
*size = readsize (val, c);
return val;
}
static uae_u32 readbin (TCHAR **c) static uae_u32 readbin (TCHAR **c)
{ {
uae_u32 val; uae_u32 val;
...@@ -446,7 +480,7 @@ static uaecptr nextaddr2 (uaecptr addr, int *next) ...@@ -446,7 +480,7 @@ static uaecptr nextaddr2 (uaecptr addr, int *next)
uaecptr prev, prevx; uaecptr prev, prevx;
int size, sizex; int size, sizex;
if (addr >= lastaddr()) { if (addr >= lastaddr ()) {
*next = -1; *next = -1;
return 0xffffffff; return 0xffffffff;
} }
...@@ -505,10 +539,15 @@ static uaecptr nextaddr2 (uaecptr addr, int *next) ...@@ -505,10 +539,15 @@ static uaecptr nextaddr2 (uaecptr addr, int *next)
return addr; return addr;
} }
static uaecptr nextaddr (uaecptr addr, uaecptr *end) static uaecptr nextaddr (uaecptr addr, uaecptr last, uaecptr *end)
{ {
uaecptr paddr = addr; uaecptr paddr = addr;
int next; int next;
if (last && 0) {
if (addr >= last)
return 0xffffffff;
return addr + 1;
}
if (addr == 0xffffffff) { if (addr == 0xffffffff) {
if (end) if (end)
*end = currprefs.chipmem_size; *end = currprefs.chipmem_size;
...@@ -516,7 +555,7 @@ static uaecptr nextaddr (uaecptr addr, uaecptr *end) ...@@ -516,7 +555,7 @@ static uaecptr nextaddr (uaecptr addr, uaecptr *end)
} }
if (end) if (end)
next = *end; next = *end;
addr = nextaddr2(addr + 1, &next); addr = nextaddr2 (addr + 1, &next);
if (end) if (end)
*end = next; *end = next;
#if 0 #if 0
...@@ -1197,14 +1236,14 @@ static void deepcheatsearch (TCHAR **c) ...@@ -1197,14 +1236,14 @@ static void deepcheatsearch (TCHAR **c)
(*c)++; (*c)++;
} }
if (more_params (c)) if (more_params (c))
maxdiff = readint(c); maxdiff = readint (c);
if (!memtmp || v == 'S') { if (!memtmp || v == 'S') {
first = 1; first = 1;
xfree (memtmp); xfree (memtmp);
memsize = 0; memsize = 0;
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr (addr, &end)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, &end)) != 0xffffffff) {
memsize += end - addr; memsize += end - addr;
addr = end - 1; addr = end - 1;
} }
...@@ -1215,7 +1254,7 @@ static void deepcheatsearch (TCHAR **c) ...@@ -1215,7 +1254,7 @@ static void deepcheatsearch (TCHAR **c)
memset (memtmp + memsize, 0xff, memsize2); memset (memtmp + memsize, 0xff, memsize2);
p1 = memtmp; p1 = memtmp;
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr (addr, &end)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, &end)) != 0xffffffff) {
for (i = addr; i < end; i++) for (i = addr; i < end; i++)
*p1++ = get_byte (i); *p1++ = get_byte (i);
addr = end - 1; addr = end - 1;
...@@ -1235,7 +1274,7 @@ static void deepcheatsearch (TCHAR **c) ...@@ -1235,7 +1274,7 @@ static void deepcheatsearch (TCHAR **c)
addrcnt = 0; addrcnt = 0;
cnt = 0; cnt = 0;
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr (addr, NULL)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, NULL)) != 0xffffffff) {
uae_s32 b, b2; uae_s32 b, b2;
int doremove = 0; int doremove = 0;
int addroff = addrcnt >> 3; int addroff = addrcnt >> 3;
...@@ -1278,7 +1317,7 @@ static void deepcheatsearch (TCHAR **c) ...@@ -1278,7 +1317,7 @@ static void deepcheatsearch (TCHAR **c)
} else { } else {
p1[addrcnt] = b >> 8; p1[addrcnt] = b >> 8;
p1[addrcnt + 1] = b >> 0; p1[addrcnt + 1] = b >> 0;
addr = nextaddr (addr, NULL); addr = nextaddr (addr, 0, NULL);
if (addr == 0xffffffff) if (addr == 0xffffffff)
break; break;
addrcnt += 2; addrcnt += 2;
...@@ -1291,7 +1330,7 @@ static void deepcheatsearch (TCHAR **c) ...@@ -1291,7 +1330,7 @@ static void deepcheatsearch (TCHAR **c)
cnt = 0; cnt = 0;
addrcnt = 0; addrcnt = 0;
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr(addr, NULL)) != 0xffffffff) { while ((addr = nextaddr(addr, 0, NULL)) != 0xffffffff) {
int addroff = addrcnt >> 3; int addroff = addrcnt >> 3;
int addrmask = (size == 1 ? 1 : 3) << (addrcnt & 7); int addrmask = (size == 1 ? 1 : 3) << (addrcnt & 7);
if (p2[addroff] & addrmask) if (p2[addroff] & addrmask)
...@@ -1320,7 +1359,7 @@ static void cheatsearch (TCHAR **c) ...@@ -1320,7 +1359,7 @@ static void cheatsearch (TCHAR **c)
memsize = 0; memsize = 0;
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr (addr, &end)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, &end)) != 0xffffffff) {
memsize += end - addr; memsize += end - addr;
addr = end - 1; addr = end - 1;
} }
...@@ -1338,22 +1377,10 @@ static void cheatsearch (TCHAR **c) ...@@ -1338,22 +1377,10 @@ static void cheatsearch (TCHAR **c)
vlist = xcalloc (uae_u8, listsize >> 3); vlist = xcalloc (uae_u8, listsize >> 3);
return; return;
} }
if (first)
val = readint_s (c, &size);
else
val = readint (c); val = readint (c);
if (first) {
if (val > 255)
size = 2;
if (val > 65535)
size = 3;
if (val > 16777215)
size = 4;
}
ignore_ws (c);
if (more_params (c))
size = readint (c);
if (size > 4)
size = 4;
if (size < 1)
size = 1;
if (vlist == NULL) { if (vlist == NULL) {
listsize = memsize; listsize = memsize;
...@@ -1366,7 +1393,7 @@ static void cheatsearch (TCHAR **c) ...@@ -1366,7 +1393,7 @@ static void cheatsearch (TCHAR **c)
clearcheater (); clearcheater ();
addr = 0xffffffff; addr = 0xffffffff;
prevmemcnt = memcnt = 0; prevmemcnt = memcnt = 0;
while ((addr = nextaddr (addr, &end)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, &end)) != 0xffffffff) {
if (addr + size < end) { if (addr + size < end) {
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
int shift = (size - i - 1) * 8; int shift = (size - i - 1) * 8;
...@@ -1439,7 +1466,7 @@ static void illg_init (void) ...@@ -1439,7 +1466,7 @@ static void illg_init (void)
return; return;
} }
addr = 0xffffffff; addr = 0xffffffff;
while ((addr = nextaddr (addr, &end)) != 0xffffffff) { while ((addr = nextaddr (addr, 0, &end)) != 0xffffffff) {
if (end < 0x01000000) { if (end < 0x01000000) {
memset (illgdebug + addr, c, end - addr); memset (illgdebug + addr, c, end - addr);
} else { } else {
...@@ -1677,7 +1704,7 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp) ...@@ -1677,7 +1704,7 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
uae_u32 mask = (1 << (m->size * 8)) - 1; uae_u32 mask = (1 << (m->size * 8)) - 1;
int scnt = size; int scnt = size;
for (;;) { for (;;) {
if (((m->val & mask) & m->valmask) == ((val & mask) & m->valmask)) if (((m->val & mask) & m->val_mask) == ((val & mask) & m->val_mask))
trigger = 1; trigger = 1;
if (mask & 0x80000000) if (mask & 0x80000000)
break; break;
...@@ -1715,12 +1742,15 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp) ...@@ -1715,12 +1742,15 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
if (m->val_enabled) { if (m->val_enabled) {
int shift = addr - m->addr; int shift = addr - m->addr;
int max = 0; int max = 0;
if (m->val > 256) if (m->val_size == 2) {
max = 1; max = 1;
if (m->val > 65536) shift = 1 - ((addr - m->addr) & 1);
} else if (m->val_size == 4) {
max = 3; max = 3;
shift &= max; shift = 3 - ((addr - m->addr) & 3);
}
*valp = m->val >> ((max - shift) * 8); *valp = m->val >> ((max - shift) * 8);
return 1;
} }
return 0; return 0;
} }
...@@ -1870,18 +1900,20 @@ static uae_u8 *REGPARAM2 debug_xlate (uaecptr addr) ...@@ -1870,18 +1900,20 @@ static uae_u8 *REGPARAM2 debug_xlate (uaecptr addr)
return debug_mem_banks[munge24 (addr) >> 16]->xlateaddr (addr); return debug_mem_banks[munge24 (addr) >> 16]->xlateaddr (addr);
} }
void debug_wputpeekdma (uaecptr addr, uae_u32 v) uae_u16 debug_wputpeekdma (uaecptr addr, uae_u32 v)
{ {
if (!memwatch_enabled) if (!memwatch_enabled)
return; return v;
memwatch_func (addr, 2, 2, &v); memwatch_func (addr, 2, 2, &v);
return v;
} }
void debug_wgetpeekdma (uaecptr addr, uae_u32 v) uae_u16 debug_wgetpeekdma (uaecptr addr, uae_u32 v)
{ {
uae_u32 vv = v; uae_u32 vv = v;
if (!memwatch_enabled) if (!memwatch_enabled)
return; return v;
memwatch_func (addr, 1, 2, &vv); memwatch_func (addr, 1, 2, &vv);
return vv;
} }
void debug_putlpeek (uaecptr addr, uae_u32 v) void debug_putlpeek (uaecptr addr, uae_u32 v)
...@@ -2014,6 +2046,19 @@ int debug_bankchange (int mode) ...@@ -2014,6 +2046,19 @@ int debug_bankchange (int mode)
return -1; return -1;
} }
static TCHAR *getsizechar (int size)
{
if (size == 4)
return ".l";
if (size == 3)
return ".3";
if (size == 2)
return ".w";
if (size == 1)
return ".b";
return "";
}
void memwatch_dump2 (TCHAR *buf, int bufsize, int num) void memwatch_dump2 (TCHAR *buf, int bufsize, int num)
{ {
int i; int i;
...@@ -2120,7 +2165,7 @@ static void memwatch (TCHAR **c) ...@@ -2120,7 +2165,7 @@ static void memwatch (TCHAR **c)
mwn->size = 1; mwn->size = 1;
mwn->rwi = 7; mwn->rwi = 7;
mwn->val_enabled = 0; mwn->val_enabled = 0;
mwn->valmask = 0xffffffff; mwn->val_mask = 0xffffffff;
mwn->frozen = 0; mwn->frozen = 0;
mwn->modval_written = 0; mwn->modval_written = 0;
ignore_ws (c); ignore_ws (c);
...@@ -2153,7 +2198,7 @@ static void memwatch (TCHAR **c) ...@@ -2153,7 +2198,7 @@ static void memwatch (TCHAR **c)
} else if (_totupper (**c) == 'C') { } else if (_totupper (**c) == 'C') {
mwn->mustchange = 1; mwn->mustchange = 1;
} else { } else {
mwn->val = readhex (c); mwn->val = readhex_s (c, &mwn->val_size);
mwn->val_enabled = 1; mwn->val_enabled = 1;
} }
} }
...@@ -2174,17 +2219,8 @@ static void writeintomem (TCHAR **c) ...@@ -2174,17 +2219,8 @@ static void writeintomem (TCHAR **c)
ignore_ws(c); ignore_ws(c);
addr = readhex (c); addr = readhex (c);
ignore_ws(c); ignore_ws(c);
val = readhex (c); val = readhex_s (c, &len);
if (val > 0xffff)
len = 4;
else if (val > 0xff)
len = 2;
else
len = 1;
if (more_params (c)) {
ignore_ws (c);
len = readint (c);
}
if (len == 4) { if (len == 4) {
put_long (addr, val); put_long (addr, val);
cc = 'L'; cc = 'L';
...@@ -2598,7 +2634,7 @@ static void searchmem (TCHAR **cc) ...@@ -2598,7 +2634,7 @@ static void searchmem (TCHAR **cc)
endaddr = readhex (cc); endaddr = readhex (cc);
} }
console_out_f ("Searching from %08X to %08X..\n", addr, endaddr); console_out_f ("Searching from %08X to %08X..\n", addr, endaddr);
while ((addr = nextaddr (addr, NULL)) != 0xffffffff) { while ((addr = nextaddr (addr, endaddr, NULL)) != 0xffffffff) {
if (addr == endaddr) if (addr == endaddr)
break; break;
for (i = 0; i < sslen; i++) { for (i = 0; i < sslen; i++) {
...@@ -2865,7 +2901,7 @@ static void disk_debug (TCHAR **inptr) ...@@ -2865,7 +2901,7 @@ static void disk_debug (TCHAR **inptr)
disk_debug_mode |= DISK_DEBUG_PIO; disk_debug_mode |= DISK_DEBUG_PIO;
} }
if (more_params(inptr)) if (more_params(inptr))
disk_debug_track = readint(inptr); disk_debug_track = readint (inptr);
if (disk_debug_track < 0 || disk_debug_track > 2 * 83) if (disk_debug_track < 0 || disk_debug_track > 2 * 83)
disk_debug_track = -1; disk_debug_track = -1;
if (disk_debug_logging == 0) if (disk_debug_logging == 0)
...@@ -2893,7 +2929,7 @@ static void find_ea (TCHAR **inptr) ...@@ -2893,7 +2929,7 @@ static void find_ea (TCHAR **inptr)
end = readhex (inptr); end = readhex (inptr);
} }
console_out_f ("Searching from %08X to %08X\n", addr, end); console_out_f ("Searching from %08X to %08X\n", addr, end);
while((addr = nextaddr(addr, &end)) != 0xffffffff) { while((addr = nextaddr(addr, end, &end)) != 0xffffffff) {
if ((addr & 1) == 0 && addr + 6 <= end) { if ((addr & 1) == 0 && addr + 6 <= end) {
sea = 0xffffffff; sea = 0xffffffff;
dea = 0xffffffff; dea = 0xffffffff;
...@@ -3050,7 +3086,7 @@ static void debug_1 (void) ...@@ -3050,7 +3086,7 @@ static void debug_1 (void)
inptr++; inptr++;
inputdevice_logging = 1 | 2; inputdevice_logging = 1 | 2;
if (more_params (&inptr)) if (more_params (&inptr))
inputdevice_logging = readint(&inptr); inputdevice_logging = readint (&inptr);
console_out_f ("Input logging level %d\n", inputdevice_logging); console_out_f ("Input logging level %d\n", inputdevice_logging);
} else if (*inptr == 'm') { } else if (*inptr == 'm') {
memory_map_dump_2 (0); memory_map_dump_2 (0);
...@@ -3447,7 +3483,7 @@ void debug (void) ...@@ -3447,7 +3483,7 @@ void debug (void)
} }
inputdevice_unacquire (); inputdevice_unacquire ();
audio_pause (); pause_sound ();
do_skip = 0; do_skip = 0;
skipaddr_start = 0xffffffff; skipaddr_start = 0xffffffff;
skipaddr_end = 0xffffffff; skipaddr_end = 0xffffffff;
...@@ -3485,7 +3521,7 @@ void debug (void) ...@@ -3485,7 +3521,7 @@ void debug (void)
m68k_resumestopped (); m68k_resumestopped ();
debugging = 1; debugging = 1;
} }
audio_resume (); resume_sound ();
inputdevice_acquire (1); inputdevice_acquire (1);
} }
......
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* Emulates simple protection dongles * Emulates simple protection dongles
* *
* Copyright 2009 Toni Wilen * Copyright 2009 Toni Wilen
*/ */
#include "sysconfig.h" #include "sysconfig.h"
......
This diff is collapsed.
This diff is collapsed.
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*/ */
#ifdef ENFORCER #ifdef ENFORCER
#include <stdlib.h> #include <stdlib.h>
#include "sysconfig.h" #include "sysconfig.h"
...@@ -57,7 +56,7 @@ int enforcermode = 0; ...@@ -57,7 +56,7 @@ int enforcermode = 0;
static int enforcer_hit = 0; /* set to 1 if displaying the hit */ static int enforcer_hit = 0; /* set to 1 if displaying the hit */
#define ENFORCER_BUF_SIZE 8192 #define ENFORCER_BUF_SIZE 8192
static char enforcer_buf[ENFORCER_BUF_SIZE]; static TCHAR enforcer_buf[ENFORCER_BUF_SIZE];
uae_u32 (REGPARAM2 *saved_chipmem_lget) (uaecptr addr); uae_u32 (REGPARAM2 *saved_chipmem_lget) (uaecptr addr);
uae_u32 (REGPARAM2 *saved_chipmem_wget) (uaecptr addr); uae_u32 (REGPARAM2 *saved_chipmem_wget) (uaecptr addr);
...@@ -113,7 +112,7 @@ static uae_u8 *amiga2native (uae_u32 aptr, int size) ...@@ -113,7 +112,7 @@ static uae_u8 *amiga2native (uae_u32 aptr, int size)
addrbank bank = get_mem_bank (aptr); addrbank bank = get_mem_bank (aptr);
/* Check if the address can be translated to native */ /* Check if the address can be translated to native */
if (bank.check (aptr,size)) { if (bank.check (aptr, size)) {
return bank.xlateaddr (aptr); return bank.xlateaddr (aptr);
} }
return NULL; return NULL;
...@@ -134,7 +133,7 @@ static int enforcer_decode_hunk_and_offset (char *buf, uae_u32 pc) ...@@ -134,7 +133,7 @@ static int enforcer_decode_hunk_and_offset (char *buf, uae_u32 pc)
uae_u8 *native_string = amiga2native (string, 100); uae_u8 *native_string = amiga2native (string, 100);
if (native_string) { if (native_string) {
if (!strcmp ((char *) native_string, "SegTracker")) if (!strcmp ((char*)native_string, "SegTracker"))
break; break;
} }
node = amiga_node_next (node); node = amiga_node_next (node);
...@@ -264,7 +263,7 @@ static void enforcer_display_hit (const char *addressmode, uae_u32 pc, uaecptr a ...@@ -264,7 +263,7 @@ static void enforcer_display_hit (const char *addressmode, uae_u32 pc, uaecptr a
/* Segtracker output */ /* Segtracker output */
a7 = m68k_areg (regs, 7); a7 = m68k_areg (regs, 7);
if (get_long (a7-4) != pc) { if (get_long (a7 - 4) != pc) {
if (enforcer_decode_hunk_and_offset (buf, pc)) { if (enforcer_decode_hunk_and_offset (buf, pc)) {
_tcscpy (enforcer_buf_ptr, buf); _tcscpy (enforcer_buf_ptr, buf);
enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
...@@ -353,25 +352,25 @@ static void enforcer_display_hit (const char *addressmode, uae_u32 pc, uaecptr a ...@@ -353,25 +352,25 @@ static void enforcer_display_hit (const char *addressmode, uae_u32 pc, uaecptr a
} }
i--; i--;
for (; i>=0; i--) { for (; i >= 0; i--) {
strcpy (enforcer_buf_ptr,lines[i]); _tcscpy (enforcer_buf_ptr, lines[i]);
enforcer_buf_ptr += strlen (enforcer_buf_ptr); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
} }
/* Now the instruction after the pc including the pc */ /* Now the instruction after the pc including the pc */
temppc = pc; temppc = pc;
for (i=0; i < (INSTRUCTIONLINES+1) / 2; i++) { for (i = 0; i < (INSTRUCTIONLINES + 1) / 2; i++) {
sm68k_disasm (buf, instrcode, temppc, &nextpc); sm68k_disasm (buf, instrcode, temppc, &nextpc);
sprintf (enforcer_buf_ptr, "%08lx : %s %-20s %s\n", temppc, sprintf (enforcer_buf_ptr, "%08lx : %s %-20s %s\n", temppc,
(i == 0 ? "*" : " "), instrcode, buf); (i == 0 ? "*" : " "), instrcode, buf);
enforcer_buf_ptr += strlen (enforcer_buf_ptr); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
temppc = nextpc; temppc = nextpc;
} }
if (!native_task_name) if (!native_task_name)
native_task_name = "Unknown"; native_task_name = "Unknown";
sprintf (enforcer_buf_ptr, "Name: \"%s\"\n\n", native_task_name); sprintf (enforcer_buf_ptr, "Name: \"%s\"\n\n", native_task_name);
enforcer_buf_ptr += strlen (enforcer_buf_ptr); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr);
console_out (enforcer_buf); console_out (enforcer_buf);
write_log (enforcer_buf); write_log (enforcer_buf);
......
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* A "replacement" for a missing Kickstart * A "replacement" for a missing Kickstart
......
...@@ -1229,7 +1229,7 @@ static void allocate_expamem (void) ...@@ -1229,7 +1229,7 @@ static void allocate_expamem (void)
if (allocated_z3chipmem) { if (allocated_z3chipmem) {
z3chipmem = mapped_malloc (allocated_z3chipmem, "z3_chip"); z3chipmem = mapped_malloc (allocated_z3chipmem, "z3_chip");
if (z3chipmem == 0) { if (z3chipmem == 0) {
write_log ("Out of memory for 32 bit fake chip memory.\n"); write_log ("Out of memory for 32 bit chip memory.\n");
allocated_z3chipmem = 0; allocated_z3chipmem = 0;
} }
} }
...@@ -1503,7 +1503,7 @@ void expamem_reset (void) ...@@ -1503,7 +1503,7 @@ void expamem_reset (void)
card_map[cardno++] = expamem_map_clear; card_map[cardno++] = expamem_map_clear;
} }
if (cardno == 0) if (cardno == 0 || savestate_state)
expamem_init_clear_zero (); expamem_init_clear_zero ();
else else
(*card_init[0]) (); (*card_init[0]) ();
......
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* Gayle (and motherboard resources) memory bank * Gayle (and motherboard resources) memory bank
* *
* (c) 2006 - 2008 Toni Wilen * (c) 2006 - 2008 Toni Wilen
*/ */
#ifdef GAYLE #ifdef GAYLE
#define GAYLE_LOG 0 #define GAYLE_LOG 0
......
This diff is collapsed.
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* SDL keyboard driver which maps SDL cooked keysyms to raw * SDL keyboard driver which maps SDL cooked keysyms to raw
...@@ -343,6 +343,22 @@ static int decode_es (int keysym) ...@@ -343,6 +343,22 @@ static int decode_es (int keysym)
} }
} }
/*
* Handle keys specific to TR keymaps.
*/
static int decode_tr (int keysym)
{
switch (keysym) {
case SDLK_a: return AK_A;
case SDLK_m: return AK_M;
case SDLK_q: return AK_Q;
case SDLK_y: return AK_Y;
case SDLK_w: return AK_W;
case SDLK_z: return AK_Z;
default: return -1;
}
}
int keysym2amiga (int keysym) int keysym2amiga (int keysym)
{ {
int amiga_keycode = kc_decode (keysym); int amiga_keycode = kc_decode (keysym);
...@@ -363,6 +379,8 @@ int keysym2amiga (int keysym) ...@@ -363,6 +379,8 @@ int keysym2amiga (int keysym)
amiga_keycode = decode_it (keysym); break; amiga_keycode = decode_it (keysym); break;
case KBD_LANG_ES: case KBD_LANG_ES:
amiga_keycode = decode_es (keysym); break; amiga_keycode = decode_es (keysym); break;
case KBD_LANG_TR:
amiga_keycode = decode_tr (keysym); break;
} }
} }
return amiga_keycode; return amiga_keycode;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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