2.2.0 beta1

parent 61850f34
......@@ -6,7 +6,7 @@ dnl Updated and generally mauled 2008 Mustafa Tufan
dnl
AC_PREREQ(2.55)
AC_INIT(PUAE, 2.1.0, ,puae)
AC_INIT(PUAE, 2.2.0, ,puae)
AC_CONFIG_SRCDIR([bootstrap.sh])
AM_CONFIG_HEADER([src/sysconfig.h])
AC_CANONICAL_TARGET
......@@ -750,10 +750,11 @@ fi
dnl
dnl CPUEMU_12: 68000 CE cpu+blit
dnl CPUEMU_20: 68020+ CE + blit
dnl CPUEMU_21: 68030 (040/060) "cycle-exact" + blitter
dnl
if [[ "x$WANT_CYCLEEXACT" != "xno" ]]; then
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_12 -DCPUEMU_20"
CPUOBJS="$CPUOBJS cpuemu_12.\$(OBJEXT) cpuemu_20.\$(OBJEXT)"
UAE_DEFINES="$UAE_DEFINES -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_21"
CPUOBJS="$CPUOBJS cpuemu_12.\$(OBJEXT) cpuemu_20.\$(OBJEXT) cpuemu_21.\$(OBJEXT)"
fi
dnl
......
......@@ -21,7 +21,7 @@ BUILT_SOURCES = \
blit.h blitfunc.h blitfunc.c blittable.c \
linetoscr.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 \
compemu.c \
compstbl.c comptbl.h
......@@ -29,7 +29,7 @@ BUILT_SOURCES = \
CLEANFILES = \
blit.h blitfunc.h blitfunc.c blittable.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 \
compemu.c \
compstbl.c comptbl.h \
......@@ -218,6 +218,7 @@ cputbl.h: cpuemu_0.c
cpuemu_11.c: cpuemu_0.c
cpuemu_12.c: cpuemu_0.c
cpuemu_20.c: cpuemu_0.c
cpuemu_21.c: cpuemu_0.c
cpuemu_31.c: cpuemu_0.c
compemu.c: tools/gencomp
......
......@@ -326,7 +326,7 @@ BUILT_SOURCES = \
blit.h blitfunc.h blitfunc.c blittable.c \
linetoscr.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 \
compemu.c \
compstbl.c comptbl.h
......@@ -334,7 +334,7 @@ BUILT_SOURCES = \
CLEANFILES = \
blit.h blitfunc.h blitfunc.c blittable.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 \
compemu.c \
compstbl.c comptbl.h \
......@@ -1021,6 +1021,7 @@ cputbl.h: cpuemu_0.c
cpuemu_11.c: cpuemu_0.c
cpuemu_12.c: cpuemu_0.c
cpuemu_20.c: cpuemu_0.c
cpuemu_21.c: cpuemu_0.c
cpuemu_31.c: cpuemu_0.c
compemu.c: tools/gencomp
......
......@@ -215,7 +215,7 @@
#ifdef DEBUG
#define write_log_debug write_log
#else
#define write_log_debug(...) do {;} while(0)
#define write_log_debug
#endif
static TCHAR *cart_memnames[] = { NULL, "hrtmon", "arhrtmon", "superiv" };
......@@ -266,7 +266,7 @@ static void cartridge_exit (void)
{
#ifdef PICASSO96
if (stored_picasso_on >= 0)
picasso_requested_on = stored_picasso_on;
picasso_requested_on = stored_picasso_on != 0;
stored_picasso_on = -1;
#endif
}
......
This diff is collapsed.
......@@ -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 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;
......@@ -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)
{
unsigned long c = get_cycles ();
unsigned long t = c - led_cycle;
unsigned long t = (c - led_cycle) / CYCLE_UNIT;
if (old_led)
led_on += t;
led_times++;
led_cycles_on += t;
else
led_cycles_off += t;
led_cycle = c;
}
static void led_vsync (void)
{
gui_data.powerled_brightness = gui_data.powerled ? 255 : 0;
calc_led (gui_data.powerled);
if (led_on > 0 && led_times > 2) {
int v = led_on / CYCLE_UNIT * 256 / (maxhpos * maxvpos_nom);
int v;
calc_led (led);
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)
v = 0;
if (v > 255)
v = 255;
gui_data.powerled_brightness = v;
}
led_on = 0;
led_times = 0;
if (led_changed)
led_cycles_on = 0;
led_cycles_off = 0;
if (led_old_brightness != gui_data.powerled_brightness) {
gui_data.powerled = gui_data.powerled_brightness > 127;
gui_led (LED_POWER, gui_data.powerled);
led_changed = 0;
}
led_old_brightness = gui_data.powerled_brightness;
led_cycle = get_cycles ();
}
......@@ -582,15 +588,14 @@ void CIA_vsync_handler (int dotod)
static void bfe001_change (void)
{
uae_u8 v = ciaapra;
int led;
bool led2;
v |= ~ciaadra; /* output is high when pin's direction is input */
led = (v & 2) ? 0 : 1;
if (led != oldled) {
calc_led (oldled);
oldled = led;
gui_data.powerled = led;
led_changed = 1;
led2 = (v & 2) ? 0 : 1;
if (led2 != led) {
calc_led (led);
led = led2;
led_old_brightness = -1;
led_filter_audio ();
}
if (currprefs.cs_ciaoverlay && (v & 1) != oldovl) {
......@@ -1173,7 +1178,7 @@ void CIA_reset (void)
serbits = 0;
oldovl = 1;
oldcd32mute = 1;
oldled = -1;
oldled = true;
resetwarning_phase = resetwarning_timer = 0;
if (!savestate_state) {
......
......@@ -20,7 +20,7 @@
#define NATMEM_OFFSETX (uae_u32)NATMEM_OFFSET
// %%% BRIAN KING WAS HERE %%%
extern int canbang;
extern bool canbang;
#include <sys/mman.h>
extern void jit_abort(const TCHAR*,...);
compop_func *compfunctbl[65536];
......@@ -175,9 +175,9 @@ STATIC_INLINE blockinfo* get_blockinfo_addr(void* addr)
blockinfo* bi=get_blockinfo(cacheline(addr));
while (bi) {
if (bi->pc_p==addr)
return bi;
bi=bi->next_same_cl;
if (bi->pc_p==addr)
return bi;
bi=bi->next_same_cl;
}
return NULL;
}
......@@ -192,21 +192,21 @@ STATIC_INLINE void remove_from_cl_list(blockinfo* bi)
uae_u32 cl=cacheline(bi->pc_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)
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)
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
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)
{
if (bi->prev_p)
*(bi->prev_p)=bi->next;
*(bi->prev_p)=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)
......@@ -220,7 +220,7 @@ STATIC_INLINE void add_to_cl_list(blockinfo* bi)
uae_u32 cl=cacheline(bi->pc_p);
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;
cache_tags[cl+1].bi=bi;
......@@ -238,7 +238,7 @@ STATIC_INLINE void raise_in_cl_list(blockinfo* bi)
STATIC_INLINE void add_to_active(blockinfo* bi)
{
if (active)
active->prev_p=&(bi->next);
active->prev_p=&(bi->next);
bi->next=active;
active=bi;
......@@ -248,7 +248,7 @@ STATIC_INLINE void add_to_active(blockinfo* bi)
STATIC_INLINE void add_to_dormant(blockinfo* bi)
{
if (dormant)
dormant->prev_p=&(bi->next);
dormant->prev_p=&(bi->next);
bi->next=dormant;
dormant=bi;
......@@ -258,9 +258,9 @@ STATIC_INLINE void add_to_dormant(blockinfo* bi)
STATIC_INLINE void remove_dep(dependency* d)
{
if (d->prev_p)
*(d->prev_p)=d->next;
*(d->prev_p)=d->next;
if (d->next)
d->next->prev_p=d->prev_p;
d->next->prev_p=d->prev_p;
d->prev_p=NULL;
d->next=NULL;
}
......@@ -343,16 +343,16 @@ STATIC_INLINE void big_to_small_state(bigstate* b, smallstate* s)
int count=0;
for (i=0;i<N_REGS;i++) {
s->nat[i].validsize=0;
s->nat[i].dirtysize=0;
if (b->nat[i].nholds) {
int index=b->nat[i].nholds-1;
int r=b->nat[i].holds[index];
s->nat[i].holds=r;
s->nat[i].validsize=b->state[r].validsize;
s->nat[i].dirtysize=b->state[r].dirtysize;
count++;
}
s->nat[i].validsize=0;
s->nat[i].dirtysize=0;
if (b->nat[i].nholds) {
int index=b->nat[i].nholds-1;
int r=b->nat[i].holds[index];
s->nat[i].holds=r;
s->nat[i].validsize=b->state[r].validsize;
s->nat[i].dirtysize=b->state[r].dirtysize;
count++;
}
}
write_log ("JIT: count=%d\n",count);
for (i=0;i<N_REGS;i++) { // FIXME --- don't do dirty yet
......@@ -427,12 +427,13 @@ STATIC_INLINE void alloc_blockinfos(void)
/********************************************************************
* 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;
static int cachesize_prev, comptrust_prev, canbang_prev;
bool changed = 0;
static int cachesize_prev, comptrust_prev;
static bool canbang_prev;
if (currprefs.comptrustbyte != changed_prefs.comptrustbyte ||
currprefs.comptrustword != changed_prefs.comptrustword ||
......@@ -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))
{
if (isconst(d)) {
COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return;
COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return;
}
if (isconst(s)) {
COMPCALL(mov_w_Ri)(d,(uae_u16)live.state[s].val,offset);
return;
COMPCALL(mov_w_Ri)(d,(uae_u16)live.state[s].val,offset);
return;
}
CLOBBER_MOV;
......@@ -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))
{
if (isconst(d)) {
COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return;
COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return;
}
if (isconst(s)) {
COMPCALL(mov_b_Ri)(d,(uae_u8)live.state[s].val,offset);
return;
COMPCALL(mov_b_Ri)(d,(uae_u8)live.state[s].val,offset);
return;
}
CLOBBER_MOV;
......@@ -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))
{
if (isconst(s)) {
COMPCALL(mov_l_ri)(d,live.state[s].val+offset);
return;
COMPCALL(mov_l_ri)(d,live.state[s].val+offset);
return;
}
#if USE_OFFSET
if (d==s) {
add_offset(d,offset);
return;
add_offset(d,offset);
return;
}
#endif
CLOBBER_LEA;
......@@ -3053,8 +3054,8 @@ MIDFUNC(3,mov_l_bRr,(R4 d, R4 s, IMM offset))
{
int dreg=d;
if (isconst(d)) {
COMPCALL(mov_l_mr)(live.state[d].val+offset,s);
return;
COMPCALL(mov_l_mr)(live.state[d].val+offset,s);
return;
}
CLOBBER_MOV;
......@@ -3074,8 +3075,8 @@ MIDFUNC(3,mov_w_bRr,(R4 d, R2 s, IMM offset))
int dreg=d;
if (isconst(d)) {
COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return;
COMPCALL(mov_w_mr)(live.state[d].val+offset,s);
return;
}
CLOBBER_MOV;
......@@ -3092,8 +3093,8 @@ MIDFUNC(3,mov_b_bRr,(R4 d, R1 s, IMM offset))
{
int dreg=d;
if (isconst(d)) {
COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return;
COMPCALL(mov_b_mr)(live.state[d].val+offset,s);
return;
}
CLOBBER_MOV;
......@@ -3111,9 +3112,9 @@ MIDFUNC(1,gen_bswap_32,(RW4 r))
int reg=r;
if (isconst(r)) {
uae_u32 oldv=live.state[r].val;
live.state[r].val=reverse32(oldv);
return;
uae_u32 oldv=live.state[r].val;
live.state[r].val=reverse32(oldv);
return;
}
CLOBBER_SW32;
......@@ -3126,10 +3127,10 @@ MENDFUNC(1,gen_bswap_32,(RW4 r))
MIDFUNC(1,gen_bswap_16,(RW2 r))
{
if (isconst(r)) {
uae_u32 oldv=live.state[r].val;
live.state[r].val=((oldv>>8)&0xff) | ((oldv<<8)&0xff00) |
(oldv&0xffff0000);
return;
uae_u32 oldv=live.state[r].val;
live.state[r].val=((oldv>>8)&0xff) | ((oldv<<8)&0xff00) |
(oldv&0xffff0000);
return;
}
CLOBBER_SW16;
......@@ -3147,11 +3148,11 @@ MIDFUNC(2,mov_l_rr,(W4 d, R4 s))
int olds;
if (d==s) { /* How pointless! */
return;
return;
}
if (isconst(s)) {
COMPCALL(mov_l_ri)(d,live.state[s].val);
return;
COMPCALL(mov_l_ri)(d,live.state[s].val);
return;
}
#if USE_ALIAS
olds=s;
......@@ -3186,8 +3187,8 @@ MENDFUNC(2,mov_l_rr,(W4 d, R4 s))
MIDFUNC(2,mov_l_mr,(IMM d, R4 s))
{
if (isconst(s)) {
COMPCALL(mov_l_mi)(d,live.state[s].val);
return;
COMPCALL(mov_l_mi)(d,live.state[s].val);
return;
}
CLOBBER_MOV;
s=readreg(s,4);
......@@ -3201,8 +3202,8 @@ MENDFUNC(2,mov_l_mr,(IMM d, R4 s))
MIDFUNC(2,mov_w_mr,(IMM d, R2 s))
{
if (isconst(s)) {
COMPCALL(mov_w_mi)(d,(uae_u16)live.state[s].val);
return;
COMPCALL(mov_w_mi)(d,(uae_u16)live.state[s].val);
return;
}
CLOBBER_MOV;
s=readreg(s,2);
......@@ -3225,8 +3226,8 @@ MENDFUNC(2,mov_w_rm,(W2 d, IMM s))
MIDFUNC(2,mov_b_mr,(IMM d, R1 s))
{
if (isconst(s)) {
COMPCALL(mov_b_mi)(d,(uae_u8)live.state[s].val);
return;
COMPCALL(mov_b_mi)(d,(uae_u8)live.state[s].val);
return;
}
CLOBBER_MOV;
......
......@@ -68,7 +68,7 @@
#define SPRBORDER 0
STATIC_INLINE int nocustom (void)
STATIC_INLINE bool nocustom (void)
{
if (picasso_on && currprefs.picasso96_nocustom)
return 1;
......@@ -141,7 +141,9 @@ extern uae_u8* compiled_code;
int vpos;
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 enum nln_how nextline_how;
static int lof_changed = 0;
......@@ -262,6 +264,7 @@ enum diw_states
int plffirstline, plflastline;
int plffirstline_total, plflastline_total;
static int autoscale_bordercolors;
int plfstrt_start, plfstrt, plfstop;
static int sprite_minx, sprite_maxx;
static int first_bpl_vpos;
......@@ -841,7 +844,10 @@ STATIC_INLINE void compute_delay_offset (void)
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++].value = value;
curr_color_changes[next_color_change].regno = -1;
......@@ -1798,11 +1804,11 @@ static void start_bpl_dma (int hpos, int hstart)
if (doflickerfix () && interlace_seen && !scandoubled_line) {
int i;
for (i = 0; i < 8; i++) {
prevbpl[lof_store][vpos][i] = bplptx[i];
if (!lof_store && (bplcon0 & 4))
bplpt[i] = prevbpl[1 - lof_store][vpos][i];
prevbpl[lof_current][vpos][i] = bplptx[i];
if (!lof_current && (bplcon0 & 4))
bplpt[i] = prevbpl[1 - lof_current][vpos][i];
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)
}
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
if (vpos < first_planes_vpos || vpos < plffirstline_total)
plffirstline_total = first_planes_vpos = vpos - 2;
if (vpos > last_planes_vpos || vpos > plflastline_total)
plflastline_total = last_planes_vpos = vpos + 3;
if (vpos >= minfirstline) {
int vpos2 = autoscale_bordercolors ? minfirstline : vpos;
if (first_planes_vpos == 0)
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)
#endif
}
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)
int ovblank = vblank_hz;
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);
if (!isvsync () && ((currprefs.chipset_refreshrate == 50 && !currprefs.ntscmode) ||
......@@ -2915,8 +2929,8 @@ static uae_u32 REGPARAM2 timehack_helper (TrapContext *context)
timehack_alive = 10;
gettimeofday (&tv, NULL);
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), tv.tv_sec - (((365 * 8 + 2) * 24) * 60 * 60));
x_put_long (m68k_areg (regs, 0) + 4, tv.tv_usec);
return 0;
#else
return 2;
......@@ -2997,7 +3011,7 @@ STATIC_INLINE uae_u16 VPOSR (void)
if (hp + HPOS_OFFSET >= maxhpos) {
vp++;
if (vp >= maxvpos + lof_current)
if (vp >= maxvpos + lof_store)
vp = 0;
}
vp = (vp >> 8) & 7;
......@@ -3017,12 +3031,12 @@ STATIC_INLINE uae_u16 VPOSR (void)
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
vp &= 1;
vp = vp | (lof_current ? 0x8000 : 0) | csbit;
vp = vp | (lof_store ? 0x8000 : 0) | csbit;
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
vp |= lol ? 0x80 : 0;
#if 0
if (M68K_GETPC < 0xf00000)
write_log ("VPOSR %04x at %08x\n", vp, M68K_GETPC);
if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000)
write_log (L"VPOSR %04x at %08x\n", vp, M68K_GETPC);
#endif
if (currprefs.cpu_model >= 68020)
hsyncdelay ();
......@@ -3035,9 +3049,9 @@ static void VPOSW (uae_u16 v)
if (M68K_GETPC < 0xf00000 || 1)
write_log ("VPOSW %04X PC=%08x\n", v, M68K_GETPC);
#endif
if (lof_current != ((v & 0x8000) ? 1 : 0)) {
if (lof_store != ((v & 0x8000) ? 1 : 0)) {
lof_changed = 1;
lof_current = (v & 0x8000) ? 1 : 0;
lof_store = (v & 0x8000) ? 1 : 0;
}
if (currprefs.chipset_mask & CSMASK_ECS_AGNUS)
lol = (v & 0x0080) ? 1 : 0;
......@@ -3070,7 +3084,7 @@ STATIC_INLINE uae_u16 VHPOSR (void)
if (hp >= maxhpos) {
hp -= maxhpos;
vp++;
if (vp >= maxvpos + lof_current)
if (vp >= maxvpos + lof_store)
vp = 0;
}
hp += 1;
......@@ -3082,8 +3096,8 @@ STATIC_INLINE uae_u16 VHPOSR (void)
if (currprefs.cpu_model >= 68020)
hsyncdelay ();
#if 0
if (M68K_GETPC < 0xf00000 && (vpos >= maxhpos || vpos <= 1))
write_log ("VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC);
if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000)
write_log ("VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC);
#endif
return vp;
}
......@@ -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);
#endif
s->dmastate = 0;
#if 1
#if 0
if (vpos == s->vstop) {
spr_arm (num, 0);
//return;
......@@ -4905,6 +4919,8 @@ static void init_hardware_frame (void)
ddflastword_total = 0;
plflastline_total = 0;
plffirstline_total = maxvpos;
plffirstline_total = maxvpos;
autoscale_bordercolors = 0;
for (i = 0; i < MAX_SPRITES; i++)
spr[i].ptxhpos = MAXHPOS;
}
......@@ -5070,8 +5086,8 @@ static void vsync_handler (void)
write_log ("vblank interrupt not cleared\n");
#endif
if (bplcon0 & 4)
lof_current = lof_current ? 0 : 1;
lof_store = lof_current;
lof_store = lof_store ? 0 : 1;
lof_current = lof_store;
#ifdef PICASSO96
picasso_handle_vsync ();
......@@ -5317,6 +5333,12 @@ void hsync_handler (void)
if (islinetoggle ())
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;
eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME;
......@@ -5359,7 +5381,7 @@ void hsync_handler (void)
vpos_count++;
if (vpos >= maxvpos_total)
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
if ((bplcon0 & 8) && !lightpen_triggered) {
vpos_lpen = vpos - 1;
......@@ -5409,7 +5431,7 @@ void hsync_handler (void)
strobe = 0x38;
else if (vpos < minfirstline)
strobe = 0x3a;
else if (vpos + 1 == maxvpos + lof_current)
else if (vpos + 1 == maxvpos + lof_store)
strobe = 0x38;
else if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && lol)
strobe = 0x3e;
......@@ -5442,7 +5464,7 @@ void hsync_handler (void)
}
} else {
#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
}
#endif
......@@ -5459,8 +5481,8 @@ void hsync_handler (void)
} else if (currprefs.gfx_linedbl && (doublescan <= 0 || interlace_seen > 0)) {
lineno *= 2;
nextline_how = currprefs.gfx_linedbl == 1 ? nln_doubled : nln_nblack;
if ((bplcon0 & 4) || (interlace_seen > 0 && !lof_store)) {
if (!lof_store) {
if ((bplcon0 & 4) || (interlace_seen > 0 && !lof_current)) {
if (!lof_current) {
lineno++;
nextline_how = nln_lower;
} else {
......@@ -6370,7 +6392,7 @@ uae_u8 *restore_custom (uae_u8 *src)
dsklen = RW; /* 024 DSKLEN */
RW; /* 026 DSKDAT */
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 */
COPCON (RW); /* 02E COPCON */
RW; /* 030 SERDAT* */
......@@ -6528,7 +6550,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full)
SW (dsklen); /* 024 DSKLEN */
SW (0); /* 026 DSKDAT */
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 (copcon); /* 02E COPCON */
SW (serper); /* 030 SERDAT * */
......@@ -7018,7 +7040,7 @@ int is_cycle_ce (void)
#endif
int ispal (void)
bool ispal (void)
{
if (beamcon0 & 0x80)
return currprefs.ntscmode == 0;
......
......@@ -112,7 +112,7 @@ typedef struct {
uae_u16 len;
uae_u32 offs;
unsigned int bitlen, track;
unsigned int sync;
uae_u16 sync;
image_tracktype type;
int revolutions;
} trackid;
......@@ -143,10 +143,10 @@ typedef struct {
trackid writetrackdata[MAX_TRACKS];
int buffered_cyl, buffered_side;
unsigned int cyl;
int motoroff;
bool motoroff;
int motordelay; /* dskrdy needs some clock cycles before it changes after switching off motor */
int state;
int wrprot;
bool state;
bool wrprot;
uae_u16 bigmfmbuf[0x4000 * DDHDMULT];
uae_u16 tracktiming[0x4000 * DDHDMULT];
int multi_revolution;
......@@ -160,9 +160,9 @@ typedef struct {
int dmalen;
unsigned int num_tracks, write_num_tracks, num_secs;
unsigned int hard_num_cyls;
int dskchange;
bool dskchange;
int dskchange_time;
int dskready;
bool dskready;
int dskready_time;
int dskready_down_time;
int writtento;
......@@ -636,7 +636,7 @@ static void reset_drive(int i)
static void update_drive_gui (int 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]
&& drv->cyl == gui_data.drive_track[num]
......@@ -651,7 +651,7 @@ static void update_drive_gui (int num)
gui_data.drive_track[num] = drv->cyl;
gui_data.drive_side = side;
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);
......@@ -783,7 +783,7 @@ static struct zfile *getwritefile (const char *name, int *wrprot)
static int iswritefileempty (const char *name)
{
struct zfile *zf;
int wrprot;
bool wrprot;
uae_char buffer[8];
trackid td[MAX_TRACKS];
unsigned int tracks, i, ret;
......@@ -806,7 +806,7 @@ static int iswritefileempty (const char *name)
static int openwritefile (drive *drv, int create)
{
int wrprot = 0;
bool wrprot = 0;
drv->writediskfile = getwritefile (currprefs.df[drv - &floppy[0]], &wrprot);
if (drv->writediskfile) {
......@@ -825,10 +825,10 @@ static int openwritefile (drive *drv, int create)
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;
int wrprot1 = 0, wrprot2 = 1;
bool wrprot1 = 0, wrprot2 = 1;
unsigned char buffer[25];
*needwritefile = 0;
......@@ -2065,11 +2065,11 @@ void disk_creatediskfile (char *name, int type, drive_type adftype, const char *
}
track_len = FLOPPY_WRITE_LEN * 2;
if (adftype == 1 || adftype == 3) {
file_size *= 2;
track_len *= 2;
file_size *= 2;
track_len *= 2;
} else if (adftype == 4) {
file_size /= 2;
tracks /= 2;
file_size /= 2;
tracks /= 2;
}
f = zfile_fopen (name, "wb", 0);
......@@ -2454,7 +2454,7 @@ void DISK_select (uae_u8 data)
}
prevdata = data;
if (disk_debug_logging > 1)
write_log ("\n");
write_log ("\n");
}
uae_u8 DISK_status (void)
......
......@@ -69,8 +69,8 @@ static void lores_reset (void)
sprite_buffer_res++;
}
int aga_mode; /* mirror of chipset_mask & CSMASK_AGA */
int direct_rgb;
bool aga_mode; /* mirror of chipset_mask & CSMASK_AGA */
bool direct_rgb;
/* The shift factor to apply when converting between Amiga coordinates and window
coordinates. Zero if the resolution is the same, positive if window coordinates
......@@ -214,8 +214,8 @@ static uae_u32 plf_sprite_mask;
static int sbasecol[2] = { 16, 16 };
static int brdsprt, brdblank, brdblank_changed;
int picasso_requested_on;
int picasso_on;
bool picasso_requested_on;
bool picasso_on;
uae_sem_t gui_sem;
int inhibit_frame;
......@@ -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)
{
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)
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)
{
uae_u16 *b = (uae_u16 *)buf;
......@@ -736,7 +709,6 @@ static void pfield_do_fill_line (int start, int stop)
{
xlinecheck(start, stop);
switch (gfxvidinfo.pixbytes) {
case 1: fill_line_8 (xlinebuffer, start, stop); break;
case 2: fill_line_16 (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)
if (issprites) {
if (res_shift == 0) {
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 4: src_pixel = linetoscr_32_spr (src_pixel, start, stop); break;
}
} else if (res_shift == 2) {
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 4: src_pixel = linetoscr_32_stretch2_spr (src_pixel, start, stop); break;
}
} else if (res_shift == 1) {
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 4: src_pixel = linetoscr_32_stretch1_spr (src_pixel, start, stop); break;
}
} else if (res_shift == -1) {
if (currprefs.gfx_lores_mode) {
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 4: src_pixel = linetoscr_32_shrink1f_spr (src_pixel, start, stop); break;
}
} else {
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 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)
} else {
if (res_shift == 0) {
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 4: src_pixel = linetoscr_32 (src_pixel, start, stop); break;
}
} else if (res_shift == 2) {
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 4: src_pixel = linetoscr_32_stretch2 (src_pixel, start, stop); break;
}
} else if (res_shift == 1) {
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 4: src_pixel = linetoscr_32_stretch1 (src_pixel, start, stop); break;
}
} else if (res_shift == -1) {
if (currprefs.gfx_lores_mode) {
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 4: src_pixel = linetoscr_32_shrink1f (src_pixel, start, stop); break;
}
} else {
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 4: src_pixel = linetoscr_32_shrink1 (src_pixel, start, stop); break;
}
......@@ -1863,7 +1825,7 @@ static void pfield_expand_dp_bplcon (void)
#endif
}
static int isham (uae_u16 bplcon0)
static bool isham (uae_u16 bplcon0)
{
int p = GET_PLANES (bplcon0);
if (!(bplcon0 & 0x800))
......@@ -2297,6 +2259,7 @@ static int frame_res_cnt;
static void init_drawing_frame (void)
{
int i, maxline;
#if 1
static int frame_res_old;
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)
can_use_lores++;
lores_reset ();
}
#endif
init_hardware_for_drawing_frame ();
......@@ -2376,9 +2340,7 @@ static void init_drawing_frame (void)
first_drawn_line = 32767;
first_block_line = last_block_line = NO_BLOCK;
if (currprefs.test_drawing_speed)
frame_redraw_necessary = 1;
else if (frame_redraw_necessary)
if (frame_redraw_necessary)
frame_redraw_necessary--;
center_image ();
......@@ -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;
} else if (led == LED_POWER) {
pos = 3;
//on = gui_data.powerled_brightness > 0;
on_rgb = ((gui_data.powerled_brightness * 10 / 16) + 0x33) << 16;
on = gui_data.powerled;
//on_rgb = 0xcc0000;
on = 1;
off_rgb = 0x330000;
} else if (led == LED_CD) {
pos = 5;
......
......@@ -131,7 +131,8 @@ uaecptr ROM_filesys_resname, ROM_filesys_resid;
uaecptr ROM_filesys_diagentry;
uaecptr ROM_hardfile_resname, ROM_hardfile_resid;
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)
static uae_u32 fastmem_mask;
static uae_u32 fastmem_lget (uaecptr) REGPARAM;
static uae_u32 fastmem_wget (uaecptr) REGPARAM;
static uae_u32 fastmem_bget (uaecptr) REGPARAM;
static void fastmem_lput (uaecptr, uae_u32) REGPARAM;
static void fastmem_wput (uaecptr, uae_u32) REGPARAM;
static void fastmem_bput (uaecptr, uae_u32) REGPARAM;
static int fastmem_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *fastmem_xlate (uaecptr addr) REGPARAM;
static uae_u32 REGPARAM3 fastmem_lget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 fastmem_wget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 fastmem_bget (uaecptr) REGPARAM;
static void REGPARAM3 fastmem_lput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 fastmem_wput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 fastmem_bput (uaecptr, uae_u32) REGPARAM;
static int REGPARAM3 fastmem_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *REGPARAM3 fastmem_xlate (uaecptr addr) REGPARAM;
uaecptr fastmem_start; /* Determined by the OS */
static uae_u8 *fastmemory;
......@@ -485,14 +486,14 @@ addrbank fastmem_bank = {
* Catweasel ZorroII
*/
static uae_u32 catweasel_lget (uaecptr) REGPARAM;
static uae_u32 catweasel_wget (uaecptr) REGPARAM;
static uae_u32 catweasel_bget (uaecptr) REGPARAM;
static void catweasel_lput (uaecptr, uae_u32) REGPARAM;
static void catweasel_wput (uaecptr, uae_u32) REGPARAM;
static void catweasel_bput (uaecptr, uae_u32) REGPARAM;
static int catweasel_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *catweasel_xlate (uaecptr addr) REGPARAM;
static uae_u32 REGPARAM3 catweasel_lget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 catweasel_wget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 catweasel_bget (uaecptr) REGPARAM;
static void REGPARAM3 catweasel_lput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 catweasel_wput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 catweasel_bput (uaecptr, uae_u32) REGPARAM;
static int REGPARAM3 catweasel_check (uaecptr addr, uae_u32 size) REGPARAM;
static uae_u8 *REGPARAM3 catweasel_xlate (uaecptr addr) REGPARAM;
static uae_u32 catweasel_mask;
static uae_u32 catweasel_start;
......@@ -614,12 +615,12 @@ static void expamem_init_catweasel (void)
* This is very simple, the Amiga shouldn't be doing things with it.
*/
static uae_u32 filesys_lget (uaecptr) REGPARAM;
static uae_u32 filesys_wget (uaecptr) REGPARAM;
static uae_u32 filesys_bget (uaecptr) REGPARAM;
static void filesys_lput (uaecptr, uae_u32) REGPARAM;
static void filesys_wput (uaecptr, uae_u32) REGPARAM;
static void filesys_bput (uaecptr, uae_u32) REGPARAM;
static uae_u32 REGPARAM3 filesys_lget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 filesys_wget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 filesys_bget (uaecptr) REGPARAM;
static void REGPARAM3 filesys_lput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 filesys_wput (uaecptr, uae_u32) REGPARAM;
static void REGPARAM3 filesys_bput (uaecptr, uae_u32) REGPARAM;
static uae_u32 filesys_start; /* Determined by the OS */
uae_u8 *filesysory;
......
This diff is collapsed.
This diff is collapsed.
......@@ -463,10 +463,10 @@ int main (int argc, char *argv[])
do_bigendian = 0;
for (i = 1; i < argc; i++) {
if (argv[i][0] != '-')
continue;
if (argv[i][1] == 'b' && argv[i][2] == '\0')
do_bigendian = 1;
if (argv[i][0] != '-')
continue;
if (argv[i][1] == 'b' && argv[i][2] == '\0')
do_bigendian = 1;
}
set_outfile (stdout);
......@@ -478,15 +478,15 @@ int main (int argc, char *argv[])
outln (" */");
outln ("");
for (bpp = DEPTH_8BPP; bpp <= DEPTH_MAX; bpp++) {
for (aga = 0; aga <= 1 ; aga++) {
if (aga && bpp == DEPTH_8BPP)
continue;
for (spr = 0; spr <= 1; spr++) {
for (hmode = HMODE_NORMAL; hmode <= HMODE_MAX; hmode++)
out_linetoscr (bpp, hmode, aga, spr);
}
}
for (bpp = DEPTH_16BPP; bpp <= DEPTH_MAX; bpp++) {
for (aga = 0; aga <= 1 ; aga++) {
if (aga && bpp == DEPTH_8BPP)
continue;
for (spr = 0; spr <= 1; spr++) {
for (hmode = HMODE_NORMAL; hmode <= HMODE_MAX; hmode++)
out_linetoscr (bpp, hmode, aga, spr);
}
}
}
return 0;
}
......@@ -69,7 +69,7 @@ static int init_kb (void)
get_key_info (&lastKeyInfo);
default_keyboard = uaekey_make_default_kbr (beos_keymap);
inputdevice_setkeytranslation (default_keyboard);
inputdevice_setkeytranslation (default_keyboard, kbmaps);
set_default_hotkeys (beos_hotkeys);
return 1;
......
......@@ -2049,7 +2049,7 @@ static int init_kb (void)
/* See if we support raw keys on this platform */
if ((keymap = get_default_raw_keymap (get_sdlgfx_type ())) != 0) {
inputdevice_setkeytranslation (keymap);
inputdevice_setkeytranslation (keymap, kbmaps);
have_rawkeys = 1;
}
switch_keymaps ();
......
......@@ -1685,7 +1685,7 @@ static int init_kb (void)
{
if (currprefs.map_raw_keys) {
if (rawkeys_available) {
inputdevice_setkeytranslation (raw_keyboard);
inputdevice_setkeytranslation (raw_keyboard, kbmaps);
set_default_hotkeys (x11pc_hotkeys);
write_log ("X11GFX: Enabling raw key-mapping.\n");
} else {
......
......@@ -519,7 +519,7 @@ extern void empty_optimizer(void);
#define comp_get_ilong(o) do_get_mem_long((uae_u32 *)(comp_pc_p + (o)))
/* Preferences handling */
int check_prefs_changed_comp (void);
bool check_prefs_changed_comp (void);
struct blockinfo_t;
......
......@@ -216,16 +216,16 @@ STATIC_INLINE void put_long_ce020 (uaecptr addr, uae_u32 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);
}
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);
}
extern void fill_cache0x0 (uae_u32);
extern void fill_icache020 (uae_u32);
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) {
uae_u32 v = regs.prefetch020data & 0xffff;
fill_cache0x0 (pc + 2);
fill_icache020 (pc + 2);
return v;
}
fill_cache0x0 (pc);
fill_icache020 (pc);
}
}
......@@ -265,8 +265,106 @@ STATIC_INLINE uae_u32 next_ilong_020ce (void)
m68k_incpc (4);
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
#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
STATIC_INLINE void ipl_fetch (void)
......@@ -294,6 +392,7 @@ STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr)
case CE_MEMBANK_CHIP:
return wait_cpu_cycle_read (addr, 1);
case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4);
break;
}
......@@ -307,6 +406,7 @@ STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr)
case CE_MEMBANK_CHIP:
return wait_cpu_cycle_read (addr, 0);
case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4);
break;
......@@ -321,6 +421,7 @@ STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v)
wait_cpu_cycle_write (addr, 0, v);
return;
case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4);
break;
}
......@@ -335,12 +436,19 @@ STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v)
return;
break;
case CE_MEMBANK_FAST:
case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4);
break;
}
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)
{
return mem_access_delay_word_read (addr);
......@@ -349,12 +457,10 @@ STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr)
{
return mem_access_delay_wordi_read (addr);
}
STATIC_INLINE uae_u32 get_byte_ce (uaecptr addr)
{
return mem_access_delay_byte_read (addr);
}
STATIC_INLINE uae_u32 get_word_ce_prefetch (int o)
{
uae_u32 v = regs.irc;
......@@ -362,12 +468,16 @@ STATIC_INLINE uae_u32 get_word_ce_prefetch (int o)
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);
}
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u8 v)
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u32 v)
{
mem_access_delay_byte_write (addr, v);
}
......@@ -400,5 +510,3 @@ STATIC_INLINE void m68k_do_jsr_ce (uaecptr oldpc, uaecptr dest)
m68k_setpc (dest);
}
#endif
......@@ -31,8 +31,8 @@ extern void init_row_map (void);
extern void init_hz (void);
extern void init_custom (void);
extern int picasso_requested_on;
extern int picasso_on;
extern bool picasso_requested_on;
extern bool picasso_on;
extern void set_picasso_hack_rate (int hz);
/* Set to 1 to leave out the current frame in average frame time calculation.
......@@ -207,6 +207,6 @@ struct customhack {
void customhack_put (struct customhack *ch, uae_u16 v, int hpos);
uae_u16 customhack_get (struct customhack *ch, int hpos);
extern void alloc_cycle_ext (int, int);
extern int ispal (void);
extern bool ispal (void);
#define HSYNCTIME (maxhpos * CYCLE_UNIT);
......@@ -40,7 +40,7 @@
#define max_diwlastword (PIXEL_XPOS(0x1d4 >> 1))
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)
{
......@@ -181,7 +181,7 @@ struct sprite_entry
unsigned short pos;
unsigned short max;
unsigned int first_pixel;
unsigned int has_attached;
bool has_attached;
};
union sps_union {
......@@ -227,9 +227,9 @@ struct decision {
#endif
uae_u8 nr_planes;
uae_u8 bplres;
unsigned int ehb_seen;
unsigned int ham_seen;
unsigned int ham_at_start;
bool ehb_seen;
bool ham_seen;
bool ham_at_start;
};
/* Anything related to changes in hw registers during the DDF for one
......
......@@ -25,7 +25,7 @@ extern unsigned int gui_ledstate;
extern void gui_display (int shortcut);
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_ACTIVE2 2
......
This diff is collapsed.
......@@ -12,6 +12,5 @@ extern int keys_available (void);
extern int record_key (int);
extern int record_key_direct (int);
extern void keybuf_init (void);
extern void joystick_setting_changed (void);
extern int getcapslockstate (void);
extern void setcapslockstate (int);
......@@ -21,7 +21,8 @@ extern void cache_free (uae_u8*);
int init_shm (void);
void preinit_shm (void);
extern int canbang, candirect;
extern bool canbang;
extern int candirect;
#endif
#ifdef ADDRESS_SPACE_24BIT
......@@ -66,10 +67,11 @@ extern uaecptr p96ram_start;
extern uaecptr fastmem_start;
extern uaecptr a3000lmem_start, a3000hmem_start;
extern int ersatzkickfile;
extern int cloanto_rom, kickstart_rom;
extern bool ersatzkickfile;
extern bool cloanto_rom, kickstart_rom;
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 uae_u8* baseaddr[];
......@@ -104,7 +106,7 @@ typedef struct {
#define CE_MEMBANK_CHIP 1
#define CE_MEMBANK_CIA 2
#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 *rtarea;
......@@ -136,7 +138,6 @@ extern void expamem_next (void);
extern uae_u32 gfxmem_start;
extern uae_u8 *gfxmemory;
extern uae_u32 gfxmem_mask;
extern int address_space_24;
extern uae_u16 last_custom_value1;
/* Default memory access functions */
......
......@@ -47,8 +47,8 @@ extern int fpp_movem_index2[256];
extern int fpp_movem_next[256];
#endif
typedef unsigned long cpuop_func (uae_u32) REGPARAM;
typedef void cpuop_func_ce (uae_u32) REGPARAM;
typedef unsigned long REGPARAM3 cpuop_func (uae_u32) REGPARAM;
typedef void REGPARAM3 cpuop_func_ce (uae_u32) REGPARAM;
struct cputbl {
cpuop_func *handler;
......@@ -65,7 +65,7 @@ struct comptbl {
};
#endif
extern unsigned long op_illg (uae_u32) REGPARAM;
extern unsigned long REGPARAM3 op_illg (uae_u32) REGPARAM;
typedef uae_u8 flagtype;
......@@ -94,13 +94,22 @@ struct cache020
{
uae_u32 data;
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
struct cache040set
{
uae_u32 data[4];
int valid[4];
bool valid[4];
uae_u32 tag;
};
#define CACHELINES040 4
......@@ -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));
}
#define m68k_incpc(o) ((regs).pc_p += (o))
STATIC_INLINE void m68k_incpc (int o)
{
regs.pc_p += o;
}
#ifdef MMU
STATIC_INLINE void m68k_setpc_mmu (uaecptr newpc)
{
......@@ -251,10 +263,19 @@ STATIC_INLINE void m68k_do_bsri (uaecptr oldpc, uae_s32 offset)
put_long(m68k_areg (regs, 7), oldpc);
m68k_incpci(offset);
}
#define get_ibyte(o) do_get_mem_byte((uae_u8 *)((regs).pc_p + (o) + 1))
#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)))
STATIC_INLINE uae_u32 get_ibyte (int 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_ilongi(o) get_longi(o)
......@@ -292,19 +313,26 @@ STATIC_INLINE uae_u32 next_ilongi (void)
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_resumestopped (void);
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_040mmu (uae_u32 base, uae_u32 dp) REGPARAM;
extern uae_u32 REGPARAM3 get_disp_ea_000 (uae_u32 base, uae_u32 dp) 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 uae_u32 REGPARAM3 get_disp_ea_000 (uae_u32 base, uae_u32 dp);
extern uae_u32 REGPARAM3 get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, int width) REGPARAM;
extern void REGPARAM3 put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 offset, int width) REGPARAM;
extern int get_cpu_model(void);
......@@ -313,9 +341,9 @@ extern int get_cpu_model(void);
# undef Exception
#endif
extern void MakeSR (void) REGPARAM;
extern void MakeFromSR (void) REGPARAM;
extern void Exception (int, uaecptr) REGPARAM;
extern void REGPARAM3 MakeSR (void) REGPARAM;
extern void REGPARAM3 MakeFromSR (void) REGPARAM;
extern void REGPARAM3 Exception (int, uaecptr) REGPARAM;
extern void NMI (void);
extern void NMI_delayed (void);
extern void prepare_interrupt (uae_u32);
......@@ -385,9 +413,9 @@ extern const struct cputbl op_smalltbl_12_ff[];
extern cpuop_func *cpufunctbl[65536] ASM_SYM_FOR_FUNC ("cpufunctbl");
#ifdef JIT
extern void flush_icache (uaecptr, int n);
extern void flush_icache (uaecptr, int);
extern void compemu_reset (void);
extern int check_prefs_changed_comp (void);
//extern bool check_prefs_changed_comp (void);
#else
#define flush_icache(uaecptr, int) do {} while (0)
#endif
......
This diff is collapsed.
......@@ -409,4 +409,7 @@ extern void xfree (const void*);
#define _tcstol strtol
#define _wunlink unlink
#define _tcsftime strftime
#define bool _Bool
#define true 1
#define false 0
#endif
......@@ -28,7 +28,7 @@ extern void target_run (void);
extern void target_quit (void);
extern int quit_program;
extern int console_emulation;
extern bool console_emulation;
extern char warning_buffer[256];
extern char start_path_data[];
......
......@@ -17,7 +17,7 @@
*/
#define UAEMAJOR 2
#define UAEMINOR 1
#define UAEMINOR 2
#define UAESUBREV 0
#define UAEVERSION (256*65536L*UAEMAJOR + 65536L*UAEMINOR + UAESUBREV)
......
This diff is collapsed.
......@@ -23,13 +23,6 @@
#include "custom.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 keybuf[256];
......@@ -48,16 +41,10 @@ int get_next_key (void)
key = keybuf[kpb_last];
if (++kpb_last == 256)
kpb_last = 0;
kpb_last = 0;
return key;
}
static void do_fake (int nr)
{
int *fake = fakestate[nr];
do_fake_joystick (nr, fake);
}
int record_key (int kc)
{
#ifdef INPREC
......@@ -84,105 +71,10 @@ int record_key_direct (int kc)
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) {
kc ^= AK_RCTRL << 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
if (input_recording > 0) {
......@@ -197,31 +89,6 @@ int record_key_direct (int kc)
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)
{
kpb_first = kpb_last = 0;
......
......@@ -172,7 +172,7 @@ struct uae_input_device_kbr_default *uaekey_make_default_kbr (const struct uaeke
if (trans) {
for (i = 0; i < count; i++) {
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;
}
......
......@@ -66,10 +66,10 @@ int config_changed;
int pissoff_value = 25000;
int pause_emulation;
char start_path_data[MAX_DPATH];
int no_gui = 0, quit_to_gui = 0;
int cloanto_rom = 0;
int kickstart_rom = 1;
int console_emulation = 0;
bool no_gui = 0, quit_to_gui = 0;
bool cloanto_rom = 0;
bool kickstart_rom = 1;
bool console_emulation = 0;
struct gui_info gui_data;
......@@ -825,6 +825,7 @@ static int real_main2 (int argc, char **argv)
currprefs.produce_sound = 0;
}
inputdevice_init ();
inputdevice_setkeytranslation (keytrans, kbmaps);
changed_prefs = currprefs;
no_gui = ! currprefs.start_gui;
......@@ -888,6 +889,7 @@ static int real_main2 (int argc, char **argv)
#ifdef FILESYS
filesys_install ();
#endif
target_startup_sequence (&currprefs);
memory_init ();
memory_reset ();
......@@ -910,7 +912,6 @@ static int real_main2 (int argc, char **argv)
init_m68k(); /* must come after reset_frame_rate_hack (); */
gui_update ();
target_startup_sequence(&currprefs);
if (graphics_init ()) {
#ifdef DEBUGGER
......@@ -945,6 +946,7 @@ static int real_main2 (int argc, char **argv)
void real_main (int argc, char **argv)
{
show_version_full ();
restart_program = 1;
fetch_configurationpath (restart_config, sizeof (restart_config) / sizeof (char));
......@@ -966,7 +968,6 @@ void real_main (int argc, char **argv)
#ifndef NO_MAIN_IN_MAIN_C
int main (int argc, char **argv)
{
show_version_full ();
real_main (argc, argv);
return 0;
}
......
......@@ -37,7 +37,7 @@ extern uae_u8 *natmem_offset, *natmem_offset_end;
#include <sys/mman.h>
#endif
int canbang;
bool canbang;
int candirect = -1;
#ifdef JIT
/* Set by each memory handler that does not simply access real memory. */
......@@ -49,7 +49,7 @@ int special_mem;
#define IPC_CREAT 0x04
#define IPC_STAT 0x08
static int isdirectjit (void)
static bool isdirectjit (void)
{
#ifdef JIT
return currprefs.cachesize && !currprefs.comptrustbyte;
......@@ -58,7 +58,7 @@ static int isdirectjit (void)
#endif
}
static int canjit (void)
static bool canjit (void)
{
#ifdef JIT
if (currprefs.cpu_model < 68020 && currprefs.address_space_24)
......@@ -74,7 +74,7 @@ static void nocanbang (void)
canbang = 0;
}
int ersatzkickfile;
bool ersatzkickfile;
uae_u32 allocated_chipmem;
uae_u32 allocated_fastmem;
......@@ -85,6 +85,7 @@ uae_u32 allocated_a3000lmem;
uae_u32 allocated_a3000hmem;
uae_u32 allocated_cardmem;
uae_u8 ce_banktype[65536];
uae_u8 ce_cachable[65536];
#if defined(CPU_64_BIT)
uae_u32 max_z3fastmem = 2048UL * 1024 * 1024;
......@@ -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,
and we must clear all memory to prevent bogus contents from confusing
the Kickstart. */
static int need_hardreset;
static bool need_hardreset;
/* 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];
......@@ -1024,7 +1025,6 @@ static int extendedkickmem_type;
#define EXTENDED_ROM_KS 3
#define EXTENDED_ROM_ARCADIA 4
//#if defined CDTV || defined CD32
static uae_u32 REGPARAM3 extendedkickmem_lget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 extendedkickmem_wget (uaecptr) REGPARAM;
static uae_u32 REGPARAM3 extendedkickmem_bget (uaecptr) REGPARAM;
......@@ -1158,7 +1158,7 @@ static uae_u8 *REGPARAM2 extendedkickmem2_xlate (uaecptr addr)
addr &= extendedkickmem2_mask;
return extendedkickmemory2 + addr;
}
//#endif //defined CDTV || defined CD32
/* Default memory access functions */
......@@ -1291,7 +1291,6 @@ addrbank kickram_bank = {
kickmem_lget, kickmem_wget, ABFLAG_UNK | ABFLAG_SAFE
};
//#if defined CDTV || defined CD32
addrbank extendedkickmem_bank = {
extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget,
extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput,
......@@ -1304,7 +1303,7 @@ addrbank extendedkickmem2_bank = {
extendedkickmem2_xlate, extendedkickmem2_check, NULL, "Extended 2nd Kickstart ROM",
extendedkickmem2_lget, extendedkickmem2_wget, ABFLAG_ROM
};
//#endif //defined CDTV || defined CD32
static uae_u32 allocated_custmem1, allocated_custmem2;
static uae_u32 custmem1_mask, custmem2_mask;
......@@ -1470,14 +1469,12 @@ void a3000_fakekick (int map)
if (fkickmemory[5] == 0xfc) {
memcpy (kickmemory, fkickmemory, fkickmem_size / 2);
memcpy (kickmemory + fkickmem_size / 2, fkickmemory, fkickmem_size / 2);
//#if defined CDTV || defined CD32
extendedkickmem_size = 65536;
extendedkickmem_mask = extendedkickmem_size - 1;
extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0");
extendedkickmem_bank.baseaddr = extendedkickmemory;
memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
map_banks (&extendedkickmem_bank, 0xf0, 1, 1);
//#endif //defined CDTV || defined CD32
a3000_f0 = 1;
} else {
memcpy (kickmemory, fkickmemory, fkickmem_size);
......@@ -1486,11 +1483,9 @@ void a3000_fakekick (int map)
} else {
if (a3000_f0) {
map_banks (&dummy_bank, 0xf0, 1, 1);
//#if defined CDTV || defined CD32
if (extendedkickmemory)
mapped_free (extendedkickmemory);
extendedkickmemory = NULL;
//#endif //defined CDTV || defined CD32
a3000_f0 = 0;
}
if (kickstore)
......@@ -1588,7 +1583,6 @@ static int read_kickstart (struct zfile *f, uae_u8 *mem, int size, int dochecksu
return i;
}
//#if defined CDTV || defined CD32 || defined ARCADIA
static int load_extendedkickstart (void)
{
struct zfile *f;
......@@ -1638,7 +1632,6 @@ static int load_extendedkickstart (void)
zfile_fclose (f);
return 1;
}
//#endif //defined CDTV || defined CD32 || defined ARCADIA
static int patch_shapeshifter (uae_u8 *kickmemory)
{
......@@ -1703,13 +1696,11 @@ static void patch_kick (void)
if (kickmem_size >= 524288 && currprefs.kickshifter)
patched += patch_shapeshifter (kickmemory);
patched += patch_residents (kickmemory, kickmem_size);
//#if defined CDTV || defined CD32
if (extendedkickmemory) {
patched += patch_residents (extendedkickmemory, extendedkickmem_size);
if (patched)
kickstart_fix_checksum (extendedkickmemory, extendedkickmem_size);
}
//#endif //defined CDTV || defined CD32
if (patched)
kickstart_fix_checksum (kickmemory, kickmem_size);
}
......@@ -1795,7 +1786,6 @@ static int load_kickstart (void)
goto err;
kickmem_mask = size - 1;
kickmem_size = size;
//#if defined CDTV || defined CD32 || defined ARCADIA
if (filesize >= 524288 * 2 && !extendedkickmem_type) {
extendedkickmem_size = 0x80000;
if (currprefs.cs_cdtvcd || currprefs.cs_cdtvram) {
......@@ -1821,7 +1811,6 @@ static int load_kickstart (void)
read_kickstart (f, extendedkickmemory2 + 524288, 524288, 0, 1);
extendedkickmem2_mask = extendedkickmem2_size - 1;
}
//#endif //defined CDTV || defined CD32 || defined ARCADIA
}
#if defined(AMIGA)
......@@ -2177,7 +2166,6 @@ static void allocate_memory (void)
}
need_hardreset = 1;
}
//#if defined CDTV || defined CD32
if (allocated_cardmem != currprefs.cs_cdtvcard * 1024) {
if (cardmemory)
mapped_free (cardmemory);
......@@ -2196,7 +2184,6 @@ static void allocate_memory (void)
cdtv_loadcardmem(cardmemory, allocated_cardmem);
#endif
}
//#endif //defined CDTV || defined CD32
if (allocated_custmem1 != currprefs.custom_memory_sizes[0]) {
if (custmem1)
mapped_free (custmem1);
......@@ -2256,6 +2243,11 @@ static void fill_ce_banks (void)
int i;
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) {
for (i = 0; i < (0x200000 >> 16); i++)
ce_banktype[i] = CE_MEMBANK_CHIP;
......@@ -2270,8 +2262,10 @@ static void fill_ce_banks (void)
addrbank *b;
ce_banktype[i] = CE_MEMBANK_CIA;
b = &get_mem_bank (i << 16);
if (b != &cia_bank)
if (b != &cia_bank) {
ce_banktype[i] = CE_MEMBANK_FAST;
ce_cachable[i] = 1;
}
}
// CD32 ROM is 16-bit
if (currprefs.cs_cd32cd) {
......@@ -2382,7 +2376,6 @@ void memory_reset (void)
memcpy (currprefs.romfile, changed_prefs.romfile, sizeof currprefs.romfile);
memcpy (currprefs.romextfile, changed_prefs.romextfile, sizeof currprefs.romextfile);
need_hardreset = 1;
//#if defined CDTV || defined CD32
if (extendedkickmemory)
mapped_free (extendedkickmemory);
extendedkickmemory = 0;
......@@ -2391,7 +2384,6 @@ void memory_reset (void)
extendedkickmem2_size = 0;
extendedkickmem_type = 0;
load_extendedkickstart ();
//#endif //defined CDTV || defined CD32
kickmem_mask = 524288 - 1;
if (!load_kickstart ()) {
if (_tcslen (currprefs.romfile) > 0) {
......@@ -2531,15 +2523,12 @@ void memory_reset (void)
map_banks (&expamem_bank, 0xE8, 1, 0); /* Map Autoconfig space at 0xE80000 - 0xE8FFFF. */
#endif
//#if defined CDTV || defined CD32
if (a3000_f0)
map_banks (&extendedkickmem_bank, 0xf0, 1, 0);
//#endif //defined CDTV || defined CD32
/* Map the chipmem into all of the lower 8MB */
map_overlay (1);
//#if defined CDTV || defined CD32
switch (extendedkickmem_type) {
case EXTENDED_ROM_KS:
map_banks (&extendedkickmem_bank, 0xE0, 8, 0);
......@@ -2555,7 +2544,6 @@ void memory_reset (void)
break;
#endif //CD32
}
//#endif //defined CDTV || defined CD32
#ifdef AUTOCONFIG
if (need_uae_boot_rom ())
......@@ -2564,7 +2552,6 @@ void memory_reset (void)
if ((cloanto_rom || currprefs.cs_ksmirror_e0) && (currprefs.maprom != 0xe00000) && !extendedkickmem_type)
map_banks (&kickmem_bank, 0xE0, 8, 0);
//#if defined CDTV || defined CD32
if (currprefs.cs_ksmirror_a8) {
if (extendedkickmem2_size) {
map_banks (&extendedkickmem2_bank, 0xa8, 16, 0);
......@@ -2579,7 +2566,7 @@ void memory_reset (void)
}
}
}
//#endif //defined CDTV || defined CD32
if (currprefs.custom_memory_sizes[0]) {
map_banks (&custmem1_bank,
currprefs.custom_memory_addrs[0] >> 16,
......
/*
* A collection of ugly and random junk brought in from Win32
* which desparately needs to be tidied up
*
*
*/
#include "sysconfig.h"
......@@ -787,3 +789,50 @@ end:
recursive--;
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)
void uae_NewList (uaecptr list)
{
put_long_slow (list, list + 4);
put_long_slow (list + 4, 0);
put_long_slow (list + 8, list);
x_put_long (list, list + 4);
x_put_long (list + 4, 0);
x_put_long (list + 8, list);
}
uaecptr uae_AllocMem (TrapContext *context, uae_u32 size, uae_u32 flags)
{
m68k_dreg (regs, 0) = size;
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)
{
m68k_dreg (regs, 0) = size;
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)
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)
{
int i;
......
......@@ -12,9 +12,9 @@ generated by GNU Autoconf 2.65. Invocation command line was
hostname = GnoStiC-dv7
uname -m = i686
uname -r = 2.6.32-21-generic
uname -r = 2.6.32-22-generic
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
/bin/uname -X = unknown
......@@ -445,7 +445,7 @@ configure:4344: $? = 0
configure:4344: result: yes
configure:4350: checking for _doprnt
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'
collect2: ld returned 1 exit status
configure:4350: $? = 1
......@@ -533,7 +533,7 @@ configure:4364: $? = 0
configure:4364: result: yes
configure:4364: checking for strcmpi
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'
collect2: ld returned 1 exit status
configure:4364: $? = 1
......@@ -613,7 +613,7 @@ configure: failed program was:
configure:4364: result: no
configure:4364: checking for stricmp
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'
collect2: ld returned 1 exit status
configure:4364: $? = 1
......
......@@ -4,7 +4,7 @@
* routines to handle compressed file automatically
*
* (c) 1996 Samuel Devulder, Tim Gunn
* 2002-2007 Toni Wilen
* 2002-2007 Toni Wilen
*/
#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