puae 2.3.0

parent 66f6641e
...@@ -362,13 +362,16 @@ static int get_standard_cd_unit2 (unsigned int csu) ...@@ -362,13 +362,16 @@ static int get_standard_cd_unit2 (unsigned int csu)
int unitnum = 0; int unitnum = 0;
int isaudio = 0; int isaudio = 0;
if (currprefs.cdslots[unitnum].name[0] || currprefs.cdslots[unitnum].inuse) { if (currprefs.cdslots[unitnum].name[0] || currprefs.cdslots[unitnum].inuse) {
device_func_init (SCSI_UNIT_IOCTL); if (currprefs.cdslots[unitnum].name[0]) {
if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) { device_func_init (SCSI_UNIT_IOCTL);
device_func_init (SCSI_UNIT_IMAGE); if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) {
if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu)) device_func_init (SCSI_UNIT_IMAGE);
goto fallback; if (!sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name, csu))
goto fallback;
}
} else {
goto fallback;
} }
getunitinfo (unitnum, 0, csu, &isaudio);
return unitnum; return unitnum;
} }
#ifdef _WIN32 #ifdef _WIN32
......
...@@ -1918,15 +1918,4 @@ void restore_cdtv_finish (void) ...@@ -1918,15 +1918,4 @@ void restore_cdtv_finish (void)
} }
#endif #endif
void cdtv_entergui (void)
{
if (cd_playing && !cd_paused)
write_comm_pipe_u32 (&requests, 0x102, 1);
}
void cdtv_exitgui (void)
{
if (cd_playing && !cd_paused)
write_comm_pipe_u32 (&requests, 0x103, 1);
}
#endif #endif
...@@ -3267,14 +3267,14 @@ static int cfgfile_handle_custom_event (TCHAR *custom, int mode) ...@@ -3267,14 +3267,14 @@ static int cfgfile_handle_custom_event (TCHAR *custom, int mode)
} }
#endif #endif
int cmdlineparser (TCHAR *s, TCHAR *outp[], int max) int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max)
{ {
int j; int j;
unsigned int cnt = 0; unsigned int cnt = 0;
int slash = 0; int slash = 0;
int quote = 0; int quote = 0;
TCHAR tmp1[MAX_DPATH]; TCHAR tmp1[MAX_DPATH];
TCHAR *prev; const TCHAR *prev;
int doout; int doout;
doout = 0; doout = 0;
......
...@@ -640,7 +640,7 @@ static void reset_drive (int num) ...@@ -640,7 +640,7 @@ static void reset_drive (int num)
static void update_drive_gui (int num) static void update_drive_gui (int num)
{ {
drive *drv = floppy + num; drive *drv = floppy + num;
bool writ = dskdmaen == 3 && drv->state && !(selected & (1 << num)); bool writ = dskdmaen == 3 && drv->state && !((selected | disabled) & (1 << num));
if (drv->state == gui_data.drive_motor[num] if (drv->state == gui_data.drive_motor[num]
&& drv->cyl == gui_data.drive_track[num] && drv->cyl == gui_data.drive_track[num]
...@@ -1166,7 +1166,7 @@ STATIC_INLINE int drive_empty (const drive * drv) ...@@ -1166,7 +1166,7 @@ STATIC_INLINE int drive_empty (const drive * drv)
return drv->diskfile == 0; return drv->diskfile == 0;
} }
static void drive_step (drive * drv) static void drive_step (drive * drv, int step_direction)
{ {
#ifdef CATWEASEL #ifdef CATWEASEL
if (drv->catweasel) { if (drv->catweasel) {
...@@ -1179,6 +1179,8 @@ static void drive_step (drive * drv) ...@@ -1179,6 +1179,8 @@ static void drive_step (drive * drv)
return; return;
} }
#endif #endif
if (!drive_empty (drv))
drv->dskchange = 0;
if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) { if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) {
if (disk_debug_logging > 1) if (disk_debug_logging > 1)
write_log (" step ignored drive %d, %d", write_log (" step ignored drive %d, %d",
...@@ -1190,9 +1192,7 @@ static void drive_step (drive * drv) ...@@ -1190,9 +1192,7 @@ static void drive_step (drive * drv)
* (stupid trackloaders with CPU delay loops) * (stupid trackloaders with CPU delay loops)
*/ */
set_steplimit (drv); set_steplimit (drv);
if (!drive_empty (drv)) if (step_direction) {
drv->dskchange = 0;
if (direction) {
if (drv->cyl) { if (drv->cyl) {
drv->cyl--; drv->cyl--;
#ifdef DRIVESOUND #ifdef DRIVESOUND
...@@ -2392,11 +2392,12 @@ static TCHAR *tobin (uae_u8 v) ...@@ -2392,11 +2392,12 @@ static TCHAR *tobin (uae_u8 v)
void DISK_select (uae_u8 data) void DISK_select (uae_u8 data)
{ {
unsigned int step_pulse, lastselected, dr; unsigned int step_pulse, prev_selected, dr;
static uae_u8 prevdata; static uae_u8 prev_data;
static unsigned int step; static unsigned int prev_step;
prev_selected = selected;
lastselected = selected;
selected = (data >> 3) & 15; selected = (data >> 3) & 15;
side = 1 - ((data >> 2) & 1); side = 1 - ((data >> 2) & 1);
direction = (data >> 1) & 1; direction = (data >> 1) & 1;
...@@ -2407,10 +2408,10 @@ void DISK_select (uae_u8 data) ...@@ -2407,10 +2408,10 @@ void DISK_select (uae_u8 data)
#ifdef AMAX #ifdef AMAX
if (currprefs.amaxromfile[0]) if (currprefs.amaxromfile[0])
amax_disk_select (data, prevdata); amax_disk_select (data, prev_data);
#endif #endif
if ((prevdata & 0x80) != (data & 0x80)) { if ((prev_data & 0x80) != (data & 0x80)) {
for (dr = 0; dr < 4; dr++) { for (dr = 0; dr < 4; dr++) {
if (floppy[dr].indexhackmode > 1 && !(selected & (1 << dr))) { if (floppy[dr].indexhackmode > 1 && !(selected & (1 << dr))) {
floppy[dr].indexhack = 1; floppy[dr].indexhack = 1;
...@@ -2422,42 +2423,44 @@ void DISK_select (uae_u8 data) ...@@ -2422,42 +2423,44 @@ void DISK_select (uae_u8 data)
if (disk_debug_logging > 1) { if (disk_debug_logging > 1) {
write_log (" %d%d%d%d% ", (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); write_log (" %d%d%d%d% ", (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1);
if ((prevdata & 0x80) != (data & 0x80)) if ((prev_data & 0x80) != (data & 0x80))
write_log (" dskmotor %d ", (data & 0x80) ? 1 : 0); write_log (" dskmotor %d ", (data & 0x80) ? 1 : 0);
if ((prevdata & 0x02) != (data & 0x02)) if ((prev_data & 0x02) != (data & 0x02))
write_log (" direct %d ", (data & 0x02) ? 1 : 0); write_log (" direct %d ", (data & 0x02) ? 1 : 0);
if ((prevdata & 0x04) != (data & 0x04)) if ((prev_data & 0x04) != (data & 0x04))
write_log (" side %d ", (data & 0x04) ? 1 : 0); write_log (" side %d ", (data & 0x04) ? 1 : 0);
} }
if (step != step_pulse) { // step goes high and drive was selected when step pulse changes: step
if (prev_step != step_pulse) {
if (disk_debug_logging > 1) if (disk_debug_logging > 1)
write_log (" dskstep %d ", step_pulse); write_log (" dskstep %d ", step_pulse);
step = step_pulse; prev_step = step_pulse;
if (step && !savestate_state) { if (prev_step && !savestate_state) {
for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
if (!((selected | disabled) & (1 << dr))) { if (!((prev_selected | disabled) & (1 << dr))) {
drive_step (floppy + dr); drive_step (floppy + dr, direction);
if (floppy[dr].indexhackmode > 1 && (data & 0x80)) if (floppy[dr].indexhackmode > 1 && (data & 0x80))
floppy[dr].indexhack = 1; floppy[dr].indexhack = 1;
} }
} }
} }
} }
if (!savestate_state) { if (!savestate_state) {
for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) {
drive *drv = floppy + dr; drive *drv = floppy + dr;
/* motor on/off workings tested with small assembler code on real Amiga 1200. */ /* motor on/off workings tested with small assembler code on real Amiga 1200. */
/* motor/id flipflop is set only when drive select goes from high to low */ /* motor/id flipflop is set only when drive select goes from high to low */
if (!(selected & (1 << dr)) && (lastselected & (1 << dr)) ) { if (!(selected & (1 << dr)) && (prev_selected & (1 << dr)) ) {
drv->drive_id_scnt++; drv->drive_id_scnt++;
drv->drive_id_scnt &= 31; drv->drive_id_scnt &= 31;
drv->idbit = (drv->drive_id & (1L << (31 - drv->drive_id_scnt))) ? 1 : 0; drv->idbit = (drv->drive_id & (1L << (31 - drv->drive_id_scnt))) ? 1 : 0;
if (!(disabled & (1 << dr))) { if (!(disabled & (1 << dr))) {
if ((prevdata & 0x80) == 0 || (data & 0x80) == 0) { if ((prev_data & 0x80) == 0 || (data & 0x80) == 0) {
/* motor off: if motor bit = 0 in prevdata or data -> turn motor on */ /* motor off: if motor bit = 0 in prevdata or data -> turn motor on */
drive_motor (drv, 0); drive_motor (drv, 0);
} else if (prevdata & 0x80) { } else if (prev_data & 0x80) {
/* motor on: if motor bit = 1 in prevdata only (motor flag state in data has no effect) /* motor on: if motor bit = 1 in prevdata only (motor flag state in data has no effect)
-> turn motor off */ -> turn motor off */
drive_motor (drv, 1); drive_motor (drv, 1);
...@@ -2477,7 +2480,7 @@ void DISK_select (uae_u8 data) ...@@ -2477,7 +2480,7 @@ void DISK_select (uae_u8 data)
floppy[dr].state = (!(selected & (1 << dr))) | !floppy[dr].motoroff; floppy[dr].state = (!(selected & (1 << dr))) | !floppy[dr].motoroff;
update_drive_gui (dr); update_drive_gui (dr);
} }
prevdata = data; prev_data = data;
if (disk_debug_logging > 1) if (disk_debug_logging > 1)
write_log ("\n"); write_log ("\n");
} }
......
...@@ -2329,7 +2329,8 @@ static void gen_opcode (unsigned long int opcode) ...@@ -2329,7 +2329,8 @@ static void gen_opcode (unsigned long int opcode)
fill_prefetch_full (); fill_prefetch_full ();
break; break;
case i_Bcc: case i_Bcc:
// bcc.s and bcc.w cycles confirmed // bcc.b branch: idle cycle, prefetch, prefetch
// bcc.b not branch: 2 idle cycles, prefetch
if (curi->size == sz_long) { if (curi->size == sz_long) {
if (cpu_level < 2) { if (cpu_level < 2) {
addcycles000 (2); addcycles000 (2);
......
...@@ -60,9 +60,6 @@ ...@@ -60,9 +60,6 @@
# endif # endif
#endif #endif
//#define hf_log write_log
//#define hf_log2 write_log
#define MAX_ASYNC_REQUESTS 50 #define MAX_ASYNC_REQUESTS 50
#define ASYNC_REQUEST_NONE 0 #define ASYNC_REQUEST_NONE 0
#define ASYNC_REQUEST_TEMP 1 #define ASYNC_REQUEST_TEMP 1
...@@ -1000,6 +997,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u ...@@ -1000,6 +997,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u
case 0x00: /* TEST UNIT READY */ case 0x00: /* TEST UNIT READY */
if (nodisk (hfd)) if (nodisk (hfd))
goto nodisk; goto nodisk;
scsi_len = 0;
break; break;
case 0x08: /* READ (6) */ case 0x08: /* READ (6) */
if (nodisk (hfd)) if (nodisk (hfd))
...@@ -1227,6 +1225,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u ...@@ -1227,6 +1225,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u
case 0x35: /* SYNCRONIZE CACHE (10) */ case 0x35: /* SYNCRONIZE CACHE (10) */
if (nodisk (hfd)) if (nodisk (hfd))
goto nodisk; goto nodisk;
scsi_len = 0;
break; break;
case 0xa8: /* READ (12) */ case 0xa8: /* READ (12) */
if (nodisk (hfd)) if (nodisk (hfd))
......
...@@ -7,8 +7,6 @@ extern void akiko_reset (void); ...@@ -7,8 +7,6 @@ extern void akiko_reset (void);
extern int akiko_init (void); extern int akiko_init (void);
extern void akiko_free (void); extern void akiko_free (void);
extern void akiko_entergui (void);
extern void akiko_exitgui (void);
extern void AKIKO_hsync_handler (void); extern void AKIKO_hsync_handler (void);
extern void akiko_mute (int); extern void akiko_mute (int);
......
...@@ -225,25 +225,7 @@ STATIC_INLINE void put_byte_ce020 (uaecptr addr, uae_u32 v) ...@@ -225,25 +225,7 @@ STATIC_INLINE void put_byte_ce020 (uaecptr addr, uae_u32 v)
mem_access_delay_byte_write_ce020 (addr, v); mem_access_delay_byte_write_ce020 (addr, v);
} }
extern void fill_icache020 (uae_u32); extern uae_u32 get_word_ce020_prefetch (int);
STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o)
{
uae_u32 pc = m68k_getpc () + o;
for (;;) {
if (pc == regs.prefetch020addr) {
uae_u32 v = regs.prefetch020data >> 16;
return v;
}
if (pc == regs.prefetch020addr + 2) {
uae_u32 v = regs.prefetch020data & 0xffff;
fill_icache020 (pc + 2);
return v;
}
fill_icache020 (pc);
}
}
STATIC_INLINE uae_u32 get_long_ce020_prefetch (int o) STATIC_INLINE uae_u32 get_long_ce020_prefetch (int o)
{ {
...@@ -281,7 +263,7 @@ STATIC_INLINE void m68k_do_rts_ce020 (void) ...@@ -281,7 +263,7 @@ STATIC_INLINE void m68k_do_rts_ce020 (void)
#ifdef CPUEMU_21 #ifdef CPUEMU_21
extern void fill_icache030 (uae_u32 addr); extern uae_u32 get_word_ce030_prefetch (int);
extern void write_dcache030 (uaecptr, uae_u32, int); extern void write_dcache030 (uaecptr, uae_u32, int);
extern uae_u32 read_dcache030 (uaecptr, int); extern uae_u32 read_dcache030 (uaecptr, int);
...@@ -313,24 +295,6 @@ STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr) ...@@ -313,24 +295,6 @@ STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr)
return read_dcache030 (addr, 0); return read_dcache030 (addr, 0);
} }
STATIC_INLINE uae_u32 get_word_ce030_prefetch (int o)
{
uae_u32 pc = m68k_getpc () + o;
for (;;) {
if (pc == regs.prefetch020addr) {
uae_u32 v = regs.prefetch020data >> 16;
return v;
}
if (pc == regs.prefetch020addr + 2) {
uae_u32 v = regs.prefetch020data & 0xffff;
fill_icache030 (pc + 2);
return v;
}
fill_icache030 (pc);
}
}
STATIC_INLINE uae_u32 get_long_ce030_prefetch (int o) STATIC_INLINE uae_u32 get_long_ce030_prefetch (int o)
{ {
uae_u32 v; uae_u32 v;
......
...@@ -84,6 +84,7 @@ typedef double fptype; ...@@ -84,6 +84,7 @@ typedef double fptype;
#endif #endif
#endif #endif
#define CPU_PIPELINE_MAX 2
#define CPU000_MEM_CYCLE 4 #define CPU000_MEM_CYCLE 4
#define CPU000_CLOCK_MULT 2 #define CPU000_CLOCK_MULT 2
#define CPU020_MEM_CYCLE 3 #define CPU020_MEM_CYCLE 3
...@@ -114,6 +115,7 @@ struct cache040 ...@@ -114,6 +115,7 @@ struct cache040
uae_u32 tag[CACHELINES040]; uae_u32 tag[CACHELINES040];
}; };
struct regstruct struct regstruct
{ {
uae_u32 regs[16]; uae_u32 regs[16];
...@@ -164,8 +166,8 @@ struct regstruct ...@@ -164,8 +166,8 @@ struct regstruct
uae_u8 panic; uae_u8 panic;
uae_u32 panic_pc, panic_addr; uae_u32 panic_pc, panic_addr;
uae_u32 prefetch020data; uae_u32 prefetch020data[CPU_PIPELINE_MAX];
uae_u32 prefetch020addr; uae_u32 prefetch020addr[CPU_PIPELINE_MAX];
int ce020memcycles; int ce020memcycles;
}; };
......
...@@ -398,6 +398,7 @@ struct uae_prefs { ...@@ -398,6 +398,7 @@ struct uae_prefs {
bool win32_alwaysontop; bool win32_alwaysontop;
bool win32_powersavedisabled; bool win32_powersavedisabled;
bool win32_minimize_inactive; bool win32_minimize_inactive;
int win32_statusbar;
int win32_active_priority; int win32_active_priority;
int win32_inactive_priority; int win32_inactive_priority;
...@@ -517,11 +518,11 @@ extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR ...@@ -517,11 +518,11 @@ extern int cfgfile_string (const TCHAR *option, const TCHAR *value, const TCHAR
extern TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file); extern TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *file);
extern TCHAR *target_expand_environment (const TCHAR *path); extern TCHAR *target_expand_environment (const TCHAR *path);
extern int target_parse_option (struct uae_prefs *, TCHAR *option, TCHAR *value); extern int target_parse_option (struct uae_prefs *, const TCHAR *option, const TCHAR *value);
/*extern void target_save_options (struct zfile*, struct uae_prefs *); /*extern void target_save_options (struct zfile*, struct uae_prefs *);
extern void target_default_options (struct uae_prefs *, int type); extern void target_default_options (struct uae_prefs *, int type);
extern void target_fixup_options (struct uae_prefs *); extern void target_fixup_options (struct uae_prefs *);
extern int target_cfgfile_load (struct uae_prefs *, TCHAR *filename, int type, int isdefault); extern int target_cfgfile_load (struct uae_prefs *, const TCHAR *filename, int type, int isdefault);
extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type); extern void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type);
extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig); extern int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ignorelink, int userconfig);
...@@ -537,8 +538,8 @@ extern uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR ...@@ -537,8 +538,8 @@ extern uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR
extern void cfgfile_addcfgparam (TCHAR *); extern void cfgfile_addcfgparam (TCHAR *);
extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck); extern int built_in_prefs (struct uae_prefs *p, int model, int config, int compa, int romcheck);
extern int built_in_chipset_prefs (struct uae_prefs *p); extern int built_in_chipset_prefs (struct uae_prefs *p);
extern int cmdlineparser (TCHAR *s, TCHAR *outp[], int max); extern int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max);
extern int cfgfile_configuration_change(int); extern int cfgfile_configuration_change (int);
extern void fixup_prefs_dimensions (struct uae_prefs *prefs); extern void fixup_prefs_dimensions (struct uae_prefs *prefs);
extern void fixup_prefs (struct uae_prefs *prefs); extern void fixup_prefs (struct uae_prefs *prefs);
extern void fixup_cpu (struct uae_prefs *prefs); extern void fixup_cpu (struct uae_prefs *prefs);
......
...@@ -642,7 +642,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv) ...@@ -642,7 +642,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv)
/* sam: if not found in $HOME then look in current directory */ /* sam: if not found in $HOME then look in current directory */
char *saved_path = strdup (optionsfile); char *saved_path = strdup (optionsfile);
strcpy (optionsfile, OPTIONSFILENAME); strcpy (optionsfile, OPTIONSFILENAME);
if (! target_cfgfile_load (&currprefs, optionsfile, 0, 0) ) { if (! target_cfgfile_load (&currprefs, optionsfile, 0) ) {
/* If not in current dir either, change path back to home /* If not in current dir either, change path back to home
* directory - so that a GUI can save a new config file there */ * directory - so that a GUI can save a new config file there */
strcpy (optionsfile, saved_path); strcpy (optionsfile, saved_path);
......
...@@ -215,6 +215,9 @@ static void set_cpu_caches (void) ...@@ -215,6 +215,9 @@ static void set_cpu_caches (void)
{ {
int i, j; int i, j;
for (i = 0; i < CPU_PIPELINE_MAX; i++)
regs.prefetch020addr[i] = 0xffffffff;
#ifdef JIT #ifdef JIT
if (currprefs.cachesize) { if (currprefs.cachesize) {
if (currprefs.cpu_model < 68040) { if (currprefs.cpu_model < 68040) {
...@@ -231,7 +234,6 @@ static void set_cpu_caches (void) ...@@ -231,7 +234,6 @@ static void set_cpu_caches (void)
if (regs.cacr & 0x08) { // clear instr cache if (regs.cacr & 0x08) { // clear instr cache
for (i = 0; i < CACHELINES020; i++) for (i = 0; i < CACHELINES020; i++)
caches020[i].valid = 0; caches020[i].valid = 0;
regs.prefetch020addr = 0xff000000;
} }
if (regs.cacr & 0x04) { // clear entry in instr cache if (regs.cacr & 0x04) { // clear entry in instr cache
caches020[(regs.caar >> 2) & (CACHELINES020 - 1)].valid = 0; caches020[(regs.caar >> 2) & (CACHELINES020 - 1)].valid = 0;
...@@ -247,7 +249,6 @@ static void set_cpu_caches (void) ...@@ -247,7 +249,6 @@ static void set_cpu_caches (void)
icaches030[i].valid[2] = 0; icaches030[i].valid[2] = 0;
icaches030[i].valid[3] = 0; icaches030[i].valid[3] = 0;
} }
regs.prefetch020addr = 0xff000000;
} }
if (regs.cacr & 0x04) { // clear entry in instr cache if (regs.cacr & 0x04) { // clear entry in instr cache
icaches030[(regs.caar >> 4) & (CACHELINES030 - 1)].valid[(regs.caar >> 2) & 3] = 0; icaches030[(regs.caar >> 4) & (CACHELINES030 - 1)].valid[(regs.caar >> 2) & 3] = 0;
...@@ -275,7 +276,6 @@ static void set_cpu_caches (void) ...@@ -275,7 +276,6 @@ static void set_cpu_caches (void)
caches040[i].valid[2] = 0; caches040[i].valid[2] = 0;
caches040[i].valid[3] = 0; caches040[i].valid[3] = 0;
} }
regs.prefetch020addr = 0xff000000;
} }
} }
} }
...@@ -4208,8 +4208,8 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr) ...@@ -4208,8 +4208,8 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr)
for (i = 0; i < CACHELINES040; i++) { for (i = 0; i < CACHELINES040; i++) {
if (c->valid[i] && c->tag[i] == tag) { if (c->valid[i] && c->tag[i] == tag) {
// cache hit // cache hit
regs.prefetch020addr = addr; regs.prefetch020addr[0] = addr;
regs.prefetch020data = c->data[i][lws]; regs.prefetch020data[0] = c->data[i][lws];
return; return;
} }
} }
...@@ -4224,13 +4224,13 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr) ...@@ -4224,13 +4224,13 @@ STATIC_INLINE void fill_cache040 (uae_u32 addr)
c->data[i][0] = data; c->data[i][0] = data;
} }
} }
regs.prefetch020addr = addr; regs.prefetch020addr[0] = addr;
regs.prefetch020data = data; regs.prefetch020data[0] = data;
} }
#ifdef CPUEMU_20 #ifdef CPUEMU_20
// this one is really simple and easy // this one is really simple and easy
void fill_icache020 (uae_u32 addr) STATIC_INLINE void fill_icache020 (uae_u32 addr, int idx)
{ {
int index; int index;
uae_u32 tag; uae_u32 tag;
...@@ -4243,8 +4243,8 @@ void fill_icache020 (uae_u32 addr) ...@@ -4243,8 +4243,8 @@ void fill_icache020 (uae_u32 addr)
c = &caches020[index]; c = &caches020[index];
if (c->valid && c->tag == tag) { if (c->valid && c->tag == tag) {
// cache hit // cache hit
regs.prefetch020addr = addr; regs.prefetch020addr[idx] = addr;
regs.prefetch020data = c->data; regs.prefetch020data[idx] = c->data;
return; return;
} }
// cache miss // cache miss
...@@ -4254,8 +4254,40 @@ void fill_icache020 (uae_u32 addr) ...@@ -4254,8 +4254,40 @@ void fill_icache020 (uae_u32 addr)
c->valid = !!(regs.cacr & 1); c->valid = !!(regs.cacr & 1);
c->data = data; c->data = data;
} }
regs.prefetch020addr = addr; regs.prefetch020addr[idx] = addr;
regs.prefetch020data = data; regs.prefetch020data[idx] = data;
}
uae_u32 get_word_ce020_prefetch (int o)
{
unsigned int i;
uae_u32 pc = m68k_getpc () + o;
for (;;) {
for (i = 0; i < 2; i++) {
if (pc == regs.prefetch020addr[0]) {
uae_u32 v = regs.prefetch020data[0] >> 16;
fill_icache020 (regs.prefetch020addr[0] + 4, 1);
return v;
}
if (pc == regs.prefetch020addr[0] + 2) {
uae_u32 v = regs.prefetch020data[0] & 0xffff;
if (regs.prefetch020addr[1] == regs.prefetch020addr[0] + 4) {
regs.prefetch020addr[0] = regs.prefetch020addr[1];
regs.prefetch020data[0] = regs.prefetch020data[1];
fill_icache020 (regs.prefetch020addr[0] + 4, 1);
} else {
fill_icache020 (pc + 4, 0);
fill_icache020 (regs.prefetch020addr[0] + 4, 1);
}
return v;
}
regs.prefetch020addr[0] = regs.prefetch020addr[1];
regs.prefetch020data[0] = regs.prefetch020data[1];
}
fill_icache020 (pc + 0, 0);
fill_icache020 (pc + 4, 1);
}
} }
// 68030 caches aren't so simple as 68020 cache.. // 68030 caches aren't so simple as 68020 cache..
...@@ -4284,7 +4316,7 @@ STATIC_INLINE void update_cache030 (struct cache030 *c, uae_u32 val, uae_u32 tag ...@@ -4284,7 +4316,7 @@ STATIC_INLINE void update_cache030 (struct cache030 *c, uae_u32 val, uae_u32 tag
c->data[lws] = val; c->data[lws] = val;
} }
void fill_icache030 (uae_u32 addr) STATIC_INLINE void fill_icache030 (uae_u32 addr, int idx)
{ {
int lws; int lws;
uae_u32 tag; uae_u32 tag;
...@@ -4295,8 +4327,8 @@ void fill_icache030 (uae_u32 addr) ...@@ -4295,8 +4327,8 @@ void fill_icache030 (uae_u32 addr)
c = getcache030 (icaches030, addr, &tag, &lws); c = getcache030 (icaches030, addr, &tag, &lws);
if (c->valid[lws] && c->tag == tag) { if (c->valid[lws] && c->tag == tag) {
// cache hit // cache hit
regs.prefetch020addr = addr; regs.prefetch020addr[idx] = addr;
regs.prefetch020data = c->data[lws]; regs.prefetch020data[idx] = c->data[lws];
return; return;
} }
// cache miss // cache miss
...@@ -4313,8 +4345,8 @@ void fill_icache030 (uae_u32 addr) ...@@ -4313,8 +4345,8 @@ void fill_icache030 (uae_u32 addr)
} }
#endif #endif
} }
regs.prefetch020addr = addr; regs.prefetch020addr[idx] = addr;
regs.prefetch020data = data; regs.prefetch020data[idx] = data;
} }
STATIC_INLINE bool cancache030 (uaecptr addr) STATIC_INLINE bool cancache030 (uaecptr addr)
...@@ -4462,6 +4494,39 @@ uae_u32 read_dcache030 (uaecptr addr, int size) ...@@ -4462,6 +4494,39 @@ uae_u32 read_dcache030 (uaecptr addr, int size)
return 0; return 0;
} }
uae_u32 get_word_ce030_prefetch (int o)
{
unsigned int i;
uae_u32 pc = m68k_getpc () + o;
for (;;) {
for (i = 0; i < 2; i++) {
if (pc == regs.prefetch020addr[0]) {
uae_u32 v = regs.prefetch020data[0] >> 16;
fill_icache030 (regs.prefetch020addr[0] + 4, 1);
return v;
}
if (pc == regs.prefetch020addr[0] + 2) {
uae_u32 v = regs.prefetch020data[0] & 0xffff;
if (regs.prefetch020addr[1] == regs.prefetch020addr[0] + 4) {
regs.prefetch020addr[0] = regs.prefetch020addr[1];
regs.prefetch020data[0] = regs.prefetch020data[1];
fill_icache030 (regs.prefetch020addr[0] + 4, 1);
} else {
fill_icache030 (pc + 4, 0);
fill_icache030 (regs.prefetch020addr[0] + 4, 1);
}
return v;
}
regs.prefetch020addr[0] = regs.prefetch020addr[1];
regs.prefetch020data[0] = regs.prefetch020data[1];
}
fill_icache030 (pc + 0, 0);
fill_icache030 (pc + 4, 1);
}
}
void flush_dcache (uaecptr addr, int size) void flush_dcache (uaecptr addr, int size)
{ {
if (!currprefs.cpu_cycle_exact) if (!currprefs.cpu_cycle_exact)
......
...@@ -138,7 +138,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p) ...@@ -138,7 +138,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p)
{ {
} }
int target_parse_option (struct uae_prefs *p, const char *option, const char *value) int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *value)
{ {
return 0; return 0;
} }
......
...@@ -107,7 +107,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p) ...@@ -107,7 +107,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p)
{ {
} }
int target_parse_option (struct uae_prefs *p, const char *option, const char *value) int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *value)
{ {
return 0; return 0;
} }
......
...@@ -56,7 +56,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) ...@@ -56,7 +56,7 @@ void target_save_options (struct zfile *f, struct uae_prefs *p)
{ {
} }
int target_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value) int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *value)
{ {
return 0; return 0;
} }
......
...@@ -395,7 +395,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p) ...@@ -395,7 +395,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p)
{ {
} }
int target_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value) int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *value)
{ {
return 0; return 0;
} }
......
...@@ -445,7 +445,7 @@ configure:4344: $? = 0 ...@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes configure:4344: result: yes
configure:4350: checking for _doprnt configure:4350: checking for _doprnt
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccySHNQU.o: In function `main': /tmp/ccVvVY5L.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt' /home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4350: $? = 1 configure:4350: $? = 1
...@@ -533,7 +533,7 @@ configure:4364: $? = 0 ...@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes configure:4364: result: yes
configure:4364: checking for strcmpi configure:4364: checking for strcmpi
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/cc4ZEZr9.o: In function `main': /tmp/ccRMTkaP.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
...@@ -613,7 +613,7 @@ configure: failed program was: ...@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no configure:4364: result: no
configure:4364: checking for stricmp configure:4364: checking for stricmp
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5 configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
/tmp/ccH9Ri3d.o: In function `main': /tmp/ccdxf26T.o: In function `main':
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp' /home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
collect2: ld returned 1 exit status collect2: ld returned 1 exit status
configure:4364: $? = 1 configure:4364: $? = 1
......
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