puae 2.3.0

parent 268a97f6
......@@ -203,12 +203,20 @@ static drive floppy[MAX_FLOPPY_DRIVES];
static TCHAR dfxhistory[2][MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
static uae_u8 exeheader[]={0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00};
static uae_u8 bootblock[]={
static uae_u8 bootblock_ofs[]={
0x44,0x4f,0x53,0x00,0xc0,0x20,0x0f,0x19,0x00,0x00,0x03,0x70,0x43,0xfa,0x00,0x18,
0x4e,0xae,0xff,0xa0,0x4a,0x80,0x67,0x0a,0x20,0x40,0x20,0x68,0x00,0x16,0x70,0x00,
0x4e,0x75,0x70,0xff,0x60,0xfa,0x64,0x6f,0x73,0x2e,0x6c,0x69,0x62,0x72,0x61,0x72,
0x79
};
static uae_u8 bootblock_ffs[]={
0x44, 0x4F, 0x53, 0x01, 0xE3, 0x3D, 0x0E, 0x72, 0x00, 0x00, 0x03, 0x70, 0x43, 0xFA, 0x00, 0x3E,
0x70, 0x25, 0x4E, 0xAE, 0xFD, 0xD8, 0x4A, 0x80, 0x67, 0x0C, 0x22, 0x40, 0x08, 0xE9, 0x00, 0x06,
0x00, 0x22, 0x4E, 0xAE, 0xFE, 0x62, 0x43, 0xFA, 0x00, 0x18, 0x4E, 0xAE, 0xFF, 0xA0, 0x4A, 0x80,
0x67, 0x0A, 0x20, 0x40, 0x20, 0x68, 0x00, 0x16, 0x70, 0x00, 0x4E, 0x75, 0x70, 0xFF, 0x4E, 0x75,
0x64, 0x6F, 0x73, 0x2E, 0x6C, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x00, 0x65, 0x78, 0x70, 0x61,
0x6E, 0x73, 0x69, 0x6F, 0x6E, 0x2E, 0x6C, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x00, 0x00, 0x00,
};
#define FS_OFS_DATABLOCKSIZE 488
#define FS_FLOPPY_BLOCKSIZE 512
......@@ -281,7 +289,7 @@ static void createbootblock (uae_u8 *sector, int bootable)
memset (sector, 0, FS_FLOPPY_BLOCKSIZE);
memcpy (sector, "DOS", 3);
if (bootable)
memcpy (sector, bootblock, sizeof (bootblock));
memcpy (sector, bootblock_ofs, sizeof (bootblock_ofs));
}
static void createrootblock (uae_u8 *sector, const char *disk_name)
......@@ -2054,17 +2062,46 @@ void DISK_ersatz_read (int tr, int sec, uaecptr dest)
zfile_fread (dptr, 1, 512, floppy[0].diskfile);
}
static void floppy_get_bootblock (uae_u8 *dst, bool ffs, bool bootable)
{
strcpy ((char*)dst, "DOS");
dst[3] = ffs ? 1 : 0;
if (bootable)
memcpy (dst, ffs ? bootblock_ffs : bootblock_ofs, ffs ? sizeof bootblock_ffs : sizeof bootblock_ofs);
}
static void floppy_get_rootblock (uae_u8 *dst, int block, const TCHAR *disk_name, drive_type adftype)
{
dst[0+3] = 2;
dst[12+3] = 0x48;
dst[312] = dst[313] = dst[314] = dst[315] = (uae_u8)0xff;
dst[316+2] = (block + 1) >> 8; dst[316+3] = (block + 1) & 255;
char *s = ua ((disk_name && _tcslen (disk_name) > 0) ? disk_name : "empty");
dst[432] = strlen (s);
strcpy ((char*)dst + 433, s);
xfree (s);
dst[508 + 3] = 1;
disk_date (dst + 420);
memcpy (dst + 472, dst + 420, 3 * 4);
memcpy (dst + 484, dst + 420, 3 * 4);
disk_checksum (dst, dst + 20);
/* bitmap block */
memset (dst + 512 + 4, 0xff, 2 * block / 8);
if (adftype == 0)
dst[512 + 0x72] = 0x3f;
else
dst[512 + 0xdc] = 0x3f;
disk_checksum (dst + 512, dst + 512);
}
/* type: 0=regular, 1=ext2adf */
/* adftype: 0=DD,1=HD,2=DD PC,3=HD PC,4=525SD */
void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk_name)
void disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable)
{
int size = 32768;
struct zfile *f;
int i, l, file_size, tracks, track_len, sectors;
uae_u8 *chunk = NULL;
uae_u8 tmp[3*4];
if (disk_name == NULL || _tcslen (disk_name) == 0)
disk_name = "empty";
int ddhd = 1;
if (type == 1)
tracks = 2 * 83;
......@@ -2080,64 +2117,66 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
if (adftype == 1 || adftype == 3) {
file_size *= 2;
track_len *= 2;
ddhd = 2;
} else if (adftype == 4) {
file_size /= 2;
tracks /= 2;
}
f = zfile_fopen (name, "wb", 0);
chunk = xmalloc (uae_u8, 32768);
chunk = xmalloc (uae_u8, size);
if (f && chunk) {
int cylsize = sectors * 2 * 512;
memset (chunk, 0, 32768);
memset (chunk, 0, size);
if (type == 0) {
for (i = 0; i < file_size; i += cylsize) {
memset(chunk, 0, cylsize);
if (adftype <= 1) {
if (i == 0) {
/* boot block */
strcpy ((char*)chunk, "DOS");
floppy_get_bootblock (chunk, ffs, bootable);
} else if (i == file_size / 2) {
int block = file_size / 1024;
/* root block */
chunk[0+3] = 2;
chunk[12+3] = 0x48;
chunk[312] = chunk[313] = chunk[314] = chunk[315] = (uae_u8)0xff;
chunk[316+2] = (block + 1) >> 8; chunk[316+3] = (block + 1) & 255;
chunk[432] = strlen (disk_name);
strcpy ((char*)chunk + 433, disk_name);
chunk[508 + 3] = 1;
disk_date (chunk + 420);
memcpy (chunk + 472, chunk + 420, 3 * 4);
memcpy (chunk + 484, chunk + 420, 3 * 4);
disk_checksum(chunk, chunk + 20);
/* bitmap block */
memset (chunk + 512 + 4, 0xff, 2 * file_size / (1024 * 8));
if (adftype == 0)
chunk[512 + 0x72] = 0x3f;
else
chunk[512 + 0xdc] = 0x3f;
disk_checksum(chunk + 512, chunk + 512);
floppy_get_rootblock (chunk, file_size / 1024, disk_name, adftype);
}
}
zfile_fwrite (chunk, cylsize, 1, f);
}
} else {
uae_u8 root[4];
uae_u8 rawtrack[3 * 4], dostrack[3 * 4];
l = track_len;
zfile_fwrite ("UAE-1ADF", 8, 1, f);
tmp[0] = 0; tmp[1] = 0; /* flags (reserved) */
tmp[2] = 0; tmp[3] = tracks; /* number of tracks */
zfile_fwrite (tmp, 4, 1, f);
tmp[0] = 0; tmp[1] = 0; /* flags (reserved) */
tmp[2] = 0; tmp[3] = 1; /* track type */
tmp[4] = 0; tmp[5] = 0; tmp[6]=(uae_u8)(l >> 8); tmp[7] = (uae_u8)l;
tmp[8] = 0; tmp[9] = 0; tmp[10] = 0; tmp[11] = 0;
for (i = 0; i < tracks; i++)
zfile_fwrite (tmp, sizeof (tmp), 1, f);
for (i = 0; i < tracks; i++)
root[0] = 0; root[1] = 0; /* flags (reserved) */
root[2] = 0; root[3] = tracks; /* number of tracks */
zfile_fwrite (root, 4, 1, f);
rawtrack[0] = 0; rawtrack[1] = 0; /* flags (reserved) */
rawtrack[2] = 0; rawtrack[3] = 1; /* track type */
rawtrack[4] = 0; rawtrack[5] = 0; rawtrack[6]=(uae_u8)(l >> 8); rawtrack[7] = (uae_u8)l;
rawtrack[8] = 0; rawtrack[9] = 0; rawtrack[10] = 0; rawtrack[11] = 0;
memcpy (dostrack, rawtrack, sizeof rawtrack);
dostrack[3] = 0;
dostrack[9] = (l * 8) >> 16; dostrack[10] = (l * 8) >> 8; dostrack[11] = (l * 8) >> 0;
bool dodos = ffs || bootable || (disk_name && _tcslen (disk_name) > 0);
for (i = 0; i < tracks; i++) {
uae_u8 tmp[3 * 4];
memcpy (tmp, rawtrack, sizeof rawtrack);
if (dodos)
memcpy (tmp, dostrack, sizeof dostrack);
zfile_fwrite (tmp, sizeof tmp, 1, f);
}
for (i = 0; i < tracks; i++) {
memset (chunk, 0, size);
if (dodos) {
if (i == 0)
floppy_get_bootblock (chunk, ffs, bootable);
else if (i == 80)
floppy_get_rootblock (chunk, 80 * 11 * ddhd, disk_name, adftype);
}
zfile_fwrite (chunk, l, 1, f);
}
}
}
xfree (chunk);
zfile_fclose (f);
if (f)
......@@ -2208,7 +2247,7 @@ int disk_setwriteprotect (int num, const TCHAR *name, bool writeprotected)
name2 = DISK_get_saveimagepath (name);
if (needwritefile && zf2 == 0)
disk_creatediskfile (name2, 1, drvtype, NULL);
disk_creatediskfile (name2, 1, drvtype, NULL, 0, 0);
zfile_fclose (zf2);
if (writeprotected && iswritefileempty (name)) {
for (i = 0; i < MAX_FLOPPY_DRIVES; i++) {
......@@ -2542,12 +2581,12 @@ uae_u8 DISK_status (void)
return st;
}
STATIC_INLINE int unformatted (const drive *drv)
static bool unformatted (const drive *drv)
{
unsigned int tr = drv->cyl * 2 + side;
if (tr >= drv->num_tracks)
return 1;
if (drv->filetype == ADF_EXT2 && drv->trackdata[tr].bitlen == 0)
if (drv->filetype == ADF_EXT2 && drv->trackdata[tr].bitlen == 0 && drv->trackdata[tr].type != TRACK_AMIGADOS)
return 1;
if (drv->trackdata[tr].type == TRACK_NONE)
return 1;
......
......@@ -2816,7 +2816,7 @@ STATIC_INLINE void check_picasso (void)
{
#ifdef PICASSO96
if (picasso_on && picasso_redraw_necessary)
picasso_refresh (1);
picasso_refresh ();
picasso_redraw_necessary = 0;
if (picasso_requested_on == picasso_on)
......
......@@ -5351,7 +5351,7 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context)
{
case 1:
mountertask = m68k_areg (regs, 1);
//picasso96_alloc (context);
picasso96_alloc (context);
break;
case 2:
ret = automountunit;
......
......@@ -195,7 +195,7 @@ STATIC_INLINE void pw (int offset, uae_u16 w)
ide->secbuf[offset * 2 + 0] = (uae_u8)w;
ide->secbuf[offset * 2 + 1] = w >> 8;
}
static void ps (int offset, TCHAR *src, int max)
static void ps (int offset, const TCHAR *src, int max)
{
int i, len;
......
......@@ -1964,7 +1964,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
return 0;
}
void gfx_set_picasso_modeinfo (int w, int h, int depth)
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 d, int rgbfmt)
{
}
......
......@@ -1705,15 +1705,23 @@ static void add_p96_mode (int width, int height, int emulate_chunky, int *count)
{
unsigned int i;
struct MultiDisplay *md1;
md1 = Displays;
struct MultiDisplay *md = (struct MultiDisplay*)md1;
md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
md1->DisplayModes[0].depth = -1;
md1->disabled = 1;
for (i = 0; i <= (emulate_chunky ? 1 : 0); i++) {
if (*count < MAX_PICASSO_MODES) {
DisplayModes[*count].res.width = width;
DisplayModes[*count].res.height = height;
DisplayModes[*count].depth = (i == 1) ? 1 : bit_unit >> 3;
DisplayModes[*count].refresh = 75;
DisplayModes[*count].refresh[0] = 75;
(*count)++;
write_log ("SDLGFX: Added P96 mode: %dx%dx%d\n", width, height, (i == 1) ? 8 : bitdepth);
addmode (md, width, height, bitdepth, 75, 0);
}
}
return;
......@@ -1806,7 +1814,7 @@ static void set_window_for_picasso (void)
graphics_subinit();
}
void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt)
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
{
DEBUG_LOG ("Function: gfx_set_picasso_modeinfo w: %i h: %i depth: %i rgbfmt: %i\n", w, h, depth, rgbfmt);
......@@ -1818,6 +1826,19 @@ void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt)
set_window_for_picasso();
}
/* Color management */
//static xcolnr xcol8[4096];
static int red_bits, green_bits, blue_bits, alpha_bits;
static int red_shift, green_shift, blue_shift, alpha_shift;
static int alpha;
void gfx_set_picasso_colors (RGBFTYPE rgbfmt)
{
alloc_colors_picasso (red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift, rgbfmt);
}
void gfx_set_picasso_state (int on)
{
DEBUG_LOG ("Function: gfx_set_picasso_state: %d\n", on);
......@@ -2217,3 +2238,9 @@ int gfx_parse_option (struct uae_prefs *p, const char *option, const char *value
#endif /* USE_GL */
return result;
}
int WIN32GFX_IsPicassoScreen (void)
{
return screen_is_picasso;
}
......@@ -797,7 +797,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 1;
DisplayModes[count].refresh = 75;
DisplayModes[count].refresh[0] = 75;
count++;
format |= RGBFF_CHUNKY;
}
......@@ -806,7 +806,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 2;
DisplayModes[count].refresh = 75;
DisplayModes[count].refresh[0] = 75;
count++;
format |= RGBFF_R5G6B5PC;
}
......@@ -815,7 +815,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 4;
DisplayModes[count].refresh = 75;
DisplayModes[count].refresh[0] = 75;
count++;
format |= RGBFF_B8G8R8A8;
}
......@@ -846,7 +846,7 @@ static void set_window_for_amiga (void)
restore_vga_colors ();
}
void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt)
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, int rgbfmt)
{
vga_modeinfo *info;
int i, mode;
......
......@@ -1405,7 +1405,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = allmodes[i]->hdisplay;
DisplayModes[count].res.height = allmodes[i]->vdisplay;
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
DisplayModes[count].refresh = 75;
DisplayModes[count].refresh[0] = 75;
count++;
}
}
......@@ -1423,7 +1423,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
DisplayModes[count].refresh = 75;
DisplayModes[count].refresh[0] = 75;
count++;
}
}
......@@ -1447,7 +1447,7 @@ static void set_window_for_picasso (void)
#endif
}
void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt)
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, int rgbfmt)
{
picasso_vidinfo.width = w;
picasso_vidinfo.height = h;
......
......@@ -209,6 +209,95 @@ static uae_u32 lowbits (int v, int shift, int lsize)
return v;
}
void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int rgbfmt)
{
int byte_swap = 0;
int i;
int red_bits = 0, green_bits, blue_bits;
int red_shift, green_shift, blue_shift;
int bpp = rw + gw + bw;
switch (rgbfmt)
{
case RGBFB_R5G6B5PC:
red_bits = 5;
green_bits = 6;
blue_bits = 5;
red_shift = 11;
green_shift = 5;
blue_shift = 0;
break;
case RGBFB_R5G5B5PC:
red_bits = green_bits = blue_bits = 5;
red_shift = 10;
green_shift = 5;
blue_shift = 0;
break;
case RGBFB_R5G6B5:
red_bits = 5;
green_bits = 6;
blue_bits = 5;
red_shift = 11;
green_shift = 5;
blue_shift = 0;
byte_swap = 1;
break;
case RGBFB_R5G5B5:
red_bits = green_bits = blue_bits = 5;
red_shift = 10;
green_shift = 5;
blue_shift = 0;
byte_swap = 1;
break;
case RGBFB_B5G6R5PC:
red_bits = 5;
green_bits = 6;
blue_bits = 5;
red_shift = 0;
green_shift = 5;
blue_shift = 11;
break;
case RGBFB_B5G5R5PC:
red_bits = 5;
green_bits = 5;
blue_bits = 5;
red_shift = 0;
green_shift = 5;
blue_shift = 10;
break;
default:
red_bits = rw;
green_bits = gw;
blue_bits = bw;
red_shift = rs;
green_shift = gs;
blue_shift = bs;
break;
}
memset (p96_rgbx16, 0, sizeof p96_rgbx16);
if (red_bits) {
int lrbits = 8 - red_bits;
int lgbits = 8 - green_bits;
int lbbits = 8 - blue_bits;
int lrmask = (1 << red_bits) - 1;
int lgmask = (1 << green_bits) - 1;
int lbmask = (1 << blue_bits) - 1;
for (i = 65535; i >= 0; i--) {
uae_u32 r, g, b, c;
uae_u32 j = byte_swap ? bswap_16 (i) : i;
r = (((j >> red_shift) & lrmask) << lrbits) | lowbits (j, red_shift, lrbits);
g = (((j >> green_shift) & lgmask) << lgbits) | lowbits (j, green_shift, lgbits);
b = (((j >> blue_shift) & lbmask) << lbbits) | lowbits (j, blue_shift, lbbits);
c = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs);
if (bpp <= 16)
c *= 0x00010001;
p96_rgbx16[i] = c;
}
}
}
void alloc_colors_rgb (int rw, int gw, int bw, int rs, int gs, int bs, int aw, int as, int alpha, int byte_swap,
uae_u32 *rc, uae_u32 *gc, uae_u32 *bc)
{
......
......@@ -28,7 +28,7 @@ extern void DISK_hsync (void);
extern void DISK_reset (void);
extern int disk_getwriteprotect (const TCHAR *name);
extern int disk_setwriteprotect (int num, const TCHAR *name, bool writeprotected);
extern void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk_name);
extern void disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const TCHAR *disk_name, bool ffs, bool bootable);
extern void dumpdisk (void);
extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
extern TCHAR *DISK_history_get (int idx, int type);
......
......@@ -124,10 +124,13 @@
#define AK_TERM_POWERUP 0xfe
// KB LED stuff
#define KBLED_NUMLOCKB 0
#define KBLED_CAPSLOCKB 1
#define KBLED_SCROLLLOCKB 2
#define KBLED_NUMLOCK 1
#define KBLED_CAPSLOCK 2
#define KBLED_SCROLLLOCK 4
#define KBLED_NUMLOCKM (1 << KBLED_NUMLOCKB)
#define KBLED_CAPSLOCKM (1 << KBLED_CAPSLOCKB)
#define KBLED_SCROLLLOCKM (1 << KBLED_SCROLLLOCKB)
enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT_FILE, AKS_SCREENSHOT_CLIPBOARD, AKS_FREEZEBUTTON,
AKS_FLOPPY0, AKS_FLOPPY1, AKS_FLOPPY2, AKS_FLOPPY3,
......
......@@ -412,7 +412,6 @@ struct uae_prefs {
bool win32_rtgscaleifsmall;
bool win32_rtgallowscaling;
int win32_rtgscaleaspectratio;
int win32_rtgvblankrate;
bool win32_borderless;
bool win32_ctrl_F11_is_quit;
bool win32_automount_removable;
......@@ -435,6 +434,7 @@ struct uae_prefs {
TCHAR win32_parjoyport0[MAX_DPATH];
TCHAR win32_parjoyport1[MAX_DPATH];
#endif
int win32_rtgvblankrate;
#ifdef USE_CURSES_GFX
int curses_reverse_video;
......
......@@ -18,8 +18,8 @@
/* Seems the same routines copy back and forth ;-) */
#define PIC_READ (SPECIAL_MEM_READ|SPECIAL_MEM_WRITE)
#define PIC_WRITE (SPECIAL_MEM_READ|SPECIAL_MEM_WRITE)
#define PIC_READ (SPECIAL_MEM_READ | SPECIAL_MEM_WRITE)
#define PIC_WRITE (SPECIAL_MEM_READ | SPECIAL_MEM_WRITE)
#define JAM1 0
#define JAM2 1
......@@ -43,9 +43,11 @@ typedef enum {
BLIT_NOTONLYDST,
BLIT_OR,
BLIT_TRUE,
BLIT_LAST
BLIT_SWAP = 30
} BLIT_OPCODE;
#define NOSIGNAL 0xFFFFFFFF
/************************************************************************/
/* Types for BoardType Identification
*/
......@@ -81,18 +83,31 @@ struct ScreenResolution
uae_u32 height; /* in pixels */
};
#define MAX_PICASSO_MODES 64
#define MAX_PICASSO_MODES 300
#define MAX_REFRESH_RATES 100
struct PicassoResolution
{
struct Resolutions *next;
struct ScreenResolution res;
int depth;
int refresh;
char name[25];
int depth; /* depth in bytes-per-pixel */
int residx;
int refresh[MAX_REFRESH_RATES]; /* refresh-rates in Hz */
int refreshtype[MAX_REFRESH_RATES]; /* 0=dx,1=enumdisplaysettings */
TCHAR name[25];
/* Bit mask of RGBFF_xxx values. */
uae_u32 colormodes;
int nondx;
};
extern struct PicassoResolution DisplayModes[MAX_PICASSO_MODES];
#define MAX_DISPLAYS 10
struct MultiDisplay {
int primary, disabled, gdi;
// GUID guid;
TCHAR *name, *name2, *name3;
struct PicassoResolution *DisplayModes;
// RECT rect;
};
extern struct MultiDisplay Displays[MAX_DISPLAYS];
/* Types for RGBFormat used */
typedef enum {
......@@ -155,6 +170,24 @@ typedef enum {
#define RGBMASK_32BIT (RGBFF_A8R8G8B8 | RGBFF_A8B8G8R8 | RGBFF_R8G8B8A8 | RGBFF_B8G8R8A8)
/************************************************************************/
/* Types for PaletteChipType Identification
*/
typedef enum {
PCT_Unknown,
PCT_S11483, // Sierra S11483: HiColor 15 bit, oMniBus, Domino
PCT_S15025, // Sierra S15025: TrueColor 32 bit, oMniBus
PCT_CirrusGD542x, // Cirrus GD542x internal: TrueColor 24 bit
PCT_Domino, // is in fact a Sierra S11483
PCT_BT482, // BrookTree BT482: TrueColor 32 bit, Merlin
PCT_Music, // Music MU9C4910: TrueColor 24 bit, oMniBus
PCT_ICS5300, // ICS 5300: ...., Retina BLT Z3
PCT_CirrusGD5446, // Cirrus GD5446 internal: TrueColor 24 bit
PCT_CirrusGD5434, // Cirrus GD5434 internal: TrueColor 32 bit
PCT_S3Trio64, // S3 Trio64 internal: TrueColor 32 bit
PCT_A2410_xxx, // A2410 DAC, *type unknown*
PCT_S3ViRGE, // S3 ViRGE internal: TrueColor 32 bit
PCT_MaxPaletteChipTypes
} PCTYPE;
#define RGBFF_PLANAR RGBFF_NONE
#define RGBFF_CHUNKY RGBFF_CLUT
......@@ -162,6 +195,28 @@ typedef enum {
#define RGBFB_PLANAR RGBFB_NONE
#define RGBFB_CHUNKY RGBFB_CLUT
/************************************************************************/
/* Types for GraphicsControllerType Identification
*/
typedef enum {
GCT_Unknown,
GCT_ET4000,
GCT_ETW32,
GCT_CirrusGD542x,
GCT_NCR77C32BLT,
GCT_CirrusGD5446,
GCT_CirrusGD5434,
GCT_S3Trio64,
GCT_TI34010,
GCT_S3ViRGE,
GCT_MaxGraphicsControllerTypes
} GCTYPE;
#define JAM1 0
#define JAM2 1
#define COMP 2
#define INVERS 4
/************************************************************************/
enum {
......@@ -243,8 +298,8 @@ struct Settings {
#define PSSO_LibResolution_Height 48
#define PSSO_LibResolution_Flags 50
#define PSSO_LibResolution_Modes 52
#define PSSO_LibResolution_BoardInfo (52 + MAXMODES*4)
#define PSSO_LibResolution_sizeof (60 + MAXMODES*4)
#define PSSO_LibResolution_BoardInfo (52 + MAXMODES * 4)
#define PSSO_LibResolution_sizeof (60 + MAXMODES * 4)
struct LibResolution {
char P96ID[6];
......@@ -309,7 +364,7 @@ struct RenderInfo {
#define PSSO_Pattern_DrawMode 17
#define PSSO_Pattern_sizeof 18
struct Pattern {
char *Memory;
uae_u8 *Memory;
uae_u16 XOffset, YOffset;
uae_u32 FgPen, BgPen;
uae_u8 Size; /* Width: 16, Height: (1<<pat_Size) */
......@@ -325,7 +380,7 @@ struct Pattern {
#define PSSO_Template_sizeof 16
struct Template {
char *Memory;
uae_u8 *Memory;
uae_s16 BytesPerRow;
uae_u8 XOffset;
uae_u8 DrawMode;
......@@ -348,6 +403,43 @@ struct Template {
#define PSSO_BitMapExtra_CompanionMaster 50
#define PSSO_BitMapExtra_Last 54
struct BoardInfo {
uae_u8 *RegisterBase, *MemoryBase, *MemoryIOBase;
uae_u32 MemorySize;
char *BoardName, VBIName[32];
uae_u16 MoniSwitch;
uae_u16 BitsPerCannon;
uae_u32 Flags;
uae_u16 SoftSpriteFlags;
uae_u16 ChipFlags; /* private, chip specific, not touched by RTG */
uae_u32 CardFlags; /* private, card specific, not touched by RTG */
uae_u16 BoardNum;
uae_s16 RGBFormats;
uae_u16 MaxHorValue[MAXMODES];
uae_u16 MaxVerValue[MAXMODES];
uae_u16 MaxHorResolution[MAXMODES];
uae_u16 MaxVerResolution[MAXMODES];
uae_u32 MaxMemorySize, MaxChunkSize;
};
#define PSSO_BitMapExtra_BoardNode 0
#define PSSO_BitMapExtra_HashChain 8 /* BoardNode is 8-bytes */
#define PSSO_BitMapExtra_Match 12
#define PSSO_BitMapExtra_BitMap 16
#define PSSO_BitMapExtra_BoardInfo 20
#define PSSO_BitMapExtra_MemChunk 24
#define PSSO_BitMapExtra_RenderInfo 28
#define PSSO_BitMapExtra_Width 40 /* RenderInfo is 12-bytes */
#define PSSO_BitMapExtra_Height 42
#define PSSO_BitMapExtra_Flags 44
#define PSSO_BitMapExtra_BaseLevel 46
#define PSSO_BitMapExtra_CurrentLevel 48
#define PSSO_BitMapExtra_CompanionMaster 50
#define PSSO_BitMapExtra_Last 54
#define PSSO_BoardInfo_RegisterBase 0
#define PSSO_BoardInfo_MemoryBase PSSO_BoardInfo_RegisterBase + 4
#define PSSO_BoardInfo_MemoryIOBase PSSO_BoardInfo_MemoryBase + 4
......@@ -374,15 +466,99 @@ struct Template {
#define PSSO_BoardInfo_BoardNum PSSO_BoardInfo_CardFlags + 4
#define PSSO_BoardInfo_RGBFormats PSSO_BoardInfo_BoardNum + 2
#define PSSO_BoardInfo_MaxHorValue PSSO_BoardInfo_RGBFormats + 2
#define PSSO_BoardInfo_MaxVerValue PSSO_BoardInfo_MaxHorValue + MAXMODES*2
#define PSSO_BoardInfo_MaxHorResolution PSSO_BoardInfo_MaxVerValue + MAXMODES*2
#define PSSO_BoardInfo_MaxVerResolution PSSO_BoardInfo_MaxHorResolution + MAXMODES*2
#define PSSO_BoardInfo_MaxMemorySize PSSO_BoardInfo_MaxVerResolution + MAXMODES*2
#define PSSO_BoardInfo_MaxVerValue PSSO_BoardInfo_MaxHorValue + MAXMODES * 2
#define PSSO_BoardInfo_MaxHorResolution PSSO_BoardInfo_MaxVerValue + MAXMODES * 2
#define PSSO_BoardInfo_MaxVerResolution PSSO_BoardInfo_MaxHorResolution + MAXMODES * 2
#define PSSO_BoardInfo_MaxMemorySize PSSO_BoardInfo_MaxVerResolution + MAXMODES * 2
#define PSSO_BoardInfo_MaxChunkSize PSSO_BoardInfo_MaxMemorySize + 4
#define PSSO_BoardInfo_MemoryClock PSSO_BoardInfo_MaxChunkSize + 4
#define PSSO_BoardInfo_PixelClockCount PSSO_BoardInfo_MemoryClock + 4
#define PSSO_BoardInfo_AllocCardMem PSSO_BoardInfo_PixelClockCount + MAXMODES*4
#define PSSO_BoardInfo_SpecialFeatures PSSO_BoardInfo_AllocCardMem + 68*4 /* 68 function pointers */
#define PSSO_BoardInfo_AllocCardMem PSSO_BoardInfo_PixelClockCount + MAXMODES * 4
#define PSSO_BoardInfo_FreeCardMem PSSO_BoardInfo_AllocCardMem + 4
#define PSSO_BoardInfo_SetSwitch PSSO_BoardInfo_FreeCardMem + 4
#define PSSO_BoardInfo_SetColorArray PSSO_BoardInfo_SetSwitch + 4
#define PSSO_BoardInfo_SetDAC PSSO_BoardInfo_SetColorArray + 4
#define PSSO_BoardInfo_SetGC PSSO_BoardInfo_SetDAC + 4
#define PSSO_BoardInfo_SetPanning PSSO_BoardInfo_SetGC + 4
#define PSSO_BoardInfo_CalculateBytesPerRow PSSO_BoardInfo_SetPanning + 4
#define PSSO_BoardInfo_CalculateMemory PSSO_BoardInfo_CalculateBytesPerRow + 4
#define PSSO_BoardInfo_GetCompatibleFormats PSSO_BoardInfo_CalculateMemory + 4
#define PSSO_BoardInfo_SetDisplay PSSO_BoardInfo_GetCompatibleFormats + 4
#define PSSO_BoardInfo_ResolvePixelClock PSSO_BoardInfo_SetDisplay + 4
#define PSSO_BoardInfo_GetPixelClock PSSO_BoardInfo_ResolvePixelClock + 4
#define PSSO_BoardInfo_SetClock PSSO_BoardInfo_GetPixelClock + 4
#define PSSO_BoardInfo_SetMemoryMode PSSO_BoardInfo_SetClock + 4
#define PSSO_BoardInfo_SetWriteMask PSSO_BoardInfo_SetMemoryMode + 4
#define PSSO_BoardInfo_SetClearMask PSSO_BoardInfo_SetWriteMask + 4
#define PSSO_BoardInfo_SetReadPlane PSSO_BoardInfo_SetClearMask + 4
#define PSSO_BoardInfo_WaitVerticalSync PSSO_BoardInfo_SetReadPlane + 4
#define PSSO_BoardInfo_SetInterrupt PSSO_BoardInfo_WaitVerticalSync + 4
#define PSSO_BoardInfo_WaitBlitter PSSO_BoardInfo_SetInterrupt + 4
#define PSSO_BoardInfo_ScrollPlanar PSSO_BoardInfo_WaitBlitter + 4
#define PSSO_BoardInfo_ScrollPlanarDefault PSSO_BoardInfo_ScrollPlanar + 4
#define PSSO_BoardInfo_UpdatePlanar PSSO_BoardInfo_ScrollPlanarDefault + 4
#define PSSO_BoardInfo_UpdatePlanarDefault PSSO_BoardInfo_UpdatePlanar + 4
#define PSSO_BoardInfo_BlitPlanar2Chunky PSSO_BoardInfo_UpdatePlanarDefault + 4
#define PSSO_BoardInfo_BlitPlanar2ChunkyDefault PSSO_BoardInfo_BlitPlanar2Chunky + 4
#define PSSO_BoardInfo_FillRect PSSO_BoardInfo_BlitPlanar2ChunkyDefault + 4
#define PSSO_BoardInfo_FillRectDefault PSSO_BoardInfo_FillRect + 4
#define PSSO_BoardInfo_InvertRect PSSO_BoardInfo_FillRectDefault + 4
#define PSSO_BoardInfo_InvertRectDefault PSSO_BoardInfo_InvertRect + 4
#define PSSO_BoardInfo_BlitRect PSSO_BoardInfo_InvertRectDefault + 4
#define PSSO_BoardInfo_BlitRectDefault PSSO_BoardInfo_BlitRect + 4
#define PSSO_BoardInfo_BlitTemplate PSSO_BoardInfo_BlitRectDefault + 4
#define PSSO_BoardInfo_BlitTemplateDefault PSSO_BoardInfo_BlitTemplate + 4
#define PSSO_BoardInfo_BlitPattern PSSO_BoardInfo_BlitTemplateDefault + 4
#define PSSO_BoardInfo_BlitPatternDefault PSSO_BoardInfo_BlitPattern + 4
#define PSSO_BoardInfo_DrawLine PSSO_BoardInfo_BlitPatternDefault + 4
#define PSSO_BoardInfo_DrawLineDefault PSSO_BoardInfo_DrawLine + 4
#define PSSO_BoardInfo_BlitRectNoMaskComplete PSSO_BoardInfo_DrawLineDefault + 4
#define PSSO_BoardInfo_BlitRectNoMaskCompleteDefault PSSO_BoardInfo_BlitRectNoMaskComplete + 4
#define PSSO_BoardInfo_BlitPlanar2Direct PSSO_BoardInfo_BlitRectNoMaskCompleteDefault + 4
#define PSSO_BoardInfo_BlitPlanar2DirectDefault PSSO_BoardInfo_BlitPlanar2Direct + 4
#define PSSO_BoardInfo_Reserved0 PSSO_BoardInfo_BlitPlanar2DirectDefault + 4
#define PSSO_BoardInfo_Reserved0Default PSSO_BoardInfo_Reserved0 + 4
#define PSSO_BoardInfo_Reserved1 PSSO_BoardInfo_Reserved0Default + 4
#define PSSO_BoardInfo_Reserved1Default PSSO_BoardInfo_Reserved1 + 4
#define PSSO_BoardInfo_Reserved2 PSSO_BoardInfo_Reserved1Default + 4
#define PSSO_BoardInfo_Reserved2Default PSSO_BoardInfo_Reserved2 + 4
#define PSSO_BoardInfo_Reserved3 PSSO_BoardInfo_Reserved2Default + 4
#define PSSO_BoardInfo_Reserved3Default PSSO_BoardInfo_Reserved3 + 4
#define PSSO_BoardInfo_Reserved4 PSSO_BoardInfo_Reserved3Default + 4
#define PSSO_BoardInfo_Reserved4Default PSSO_BoardInfo_Reserved4 + 4
#define PSSO_BoardInfo_Reserved5 PSSO_BoardInfo_Reserved4Default + 4
#define PSSO_BoardInfo_Reserved5Default PSSO_BoardInfo_Reserved5 + 4
#define PSSO_BoardInfo_SetDPMSLevel PSSO_BoardInfo_Reserved5Default + 4
#define PSSO_BoardInfo_ResetChip PSSO_BoardInfo_SetDPMSLevel + 4
#define PSSO_BoardInfo_GetFeatureAttrs PSSO_BoardInfo_ResetChip + 4
#define PSSO_BoardInfo_AllocBitMap PSSO_BoardInfo_GetFeatureAttrs + 4
#define PSSO_BoardInfo_FreeBitMap PSSO_BoardInfo_AllocBitMap + 4
#define PSSO_BoardInfo_GetBitMapAttr PSSO_BoardInfo_FreeBitMap + 4
#define PSSO_BoardInfo_SetSprite PSSO_BoardInfo_GetBitMapAttr + 4
#define PSSO_BoardInfo_SetSpritePosition PSSO_BoardInfo_SetSprite + 4
#define PSSO_BoardInfo_SetSpriteImage PSSO_BoardInfo_SetSpritePosition + 4
#define PSSO_BoardInfo_SetSpriteColor PSSO_BoardInfo_SetSpriteImage + 4
#define PSSO_BoardInfo_CreateFeature PSSO_BoardInfo_SetSpriteColor + 4
#define PSSO_BoardInfo_SetFeatureAttrs PSSO_BoardInfo_CreateFeature + 4
#define PSSO_BoardInfo_DeleteFeature PSSO_BoardInfo_SetFeatureAttrs + 4
#define PSSO_BoardInfo_SpecialFeatures PSSO_BoardInfo_DeleteFeature + 4
#define PSSO_BoardInfo_ModeInfo PSSO_BoardInfo_SpecialFeatures + 12 /* SpecialFeatures is 12-bytes */
#define PSSO_BoardInfo_RGBFormat PSSO_BoardInfo_ModeInfo + 4
#define PSSO_BoardInfo_XOffset PSSO_BoardInfo_RGBFormat + 4
......@@ -410,27 +586,15 @@ struct Template {
#define PSSO_BoardInfo_MouseRendered PSSO_BoardInfo_MouseChunky + 4
#define PSSO_BoardInfo_MouseSaveBuffer PSSO_BoardInfo_MouseRendered + 4
struct BoardInfo {
uae_u8 *RegisterBase, *MemoryBase, *MemoryIOBase;
uae_u32 MemorySize;
char *BoardName, VBIName[32];
uae_u16 MoniSwitch;
uae_u16 BitsPerCannon;
uae_u32 Flags;
uae_u16 SoftSpriteFlags;
uae_u16 ChipFlags; /* private, chip specific, not touched by RTG */
uae_u32 CardFlags; /* private, card specific, not touched by RTG */
uae_u16 BoardNum;
uae_s16 RGBFormats;
uae_u16 MaxHorValue[MAXMODES];
uae_u16 MaxVerValue[MAXMODES];
uae_u16 MaxHorResolution[MAXMODES];
uae_u16 MaxVerResolution[MAXMODES];
uae_u32 MaxMemorySize, MaxChunkSize;
};
#define PSSO_BoardInfo_ChipData PSSO_BoardInfo_MouseSaveBuffer + 4
#define PSSO_BoardInfo_CardData PSSO_BoardInfo_ChipData + 16 * 4
#define PSSO_BoardInfo_MemorySpaceBase PSSO_BoardInfo_CardData + 16 * 4
#define PSSO_BoardInfo_MemorySpaceSize PSSO_BoardInfo_MemorySpaceBase + 4
#define PSSO_BoardInfo_DoubleBufferList PSSO_BoardInfo_MemorySpaceSize + 4
#define PSSO_BoardInfo_SyncTime PSSO_BoardInfo_DoubleBufferList + 4
#define PSSO_BoardInfo_SyncPeriod PSSO_BoardInfo_SyncTime + 4
#define PSSO_BoardInfo_SoftVBlankPort PSSO_BoardInfo_SyncPeriod + 8
#define PSSO_BoardInfo_SizeOf PSSO_BoardInfo_SoftVBlankPort + 34
/* BoardInfo flags */
/* 0-15: hardware flags */
......@@ -438,15 +602,15 @@ struct BoardInfo {
#define BIB_HARDWARESPRITE 0 /* board has hardware sprite */
#define BIB_NOMEMORYMODEMIX 1 /* board does not support modifying planar bitmaps while displaying chunky and vice versa */
#define BIB_NEEDSALIGNMENT 2 /* bitmaps have to be aligned (not yet supported!) */
#define BIB_CACHEMODECHANGE 3 /* board memory may be set to Imprecise (060) or Nonserialised (040) */
#define BIB_VBLANKINTERRUPT 4 /* board can cause a hardware interrupt on a vertical retrace */
#define BIB_DBLSCANDBLSPRITEY 8 /* hardware sprite y position is doubled on doublescan display modes */
#define BIB_ILACEHALFSPRITEY 9 /* hardware sprite y position is halved on interlace display modes */
#define BIB_ILACEDBLROWOFFSET 10 /* doubled row offset in interlaced display modes needs additional horizontal bit */
#define BIB_FLICKERFIXER 12 /* board can flicker fix Amiga RGB signal */
#define BIB_VIDEOCAPTURE 13 /* board can capture video data to a memory area */
#define BIB_VIDEOWINDOW 14 /* board can display a second mem area as a pip */
#define BIB_BLITTER 15 /* board has blitter */
#define BIB_HIRESSPRITE 16 /* mouse sprite has double resolution */
#define BIB_BIGSPRITE 17 /* user wants big mouse sprite */
#define BIB_BORDEROVERRIDE 18 /* user wants to override system overscan border prefs */
......@@ -456,74 +620,67 @@ struct BoardInfo {
#define BIB_NOMASKBLITS 22 /* perform blits without taking care of mask */
#define BIB_NOC2PBLITS 23 /* use CPU for planar to chunky conversions */
#define BIB_NOBLITTER 24 /* disable all blitter functions */
#define BIB_OVERCLOCK 31 /* enable overclocking for some boards */
#define BIB_IGNOREMASK BIB_NOMASKBLITS
#define BIF_HARDWARESPRITE (1<<BIB_HARDWARESPRITE)
#define BIF_NOMEMORYMODEMIX (1<<BIB_NOMEMORYMODEMIX)
#define BIF_NEEDSALIGNMENT (1<<BIB_NEEDSALIGNMENT)
#define BIF_DBLSCANDBLSPRITEY (1<<BIB_DBLSCANDBLSPRITEY)
#define BIF_ILACEHALFSPRITEY (1<<BIB_ILACEHALFSPRITEY)
#define BIF_ILACEDBLROWOFFSET (1<<BIB_ILACEDBLROWOFFSET)
#define BIF_FLICKERFIXER (1<<BIB_FLICKERFIXER)
#define BIF_VIDEOCAPTURE (1<<BIB_VIDEOCAPTURE)
#define BIF_VIDEOWINDOW (1<<BIB_VIDEOWINDOW)
#define BIF_BLITTER (1<<BIB_BLITTER)
#define BIF_HIRESSPRITE (1<<BIB_HIRESSPRITE)
#define BIF_BIGSPRITE (1<<BIB_BIGSPRITE)
#define BIF_BORDEROVERRIDE (1<<BIB_BORDEROVERRIDE)
#define BIF_BORDERBLANK (1<<BIB_BORDERBLANK)
#define BIF_INDISPLAYCHAIN (1<<BIB_INDISPLAYCHAIN)
#define BIF_QUIET (1<<BIB_QUIET)
#define BIF_NOMASKBLITS (1<<BIB_NOMASKBLITS)
#define BIF_NOC2PBLITS (1<<BIB_NOC2PBLITS)
#define BIF_NOBLITTER (1<<BIB_NOBLITTER)
#define BIF_HARDWARESPRITE (1 << BIB_HARDWARESPRITE)
#define BIF_NOMEMORYMODEMIX (1 << BIB_NOMEMORYMODEMIX)
#define BIF_NEEDSALIGNMENT (1 << BIB_NEEDSALIGNMENT)
#define BIF_CACHEMODECHANGE (1 << BIB_CACHEMODECHANGE)
#define BIF_VBLANKINTERRUPT (1 << BIB_VBLANKINTERRUPT)
#define BIF_DBLSCANDBLSPRITEY (1 << BIB_DBLSCANDBLSPRITEY)
#define BIF_ILACEHALFSPRITEY (1 << BIB_ILACEHALFSPRITEY)
#define BIF_ILACEDBLROWOFFSET (1 << BIB_ILACEDBLROWOFFSET)
#define BIF_FLICKERFIXER (1 << BIB_FLICKERFIXER)
#define BIF_VIDEOCAPTURE (1 << BIB_VIDEOCAPTURE)
#define BIF_VIDEOWINDOW (1 << BIB_VIDEOWINDOW)
#define BIF_BLITTER (1 << BIB_BLITTER)
#define BIF_HIRESSPRITE (1 << BIB_HIRESSPRITE)
#define BIF_BIGSPRITE (1 << BIB_BIGSPRITE)
#define BIF_BORDEROVERRIDE (1 << BIB_BORDEROVERRIDE)
#define BIF_BORDERBLANK (1 << BIB_BORDERBLANK)
#define BIF_INDISPLAYCHAIN (1 << BIB_INDISPLAYCHAIN)
#define BIF_QUIET (1 << BIB_QUIET)
#define BIF_NOMASKBLITS (1 << BIB_NOMASKBLITS)
#define BIF_NOC2PBLITS (1 << BIB_NOC2PBLITS)
#define BIF_NOBLITTER (1 << BIB_NOBLITTER)
#define BIF_OVERCLOCK (1 << BIB_OVERCLOCK)
#define BIF_IGNOREMASK BIF_NOMASKBLITS
/************************************************************************/
struct picasso96_state_struct
{
uae_u32 RGBFormat; /* true-colour, CLUT, hi-colour, etc. */
RGBFTYPE RGBFormat; /* true-colour, CLUT, hi-colour, etc.*/
struct MyCLUTEntry CLUT[256]; /* Duh! */
uaecptr Address; /* Active screen address (Amiga-side) */
uaecptr Extent; /* End address of screen (Amiga-side) */
uae_u16 Width; /* Active display width (From SetGC) */
uae_u16 VirtualWidth;/* Total screen width (From SetPanning) */
uae_u16 BytesPerRow; /* Total screen width in bytes (From SetGC) */
uae_u16 Height; /* Active display height (From SetGC) */
uaecptr Address; /* Active screen address (Amiga-side)*/
uaecptr Extent; /* End address of screen (Amiga-side)*/
uae_u16 Width; /* Active display width (From SetGC)*/
uae_u16 VirtualWidth;/* Total screen width (From SetPanning)*/
uae_u16 BytesPerRow; /* Total screen width in bytes (FromSetGC) */
uae_u16 Height; /* Active display height (From SetGC)*/
uae_u16 VirtualHeight; /* Total screen height */
uae_u8 GC_Depth; /* From SetGC() */
uae_u8 GC_Flags; /* From SetGC() */
long XOffset; /* From SetPanning() */
long YOffset; /* From SetPanning() */
uae_u8 SwitchState; /* From SetSwitch() - 0 is Amiga, 1 is Picasso */
uae_u8 SwitchState; /* From SetSwitch() - 0 is Amiga, 1 isPicasso */
uae_u8 BytesPerPixel;
uae_u8 CardFound;
//here follow winuae additional entrys
uae_u8 BigAssBitmap; /* Set to 1 when our Amiga screen is bigger than the displayable area */
unsigned int Version;
uae_u8 *HostAddress; /* Active screen address (PC-side) */
// host address is need because Windows
// support NO direct access all the time to gfx Card
// everytime windows can remove your surface from card so the mainrender place
// must be in memory
long XYOffset;
};
extern void InitPicasso96 (void);
extern uae_u32 picasso_SetDisplay (void);
extern uae_u32 picasso_WaitVerticalSync (void);
extern uae_u32 picasso_CalculateBytesPerRow (void);
extern uae_u32 picasso_FillRect (void);
extern uae_u32 picasso_BlitRect (void);
extern uae_u32 picasso_InvertRect (void);
extern uae_u32 picasso_SetPanning (void);
extern uae_u32 picasso_SetGC (void);
extern uae_u32 picasso_SetDAC (void);
extern uae_u32 picasso_SetColorArray (void);
extern uae_u32 picasso_SetSwitch (void);
extern uae_u32 picasso_SetSwitch (void);
extern uae_u32 picasso_FindCard (void);
extern uae_u32 picasso_InitCard (void);
extern uae_u32 picasso_BlitPlanar2Chunky (void);
extern uae_u32 picasso_BlitPlanar2Direct (void);
extern uae_u32 picasso_BlitTemplate (void);
extern uae_u32 picasso_BlitPattern (void);
extern uae_u32 picasso_BlitRectNoMaskComplete (void);
extern uae_u32 gfxmem_mask;
extern uae_u8 *gfxmemory;
......@@ -535,18 +692,14 @@ extern struct picasso96_state_struct picasso96_state;
extern unsigned int timer_id;
#endif
extern int DX_Fill (int dstx, int dsty, int width, int height, uae_u32 color, RGBFTYPE rgbtype);
extern int DX_Blit (int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT_OPCODE opcode);
extern void DX_BlitRectFromBuffer (struct RenderInfo *ri, uae_u8* buffer, uae_u16 dstx, uae_u16 dsty, uae_u16 w, uae_u16 h);
extern void DX_InvertRect (struct RenderInfo *ri, uae_u16 X, uae_u16 Y, uae_u16 Width, uae_u16 Height);
extern void DX_SetPalette (int start, int count);
extern void DX_SetPalette_vsync (void);
extern int DX_FillResolutions (uae_u16 *);
extern int DX_BitsPerCannon (void);
extern void DX_Invalidate (int first, int last);
extern void picasso_enablescreen (int on);
extern void picasso_refresh (int call_setpalette);
extern void picasso_refresh (void);
extern void picasso_handle_vsync (void);
extern void init_hz_p96 (void);
extern void picasso_handle_hsync (void);
extern void picasso_reset (void);
extern int picasso_setwincursor (void);
extern int picasso_palette (void);
extern uae_u8 *gfxmemory;
......@@ -554,7 +707,7 @@ extern uae_u8 *gfxmemory;
* screen. */
struct picasso_vidbuf_description {
int width, height, depth;
int rowbytes, pixbytes;
int rowbytes, pixbytes, offset;
int extra_mem; /* nonzero if there's a second buffer that must be updated */
uae_u32 rgbformat;
uae_u32 selected_rgbformat;
......@@ -563,29 +716,39 @@ struct picasso_vidbuf_description {
extern struct picasso_vidbuf_description picasso_vidinfo;
extern void gfx_set_picasso_modeinfo (int w, int h, int d, int rgbfmt);
extern void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 d, RGBFTYPE rgbfmt);
extern void gfx_set_picasso_colors (RGBFTYPE rgbfmt);
extern void gfx_set_picasso_baseaddr (uaecptr);
extern void gfx_set_picasso_state (int on);
extern uae_u8 *gfx_lock_picasso (void);
extern void gfx_unlock_picasso (void);
extern int picasso_display_mode_index (uae_u32 x, uae_u32 y, uae_u32 d);
extern int picasso_nr_resolutions (void);
extern void picasso_clip_mouse (int *, int *);
extern int NDX_InvertRect(struct RenderInfo* ri, unsigned long X, unsigned long Y, unsigned long Width, unsigned long Height, uae_u32 mask, int Bpp);
extern int NDX_BlitPattern(struct RenderInfo* ri,struct Pattern* pat,unsigned long X, unsigned long Y, unsigned long W, unsigned long H, uae_u8 Mask, uae_u32 RGBFmt);
extern int NDX_BlitTemplate(struct RenderInfo* ri, struct Template* tmp, unsigned long X, unsigned long Y, unsigned long W, unsigned long H, uae_u16 Mask);
extern int NDX_BlitPlanar2Chunky(struct RenderInfo* ri, struct BitMap* bm, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 minterm, uae_u8 mask);
extern int NDX_BlitPlanar2Direct(struct RenderInfo* ri, struct BitMap* bm, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 minterm, uae_u8 Mask);
extern int NDX_FillRect(struct RenderInfo* ri, unsigned long X, unsigned long Y, unsigned long Width, unsigned long Height, uae_u32 Pen, uae_u8 Mask, uae_u32 RGBFormat);
extern int NDX_BlitRect(struct RenderInfo* ri, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 Mask);
extern int NDX_BlitRectNoMaskComplete(struct RenderInfo* sri,struct RenderInfo* dri, unsigned long srcx, unsigned long srcy, unsigned long dstx, unsigned long dsty, unsigned long width, unsigned long height, uae_u8 OpCode, uae_u32 RGBFmt);
extern int picasso_is_special;
extern int picasso_is_special_read;
extern int p96hack_vpos2;
extern int p96refresh_active;
extern int p96hsync_counter;
#define LIB_SIZE 34
#define CARD_FLAGS LIB_SIZE
#define CARD_EXECBASE (CARD_FLAGS + 2)
#define CARD_EXPANSIONBASE (CARD_EXECBASE + 4)
#define CARD_SEGMENTLIST (CARD_EXPANSIONBASE + 4)
#define CARD_NAME (CARD_SEGMENTLIST + 4)
/* uae specific stuff */
#define CARD_RESLIST (CARD_NAME + 4)
#define CARD_RESLISTSIZE (CARD_RESLIST + 4)
#define CARD_BOARDINFO (CARD_RESLISTSIZE + 4)
#define CARD_VBLANKIRQ (CARD_BOARDINFO + 4)
#define CARD_PORTSIRQ (CARD_VBLANKIRQ + 22)
#define CARD_IRQFLAG (CARD_PORTSIRQ + 22)
#define CARD_IRQPTR (CARD_IRQFLAG + 4)
#define CARD_IRQCODE (CARD_IRQPTR + 4)
#define CARD_END (CARD_IRQCODE + 11 * 2)
#define CARD_SIZEOF CARD_END
#endif
#endif
......@@ -1149,3 +1149,113 @@ void my_kbd_handler (int keyboard, int scancode, int newstate)
write_log ("kbd = %d, scancode = %d, state = %d\n", keyboard, scancode, newstate );
inputdevice_translatekeycode (keyboard, scancode, newstate);
}
//win32gfx
#define MAX_DISPLAYS 10
struct MultiDisplay Displays[MAX_DISPLAYS];
struct MultiDisplay *getdisplay (struct uae_prefs *p)
{
int i;
int display = p->gfx_display;
write_log ("Multimonitor detection disabled\n");
Displays[0].primary = 1;
Displays[0].name = "Display";
Displays[0].disabled = 0;
i = 0;
while (Displays[i].name) {
struct MultiDisplay *md = &Displays[i];
if (p->gfx_display_name[0] && !_tcscmp (md->name, p->gfx_display_name))
return md;
if (p->gfx_display_name[0] && !_tcscmp (md->name2, p->gfx_display_name))
return md;
i++;
}
if (i == 0) {
write_log ("no display adapters! Exiting");
exit (0);
}
if (display >= i)
display = 0;
return &Displays[display];
}
void addmode (struct MultiDisplay *md, int w, int h, int d, int rate, int nondx)
{
int ct;
int i, j;
ct = 0;
if (d == 8)
ct = RGBMASK_8BIT;
if (d == 15)
ct = RGBMASK_15BIT;
if (d == 16)
ct = RGBMASK_16BIT;
if (d == 24)
ct = RGBMASK_24BIT;
if (d == 32)
ct = RGBMASK_32BIT;
if (ct == 0)
return;
d /= 8;
i = 0;
while (md->DisplayModes[i].depth >= 0) {
if (md->DisplayModes[i].depth == d && md->DisplayModes[i].res.width == w && md->DisplayModes[i].res.height == h) {
for (j = 0; j < MAX_REFRESH_RATES; j++) {
if (md->DisplayModes[i].refresh[j] == 0 || md->DisplayModes[i].refresh[j] == rate)
break;
}
if (j < MAX_REFRESH_RATES) {
md->DisplayModes[i].refresh[j] = rate;
md->DisplayModes[i].refreshtype[j] = nondx;
md->DisplayModes[i].refresh[j + 1] = 0;
return;
}
}
i++;
}
i = 0;
while (md->DisplayModes[i].depth >= 0)
i++;
if (i >= MAX_PICASSO_MODES - 1)
return;
md->DisplayModes[i].nondx = nondx;
md->DisplayModes[i].res.width = w;
md->DisplayModes[i].res.height = h;
md->DisplayModes[i].depth = d;
md->DisplayModes[i].refresh[0] = rate;
md->DisplayModes[i].refreshtype[0] = nondx;
md->DisplayModes[i].refresh[1] = 0;
md->DisplayModes[i].colormodes = ct;
md->DisplayModes[i + 1].depth = -1;
_stprintf (md->DisplayModes[i].name, "%dx%d, %d-bit",
md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, md->DisplayModes[i].depth * 8);
}
//dxwrap
int DirectDraw_CurrentRefreshRate (void)
{
//DirectDraw_GetDisplayMode ();
//return dxdata.native.dwRefreshRate;
return 50;
}
int DirectDraw_GetVerticalBlankStatus (void)
{
// BOOL status;
// if (FAILED (IDirectDraw7_GetVerticalBlankStatus (dxdata.maindd, &status)))
return -1;
// return status;
}
// direct3d
int D3D_goodenough (void)
{
return 0;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -456,3 +456,4 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */
#define PICASSO96
......@@ -14,7 +14,7 @@ hostname = GnoStiC-dv7
uname -m = i686
uname -r = 2.6.32-24-generic
uname -s = Linux
uname -v = #41-Ubuntu SMP Thu Aug 19 01:12:52 UTC 2010
uname -v = #42-Ubuntu SMP Fri Aug 20 14:24:04 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/ccAAwvoL.o: In function `main':
/tmp/cc3ddsdl.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/ccIwYmH0.o: In function `main':
/tmp/ccyjfxIA.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/ccXSlxnT.o: In function `main':
/tmp/ccs8WUKF.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
......
/*
* UAE - The Un*x Amiga Emulator
*
* uae.resource
*
*/
* UAE - The Un*x Amiga Emulator
*
* uae.resource
*
*/
#include "sysconfig.h"
#include "sysdeps.h"
......
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