Merged SDL1 and SDL2 projects

This commit is contained in:
Dimitris Panokostas 2017-12-04 15:49:40 +01:00
parent 0f52c165e6
commit cebfc8f823
155 changed files with 42610 additions and 67600 deletions

View file

@ -1,18 +1,19 @@
/*
* UAE - The Un*x Amiga Emulator
*
* custom chip support
*
* (c) 1995 Bernd Schmidt
*/
/*
* UAE - The Un*x Amiga Emulator
*
* custom chip support
*
* (c) 1995 Bernd Schmidt
*/
#ifndef UAE_CUSTOM_H
#define UAE_CUSTOM_H
#include "uae/types.h"
#include "machdep/rpt.h"
/* These are the masks that are ORed together in the chipset_mask option.
* If CSMASK_AGA is set, the ECS bits are guaranteed to be set as well. */
* If CSMASK_AGA is set, the ECS bits are guaranteed to be set as well. */
#define CSMASK_ECS_AGNUS 1
#define CSMASK_ECS_DENISE 2
#define CSMASK_AGA 4
@ -26,41 +27,29 @@
#define MAXVPOS_LINES_OCS 512
#define HPOS_SHIFT 3
uae_u32 get_copper_address(int copno);
extern void set_speedup_values(void);
extern int custom_init (void);
extern void custom_prepare (void);
extern void custom_reset (bool hardreset, bool keyboardreset);
extern int intlev (void);
extern int custom_init(void);
extern void custom_prepare(void);
extern void custom_reset(bool hardreset, bool keyboardreset);
extern int intlev(void);
extern void dumpcustom(void);
extern void do_copper (void);
extern void do_disk(void);
extern void do_copper(void);
extern void notice_new_xcolors(void);
extern void notice_screen_contents_lost(void);
extern void init_row_map(void);
extern void init_hz_normal(void);
extern void init_custom(void);
extern void notice_new_xcolors (void);
extern void init_row_map (void);
extern void init_hz_normal (void);
extern void init_custom (void);
extern bool picasso_requested_on, picasso_requested_forced_on, picasso_on;
extern void set_picasso_hack_rate(int hz);
/* Set to 1 to leave out the current frame in average frame time calculation.
* Useful if the debugger was active. */
extern int bogusframe;
extern unsigned long int hsync_counter, vsync_counter;
extern unsigned long int hsync_counter;
extern uae_u16 dmacon;
extern uae_u16 intena, intreq, intreqr;
extern uae_u16 intreq;
extern int vpos, lof_store;
extern int vpos;
extern int find_copper_record(uaecptr, int *, int *);
extern int n_frames;
STATIC_INLINE int dmaen(unsigned int dmamask)
STATIC_INLINE int dmaen (unsigned int dmamask)
{
return (dmamask & dmacon) && (dmacon & 0x200);
}
@ -85,25 +74,22 @@ STATIC_INLINE int dmaen(unsigned int dmamask)
extern uae_u16 adkcon;
extern unsigned int joy0dir, joy1dir;
extern int joy0button, joy1button;
extern void INTREQ(uae_u16);
extern bool INTREQ_0(uae_u16);
extern void INTREQ_f(uae_u16);
extern void send_interrupt(int num, int delay);
extern void INTREQ (uae_u16);
extern bool INTREQ_0 (uae_u16);
extern void INTREQ_f (uae_u16);
STATIC_INLINE void send_interrupt (int num)
{
INTREQ_0 (0x8000 | (1 << num));
}
extern void rethink_uae_int(void);
extern uae_u16 INTREQR(void);
STATIC_INLINE uae_u16 INTREQR (void)
{
return intreq;
}
/* maximums for statically allocated tables */
#ifdef UAE_MINI
/* absolute minimums for basic A500/A1200-emulation */
#define MAXHPOS 227
#define MAXVPOS 312
#else
#define MAXHPOS 256
#define MAXVPOS 592
#endif
#define MAXVPOS 314
/* PAL/NTSC values */
@ -125,14 +111,11 @@ extern uae_u16 INTREQR(void);
#define EQU_ENDLINE_PAL 8
#define EQU_ENDLINE_NTSC 10
extern int maxhpos, maxhpos_short;
extern int maxhpos;
extern int maxvpos, maxvpos_nom, maxvpos_display;
extern int hsyncstartpos, hsyncendpos;
extern int minfirstline, vblank_endline, numscrlines;
extern double vblank_hz, fake_vblank_hz;
extern double hblank_hz;
extern int vblank_skip, doublescan;
extern bool programmedmode;
extern int minfirstline;
extern float vblank_hz, fake_vblank_hz;
extern float hblank_hz;
#define DMA_AUD0 0x0001
#define DMA_AUD1 0x0002
@ -146,43 +129,17 @@ extern bool programmedmode;
#define DMA_MASTER 0x0200
#define DMA_BLITPRI 0x0400
#define CYCLE_REFRESH 1
#define CYCLE_STROBE 2
#define CYCLE_MISC 3
#define CYCLE_SPRITE 4
#define CYCLE_COPPER 5
#define CYCLE_BLITTER 6
#define CYCLE_CPU 7
#define CYCLE_CPUNASTY 8
#define CYCLE_COPPER_SPECIAL 0x10
#define CYCLE_MASK 0x0f
extern unsigned long frametime, timeframes;
extern uae_u16 htotal, vtotal, beamcon0;
extern unsigned long timeframes;
/* 100 words give you 1600 horizontal pixels. Should be more than enough for
* superhires. Don't forget to update the definition in genp2c.c as well.
* needs to be larger for superhires support */
#ifdef CUSTOM_SIMPLE
#define MAX_WORDS_PER_LINE 50
#else
* superhires. Don't forget to update the definition in genp2c.c as well.
* needs to be larger for superhires support */
#define MAX_WORDS_PER_LINE 100
#endif
extern uae_u32 hirestab_h[256][2];
extern uae_u32 lorestab_h[256][4];
extern uae_u32 hirestab_l[256][1];
extern uae_u32 lorestab_l[256][2];
#ifdef AGA
#ifndef ARMV6_ASSEMBLY
/* AGA mode color lookup tables */
extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
#endif
extern int xredcolor_s, xredcolor_b, xredcolor_m;
extern int xgreencolor_s, xgreencolor_b, xgreencolor_m;
extern int xbluecolor_s, xbluecolor_b, xbluecolor_m;
#define RES_LORES 0
#define RES_HIRES 1
@ -190,55 +147,37 @@ extern int xbluecolor_s, xbluecolor_b, xbluecolor_m;
#define RES_MAX 2
#define VRES_NONDOUBLE 0
#define VRES_DOUBLE 1
#define VRES_QUAD 2
#define VRES_MAX 1
/* calculate shift depending on resolution (replaced "decided_hires ? 4 : 8") */
#define RES_SHIFT(res) ((res) == RES_LORES ? 8 : (res) == RES_HIRES ? 4 : 2)
/* get resolution from bplcon0 */
STATIC_INLINE int GET_RES_DENISE(uae_u16 con0)
STATIC_INLINE int GET_RES_DENISE (uae_u16 con0)
{
if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
con0 &= ~0x40; // SUPERHIRES
return ((con0) & 0x40) ? RES_SUPERHIRES : ((con0) & 0x8000) ? RES_HIRES : RES_LORES;
if ((currprefs.chipset_mask & CSMASK_ECS_DENISE) && ((con0) & 0x40))
return RES_SUPERHIRES; // SUPERHIRES
return ((con0) & 0x8000) ? RES_HIRES : RES_LORES;
}
STATIC_INLINE int GET_RES_AGNUS(uae_u16 con0)
STATIC_INLINE int GET_RES_AGNUS (uae_u16 con0)
{
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
con0 &= ~0x40; // SUPERHIRES
return ((con0) & 0x40) ? RES_SUPERHIRES : ((con0) & 0x8000) ? RES_HIRES : RES_LORES;
if ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) && ((con0) & 0x40))
return RES_SUPERHIRES; // SUPERHIRES
return ((con0) & 0x8000) ? RES_HIRES : RES_LORES;
}
/* get sprite width from FMODE */
#define GET_SPRITEWIDTH(FMODE) ((((FMODE) >> 2) & 3) == 3 ? 64 : (((FMODE) >> 2) & 3) == 0 ? 16 : 32)
/* Compute the number of bitplanes from a value written to BPLCON0 */
STATIC_INLINE int GET_PLANES(uae_u16 bplcon0)
{
if ((bplcon0 & 0x0010) && (bplcon0 & 0x7000))
return 0; // >8 planes = 0 planes
if (bplcon0 & 0x0010)
return 8; // AGA 8-planes bit
return (bplcon0 >> 12) & 7; // normal planes bits
if ((bplcon0 & 0x0010) && (bplcon0 & 0x7000))
return 0; // >8 planes = 0 planes
if (bplcon0 & 0x0010)
return 8; // AGA 8-planes bit
return (bplcon0 >> 12) & 7; // normal planes bits
}
extern void fpscounter_reset(void);
extern void fpscounter_reset (void);
extern unsigned long idletime;
extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy, lightpen_active, lightpen_enabled;
struct customhack {
uae_u16 v;
int vpos, hpos;
};
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 void alloc_cycle_blitter(int hpos, uaecptr *ptr, int);
extern bool ispal(void);
extern bool isvga(void);
extern int current_maxvpos(void);
extern struct chipset_refresh *get_chipset_refresh(void);
extern void compute_framesync(void);
extern void getsyncregisters(uae_u16 *phsstrt, uae_u16 *phsstop, uae_u16 *pvsstrt, uae_u16 *pvsstop);
int is_bitplane_dma(int hpos);
extern int current_maxvpos (void);
extern struct chipset_refresh *get_chipset_refresh (void);
#endif /* UAE_CUSTOM_H */