puae 2.3.0

parent 268a97f6
...@@ -203,12 +203,20 @@ static drive floppy[MAX_FLOPPY_DRIVES]; ...@@ -203,12 +203,20 @@ static drive floppy[MAX_FLOPPY_DRIVES];
static TCHAR dfxhistory[2][MAX_PREVIOUS_FLOPPIES][MAX_DPATH]; static TCHAR dfxhistory[2][MAX_PREVIOUS_FLOPPIES][MAX_DPATH];
static uae_u8 exeheader[]={0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00}; 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, 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,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, 0x4e,0x75,0x70,0xff,0x60,0xfa,0x64,0x6f,0x73,0x2e,0x6c,0x69,0x62,0x72,0x61,0x72,
0x79 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_OFS_DATABLOCKSIZE 488
#define FS_FLOPPY_BLOCKSIZE 512 #define FS_FLOPPY_BLOCKSIZE 512
...@@ -281,7 +289,7 @@ static void createbootblock (uae_u8 *sector, int bootable) ...@@ -281,7 +289,7 @@ static void createbootblock (uae_u8 *sector, int bootable)
memset (sector, 0, FS_FLOPPY_BLOCKSIZE); memset (sector, 0, FS_FLOPPY_BLOCKSIZE);
memcpy (sector, "DOS", 3); memcpy (sector, "DOS", 3);
if (bootable) if (bootable)
memcpy (sector, bootblock, sizeof (bootblock)); memcpy (sector, bootblock_ofs, sizeof (bootblock_ofs));
} }
static void createrootblock (uae_u8 *sector, const char *disk_name) static void createrootblock (uae_u8 *sector, const char *disk_name)
...@@ -2054,17 +2062,46 @@ void DISK_ersatz_read (int tr, int sec, uaecptr dest) ...@@ -2054,17 +2062,46 @@ void DISK_ersatz_read (int tr, int sec, uaecptr dest)
zfile_fread (dptr, 1, 512, floppy[0].diskfile); 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 */ /* type: 0=regular, 1=ext2adf */
/* adftype: 0=DD,1=HD,2=DD PC,3=HD PC,4=525SD */ /* 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; struct zfile *f;
int i, l, file_size, tracks, track_len, sectors; int i, l, file_size, tracks, track_len, sectors;
uae_u8 *chunk = NULL; uae_u8 *chunk = NULL;
uae_u8 tmp[3*4]; int ddhd = 1;
if (disk_name == NULL || _tcslen (disk_name) == 0)
disk_name = "empty";
if (type == 1) if (type == 1)
tracks = 2 * 83; tracks = 2 * 83;
...@@ -2080,62 +2117,64 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk ...@@ -2080,62 +2117,64 @@ void disk_creatediskfile (TCHAR *name, int type, drive_type adftype, TCHAR *disk
if (adftype == 1 || adftype == 3) { if (adftype == 1 || adftype == 3) {
file_size *= 2; file_size *= 2;
track_len *= 2; track_len *= 2;
ddhd = 2;
} else if (adftype == 4) { } else if (adftype == 4) {
file_size /= 2; file_size /= 2;
tracks /= 2; tracks /= 2;
} }
f = zfile_fopen (name, "wb", 0); f = zfile_fopen (name, "wb", 0);
chunk = xmalloc (uae_u8, 32768); chunk = xmalloc (uae_u8, size);
if (f && chunk) { if (f && chunk) {
int cylsize = sectors * 2 * 512; int cylsize = sectors * 2 * 512;
memset (chunk, 0, 32768); memset (chunk, 0, size);
if (type == 0) { if (type == 0) {
for (i = 0; i < file_size; i += cylsize) { for (i = 0; i < file_size; i += cylsize) {
memset(chunk, 0, cylsize); memset(chunk, 0, cylsize);
if (adftype <= 1) { if (adftype <= 1) {
if (i == 0) { if (i == 0) {
/* boot block */ /* boot block */
strcpy ((char*)chunk, "DOS"); floppy_get_bootblock (chunk, ffs, bootable);
} else if (i == file_size / 2) { } else if (i == file_size / 2) {
int block = file_size / 1024;
/* root block */ /* root block */
chunk[0+3] = 2; floppy_get_rootblock (chunk, file_size / 1024, disk_name, adftype);
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);
} }
} }
zfile_fwrite (chunk, cylsize, 1, f); zfile_fwrite (chunk, cylsize, 1, f);
} }
} else { } else {
uae_u8 root[4];
uae_u8 rawtrack[3 * 4], dostrack[3 * 4];
l = track_len; l = track_len;
zfile_fwrite ("UAE-1ADF", 8, 1, f); zfile_fwrite ("UAE-1ADF", 8, 1, f);
tmp[0] = 0; tmp[1] = 0; /* flags (reserved) */ root[0] = 0; root[1] = 0; /* flags (reserved) */
tmp[2] = 0; tmp[3] = tracks; /* number of tracks */ root[2] = 0; root[3] = tracks; /* number of tracks */
zfile_fwrite (tmp, 4, 1, f); zfile_fwrite (root, 4, 1, f);
tmp[0] = 0; tmp[1] = 0; /* flags (reserved) */ rawtrack[0] = 0; rawtrack[1] = 0; /* flags (reserved) */
tmp[2] = 0; tmp[3] = 1; /* track type */ rawtrack[2] = 0; rawtrack[3] = 1; /* track type */
tmp[4] = 0; tmp[5] = 0; tmp[6]=(uae_u8)(l >> 8); tmp[7] = (uae_u8)l; rawtrack[4] = 0; rawtrack[5] = 0; rawtrack[6]=(uae_u8)(l >> 8); rawtrack[7] = (uae_u8)l;
tmp[8] = 0; tmp[9] = 0; tmp[10] = 0; tmp[11] = 0; rawtrack[8] = 0; rawtrack[9] = 0; rawtrack[10] = 0; rawtrack[11] = 0;
for (i = 0; i < tracks; i++) memcpy (dostrack, rawtrack, sizeof rawtrack);
zfile_fwrite (tmp, sizeof (tmp), 1, f); dostrack[3] = 0;
for (i = 0; i < tracks; i++) 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); zfile_fwrite (chunk, l, 1, f);
}
} }
} }
xfree (chunk); xfree (chunk);
...@@ -2208,7 +2247,7 @@ int disk_setwriteprotect (int num, const TCHAR *name, bool writeprotected) ...@@ -2208,7 +2247,7 @@ int disk_setwriteprotect (int num, const TCHAR *name, bool writeprotected)
name2 = DISK_get_saveimagepath (name); name2 = DISK_get_saveimagepath (name);
if (needwritefile && zf2 == 0) if (needwritefile && zf2 == 0)
disk_creatediskfile (name2, 1, drvtype, NULL); disk_creatediskfile (name2, 1, drvtype, NULL, 0, 0);
zfile_fclose (zf2); zfile_fclose (zf2);
if (writeprotected && iswritefileempty (name)) { if (writeprotected && iswritefileempty (name)) {
for (i = 0; i < MAX_FLOPPY_DRIVES; i++) { for (i = 0; i < MAX_FLOPPY_DRIVES; i++) {
...@@ -2542,12 +2581,12 @@ uae_u8 DISK_status (void) ...@@ -2542,12 +2581,12 @@ uae_u8 DISK_status (void)
return st; return st;
} }
STATIC_INLINE int unformatted (const drive *drv) static bool unformatted (const drive *drv)
{ {
unsigned int tr = drv->cyl * 2 + side; unsigned int tr = drv->cyl * 2 + side;
if (tr >= drv->num_tracks) if (tr >= drv->num_tracks)
return 1; 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; return 1;
if (drv->trackdata[tr].type == TRACK_NONE) if (drv->trackdata[tr].type == TRACK_NONE)
return 1; return 1;
......
...@@ -2816,7 +2816,7 @@ STATIC_INLINE void check_picasso (void) ...@@ -2816,7 +2816,7 @@ STATIC_INLINE void check_picasso (void)
{ {
#ifdef PICASSO96 #ifdef PICASSO96
if (picasso_on && picasso_redraw_necessary) if (picasso_on && picasso_redraw_necessary)
picasso_refresh (1); picasso_refresh ();
picasso_redraw_necessary = 0; picasso_redraw_necessary = 0;
if (picasso_requested_on == picasso_on) if (picasso_requested_on == picasso_on)
......
...@@ -5351,7 +5351,7 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context) ...@@ -5351,7 +5351,7 @@ static uae_u32 REGPARAM2 filesys_init_storeinfo (TrapContext *context)
{ {
case 1: case 1:
mountertask = m68k_areg (regs, 1); mountertask = m68k_areg (regs, 1);
//picasso96_alloc (context); picasso96_alloc (context);
break; break;
case 2: case 2:
ret = automountunit; ret = automountunit;
......
...@@ -195,7 +195,7 @@ STATIC_INLINE void pw (int offset, uae_u16 w) ...@@ -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 + 0] = (uae_u8)w;
ide->secbuf[offset * 2 + 1] = w >> 8; 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; int i, len;
......
...@@ -1964,7 +1964,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -1964,7 +1964,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
return 0; 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)
{ {
} }
......
...@@ -1703,20 +1703,28 @@ int DX_Blit (int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT ...@@ -1703,20 +1703,28 @@ int DX_Blit (int srcx, int srcy, int dstx, int dsty, int width, int height, BLIT
*/ */
static void add_p96_mode (int width, int height, int emulate_chunky, int *count) static void add_p96_mode (int width, int height, int emulate_chunky, int *count)
{ {
unsigned int i; unsigned int i;
for (i = 0; i <= (emulate_chunky ? 1 : 0); i++) { struct MultiDisplay *md1;
if (*count < MAX_PICASSO_MODES) { md1 = Displays;
DisplayModes[*count].res.width = width; struct MultiDisplay *md = (struct MultiDisplay*)md1;
DisplayModes[*count].res.height = height; md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES);
DisplayModes[*count].depth = (i == 1) ? 1 : bit_unit >> 3; md1->DisplayModes[0].depth = -1;
DisplayModes[*count].refresh = 75; md1->disabled = 1;
(*count)++;
for (i = 0; i <= (emulate_chunky ? 1 : 0); i++) {
write_log ("SDLGFX: Added P96 mode: %dx%dx%d\n", width, height, (i == 1) ? 8 : bitdepth); 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[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;
return;
} }
int DX_FillResolutions (uae_u16 *ppixel_format) int DX_FillResolutions (uae_u16 *ppixel_format)
...@@ -1806,7 +1814,7 @@ static void set_window_for_picasso (void) ...@@ -1806,7 +1814,7 @@ static void set_window_for_picasso (void)
graphics_subinit(); 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); DEBUG_LOG ("Function: gfx_set_picasso_modeinfo w: %i h: %i depth: %i rgbfmt: %i\n", w, h, depth, rgbfmt);
...@@ -1815,7 +1823,20 @@ void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt) ...@@ -1815,7 +1823,20 @@ void gfx_set_picasso_modeinfo (int w, int h, int depth, int rgbfmt)
picasso_vidinfo.depth = depth; picasso_vidinfo.depth = depth;
picasso_vidinfo.pixbytes = bit_unit >> 3; picasso_vidinfo.pixbytes = bit_unit >> 3;
if (screen_is_picasso) if (screen_is_picasso)
set_window_for_picasso(); 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) void gfx_set_picasso_state (int on)
...@@ -1823,12 +1844,12 @@ void gfx_set_picasso_state (int on) ...@@ -1823,12 +1844,12 @@ void gfx_set_picasso_state (int on)
DEBUG_LOG ("Function: gfx_set_picasso_state: %d\n", on); DEBUG_LOG ("Function: gfx_set_picasso_state: %d\n", on);
if (on == screen_is_picasso) if (on == screen_is_picasso)
return; return;
/* We can get called by drawing_init() when there's /* We can get called by drawing_init() when there's
* no window opened yet... */ * no window opened yet... */
if (display == 0) if (display == 0)
return return
graphics_subshutdown (); graphics_subshutdown ();
screen_was_picasso = screen_is_picasso; screen_was_picasso = screen_is_picasso;
...@@ -2217,3 +2238,9 @@ int gfx_parse_option (struct uae_prefs *p, const char *option, const char *value ...@@ -2217,3 +2238,9 @@ int gfx_parse_option (struct uae_prefs *p, const char *option, const char *value
#endif /* USE_GL */ #endif /* USE_GL */
return result; return result;
} }
int WIN32GFX_IsPicassoScreen (void)
{
return screen_is_picasso;
}
...@@ -797,7 +797,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -797,7 +797,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i]; DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i]; DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 1; DisplayModes[count].depth = 1;
DisplayModes[count].refresh = 75; DisplayModes[count].refresh[0] = 75;
count++; count++;
format |= RGBFF_CHUNKY; format |= RGBFF_CHUNKY;
} }
...@@ -806,7 +806,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -806,7 +806,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i]; DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i]; DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 2; DisplayModes[count].depth = 2;
DisplayModes[count].refresh = 75; DisplayModes[count].refresh[0] = 75;
count++; count++;
format |= RGBFF_R5G6B5PC; format |= RGBFF_R5G6B5PC;
} }
...@@ -815,7 +815,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -815,7 +815,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i]; DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i]; DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = 4; DisplayModes[count].depth = 4;
DisplayModes[count].refresh = 75; DisplayModes[count].refresh[0] = 75;
count++; count++;
format |= RGBFF_B8G8R8A8; format |= RGBFF_B8G8R8A8;
} }
...@@ -846,7 +846,7 @@ static void set_window_for_amiga (void) ...@@ -846,7 +846,7 @@ static void set_window_for_amiga (void)
restore_vga_colors (); 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; vga_modeinfo *info;
int i, mode; int i, mode;
......
...@@ -1405,7 +1405,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -1405,7 +1405,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = allmodes[i]->hdisplay; DisplayModes[count].res.width = allmodes[i]->hdisplay;
DisplayModes[count].res.height = allmodes[i]->vdisplay; DisplayModes[count].res.height = allmodes[i]->vdisplay;
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3; DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
DisplayModes[count].refresh = 75; DisplayModes[count].refresh[0] = 75;
count++; count++;
} }
} }
...@@ -1423,7 +1423,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format) ...@@ -1423,7 +1423,7 @@ int DX_FillResolutions (uae_u16 *ppixel_format)
DisplayModes[count].res.width = x_size_table[i]; DisplayModes[count].res.width = x_size_table[i];
DisplayModes[count].res.height = y_size_table[i]; DisplayModes[count].res.height = y_size_table[i];
DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3; DisplayModes[count].depth = j == 1 ? 1 : bit_unit >> 3;
DisplayModes[count].refresh = 75; DisplayModes[count].refresh[0] = 75;
count++; count++;
} }
} }
...@@ -1447,7 +1447,7 @@ static void set_window_for_picasso (void) ...@@ -1447,7 +1447,7 @@ static void set_window_for_picasso (void)
#endif #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.width = w;
picasso_vidinfo.height = h; picasso_vidinfo.height = h;
......
...@@ -209,6 +209,95 @@ static uae_u32 lowbits (int v, int shift, int lsize) ...@@ -209,6 +209,95 @@ static uae_u32 lowbits (int v, int shift, int lsize)
return v; 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, 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) uae_u32 *rc, uae_u32 *gc, uae_u32 *bc)
{ {
......
...@@ -28,7 +28,7 @@ extern void DISK_hsync (void); ...@@ -28,7 +28,7 @@ extern void DISK_hsync (void);
extern void DISK_reset (void); extern void DISK_reset (void);
extern int disk_getwriteprotect (const TCHAR *name); extern int disk_getwriteprotect (const TCHAR *name);
extern int disk_setwriteprotect (int num, const TCHAR *name, bool writeprotected); 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 void dumpdisk (void);
extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck); extern int DISK_history_add (const TCHAR *name, int idx, int type, int donotcheck);
extern TCHAR *DISK_history_get (int idx, int type); extern TCHAR *DISK_history_get (int idx, int type);
......
...@@ -124,10 +124,13 @@ ...@@ -124,10 +124,13 @@
#define AK_TERM_POWERUP 0xfe #define AK_TERM_POWERUP 0xfe
// KB LED stuff // KB LED stuff
#define KBLED_NUMLOCKB 0
#define KBLED_CAPSLOCKB 1
#define KBLED_SCROLLLOCKB 2
#define KBLED_NUMLOCK 1 #define KBLED_NUMLOCKM (1 << KBLED_NUMLOCKB)
#define KBLED_CAPSLOCK 2 #define KBLED_CAPSLOCKM (1 << KBLED_CAPSLOCKB)
#define KBLED_SCROLLLOCK 4 #define KBLED_SCROLLLOCKM (1 << KBLED_SCROLLLOCKB)
enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT_FILE, AKS_SCREENSHOT_CLIPBOARD, AKS_FREEZEBUTTON, enum aks { AKS_ENTERGUI = 0x200, AKS_SCREENSHOT_FILE, AKS_SCREENSHOT_CLIPBOARD, AKS_FREEZEBUTTON,
AKS_FLOPPY0, AKS_FLOPPY1, AKS_FLOPPY2, AKS_FLOPPY3, AKS_FLOPPY0, AKS_FLOPPY1, AKS_FLOPPY2, AKS_FLOPPY3,
......
...@@ -412,7 +412,6 @@ struct uae_prefs { ...@@ -412,7 +412,6 @@ struct uae_prefs {
bool win32_rtgscaleifsmall; bool win32_rtgscaleifsmall;
bool win32_rtgallowscaling; bool win32_rtgallowscaling;
int win32_rtgscaleaspectratio; int win32_rtgscaleaspectratio;
int win32_rtgvblankrate;
bool win32_borderless; bool win32_borderless;
bool win32_ctrl_F11_is_quit; bool win32_ctrl_F11_is_quit;
bool win32_automount_removable; bool win32_automount_removable;
...@@ -435,6 +434,7 @@ struct uae_prefs { ...@@ -435,6 +434,7 @@ struct uae_prefs {
TCHAR win32_parjoyport0[MAX_DPATH]; TCHAR win32_parjoyport0[MAX_DPATH];
TCHAR win32_parjoyport1[MAX_DPATH]; TCHAR win32_parjoyport1[MAX_DPATH];
#endif #endif
int win32_rtgvblankrate;
#ifdef USE_CURSES_GFX #ifdef USE_CURSES_GFX
int curses_reverse_video; int curses_reverse_video;
......
This diff is collapsed.
...@@ -1149,3 +1149,113 @@ void my_kbd_handler (int keyboard, int scancode, int newstate) ...@@ -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 ); write_log ("kbd = %d, scancode = %d, state = %d\n", keyboard, scancode, newstate );
inputdevice_translatekeycode (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 diff is collapsed.
...@@ -456,3 +456,4 @@ ...@@ -456,3 +456,4 @@
/* Define to empty if the keyword `volatile' does not work. Warning: valid /* Define to empty if the keyword `volatile' does not work. Warning: valid
code using `volatile' can become incorrect without. Disable with care. */ code using `volatile' can become incorrect without. Disable with care. */
/* #undef volatile */ /* #undef volatile */
#define PICASSO96
...@@ -14,7 +14,7 @@ hostname = GnoStiC-dv7 ...@@ -14,7 +14,7 @@ hostname = GnoStiC-dv7
uname -m = i686 uname -m = i686
uname -r = 2.6.32-24-generic uname -r = 2.6.32-24-generic
uname -s = Linux 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 /usr/bin/uname -p = unknown
/bin/uname -X = unknown /bin/uname -X = unknown
...@@ -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/ccAAwvoL.o: In function `main': /tmp/cc3ddsdl.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/ccIwYmH0.o: In function `main': /tmp/ccyjfxIA.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/ccXSlxnT.o: In function `main': /tmp/ccs8WUKF.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
......
/* /*
* UAE - The Un*x Amiga Emulator * UAE - The Un*x Amiga Emulator
* *
* uae.resource * uae.resource
* *
*/ */
#include "sysconfig.h" #include "sysconfig.h"
#include "sysdeps.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