2.2.0 beta1

parent 61850f34
...@@ -6,7 +6,7 @@ dnl Updated and generally mauled 2008 Mustafa Tufan ...@@ -6,7 +6,7 @@ dnl Updated and generally mauled 2008 Mustafa Tufan
dnl dnl
AC_PREREQ(2.55) AC_PREREQ(2.55)
AC_INIT(PUAE, 2.1.0, ,puae) AC_INIT(PUAE, 2.2.0, ,puae)
AC_CONFIG_SRCDIR([bootstrap.sh]) AC_CONFIG_SRCDIR([bootstrap.sh])
AM_CONFIG_HEADER([src/sysconfig.h]) AM_CONFIG_HEADER([src/sysconfig.h])
AC_CANONICAL_TARGET AC_CANONICAL_TARGET
...@@ -750,10 +750,11 @@ fi ...@@ -750,10 +750,11 @@ fi
dnl dnl
dnl CPUEMU_12: 68000 CE cpu+blit dnl CPUEMU_12: 68000 CE cpu+blit
dnl CPUEMU_20: 68020+ CE + blit dnl CPUEMU_20: 68020+ CE + blit
dnl CPUEMU_21: 68030 (040/060) "cycle-exact" + blitter
dnl dnl
if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_12 -DCPUEMU_20" UAE_DEFINES="$UAE_DEFINES -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_21"
CPUOBJS="$CPUOBJS cpuemu_12.\$(OBJEXT) cpuemu_20.\$(OBJEXT)" CPUOBJS="$CPUOBJS cpuemu_12.\$(OBJEXT) cpuemu_20.\$(OBJEXT) cpuemu_21.\$(OBJEXT)"
fi fi
dnl dnl
......
...@@ -21,7 +21,7 @@ BUILT_SOURCES = \ ...@@ -21,7 +21,7 @@ BUILT_SOURCES = \
blit.h blitfunc.h blitfunc.c blittable.c \ blit.h blitfunc.h blitfunc.c blittable.c \
linetoscr.c \ linetoscr.c \
cpudefs.c \ cpudefs.c \
cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_31.c \ cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_21.c cpuemu_31.c \
cpustbl.c cputbl.h \ cpustbl.c cputbl.h \
compemu.c \ compemu.c \
compstbl.c comptbl.h compstbl.c comptbl.h
...@@ -29,7 +29,7 @@ BUILT_SOURCES = \ ...@@ -29,7 +29,7 @@ BUILT_SOURCES = \
CLEANFILES = \ CLEANFILES = \
blit.h blitfunc.h blitfunc.c blittable.c \ blit.h blitfunc.h blitfunc.c blittable.c \
cpudefs.c \ cpudefs.c \
cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_31.c \ cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_21.c cpuemu_31.c \
cpustbl.c cputbl.h \ cpustbl.c cputbl.h \
compemu.c \ compemu.c \
compstbl.c comptbl.h \ compstbl.c comptbl.h \
...@@ -218,6 +218,7 @@ cputbl.h: cpuemu_0.c ...@@ -218,6 +218,7 @@ cputbl.h: cpuemu_0.c
cpuemu_11.c: cpuemu_0.c cpuemu_11.c: cpuemu_0.c
cpuemu_12.c: cpuemu_0.c cpuemu_12.c: cpuemu_0.c
cpuemu_20.c: cpuemu_0.c cpuemu_20.c: cpuemu_0.c
cpuemu_21.c: cpuemu_0.c
cpuemu_31.c: cpuemu_0.c cpuemu_31.c: cpuemu_0.c
compemu.c: tools/gencomp compemu.c: tools/gencomp
......
...@@ -326,7 +326,7 @@ BUILT_SOURCES = \ ...@@ -326,7 +326,7 @@ BUILT_SOURCES = \
blit.h blitfunc.h blitfunc.c blittable.c \ blit.h blitfunc.h blitfunc.c blittable.c \
linetoscr.c \ linetoscr.c \
cpudefs.c \ cpudefs.c \
cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_31.c \ cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_21.c cpuemu_31.c \
cpustbl.c cputbl.h \ cpustbl.c cputbl.h \
compemu.c \ compemu.c \
compstbl.c comptbl.h compstbl.c comptbl.h
...@@ -334,7 +334,7 @@ BUILT_SOURCES = \ ...@@ -334,7 +334,7 @@ BUILT_SOURCES = \
CLEANFILES = \ CLEANFILES = \
blit.h blitfunc.h blitfunc.c blittable.c \ blit.h blitfunc.h blitfunc.c blittable.c \
cpudefs.c \ cpudefs.c \
cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_31.c \ cpuemu_0.c cpuemu_11.c cpuemu_12.c cpuemu_20.c cpuemu_21.c cpuemu_31.c \
cpustbl.c cputbl.h \ cpustbl.c cputbl.h \
compemu.c \ compemu.c \
compstbl.c comptbl.h \ compstbl.c comptbl.h \
...@@ -1021,6 +1021,7 @@ cputbl.h: cpuemu_0.c ...@@ -1021,6 +1021,7 @@ cputbl.h: cpuemu_0.c
cpuemu_11.c: cpuemu_0.c cpuemu_11.c: cpuemu_0.c
cpuemu_12.c: cpuemu_0.c cpuemu_12.c: cpuemu_0.c
cpuemu_20.c: cpuemu_0.c cpuemu_20.c: cpuemu_0.c
cpuemu_21.c: cpuemu_0.c
cpuemu_31.c: cpuemu_0.c cpuemu_31.c: cpuemu_0.c
compemu.c: tools/gencomp compemu.c: tools/gencomp
......
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
#ifdef DEBUG #ifdef DEBUG
#define write_log_debug write_log #define write_log_debug write_log
#else #else
#define write_log_debug(...) do {;} while(0) #define write_log_debug
#endif #endif
static TCHAR *cart_memnames[] = { NULL, "hrtmon", "arhrtmon", "superiv" }; static TCHAR *cart_memnames[] = { NULL, "hrtmon", "arhrtmon", "superiv" };
...@@ -266,7 +266,7 @@ static void cartridge_exit (void) ...@@ -266,7 +266,7 @@ static void cartridge_exit (void)
{ {
#ifdef PICASSO96 #ifdef PICASSO96
if (stored_picasso_on >= 0) if (stored_picasso_on >= 0)
picasso_requested_on = stored_picasso_on; picasso_requested_on = stored_picasso_on != 0;
stored_picasso_on = -1; stored_picasso_on = -1;
#endif #endif
} }
......
This diff is collapsed.
...@@ -66,7 +66,10 @@ static unsigned long ciaata_passed, ciaatb_passed, ciabta_passed, ciabtb_passed; ...@@ -66,7 +66,10 @@ static unsigned long ciaata_passed, ciaatb_passed, ciabta_passed, ciabtb_passed;
static unsigned long ciaatod, ciabtod, ciaatol, ciabtol, ciaaalarm, ciabalarm; static unsigned long ciaatod, ciabtod, ciaatol, ciabtol, ciaaalarm, ciabalarm;
static int ciaatlatch, ciabtlatch; static int ciaatlatch, ciabtlatch;
static int oldled, oldovl, oldcd32mute, led_changed; static bool oldled, oldovl, oldcd32mute;
static bool led;
static int led_old_brightness;
static unsigned long led_cycles_on, led_cycles_off, led_cycle;
unsigned int ciabpra; unsigned int ciabpra;
...@@ -531,37 +534,40 @@ void CIA_hsync_handler (int dotod) ...@@ -531,37 +534,40 @@ void CIA_hsync_handler (int dotod)
} }
} }
static int led_times;
static unsigned long led_on, led_cycle;
static void calc_led (int old_led) static void calc_led (int old_led)
{ {
unsigned long c = get_cycles (); unsigned long c = get_cycles ();
unsigned long t = c - led_cycle; unsigned long t = (c - led_cycle) / CYCLE_UNIT;
if (old_led) if (old_led)
led_on += t; led_cycles_on += t;
led_times++; else
led_cycles_off += t;
led_cycle = c; led_cycle = c;
} }
static void led_vsync (void) static void led_vsync (void)
{ {
gui_data.powerled_brightness = gui_data.powerled ? 255 : 0; int v;
calc_led (gui_data.powerled);
if (led_on > 0 && led_times > 2) { calc_led (led);
int v = led_on / CYCLE_UNIT * 256 / (maxhpos * maxvpos_nom); if (led_cycles_on && !led_cycles_off)
v = 255;
else if (led_cycles_off && !led_cycles_on)
v = 0;
else
v = led_cycles_on * 255 / led_cycles_off;
if (v < 0) if (v < 0)
v = 0; v = 0;
if (v > 255) if (v > 255)
v = 255; v = 255;
gui_data.powerled_brightness = v; gui_data.powerled_brightness = v;
} led_cycles_on = 0;
led_on = 0; led_cycles_off = 0;
led_times = 0; if (led_old_brightness != gui_data.powerled_brightness) {
if (led_changed) gui_data.powerled = gui_data.powerled_brightness > 127;
gui_led (LED_POWER, gui_data.powerled); gui_led (LED_POWER, gui_data.powerled);
led_changed = 0; }
led_old_brightness = gui_data.powerled_brightness;
led_cycle = get_cycles (); led_cycle = get_cycles ();
} }
...@@ -582,15 +588,14 @@ void CIA_vsync_handler (int dotod) ...@@ -582,15 +588,14 @@ void CIA_vsync_handler (int dotod)
static void bfe001_change (void) static void bfe001_change (void)
{ {
uae_u8 v = ciaapra; uae_u8 v = ciaapra;
int led; bool led2;
v |= ~ciaadra; /* output is high when pin's direction is input */ v |= ~ciaadra; /* output is high when pin's direction is input */
led = (v & 2) ? 0 : 1; led2 = (v & 2) ? 0 : 1;
if (led != oldled) { if (led2 != led) {
calc_led (oldled); calc_led (led);
oldled = led; led = led2;
gui_data.powerled = led; led_old_brightness = -1;
led_changed = 1;
led_filter_audio (); led_filter_audio ();
} }
if (currprefs.cs_ciaoverlay && (v & 1) != oldovl) { if (currprefs.cs_ciaoverlay && (v & 1) != oldovl) {
...@@ -1173,7 +1178,7 @@ void CIA_reset (void) ...@@ -1173,7 +1178,7 @@ void CIA_reset (void)
serbits = 0; serbits = 0;
oldovl = 1; oldovl = 1;
oldcd32mute = 1; oldcd32mute = 1;
oldled = -1; oldled = true;
resetwarning_phase = resetwarning_timer = 0; resetwarning_phase = resetwarning_timer = 0;
if (!savestate_state) { if (!savestate_state) {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#define NATMEM_OFFSETX (uae_u32)NATMEM_OFFSET #define NATMEM_OFFSETX (uae_u32)NATMEM_OFFSET
// %%% BRIAN KING WAS HERE %%% // %%% BRIAN KING WAS HERE %%%
extern int canbang; extern bool canbang;
#include <sys/mman.h> #include <sys/mman.h>
extern void jit_abort(const TCHAR*,...); extern void jit_abort(const TCHAR*,...);
compop_func *compfunctbl[65536]; compop_func *compfunctbl[65536];
...@@ -175,9 +175,9 @@ STATIC_INLINE blockinfo* get_blockinfo_addr(void* addr) ...@@ -175,9 +175,9 @@ STATIC_INLINE blockinfo* get_blockinfo_addr(void* addr)
blockinfo* bi=get_blockinfo(cacheline(addr)); blockinfo* bi=get_blockinfo(cacheline(addr));
while (bi) { while (bi) {
if (bi->pc_p==addr) if (bi->pc_p==addr)
return bi; return bi;
bi=bi->next_same_cl; bi=bi->next_same_cl;
} }
return NULL; return NULL;
} }
...@@ -192,21 +192,21 @@ STATIC_INLINE void remove_from_cl_list(blockinfo* bi) ...@@ -192,21 +192,21 @@ STATIC_INLINE void remove_from_cl_list(blockinfo* bi)
uae_u32 cl=cacheline(bi->pc_p); uae_u32 cl=cacheline(bi->pc_p);
if (bi->prev_same_cl_p) if (bi->prev_same_cl_p)
*(bi->prev_same_cl_p)=bi->next_same_cl; *(bi->prev_same_cl_p)=bi->next_same_cl;
if (bi->next_same_cl) if (bi->next_same_cl)
bi->next_same_cl->prev_same_cl_p=bi->prev_same_cl_p; bi->next_same_cl->prev_same_cl_p=bi->prev_same_cl_p;
if (cache_tags[cl+1].bi) if (cache_tags[cl+1].bi)
cache_tags[cl].handler=cache_tags[cl+1].bi->handler_to_use; cache_tags[cl].handler=cache_tags[cl+1].bi->handler_to_use;
else else
cache_tags[cl].handler=(cpuop_func*)popall_execute_normal; cache_tags[cl].handler=(cpuop_func*)popall_execute_normal;
} }
STATIC_INLINE void remove_from_list(blockinfo* bi) STATIC_INLINE void remove_from_list(blockinfo* bi)
{ {
if (bi->prev_p) if (bi->prev_p)
*(bi->prev_p)=bi->next; *(bi->prev_p)=bi->next;
if (bi->next) if (bi->next)
bi->next->prev_p=bi->prev_p; bi->next->prev_p=bi->prev_p;
} }
STATIC_INLINE void remove_from_lists(blockinfo* bi) STATIC_INLINE void remove_from_lists(blockinfo* bi)
...@@ -220,7 +220,7 @@ STATIC_INLINE void add_to_cl_list(blockinfo* bi) ...@@ -220,7 +220,7 @@ STATIC_INLINE void add_to_cl_list(blockinfo* bi)
uae_u32 cl=cacheline(bi->pc_p); uae_u32 cl=cacheline(bi->pc_p);
if (cache_tags[cl+1].bi) if (cache_tags[cl+1].bi)
cache_tags[cl+1].bi->prev_same_cl_p=&(bi->next_same_cl); cache_tags[cl+1].bi->prev_same_cl_p=&(bi->next_same_cl);
bi->next_same_cl=cache_tags[cl+1].bi; bi->next_same_cl=cache_tags[cl+1].bi;
cache_tags[cl+1].bi=bi; cache_tags[cl+1].bi=bi;
...@@ -238,7 +238,7 @@ STATIC_INLINE void raise_in_cl_list(blockinfo* bi) ...@@ -238,7 +238,7 @@ STATIC_INLINE void raise_in_cl_list(blockinfo* bi)
STATIC_INLINE void add_to_active(blockinfo* bi) STATIC_INLINE void add_to_active(blockinfo* bi)
{ {
if (active) if (active)
active->prev_p=&(bi->next); active->prev_p=&(bi->next);
bi->next=active; bi->next=active;
active=bi; active=bi;
...@@ -248,7 +248,7 @@ STATIC_INLINE void add_to_active(blockinfo* bi) ...@@ -248,7 +248,7 @@ STATIC_INLINE void add_to_active(blockinfo* bi)
STATIC_INLINE void add_to_dormant(blockinfo* bi) STATIC_INLINE void add_to_dormant(blockinfo* bi)
{ {
if (dormant) if (dormant)
dormant->prev_p=&(bi->next); dormant->prev_p=&(bi->next);
bi->next=dormant; bi->next=dormant;
dormant=bi; dormant=bi;
...@@ -258,9 +258,9 @@ STATIC_INLINE void add_to_dormant(blockinfo* bi) ...@@ -258,9 +258,9 @@ STATIC_INLINE void add_to_dormant(blockinfo* bi)
STATIC_INLINE void remove_dep(dependency* d) STATIC_INLINE void remove_dep(dependency* d)
{ {
if (d->prev_p) if (d->prev_p)
*(d->prev_p)=d->next; *(d->prev_p)=d->next;
if (d->next) if (d->next)
d->next->prev_p=d->prev_p; d->next->prev_p=d->prev_p;
d->prev_p=NULL; d->prev_p=NULL;
d->next=NULL; d->next=NULL;
} }
...@@ -343,16 +343,16 @@ STATIC_INLINE void big_to_small_state(bigstate* b, smallstate* s) ...@@ -343,16 +343,16 @@ STATIC_INLINE void big_to_small_state(bigstate* b, smallstate* s)
int count=0; int count=0;
for (i=0;i<N_REGS;i++) { for (i=0;i<N_REGS;i++) {
s->nat[i].validsize=0; s->nat[i].validsize=0;
s->nat[i].dirtysize=0; s->nat[i].dirtysize=0;
if (b->nat[i].nholds) { if (b->nat[i].nholds) {
int index=b->nat[i].nholds-1; int index=b->nat[i].nholds-1;
int r=b->nat[i].holds[index]; int r=b->nat[i].holds[index];
s->nat[i].holds=r; s->nat[i].holds=r;
s->nat[i].validsize=b->state[r].validsize; s->nat[i].validsize=b->state[r].validsize;
s->nat[i].dirtysize=b->state[r].dirtysize; s->nat[i].dirtysize=b->state[r].dirtysize;
count++; count++;
} }
} }
write_log ("JIT: count=%d\n",count); write_log ("JIT: count=%d\n",count);
for (i=0;i<N_REGS;i++) { // FIXME --- don't do dirty yet for (i=0;i<N_REGS;i++) { // FIXME --- don't do dirty yet
...@@ -427,12 +427,13 @@ STATIC_INLINE void alloc_blockinfos(void) ...@@ -427,12 +427,13 @@ STATIC_INLINE void alloc_blockinfos(void)
/******************************************************************** /********************************************************************
* Preferences handling. This is just a convenient place to put it * * Preferences handling. This is just a convenient place to put it *
********************************************************************/ ********************************************************************/
extern int have_done_picasso; extern bool have_done_picasso;
int check_prefs_changed_comp (void) bool check_prefs_changed_comp (void)
{ {
int changed = 0; bool changed = 0;
static int cachesize_prev, comptrust_prev, canbang_prev; static int cachesize_prev, comptrust_prev;
static bool canbang_prev;
if (currprefs.comptrustbyte != changed_prefs.comptrustbyte || if (currprefs.comptrustbyte != changed_prefs.comptrustbyte ||
currprefs.comptrustword != changed_prefs.comptrustword || currprefs.comptrustword != changed_prefs.comptrustword ||
...@@ -2976,12 +2977,12 @@ MENDFUNC(3,mov_l_Rr,(R4 d, R4 s, IMM offset)) ...@@ -2976,12 +2977,12 @@ MENDFUNC(3,mov_l_Rr,(R4 d, R4 s, IMM offset))
MIDFUNC(3,mov_w_Rr,(R4 d, R2 s, IMM offset)) MIDFUNC(3,mov_w_Rr,(R4 d, R2 s, IMM offset))
{ {
if (isconst(d)) { if (isconst(d)) {
COMPCALL(mov_w_mr)(live.state[d].val+offset,s); COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return; return;
} }
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_w_Ri)(d,(uae_u16)live.state[s].val,offset); COMPCALL(mov_w_Ri)(d,(uae_u16)live.state[s].val,offset);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
...@@ -2996,12 +2997,12 @@ MENDFUNC(3,mov_w_Rr,(R4 d, R2 s, IMM offset)) ...@@ -2996,12 +2997,12 @@ MENDFUNC(3,mov_w_Rr,(R4 d, R2 s, IMM offset))
MIDFUNC(3,mov_b_Rr,(R4 d, R1 s, IMM offset)) MIDFUNC(3,mov_b_Rr,(R4 d, R1 s, IMM offset))
{ {
if (isconst(d)) { if (isconst(d)) {
COMPCALL(mov_b_mr)(live.state[d].val+offset,s); COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return; return;
} }
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_b_Ri)(d,(uae_u8)live.state[s].val,offset); COMPCALL(mov_b_Ri)(d,(uae_u8)live.state[s].val,offset);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
...@@ -3016,13 +3017,13 @@ MENDFUNC(3,mov_b_Rr,(R4 d, R1 s, IMM offset)) ...@@ -3016,13 +3017,13 @@ MENDFUNC(3,mov_b_Rr,(R4 d, R1 s, IMM offset))
MIDFUNC(3,lea_l_brr,(W4 d, R4 s, IMM offset)) MIDFUNC(3,lea_l_brr,(W4 d, R4 s, IMM offset))
{ {
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_l_ri)(d,live.state[s].val+offset); COMPCALL(mov_l_ri)(d,live.state[s].val+offset);
return; return;
} }
#if USE_OFFSET #if USE_OFFSET
if (d==s) { if (d==s) {
add_offset(d,offset); add_offset(d,offset);
return; return;
} }
#endif #endif
CLOBBER_LEA; CLOBBER_LEA;
...@@ -3053,8 +3054,8 @@ MIDFUNC(3,mov_l_bRr,(R4 d, R4 s, IMM offset)) ...@@ -3053,8 +3054,8 @@ MIDFUNC(3,mov_l_bRr,(R4 d, R4 s, IMM offset))
{ {
int dreg=d; int dreg=d;
if (isconst(d)) { if (isconst(d)) {
COMPCALL(mov_l_mr)(live.state[d].val+offset,s); COMPCALL(mov_l_mr)(live.state[d].val+offset,s);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
...@@ -3074,8 +3075,8 @@ MIDFUNC(3,mov_w_bRr,(R4 d, R2 s, IMM offset)) ...@@ -3074,8 +3075,8 @@ MIDFUNC(3,mov_w_bRr,(R4 d, R2 s, IMM offset))
int dreg=d; int dreg=d;
if (isconst(d)) { if (isconst(d)) {
COMPCALL(mov_w_mr)(live.state[d].val+offset,s); COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
...@@ -3092,8 +3093,8 @@ MIDFUNC(3,mov_b_bRr,(R4 d, R1 s, IMM offset)) ...@@ -3092,8 +3093,8 @@ MIDFUNC(3,mov_b_bRr,(R4 d, R1 s, IMM offset))
{ {
int dreg=d; int dreg=d;
if (isconst(d)) { if (isconst(d)) {
COMPCALL(mov_b_mr)(live.state[d].val+offset,s); COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
...@@ -3111,9 +3112,9 @@ MIDFUNC(1,gen_bswap_32,(RW4 r)) ...@@ -3111,9 +3112,9 @@ MIDFUNC(1,gen_bswap_32,(RW4 r))
int reg=r; int reg=r;
if (isconst(r)) { if (isconst(r)) {
uae_u32 oldv=live.state[r].val; uae_u32 oldv=live.state[r].val;
live.state[r].val=reverse32(oldv); live.state[r].val=reverse32(oldv);
return; return;
} }
CLOBBER_SW32; CLOBBER_SW32;
...@@ -3126,10 +3127,10 @@ MENDFUNC(1,gen_bswap_32,(RW4 r)) ...@@ -3126,10 +3127,10 @@ MENDFUNC(1,gen_bswap_32,(RW4 r))
MIDFUNC(1,gen_bswap_16,(RW2 r)) MIDFUNC(1,gen_bswap_16,(RW2 r))
{ {
if (isconst(r)) { if (isconst(r)) {
uae_u32 oldv=live.state[r].val; uae_u32 oldv=live.state[r].val;
live.state[r].val=((oldv>>8)&0xff) | ((oldv<<8)&0xff00) | live.state[r].val=((oldv>>8)&0xff) | ((oldv<<8)&0xff00) |
(oldv&0xffff0000); (oldv&0xffff0000);
return; return;
} }
CLOBBER_SW16; CLOBBER_SW16;
...@@ -3147,11 +3148,11 @@ MIDFUNC(2,mov_l_rr,(W4 d, R4 s)) ...@@ -3147,11 +3148,11 @@ MIDFUNC(2,mov_l_rr,(W4 d, R4 s))
int olds; int olds;
if (d==s) { /* How pointless! */ if (d==s) { /* How pointless! */
return; return;
} }
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_l_ri)(d,live.state[s].val); COMPCALL(mov_l_ri)(d,live.state[s].val);
return; return;
} }
#if USE_ALIAS #if USE_ALIAS
olds=s; olds=s;
...@@ -3186,8 +3187,8 @@ MENDFUNC(2,mov_l_rr,(W4 d, R4 s)) ...@@ -3186,8 +3187,8 @@ MENDFUNC(2,mov_l_rr,(W4 d, R4 s))
MIDFUNC(2,mov_l_mr,(IMM d, R4 s)) MIDFUNC(2,mov_l_mr,(IMM d, R4 s))
{ {
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_l_mi)(d,live.state[s].val); COMPCALL(mov_l_mi)(d,live.state[s].val);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
s=readreg(s,4); s=readreg(s,4);
...@@ -3201,8 +3202,8 @@ MENDFUNC(2,mov_l_mr,(IMM d, R4 s)) ...@@ -3201,8 +3202,8 @@ MENDFUNC(2,mov_l_mr,(IMM d, R4 s))
MIDFUNC(2,mov_w_mr,(IMM d, R2 s)) MIDFUNC(2,mov_w_mr,(IMM d, R2 s))
{ {
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_w_mi)(d,(uae_u16)live.state[s].val); COMPCALL(mov_w_mi)(d,(uae_u16)live.state[s].val);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
s=readreg(s,2); s=readreg(s,2);
...@@ -3225,8 +3226,8 @@ MENDFUNC(2,mov_w_rm,(W2 d, IMM s)) ...@@ -3225,8 +3226,8 @@ MENDFUNC(2,mov_w_rm,(W2 d, IMM s))
MIDFUNC(2,mov_b_mr,(IMM d, R1 s)) MIDFUNC(2,mov_b_mr,(IMM d, R1 s))
{ {
if (isconst(s)) { if (isconst(s)) {
COMPCALL(mov_b_mi)(d,(uae_u8)live.state[s].val); COMPCALL(mov_b_mi)(d,(uae_u8)live.state[s].val);
return; return;
} }
CLOBBER_MOV; CLOBBER_MOV;
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
#define SPRBORDER 0 #define SPRBORDER 0
STATIC_INLINE int nocustom (void) STATIC_INLINE bool nocustom (void)
{ {
if (picasso_on && currprefs.picasso96_nocustom) if (picasso_on && currprefs.picasso96_nocustom)
return 1; return 1;
...@@ -141,7 +141,9 @@ extern uae_u8* compiled_code; ...@@ -141,7 +141,9 @@ extern uae_u8* compiled_code;
int vpos; int vpos;
static int vpos_count, vpos_count_prev; static int vpos_count, vpos_count_prev;
static int lof_store, lof_current, lol; static int lof_store; // real bit in custom registers
static int lof_current; // what display device thinks
static int lol;
static int next_lineno, prev_lineno; static int next_lineno, prev_lineno;
static enum nln_how nextline_how; static enum nln_how nextline_how;
static int lof_changed = 0; static int lof_changed = 0;
...@@ -262,6 +264,7 @@ enum diw_states ...@@ -262,6 +264,7 @@ enum diw_states
int plffirstline, plflastline; int plffirstline, plflastline;
int plffirstline_total, plflastline_total; int plffirstline_total, plflastline_total;
static int autoscale_bordercolors;
int plfstrt_start, plfstrt, plfstop; int plfstrt_start, plfstrt, plfstop;
static int sprite_minx, sprite_maxx; static int sprite_minx, sprite_maxx;
static int first_bpl_vpos; static int first_bpl_vpos;
...@@ -841,7 +844,10 @@ STATIC_INLINE void compute_delay_offset (void) ...@@ -841,7 +844,10 @@ STATIC_INLINE void compute_delay_offset (void)
static void record_color_change2 (int hpos, int regno, unsigned long value) static void record_color_change2 (int hpos, int regno, unsigned long value)
{ {
curr_color_changes[next_color_change].linepos = hpos * 2; int pos = hpos * 2;
if (regno == 0x1000 + 0x10c)
pos++; // BPLCON4 change needs 1 lores pixel delay
curr_color_changes[next_color_change].linepos = pos;
curr_color_changes[next_color_change].regno = regno; curr_color_changes[next_color_change].regno = regno;
curr_color_changes[next_color_change++].value = value; curr_color_changes[next_color_change++].value = value;
curr_color_changes[next_color_change].regno = -1; curr_color_changes[next_color_change].regno = -1;
...@@ -1798,11 +1804,11 @@ static void start_bpl_dma (int hpos, int hstart) ...@@ -1798,11 +1804,11 @@ static void start_bpl_dma (int hpos, int hstart)
if (doflickerfix () && interlace_seen && !scandoubled_line) { if (doflickerfix () && interlace_seen && !scandoubled_line) {
int i; int i;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
prevbpl[lof_store][vpos][i] = bplptx[i]; prevbpl[lof_current][vpos][i] = bplptx[i];
if (!lof_store && (bplcon0 & 4)) if (!lof_current && (bplcon0 & 4))
bplpt[i] = prevbpl[1 - lof_store][vpos][i]; bplpt[i] = prevbpl[1 - lof_current][vpos][i];
if (!(bplcon0 & 4) || interlace_seen < 0) if (!(bplcon0 & 4) || interlace_seen < 0)
prevbpl[1 - lof_store][vpos][i] = prevbpl[lof_store][vpos][i] = 0; prevbpl[1 - lof_current][vpos][i] = prevbpl[lof_current][vpos][i] = 0;
} }
} }
...@@ -1936,12 +1942,20 @@ static void record_color_change (int hpos, int regno, unsigned long value) ...@@ -1936,12 +1942,20 @@ static void record_color_change (int hpos, int regno, unsigned long value)
} }
record_color_change2 (hpos, regno, value); record_color_change2 (hpos, regno, value);
if (regno == 0 && value != 0 && vpos >= 32) { if (regno == 0 && value != 0 && vpos >= 20) {
// autoscale if COLOR00 changes in top or bottom of screen // autoscale if COLOR00 changes in top or bottom of screen
if (vpos < first_planes_vpos || vpos < plffirstline_total) if (vpos >= minfirstline) {
plffirstline_total = first_planes_vpos = vpos - 2; int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
if (vpos > last_planes_vpos || vpos > plflastline_total) if (first_planes_vpos == 0)
plflastline_total = last_planes_vpos = vpos + 3; first_planes_vpos = vpos2 - 2;
if (plffirstline_total == maxvpos)
plffirstline_total = vpos2 - 2;
if (vpos2 > last_planes_vpos || vpos2 > plflastline_total)
plflastline_total = last_planes_vpos = vpos2 + 3;
autoscale_bordercolors = 0;
} else {
autoscale_bordercolors++;
}
} }
} }
...@@ -2699,7 +2713,7 @@ void compute_vsynctime (void) ...@@ -2699,7 +2713,7 @@ void compute_vsynctime (void)
#endif #endif
} }
if (currprefs.produce_sound > 1) if (currprefs.produce_sound > 1)
update_sound (fake_vblank_hz, (bplcon0 & 4) ? -1 : lof_current, islinetoggle ()); update_sound (fake_vblank_hz, (bplcon0 & 4) ? -1 : lof_store, islinetoggle ());
} }
...@@ -2723,7 +2737,7 @@ void init_hz (void) ...@@ -2723,7 +2737,7 @@ void init_hz (void)
int ovblank = vblank_hz; int ovblank = vblank_hz;
int hzc = 0; int hzc = 0;
if (vsync_switchmode (-1, 0) > 0) if (vsync_switchmode (-1, 0))
currprefs.gfx_avsync = changed_prefs.gfx_avsync = vsync_switchmode (-1, 0); currprefs.gfx_avsync = changed_prefs.gfx_avsync = vsync_switchmode (-1, 0);
if (!isvsync () && ((currprefs.chipset_refreshrate == 50 && !currprefs.ntscmode) || if (!isvsync () && ((currprefs.chipset_refreshrate == 50 && !currprefs.ntscmode) ||
...@@ -2915,8 +2929,8 @@ static uae_u32 REGPARAM2 timehack_helper (TrapContext *context) ...@@ -2915,8 +2929,8 @@ static uae_u32 REGPARAM2 timehack_helper (TrapContext *context)
timehack_alive = 10; timehack_alive = 10;
gettimeofday (&tv, NULL); gettimeofday (&tv, NULL);
put_long (m68k_areg (regs, 0), tv.tv_sec - (((365 * 8 + 2) * 24) * 60 * 60)); x_put_long (m68k_areg (regs, 0), tv.tv_sec - (((365 * 8 + 2) * 24) * 60 * 60));
put_long (m68k_areg (regs, 0) + 4, tv.tv_usec); x_put_long (m68k_areg (regs, 0) + 4, tv.tv_usec);
return 0; return 0;
#else #else
return 2; return 2;
...@@ -2997,7 +3011,7 @@ STATIC_INLINE uae_u16 VPOSR (void) ...@@ -2997,7 +3011,7 @@ STATIC_INLINE uae_u16 VPOSR (void)
if (hp + HPOS_OFFSET >= maxhpos) { if (hp + HPOS_OFFSET >= maxhpos) {
vp++; vp++;
if (vp >= maxvpos + lof_current) if (vp >= maxvpos + lof_store)
vp = 0; vp = 0;
} }
vp = (vp >> 8) & 7; vp = (vp >> 8) & 7;
...@@ -3017,12 +3031,12 @@ STATIC_INLINE uae_u16 VPOSR (void) ...@@ -3017,12 +3031,12 @@ STATIC_INLINE uae_u16 VPOSR (void)
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS)) if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
vp &= 1; vp &= 1;
vp = vp | (lof_current ? 0x8000 : 0) | csbit; vp = vp | (lof_store ? 0x8000 : 0) | csbit;
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
vp |= lol ? 0x80 : 0; vp |= lol ? 0x80 : 0;
#if 0 #if 0
if (M68K_GETPC < 0xf00000) if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000)
write_log ("VPOSR %04x at %08x\n", vp, M68K_GETPC); write_log (L"VPOSR %04x at %08x\n", vp, M68K_GETPC);
#endif #endif
if (currprefs.cpu_model >= 68020) if (currprefs.cpu_model >= 68020)
hsyncdelay (); hsyncdelay ();
...@@ -3035,9 +3049,9 @@ static void VPOSW (uae_u16 v) ...@@ -3035,9 +3049,9 @@ static void VPOSW (uae_u16 v)
if (M68K_GETPC < 0xf00000 || 1) if (M68K_GETPC < 0xf00000 || 1)
write_log ("VPOSW %04X PC=%08x\n", v, M68K_GETPC); write_log ("VPOSW %04X PC=%08x\n", v, M68K_GETPC);
#endif #endif
if (lof_current != ((v & 0x8000) ? 1 : 0)) { if (lof_store != ((v & 0x8000) ? 1 : 0)) {
lof_changed = 1; lof_changed = 1;
lof_current = (v & 0x8000) ? 1 : 0; lof_store = (v & 0x8000) ? 1 : 0;
} }
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
lol = (v & 0x0080) ? 1 : 0; lol = (v & 0x0080) ? 1 : 0;
...@@ -3070,7 +3084,7 @@ STATIC_INLINE uae_u16 VHPOSR (void) ...@@ -3070,7 +3084,7 @@ STATIC_INLINE uae_u16 VHPOSR (void)
if (hp >= maxhpos) { if (hp >= maxhpos) {
hp -= maxhpos; hp -= maxhpos;
vp++; vp++;
if (vp >= maxvpos + lof_current) if (vp >= maxvpos + lof_store)
vp = 0; vp = 0;
} }
hp += 1; hp += 1;
...@@ -3082,8 +3096,8 @@ STATIC_INLINE uae_u16 VHPOSR (void) ...@@ -3082,8 +3096,8 @@ STATIC_INLINE uae_u16 VHPOSR (void)
if (currprefs.cpu_model >= 68020) if (currprefs.cpu_model >= 68020)
hsyncdelay (); hsyncdelay ();
#if 0 #if 0
if (M68K_GETPC < 0xf00000 && (vpos >= maxhpos || vpos <= 1)) if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000)
write_log ("VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC); write_log ("VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC);
#endif #endif
return vp; return vp;
} }
...@@ -4728,7 +4742,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) ...@@ -4728,7 +4742,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos)
write_log ("%d:%d:SPR%d STOP\n", vpos, hpos, num); write_log ("%d:%d:SPR%d STOP\n", vpos, hpos, num);
#endif #endif
s->dmastate = 0; s->dmastate = 0;
#if 1 #if 0
if (vpos == s->vstop) { if (vpos == s->vstop) {
spr_arm (num, 0); spr_arm (num, 0);
//return; //return;
...@@ -4905,6 +4919,8 @@ static void init_hardware_frame (void) ...@@ -4905,6 +4919,8 @@ static void init_hardware_frame (void)
ddflastword_total = 0; ddflastword_total = 0;
plflastline_total = 0; plflastline_total = 0;
plffirstline_total = maxvpos; plffirstline_total = maxvpos;
plffirstline_total = maxvpos;
autoscale_bordercolors = 0;
for (i = 0; i < MAX_SPRITES; i++) for (i = 0; i < MAX_SPRITES; i++)
spr[i].ptxhpos = MAXHPOS; spr[i].ptxhpos = MAXHPOS;
} }
...@@ -5070,8 +5086,8 @@ static void vsync_handler (void) ...@@ -5070,8 +5086,8 @@ static void vsync_handler (void)
write_log ("vblank interrupt not cleared\n"); write_log ("vblank interrupt not cleared\n");
#endif #endif
if (bplcon0 & 4) if (bplcon0 & 4)
lof_current = lof_current ? 0 : 1; lof_store = lof_store ? 0 : 1;
lof_store = lof_current; lof_current = lof_store;
#ifdef PICASSO96 #ifdef PICASSO96
picasso_handle_vsync (); picasso_handle_vsync ();
...@@ -5317,6 +5333,12 @@ void hsync_handler (void) ...@@ -5317,6 +5333,12 @@ void hsync_handler (void)
if (islinetoggle ()) if (islinetoggle ())
lol ^= 1; lol ^= 1;
if (vpos == equ_vblank_endline + 1 && lof_current != lof_store) {
// argh, line=0 field decision was wrong, someone did
// something stupid and changed LOF
// lof_current = lof_store;
// don't really know what to do here exactly without corrupt display
}
maxhpos = maxhpos_short + lol; maxhpos = maxhpos_short + lol;
eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME; eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME;
...@@ -5359,7 +5381,7 @@ void hsync_handler (void) ...@@ -5359,7 +5381,7 @@ void hsync_handler (void)
vpos_count++; vpos_count++;
if (vpos >= maxvpos_total) if (vpos >= maxvpos_total)
vpos = 0; vpos = 0;
if (vpos == maxvpos + lof_current || vpos == maxvpos + lof_current + 1 || vpos_count >= MAXVPOS) { if (vpos == maxvpos + lof_store || vpos == maxvpos + lof_store + 1 || vpos_count >= MAXVPOS) {
// vpos_count >= MAXVPOS just to not crash if VPOSW writes prevent vsync completely // vpos_count >= MAXVPOS just to not crash if VPOSW writes prevent vsync completely
if ((bplcon0 & 8) && !lightpen_triggered) { if ((bplcon0 & 8) && !lightpen_triggered) {
vpos_lpen = vpos - 1; vpos_lpen = vpos - 1;
...@@ -5409,7 +5431,7 @@ void hsync_handler (void) ...@@ -5409,7 +5431,7 @@ void hsync_handler (void)
strobe = 0x38; strobe = 0x38;
else if (vpos < minfirstline) else if (vpos < minfirstline)
strobe = 0x3a; strobe = 0x3a;
else if (vpos + 1 == maxvpos + lof_current) else if (vpos + 1 == maxvpos + lof_store)
strobe = 0x38; strobe = 0x38;
else if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && lol) else if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && lol)
strobe = 0x3e; strobe = 0x3e;
...@@ -5442,7 +5464,7 @@ void hsync_handler (void) ...@@ -5442,7 +5464,7 @@ void hsync_handler (void)
} }
} else { } else {
#endif #endif
is_lastline = vpos + 1 == maxvpos + lof_current && currprefs.m68k_speed == -1; is_lastline = vpos + 1 == maxvpos + lof_store && currprefs.m68k_speed == -1;
#ifdef JIT #ifdef JIT
} }
#endif #endif
...@@ -5459,8 +5481,8 @@ void hsync_handler (void) ...@@ -5459,8 +5481,8 @@ void hsync_handler (void)
} else if (currprefs.gfx_linedbl && (doublescan <= 0 || interlace_seen > 0)) { } else if (currprefs.gfx_linedbl && (doublescan <= 0 || interlace_seen > 0)) {
lineno *= 2; lineno *= 2;
nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack; nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
if ((bplcon0 & 4) || (interlace_seen > 0 && !lof_store)) { if ((bplcon0 & 4) || (interlace_seen > 0 && !lof_current)) {
if (!lof_store) { if (!lof_current) {
lineno++; lineno++;
nextline_how = nln_lower; nextline_how = nln_lower;
} else { } else {
...@@ -6370,7 +6392,7 @@ uae_u8 *restore_custom (uae_u8 *src) ...@@ -6370,7 +6392,7 @@ uae_u8 *restore_custom (uae_u8 *src)
dsklen = RW; /* 024 DSKLEN */ dsklen = RW; /* 024 DSKLEN */
RW; /* 026 DSKDAT */ RW; /* 026 DSKDAT */
RW; /* 028 REFPTR */ RW; /* 028 REFPTR */
i = RW; lof_current = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080) ? 1 : 0; /* 02A VPOSW */ i = RW; lof_store = lof_current = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080) ? 1 : 0; /* 02A VPOSW */
RW; /* 02C VHPOSW */ RW; /* 02C VHPOSW */
COPCON (RW); /* 02E COPCON */ COPCON (RW); /* 02E COPCON */
RW; /* 030 SERDAT* */ RW; /* 030 SERDAT* */
...@@ -6528,7 +6550,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full) ...@@ -6528,7 +6550,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full)
SW (dsklen); /* 024 DSKLEN */ SW (dsklen); /* 024 DSKLEN */
SW (0); /* 026 DSKDAT */ SW (0); /* 026 DSKDAT */
SW (0); /* 028 REFPTR */ SW (0); /* 028 REFPTR */
SW ((lof_current ? 0x8001 : 0) | (lol ? 0x0080 : 0));/* 02A VPOSW */ SW ((lof_store ? 0x8001 : 0) | (lol ? 0x0080 : 0));/* 02A VPOSW */
SW (0); /* 02C VHPOSW */ SW (0); /* 02C VHPOSW */
SW (copcon); /* 02E COPCON */ SW (copcon); /* 02E COPCON */
SW (serper); /* 030 SERDAT * */ SW (serper); /* 030 SERDAT * */
...@@ -7018,7 +7040,7 @@ int is_cycle_ce (void) ...@@ -7018,7 +7040,7 @@ int is_cycle_ce (void)
#endif #endif
int ispal (void) bool ispal (void)
{ {
if (beamcon0 & 0x80) if (beamcon0 & 0x80)
return currprefs.ntscmode == 0; return currprefs.ntscmode == 0;
......
...@@ -112,7 +112,7 @@ typedef struct { ...@@ -112,7 +112,7 @@ typedef struct {
uae_u16 len; uae_u16 len;
uae_u32 offs; uae_u32 offs;
unsigned int bitlen, track; unsigned int bitlen, track;
unsigned int sync; uae_u16 sync;
image_tracktype type; image_tracktype type;
int revolutions; int revolutions;
} trackid; } trackid;
...@@ -143,10 +143,10 @@ typedef struct { ...@@ -143,10 +143,10 @@ typedef struct {
trackid writetrackdata[MAX_TRACKS]; trackid writetrackdata[MAX_TRACKS];
int buffered_cyl, buffered_side; int buffered_cyl, buffered_side;
unsigned int cyl; unsigned int cyl;
int motoroff; bool motoroff;
int motordelay; /* dskrdy needs some clock cycles before it changes after switching off motor */ int motordelay; /* dskrdy needs some clock cycles before it changes after switching off motor */
int state; bool state;
int wrprot; bool wrprot;
uae_u16 bigmfmbuf[0x4000 * DDHDMULT]; uae_u16 bigmfmbuf[0x4000 * DDHDMULT];
uae_u16 tracktiming[0x4000 * DDHDMULT]; uae_u16 tracktiming[0x4000 * DDHDMULT];
int multi_revolution; int multi_revolution;
...@@ -160,9 +160,9 @@ typedef struct { ...@@ -160,9 +160,9 @@ typedef struct {
int dmalen; int dmalen;
unsigned int num_tracks, write_num_tracks, num_secs; unsigned int num_tracks, write_num_tracks, num_secs;
unsigned int hard_num_cyls; unsigned int hard_num_cyls;
int dskchange; bool dskchange;
int dskchange_time; int dskchange_time;
int dskready; bool dskready;
int dskready_time; int dskready_time;
int dskready_down_time; int dskready_down_time;
int writtento; int writtento;
...@@ -636,7 +636,7 @@ static void reset_drive(int i) ...@@ -636,7 +636,7 @@ static void reset_drive(int i)
static void update_drive_gui (int num) static void update_drive_gui (int num)
{ {
drive *drv = floppy + num; drive *drv = floppy + num;
int writ = dskdmaen == 3 && drv->state && !(selected & (1 << num)); bool writ = dskdmaen == 3 && drv->state && !(selected & (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]
...@@ -651,7 +651,7 @@ static void update_drive_gui (int num) ...@@ -651,7 +651,7 @@ static void update_drive_gui (int num)
gui_data.drive_track[num] = drv->cyl; gui_data.drive_track[num] = drv->cyl;
gui_data.drive_side = side; gui_data.drive_side = side;
gui_data.drive_writing[num] = writ; gui_data.drive_writing[num] = writ;
gui_led (num + LED_DF0, gui_data.drive_motor[num]); gui_led (num + LED_DF0, (gui_data.drive_motor[num] ? 1 : 0) | (gui_data.drive_writing[num] ? 2 : 0));
} }
static void drive_fill_bigbuf (drive * drv,int); static void drive_fill_bigbuf (drive * drv,int);
...@@ -783,7 +783,7 @@ static struct zfile *getwritefile (const char *name, int *wrprot) ...@@ -783,7 +783,7 @@ static struct zfile *getwritefile (const char *name, int *wrprot)
static int iswritefileempty (const char *name) static int iswritefileempty (const char *name)
{ {
struct zfile *zf; struct zfile *zf;
int wrprot; bool wrprot;
uae_char buffer[8]; uae_char buffer[8];
trackid td[MAX_TRACKS]; trackid td[MAX_TRACKS];
unsigned int tracks, i, ret; unsigned int tracks, i, ret;
...@@ -806,7 +806,7 @@ static int iswritefileempty (const char *name) ...@@ -806,7 +806,7 @@ static int iswritefileempty (const char *name)
static int openwritefile (drive *drv, int create) static int openwritefile (drive *drv, int create)
{ {
int wrprot = 0; bool wrprot = 0;
drv->writediskfile = getwritefile (currprefs.df[drv - &floppy[0]], &wrprot); drv->writediskfile = getwritefile (currprefs.df[drv - &floppy[0]], &wrprot);
if (drv->writediskfile) { if (drv->writediskfile) {
...@@ -825,10 +825,10 @@ static int openwritefile (drive *drv, int create) ...@@ -825,10 +825,10 @@ static int openwritefile (drive *drv, int create)
return drv->writediskfile ? 1 : 0; return drv->writediskfile ? 1 : 0;
} }
static int diskfile_iswriteprotect (const char *fname, int *needwritefile, drive_type *drvtype) static bool diskfile_iswriteprotect (const char *fname, int *needwritefile, drive_type *drvtype)
{ {
struct zfile *zf1, *zf2; struct zfile *zf1, *zf2;
int wrprot1 = 0, wrprot2 = 1; bool wrprot1 = 0, wrprot2 = 1;
unsigned char buffer[25]; unsigned char buffer[25];
*needwritefile = 0; *needwritefile = 0;
...@@ -2065,11 +2065,11 @@ void disk_creatediskfile (char *name, int type, drive_type adftype, const char * ...@@ -2065,11 +2065,11 @@ void disk_creatediskfile (char *name, int type, drive_type adftype, const char *
} }
track_len = FLOPPY_WRITE_LEN * 2; track_len = FLOPPY_WRITE_LEN * 2;
if (adftype == 1 || adftype == 3) { if (adftype == 1 || adftype == 3) {
file_size *= 2; file_size *= 2;
track_len *= 2; track_len *= 2;
} else if (adftype == 4) { } else if (adftype == 4) {
file_size /= 2; file_size /= 2;
tracks /= 2; tracks /= 2;
} }
f = zfile_fopen (name, "wb", 0); f = zfile_fopen (name, "wb", 0);
...@@ -2454,7 +2454,7 @@ void DISK_select (uae_u8 data) ...@@ -2454,7 +2454,7 @@ void DISK_select (uae_u8 data)
} }
prevdata = data; prevdata = data;
if (disk_debug_logging > 1) if (disk_debug_logging > 1)
write_log ("\n"); write_log ("\n");
} }
uae_u8 DISK_status (void) uae_u8 DISK_status (void)
......
...@@ -69,8 +69,8 @@ static void lores_reset (void) ...@@ -69,8 +69,8 @@ static void lores_reset (void)
sprite_buffer_res++; sprite_buffer_res++;
} }
int aga_mode; /* mirror of chipset_mask & CSMASK_AGA */ bool aga_mode; /* mirror of chipset_mask & CSMASK_AGA */
int direct_rgb; bool direct_rgb;
/* The shift factor to apply when converting between Amiga coordinates and window /* The shift factor to apply when converting between Amiga coordinates and window
coordinates. Zero if the resolution is the same, positive if window coordinates coordinates. Zero if the resolution is the same, positive if window coordinates
...@@ -214,8 +214,8 @@ static uae_u32 plf_sprite_mask; ...@@ -214,8 +214,8 @@ static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 }; static int sbasecol[2] = { 16, 16 };
static int brdsprt, brdblank, brdblank_changed; static int brdsprt, brdblank, brdblank_changed;
int picasso_requested_on; bool picasso_requested_on;
int picasso_on; bool picasso_on;
uae_sem_t gui_sem; uae_sem_t gui_sem;
int inhibit_frame; int inhibit_frame;
...@@ -659,10 +659,6 @@ static void pfield_init_linetoscr (void) ...@@ -659,10 +659,6 @@ static void pfield_init_linetoscr (void)
} }
} }
STATIC_INLINE uae_u8 merge_2pixel8 (uae_u8 p1, uae_u8 p2)
{
return p1;
}
STATIC_INLINE uae_u16 merge_2pixel16 (uae_u16 p1, uae_u16 p2) STATIC_INLINE uae_u16 merge_2pixel16 (uae_u16 p1, uae_u16 p2)
{ {
uae_u16 v = ((((p1 >> xredcolor_s) & xredcolor_m) + ((p2 >> xredcolor_s) & xredcolor_m)) / 2) << xredcolor_s; uae_u16 v = ((((p1 >> xredcolor_s) & xredcolor_m) + ((p2 >> xredcolor_s) & xredcolor_m)) / 2) << xredcolor_s;
...@@ -678,29 +674,6 @@ STATIC_INLINE uae_u32 merge_2pixel32 (uae_u32 p1, uae_u32 p2) ...@@ -678,29 +674,6 @@ STATIC_INLINE uae_u32 merge_2pixel32 (uae_u32 p1, uae_u32 p2)
return v; return v;
} }
static void fill_line_8 (uae_u8 *buf, unsigned int start, unsigned int stop)
{
uae_u8 *b = (uae_u8 *)buf;
unsigned int i;
unsigned int rem = 0;
xcolnr col = brdblank ? 0 : colors_for_drawing.acolors[0];
while (((long)&b[start]) & 3) {
b[start++] = (uae_u8)col;
if (start == stop)
return;
}
if (((long)&b[stop]) & 3) {
rem = ((long)&b[stop]) & 3;
stop -= rem;
}
for (i = start; i < stop; i += 4) {
uae_u32 *b2 = (uae_u32 *)&b[i];
*b2 = col;
}
while (rem--)
b[stop++] = (uae_u8) col;
}
static void fill_line_16 (uae_u8 *buf, unsigned int start, unsigned int stop) static void fill_line_16 (uae_u8 *buf, unsigned int start, unsigned int stop)
{ {
uae_u16 *b = (uae_u16 *)buf; uae_u16 *b = (uae_u16 *)buf;
...@@ -736,7 +709,6 @@ static void pfield_do_fill_line (int start, int stop) ...@@ -736,7 +709,6 @@ static void pfield_do_fill_line (int start, int stop)
{ {
xlinecheck(start, stop); xlinecheck(start, stop);
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: fill_line_8 (xlinebuffer, start, stop); break;
case 2: fill_line_16 (xlinebuffer, start, stop); break; case 2: fill_line_16 (xlinebuffer, start, stop); break;
case 4: fill_line_32 (xlinebuffer, start, stop); break; case 4: fill_line_32 (xlinebuffer, start, stop); break;
} }
...@@ -1242,32 +1214,27 @@ static void pfield_do_linetoscr (int start, int stop) ...@@ -1242,32 +1214,27 @@ static void pfield_do_linetoscr (int start, int stop)
if (issprites) { if (issprites) {
if (res_shift == 0) { if (res_shift == 0) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_spr (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == 2) { } else if (res_shift == 2) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_stretch2_spr (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_stretch2_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch2_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch2_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch2_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == 1) { } else if (res_shift == 1) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_stretch1_spr (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_stretch1_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch1_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch1_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch1_spr (src_pixel, start, stop); break;
} }
} else if (res_shift == -1) { } else if (res_shift == -1) {
if (currprefs.gfx_lores_mode) { if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_shrink1f_spr (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_shrink1f_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1f_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1f_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1f_spr (src_pixel, start, stop); break;
} }
} else { } else {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_shrink1_spr (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_shrink1_spr (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1_spr (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1_spr (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1_spr (src_pixel, start, stop); break;
} }
...@@ -1276,32 +1243,27 @@ static void pfield_do_linetoscr (int start, int stop) ...@@ -1276,32 +1243,27 @@ static void pfield_do_linetoscr (int start, int stop)
} else { } else {
if (res_shift == 0) { if (res_shift == 0) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8 (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16 (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16 (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32 (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32 (src_pixel, start, stop); break;
} }
} else if (res_shift == 2) { } else if (res_shift == 2) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_stretch2 (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_stretch2 (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch2 (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch2 (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch2 (src_pixel, start, stop); break;
} }
} else if (res_shift == 1) { } else if (res_shift == 1) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_stretch1 (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_stretch1 (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_stretch1 (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_stretch1 (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_stretch1 (src_pixel, start, stop); break;
} }
} else if (res_shift == -1) { } else if (res_shift == -1) {
if (currprefs.gfx_lores_mode) { if (currprefs.gfx_lores_mode) {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_shrink1f (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_shrink1f (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1f (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1f (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1f (src_pixel, start, stop); break;
} }
} else { } else {
switch (gfxvidinfo.pixbytes) { switch (gfxvidinfo.pixbytes) {
case 1: src_pixel = linetoscr_8_shrink1 (src_pixel, start, stop); break;
case 2: src_pixel = linetoscr_16_shrink1 (src_pixel, start, stop); break; case 2: src_pixel = linetoscr_16_shrink1 (src_pixel, start, stop); break;
case 4: src_pixel = linetoscr_32_shrink1 (src_pixel, start, stop); break; case 4: src_pixel = linetoscr_32_shrink1 (src_pixel, start, stop); break;
} }
...@@ -1863,7 +1825,7 @@ static void pfield_expand_dp_bplcon (void) ...@@ -1863,7 +1825,7 @@ static void pfield_expand_dp_bplcon (void)
#endif #endif
} }
static int isham (uae_u16 bplcon0) static bool isham (uae_u16 bplcon0)
{ {
int p = GET_PLANES (bplcon0); int p = GET_PLANES (bplcon0);
if (!(bplcon0 & 0x800)) if (!(bplcon0 & 0x800))
...@@ -2297,6 +2259,7 @@ static int frame_res_cnt; ...@@ -2297,6 +2259,7 @@ static int frame_res_cnt;
static void init_drawing_frame (void) static void init_drawing_frame (void)
{ {
int i, maxline; int i, maxline;
#if 1
static int frame_res_old; static int frame_res_old;
if (FRAMES_UNTIL_RES_SWITCH > 0 && frame_res_old == frame_res * 2 + frame_res_lace) { if (FRAMES_UNTIL_RES_SWITCH > 0 && frame_res_old == frame_res * 2 + frame_res_lace) {
...@@ -2346,6 +2309,7 @@ static void init_drawing_frame (void) ...@@ -2346,6 +2309,7 @@ static void init_drawing_frame (void)
can_use_lores++; can_use_lores++;
lores_reset (); lores_reset ();
} }
#endif
init_hardware_for_drawing_frame (); init_hardware_for_drawing_frame ();
...@@ -2376,9 +2340,7 @@ static void init_drawing_frame (void) ...@@ -2376,9 +2340,7 @@ static void init_drawing_frame (void)
first_drawn_line = 32767; first_drawn_line = 32767;
first_block_line = last_block_line = NO_BLOCK; first_block_line = last_block_line = NO_BLOCK;
if (currprefs.test_drawing_speed) if (frame_redraw_necessary)
frame_redraw_necessary = 1;
else if (frame_redraw_necessary)
frame_redraw_necessary--; frame_redraw_necessary--;
center_image (); center_image ();
...@@ -2510,10 +2472,8 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u ...@@ -2510,10 +2472,8 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u
side = gui_data.drive_side; side = gui_data.drive_side;
} else if (led == LED_POWER) { } else if (led == LED_POWER) {
pos = 3; pos = 3;
//on = gui_data.powerled_brightness > 0;
on_rgb = ((gui_data.powerled_brightness * 10 / 16) + 0x33) << 16; on_rgb = ((gui_data.powerled_brightness * 10 / 16) + 0x33) << 16;
on = gui_data.powerled; on = 1;
//on_rgb = 0xcc0000;
off_rgb = 0x330000; off_rgb = 0x330000;
} else if (led == LED_CD) { } else if (led == LED_CD) {
pos = 5; pos = 5;
......
...@@ -131,7 +131,8 @@ uaecptr ROM_filesys_resname, ROM_filesys_resid; ...@@ -131,7 +131,8 @@ uaecptr ROM_filesys_resname, ROM_filesys_resid;
uaecptr ROM_filesys_diagentry; uaecptr ROM_filesys_diagentry;
uaecptr ROM_hardfile_resname, ROM_hardfile_resid; uaecptr ROM_hardfile_resname, ROM_hardfile_resid;
uaecptr ROM_hardfile_init; uaecptr ROM_hardfile_init;
int uae_boot_rom, uae_boot_rom_size; /* size = code size only */ bool uae_boot_rom;
int uae_boot_rom_size; /* size = code size only */
/* ********************************************************** */ /* ********************************************************** */
...@@ -395,14 +396,14 @@ static void expamem_init_cd32fmv (void) ...@@ -395,14 +396,14 @@ static void expamem_init_cd32fmv (void)
static uae_u32 fastmem_mask; static uae_u32 fastmem_mask;
static uae_u32 fastmem_lget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 fastmem_lget (uaecptr) REGPARAM;
static uae_u32 fastmem_wget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 fastmem_wget (uaecptr) REGPARAM;
static uae_u32 fastmem_bget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 fastmem_bget (uaecptr) REGPARAM;
static void fastmem_lput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 fastmem_lput (uaecptr, uae_u32) REGPARAM;
static void fastmem_wput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 fastmem_wput (uaecptr, uae_u32) REGPARAM;
static void fastmem_bput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 fastmem_bput (uaecptr, uae_u32) REGPARAM;
static int fastmem_check (uaecptr addr, uae_u32 size) REGPARAM; static int REGPARAM3 fastmem_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *fastmem_xlate (uaecptr addr) REGPARAM; static uae_u8 *REGPARAM3 fastmem_xlate (uaecptr addr) REGPARAM;
uaecptr fastmem_start; /* Determined by the OS */ uaecptr fastmem_start; /* Determined by the OS */
static uae_u8 *fastmemory; static uae_u8 *fastmemory;
...@@ -485,14 +486,14 @@ addrbank fastmem_bank = { ...@@ -485,14 +486,14 @@ addrbank fastmem_bank = {
* Catweasel ZorroII * Catweasel ZorroII
*/ */
static uae_u32 catweasel_lget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 catweasel_lget (uaecptr) REGPARAM;
static uae_u32 catweasel_wget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 catweasel_wget (uaecptr) REGPARAM;
static uae_u32 catweasel_bget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 catweasel_bget (uaecptr) REGPARAM;
static void catweasel_lput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 catweasel_lput (uaecptr, uae_u32) REGPARAM;
static void catweasel_wput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 catweasel_wput (uaecptr, uae_u32) REGPARAM;
static void catweasel_bput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 catweasel_bput (uaecptr, uae_u32) REGPARAM;
static int catweasel_check (uaecptr addr, uae_u32 size) REGPARAM; static int REGPARAM3 catweasel_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *catweasel_xlate (uaecptr addr) REGPARAM; static uae_u8 *REGPARAM3 catweasel_xlate (uaecptr addr) REGPARAM;
static uae_u32 catweasel_mask; static uae_u32 catweasel_mask;
static uae_u32 catweasel_start; static uae_u32 catweasel_start;
...@@ -614,12 +615,12 @@ static void expamem_init_catweasel (void) ...@@ -614,12 +615,12 @@ static void expamem_init_catweasel (void)
* This is very simple, the Amiga shouldn't be doing things with it. * This is very simple, the Amiga shouldn't be doing things with it.
*/ */
static uae_u32 filesys_lget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 filesys_lget (uaecptr) REGPARAM;
static uae_u32 filesys_wget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 filesys_wget (uaecptr) REGPARAM;
static uae_u32 filesys_bget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 filesys_bget (uaecptr) REGPARAM;
static void filesys_lput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 filesys_lput (uaecptr, uae_u32) REGPARAM;
static void filesys_wput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 filesys_wput (uaecptr, uae_u32) REGPARAM;
static void filesys_bput (uaecptr, uae_u32) REGPARAM; static void REGPARAM3 filesys_bput (uaecptr, uae_u32) REGPARAM;
static uae_u32 filesys_start; /* Determined by the OS */ static uae_u32 filesys_start; /* Determined by the OS */
uae_u8 *filesysory; uae_u8 *filesysory;
......
This diff is collapsed.
This diff is collapsed.
...@@ -463,10 +463,10 @@ int main (int argc, char *argv[]) ...@@ -463,10 +463,10 @@ int main (int argc, char *argv[])
do_bigendian = 0; do_bigendian = 0;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (argv[i][0] != '-') if (argv[i][0] != '-')
continue; continue;
if (argv[i][1] == 'b' && argv[i][2] == '\0') if (argv[i][1] == 'b' && argv[i][2] == '\0')
do_bigendian = 1; do_bigendian = 1;
} }
set_outfile (stdout); set_outfile (stdout);
...@@ -478,15 +478,15 @@ int main (int argc, char *argv[]) ...@@ -478,15 +478,15 @@ int main (int argc, char *argv[])
outln (" */"); outln (" */");
outln (""); outln ("");
for (bpp = DEPTH_8BPP; bpp <= DEPTH_MAX; bpp++) { for (bpp = DEPTH_16BPP; bpp <= DEPTH_MAX; bpp++) {
for (aga = 0; aga <= 1 ; aga++) { for (aga = 0; aga <= 1 ; aga++) {
if (aga && bpp == DEPTH_8BPP) if (aga && bpp == DEPTH_8BPP)
continue; continue;
for (spr = 0; spr <= 1; spr++) { for (spr = 0; spr <= 1; spr++) {
for (hmode = HMODE_NORMAL; hmode <= HMODE_MAX; hmode++) for (hmode = HMODE_NORMAL; hmode <= HMODE_MAX; hmode++)
out_linetoscr (bpp, hmode, aga, spr); out_linetoscr (bpp, hmode, aga, spr);
} }
} }
} }
return 0; return 0;
} }
...@@ -69,7 +69,7 @@ static int init_kb (void) ...@@ -69,7 +69,7 @@ static int init_kb (void)
get_key_info (&lastKeyInfo); get_key_info (&lastKeyInfo);
default_keyboard = uaekey_make_default_kbr (beos_keymap); default_keyboard = uaekey_make_default_kbr (beos_keymap);
inputdevice_setkeytranslation (default_keyboard); inputdevice_setkeytranslation (default_keyboard, kbmaps);
set_default_hotkeys (beos_hotkeys); set_default_hotkeys (beos_hotkeys);
return 1; return 1;
......
...@@ -2049,7 +2049,7 @@ static int init_kb (void) ...@@ -2049,7 +2049,7 @@ static int init_kb (void)
/* See if we support raw keys on this platform */ /* See if we support raw keys on this platform */
if ((keymap = get_default_raw_keymap (get_sdlgfx_type ())) != 0) { if ((keymap = get_default_raw_keymap (get_sdlgfx_type ())) != 0) {
inputdevice_setkeytranslation (keymap); inputdevice_setkeytranslation (keymap, kbmaps);
have_rawkeys = 1; have_rawkeys = 1;
} }
switch_keymaps (); switch_keymaps ();
......
...@@ -1685,7 +1685,7 @@ static int init_kb (void) ...@@ -1685,7 +1685,7 @@ static int init_kb (void)
{ {
if (currprefs.map_raw_keys) { if (currprefs.map_raw_keys) {
if (rawkeys_available) { if (rawkeys_available) {
inputdevice_setkeytranslation (raw_keyboard); inputdevice_setkeytranslation (raw_keyboard, kbmaps);
set_default_hotkeys (x11pc_hotkeys); set_default_hotkeys (x11pc_hotkeys);
write_log ("X11GFX: Enabling raw key-mapping.\n"); write_log ("X11GFX: Enabling raw key-mapping.\n");
} else { } else {
......
...@@ -519,7 +519,7 @@ extern void empty_optimizer(void); ...@@ -519,7 +519,7 @@ extern void empty_optimizer(void);
#define comp_get_ilong(o) do_get_mem_long((uae_u32 *)(comp_pc_p + (o))) #define comp_get_ilong(o) do_get_mem_long((uae_u32 *)(comp_pc_p + (o)))
/* Preferences handling */ /* Preferences handling */
int check_prefs_changed_comp (void); bool check_prefs_changed_comp (void);
struct blockinfo_t; struct blockinfo_t;
......
...@@ -216,16 +216,16 @@ STATIC_INLINE void put_long_ce020 (uaecptr addr, uae_u32 v) ...@@ -216,16 +216,16 @@ STATIC_INLINE void put_long_ce020 (uaecptr addr, uae_u32 v)
{ {
mem_access_delay_long_write_ce020 (addr, v); mem_access_delay_long_write_ce020 (addr, v);
} }
STATIC_INLINE void put_word_ce020 (uaecptr addr, uae_u16 v) STATIC_INLINE void put_word_ce020 (uaecptr addr, uae_u32 v)
{ {
mem_access_delay_word_write_ce020 (addr, v); mem_access_delay_word_write_ce020 (addr, v);
} }
STATIC_INLINE void put_byte_ce020 (uaecptr addr, uae_u8 v) 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_cache0x0 (uae_u32); extern void fill_icache020 (uae_u32);
STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o) STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o)
{ {
...@@ -238,10 +238,10 @@ STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o) ...@@ -238,10 +238,10 @@ STATIC_INLINE uae_u32 get_word_ce020_prefetch (int o)
} }
if (pc == regs.prefetch020addr + 2) { if (pc == regs.prefetch020addr + 2) {
uae_u32 v = regs.prefetch020data & 0xffff; uae_u32 v = regs.prefetch020data & 0xffff;
fill_cache0x0 (pc + 2); fill_icache020 (pc + 2);
return v; return v;
} }
fill_cache0x0 (pc); fill_icache020 (pc);
} }
} }
...@@ -265,8 +265,106 @@ STATIC_INLINE uae_u32 next_ilong_020ce (void) ...@@ -265,8 +265,106 @@ STATIC_INLINE uae_u32 next_ilong_020ce (void)
m68k_incpc (4); m68k_incpc (4);
return r; return r;
} }
STATIC_INLINE void m68k_do_bsr_ce020 (uaecptr oldpc, uae_s32 offset)
{
m68k_areg (regs, 7) -= 4;
put_long_ce020 (m68k_areg (regs, 7), oldpc);
m68k_incpc (offset);
}
STATIC_INLINE void m68k_do_rts_ce020 (void)
{
m68k_setpc (get_long_ce020 (m68k_areg (regs, 7)));
m68k_areg (regs, 7) += 4;
}
#endif #endif
#ifdef CPUEMU_21
extern void fill_icache030 (uae_u32 addr);
extern void write_dcache030 (uaecptr, uae_u32, int);
extern uae_u32 read_dcache030 (uaecptr, int);
STATIC_INLINE void put_long_ce030 (uaecptr addr, uae_u32 v)
{
write_dcache030 (addr, v, 2);
mem_access_delay_long_write_ce020 (addr, v);
}
STATIC_INLINE void put_word_ce030 (uaecptr addr, uae_u32 v)
{
write_dcache030 (addr, v, 1);
mem_access_delay_word_write_ce020 (addr, v);
}
STATIC_INLINE void put_byte_ce030 (uaecptr addr, uae_u32 v)
{
write_dcache030 (addr, v, 0);
mem_access_delay_byte_write_ce020 (addr, v);
}
STATIC_INLINE uae_u32 get_long_ce030 (uaecptr addr)
{
return read_dcache030 (addr, 2);
}
STATIC_INLINE uae_u32 get_word_ce030 (uaecptr addr)
{
return read_dcache030 (addr, 1);
}
STATIC_INLINE uae_u32 get_byte_ce030 (uaecptr addr)
{
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)
{
uae_u32 v;
v = get_word_ce030_prefetch (o) << 16;
v |= get_word_ce030_prefetch (o + 2);
return v;
}
STATIC_INLINE uae_u32 next_iword_030ce (void)
{
uae_u32 r = get_word_ce030_prefetch (0);
m68k_incpc (2);
return r;
}
STATIC_INLINE uae_u32 next_ilong_030ce (void)
{
uae_u32 r = get_long_ce030_prefetch (0);
m68k_incpc (4);
return r;
}
STATIC_INLINE void m68k_do_bsr_ce030 (uaecptr oldpc, uae_s32 offset)
{
m68k_areg (regs, 7) -= 4;
put_long_ce030 (m68k_areg (regs, 7), oldpc);
m68k_incpc (offset);
}
STATIC_INLINE void m68k_do_rts_ce030 (void)
{
m68k_setpc (get_long_ce030 (m68k_areg (regs, 7)));
m68k_areg (regs, 7) += 4;
}
#endif
#ifdef CPUEMU_12 #ifdef CPUEMU_12
STATIC_INLINE void ipl_fetch (void) STATIC_INLINE void ipl_fetch (void)
...@@ -294,6 +392,7 @@ STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr) ...@@ -294,6 +392,7 @@ STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr)
case CE_MEMBANK_CHIP: case CE_MEMBANK_CHIP:
return wait_cpu_cycle_read (addr, 1); return wait_cpu_cycle_read (addr, 1);
case CE_MEMBANK_FAST: case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
...@@ -307,6 +406,7 @@ STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr) ...@@ -307,6 +406,7 @@ STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr)
case CE_MEMBANK_CHIP: case CE_MEMBANK_CHIP:
return wait_cpu_cycle_read (addr, 0); return wait_cpu_cycle_read (addr, 0);
case CE_MEMBANK_FAST: case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
...@@ -321,6 +421,7 @@ STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v) ...@@ -321,6 +421,7 @@ STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v)
wait_cpu_cycle_write (addr, 0, v); wait_cpu_cycle_write (addr, 0, v);
return; return;
case CE_MEMBANK_FAST: case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
...@@ -335,12 +436,19 @@ STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v) ...@@ -335,12 +436,19 @@ STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v)
return; return;
break; break;
case CE_MEMBANK_FAST: case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
put_word (addr, v); put_word (addr, v);
} }
STATIC_INLINE uae_u32 get_long_ce (uaecptr addr)
{
uae_u32 v = mem_access_delay_word_read (addr) << 16;
v |= mem_access_delay_word_read (addr + 2);
return v;
}
STATIC_INLINE uae_u32 get_word_ce (uaecptr addr) STATIC_INLINE uae_u32 get_word_ce (uaecptr addr)
{ {
return mem_access_delay_word_read (addr); return mem_access_delay_word_read (addr);
...@@ -349,12 +457,10 @@ STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr) ...@@ -349,12 +457,10 @@ STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr)
{ {
return mem_access_delay_wordi_read (addr); return mem_access_delay_wordi_read (addr);
} }
STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr) STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr)
{ {
return mem_access_delay_byte_read (addr); return mem_access_delay_byte_read (addr);
} }
STATIC_INLINE uae_u32 get_word_ce_prefetch (int o) STATIC_INLINE uae_u32 get_word_ce_prefetch (int o)
{ {
uae_u32 v = regs.irc; uae_u32 v = regs.irc;
...@@ -362,12 +468,16 @@ STATIC_INLINE uae_u32 get_word_ce_prefetch (int o) ...@@ -362,12 +468,16 @@ STATIC_INLINE uae_u32 get_word_ce_prefetch (int o)
return v; return v;
} }
STATIC_INLINE void put_word_ce (uaecptr addr, uae_u16 v) STATIC_INLINE void put_long_ce (uaecptr addr, uae_u32 v)
{
mem_access_delay_word_write (addr, v >> 16);
mem_access_delay_word_write (addr + 2, v);
}
STATIC_INLINE void put_word_ce (uaecptr addr, uae_u32 v)
{ {
mem_access_delay_word_write (addr, v); mem_access_delay_word_write (addr, v);
} }
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u32 v)
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u8 v)
{ {
mem_access_delay_byte_write (addr, v); mem_access_delay_byte_write (addr, v);
} }
...@@ -400,5 +510,3 @@ STATIC_INLINE void m68k_do_jsr_ce (uaecptr oldpc, uaecptr dest) ...@@ -400,5 +510,3 @@ STATIC_INLINE void m68k_do_jsr_ce (uaecptr oldpc, uaecptr dest)
m68k_setpc (dest); m68k_setpc (dest);
} }
#endif #endif
...@@ -31,8 +31,8 @@ extern void init_row_map (void); ...@@ -31,8 +31,8 @@ extern void init_row_map (void);
extern void init_hz (void); extern void init_hz (void);
extern void init_custom (void); extern void init_custom (void);
extern int picasso_requested_on; extern bool picasso_requested_on;
extern int picasso_on; extern bool picasso_on;
extern void set_picasso_hack_rate (int hz); extern void set_picasso_hack_rate (int hz);
/* Set to 1 to leave out the current frame in average frame time calculation. /* Set to 1 to leave out the current frame in average frame time calculation.
...@@ -207,6 +207,6 @@ struct customhack { ...@@ -207,6 +207,6 @@ struct customhack {
void customhack_put (struct customhack *ch, uae_u16 v, int hpos); void customhack_put (struct customhack *ch, uae_u16 v, int hpos);
uae_u16 customhack_get (struct customhack *ch, int hpos); uae_u16 customhack_get (struct customhack *ch, int hpos);
extern void alloc_cycle_ext (int, int); extern void alloc_cycle_ext (int, int);
extern int ispal (void); extern bool ispal (void);
#define HSYNCTIME (maxhpos * CYCLE_UNIT); #define HSYNCTIME (maxhpos * CYCLE_UNIT);
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1)) #define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1))
extern int lores_factor, lores_shift, sprite_width, interlace_seen; extern int lores_factor, lores_shift, sprite_width, interlace_seen;
extern int aga_mode, direct_rgb; extern bool aga_mode, direct_rgb;
STATIC_INLINE int coord_hw_to_window_x (int x) STATIC_INLINE int coord_hw_to_window_x (int x)
{ {
...@@ -181,7 +181,7 @@ struct sprite_entry ...@@ -181,7 +181,7 @@ struct sprite_entry
unsigned short pos; unsigned short pos;
unsigned short max; unsigned short max;
unsigned int first_pixel; unsigned int first_pixel;
unsigned int has_attached; bool has_attached;
}; };
union sps_union { union sps_union {
...@@ -227,9 +227,9 @@ struct decision { ...@@ -227,9 +227,9 @@ struct decision {
#endif #endif
uae_u8 nr_planes; uae_u8 nr_planes;
uae_u8 bplres; uae_u8 bplres;
unsigned int ehb_seen; bool ehb_seen;
unsigned int ham_seen; bool ham_seen;
unsigned int ham_at_start; bool ham_at_start;
}; };
/* Anything related to changes in hw registers during the DDF for one /* Anything related to changes in hw registers during the DDF for one
......
...@@ -25,7 +25,7 @@ extern unsigned int gui_ledstate; ...@@ -25,7 +25,7 @@ extern unsigned int gui_ledstate;
extern void gui_display (int shortcut); extern void gui_display (int shortcut);
extern void gui_notify_state (int state); extern void gui_notify_state (int state);
extern int no_gui, quit_to_gui; extern bool no_gui, quit_to_gui;
#define LED_CD_ACTIVE 1 #define LED_CD_ACTIVE 1
#define LED_CD_ACTIVE2 2 #define LED_CD_ACTIVE2 2
......
This diff is collapsed.
...@@ -12,6 +12,5 @@ extern int keys_available (void); ...@@ -12,6 +12,5 @@ extern int keys_available (void);
extern int record_key (int); extern int record_key (int);
extern int record_key_direct (int); extern int record_key_direct (int);
extern void keybuf_init (void); extern void keybuf_init (void);
extern void joystick_setting_changed (void);
extern int getcapslockstate (void); extern int getcapslockstate (void);
extern void setcapslockstate (int); extern void setcapslockstate (int);
...@@ -21,7 +21,8 @@ extern void cache_free (uae_u8*); ...@@ -21,7 +21,8 @@ extern void cache_free (uae_u8*);
int init_shm (void); int init_shm (void);
void preinit_shm (void); void preinit_shm (void);
extern int canbang, candirect; extern bool canbang;
extern int candirect;
#endif #endif
#ifdef ADDRESS_SPACE_24BIT #ifdef ADDRESS_SPACE_24BIT
...@@ -66,10 +67,11 @@ extern uaecptr p96ram_start; ...@@ -66,10 +67,11 @@ extern uaecptr p96ram_start;
extern uaecptr fastmem_start; extern uaecptr fastmem_start;
extern uaecptr a3000lmem_start, a3000hmem_start; extern uaecptr a3000lmem_start, a3000hmem_start;
extern int ersatzkickfile; extern bool ersatzkickfile;
extern int cloanto_rom, kickstart_rom; extern bool cloanto_rom, kickstart_rom;
extern uae_u16 kickstart_version; extern uae_u16 kickstart_version;
extern int uae_boot_rom, uae_boot_rom_size; extern bool uae_boot_rom;
extern int uae_boot_rom_size;
extern uaecptr rtarea_base; extern uaecptr rtarea_base;
extern uae_u8* baseaddr[]; extern uae_u8* baseaddr[];
...@@ -104,7 +106,7 @@ typedef struct { ...@@ -104,7 +106,7 @@ typedef struct {
#define CE_MEMBANK_CHIP 1 #define CE_MEMBANK_CHIP 1
#define CE_MEMBANK_CIA 2 #define CE_MEMBANK_CIA 2
#define CE_MEMBANK_FAST16BIT 3 #define CE_MEMBANK_FAST16BIT 3
extern uae_u8 ce_banktype[65536]; extern uae_u8 ce_banktype[65536], ce_cachable[65536];
extern uae_u8 *filesysory; extern uae_u8 *filesysory;
extern uae_u8 *rtarea; extern uae_u8 *rtarea;
...@@ -136,7 +138,6 @@ extern void expamem_next (void); ...@@ -136,7 +138,6 @@ extern void expamem_next (void);
extern uae_u32 gfxmem_start; extern uae_u32 gfxmem_start;
extern uae_u8 *gfxmemory; extern uae_u8 *gfxmemory;
extern uae_u32 gfxmem_mask; extern uae_u32 gfxmem_mask;
extern int address_space_24;
extern uae_u16 last_custom_value1; extern uae_u16 last_custom_value1;
/* Default memory access functions */ /* Default memory access functions */
......
...@@ -47,8 +47,8 @@ extern int fpp_movem_index2[256]; ...@@ -47,8 +47,8 @@ extern int fpp_movem_index2[256];
extern int fpp_movem_next[256]; extern int fpp_movem_next[256];
#endif #endif
typedef unsigned long cpuop_func (uae_u32) REGPARAM; typedef unsigned long REGPARAM3 cpuop_func (uae_u32) REGPARAM;
typedef void cpuop_func_ce (uae_u32) REGPARAM; typedef void REGPARAM3 cpuop_func_ce (uae_u32) REGPARAM;
struct cputbl { struct cputbl {
cpuop_func *handler; cpuop_func *handler;
...@@ -65,7 +65,7 @@ struct comptbl { ...@@ -65,7 +65,7 @@ struct comptbl {
}; };
#endif #endif
extern unsigned long op_illg (uae_u32) REGPARAM; extern unsigned long REGPARAM3 op_illg (uae_u32) REGPARAM;
typedef uae_u8 flagtype; typedef uae_u8 flagtype;
...@@ -94,13 +94,22 @@ struct cache020 ...@@ -94,13 +94,22 @@ struct cache020
{ {
uae_u32 data; uae_u32 data;
uae_u32 tag; uae_u32 tag;
uae_u32 valid:1; bool valid;
}; };
#define CACHELINES030 16
struct cache030
{
uae_u32 data[4];
bool valid[4];
uae_u32 tag;
};
#define CACHESETS040 64 #define CACHESETS040 64
struct cache040set struct cache040set
{ {
uae_u32 data[4]; uae_u32 data[4];
int valid[4]; bool valid[4];
uae_u32 tag; uae_u32 tag;
}; };
#define CACHELINES040 4 #define CACHELINES040 4
...@@ -206,8 +215,11 @@ STATIC_INLINE uaecptr m68k_getpc_p (uae_u8 *p) ...@@ -206,8 +215,11 @@ STATIC_INLINE uaecptr m68k_getpc_p (uae_u8 *p)
return (uaecptr)(regs.pc + ((uae_u8*)p - (uae_u8*)regs.pc_oldp)); return (uaecptr)(regs.pc + ((uae_u8*)p - (uae_u8*)regs.pc_oldp));
} }
#define m68k_incpc(o) ((regs).pc_p += (o)) STATIC_INLINE void m68k_incpc (int o)
{
regs.pc_p += o;
}
#ifdef MMU #ifdef MMU
STATIC_INLINE void m68k_setpc_mmu (uaecptr newpc) STATIC_INLINE void m68k_setpc_mmu (uaecptr newpc)
{ {
...@@ -251,10 +263,19 @@ STATIC_INLINE void m68k_do_bsri (uaecptr oldpc, uae_s32 offset) ...@@ -251,10 +263,19 @@ STATIC_INLINE void m68k_do_bsri (uaecptr oldpc, uae_s32 offset)
put_long(m68k_areg (regs, 7), oldpc); put_long(m68k_areg (regs, 7), oldpc);
m68k_incpci(offset); m68k_incpci(offset);
} }
#define get_ibyte(o) do_get_mem_byte((uae_u8 *)((regs).pc_p + (o) + 1)) STATIC_INLINE uae_u32 get_ibyte (int o)
#define get_iword(o) do_get_mem_word((uae_u16 *)((regs).pc_p + (o))) {
#define get_ilong(o) do_get_mem_long((uae_u32 *)((regs).pc_p + (o))) return do_get_mem_byte((uae_u8 *)((regs).pc_p + (o) + 1));
}
STATIC_INLINE uae_u32 get_iword (int o)
{
return do_get_mem_word((uae_u16 *)((regs).pc_p + (o)));
}
STATIC_INLINE uae_u32 get_ilong (int o)
{
return do_get_mem_long((uae_u32 *)((regs).pc_p + (o)));
}
#define get_iwordi(o) get_wordi(o) #define get_iwordi(o) get_wordi(o)
#define get_ilongi(o) get_longi(o) #define get_ilongi(o) get_longi(o)
...@@ -292,19 +313,26 @@ STATIC_INLINE uae_u32 next_ilongi (void) ...@@ -292,19 +313,26 @@ STATIC_INLINE uae_u32 next_ilongi (void)
return r; return r;
} }
extern uae_u32 (*x_get_byte)(uaecptr addr);
extern uae_u32 (*x_get_word)(uaecptr addr);
extern uae_u32 (*x_get_long)(uaecptr addr);
extern void (*x_put_byte)(uaecptr addr, uae_u32 v);
extern void (*x_put_word)(uaecptr addr, uae_u32 v);
extern void (*x_put_long)(uaecptr addr, uae_u32 v);
extern uae_u32 (*x_next_iword)(void);
extern uae_u32 (*x_next_ilong)(void);
extern uae_u32 REGPARAM3 x_get_disp_ea_020 (uae_u32 base, uae_u32 dp) REGPARAM;
extern uae_u32 REGPARAM3 x_get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width) REGPARAM;
extern void REGPARAM3 x_put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width) REGPARAM;
extern void m68k_setstopped (void); extern void m68k_setstopped (void);
extern void m68k_resumestopped (void); extern void m68k_resumestopped (void);
extern uae_u32 REGPARAM3 get_disp_ea_020 (uae_u32 base, uae_u32 dp) REGPARAM; extern uae_u32 REGPARAM3 get_disp_ea_020 (uae_u32 base, uae_u32 dp) REGPARAM;
extern uae_u32 REGPARAM3 get_disp_ea_020ce (uae_u32 base, uae_u32 dp) REGPARAM; extern uae_u32 REGPARAM3 get_disp_ea_000 (uae_u32 base, uae_u32 dp);
extern uae_u32 REGPARAM3 get_disp_ea_040mmu (uae_u32 base, uae_u32 dp) REGPARAM; extern uae_u32 REGPARAM3 get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width) REGPARAM;
extern uae_u32 REGPARAM3 get_disp_ea_000 (uae_u32 base, uae_u32 dp) REGPARAM; extern void REGPARAM3 put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width) REGPARAM;
extern uae_u32 get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width);
extern void put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width);
extern uae_u32 get_bitfield_020ce (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width);
extern void put_bitfield_020ce (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width);
extern uae_u32 get_bitfield_040mmu (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width);
extern void put_bitfield_040mmu (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width);
extern int get_cpu_model(void); extern int get_cpu_model(void);
...@@ -313,9 +341,9 @@ extern int get_cpu_model(void); ...@@ -313,9 +341,9 @@ extern int get_cpu_model(void);
# undef Exception # undef Exception
#endif #endif
extern void MakeSR (void) REGPARAM; extern void REGPARAM3 MakeSR (void) REGPARAM;
extern void MakeFromSR (void) REGPARAM; extern void REGPARAM3 MakeFromSR (void) REGPARAM;
extern void Exception (int, uaecptr) REGPARAM; extern void REGPARAM3 Exception (int, uaecptr) REGPARAM;
extern void NMI (void); extern void NMI (void);
extern void NMI_delayed (void); extern void NMI_delayed (void);
extern void prepare_interrupt (uae_u32); extern void prepare_interrupt (uae_u32);
...@@ -385,9 +413,9 @@ extern const struct cputbl op_smalltbl_12_ff[]; ...@@ -385,9 +413,9 @@ extern const struct cputbl op_smalltbl_12_ff[];
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl"); extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl");
#ifdef JIT #ifdef JIT
extern void flush_icache (uaecptr, int n); extern void flush_icache (uaecptr, int);
extern void compemu_reset (void); extern void compemu_reset (void);
extern int check_prefs_changed_comp (void); //extern bool check_prefs_changed_comp (void);
#else #else
#define flush_icache(uaecptr, int) do {} while (0) #define flush_icache(uaecptr, int) do {} while (0)
#endif #endif
......
This diff is collapsed.
...@@ -409,4 +409,7 @@ extern void xfree (const void*); ...@@ -409,4 +409,7 @@ extern void xfree (const void*);
#define _tcstol strtol #define _tcstol strtol
#define _wunlink unlink #define _wunlink unlink
#define _tcsftime strftime #define _tcsftime strftime
#define bool _Bool
#define true 1
#define false 0
#endif #endif
...@@ -28,7 +28,7 @@ extern void target_run (void); ...@@ -28,7 +28,7 @@ extern void target_run (void);
extern void target_quit (void); extern void target_quit (void);
extern int quit_program; extern int quit_program;
extern int console_emulation; extern bool console_emulation;
extern char warning_buffer[256]; extern char warning_buffer[256];
extern char start_path_data[]; extern char start_path_data[];
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
*/ */
#define UAEMAJOR 2 #define UAEMAJOR 2
#define UAEMINOR 1 #define UAEMINOR 2
#define UAESUBREV 0 #define UAESUBREV 0
#define UAEVERSION (256*65536L*UAEMAJOR + 65536L*UAEMINOR + UAESUBREV) #define UAEVERSION (256*65536L*UAEMAJOR + 65536L*UAEMINOR + UAESUBREV)
......
This diff is collapsed.
...@@ -23,13 +23,6 @@ ...@@ -23,13 +23,6 @@
#include "custom.h" #include "custom.h"
#include "savestate.h" #include "savestate.h"
static int fakestate[MAX_JPORTS][7] = { {0},{0} };
static int *fs_np, *fs_ck, *fs_se;
#ifdef ARCADIA
static int *fs_xa1, *fs_xa2;
#endif
static int kpb_first, kpb_last; static int kpb_first, kpb_last;
static int keybuf[256]; static int keybuf[256];
...@@ -48,16 +41,10 @@ int get_next_key (void) ...@@ -48,16 +41,10 @@ int get_next_key (void)
key = keybuf[kpb_last]; key = keybuf[kpb_last];
if (++kpb_last == 256) if (++kpb_last == 256)
kpb_last = 0; kpb_last = 0;
return key; return key;
} }
static void do_fake (int nr)
{
int *fake = fakestate[nr];
do_fake_joystick (nr, fake);
}
int record_key (int kc) int record_key (int kc)
{ {
#ifdef INPREC #ifdef INPREC
...@@ -84,105 +71,10 @@ int record_key_direct (int kc) ...@@ -84,105 +71,10 @@ int record_key_direct (int kc)
return 0; return 0;
} }
if (fs_np != 0) {
switch (k) {
case AK_NP8: fs = 1; fs_np[0] = b; break;
case AK_NP4: fs = 1; fs_np[1] = b; break;
case AK_NP6: fs = 1; fs_np[2] = b; break;
case AK_NP2: fs = 1; fs_np[3] = b; break;
case AK_NP0: case AK_NP5: fs = 1; fs_np[4] = b; break;
case AK_NPDEL: case AK_NPDIV: case AK_ENT: fs = 1; fs_np[5] = b; break;
}
}
if (fs_ck != 0) {
switch (k) {
case AK_UP: fs = 1; fs_ck[0] = b; break;
case AK_LF: fs = 1; fs_ck[1] = b; break;
case AK_RT: fs = 1; fs_ck[2] = b; break;
case AK_DN: fs = 1; fs_ck[3] = b; break;
case AK_RCTRL: case AK_RALT: fs = 1; fs_ck[4] = b; break;
case AK_RSH: fs = 1; fs_ck[5] = b; break;
}
}
if (fs_se != 0) {
switch (k) {
case AK_W: fs = 1; fs_se[0] = b; break;
case AK_A: fs = 1; fs_se[1] = b; break;
case AK_D: fs = 1; fs_se[2] = b; break;
case AK_S: fs = 1; fs_se[3] = b; break;
case AK_LALT: fs = 1; fs_se[4] = b; break;
case AK_LSH: fs = 1; fs_se[5] = b; break;
}
}
#ifdef ARCADIA
if (fs_xa1 != 0) {
switch (k) {
case AK_NP8: fs = 1; fs_xa1[0] = b; break;
case AK_NP4: fs = 1; fs_xa1[1] = b; break;
case AK_NP6: fs = 1; fs_xa1[2] = b; break;
case AK_NP2: case AK_NP5: fs = 1; fs_xa1[3] = b; break;
case AK_CTRL: fs = 1; fs_xa1[4] = b; break;
case AK_LALT: fs = 1; fs_xa1[5] = b; break;
case AK_SPC: fs = 1; fs_xa1[6] = b; break;
}
}
if (fs_xa2 != 0) {
switch (k) {
case AK_R: fs = 1; fs_xa2[0] = b; break;
case AK_D: fs = 1; fs_xa2[1] = b; break;
case AK_G: fs = 1; fs_xa2[2] = b; break;
case AK_F: fs = 1; fs_xa2[3] = b; break;
case AK_A: fs = 1; fs_xa2[4] = b; break;
case AK_S: fs = 1; fs_xa2[5] = b; break;
case AK_Q: fs = 1; fs_xa2[6] = b; break;
}
}
#endif
if (fs && currprefs.input_selected_setting == 0) {
if (JSEM_ISANYKBD (0, &currprefs))
do_fake (0);
if (JSEM_ISANYKBD (1, &currprefs))
do_fake (1);
if (JSEM_ISANYKBD (2, &currprefs))
do_fake (2);
if (JSEM_ISANYKBD (3, &currprefs))
do_fake (3);
return 0;
} else {
if ((kc >> 1) == AK_RCTRL) { if ((kc >> 1) == AK_RCTRL) {
kc ^= AK_RCTRL << 1; kc ^= AK_RCTRL << 1;
kc ^= AK_CTRL << 1; kc ^= AK_CTRL << 1;
} }
#ifdef ARCADIA
if (fs_xa1 || fs_xa2) {
int k2 = k;
if (k == AK_1)
k2 = AK_F1;
if (k == AK_2)
k2 = AK_F2;
if (k == AK_3)
k2 = AK_LALT;
if (k == AK_4)
k2 = AK_RALT;
if (k == AK_6)
k2 = AK_DN;
if (k == AK_LBRACKET || k == AK_LSH)
k2 = AK_SPC;
if (k == AK_RBRACKET)
k2 = AK_RET;
if (k == AK_C)
k2 = AK_1;
if (k == AK_5)
k2 = AK_2;
if (k == AK_Z)
k2 = AK_3;
if (k == AK_X)
k2 = AK_4;
if (k != k2)
kc = (k2 << 1) | (b ? 0 : 1);
}
#endif
}
#ifdef INPREC #ifdef INPREC
if (input_recording > 0) { if (input_recording > 0) {
...@@ -197,31 +89,6 @@ int record_key_direct (int kc) ...@@ -197,31 +89,6 @@ int record_key_direct (int kc)
return 1; return 1;
} }
void joystick_setting_changed (void)
{
int i;
fs_np = fs_ck = fs_se = 0;
#ifdef ARCADIA
fs_xa1 = fs_xa2 = 0;
#endif
for (i = 0; i < MAX_JPORTS; i++) {
if (JSEM_ISNUMPAD (i, &currprefs))
fs_np = fakestate[i];
if (JSEM_ISCURSOR (i, &currprefs))
fs_ck = fakestate[i];
if (JSEM_ISSOMEWHEREELSE (i, &currprefs))
fs_se = fakestate[i];
#ifdef ARCADIA
if (JSEM_ISXARCADE1 (i, &currprefs))
fs_xa1 = fakestate[i];
if (JSEM_ISXARCADE2 (i, &currprefs))
fs_xa2 = fakestate[i];
#endif
}
}
void keybuf_init (void) void keybuf_init (void)
{ {
kpb_first = kpb_last = 0; kpb_first = kpb_last = 0;
......
...@@ -172,7 +172,7 @@ struct uae_input_device_kbr_default *uaekey_make_default_kbr (const struct uaeke ...@@ -172,7 +172,7 @@ struct uae_input_device_kbr_default *uaekey_make_default_kbr (const struct uaeke
if (trans) { if (trans) {
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
trans[i].scancode = hostkeys[i].hostkey; trans[i].scancode = hostkeys[i].hostkey;
trans[i].event = default_keymap[hostkeys[i].uaekey]; trans[i].evt = default_keymap[hostkeys[i].uaekey];
} }
trans[i].scancode = -1; trans[i].scancode = -1;
} }
......
...@@ -66,10 +66,10 @@ int config_changed; ...@@ -66,10 +66,10 @@ int config_changed;
int pissoff_value = 25000; int pissoff_value = 25000;
int pause_emulation; int pause_emulation;
char start_path_data[MAX_DPATH]; char start_path_data[MAX_DPATH];
int no_gui = 0, quit_to_gui = 0; bool no_gui = 0, quit_to_gui = 0;
int cloanto_rom = 0; bool cloanto_rom = 0;
int kickstart_rom = 1; bool kickstart_rom = 1;
int console_emulation = 0; bool console_emulation = 0;
struct gui_info gui_data; struct gui_info gui_data;
...@@ -825,6 +825,7 @@ static int real_main2 (int argc, char **argv) ...@@ -825,6 +825,7 @@ static int real_main2 (int argc, char **argv)
currprefs.produce_sound = 0; currprefs.produce_sound = 0;
} }
inputdevice_init (); inputdevice_init ();
inputdevice_setkeytranslation (keytrans, kbmaps);
changed_prefs = currprefs; changed_prefs = currprefs;
no_gui = ! currprefs.start_gui; no_gui = ! currprefs.start_gui;
...@@ -888,6 +889,7 @@ static int real_main2 (int argc, char **argv) ...@@ -888,6 +889,7 @@ static int real_main2 (int argc, char **argv)
#ifdef FILESYS #ifdef FILESYS
filesys_install (); filesys_install ();
#endif #endif
target_startup_sequence (&currprefs);
memory_init (); memory_init ();
memory_reset (); memory_reset ();
...@@ -910,7 +912,6 @@ static int real_main2 (int argc, char **argv) ...@@ -910,7 +912,6 @@ static int real_main2 (int argc, char **argv)
init_m68k(); /* must come after reset_frame_rate_hack (); */ init_m68k(); /* must come after reset_frame_rate_hack (); */
gui_update (); gui_update ();
target_startup_sequence(&currprefs);
if (graphics_init ()) { if (graphics_init ()) {
#ifdef DEBUGGER #ifdef DEBUGGER
...@@ -945,6 +946,7 @@ static int real_main2 (int argc, char **argv) ...@@ -945,6 +946,7 @@ static int real_main2 (int argc, char **argv)
void real_main (int argc, char **argv) void real_main (int argc, char **argv)
{ {
show_version_full ();
restart_program = 1; restart_program = 1;
fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (char)); fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (char));
...@@ -966,7 +968,6 @@ void real_main (int argc, char **argv) ...@@ -966,7 +968,6 @@ void real_main (int argc, char **argv)
#ifndef NO_MAIN_IN_MAIN_C #ifndef NO_MAIN_IN_MAIN_C
int main (int argc, char **argv) int main (int argc, char **argv)
{ {
show_version_full ();
real_main (argc, argv); real_main (argc, argv);
return 0; return 0;
} }
......
...@@ -37,7 +37,7 @@ extern uae_u8 *natmem_offset, *natmem_offset_end; ...@@ -37,7 +37,7 @@ extern uae_u8 *natmem_offset, *natmem_offset_end;
#include <sys/mman.h> #include <sys/mman.h>
#endif #endif
int canbang; bool canbang;
int candirect = -1; int candirect = -1;
#ifdef JIT #ifdef JIT
/* Set by each memory handler that does not simply access real memory. */ /* Set by each memory handler that does not simply access real memory. */
...@@ -49,7 +49,7 @@ int special_mem; ...@@ -49,7 +49,7 @@ int special_mem;
#define IPC_CREAT 0x04 #define IPC_CREAT 0x04
#define IPC_STAT 0x08 #define IPC_STAT 0x08
static int isdirectjit (void) static bool isdirectjit (void)
{ {
#ifdef JIT #ifdef JIT
return currprefs.cachesize && !currprefs.comptrustbyte; return currprefs.cachesize && !currprefs.comptrustbyte;
...@@ -58,7 +58,7 @@ static int isdirectjit (void) ...@@ -58,7 +58,7 @@ static int isdirectjit (void)
#endif #endif
} }
static int canjit (void) static bool canjit (void)
{ {
#ifdef JIT #ifdef JIT
if (currprefs.cpu_model < 68020 && currprefs.address_space_24) if (currprefs.cpu_model < 68020 && currprefs.address_space_24)
...@@ -74,7 +74,7 @@ static void nocanbang (void) ...@@ -74,7 +74,7 @@ static void nocanbang (void)
canbang = 0; canbang = 0;
} }
int ersatzkickfile; bool ersatzkickfile;
uae_u32 allocated_chipmem; uae_u32 allocated_chipmem;
uae_u32 allocated_fastmem; uae_u32 allocated_fastmem;
...@@ -85,6 +85,7 @@ uae_u32 allocated_a3000lmem; ...@@ -85,6 +85,7 @@ uae_u32 allocated_a3000lmem;
uae_u32 allocated_a3000hmem; uae_u32 allocated_a3000hmem;
uae_u32 allocated_cardmem; uae_u32 allocated_cardmem;
uae_u8 ce_banktype[65536]; uae_u8 ce_banktype[65536];
uae_u8 ce_cachable[65536];
#if defined(CPU_64_BIT) #if defined(CPU_64_BIT)
uae_u32 max_z3fastmem = 2048UL * 1024 * 1024; uae_u32 max_z3fastmem = 2048UL * 1024 * 1024;
...@@ -97,10 +98,10 @@ static size_t bootrom_filepos, chip_filepos, bogo_filepos, rom_filepos, a3000lme ...@@ -97,10 +98,10 @@ static size_t bootrom_filepos, chip_filepos, bogo_filepos, rom_filepos, a3000lme
/* Set if we notice during initialization that settings changed, /* Set if we notice during initialization that settings changed,
and we must clear all memory to prevent bogus contents from confusing and we must clear all memory to prevent bogus contents from confusing
the Kickstart. */ the Kickstart. */
static int need_hardreset; static bool need_hardreset;
/* The address space setting used during the last reset. */ /* The address space setting used during the last reset. */
static int last_address_space_24; static bool last_address_space_24;
addrbank *mem_banks[MEMORY_BANKS]; addrbank *mem_banks[MEMORY_BANKS];
...@@ -1024,7 +1025,6 @@ static int extendedkickmem_type; ...@@ -1024,7 +1025,6 @@ static int extendedkickmem_type;
#define EXTENDED_ROM_KS 3 #define EXTENDED_ROM_KS 3
#define EXTENDED_ROM_ARCADIA 4 #define EXTENDED_ROM_ARCADIA 4
//#if defined CDTV || defined CD32
static uae_u32 REGPARAM3 extendedkickmem_lget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 extendedkickmem_lget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 extendedkickmem_wget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 extendedkickmem_wget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 extendedkickmem_bget (uaecptr) REGPARAM; static uae_u32 REGPARAM3 extendedkickmem_bget (uaecptr) REGPARAM;
...@@ -1158,7 +1158,7 @@ static uae_u8 *REGPARAM2 extendedkickmem2_xlate (uaecptr addr) ...@@ -1158,7 +1158,7 @@ static uae_u8 *REGPARAM2 extendedkickmem2_xlate (uaecptr addr)
addr &= extendedkickmem2_mask; addr &= extendedkickmem2_mask;
return extendedkickmemory2 + addr; return extendedkickmemory2 + addr;
} }
//#endif //defined CDTV || defined CD32
/* Default memory access functions */ /* Default memory access functions */
...@@ -1291,7 +1291,6 @@ addrbank kickram_bank = { ...@@ -1291,7 +1291,6 @@ addrbank kickram_bank = {
kickmem_lget, kickmem_wget, ABFLAG_UNK | ABFLAG_SAFE kickmem_lget, kickmem_wget, ABFLAG_UNK | ABFLAG_SAFE
}; };
//#if defined CDTV || defined CD32
addrbank extendedkickmem_bank = { addrbank extendedkickmem_bank = {
extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget, extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget,
extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput, extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput,
...@@ -1304,7 +1303,7 @@ addrbank extendedkickmem2_bank = { ...@@ -1304,7 +1303,7 @@ addrbank extendedkickmem2_bank = {
extendedkickmem2_xlate, extendedkickmem2_check, NULL, "Extended 2nd Kickstart ROM", extendedkickmem2_xlate, extendedkickmem2_check, NULL, "Extended 2nd Kickstart ROM",
extendedkickmem2_lget, extendedkickmem2_wget, ABFLAG_ROM extendedkickmem2_lget, extendedkickmem2_wget, ABFLAG_ROM
}; };
//#endif //defined CDTV || defined CD32
static uae_u32 allocated_custmem1, allocated_custmem2; static uae_u32 allocated_custmem1, allocated_custmem2;
static uae_u32 custmem1_mask, custmem2_mask; static uae_u32 custmem1_mask, custmem2_mask;
...@@ -1470,14 +1469,12 @@ void a3000_fakekick (int map) ...@@ -1470,14 +1469,12 @@ void a3000_fakekick (int map)
if (fkickmemory[5] == 0xfc) { if (fkickmemory[5] == 0xfc) {
memcpy (kickmemory, fkickmemory, fkickmem_size / 2); memcpy (kickmemory, fkickmemory, fkickmem_size / 2);
memcpy (kickmemory + fkickmem_size / 2, fkickmemory, fkickmem_size / 2); memcpy (kickmemory + fkickmem_size / 2, fkickmemory, fkickmem_size / 2);
//#if defined CDTV || defined CD32
extendedkickmem_size = 65536; extendedkickmem_size = 65536;
extendedkickmem_mask = extendedkickmem_size - 1; extendedkickmem_mask = extendedkickmem_size - 1;
extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0"); extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0");
extendedkickmem_bank.baseaddr = extendedkickmemory; extendedkickmem_bank.baseaddr = extendedkickmemory;
memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536); memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
map_banks (&extendedkickmem_bank, 0xf0, 1, 1); map_banks (&extendedkickmem_bank, 0xf0, 1, 1);
//#endif //defined CDTV || defined CD32
a3000_f0 = 1; a3000_f0 = 1;
} else { } else {
memcpy (kickmemory, fkickmemory, fkickmem_size); memcpy (kickmemory, fkickmemory, fkickmem_size);
...@@ -1486,11 +1483,9 @@ void a3000_fakekick (int map) ...@@ -1486,11 +1483,9 @@ void a3000_fakekick (int map)
} else { } else {
if (a3000_f0) { if (a3000_f0) {
map_banks (&dummy_bank, 0xf0, 1, 1); map_banks (&dummy_bank, 0xf0, 1, 1);
//#if defined CDTV || defined CD32
if (extendedkickmemory) if (extendedkickmemory)
mapped_free (extendedkickmemory); mapped_free (extendedkickmemory);
extendedkickmemory = NULL; extendedkickmemory = NULL;
//#endif //defined CDTV || defined CD32
a3000_f0 = 0; a3000_f0 = 0;
} }
if (kickstore) if (kickstore)
...@@ -1588,7 +1583,6 @@ static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksu ...@@ -1588,7 +1583,6 @@ static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksu
return i; return i;
} }
//#if defined CDTV || defined CD32 || defined ARCADIA
static int load_extendedkickstart (void) static int load_extendedkickstart (void)
{ {
struct zfile *f; struct zfile *f;
...@@ -1638,7 +1632,6 @@ static int load_extendedkickstart (void) ...@@ -1638,7 +1632,6 @@ static int load_extendedkickstart (void)
zfile_fclose (f); zfile_fclose (f);
return 1; return 1;
} }
//#endif //defined CDTV || defined CD32 || defined ARCADIA
static int patch_shapeshifter (uae_u8 *kickmemory) static int patch_shapeshifter (uae_u8 *kickmemory)
{ {
...@@ -1703,13 +1696,11 @@ static void patch_kick (void) ...@@ -1703,13 +1696,11 @@ static void patch_kick (void)
if (kickmem_size >= 524288 && currprefs.kickshifter) if (kickmem_size >= 524288 && currprefs.kickshifter)
patched += patch_shapeshifter (kickmemory); patched += patch_shapeshifter (kickmemory);
patched += patch_residents (kickmemory, kickmem_size); patched += patch_residents (kickmemory, kickmem_size);
//#if defined CDTV || defined CD32
if (extendedkickmemory) { if (extendedkickmemory) {
patched += patch_residents (extendedkickmemory, extendedkickmem_size); patched += patch_residents (extendedkickmemory, extendedkickmem_size);
if (patched) if (patched)
kickstart_fix_checksum (extendedkickmemory, extendedkickmem_size); kickstart_fix_checksum (extendedkickmemory, extendedkickmem_size);
} }
//#endif //defined CDTV || defined CD32
if (patched) if (patched)
kickstart_fix_checksum (kickmemory, kickmem_size); kickstart_fix_checksum (kickmemory, kickmem_size);
} }
...@@ -1795,7 +1786,6 @@ static int load_kickstart (void) ...@@ -1795,7 +1786,6 @@ static int load_kickstart (void)
goto err; goto err;
kickmem_mask = size - 1; kickmem_mask = size - 1;
kickmem_size = size; kickmem_size = size;
//#if defined CDTV || defined CD32 || defined ARCADIA
if (filesize >= 524288 * 2 && !extendedkickmem_type) { if (filesize >= 524288 * 2 && !extendedkickmem_type) {
extendedkickmem_size = 0x80000; extendedkickmem_size = 0x80000;
if (currprefs.cs_cdtvcd || currprefs.cs_cdtvram) { if (currprefs.cs_cdtvcd || currprefs.cs_cdtvram) {
...@@ -1821,7 +1811,6 @@ static int load_kickstart (void) ...@@ -1821,7 +1811,6 @@ static int load_kickstart (void)
read_kickstart (f, extendedkickmemory2 + 524288, 524288, 0, 1); read_kickstart (f, extendedkickmemory2 + 524288, 524288, 0, 1);
extendedkickmem2_mask = extendedkickmem2_size - 1; extendedkickmem2_mask = extendedkickmem2_size - 1;
} }
//#endif //defined CDTV || defined CD32 || defined ARCADIA
} }
#if defined(AMIGA) #if defined(AMIGA)
...@@ -2177,7 +2166,6 @@ static void allocate_memory (void) ...@@ -2177,7 +2166,6 @@ static void allocate_memory (void)
} }
need_hardreset = 1; need_hardreset = 1;
} }
//#if defined CDTV || defined CD32
if (allocated_cardmem != currprefs.cs_cdtvcard * 1024) { if (allocated_cardmem != currprefs.cs_cdtvcard * 1024) {
if (cardmemory) if (cardmemory)
mapped_free (cardmemory); mapped_free (cardmemory);
...@@ -2196,7 +2184,6 @@ static void allocate_memory (void) ...@@ -2196,7 +2184,6 @@ static void allocate_memory (void)
cdtv_loadcardmem(cardmemory, allocated_cardmem); cdtv_loadcardmem(cardmemory, allocated_cardmem);
#endif #endif
} }
//#endif //defined CDTV || defined CD32
if (allocated_custmem1 != currprefs.custom_memory_sizes[0]) { if (allocated_custmem1 != currprefs.custom_memory_sizes[0]) {
if (custmem1) if (custmem1)
mapped_free (custmem1); mapped_free (custmem1);
...@@ -2256,6 +2243,11 @@ static void fill_ce_banks (void) ...@@ -2256,6 +2243,11 @@ static void fill_ce_banks (void)
int i; int i;
memset (ce_banktype, CE_MEMBANK_FAST, sizeof ce_banktype); memset (ce_banktype, CE_MEMBANK_FAST, sizeof ce_banktype);
// data cachable regions
memset (ce_cachable, 0, sizeof ce_cachable);
memset (ce_cachable + (0x00200000 >> 16), 1, currprefs.fastmem_size >> 16);
memset (ce_cachable + (0x10000000 >> 16), 1, currprefs.z3fastmem_size >> 16);
if (&get_mem_bank (0) == &chipmem_bank) { if (&get_mem_bank (0) == &chipmem_bank) {
for (i = 0; i < (0x200000 >> 16); i++) for (i = 0; i < (0x200000 >> 16); i++)
ce_banktype[i] = CE_MEMBANK_CHIP; ce_banktype[i] = CE_MEMBANK_CHIP;
...@@ -2270,8 +2262,10 @@ static void fill_ce_banks (void) ...@@ -2270,8 +2262,10 @@ static void fill_ce_banks (void)
addrbank *b; addrbank *b;
ce_banktype[i] = CE_MEMBANK_CIA; ce_banktype[i] = CE_MEMBANK_CIA;
b = &get_mem_bank (i << 16); b = &get_mem_bank (i << 16);
if (b != &cia_bank) if (b != &cia_bank) {
ce_banktype[i] = CE_MEMBANK_FAST; ce_banktype[i] = CE_MEMBANK_FAST;
ce_cachable[i] = 1;
}
} }
// CD32 ROM is 16-bit // CD32 ROM is 16-bit
if (currprefs.cs_cd32cd) { if (currprefs.cs_cd32cd) {
...@@ -2382,7 +2376,6 @@ void memory_reset (void) ...@@ -2382,7 +2376,6 @@ void memory_reset (void)
memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile); memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile);
memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile); memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile);
need_hardreset = 1; need_hardreset = 1;
//#if defined CDTV || defined CD32
if (extendedkickmemory) if (extendedkickmemory)
mapped_free (extendedkickmemory); mapped_free (extendedkickmemory);
extendedkickmemory = 0; extendedkickmemory = 0;
...@@ -2391,7 +2384,6 @@ void memory_reset (void) ...@@ -2391,7 +2384,6 @@ void memory_reset (void)
extendedkickmem2_size = 0; extendedkickmem2_size = 0;
extendedkickmem_type = 0; extendedkickmem_type = 0;
load_extendedkickstart (); load_extendedkickstart ();
//#endif //defined CDTV || defined CD32
kickmem_mask = 524288 - 1; kickmem_mask = 524288 - 1;
if (!load_kickstart ()) { if (!load_kickstart ()) {
if (_tcslen (currprefs.romfile) > 0) { if (_tcslen (currprefs.romfile) > 0) {
...@@ -2531,15 +2523,12 @@ void memory_reset (void) ...@@ -2531,15 +2523,12 @@ void memory_reset (void)
map_banks (&expamem_bank, 0xE8, 1, 0); /* Map Autoconfig space at 0xE80000 - 0xE8FFFF. */ map_banks (&expamem_bank, 0xE8, 1, 0); /* Map Autoconfig space at 0xE80000 - 0xE8FFFF. */
#endif #endif
//#if defined CDTV || defined CD32
if (a3000_f0) if (a3000_f0)
map_banks (&extendedkickmem_bank, 0xf0, 1, 0); map_banks (&extendedkickmem_bank, 0xf0, 1, 0);
//#endif //defined CDTV || defined CD32
/* Map the chipmem into all of the lower 8MB */ /* Map the chipmem into all of the lower 8MB */
map_overlay (1); map_overlay (1);
//#if defined CDTV || defined CD32
switch (extendedkickmem_type) { switch (extendedkickmem_type) {
case EXTENDED_ROM_KS: case EXTENDED_ROM_KS:
map_banks (&extendedkickmem_bank, 0xE0, 8, 0); map_banks (&extendedkickmem_bank, 0xE0, 8, 0);
...@@ -2555,7 +2544,6 @@ void memory_reset (void) ...@@ -2555,7 +2544,6 @@ void memory_reset (void)
break; break;
#endif //CD32 #endif //CD32
} }
//#endif //defined CDTV || defined CD32
#ifdef AUTOCONFIG #ifdef AUTOCONFIG
if (need_uae_boot_rom ()) if (need_uae_boot_rom ())
...@@ -2564,7 +2552,6 @@ void memory_reset (void) ...@@ -2564,7 +2552,6 @@ void memory_reset (void)
if ((cloanto_rom || currprefs.cs_ksmirror_e0) && (currprefs.maprom != 0xe00000) && !extendedkickmem_type) if ((cloanto_rom || currprefs.cs_ksmirror_e0) && (currprefs.maprom != 0xe00000) && !extendedkickmem_type)
map_banks (&kickmem_bank, 0xE0, 8, 0); map_banks (&kickmem_bank, 0xE0, 8, 0);
//#if defined CDTV || defined CD32
if (currprefs.cs_ksmirror_a8) { if (currprefs.cs_ksmirror_a8) {
if (extendedkickmem2_size) { if (extendedkickmem2_size) {
map_banks (&extendedkickmem2_bank, 0xa8, 16, 0); map_banks (&extendedkickmem2_bank, 0xa8, 16, 0);
...@@ -2579,7 +2566,7 @@ void memory_reset (void) ...@@ -2579,7 +2566,7 @@ void memory_reset (void)
} }
} }
} }
//#endif //defined CDTV || defined CD32
if (currprefs.custom_memory_sizes[0]) { if (currprefs.custom_memory_sizes[0]) {
map_banks (&custmem1_bank, map_banks (&custmem1_bank,
currprefs.custom_memory_addrs[0] >> 16, currprefs.custom_memory_addrs[0] >> 16,
......
/* /*
* A collection of ugly and random junk brought in from Win32 * A collection of ugly and random junk brought in from Win32
* which desparately needs to be tidied up * which desparately needs to be tidied up
*
*
*/ */
#include "sysconfig.h" #include "sysconfig.h"
...@@ -787,3 +789,50 @@ end: ...@@ -787,3 +789,50 @@ end:
recursive--; recursive--;
return ret; return ret;
} }
// -- dinput.c
int input_get_default_lightpen (struct uae_input_device *uid, int i, int port)
{
/* struct didata *did;
if (i >= num_mouse)
return 0;
did = &di_mouse[i];
uid[i].eventid[ID_AXIS_OFFSET + 0][0] = INPUTEVENT_LIGHTPEN_HORIZ;
uid[i].eventid[ID_AXIS_OFFSET + 1][0] = INPUTEVENT_LIGHTPEN_VERT;
uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_3RD_BUTTON : INPUTEVENT_JOY1_3RD_BUTTON;
if (i == 0)
return 1;*/
return 0;
}
int input_get_default_joystick_analog (struct uae_input_device *uid, int i, int port)
{
/* int j;
struct didata *did;
if (i >= num_joystick)
return 0;
did = &di_joystick[i];
uid[i].eventid[ID_AXIS_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT;
uid[i].eventid[ID_AXIS_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT;
uid[i].eventid[ID_BUTTON_OFFSET + 0][0] = port ? INPUTEVENT_JOY2_LEFT : INPUTEVENT_JOY1_LEFT;
if (isrealbutton (did, 1))
uid[i].eventid[ID_BUTTON_OFFSET + 1][0] = port ? INPUTEVENT_JOY2_RIGHT : INPUTEVENT_JOY1_RIGHT;
if (isrealbutton (did, 2))
uid[i].eventid[ID_BUTTON_OFFSET + 2][0] = port ? INPUTEVENT_JOY2_UP : INPUTEVENT_JOY1_UP;
if (isrealbutton (did, 3))
uid[i].eventid[ID_BUTTON_OFFSET + 3][0] = port ? INPUTEVENT_JOY2_DOWN : INPUTEVENT_JOY1_DOWN;
for (j = 2; j < MAX_MAPPINGS - 1; j++) {
int am = did->axismappings[j];
if (am == DIJOFS_POV(0) || am == DIJOFS_POV(1) || am == DIJOFS_POV(2) || am == DIJOFS_POV(3)) {
uid[i].eventid[ID_AXIS_OFFSET + j + 0][0] = port ? INPUTEVENT_JOY2_HORIZ_POT : INPUTEVENT_JOY1_HORIZ_POT;
uid[i].eventid[ID_AXIS_OFFSET + j + 1][0] = port ? INPUTEVENT_JOY2_VERT_POT : INPUTEVENT_JOY1_VERT_POT;
j++;
}
}
if (i == 0)
return 1;*/
return 0;
}
...@@ -108,21 +108,21 @@ void uae_NotificationHack (uaecptr port, uaecptr nr) ...@@ -108,21 +108,21 @@ void uae_NotificationHack (uaecptr port, uaecptr nr)
void uae_NewList (uaecptr list) void uae_NewList (uaecptr list)
{ {
put_long_slow (list, list + 4); x_put_long (list, list + 4);
put_long_slow (list + 4, 0); x_put_long (list + 4, 0);
put_long_slow (list + 8, list); x_put_long (list + 8, list);
} }
uaecptr uae_AllocMem (TrapContext *context, uae_u32 size, uae_u32 flags) uaecptr uae_AllocMem (TrapContext *context, uae_u32 size, uae_u32 flags)
{ {
m68k_dreg (regs, 0) = size; m68k_dreg (regs, 0) = size;
m68k_dreg (regs, 1) = flags; m68k_dreg (regs, 1) = flags;
return CallLib (context, get_long (4), -198); /* AllocMem */ return CallLib (context, x_get_long (4), -198); /* AllocMem */
} }
void uae_FreeMem (TrapContext *context, uaecptr memory, uae_u32 size) void uae_FreeMem (TrapContext *context, uaecptr memory, uae_u32 size)
{ {
m68k_dreg (regs, 0) = size; m68k_dreg (regs, 0) = size;
m68k_areg (regs, 1) = memory; m68k_areg (regs, 1) = memory;
CallLib (context, get_long (4), -0xD2); /* FreeMem */ CallLib (context, x_get_long (4), -0xD2); /* FreeMem */
} }
This diff is collapsed.
...@@ -92,12 +92,6 @@ static void io_log (const TCHAR *msg, uaecptr request) ...@@ -92,12 +92,6 @@ static void io_log (const TCHAR *msg, uaecptr request)
get_long (request + 32), get_byte (request + 31)); get_long (request + 32), get_byte (request + 31));
} }
STATIC_INLINE void memcpyha (uae_u32 dst, const uae_u8 *src, int size)
{
while (size--)
put_byte (dst++, *src++);
}
static struct devstruct *getdevstruct (int unit) static struct devstruct *getdevstruct (int unit)
{ {
int i; int i;
......
...@@ -12,9 +12,9 @@ generated by GNU Autoconf 2.65. Invocation command line was ...@@ -12,9 +12,9 @@ generated by GNU Autoconf 2.65. Invocation command line was
hostname = GnoStiC-dv7 hostname = GnoStiC-dv7
uname -m = i686 uname -m = i686
uname -r = 2.6.32-21-generic uname -r = 2.6.32-22-generic
uname -s = Linux uname -s = Linux
uname -v = #32-Ubuntu SMP Fri Apr 16 08:10:02 UTC 2010 uname -v = #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010
/usr/bin/uname -p = unknown /usr/bin/uname -p = unknown
/bin/uname -X = unknown /bin/uname -X = unknown
...@@ -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/ccS2CdhX.o: In function `main': /tmp/ccSMtDaE.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/ccJt7cQ4.o: In function `main': /tmp/ccMreunT.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/ccaolMG6.o: In function `main': /tmp/ccfHXHOY.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
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* routines to handle compressed file automatically * routines to handle compressed file automatically
* *
* (c) 1996 Samuel Devulder, Tim Gunn * (c) 1996 Samuel Devulder, Tim Gunn
* 2002-2007 Toni Wilen * 2002-2007 Toni Wilen
*/ */
#define ZLIB_WINAPI #define ZLIB_WINAPI
......
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