trying to sync rc1

parent 08d195f3
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* Common code needed by all the various graphics systems. * Common code needed by all the various graphics systems.
* *
* (c) 1996 Bernd Schmidt, Ed Hanway, Samuel Devulder * (c) 1996 Bernd Schmidt, Ed Hanway, Samuel Devulder
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.h" #include "sysdeps.h"
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "rtgmodes.h" #include "rtgmodes.h"
#include "xwin.h" #include "xwin.h"
#include "gfxfilter.h" #include "gfxfilter.h"
#include "uae_endian.h" #include "uae_endian.h"
int getvsyncrate (int hz) int getvsyncrate (int hz)
...@@ -22,9 +23,9 @@ int getvsyncrate (int hz) ...@@ -22,9 +23,9 @@ int getvsyncrate (int hz)
return hz; return hz;
} }
#define RED 0 #define RED 0
#define GRN 1 #define GRN 1
#define BLU 2 #define BLU 2
/* /*
* dither matrix * dither matrix
...@@ -39,57 +40,57 @@ static uae_u8 dither[4][4] = ...@@ -39,57 +40,57 @@ static uae_u8 dither[4][4] =
unsigned int doMask (int p, int bits, int shift) unsigned int doMask (int p, int bits, int shift)
{ {
/* scale to 0..255, shift to align msb with mask, and apply mask */ /* scale to 0..255, shift to align msb with mask, and apply mask */
unsigned long val; unsigned long val;
if (flashscreen) if (flashscreen)
p ^= 0xff; p ^= 0xff;
val = p << 24; val = p << 24;
if (!bits) if (!bits)
return 0; return 0;
val >>= (32 - bits); val >>= (32 - bits);
val <<= shift; val <<= shift;
return val; return val;
} }
int bits_in_mask (unsigned long mask) int bits_in_mask (unsigned long mask)
{ {
int n = 0; int n = 0;
while (mask) { while (mask) {
n += mask & 1; n += mask & 1;
mask >>= 1; mask >>= 1;
} }
return n; return n;
} }
int mask_shift (unsigned long mask) int mask_shift (unsigned long mask)
{ {
int n = 0; int n = 0;
while (!(mask & 1)) { while (!(mask & 1)) {
n++; n++;
mask >>= 1; mask >>= 1;
} }
return n; return n;
} }
unsigned int doMask256 (int p, int bits, int shift) unsigned int doMask256 (int p, int bits, int shift)
{ {
/* p is a value from 0 to 255 (Amiga color value) /* p is a value from 0 to 255 (Amiga color value)
* shift to align msb with mask, and apply mask */ * shift to align msb with mask, and apply mask */
unsigned long val = p * 0x01010101UL; unsigned long val = p * 0x01010101UL;
if (bits == 0) if (bits == 0)
return 0; return 0;
val >>= (32 - bits); val >>= (32 - bits);
val <<= shift; val <<= shift;
return val; return val;
} }
static unsigned int doColor (int i, int bits, int shift) static unsigned int doColor (int i, int bits, int shift)
{ {
int shift2; int shift2;
if (flashscreen) if (flashscreen)
i ^= 0xffffffff; i ^= 0xffffffff;
...@@ -97,12 +98,12 @@ static unsigned int doColor (int i, int bits, int shift) ...@@ -97,12 +98,12 @@ static unsigned int doColor (int i, int bits, int shift)
shift2 = 0; shift2 = 0;
else else
shift2 = 8 - bits; shift2 = 8 - bits;
return (i >> shift2) << shift; return (i >> shift2) << shift;
} }
static unsigned int doAlpha (int alpha, int bits, int shift) static unsigned int doAlpha (int alpha, int bits, int shift)
{ {
return (alpha & ((1 << bits) - 1)) << shift; return (alpha & ((1 << bits) - 1)) << shift;
} }
static float video_gamma (float value, float gamma, float bri, float con) static float video_gamma (float value, float gamma, float bri, float con)
...@@ -254,30 +255,30 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in ...@@ -254,30 +255,30 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in
video_calc_gammatable(); video_calc_gammatable();
j = 256; j = 256;
for (i = 0; i < 4096; i++) { for (i = 0; i < 4096; i++) {
int r = ((i >> 8) << 4) | (i >> 8); int r = ((i >> 8) << 4) | (i >> 8);
int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f); int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f);
int b = ((i & 0xf) << 4) | (i & 0x0f); int b = ((i & 0xf) << 4) | (i & 0x0f);
r = gamma[r + j]; r = gamma[r + j];
g = gamma[g + j]; g = gamma[g + j];
b = gamma[b + j]; b = gamma[b + j];
xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as); xcolors[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs) | doAlpha (alpha, aw, as);
if (byte_swap) { if (byte_swap) {
if (bpp <= 16) if (bpp <= 16)
xcolors[i] = bswap_16 (xcolors[i]); xcolors[i] = bswap_16 (xcolors[i]);
else else
xcolors[i] = bswap_32 (xcolors[i]); xcolors[i] = bswap_32 (xcolors[i]);
} }
if (bpp <= 16) { if (bpp <= 16) {
/* Fill upper 16 bits of each colour value /* Fill upper 16 bits of each colour value
* with a copy of the colour. */ * with a copy of the colour. */
xcolors[i] |= xcolors[i] * 0x00010001; xcolors[i] |= xcolors[i] * 0x00010001;
}
} }
}
#if defined(AGA) || defined(GFXFILTER) #if defined(AGA) || defined(GFXFILTER)
alloc_colors_rgb (rw, gw, bw, rs, gs, bs, aw, as, alpha, byte_swap, xredcolors, xgreencolors, xbluecolors); alloc_colors_rgb (rw, gw, bw, rs, gs, bs, aw, as, alpha, byte_swap, xredcolors, xgreencolors, xbluecolors);
/* copy original color table */ /* copy original color table */
for (i = 0; i < 256; i++) { for (i = 0; i < 256; i++) {
redc[0 * 256 + i] = xredcolors[0]; redc[0 * 256 + i] = xredcolors[0];
grec[0 * 256 + i] = xgreencolors[0]; grec[0 * 256 + i] = xgreencolors[0];
bluc[0 * 256 + i] = xbluecolors[0]; bluc[0 * 256 + i] = xbluecolors[0];
...@@ -287,7 +288,7 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in ...@@ -287,7 +288,7 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in
redc[2 * 256 + i] = xredcolors[255]; redc[2 * 256 + i] = xredcolors[255];
grec[2 * 256 + i] = xgreencolors[255]; grec[2 * 256 + i] = xgreencolors[255];
bluc[2 * 256 + i] = xbluecolors[255]; bluc[2 * 256 + i] = xbluecolors[255];
} }
#ifdef GFXFILTER #ifdef GFXFILTER
if (usedfilter && usedfilter->yuv) { if (usedfilter && usedfilter->yuv) {
/* create internal 5:6:5 color tables */ /* create internal 5:6:5 color tables */
...@@ -296,14 +297,14 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in ...@@ -296,14 +297,14 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in
xredcolors[i] = doColor (gamma[j], 5, 11); xredcolors[i] = doColor (gamma[j], 5, 11);
xgreencolors[i] = doColor (gamma[j], 6, 5); xgreencolors[i] = doColor (gamma[j], 6, 5);
xbluecolors[i] = doColor (gamma[j], 5, 0); xbluecolors[i] = doColor (gamma[j], 5, 0);
if (bpp <= 16) { if (bpp <= 16) {
/* Fill upper 16 bits of each colour value with /* Fill upper 16 bits of each colour value with
* a copy of the colour. */ * a copy of the colour. */
xredcolors [i] = xredcolors [i] * 0x00010001; xredcolors [i] = xredcolors [i] * 0x00010001;
xgreencolors[i] = xgreencolors[i] * 0x00010001; xgreencolors[i] = xgreencolors[i] * 0x00010001;
xbluecolors [i] = xbluecolors [i] * 0x00010001; xbluecolors [i] = xbluecolors [i] * 0x00010001;
} }
} }
for (i = 0; i < 4096; i++) { for (i = 0; i < 4096; i++) {
int r = ((i >> 8) << 4) | (i >> 8); int r = ((i >> 8) << 4) | (i >> 8);
int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f); int g = (((i >> 4) & 0xf) << 4) | ((i >> 4) & 0x0f);
...@@ -348,9 +349,9 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in ...@@ -348,9 +349,9 @@ void alloc_colors64k (int rw, int gw, int bw, int rs, int gs, int bs, int aw, in
xredcolor_s = rs; xredcolor_s = rs;
xgreencolor_s = gs; xgreencolor_s = gs;
xbluecolor_s = bs; xbluecolor_s = bs;
xredcolor_m = (1 << rw) - 1; xredcolor_m = ((1 << rw) - 1) << xredcolor_s;
xgreencolor_m = (1 << gw) - 1; xgreencolor_m = ((1 << gw) - 1) << xgreencolor_s;
xbluecolor_m = (1 << bw) - 1; xbluecolor_m = ((1 << bw) - 1) << xbluecolor_s;
} }
static int color_diff[4096]; static int color_diff[4096];
......
This diff is collapsed.
#ifdef A2065 #ifdef A2065
extern void a2065_init (void); extern void a2065_init (void);
extern void a2065_free (void); extern void a2065_free (void);
extern void a2065_reset (void); extern void a2065_reset (void);
extern void a2065_hsync_handler (void); extern void a2065_hsync_handler (void);
extern void rethink_a2065 (void); extern void rethink_a2065 (void);
#endif #endif
#ifdef A2091 #ifdef A2091
extern addrbank dmaca2091_bank; extern addrbank dmaca2091_bank;
extern void a2091_init (void); extern void a2091_init (void);
extern void a2091_free (void); extern void a2091_free (void);
extern void a2091_reset (void); extern void a2091_reset (void);
extern void a3000scsi_init (void); extern void a3000scsi_init (void);
extern void a3000scsi_free (void); extern void a3000scsi_free (void);
extern void a3000scsi_reset (void); extern void a3000scsi_reset (void);
extern void rethink_a2091 (void); extern void rethink_a2091 (void);
extern void wdscsi_put (uae_u8); extern void wdscsi_put (uae_u8);
extern uae_u8 wdscsi_get (void); extern uae_u8 wdscsi_get (void);
extern uae_u8 wdscsi_getauxstatus (void); extern uae_u8 wdscsi_getauxstatus (void);
extern void wdscsi_sasr (uae_u8); extern void wdscsi_sasr (uae_u8);
extern void scsi_hsync (void); extern void scsi_hsync (void);
extern uae_u8 wdregs[32]; extern uae_u8 wdregs[32];
extern struct scsi_data *scsis[8]; extern struct scsi_data *scsis[8];
#define WD33C93 "WD33C93" #define WD33C93 "WD33C93"
#define SCSIID (scsis[wdregs[WD_DESTINATION_ID] & 7]) #define SCSIID (scsis[wdregs[WD_DESTINATION_ID] & 7])
extern int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, extern int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
TCHAR *devname, int sectors, int surfaces, int reserved, TCHAR *devname, int sectors, int surfaces, int reserved,
int bootpri, TCHAR *filesys); int bootpri, TCHAR *filesys);
extern int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly, extern int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
TCHAR *devname, int sectors, int surfaces, int reserved, TCHAR *devname, int sectors, int surfaces, int reserved,
int bootpri, TCHAR *filesys); int bootpri, TCHAR *filesys);
extern int addscsi (int ch, TCHAR *path, int blocksize, int readonly, extern int addscsi (int ch, TCHAR *path, int blocksize, int readonly,
TCHAR *devname, int sectors, int surfaces, int reserved, TCHAR *devname, int sectors, int surfaces, int reserved,
int bootpri, TCHAR *filesys, int scsi_level); int bootpri, TCHAR *filesys, int scsi_level);
#endif #endif
void amax_diskwrite (uae_u16 w); void amax_diskwrite (uae_u16 w);
void amax_bfe001_write (uae_u8 pra, uae_u8 dra); void amax_bfe001_write (uae_u8 pra, uae_u8 dra);
uae_u8 amax_disk_status (void); uae_u8 amax_disk_status (void);
void amax_disk_select (uae_u8 v, uae_u8 ov); void amax_disk_select (uae_u8 v, uae_u8 ov);
void amax_reset (void); void amax_reset (void);
void amax_init (void); void amax_init (void);
...@@ -39,18 +39,17 @@ extern void action_replay_hide (void); ...@@ -39,18 +39,17 @@ extern void action_replay_hide (void);
extern void action_replay_reset (void); extern void action_replay_reset (void);
extern int action_replay_load (void); extern int action_replay_load (void);
extern void action_replay_memory_reset(void); extern void action_replay_memory_reset (void);
extern void action_replay_init (int); extern void action_replay_init (int);
extern void action_replay_cleanup (void); extern void action_replay_cleanup (void);
extern void action_replay_chipwrite(void); //extern void action_replay_map_banks (void);
//static--extern void action_replay_map_banks(void);
extern void REGPARAM3 chipmem_lput_actionreplay23 (uaecptr addr, uae_u32 l) REGPARAM; extern void REGPARAM3 chipmem_lput_actionreplay23 (uaecptr addr, uae_u32 l) REGPARAM;
extern void REGPARAM3 chipmem_wput_actionreplay23 (uaecptr addr, uae_u32 w) REGPARAM; extern void REGPARAM3 chipmem_wput_actionreplay23 (uaecptr addr, uae_u32 w) REGPARAM;
extern void REGPARAM3 chipmem_bput_actionreplay1 (uaecptr addr, uae_u32 b) REGPARAM; extern void REGPARAM3 chipmem_bput_actionreplay1 (uaecptr addr, uae_u32 b) REGPARAM;
extern void REGPARAM3 chipmem_wput_actionreplay1 (uaecptr addr, uae_u32 w) REGPARAM; extern void REGPARAM3 chipmem_wput_actionreplay1 (uaecptr addr, uae_u32 w) REGPARAM;
extern void REGPARAM3 chipmem_lput_actionreplay1 (uaecptr addr, uae_u32 l) REGPARAM; extern void REGPARAM3 chipmem_lput_actionreplay1 (uaecptr addr, uae_u32 l) REGPARAM;
extern void action_replay_version(void); extern void action_replay_version (void);
extern int hrtmon_flag; extern int hrtmon_flag;
...@@ -60,7 +59,7 @@ extern void hrtmon_ciaread (void); ...@@ -60,7 +59,7 @@ extern void hrtmon_ciaread (void);
extern void hrtmon_hide (void); extern void hrtmon_hide (void);
extern void hrtmon_reset (void); extern void hrtmon_reset (void);
extern int hrtmon_load (void); extern int hrtmon_load (void);
extern void hrtmon_map_banks(void); extern void hrtmon_map_banks (void);
/*extern uae_u8 *hrtmemory;*/ /*extern uae_u8 *hrtmemory;*/
extern uae_u32 hrtmem_start, hrtmem_size; extern uae_u32 hrtmem_start, hrtmem_size;
......
#ifdef ARCADIA #ifdef ARCADIA
extern void arcadia_init (void); extern void arcadia_init (void);
extern int is_arcadia_rom (const TCHAR *path); extern int is_arcadia_rom (const TCHAR *path);
extern int arcadia_map_banks (void); extern int arcadia_map_banks (void);
extern void arcadia_unmap (void); extern void arcadia_unmap (void);
extern void arcadia_vsync (void); extern void arcadia_vsync (void);
extern void arcadia_reset (void); extern void arcadia_reset (void);
extern uae_u8 arcadia_parport (int port, uae_u8 pra, uae_u8 dra); extern uae_u8 arcadia_parport (int port, uae_u8 pra, uae_u8 dra);
extern struct romdata *scan_arcadia_rom (TCHAR*, int); extern struct romdata *scan_arcadia_rom (TCHAR*, int);
struct arcadiarom { struct arcadiarom {
int romid; int romid;
TCHAR *name, *rom; TCHAR *name, *rom;
int type, extra; int type, extra;
int b7, b6, b5, b4, b3, b2, b1, b0; int b7, b6, b5, b4, b3, b2, b1, b0;
}; };
extern struct arcadiarom *arcadia_bios, *arcadia_game; extern struct arcadiarom *arcadia_bios, *arcadia_game;
extern int arcadia_flag, arcadia_coin[2]; extern int arcadia_flag, arcadia_coin[2];
#define NO_ARCADIA_ROM 0 #define NO_ARCADIA_ROM 0
#define ARCADIA_BIOS 1 #define ARCADIA_BIOS 1
#define ARCADIA_GAME 2 #define ARCADIA_GAME 2
#endif #endif
\ No newline at end of file
int consolehook_activate (void); int consolehook_activate (void);
void consolehook_ret (uaecptr condev, uaecptr oldbeginio); void consolehook_ret (uaecptr condev, uaecptr oldbeginio);
uaecptr consolehook_beginio (uaecptr request); uaecptr consolehook_beginio (uaecptr request);
void consolehook_config (struct uae_prefs *p); void consolehook_config (struct uae_prefs *p);
...@@ -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_u32 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_u32 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_icache020 (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_icache020 (pc + 2); fill_icache020 (pc + 2);
return v; return v;
} }
fill_icache020 (pc); fill_icache020 (pc);
} }
} }
...@@ -265,106 +265,106 @@ STATIC_INLINE uae_u32 next_ilong_020ce (void) ...@@ -265,106 +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) STATIC_INLINE void m68k_do_bsr_ce020 (uaecptr oldpc, uae_s32 offset)
{ {
m68k_areg (regs, 7) -= 4; m68k_areg (regs, 7) -= 4;
put_long_ce020 (m68k_areg (regs, 7), oldpc); put_long_ce020 (m68k_areg (regs, 7), oldpc);
m68k_incpc (offset); m68k_incpc (offset);
} }
STATIC_INLINE void m68k_do_rts_ce020 (void) STATIC_INLINE void m68k_do_rts_ce020 (void)
{ {
m68k_setpc (get_long_ce020 (m68k_areg (regs, 7))); m68k_setpc (get_long_ce020 (m68k_areg (regs, 7)));
m68k_areg (regs, 7) += 4; 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 #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)
...@@ -392,7 +392,7 @@ STATIC_INLINE uae_u32 mem_access_delay_wordi_read (uaecptr addr) ...@@ -392,7 +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: case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
...@@ -406,12 +406,12 @@ STATIC_INLINE uae_u32 mem_access_delay_byte_read (uaecptr addr) ...@@ -406,12 +406,12 @@ 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: case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
return get_byte (addr); return get_byte (addr);
} }
STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v) STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v)
{ {
...@@ -421,11 +421,11 @@ STATIC_INLINE void mem_access_delay_byte_write (uaecptr addr, uae_u32 v) ...@@ -421,11 +421,11 @@ 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: case CE_MEMBANK_FAST16BIT:
do_cycles_ce000 (4); do_cycles_ce000 (4);
break; break;
} }
put_byte (addr, v); put_byte (addr, v);
} }
STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v) STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v)
{ {
...@@ -436,22 +436,22 @@ STATIC_INLINE void mem_access_delay_word_write (uaecptr addr, uae_u32 v) ...@@ -436,22 +436,22 @@ 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: 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) STATIC_INLINE uae_u32 get_long_ce (uaecptr addr)
{ {
uae_u32 v = mem_access_delay_word_read (addr) << 16; uae_u32 v = mem_access_delay_word_read (addr) << 16;
v |= mem_access_delay_word_read (addr + 2); v |= mem_access_delay_word_read (addr + 2);
return v; 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);
} }
STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr) STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr)
{ {
...@@ -459,47 +459,47 @@ STATIC_INLINE uae_u32 get_wordi_ce (uaecptr addr) ...@@ -459,47 +459,47 @@ STATIC_INLINE uae_u32 get_wordi_ce (uaecptr 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;
regs.irc = get_wordi_ce (m68k_getpc () + o); regs.irc = get_wordi_ce (m68k_getpc () + o);
return v; return v;
} }
STATIC_INLINE void put_long_ce (uaecptr addr, uae_u32 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 >> 16);
mem_access_delay_word_write (addr + 2, v);
} }
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u32 v) STATIC_INLINE void put_word_ce (uaecptr addr, uae_u32 v)
{ {
mem_access_delay_byte_write (addr, v); mem_access_delay_word_write (addr, v);
}
STATIC_INLINE void put_byte_ce (uaecptr addr, uae_u32 v)
{
mem_access_delay_byte_write (addr, v);
} }
STATIC_INLINE void m68k_do_rts_ce (void) STATIC_INLINE void m68k_do_rts_ce (void)
{ {
uaecptr pc; uaecptr pc;
pc = get_word_ce (m68k_areg (regs, 7)) << 16; pc = get_word_ce (m68k_areg (regs, 7)) << 16;
pc |= get_word_ce (m68k_areg (regs, 7) + 2); pc |= get_word_ce (m68k_areg (regs, 7) + 2);
m68k_areg (regs, 7) += 4; m68k_areg (regs, 7) += 4;
if (pc & 1) if (pc & 1)
exception3 (0x4e75, m68k_getpc (), pc); exception3 (0x4e75, m68k_getpc (), pc);
else else
m68k_setpc (pc); m68k_setpc (pc);
} }
STATIC_INLINE void m68k_do_bsr_ce (uaecptr oldpc, uae_s32 offset) STATIC_INLINE void m68k_do_bsr_ce (uaecptr oldpc, uae_s32 offset)
{ {
m68k_areg (regs, 7) -= 4; m68k_areg (regs, 7) -= 4;
put_word_ce (m68k_areg (regs, 7), oldpc >> 16); put_word_ce (m68k_areg (regs, 7), oldpc >> 16);
put_word_ce (m68k_areg (regs, 7) + 2, oldpc); put_word_ce (m68k_areg (regs, 7) + 2, oldpc);
m68k_incpc (offset); m68k_incpc (offset);
} }
STATIC_INLINE void m68k_do_jsr_ce (uaecptr oldpc, uaecptr dest) STATIC_INLINE void m68k_do_jsr_ce (uaecptr oldpc, uaecptr dest)
......
This diff is collapsed.
int isamigatrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize); int isamigatrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize);
int ispctrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize); int ispctrack (uae_u16 *amigamfmbuffer, uae_u8 *mfmdata, int len, uae_u8 *writebuffer, uae_u8 *writebuffer_ok, int track, int *outsize);
...@@ -57,10 +57,10 @@ int setup_sound (void) ...@@ -57,10 +57,10 @@ int setup_sound (void)
printf("ALSA lib version: %s\n", SND_LIB_VERSION_STR); printf("ALSA lib version: %s\n", SND_LIB_VERSION_STR);
if ((err = open_sound()) < 0) { if ((err = open_sound()) < 0) {
/* TODO: if the pcm was busy, we should the same as sd-uss does. /* TODO: if the pcm was busy, we should the same as sd-uss does.
tell the caller that sound is available. in any other tell the caller that sound is available. in any other
condition we should just return 0. */ condition we should just return 0. */
write_log ("ALSA: Can't open audio device: %s\n", snd_strerror (err)); write_log ("ALSA: Can't open audio device: %s\n", snd_strerror (err));
return 0; return 0;
} }
snd_pcm_close (alsa_playback_handle); snd_pcm_close (alsa_playback_handle);
alsa_playback_handle = 0; alsa_playback_handle = 0;
...@@ -171,8 +171,8 @@ int init_sound (void) ...@@ -171,8 +171,8 @@ int init_sound (void)
channels = currprefs.sound_stereo ? 2 : 1; channels = currprefs.sound_stereo ? 2 : 1;
rate = currprefs.sound_freq; rate = currprefs.sound_freq;
have_sound = 0; have_sound = 0;
alsa_playback_handle = 0; alsa_playback_handle = 0;
printf("ALSA lib version: %s\n", SND_LIB_VERSION_STR); printf("ALSA lib version: %s\n", SND_LIB_VERSION_STR);
if ((err = open_sound()) < 0) { if ((err = open_sound()) < 0) {
write_log ("ALSA: Can't open audio device: %s\n", snd_strerror (err)); write_log ("ALSA: Can't open audio device: %s\n", snd_strerror (err));
......
...@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake. ...@@ -4,7 +4,7 @@ running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure --disable-option-checking --prefix=/usr/local --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --with-caps --with-gayle --enable-drvsnd --enable-amax --enable-cd32 --enable-scsi-device --disable-jit --cache-file=/dev/null --srcdir=. $ ./configure --disable-option-checking --prefix=/usr/local --with-sdl --with-sdl-gl --with-sdl-gfx --with-sdl-sound --with-caps --with-gayle --enable-drvsnd --enable-amax --enable-cd32 --enable-scsi-device --cache-file=/dev/null --srcdir=.
## --------- ## ## --------- ##
## Platform. ## ## Platform. ##
...@@ -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/cclXBtVj.o: In function `main': /tmp/ccKkOe2m.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/cc5VqNdA.o: In function `main': /tmp/ccZO2eLu.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/ccQPmvfF.o: In function `main': /tmp/ccmHyUSz.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
......
...@@ -438,7 +438,7 @@ $config_links ...@@ -438,7 +438,7 @@ $config_links
Report bugs to the package provider." Report bugs to the package provider."
ac_cs_config="'--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--disable-jit' '--cache-file=/dev/null' '--srcdir=.'" ac_cs_config="'--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--cache-file=/dev/null' '--srcdir=.'"
ac_cs_version="\ ac_cs_version="\
config.status config.status
configured by ./configure, generated by GNU Autoconf 2.65, configured by ./configure, generated by GNU Autoconf 2.65,
...@@ -522,7 +522,7 @@ if $ac_cs_silent; then ...@@ -522,7 +522,7 @@ if $ac_cs_silent; then
fi fi
if $ac_cs_recheck; then if $ac_cs_recheck; then
set X '/bin/bash' './configure' '--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--disable-jit' '--cache-file=/dev/null' '--srcdir=.' $ac_configure_extra_args --no-create --no-recursion set X '/bin/bash' './configure' '--disable-option-checking' '--prefix=/usr/local' '--with-sdl' '--with-sdl-gl' '--with-sdl-gfx' '--with-sdl-sound' '--with-caps' '--with-gayle' '--enable-drvsnd' '--enable-amax' '--enable-cd32' '--enable-scsi-device' '--cache-file=/dev/null' '--srcdir=.' $ac_configure_extra_args --no-create --no-recursion
shift shift
$as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6
CONFIG_SHELL='/bin/bash' CONFIG_SHELL='/bin/bash'
......
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