Merge latest TomB version as of 6 April

This commit is contained in:
Chips 2016-04-24 09:45:29 +00:00
parent dcb6ab5053
commit d8ba1f9037
240 changed files with 125165 additions and 108915 deletions

View file

@ -6,6 +6,8 @@
* (c) 1995 Bernd Schmidt
*/
#include "md-pandora/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. */
@ -15,37 +17,34 @@
#define CSMASK_ECS_AGNUS 1
#define CSMASK_ECS_DENISE 2
#define CSMASK_AGA 4
uae_u32 get_copper_address(int copno);
#define CSMASK_MASK (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA)
extern int custom_init (void);
extern void customreset (int hardreset);
extern void custom_prepare (void);
extern void custom_reset (int hardreset);
extern int intlev (void);
extern void dumpcustom (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 (void);
extern void init_hz_full (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);
extern unsigned long int hsync_counter;
extern uae_u16 dmacon;
extern uae_u16 intena, intreq, intreqr;
extern uae_u16 intreq;
extern int vpos;
#define current_hpos() ((get_cycles () - eventtab[ev_hsync].oldcycles) / CYCLE_UNIT)
extern void update_copper (int until_hpos);
extern int find_copper_record (uaecptr, int *, int *);
extern int n_frames;
STATIC_INLINE void do_copper (void)
{
int hpos = current_hpos ();
update_copper (hpos);
}
#define dmaen(DMAMASK) (int)((DMAMASK & dmacon) && (dmacon & 0x200))
@ -66,13 +65,14 @@ extern int n_frames;
extern uae_u16 adkcon;
extern unsigned int joy0dir, joy1dir;
extern int joy0button, joy1button;
extern void INTREQ (uae_u16);
extern void INTREQ_0 (uae_u16);
extern void INTREQ_f (uae_u32);
extern uae_u16 INTREQR (void);
extern void INTREQ_f (uae_u16);
#define send_interrupt(num) (INTREQ_0(0x8000 | (1 << num)))
STATIC_INLINE uae_u16 INTREQR (void)
{
return intreq;
}
/* maximums for statically allocated tables */
@ -91,10 +91,13 @@ extern uae_u16 INTREQR (void);
#define VBLANK_SPRITE_NTSC 20
#define VBLANK_HZ_PAL 50
#define VBLANK_HZ_NTSC 60
#define EQU_ENDLINE_PAL 8
#define EQU_ENDLINE_NTSC 10
extern int maxhpos, maxvpos, minfirstline, vblank_endline, numscrlines;
extern int maxhpos;
extern int maxvpos, maxvpos_nom;
extern int minfirstline;
extern int vblank_hz;
#define NUMSCRLINES (maxvpos+1-minfirstline+1)
#define DMA_AUD0 0x0001
#define DMA_AUD1 0x0002
@ -108,19 +111,11 @@ extern int vblank_hz;
#define DMA_MASTER 0x0200
#define DMA_BLITPRI 0x0400
extern uae_u16 htotal, vtotal, beamcon0;
/* 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 */
#define MAX_WORDS_PER_LINE 100
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];
/* AGA mode color lookup tables */
extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
@ -129,15 +124,30 @@ extern unsigned int xredcolors[256], xgreencolors[256], xbluecolors[256];
#define RES_SUPERHIRES 2
#define RES_MAX 2
/* 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 */
#define GET_RES(CON0) (((CON0) & 0x8000) ? RES_HIRES : ((CON0) & 0x40) ? RES_SUPERHIRES : RES_LORES)
STATIC_INLINE int GET_RES_DENISE (uae_u16 con0)
{
if (!(currprefs.chipset_mask & CSMASK_ECS_DENISE))
con0 &= ~0x40; // SUPERHIRES
return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : RES_LORES;
}
STATIC_INLINE int GET_RES_AGNUS (uae_u16 con0)
{
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
con0 &= ~0x40; // SUPERHIRES
return ((con0) & 0x8000) ? RES_HIRES : ((con0) & 0x40) ? RES_SUPERHIRES : 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 */
#define GET_PLANES(x) ((((x) >> 12) & 7) | (((x) & 0x10) >> 1))
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
}
extern void fpscounter_reset (void);