write_log ("virtual memory exhausted (rtarea)!\n");
abort ();
}
+ memset (rtarea, 0, 0x10000);
rtarea_bank.baseaddr = rtarea;
}
//#define BLITTER_DEBUG
//#define BLITTER_SLOWDOWNDEBUG 4
+//#define BLITTER_DEBUG_NO_D
#define SPEEDUP
#endif
}
+STATIC_INLINE chipmem_agnus_wput2 (uaecptr addr, uae_u32 w)
+{
+#ifndef BLITTER_DEBUG_NO_D
+ chipmem_agnus_wput (addr, w);
+#endif
+}
+
static void blitter_dofast (void)
{
int i,j;
blt_info.bltcdat = chipmem_agnus_wget (bltcdatptr);
bltcdatptr += 2;
}
- if (dodst) chipmem_agnus_wput (dstp, blt_info.bltddat);
+ if (dodst)
+ chipmem_agnus_wput2 (dstp, blt_info.bltddat);
blt_info.bltddat = blit_func (blitahold, blitbhold, blt_info.bltcdat, mt) & 0xFFFF;
if (blitfill) {
uae_u16 d = blt_info.bltddat;
bltddatptr += 2;
}
}
- if (bltadatptr) bltadatptr += blt_info.bltamod;
- if (bltbdatptr) bltbdatptr += blt_info.bltbmod;
- if (bltcdatptr) bltcdatptr += blt_info.bltcmod;
- if (bltddatptr) bltddatptr += blt_info.bltdmod;
+ if (bltadatptr)
+ bltadatptr += blt_info.bltamod;
+ if (bltbdatptr)
+ bltbdatptr += blt_info.bltbmod;
+ if (bltcdatptr)
+ bltcdatptr += blt_info.bltcmod;
+ if (bltddatptr)
+ bltddatptr += blt_info.bltdmod;
}
- if (dodst) chipmem_agnus_wput (dstp, blt_info.bltddat);
+ if (dodst)
+ chipmem_agnus_wput2 (dstp, blt_info.bltddat);
blt_info.bltbhold = blitbhold;
}
blit_masktable[0] = 0xFFFF;
blt_info.bltcdat = blt_info.bltbdat = chipmem_agnus_wget (bltcdatptr);
bltcdatptr -= 2;
}
- if (dodst) chipmem_agnus_wput (dstp, blt_info.bltddat);
+ if (dodst)
+ chipmem_agnus_wput2 (dstp, blt_info.bltddat);
blt_info.bltddat = blit_func (blitahold, blitbhold, blt_info.bltcdat, mt) & 0xFFFF;
if (blitfill) {
uae_u16 d = blt_info.bltddat;
bltddatptr -= 2;
}
}
- if (bltadatptr) bltadatptr -= blt_info.bltamod;
- if (bltbdatptr) bltbdatptr -= blt_info.bltbmod;
- if (bltcdatptr) bltcdatptr -= blt_info.bltcmod;
- if (bltddatptr) bltddatptr -= blt_info.bltdmod;
+ if (bltadatptr)
+ bltadatptr -= blt_info.bltamod;
+ if (bltbdatptr)
+ bltbdatptr -= blt_info.bltbmod;
+ if (bltcdatptr)
+ bltcdatptr -= blt_info.bltcmod;
+ if (bltddatptr)
+ bltddatptr -= blt_info.bltdmod;
}
- if (dodst) chipmem_agnus_wput (dstp, blt_info.bltddat);
+ if (dodst)
+ chipmem_agnus_wput2 (dstp, blt_info.bltddat);
blt_info.bltbhold = blitbhold;
}
blit_masktable[0] = 0xFFFF;
wd = 1;
}
if (wd) {
- chipmem_agnus_wput (bltdpt, d);
+ chipmem_agnus_wput2 (bltdpt, d);
bltdpt += blit_add;
blitter_hcounter2++;
if (blitter_hcounter2 == blt_info.hblitsize) {
cfgfile_write (f, "parallel_autoflush=%d\n", p->parallel_autoflush_time);
cfgfile_dwrite (f, "gfx_display=%d\n", p->gfx_display);
+ cfgfile_dwrite (f, "gfx_display_name=%s\n", p->gfx_display_name);
cfgfile_dwrite (f, "gfx_framerate=%d\n", p->gfx_framerate);
cfgfile_dwrite (f, "gfx_width=%d\n", p->gfx_size_win.width); /* compatibility with old versions */
cfgfile_dwrite (f, "gfx_height=%d\n", p->gfx_size_win.height); /* compatibility with old versions */
cfgfile_write (f, "cpu_cycle_exact=%s\n", p->cpu_cycle_exact ? "true" : "false");
cfgfile_write (f, "blitter_cycle_exact=%s\n", p->blitter_cycle_exact ? "true" : "false");
cfgfile_write (f, "rtg_nocustom=%s\n", p->picasso96_nocustom ? "true" : "false");
+ cfgfile_write (f, "rtg_modes=0x%x\n", p->picasso96_modeflags);
cfgfile_write (f, "log_illegal_mem=%s\n", p->illegal_mem ? "true" : "false");
if (p->catweasel >= 100)
|| cfgfile_string (option, value, "floppy1soundext", p->dfxclickexternal[1], sizeof p->dfxclickexternal[1])
|| cfgfile_string (option, value, "floppy2soundext", p->dfxclickexternal[2], sizeof p->dfxclickexternal[2])
|| cfgfile_string (option, value, "floppy3soundext", p->dfxclickexternal[3], sizeof p->dfxclickexternal[3])
+ || cfgfile_string (option, value, "gfx_display_name", p->gfx_display_name, sizeof p->gfx_display_name)
|| cfgfile_string (option, value, "config_info", p->info, sizeof p->info)
|| cfgfile_string (option, value, "config_description", p->description, sizeof p->description))
return 1;
|| cfgfile_intval (option, value, "z3mem_start", &p->z3fastmem_start, 1)
|| cfgfile_intval (option, value, "bogomem_size", &p->bogomem_size, 0x40000)
|| cfgfile_intval (option, value, "gfxcard_size", &p->gfxmem_size, 0x100000)
+ || cfgfile_intval (option, value, "rtg_modes", &p->picasso96_modeflags, 1)
|| cfgfile_intval (option, value, "floppy_speed", &p->floppy_speed, 1)
|| cfgfile_intval (option, value, "floppy_write_length", &p->floppy_write_length, 1)
|| cfgfile_intval (option, value, "nr_floppies", &p->nr_floppies, 1)
p->cs_resetwarning = 1;
p->gfx_filter = 0;
- p->gfx_filter_horiz_zoom_mult = 1000;
- p->gfx_filter_vert_zoom_mult = 1000;
+ p->gfx_filter_horiz_zoom_mult = 0;
+ p->gfx_filter_vert_zoom_mult = 0;
p->gfx_filter_filtermode = 1;
p->gfx_filter_scanlineratio = (1 << 4) | 1;
delay2 += delayoffset;
delaymask = (fetchwidth - 1) >> toscr_res;
toscr_delay1x = (delay1 & delaymask) << toscr_res;
- toscr_delay1x |= shdelay1 >> (2 - toscr_res);
+ toscr_delay1x |= shdelay1 >> (RES_MAX - toscr_res);
toscr_delay2x = (delay2 & delaymask) << toscr_res;
- toscr_delay2x |= shdelay2 >> (2 - toscr_res);
+ toscr_delay2x |= shdelay2 >> (RES_MAX - toscr_res);
}
static void compute_toscr_delay (int hpos)
{
int j = 0;
while (datab) {
- unsigned int tmp = *buf;
unsigned int col = (datab & 3) << (2 * num);
- tmp |= col;
- if ((j & mask) == 0)
+ unsigned coltmp = 0;
+
+ if ((j & mask) == 0) {
+ unsigned int tmp = (*buf) | col;
*buf++ = tmp;
- if (dbl > 0)
+ if (do_collisions)
+ coltmp |= tmp;
+ }
+ if (dbl > 0) {
+ unsigned int tmp = (*buf) | col;
*buf++ = tmp;
+ if (do_collisions)
+ coltmp |= tmp;
+ }
if (dbl > 1) {
+ unsigned int tmp;
+ tmp = (*buf) | col;
*buf++ = tmp;
+ if (do_collisions)
+ coltmp |= tmp;
+ tmp = (*buf) | col;
*buf++ = tmp;
+ if (do_collisions)
+ coltmp |= tmp;
}
j++;
datab >>= 2;
if (do_collisions) {
- tmp &= collision_mask;
- if (tmp) {
- unsigned int shrunk_tmp = sprite_ab_merge[tmp & 255] | (sprite_ab_merge[tmp >> 8] << 2);
+ coltmp &= collision_mask;
+ if (coltmp) {
+ unsigned int shrunk_tmp = sprite_ab_merge[coltmp & 255] | (sprite_ab_merge[coltmp >> 8] << 2);
clxdat |= sprclx[shrunk_tmp];
}
}
This function assumes that for all sprites in a given line, SPRXP either
stays equal or increases between successive calls.
- The data is recorded either in lores pixels (if OCS/ECS), or in superhires
- pixels (if AGA). */
+ The data is recorded either in lores pixels (if OCS/ECS), or in hires or
+ superhires pixels (if AGA). */
static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16 *datb, unsigned int ctl)
{
if (dbl < 0) {
half = -dbl;
dbl = 0;
- if (ecsshres ())
- mask = 1;
+ if (ecsshres () || (sprite_buffer_res < RES_SUPERHIRES && sprres == RES_SUPERHIRES))
+ mask = 1; /* need to halve horizontal size */
}
width = (sprite_width << sprite_buffer_res) >> sprres;
- attachment = (spr[num & ~1].armed && ((sprctl[num | 1] & 0x80) || (!(currprefs.chipset_mask & CSMASK_AGA) && (sprctl[num & ~1] & 0x80))));
+ attachment = (spr[num & ~1].armed && ((sprctl[num | 1] & 0x80) || (!(currprefs.chipset_mask & CSMASK_AGA) && (sprctl[num & ~1] & 0x80))));
/* Try to coalesce entries if they aren't too far apart */
- if (!next_sprite_forced && e[-1].max + sprite_width >= sprxp && (attachment || ((bplcon4 >> 4) & 15) == ((bplcon4 >> 0) & 15))) {
+ if (!next_sprite_forced && e[-1].max + sprite_width >= sprxp) {
e--;
} else {
next_sprite_entry++;
low order bit records whether the attach bit was set for this pair. */
if (attachment) {
uae_u32 state = 0x01010101 << (num & ~1);
- uae_u32 *stbuf = spixstate.words + (word_offs >> 2);
uae_u8 *stb1 = spixstate.bytes + word_offs;
for (i = 0; i < width; i += 8) {
stb1[0] |= state;
}
#ifdef AGA
else if (currprefs.chipset_mask & CSMASK_AGA) {
- sprxp |= ((sprctl[num] >> 3) & 3) >> (2 - sprite_buffer_res);
+ sprxp |= ((sprctl[num] >> 3) & 3) >> (RES_MAX - sprite_buffer_res);
s->dblscan = sprpos[num] & 0x80;
}
#endif
#ifdef ECS_DENISE
else if (currprefs.chipset_mask & CSMASK_ECS_DENISE) {
- sprxp |= ((sprctl[num] >> 3) & 2) >> (2 - sprite_buffer_res);
+ sprxp |= ((sprctl[num] >> 3) & 2) >> (RES_MAX - sprite_buffer_res);
}
#endif
s->xpos = sprxp;
lof ^= 0x8000;
#ifdef PICASSO96
- /* And now let's update the Picasso palette, if required */
- if (picasso_on)
- picasso_handle_vsync ();
+ picasso_handle_vsync ();
#endif
if (quit_program > 0) {
bogusframe = 1;
- sprite_buffer_res = (currprefs.chipset_mask & CSMASK_AGA) ? RES_SUPERHIRES : RES_LORES;
- if (sprite_buffer_res > currprefs.gfx_resolution)
- sprite_buffer_res = currprefs.gfx_resolution;
if (savestate_state == STATE_RESTORE) {
uae_u16 v;
uae_u32 vv;
stbuf -= e->pos;
window_pos = e->pos + ((DIW_DDF_OFFSET - DISPLAY_LEFT_SHIFT) << sprite_buffer_res);
+
spr_level = 0;
spr_level_max = 0;
if (res_shift > 0 && aga) {
else if (posdoubling)
window_pos <<= posdoubling;
window_pos += pixels_offset;
+
if (aga) {
if (window_pos < sprite_aga_first_x)
sprite_aga_first_x = window_pos;
}
+
for (pos = e->pos; pos < e->max; pos += 1 << sizeskip) {
int maskshift, plfmask;
unsigned int v = buf[pos];
visible_left_border = (max_diwlastword - 48) / 2 - gfxvidinfo.width;
}
if (currprefs.gfx_xcenter_pos >= 0) {
- int val = currprefs.gfx_xcenter_pos < 56 ? 56 : currprefs.gfx_xcenter_pos;
+ int val = (currprefs.gfx_xcenter_pos >> RES_MAX) < 56 ? 56 : (currprefs.gfx_xcenter_pos >> RES_MAX);
visible_left_border = val + (DIW_DDF_OFFSET << currprefs.gfx_resolution) - (DISPLAY_LEFT_SHIFT * 2 - (DISPLAY_LEFT_SHIFT << currprefs.gfx_resolution));
}
}
}
if (currprefs.gfx_ycenter_pos >= 0) {
- thisframe_y_adjust = currprefs.gfx_ycenter_pos;
+ thisframe_y_adjust = currprefs.gfx_ycenter_pos >> 1;
if (thisframe_y_adjust + max_drawn_amiga_line > 2 * maxvpos_max)
thisframe_y_adjust = 2 * maxvpos_max - max_drawn_amiga_line;
if (thisframe_y_adjust < 0)
notice_screen_contents_lost ();
frame_res_cnt = FRAMES_UNTIL_RES_SWITCH;
lightpen_y1 = lightpen_y2 = -1;
+
+ sprite_buffer_res = (currprefs.chipset_mask & CSMASK_AGA) ? RES_SUPERHIRES : RES_LORES;
+ if (sprite_buffer_res > currprefs.gfx_resolution)
+ sprite_buffer_res = currprefs.gfx_resolution;
}
void drawing_init (void)
#include "ncr_scsi.h"
#include "debug.h"
+static int scrambled_autoconfig = 0;
+
#define MAX_EXPANSION_BOARDS 8
/* ********************************************************** */
int cardno = 0;
ecard = 0;
- uae_id = hackers_id;
+ if (scrambled_autoconfig)
+ uae_id = rand () & 2047 + 100;
+ else
+ uae_id = hackers_id;
allocate_expamem ();
#include "sysdeps.h"
#include "options.h"
#include "custom.h"
+#include "rtgmodes.h"
#include "xwin.h"
#include "gfxfilter.h"
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)
{
double factor;
float ret;
static uae_u32 gamma[256 * 3];
static int lf, hf;
-static void video_calc_gammatable(void)
+static void video_calc_gammatable (void)
{
int i;
float bri, con, gam, v;
}
}
-static uae_u32 limit256(double v)
+static uae_u32 limit256 (double v)
{
v = v * (double)(currprefs.gfx_filter_contrast + 1000) / 1000.0 + currprefs.gfx_filter_luminance / 10.0;
if (v < 0)
v = 255;
return ((uae_u32)v) & 0xff;
}
-static uae_u32 limit256rb(double v)
+static uae_u32 limit256rb (double v)
{
v *= (double)(currprefs.gfx_filter_saturation + 1000) / 1000.0;
if (v < -128)
v = 127;
return ((uae_u32)v) & 0xff;
}
-static double get_y(int r, int g, int b)
+static double get_y (int r, int g, int b)
{
- return 0.2989f*r + 0.5866f*g + 0.1145f*b;
+ return 0.2989f * r + 0.5866f * g + 0.1145f * b;
}
-static uae_u32 get_yh(int r, int g, int b)
+static uae_u32 get_yh (int r, int g, int b)
{
- return limit256(get_y(r, g, b) * hf / 256);
+ return limit256 (get_y (r, g, b) * hf / 256);
}
-static uae_u32 get_yl(int r, int g, int b)
+static uae_u32 get_yl (int r, int g, int b)
{
- return limit256(get_y(r, g, b) * lf / 256);
+ return limit256 (get_y (r, g, b) * lf / 256);
}
-static uae_u32 get_cb(int r, int g, int b)
+static uae_u32 get_cb (int r, int g, int b)
{
- return limit256rb(-0.168736f*r - 0.331264f*g + 0.5f*b);
+ return limit256rb (-0.168736f * r - 0.331264f * g + 0.5f * b);
}
-static uae_u32 get_cr(int r, int g, int b)
+static uae_u32 get_cr (int r, int g, int b)
{
- return limit256rb(0.5f*r - 0.418688f*g - 0.081312f*b);
+ return limit256rb (0.5f * r - 0.418688f * g - 0.081312f * b);
}
extern uae_s32 tyhrgb[65536];
extern uae_s32 tcrrgb[65536];
extern uae_u32 redc[3 * 256], grec[3 * 256], bluc[3 * 256];
-static uae_u32 lowbits(int v, int shift, int lsize)
+static uae_u32 lowbits (int v, int shift, int lsize)
{
v >>= shift;
v &= (1 << lsize) - 1;
return v;
}
-void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int aw, int as, int alpha, int byte_swap)
+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;
- for (i = 0; i < 65536; i++) {
- uae_u32 r, g, b;
- r = (((i >> 11) & 31) << 3) | lowbits (i, 11, 3);
- g = (((i >> 5) & 63) << 2) | lowbits (i, 5, 2);
- b = (((i >> 0) & 31) << 3) | lowbits (i, 0, 3);
- p96_rgbx16[i] = doMask(r, rw, rs) | doMask(g, gw, gs) | doMask(b, bw, bs);
+ 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;
+ }
+
+ 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 |= c * 0x00010001;
+ p96_rgbx16[i] = c;
+ }
}
}
#define RES_LORES 0
#define RES_HIRES 1
#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)
extern void togglemouse (void);
extern int mousehack_alive (void);
extern int mousehack_allowed (void);
+extern int magicmouse_alive (void);
extern void setmousebuttonstateall (int mouse, uae_u32 buttonbits, uae_u32 buttonmask);
extern void setjoybuttonstateall (int joy, uae_u32 buttonbits, uae_u32 buttonmask);
uae_u32 override_dga_address;
int gfx_display;
+ char gfx_display_name[256];
int gfx_framerate, gfx_autoframerate;
struct wh gfx_size_win;
struct wh gfx_size_fs;
int cpu_compatible;
int address_space_24;
int picasso96_nocustom;
+ int picasso96_modeflags;
uae_u32 z3fastmem_size;
uae_u32 z3fastmem_start;
--- /dev/null
+/* Types for RGBFormat used */
+typedef enum {
+ RGBFB_NONE, /* no valid RGB format (should not happen) */
+ RGBFB_CLUT, /* palette mode, set colors when opening screen using
+ tags or use SetRGB32/LoadRGB32(...) */
+ RGBFB_R8G8B8, /* TrueColor RGB (8 bit each) */
+ RGBFB_B8G8R8, /* TrueColor BGR (8 bit each) */
+ RGBFB_R5G6B5PC, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
+ format: gggbbbbbrrrrrggg */
+ RGBFB_R5G5B5PC, /* HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg */
+ RGBFB_A8R8G8B8, /* 4 Byte TrueColor ARGB (A unused alpha channel) */
+ RGBFB_A8B8G8R8, /* 4 Byte TrueColor ABGR (A unused alpha channel) */
+ RGBFB_R8G8B8A8, /* 4 Byte TrueColor RGBA (A unused alpha channel) */
+ RGBFB_B8G8R8A8, /* 4 Byte TrueColor BGRA (A unused alpha channel) */
+ RGBFB_R5G6B5, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
+ format: rrrrrggggggbbbbb */
+ RGBFB_R5G5B5, /* HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb */
+ RGBFB_B5G6R5PC, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
+ format: gggrrrrrbbbbbggg */
+ RGBFB_B5G5R5PC, /* HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg */
+
+ /* By now, the following formats are for use with a hardware window only
+ (bitmap operations may be implemented incompletely) */
+
+ RGBFB_Y4U2V2, /* 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
+ Each two-pixel unit is stored as one longword
+ containing luminance (Y) for each of the two pixels,
+ and chrominance (U,V) for alternate pixels.
+ The missing chrominance values are generated by
+ interpolation. (Y1-U0-Y0-V0) */
+ RGBFB_Y4U1V1, /* 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
+ a packet of 5 bits Y (luminance) each pixel and 6 bits
+ U and V (chrominance) shared by the four pixels */
+
+ RGBFB_MaxFormats
+} RGBFTYPE;
+
+#define RGBFF_NONE (1<<RGBFB_NONE)
+#define RGBFF_CLUT (1<<RGBFB_CLUT)
+#define RGBFF_R8G8B8 (1<<RGBFB_R8G8B8)
+#define RGBFF_B8G8R8 (1<<RGBFB_B8G8R8)
+#define RGBFF_R5G6B5PC (1<<RGBFB_R5G6B5PC)
+#define RGBFF_R5G5B5PC (1<<RGBFB_R5G5B5PC)
+#define RGBFF_A8R8G8B8 (1<<RGBFB_A8R8G8B8)
+#define RGBFF_A8B8G8R8 (1<<RGBFB_A8B8G8R8)
+#define RGBFF_R8G8B8A8 (1<<RGBFB_R8G8B8A8)
+#define RGBFF_B8G8R8A8 (1<<RGBFB_B8G8R8A8)
+#define RGBFF_R5G6B5 (1<<RGBFB_R5G6B5)
+#define RGBFF_R5G5B5 (1<<RGBFB_R5G5B5)
+#define RGBFF_B5G6R5PC (1<<RGBFB_B5G6R5PC)
+#define RGBFF_B5G5R5PC (1<<RGBFB_B5G5R5PC)
+#define RGBFF_Y4U2V2 (1<<RGBFB_Y4U2V2)
+#define RGBFF_Y4U1V1 (1<<RGBFB_Y4U1V1)
+
+#define RGBMASK_8BIT RGBFF_CLUT
+#define RGBMASK_16BIT (RGBFF_R5G6B5PC | RGBFF_B5G6R5PC | RGBFF_R5G6B5)
+#define RGBMASK_15BIT (RGBFF_R5G5B5PC | RGBFF_B5G5R5PC | RGBFF_R5G5B5)
+#define RGBMASK_24BIT (RGBFF_R8G8B8 | RGBFF_B8G8R8)
+#define RGBMASK_32BIT (RGBFF_A8R8G8B8 | RGBFF_A8B8G8R8 | RGBFF_R8G8B8A8 | RGBFF_B8G8R8A8)
+
+#define RGBFF_PLANAR RGBFF_NONE
+#define RGBFF_CHUNKY RGBFF_CLUT
+
+#define RGBFB_PLANAR RGBFB_NONE
+#define RGBFB_CHUNKY RGBFB_CLUT
extern void alloc_colors64k (int, int, int, int, int, int, int, int, int, int);
extern 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);
-extern void alloc_colors_picasso (int, int, int, int, int, int, int, int, int, int);
+extern void alloc_colors_picasso (int rw, int gw, int bw, int rs, int gs, int bs, int rgbfmt);
extern void setup_greydither (int bits, allocfunc_type allocfunc);
extern void setup_greydither_maxcol (int maxcol, allocfunc_type allocfunc);
extern void setup_dither (int bits, allocfunc_type allocfunc);
/* For ports using tui.c, this should be built by graphics_setup(). */
extern struct bstring *video_mode_menu;
extern void vidmode_menu_selected(int);
+
xfree (custom);
}
-static int ievent_alive = 0;
+static int ievent_alive, mouseedge_alive;
static int lastmx, lastmy;
static uae_u32 magicmouse_ibase = 0;
#define intui "intuition.library"
rtarea[off + 12 - 2] = 1;
}
-static void mousehack_setpos(int mousexpos, int mouseypos)
+static void mousehack_setpos (int mousexpos, int mouseypos)
{
uae_u8 *p;
if (!uae_boot_rom)
#define MOUSEEDGE_RANGE 300
#define MOUSEEDGE_TIME 2
-void setamigamouse(int x, int y)
+void setamigamouse (int x, int y)
{
- mousehack_enable();
- mousehack_setpos(x, y);
+ mousehack_enable ();
+ mousehack_setpos (x, y);
}
-extern void setmouseactivexy(int,int,int);
-extern void drawing_adjust_mousepos(int*,int*);
+extern void setmouseactivexy (int,int,int);
+extern void drawing_adjust_mousepos (int*,int*);
-static void mouseedge(void)
+static int mouseedge (void)
{
int x, y, dir;
uaecptr ib;
static int isnonzero;
if (!currprefs.win32_outsidemouse || magicmouse_ibase == 0xffffffff)
- return;
+ return 0;
dir = 0;
if (!mouseedge_time) {
isnonzero = 0;
else
ib = magicmouse_ibase;
if (!ib)
- return;
+ return 0;
x = get_word (ib + 70);
y = get_word (ib + 68);
if (x || y)
isnonzero = 1;
- //write_log ("%x x %d\n", x, y);
if (!isnonzero)
- return;
+ return 0;
if (melast_x == x) {
if (mouseedge_x < -MOUSEEDGE_RANGE) {
mouseedge_x = 0;
mouseedge_y = 0;
melast_y = y;
}
- return;
+ return 1;
end:
mouseedge_time = 0;
if (dir) {
if (!picasso_on) {
- drawing_adjust_mousepos(&x, &y);
+ drawing_adjust_mousepos (&x, &y);
}
- //write_log ("%d\n", dir);
if (!dmaen(DMA_SPRITE))
- setmouseactivexy(x, y, 0);
+ setmouseactivexy (x, y, 0);
else
- setmouseactivexy(x, y, dir);
+ setmouseactivexy (x, y, dir);
}
+ return 1;
}
int mousehack_alive (void)
return ievent_alive > 0;
}
+int magicmouse_alive (void)
+{
+ return mouseedge_alive > 0;
+}
+
static void mousehack_helper (void)
{
int mousexpos, mouseypos;
- if (!mousehack_allowed())
+ if (!mousehack_allowed ())
return;
#ifdef PICASSO96
if (picasso_on) {
} else
#endif
{
- mouseypos = coord_native_to_amiga_y (lastmy) << 1;
mousexpos = coord_native_to_amiga_x (lastmx);
+ mouseypos = coord_native_to_amiga_y (lastmy) << 1;
}
- mousehack_setpos(mousexpos, mouseypos);
+ mousehack_setpos (mousexpos, mouseypos);
}
STATIC_INLINE int adjust (int val)
inputdevice_handle_inputcode ();
if (ievent_alive > 0)
ievent_alive--;
+ if (mouseedge_alive > 0)
+ mouseedge_alive--;
#ifdef ARCADIA
if (arcadia_bios)
arcadia_vsync ();
#endif
- mouseedge();
+ if (mouseedge ())
+ mouseedge_alive = 10;
}
void inputdevice_reset (void)
}
for (i = 0; i < MAX_INPUT_SUB_EVENT; i++)
handle_input_event (id->eventid[ID_AXIS_OFFSET + axis][i], v, 0, 0);
- mousehack_helper();
+ mousehack_helper ();
}
int getmousestate(int joy)
{
return 0;
}
-STATIC_INLINE int notcrc32(uae_u32 crc32)
+STATIC_INLINE int notcrc32 (uae_u32 crc32)
{
if (crc32 == 0xffffffff || crc32 == 0x00000000)
return 1;
return 0;
}
-static int cmpsha1(uae_u8 *s1, struct romdata *rd)
+static int cmpsha1 (uae_u8 *s1, struct romdata *rd)
{
int i;
return 0;
}
-static struct romdata *checkromdata(uae_u8 *sha1, int size, uae_u32 mask)
+static struct romdata *checkromdata (uae_u8 *sha1, int size, uae_u32 mask)
{
int i = 0;
while (roms[i].name) {
sprintf (name + strlen (name), " [%s]", rd->partnumber);
}
-struct romlist *getromlistbyromdata(struct romdata *rd)
+struct romlist *getromlistbyromdata (struct romdata *rd)
{
int ids[2];
return getromlistbyids(ids);
}
-struct romlist *getromlistbyids(int *ids)
+struct romlist *getromlistbyids (int *ids)
{
struct romdata *rd;
int i, j;
return NULL;
}
-void romwarning(int *ids)
+void romwarning (int *ids)
{
int i, exp;
char tmp1[MAX_DPATH], tmp2[MAX_DPATH];
}
#endif
-int addr_valid(char *txt, uaecptr addr, uae_u32 len)
+int addr_valid (char *txt, uaecptr addr, uae_u32 len)
{
addrbank *ab = &get_mem_bank(addr);
if (ab == 0 || !(ab->flags & ABFLAG_RAM) || addr < 0x100 || len < 0 || len > 16777215 || !valid_address (addr, len)) {
#define NONEXISTINGDATA 0
//#define NONEXISTINGDATA 0xffffffff
-static void dummylog(int rw, uaecptr addr, int size, uae_u32 val, int ins)
+static void dummylog (int rw, uaecptr addr, int size, uae_u32 val, int ins)
{
if (illegal_count >= MAX_ILG)
return;
extendedkickmem_mask = extendedkickmem_size - 1;
extendedkickmemory = mapped_malloc (extendedkickmem_size, "rom_f0");
extendedkickmem_bank.baseaddr = extendedkickmemory;
- memcpy(extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
- map_banks(&extendedkickmem_bank, 0xf0, 1, 1);
+ memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536);
+ map_banks (&extendedkickmem_bank, 0xf0, 1, 1);
f0 = 1;
} else {
write_log ("A3000 Bonus hack: can't map bonus when uae boot rom is enabled\n");
}
} else {
if (f0) {
- map_banks(&dummy_bank, 0xf0, 1, 1);
+ map_banks (&dummy_bank, 0xf0, 1, 1);
mapped_free(extendedkickmemory);
extendedkickmemory = NULL;
f0 = 0;
return patched;
}
-static void patch_kick(void)
+static void patch_kick (void)
{
int patched = 0;
if (kickmem_size >= 524288 && currprefs.kickshifter)
shmpiece *shm_start;
-static void dumplist(void)
+static void dumplist (void)
{
shmpiece *x = shm_start;
write_log ("Start Dump:\n");
static void init_mem_banks (void)
{
int i;
+
for (i = 0; i < MEMORY_BANKS; i++)
put_mem_bank (i << 16, &dummy_bank, 0);
#ifdef NATMEM_OFFSET
#include "newcpu.h"
#include "traps.h"
#include "od-win32/win32.h"
-#include "picasso96_win.h"
#include "sounddep/sound.h"
#include "dxwrap.h"
#include "win32.h"
cds.dwData = (ULONG_PTR)uMessage;
cds.cbData = dwDataSize;
cds.lpData = (LPVOID)pData;
- if (!SendMessageTimeout(pInfo->hHostMessageWindow, WM_COPYDATA, (WPARAM)pInfo->hGuestMessageWindow, (LPARAM)&cds, SMTO_NORMAL, SRPMSG_TIMEOUT, &dwResult))
- return FALSE;
+ dwResult = SendMessage(pInfo->hHostMessageWindow, WM_COPYDATA, (WPARAM)pInfo->hGuestMessageWindow, (LPARAM)&cds);
}
else
{
- if (!SendMessageTimeout(pInfo->hHostMessageWindow, uMessage, wParam, lParam, SMTO_NORMAL, SRPMSG_TIMEOUT, &dwResult))
- return FALSE;
+ // SendMessageTimeout is not used, since the host
+ // might display MessageBoxes during notifications
+ // (e.g. go-to-fullscreen message)
+ dwResult = SendMessage(pInfo->hHostMessageWindow, uMessage, wParam, lParam);
}
if (plResult)
*plResult = dwResult;
: License version 2 as published by the Free Software Foundation.
Authors : os, mcb
Created : 2007-08-27 13:55:49
- Updated : 2008-02-03 06:49:00
+ Updated : 2008-03-25 18:49:00
Comment : RP Player interprocess communication include file
*****************************************************************************/
// Guest-to-Host Messages
// ****************************************************************************
-#define RPIPCGM_REGISTER (WM_APP + 0)
-#define RPIPCGM_FEATURES (WM_APP + 1)
-#define RPIPCGM_CLOSED (WM_APP + 2)
-#define RPIPCGM_ACTIVATED (WM_APP + 3)
-#define RPIPCGM_DEACTIVATED (WM_APP + 4)
-#define RPIPCGM_SCREENMODE (WM_APP + 9)
-#define RPIPCGM_POWERLED (WM_APP + 10)
-#define RPIPCGM_DEVICES (WM_APP + 11)
-#define RPIPCGM_DEVICEACTIVITY (WM_APP + 12)
-#define RPIPCGM_MOUSECAPTURE (WM_APP + 13)
-#define RPIPCGM_HOSTAPIVERSION (WM_APP + 14)
-#define RPIPCGM_PAUSE (WM_APP + 15)
-#define RPIPCGM_DEVICECONTENT (WM_APP + 16)
-#define RPIPCGM_TURBO (WM_APP + 17)
-#define RPIPCGM_PING (WM_APP + 18)
-#define RPIPCGM_VOLUME (WM_APP + 19)
-#define RPIPCGM_ESCAPED (WM_APP + 20)
-#define RPIPCGM_PARENT (WM_APP + 21)
+#define RPIPCGM_REGISTER (WM_APP + 0)
+#define RPIPCGM_FEATURES (WM_APP + 1)
+#define RPIPCGM_CLOSED (WM_APP + 2)
+#define RPIPCGM_ACTIVATED (WM_APP + 3)
+#define RPIPCGM_DEACTIVATED (WM_APP + 4)
+#define RPIPCGM_SCREENMODE (WM_APP + 9)
+#define RPIPCGM_POWERLED (WM_APP + 10)
+#define RPIPCGM_DEVICES (WM_APP + 11)
+#define RPIPCGM_DEVICEACTIVITY (WM_APP + 12)
+#define RPIPCGM_MOUSECAPTURE (WM_APP + 13)
+#define RPIPCGM_HOSTAPIVERSION (WM_APP + 14)
+#define RPIPCGM_PAUSE (WM_APP + 15)
+#define RPIPCGM_DEVICECONTENT (WM_APP + 16)
+#define RPIPCGM_TURBO (WM_APP + 17)
+#define RPIPCGM_PING (WM_APP + 18)
+#define RPIPCGM_VOLUME (WM_APP + 19)
+#define RPIPCGM_ESCAPED (WM_APP + 20)
+#define RPIPCGM_PARENT (WM_APP + 21)
+#define RPIPCGM_DEVICESEEK (WM_APP + 22)
// ****************************************************************************
// Host-to-Guest Messages
// ****************************************************************************
-#define RPIPCHM_CLOSE (WM_APP + 200)
-#define RPIPCHM_SCREENMODE (WM_APP + 202)
-#define RPIPCHM_SCREENCAPTURE (WM_APP + 203)
-#define RPIPCHM_PAUSE (WM_APP + 204)
-#define RPIPCHM_DEVICECONTENT (WM_APP + 205)
-#define RPIPCHM_RESET (WM_APP + 206)
-#define RPIPCHM_TURBO (WM_APP + 207)
-#define RPIPCHM_PING (WM_APP + 208)
-#define RPIPCHM_VOLUME (WM_APP + 209)
-#define RPIPCHM_ESCAPEKEY (WM_APP + 210)
-#define RPIPCHM_EVENT (WM_APP + 211)
-#define RPIPCHM_MOUSECAPTURE (WM_APP + 212)
+#define RPIPCHM_CLOSE (WM_APP + 200)
+#define RPIPCHM_SCREENMODE (WM_APP + 202)
+#define RPIPCHM_SCREENCAPTURE (WM_APP + 203)
+#define RPIPCHM_PAUSE (WM_APP + 204)
+#define RPIPCHM_DEVICECONTENT (WM_APP + 205)
+#define RPIPCHM_RESET (WM_APP + 206)
+#define RPIPCHM_TURBO (WM_APP + 207)
+#define RPIPCHM_PING (WM_APP + 208)
+#define RPIPCHM_VOLUME (WM_APP + 209)
+#define RPIPCHM_ESCAPEKEY (WM_APP + 210)
+#define RPIPCHM_EVENT (WM_APP + 211)
+#define RPIPCHM_MOUSECAPTURE (WM_APP + 212)
+#define RPIPCHM_SCREENCLIP (WM_APP + 213)
// ****************************************************************************
#define RP_FEATURE_PAUSE 0x00000040 // pause functionality is available (see RPIPCHM_PAUSE message)
#define RP_FEATURE_TURBO 0x00000080 // turbo mode functionality is available (see RPIPCHM_TURBO message)
#define RP_FEATURE_VOLUME 0x00000100 // volume adjustment is possible (see RPIPCHM_VOLUME message)
+#define RP_FEATURE_SCREENCLIP 0x00000200 // screen clipping is supported (see RPIPCHM_SCREENCLIP message)
// Screen Modes
#define RP_SCREENMODE_1X 0 // 1x windowed mode
#define RP_RESET_SOFT 0 // soft reset
#define RP_RESET_HARD 1 // hard reset
+// RPIPCGM_MOUSECAPTURE/RPIPCHM_MOUSECAPTURE
+#define RP_MOUSECAPTURE_CAPTURED 0x00000001
+#define RP_MOUSECAPTURE_MAGICMOUSE 0x00000002
+
+typedef struct RPScreenClip
+{
+ LONG lLeft;
+ LONG lTop;
+ LONG lWidth;
+ LONG lHeight;
+} RPSCREENCLIP;
#endif // __CLOANTO_RETROPLATFORMIPC_H__
--- /dev/null
+Reference for RetroPlatformIPC.h (RP Player interprocess communication include file)
+
+
+****************************************************************************
+ Guest-to-Host Messages
+****************************************************************************
+
+Message:
+ RPIPCGM_REGISTER
+Description:
+ this is a private message and is automatically sent
+ by the RPInitializeGuest() function
+ to register the caller as a RetroPlatform guest
+
+
+Message:
+ RPIPCGM_FEATURES
+Description:
+ the guest uses this message to tell the host
+ about the features it supports;
+ at startup time, the guest sends initialization messages
+ so that the host can adapt the GUI based on the reported features;
+ these messages include:
+ RPIPCGM_FEATURES (describes guest features),
+ RPIPCGM_POWERLED (turns on the power LED in the GUI),
+ RPIPCGM_DEVICES (one for each device category: tells the number of emulated devices),
+ RPIPCGM_DEVICECONTENT (one for each device with an image file or peripheral attached),
+ RPIPCGM_TURBO (tells if some of the turbo modes are activated from the start),
+ RPIPCGM_VOLUME (reports about starting volume level),
+ RPIPCGM_SCREENMODE (communicates the screen mode and the guest window handle);
+ note that at startup time the guest should create a borderless and hidden window
+ and send its handle using a RPIPCGM_SCREENMODE message, which must be the last
+ of the initialization messages, since it displays the guest window
+ and the host "frame window" (the part of the player user interface
+ with command and status icons which can be used to drag the guest window, etc.)
+Data sent:
+ WPARAM = RP_FEATURE_* flags
+Response:
+ none
+
+
+Message:
+ RPIPCGM_CLOSED
+Description:
+ this message is sent to the host when the guest is terminating
+Data sent:
+ none
+Response:
+ none
+
+
+Message:
+ RPIPCGM_ACTIVATED
+Description:
+ the guest sends this message to the host
+ when its window is being activated
+Data sent:
+ LPARAM = identifier of the thread that owns the window being deactivated
+Response:
+ none
+
+
+Message:
+ RPIPCGM_DEACTIVATED
+Description:
+ the guest sends this message to the host
+ when its window is being deactivated
+Data sent:
+ LPARAM = identifier of the thread that owns the window being activated
+Response:
+ none
+
+
+Message:
+ RPIPCGM_SCREENMODE
+Description:
+ the guest sends a RPIPCGM_SCREENMODE message to notify the host
+ about a change in its "screen mode" (1x/2x/4x/full screen, etc.);
+ screen mode changes requested by the host
+ (see the RPIPCHM_SCREENMODE message) must not be notified,
+ unless this is an asynchronous screen mode change
+ (i.e. the guest returned the INVALID_HANDLE_VALUE
+ response to a RPIPCHM_SCREENMODE host request);
+ this message can also be sent when the guest has to close
+ and reopen its window for other reasons;
+ at startup-time, the guest must create
+ a borderless and hidden window and send its handle
+ using this message; the host will then take care
+ of preparing, positioning and showing the guest window
+Data sent:
+ WPARAM = new screen mode (RP_SCREENMODE_* value)
+ LPARAM = handle of the (new) guest window
+Response:
+ none
+
+
+Message:
+ RPIPCGM_POWERLED
+Description:
+ sent to the host to change the power LED state
+Data sent:
+ WPARAM = power LED intensity (min/off 0, max 100)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_DEVICES
+Description:
+ this message is used to notify the host about a change
+ in the number of emulated devices (floppy drives, hard disks, etc.)
+Data sent:
+ WPARAM = device category (RP_DEVICE_* value)
+ LPARAM = 32-bit bitfield representing the devices
+ emulated in the specified category
+ (every bit set to 1 corresponds to a mounted drive
+ e.g. 0x00000005 = drive 0 and drive 2 are emulated)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_DEVICEACTIVITY
+Description:
+ this message can be used to turn on or off the activity indicator
+ of a specified device (like a LED on the original hardware);
+ the indicator can also be "blinked", i.e. the host will turn the
+ LED on and then off again after the specified amount of time
+Data sent:
+ WPARAM = device category (RP_DEVICE_* value) and device number
+ combined with the MAKEWORD macro;
+ e.g. MAKEWORD(RP_DEVICE_FLOPPY, 0);
+ the RP_ALL_DEVICES define may be used as device number
+ to turn on or off all the activity leds for a device category
+ LPARAM = 0 turns off the activity LED,
+ (LPARAM)-1 turns on the activity LED,
+ <millisecond delay> turns on the activity LED
+ for the specified amount of time (blink)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_MOUSECAPTURE
+Description:
+ the guest sends this message when the mouse is captured/released
+ (the mouse is "captured" when its movements are restricted to the guest window area
+ and the system cursor is not visible);
+ mouse capture changes requested by the host
+ (see the RPIPCHM_MOUSECAPTURE message) must not be notified;
+ for consistency across different guests, a guest which sends RPIPCGM_MOUSECAPTURE
+ messages should also implement a keyboard-actuated escape functionality
+ (the preferred key for this purpose is included in the parameters sent from the
+ host at startup time - see RPLaunchGuest() in RetroPlatformPlugin.h);
+ note that in order not to interfere with the window dragging functionality,
+ the mouse should not be captured when the guest window gets the focus,
+ but when a mouse button event is received
+Data sent:
+ WPARAM = mouse capture state (RP_MOUSECAPTURE_* value)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_HOSTAPIVERSION
+Description:
+ the guest can send a RPIPCGM_HOSTAPIVERSION to query the host
+ about the RetroPlatform API version it implements;
+ since the guest plugin already asks for a minimim version of the API
+ on the host side, this message can be used to check the host API version
+ and enable optional functionality
+Data sent:
+ none
+Response:
+ LRESULT = major and minor version combined with the MAKELONG macro
+ (e.g. LOWORD(lr) = major version; HIWORD(lr) = minor version)
+
+
+Message:
+ RPIPCGM_PAUSE
+Description:
+ the guest sends this message to the host
+ when it enters or exits pause mode;
+ pause mode changes requested by the host
+ (see the RPIPCHM_PAUSE message) must not be notified;
+ note: when paused, the guest should release the mouse (if captured)
+Data sent:
+ WPARAM = non-zero when the guest enters pause mode
+ or zero when the guest exits from pause mode
+Response:
+ none
+
+
+Message:
+ RPIPCGM_DEVICECONTENT
+Description:
+ the guest sends a RPIPCGM_DEVICECONTENT message
+ to notify the host that an image file (e.g. a floppy disk image)
+ or a peripheral (e.g. a joystick)
+ has been loaded into (or ejected from) an emulated device;
+ this notification must not be sent when the event
+ has been requested by the host (see the RPIPCHM_DEVICECONTENT message)
+Data sent:
+ pData = a RPDEVICECONTENT structure (see below);
+ the szImageFile field of the structure
+ contains an empty string when the guest
+ is ejecting something from the device
+Response:
+ none
+
+
+Message:
+ RPIPCGM_TURBO
+Description:
+ the guest sends a RPIPCGM_TURBO message
+ to notify the host about activation of "turbo" (maximum speed) mode
+ of some of its functionalities (e.g. floppy, CPU);
+ turbo mode activations/deactivations requested by the host
+ (see the RPIPCHM_TURBO message) must not be notified;
+Data sent:
+ WPARAM = mask of functionalities affected (RP_TURBO_* flags)
+ LPARAM = bits corresponding to those set in WPARAM
+ (1 = turbo mode activated for the guest functionality
+ 0 = guest functionality reverted to normal speed)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_PING
+Description:
+ this is a no-operation message and can be sent
+ to check if the host is responsive and functional
+Data sent:
+ none
+Response:
+ LRESULT = non-zero value is returned
+
+
+Message:
+ RPIPCGM_VOLUME
+Description:
+ the guest uses the RPIPCGM_VOLUME message
+ to notify the host about a change of its audio level;
+ audio level changes requested by the host
+ (see the RPIPCHM_VOLUME message) must not be notified
+Data sent:
+ WPARAM = volume level (min/off 0, max 100)
+Response:
+ none
+
+
+Message:
+ RPIPCGM_ESCAPED
+Description:
+ this message is sent to notify the host
+ that the escape key has been held down
+Data sent:
+ none
+Response:
+ none
+
+
+Message:
+ RPIPCGM_PARENT
+Description:
+ the guest sends this message to the host to get the handle
+ of the parent for its window; the guest window must be created
+ as a borderless (WS_POPUP style), hidden window,
+ using the handle returned by this message as the parent window parameter
+Data sent:
+ none
+Response:
+ LRESULT = window handle (HWND) to use in a CreateWindow call
+
+
+Message:
+ RPIPCGM_DEVICESEEK
+Description:
+ this message can be used to notify the host about a seek operation
+ of a specified device (e.g. the head of a disk drive changes position);
+Data sent:
+ WPARAM = device category (RP_DEVICE_* value) and device number
+ combined with the MAKEWORD macro;
+ e.g. MAKEWORD(RP_DEVICE_FLOPPY, 0)
+ LPARAM = device-dependant seek position (e.g. drive track position)
+Response:
+ none
+
+
+
+
+
+****************************************************************************
+ Host-to-Guest Messages
+****************************************************************************
+
+Message:
+ RPIPCHM_CLOSE
+Description:
+ sent from the host when the emulation must be terminated
+ (e.g. the user has hit the close button in the host window);
+ the guest should destroy its window and terminate (see Response below)
+Data sent:
+ none
+Response:
+ LRESULT = non-zero if the guest can safely terminate or 0 otherwise
+
+
+Message:
+ RPIPCHM_SCREENMODE
+Description:
+ this message is sent to ask the guest to activate a specified screen mode;
+ when switching to the new screen mode, the guest can resize (reuse) its window
+ or close its window and open a new one
+Data sent:
+ WPARAM = RP_SCREENMODE_* value
+Response:
+ LRESULT = handle of the (new) guest window
+ or NULL (the screen mode couldn't be changed)
+ or INVALID_HANDLE_VALUE (the screen mode will be changed asynchronously
+ and the host will soon get a RPIPCGM_SCREENMODE notification)
+
+
+Message:
+ RPIPCHM_SCREENCAPTURE
+Description:
+ with this message the host asks the guest to save its screen
+ to the the specified file in BMP format
+Data sent:
+ pData = (Unicode) full path and name of the file to save
+ (note: the file may exist and can be overwritten)
+Response:
+ LRESULT = non-zero if the guest saved its screen to the file
+
+
+Message:
+ RPIPCHM_PAUSE
+Description:
+ the RPIPCHM_PAUSE message sets the guest into pause mode
+ or resumes the guest from pause mode;
+ note: when paused, the guest should release the mouse (if captured)
+Data sent:
+ WPARAM = non-zero to set the guest into pause mode
+ or zero to resume the guest from pause mode
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+Message:
+ RPIPCHM_DEVICECONTENT
+Description:
+ the host sends a RPIPCHM_DEVICECONTENT message
+ to load an image file or a peripheral into an emulated device
+ (e.g. an ADF floppy file into a floppy drive,
+ or a physical or keyboard-emulated joystick into an input port)
+ or to unload the currently loaded content from the device
+Data sent:
+ pData = a RPDEVICECONTENT structure (see below);
+ if the szImageFile field of the structure
+ contains an empty string, the guest should
+ unload the current content from the device
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+Message:
+ RPIPCHM_RESET
+Description:
+ the host sends this message to reset the guest
+Data sent:
+ WPARAM = a RP_RESET_* value
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+Message:
+ RPIPCHM_TURBO
+Description:
+ the host sends this message to activate or deactivate
+ the turbo mode of selected guest functionalities
+Data sent:
+ WPARAM = mask of functionalities to change (RP_TURBO_* flags)
+ LPARAM = bits corresponding to those set in WPARAM
+ (1 = speedup the guest functionality
+ 0 = revert to normal speed emulation)
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+Message:
+ RPIPCHM_PING
+Description:
+ this is a no-operation message and can be sent
+ to check if the guest is responsive and functional
+Data sent:
+ none
+Response:
+ LRESULT = non-zero value is returned
+
+
+Message:
+ RPIPCHM_VOLUME
+Description:
+ the host uses the RPIPCHM_VOLUME message to set
+ the audio level of the guest
+Data sent:
+ WPARAM = volume level (min 0, max 100)
+Response:
+ LRESULT = non-zero if the guest set the volume as requested
+
+
+Message:
+ RPIPCHM_ESCAPEKEY
+Description:
+ the host uses the RPIPCHM_ESCAPEKEY message
+ to change the escape key information
+Data sent:
+ WPARAM = DirectInput DIK_* identifier of the escape key
+ (e.g. 1 for the Esc key - see DIK_* constants in dinput.h)
+ LPARAM = milliseconds value
+ (amount of time the user has to hold the above key to trigger the escape functionality)
+Response:
+ LRESULT = non-zero if the guest accepted the new settings
+
+
+Message:
+ RPIPCHM_EVENT
+Description:
+ the host uses the RPIPCHM_EVENT message
+ to simulate keyboard, mouse, joystick (press/release)
+ and other guest-specific events
+Data sent:
+ pData = (Unicode) event string (guest-specific)
+Response:
+ LRESULT = non-zero if the guest simulated the specified event
+
+
+Message:
+ RPIPCHM_MOUSECAPTURE
+Description:
+ the host uses this message to ask the guest
+ to capture or release the mouse
+Data sent:
+ WPARAM = mouse capture state being requested (RP_MOUSECAPTURE_* value)
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+Message:
+ RPIPCHM_SCREENCLIP
+Description:
+ this command is used to set the clipping coordinates of the screen
+Data sent:
+ pData = a RPSCREENCLIP structure
+Response:
+ LRESULT = non-zero if the guest executed the command
+
+
+
+// ****************************************************************************
+// Message Data Structures and Defines
+// ****************************************************************************
+
+// Guest Features
+#define RP_FEATURE_POWERLED 0x00000001 // a power LED is emulated
+#define RP_FEATURE_SCREEN1X 0x00000002 // 1x windowed mode is available
+#define RP_FEATURE_SCREEN2X 0x00000004 // 2x windowed mode is available
+#define RP_FEATURE_SCREEN4X 0x00000008 // 4x windowed mode is available
+#define RP_FEATURE_FULLSCREEN 0x00000010 // full screen display is available
+#define RP_FEATURE_SCREENCAPTURE 0x00000020 // screen capture functionality is available (see RPIPCHM_SCREENCAPTURE message)
+#define RP_FEATURE_PAUSE 0x00000040 // pause functionality is available (see RPIPCHM_PAUSE message)
+#define RP_FEATURE_TURBO 0x00000080 // turbo mode functionality is available (see RPIPCHM_TURBO message)
+#define RP_FEATURE_VOLUME 0x00000100 // volume adjustment is possible (see RPIPCHM_VOLUME message)
+
+// Screen Modes
+#define RP_SCREENMODE_1X 0 // 1x windowed mode
+#define RP_SCREENMODE_2X 1 // 2x windowed mode
+#define RP_SCREENMODE_4X 2 // 4x windowed mode
+#define RP_SCREENMODE_FULLSCREEN 3 // full screen
+
+// Device Categories
+#define RP_DEVICE_FLOPPY 0 // floppy disk drive
+#define RP_DEVICE_HD 1 // hard disk drive
+#define RP_DEVICE_CD 2 // CD/DVD drive
+#define RP_DEVICE_NET 3 // network card
+#define RP_DEVICE_TAPE 4 // cassette tape drive
+#define RP_DEVICE_CARTRIDGE 5 // expansion cartridge
+#define RP_DEVICE_INPUTPORT 6 // input port
+
+typedef struct RPDeviceContent
+{
+ BYTE btDeviceCategory; // RP_DEVICE_* value
+ BYTE btDeviceNumber; // device number (range 0..31)
+ WCHAR szContent[1]; // full path and name of the image file to load, or input port device (Unicode, variable-sized field)
+} RPDEVICECONTENT;
+
+// Input Port Devices
+#define RP_IPD_MOUSE1 L"Mouse1" // first mouse type (e.g. Windows Mouse for WinUAE)
+#define RP_IPD_MOUSE2 L"Mouse2" // second mouse type (e.g. Mouse for WinUAE)
+#define RP_IPD_MOUSE3 L"Mouse3" // third mouse type (e.g. Mousehack Mouse for WinUAE)
+#define RP_IPD_MOUSE4 L"Mouse4" // fourth mouse type (e.g. RAW Mouse for WinUAE)
+#define RP_IPD_JOYSTICK1 L"Joystick1" // first joystick type (e.g. standard joystick for WinUAE, described as "Joystick1\ProductGUID\ProductName")
+#define RP_IPD_JOYSTICK2 L"Joystick2" // second joystick type (e.g. X-Arcade (Left) joystick for WinUAE, described as "Joystick2\ProductGUID\ProductName")
+#define RP_IPD_JOYSTICK3 L"Joystick3" // third joystick type (e.g. X-Arcade (Right) joystick for WinUAE, described as "Joystick3\ProductGUID\ProductName")
+#define RP_IPD_KEYBDL1 L"KeyboardLayout1" // first joystick emulation keyboard layout (e.g. Keyboard Layout A for WinUAE)
+#define RP_IPD_KEYBDL2 L"KeyboardLayout2" // second joystick emulation keyboard layout (e.g. Keyboard Layout B for WinUAE)
+#define RP_IPD_KEYBDL3 L"KeyboardLayout3" // third joystick emulation keyboard layout (e.g. Keyboard Layout C for WinUAE)
+
+// Turbo Mode Functionalities
+#define RP_TURBO_CPU 0x00000001 // CPU
+#define RP_TURBO_FLOPPY 0x00000002 // floppy disk drive
+#define RP_TURBO_TAPE 0x00000004 // cassette tape drive
+
+// Reset Type
+#define RP_RESET_SOFT 0 // soft reset
+#define RP_RESET_HARD 1 // hard reset
+
+// RPIPCGM_MOUSECAPTURE/RPIPCHM_MOUSECAPTURE
+#define RP_MOUSECAPTURE_UNCAPTURED 0
+#define RP_MOUSECAPTURE_CAPTURED 1
+#define RP_MOUSECAPTURE_MAGICMOUSE 2
+
+typedef struct RPScreenClip
+{
+ LONG lLeft;
+ LONG lTop;
+ LONG lWidth;
+ LONG lHeight;
+} RPSCREENCLIP;
+
+#endif // __CLOANTO_RETROPLATFORMIPC_H__
}
static char *alloctexts[] = { "NonLocalVRAM", "DefaultRAM", "VRAM", "RAM" };
-LPDIRECTDRAWSURFACE7 allocsurface_2 (int width, int height, int forcemode)
+LPDIRECTDRAWSURFACE7 allocsurface_2 (int width, int height, uae_u8 *ptr, int pitch, int forcemode)
{
HRESULT ddrval;
DDSURFACEDESC2 desc;
desc.ddsCaps.dwCaps |= DDSCAPS_SYSTEMMEMORY;
desc.dwWidth = width;
desc.dwHeight = height;
+ if (ptr) {
+ desc.dwFlags |= DDSD_LPSURFACE | DDSD_PITCH;
+ desc.lPitch = pitch;
+ desc.lpSurface = ptr;
+ }
memcpy (&desc.ddpfPixelFormat, &dxdata.native.ddpfPixelFormat, sizeof (DDPIXELFORMAT));
ddrval = IDirectDraw7_CreateSurface (dxdata.maindd, &desc, &surf, NULL);
if (FAILED (ddrval)) {
write_log ("IDirectDraw7_CreateSurface (%dx%d,%s): %s\n", width, height, alloctexts[forcemode], DXError (ddrval));
} else {
- clearsurf (surf);
- write_log ("Created %dx%d surface in %s (%d)\n", width, height, alloctexts[forcemode]);
+ write_log ("Created %dx%d surface in %s (%d)\n", width, height, alloctexts[forcemode], forcemode);
}
return surf;
}
int mode = ddforceram;
for (;;) {
- s = allocsurface_2 (width, height, mode);
- if (s)
+ s = allocsurface_2 (width, height, NULL, 0, mode);
+ if (s) {
+ clearsurf (s);
return s;
+ }
mode++;
if (mode >= 4)
mode = 0;
return NULL;
}
}
+LPDIRECTDRAWSURFACE7 createsurface (uae_u8 *ptr, int pitch, int width, int height)
+{
+ return allocsurface_2 (width, height, ptr, pitch, DDFORCED_SYSMEM);
+}
void freesurface (LPDIRECTDRAWSURFACE7 surf)
{
return dderr;
}
-RGBFTYPE DirectDraw_GetSurfacePixelFormat(LPDDSURFACEDESC2 surface)
+RGBFTYPE DirectDraw_GetSurfacePixelFormat (LPDDSURFACEDESC2 surface)
{
int surface_is = 0;
DDPIXELFORMAT *pfp = NULL;
DWORD r, g, b;
DWORD surf_flags;
+ if (surface == NULL)
+ surface = &dxdata.native;
surf_flags = surface->dwFlags;
pfp = &surface->ddpfPixelFormat;
r = pfp->dwRBitMask;
g = pfp->dwGBitMask;
b = pfp->dwBBitMask;
- switch (pfp->dwRGBBitCount) {
+ switch (pfp->dwRGBBitCount)
+ {
case 8:
if ((pfp->dwFlags & DDPF_PALETTEINDEXED8) != 0)
return RGBFB_CHUNKY;
#ifndef __DXWRAP_H__
#define __DXWRAP_H__
+#include "rtgmodes.h"
#include "ddraw.h"
+extern int ddforceram;
+
struct ddstuff
{
int ddinit;
int primary, disabled, gdi;
GUID guid;
char *name;
+ char *name2;
struct PicassoResolution *DisplayModes;
RECT rect;
};
extern struct MultiDisplay Displays[MAX_DISPLAYS];
-/* Types for RGBFormat used */
-typedef enum {
- RGBFB_NONE, /* no valid RGB format (should not happen) */
- RGBFB_CLUT, /* palette mode, set colors when opening screen using
- tags or use SetRGB32/LoadRGB32(...) */
- RGBFB_R8G8B8, /* TrueColor RGB (8 bit each) */
- RGBFB_B8G8R8, /* TrueColor BGR (8 bit each) */
- RGBFB_R5G6B5PC, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
- format: gggbbbbbrrrrrggg */
- RGBFB_R5G5B5PC, /* HiColor15 (5 bit each), format: gggbbbbb0rrrrrgg */
- RGBFB_A8R8G8B8, /* 4 Byte TrueColor ARGB (A unused alpha channel) */
- RGBFB_A8B8G8R8, /* 4 Byte TrueColor ABGR (A unused alpha channel) */
- RGBFB_R8G8B8A8, /* 4 Byte TrueColor RGBA (A unused alpha channel) */
- RGBFB_B8G8R8A8, /* 4 Byte TrueColor BGRA (A unused alpha channel) */
- RGBFB_R5G6B5, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
- format: rrrrrggggggbbbbb */
- RGBFB_R5G5B5, /* HiColor15 (5 bit each), format: 0rrrrrgggggbbbbb */
- RGBFB_B5G6R5PC, /* HiColor16 (5 bit R, 6 bit G, 5 bit B),
- format: gggrrrrrbbbbbggg */
- RGBFB_B5G5R5PC, /* HiColor15 (5 bit each), format: gggrrrrr0bbbbbbgg */
-
- /* By now, the following formats are for use with a hardware window only
- (bitmap operations may be implemented incompletely) */
-
- RGBFB_Y4U2V2, /* 2 Byte TrueColor YUV (CCIR recommendation CCIR601).
- Each two-pixel unit is stored as one longword
- containing luminance (Y) for each of the two pixels,
- and chrominance (U,V) for alternate pixels.
- The missing chrominance values are generated by
- interpolation. (Y1-U0-Y0-V0) */
- RGBFB_Y4U1V1, /* 1 Byte TrueColor ACCUPAK. Four adjacent pixels form
- a packet of 5 bits Y (luminance) each pixel and 6 bits
- U and V (chrominance) shared by the four pixels */
-
- RGBFB_MaxFormats
-} RGBFTYPE;
-
-#define RGBFF_NONE (1<<RGBFB_NONE)
-#define RGBFF_CLUT (1<<RGBFB_CLUT)
-#define RGBFF_R8G8B8 (1<<RGBFB_R8G8B8)
-#define RGBFF_B8G8R8 (1<<RGBFB_B8G8R8)
-#define RGBFF_R5G6B5PC (1<<RGBFB_R5G6B5PC)
-#define RGBFF_R5G5B5PC (1<<RGBFB_R5G5B5PC)
-#define RGBFF_A8R8G8B8 (1<<RGBFB_A8R8G8B8)
-#define RGBFF_A8B8G8R8 (1<<RGBFB_A8B8G8R8)
-#define RGBFF_R8G8B8A8 (1<<RGBFB_R8G8B8A8)
-#define RGBFF_B8G8R8A8 (1<<RGBFB_B8G8R8A8)
-#define RGBFF_R5G6B5 (1<<RGBFB_R5G6B5)
-#define RGBFF_R5G5B5 (1<<RGBFB_R5G5B5)
-#define RGBFF_B5G6R5PC (1<<RGBFB_B5G6R5PC)
-#define RGBFF_B5G5R5PC (1<<RGBFB_B5G5R5PC)
-#define RGBFF_Y4U2V2 (1<<RGBFB_Y4U2V2)
-#define RGBFF_Y4U1V1 (1<<RGBFB_Y4U1V1)
-
-#define RGBMASK_8BIT RGBFF_CLUT
-#define RGBMASK_16BIT (RGBFF_R5G6B5PC | RGBFF_B5G6R5PC | RGBFF_R5G6B5)
-#define RGBMASK_15BIT (RGBFF_R5G5B5PC | RGBFF_B5G5R5PC | RGBFF_R5G5B5)
-#define RGBMASK_24BIT (RGBFF_R8G8B8 | RGBFF_B8G8R8)
-#define RGBMASK_32BIT (RGBFF_A8R8G8B8 | RGBFF_A8B8G8R8 | RGBFF_R8G8B8A8 | RGBFF_B8G8R8A8)
-
-#define RGBFF_PLANAR RGBFF_NONE
-#define RGBFF_CHUNKY RGBFF_CLUT
-
-#define RGBFB_PLANAR RGBFB_NONE
-#define RGBFB_CHUNKY RGBFB_CLUT
-
typedef enum
{
red_mask,
int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc);
void unlocksurface (LPDIRECTDRAWSURFACE7 surf);
LPDIRECTDRAWSURFACE7 allocsurface (int width, int height);
+LPDIRECTDRAWSURFACE7 createsurface (uae_u8 *ptr, int pitch, int width, int height);
void freesurface (LPDIRECTDRAWSURFACE7 surf);
void DirectDraw_FreeMainSurface (void);
HRESULT DirectDraw_CreateMainSurface (int width, int height);
int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddresses, PULONG_PTR lpdwCount, PULONG lpdwGranularity)
{
- int i, j;
+ int i, j, off;
if (memwatchok)
return GetWriteWatch (0, lpBaseAddress, dwRegionSize, lpAddresses, lpdwCount, lpdwGranularity);
j = 0;
- for (i = 0; i < p96mem_size / si.dwPageSize; i++) {
+ off = ((uae_u8*)lpBaseAddress - (natmem_offset + p96ram_start)) / si.dwPageSize;
+ for (i = 0; i < dwRegionSize / si.dwPageSize; i++) {
if (j >= *lpdwCount)
break;
- if (memwatchtable[i])
- lpAddresses[j++] = p96mem_offset + i * si.dwPageSize;
+ if (memwatchtable[off + i])
+ lpAddresses[j++] = (uae_u8*)lpBaseAddress + i * si.dwPageSize;
}
*lpdwCount = j;
*lpdwGranularity = si.dwPageSize;
void preinit_shm (void)
{
+ int i;
uae_u64 total64;
uae_u64 totalphys64;
MEMORYSTATUS memstats;
if (max_z3fastmem < 512 * 1024 * 1024)
max_z3fastmem = 512 * 1024 * 1024;
+ shm_start = 0;
+ for (i = 0; i < MAX_SHMID; i++) {
+ shmids[i].attached = 0;
+ shmids[i].key = -1;
+ shmids[i].size = 0;
+ shmids[i].addr = NULL;
+ shmids[i].name[0] = 0;
+ }
+
write_log ("Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20);
testwritewatch ();
canbang = 1;
}
-int init_shm (void)
+static void resetmem (void)
{
int i;
+
+ if (!shm_start)
+ return;
+ for (i = 0; i < MAX_SHMID; i++) {
+ struct shmid_ds *s = &shmids[i];
+ int size = s->size;
+ uae_u8 *shmaddr;
+ uae_u8 *result;
+
+ if (!s->attached)
+ continue;
+ if (!s->natmembase)
+ continue;
+ shmaddr = natmem_offset + ((uae_u8*)s->attached - (uae_u8*)s->natmembase);
+ result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, s->mode);
+ if (result != shmaddr)
+ write_log ("NATMEM: realloc(%p,%d,%d) failed, err=%x\n", shmaddr, size, s->mode, GetLastError ());
+ else
+ write_log ("NATMEM: rellocated(%p,%d,%s)\n", shmaddr, size, s->name);
+ }
+}
+
+int init_shm (void)
+{
uae_u32 size, totalsize, z3size, natmemsize, rtgbarrier, rtgextra;
int rounds = 0;
}
natmemsize = size + z3size;
- shm_start = 0;
- for (i = 0; i < MAX_SHMID; i++) {
- shmids[i].attached = 0;
- shmids[i].key = -1;
- shmids[i].size = 0;
- shmids[i].addr = NULL;
- shmids[i].name[0] = 0;
- }
xfree (memwatchtable);
memwatchtable = 0;
if (currprefs.gfxmem_size) {
natmem_offset_end = p96mem_offset + currprefs.gfxmem_size;
}
+ resetmem ();
+
return canbang;
}
-void mapped_free(uae_u8 *mem)
+void mapped_free (uae_u8 *mem)
{
shmpiece *x = shm_start;
shmids[shmid].name[0] = '\0';
shmids[shmid].size = 0;
shmids[shmid].attached = 0;
+ shmids[shmid].mode = 0;
+ shmids[shmid].natmembase = 0;
}
x = x->next;
}
while(x) {
if(mem == x->native_address)
- shmdt(x->native_address);
+ shmdt (x->native_address);
x = x->next;
}
x = shm_start;
while(x) {
struct shmid_ds blah;
if (mem == x->native_address) {
- if (shmctl(x->id, IPC_STAT, &blah) == 0)
- shmctl(x->id, IPC_RMID, &blah);
+ if (shmctl (x->id, IPC_STAT, &blah) == 0)
+ shmctl (x->id, IPC_RMID, &blah);
}
x = x->next;
}
}
-static key_t get_next_shmkey(void)
+static key_t get_next_shmkey (void)
{
key_t result = -1;
int i;
return result;
}
-STATIC_INLINE key_t find_shmkey(key_t key)
+STATIC_INLINE key_t find_shmkey (key_t key)
{
int result = -1;
if(shmids[key].key == key) {
return result;
}
-int mprotect(void *addr, size_t len, int prot)
+int mprotect (void *addr, size_t len, int prot)
{
int result = 0;
return result;
}
-void *shmat(int shmid, void *shmaddr, int shmflg)
+void *shmat (int shmid, void *shmaddr, int shmflg)
{
void *result = (void *)-1;
BOOL got = FALSE;
DWORD protect = PAGE_READWRITE;
#ifdef NATMEM_OFFSET
- unsigned int size=shmids[shmid].size;
- if(shmids[shmid].attached)
+ unsigned int size = shmids[shmid].size;
+
+ if (shmids[shmid].attached)
return shmids[shmid].attached;
- if ((uae_u8*)shmaddr<natmem_offset) {
+
+ if ((uae_u8*)shmaddr < natmem_offset) {
if(!strcmp(shmids[shmid].name,"chip")) {
shmaddr=natmem_offset;
got = TRUE;
}
if(!strcmp(shmids[shmid].name,"filesys")) {
result = xcalloc (size, 1);
- shmids[shmid].attached=result;
+ shmids[shmid].attached = result;
return result;
}
if(!strcmp(shmids[shmid].name,"hrtmon")) {
}
#endif
- if ((shmids[shmid].key == shmid) && shmids[shmid].size) {
- got = FALSE;
- if (got == FALSE) {
- if (shmaddr)
- virtualfreewithlock (shmaddr, size, MEM_DECOMMIT);
- result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, protect);
- if (result == NULL) {
- result = (void*)-1;
- write_log ("VirtualAlloc %08.8X - %08.8X %x (%dk) failed %d\n",
- (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
- size, size >> 10, GetLastError());
- } else {
- shmids[shmid].attached = result;
- write_log ("VirtualAlloc %08.8X - %08.8X %x (%dk) ok%s\n",
- (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
- size, size >> 10, p96special ? " P96" : "");
- }
- } else {
- shmids[shmid].attached = shmaddr;
- result = shmaddr;
+ if (shmids[shmid].key == shmid && shmids[shmid].size) {
+ shmids[shmid].mode = protect;
+ shmids[shmid].natmembase = natmem_offset;
+ if (shmaddr)
+ virtualfreewithlock (shmaddr, size, MEM_DECOMMIT);
+ result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, protect);
+ if (result == NULL) {
+ result = (void*)-1;
+ write_log ("VirtualAlloc %08.8X - %08.8X %x (%dk) failed %d\n",
+ (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
+ size, size >> 10, GetLastError());
+ } else {
+ shmids[shmid].attached = result;
+ write_log ("VirtualAlloc %08.8X - %08.8X %x (%dk) ok%s\n",
+ (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size,
+ size, size >> 10, p96special ? " P96" : "");
}
}
return result;
}
-int shmdt(const void *shmaddr)
+int shmdt (const void *shmaddr)
{
return 0;
}
-int shmget(key_t key, size_t size, int shmflg, char *name)
+int shmget (key_t key, size_t size, int shmflg, char *name)
{
int result = -1;
return result;
}
-int shmctl(int shmid, int cmd, struct shmid_ds *buf)
+int shmctl (int shmid, int cmd, struct shmid_ds *buf)
{
int result = -1;
- if ((find_shmkey(shmid) != -1) && buf) {
+ if ((find_shmkey (shmid) != -1) && buf) {
switch(cmd)
{
case IPC_STAT:
result = 0;
break;
case IPC_RMID:
- VirtualFree(shmids[shmid].attached, shmids[shmid].size, MEM_DECOMMIT);
+ VirtualFree (shmids[shmid].attached, shmids[shmid].size, MEM_DECOMMIT);
shmids[shmid].key = -1;
shmids[shmid].name[0] = '\0';
shmids[shmid].size = 0;
shmids[shmid].attached = 0;
+ shmids[shmid].mode = 0;
result = 0;
break;
}
#endif
-int isinf(double x)
+int isinf (double x)
{
- const int nClass = _fpclass(x);
+ const int nClass = _fpclass (x);
int result;
if (nClass == _FPCLASS_NINF || nClass == _FPCLASS_PINF)
result = 1;
static int prtbufbytes,wantwrite;
static HANDLE hPrt = INVALID_HANDLE_VALUE;
static DWORD dwJob;
-extern HWND hAmigaWnd;
static int prtopen;
extern void flushpixels(void);
void DoSomeWeirdPrintingStuff(char val);
* programs started from a Picasso workbench.
*/
+#define P96DX 0
+
#include "sysconfig.h"
#include "sysdeps.h"
#if defined(PICASSO96)
-#define NOBLITTER 0
-
-static int hwsprite = 0;
-static int uaegfxcard_old = 1;
-
#include "registry.h"
#include "dxwrap.h"
#include "rp.h"
#include "picasso96_win.h"
#include "win32gfx.h"
+#define NOBLITTER 0
+#define NOBLITTER_BLIT 0
+
+static int hwsprite = 0;
+static int picasso96_BT = BT_uaegfx;
+static int picasso96_GCT = GCT_Unknown;
+static int picasso96_PCT = PCT_Unknown;
+#ifndef UAEGFX_INTERNAL
+static int uaegfxcard_old = 1;
+#endif
+
int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddresses, PULONG_PTR lpdwCount, PULONG lpdwGranularity);
void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize);
struct picasso_vidbuf_description picasso_vidinfo;
static struct PicassoResolution *newmodes;
+static int picasso_convert, host_mode;
+
/* These are the maximum resolutions... They are filled in by GetSupportedResolutions() */
/* have to fill this in, otherwise problems occur on the Amiga side P96 s/w which expects
/* data here. */
uae_u32 p96_rgbx16[65536];
+#if P96DX > 0
+static LPDIRECTDRAWSURFACE7 p96surface;
+#endif
static LPDIRECTDRAWSURFACE7 cursorsurface;
static int cursorwidth, cursorheight;
static uae_u32 cursorrgb[4], cursorrgbn[4];
switch (bpp)
{
case 2:
- *vp = (((v >> 8) & 0xff) | (v << 8)) & 0xffff;
+ *vp = (((v >> 8) & 0x00ff) | (v << 8)) & 0xffff;
break;
case 4:
*vp = ((v >> 24) & 0x000000ff) | ((v >> 8) & 0x0000ff00) | ((v << 8) & 0x00ff0000) | ((v << 24) & 0xff000000);
/*
* Fill a rectangle in the screen.
*/
-STATIC_INLINE void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y,
- int Width, int Height, uae_u32 Pen, int Bpp)
+static void do_fillrect_frame_buffer (struct RenderInfo *ri, int X, int Y,
+ int Width, int Height, uae_u32 Pen, int Bpp)
{
int cols;
- uae_u8 *src, *dst;
+ uae_u8 *dst;
int lines;
int bpr = ri->BytesPerRow;
- dst = src = ri->Memory + X * Bpp + Y * ri->BytesPerRow;
+ dst = ri->Memory + X * Bpp + Y * ri->BytesPerRow;
endianswap (&Pen, Bpp);
switch (Bpp)
{
break;
case 3:
for (lines = 0; lines < Height; lines++, dst += bpr) {
- uae_u8 *d = (uae_u8*)dst;
+ uae_u8 *p = (uae_u8*)dst;
for (cols = 0; cols < Width; cols++) {
- *d++ = Pen >> 16;
- *d++ = Pen >> 8;
- *d++ = Pen;
+ *p++ = Pen >> 0;
+ *p++ = Pen >> 8;
+ *p++ = Pen >> 16;
}
}
break;
{
static int vsynccnt;
+#ifdef RETROPLATFORM
+ rp_vsync ();
+#endif
+
+ if (!picasso_on)
+ return;
+
framecnt++;
mouseupdate ();
static int set_panning_called = 0;
+
+typedef enum {
+
+ /* DEST = RGBFB_B8G8R8A8,32 */
+ RGBFB_A8R8G8B8_32 = 1,
+ RGBFB_A8B8G8R8_32,
+ RGBFB_R8G8B8A8_32,
+ RGBFB_B8G8R8A8_32,
+ RGBFB_R8G8B8_32,
+ RGBFB_B8G8R8_32,
+ RGBFB_R5G6B5PC_32,
+ RGBFB_R5G5B5PC_32,
+ RGBFB_R5G6B5_32,
+ RGBFB_R5G5B5_32,
+ RGBFB_B5G6R5PC_32,
+ RGBFB_B5G5R5PC_32,
+ RGBFB_CLUT_RGBFB_32,
+
+ /* DEST = RGBFB_R5G6B5PC,16 */
+ RGBFB_A8R8G8B8_16,
+ RGBFB_A8B8G8R8_16,
+ RGBFB_R8G8B8A8_16,
+ RGBFB_B8G8R8A8_16,
+ RGBFB_R8G8B8_16,
+ RGBFB_B8G8R8_16,
+ RGBFB_R5G6B5PC_16,
+ RGBFB_R5G5B5PC_16,
+ RGBFB_R5G6B5_16,
+ RGBFB_R5G5B5_16,
+ RGBFB_B5G6R5PC_16,
+ RGBFB_B5G5R5PC_16,
+ RGBFB_CLUT_RGBFB_16,
+
+ /* DEST = RGBFB_CLUT,8 */
+ RGBFB_CLUT_8
+};
+
+static void setconvert (void)
+{
+ int d = picasso_vidinfo.pixbytes;
+ int v;
+
+ v = 0;
+ switch (picasso96_state.RGBFormat)
+ {
+ case RGBFB_CLUT:
+ if (d == 1)
+ v = RGBFB_CLUT_8;
+ else if (d == 2)
+ v = RGBFB_CLUT_RGBFB_16;
+ else if (d == 4)
+ v = RGBFB_CLUT_RGBFB_32;
+ break;
+
+ case RGBFB_B5G6R5PC:
+ if (d == 2)
+ v = RGBFB_B5G6R5PC_16;
+ else if (d == 4)
+ v = RGBFB_B5G6R5PC_32;
+ break;
+ case RGBFB_R5G6B5PC:
+ if (d == 2)
+ v = RGBFB_R5G6B5PC_16;
+ else if (d == 4)
+ v = RGBFB_R5G6B5PC_32;
+ break;
+
+ case RGBFB_R5G5B5PC:
+ if (d == 4)
+ v = RGBFB_R5G5B5PC_32;
+ else if (d == 2)
+ v = RGBFB_R5G5B5PC_16;
+ break;
+ case RGBFB_R5G6B5:
+ if (d == 4)
+ v = RGBFB_R5G6B5_32;
+ break;
+ case RGBFB_R5G5B5:
+ if (d == 4)
+ v = RGBFB_R5G5B5_32;
+ break;
+ case RGBFB_B5G5R5PC:
+ if (d == 4)
+ v = RGBFB_B5G5R5PC_32;
+ break;
+
+
+ case RGBFB_R8G8B8:
+ if (d == 4)
+ v = RGBFB_R8G8B8_32;
+ break;
+ case RGBFB_B8G8R8:
+ if (d == 4)
+ v = RGBFB_B8G8R8_32;
+ break;
+ case RGBFB_A8B8G8R8:
+ if (d == 2)
+ v = RGBFB_A8B8G8R8_16;
+ else if (d == 4)
+ v = RGBFB_A8B8G8R8_32;
+ break;
+ case RGBFB_B8G8R8A8:
+ if (d == 2)
+ v = RGBFB_B8G8R8A8_16;
+ else if (d == 4)
+ v = RGBFB_B8G8R8A8_32;
+ break;
+ }
+ picasso_convert = v;
+ host_mode = DirectDraw_GetSurfacePixelFormat (NULL);
+ write_log ("RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d\n", d, host_mode, picasso96_state.RGBFormat, v);
+}
+
/* Clear our screen, since we've got a new Picasso screen-mode, and refresh with the proper contents
* This is called on several occasions:
* 1. Amiga-->Picasso transition, via SetSwitch()
} //end for higher P96 mousedraw rate
have_done_picasso = 1;
palette_changed = 1;
+ setconvert ();
/* Make sure that the first time we show a Picasso video mode, we don't blit any crap.
* We can do this by checking if we have an Address yet. */
#undef BLT_SIZE
#undef BLT_MULT
+#define BLT_SIZE 3
+#define BLT_MULT 1
+#define BLT_NAME BLIT_FALSE_24
+#define BLT_FUNC(s,d) *d = 0
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NOR_24
+#define BLT_FUNC(s,d) *d = ~(*s | * d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_ONLYDST_24
+#define BLT_FUNC(s,d) *d = (*d) & ~(*s)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NOTSRC_24
+#define BLT_FUNC(s,d) *d = ~(*s)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_ONLYSRC_24
+#define BLT_FUNC(s,d) *d = (*s) & ~(*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NOTDST_24
+#define BLT_FUNC(s,d) *d = ~(*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_EOR_24
+#define BLT_FUNC(s,d) *d = (*s) ^ (*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NAND_24
+#define BLT_FUNC(s,d) *d = ~((*s) & (*d))
+#include "p96_blit.c"
+#define BLT_NAME BLIT_AND_24
+#define BLT_FUNC(s,d) *d = (*s) & (*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NEOR_24
+#define BLT_FUNC(s,d) *d = ~((*s) ^ (*d))
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NOTONLYSRC_24
+#define BLT_FUNC(s,d) *d = ~(*s) | (*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_NOTONLYDST_24
+#define BLT_FUNC(s,d) *d = ~(*d) | (*s)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_OR_24
+#define BLT_FUNC(s,d) *d = (*s) | (*d)
+#include "p96_blit.c"
+#define BLT_NAME BLIT_TRUE_24
+#define BLT_FUNC(s,d) *d = 0xffffffff
+#include "p96_blit.c"
+#define BLT_NAME BLIT_30_24
+#define BLT_FUNC(s,d) tmp = *d ; *d = *s; *s = tmp;
+#define BLT_TEMP
+#include "p96_blit.c"
+#undef BLT_SIZE
+#undef BLT_MULT
+
#define BLT_SIZE 2
#define BLT_MULT 2
#define BLT_NAME BLIT_FALSE_16
uae_u8 *src, *dst;
uae_u8 Bpp = GetBytesPerPixel (ri->RGBFormat);
unsigned long total_width = width * Bpp;
- unsigned long linewidth = (total_width + 15) & ~15;
src = ri->Memory + srcx * Bpp + srcy * ri->BytesPerRow;
dst = dstri->Memory + dstx * Bpp + dsty * dstri->BytesPerRow;
case BLIT_TRUE: BLIT_TRUE_32 (PARMS); break;
case 30: BLIT_30_32 (PARMS); break;
}
+ } else if (Bpp == 3) {
+
+ /* 24-bit (not very) optimized */
+ switch (opcode)
+ {
+ case BLIT_FALSE: BLIT_FALSE_24 (PARMS); break;
+ case BLIT_NOR: BLIT_NOR_24 (PARMS); break;
+ case BLIT_ONLYDST: BLIT_ONLYDST_24 (PARMS); break;
+ case BLIT_NOTSRC: BLIT_NOTSRC_24 (PARMS); break;
+ case BLIT_ONLYSRC: BLIT_ONLYSRC_24 (PARMS); break;
+ case BLIT_NOTDST: BLIT_NOTDST_24 (PARMS); break;
+ case BLIT_EOR: BLIT_EOR_24 (PARMS); break;
+ case BLIT_NAND: BLIT_NAND_24 (PARMS); break;
+ case BLIT_AND: BLIT_AND_24 (PARMS); break;
+ case BLIT_NEOR: BLIT_NEOR_24 (PARMS); break;
+ case BLIT_NOTONLYSRC: BLIT_NOTONLYSRC_24 (PARMS); break;
+ case BLIT_NOTONLYDST: BLIT_NOTONLYDST_24 (PARMS); break;
+ case BLIT_OR: BLIT_OR_24 (PARMS); break;
+ case BLIT_TRUE: BLIT_TRUE_24 (PARMS); break;
+ case 30: BLIT_30_24 (PARMS); break;
+ }
} else if (Bpp == 2) {
write_log ("Cursor surface clearblit failed: %s\n", DXError (ddrval));
}
-static void putmousepixel (uae_u8 *d, int bpp, int idx)
+STATIC_INLINE uae_u16 rgb32torgb16pc (uae_u32 rgb)
{
- uae_u32 val = cursorrgbn[idx];
- switch (bpp)
- {
- case 1:
- ((uae_u8*)d)[0] = (uae_u8)val;
- break;
- case 2:
- ((uae_u16*)d)[0] = (uae_u16)val;
- break;
- case 4:
- ((uae_u32*)d)[0] = (uae_u32)val;
- break;
- }
+ return (((rgb >> (16 + 3)) & 0x1f) << 11) | (((rgb >> (8 + 2)) & 0x3f) << 5) | (((rgb >> (0 + 3)) & 0x1f) << 0);
}
static void updatesprcolors (void)
cursorrgbn[i] = i + 16;
break;
case 2:
- vx = 0xff00ff;
- cursorrgbn[0] = p96_rgbx16[(((vx >> (16 + 3)) & 0x1f) << 11) | (((vx >> (8 + 2)) & 0x3f) << 5) | (((vx >> (0 + 3)) & 0x1f) << 0)];
- cursorrgbn[i] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
+ vx = 0xff00ff; /* RGB -> B5G6R5 */
+ cursorrgbn[0] = rgb32torgb16pc (vx);
+ cursorrgbn[i] = rgb32torgb16pc (v);
break;
case 4:
cursorrgbn[0] = 0xff00ff;
}
}
+static void putmousepixel (uae_u8 *d, int bpp, int idx)
+{
+ uae_u32 val = cursorrgbn[idx];
+ switch (bpp)
+ {
+ case 1:
+ ((uae_u8*)d)[0] = (uae_u8)val;
+ break;
+ case 2:
+ ((uae_u16*)d)[0] = (uae_u16)val;
+ break;
+ case 4:
+ ((uae_u32*)d)[0] = (uae_u32)val;
+ break;
+ }
+}
+
static uae_u32 setspriteimage (uaecptr bi)
{
DDSURFACEDESC2 desc;
return 0;
}
-static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struct PicassoResolution *dm)
+static void FillBoardInfo (uaecptr amigamemptr, struct LibResolution *res, struct PicassoResolution *dm, int depth)
{
int i;
- switch (dm->depth) {
- case 1:
+ switch (depth)
+ {
+ case 8:
res->Modes[CHUNKY] = amigamemptr;
break;
- case 2:
+ case 15:
+ case 16:
res->Modes[HICOLOR] = amigamemptr;
break;
- case 3:
+ case 24:
res->Modes[TRUECOLOR] = amigamemptr;
break;
- default:
+ default:
res->Modes[TRUEALPHA] = amigamemptr;
break;
}
put_word (amigamemptr + PSSO_ModeInfo_Width, dm->res.width);
put_word (amigamemptr + PSSO_ModeInfo_Height, dm->res.height);
- put_byte (amigamemptr + PSSO_ModeInfo_Depth, dm->depth * 8);
+ put_byte (amigamemptr + PSSO_ModeInfo_Depth, depth);
put_byte (amigamemptr + PSSO_ModeInfo_Flags, 0);
put_word (amigamemptr + PSSO_ModeInfo_HorTotal, dm->res.width);
put_word (amigamemptr + PSSO_ModeInfo_HorBlankSize, 0);
put_long (amigamemptr + PSSO_LibResolution_BoardInfo, libres->BoardInfo);
}
+static int p96depth (int depth)
+{
+ uae_u32 f = currprefs.picasso96_modeflags;
+ int ok = 0;
+
+ if (depth == 8 && (f & RGBFF_CLUT))
+ ok = 1;
+ if (depth == 15 && (f & (RGBFF_R5G5B5PC | RGBFF_R5G5B5 | RGBFF_B5G5R5PC)))
+ ok = 2;
+ if (depth == 16 && (f & (RGBFF_R5G6B5PC | RGBFF_R5G6B5 | RGBFF_B5G6R5PC)))
+ ok = 2;
+ if (depth == 24 && (f & (RGBFF_R8G8B8 | RGBFF_B8G8R8)))
+ ok = 3;
+ if (depth == 32 && (f & (RGBFF_A8R8G8B8 | RGBFF_A8B8G8R8 | RGBFF_R8G8B8A8 | RGBFF_B8G8R8A8)))
+ ok = 4;
+ return ok;
+}
static int missmodes[] = { 320, 200, 320, 240, 640, 400, 640, 480, -1 };
void picasso96_alloc (TrapContext *ctx)
{
int i, j, size, cnt;
- int misscnt;
+ int misscnt, depths;
SYSTEM_INFO si;
uaegfx_resname = ds ("uaegfx.card");
cnt = 0;
newmodes = xmalloc (sizeof (struct PicassoResolution) * MAX_PICASSO_MODES);
size = 0;
+
+ depths = 0;
+ if (p96depth (8))
+ depths++;
+ if (p96depth (15))
+ depths++;
+ if (p96depth (16))
+ depths++;
+ if (p96depth (24))
+ depths++;
+ if (p96depth (32))
+ depths++;
+
i = 0;
while (DisplayModes[i].depth >= 0) {
for (j = 0; missmodes[j * 2] >= 0; j++) {
while (missmodes[misscnt * 2] == 0)
misscnt++;
if (missmodes[misscnt * 2] >= 0) {
- int oldi = i;
if (DisplayModes[i].res.width > missmodes[misscnt * 2 + 0] || DisplayModes[i].res.height > missmodes[misscnt * 2 + 1]) {
+ int depth;
int w = DisplayModes[i].res.width;
int h = DisplayModes[i].res.height;
- do {
+ for (depth = 8; depth <= 32; depth++) {
struct PicassoResolution *pr = &newmodes[cnt];
+ if (!p96depth (depth))
+ continue;
memcpy (pr, &DisplayModes[i], sizeof (struct PicassoResolution));
pr->res.width = missmodes[misscnt * 2 + 0];
pr->res.height = missmodes[misscnt * 2 + 1];
- sprintf (pr->name, "%dx%dx%d FAKE", pr->res.width, pr->res.height, pr->depth * 8);
+ sprintf (pr->name, "%dx%dx%d FAKE", pr->res.width, pr->res.height, depth);
size += PSSO_ModeInfo_sizeof;
- i++;
- cnt++;
- } while (DisplayModes[i].depth >= 0
- && w == DisplayModes[i].res.width
- && h == DisplayModes[i].res.height);
-
- i = oldi;
+ }
misscnt++;
continue;
}
}
- do {
- memcpy (&newmodes[cnt], &DisplayModes[i], sizeof (struct PicassoResolution));
- size += PSSO_ModeInfo_sizeof;
- i++;
- cnt++;
- } while (DisplayModes[i].depth >= 0
+ memcpy (&newmodes[cnt], &DisplayModes[i], sizeof (struct PicassoResolution));
+ size += PSSO_ModeInfo_sizeof * depths;
+ i++;
+ cnt++;
+ while (DisplayModes[i].depth >= 0
&& DisplayModes[i].res.width == DisplayModes[j].res.width
- && DisplayModes[i].res.height == DisplayModes[j].res.height);
+ && DisplayModes[i].res.height == DisplayModes[j].res.height)
+ i++;
}
newmodes[cnt].depth = -1;
for (i = 0; i < cnt; i++) {
- switch (newmodes[i].depth) {
- case 1:
- if (newmodes[i].res.width > chunky.width)
- chunky.width = newmodes[i].res.width;
- if (newmodes[i].res.height > chunky.height)
- chunky.height = newmodes[i].res.height;
- break;
- case 2:
- if (newmodes[i].res.width > hicolour.width)
- hicolour.width = newmodes[i].res.width;
- if (newmodes[i].res.height > hicolour.height)
- hicolour.height = newmodes[i].res.height;
- break;
- case 3:
- if (newmodes[i].res.width > truecolour.width)
- truecolour.width = newmodes[i].res.width;
- if (newmodes[i].res.height > truecolour.height)
- truecolour.height = newmodes[i].res.height;
- break;
- case 4:
- if (newmodes[i].res.width > alphacolour.width)
- alphacolour.width = newmodes[i].res.width;
- if (newmodes[i].res.height > alphacolour.height)
- alphacolour.height = newmodes[i].res.height;
- break;
+ int depth;
+ for (depth = 8; depth <= 32; depth++) {
+ if (!p96depth (depth))
+ continue;
+ switch (depth) {
+ case 1:
+ if (newmodes[i].res.width > chunky.width)
+ chunky.width = newmodes[i].res.width;
+ if (newmodes[i].res.height > chunky.height)
+ chunky.height = newmodes[i].res.height;
+ break;
+ case 2:
+ if (newmodes[i].res.width > hicolour.width)
+ hicolour.width = newmodes[i].res.width;
+ if (newmodes[i].res.height > hicolour.height)
+ hicolour.height = newmodes[i].res.height;
+ break;
+ case 3:
+ if (newmodes[i].res.width > truecolour.width)
+ truecolour.width = newmodes[i].res.width;
+ if (newmodes[i].res.height > truecolour.height)
+ truecolour.height = newmodes[i].res.height;
+ break;
+ case 4:
+ if (newmodes[i].res.width > alphacolour.width)
+ alphacolour.width = newmodes[i].res.width;
+ if (newmodes[i].res.height > alphacolour.height)
+ alphacolour.height = newmodes[i].res.height;
+ break;
+ }
}
}
#if 0
ShowSupportedResolutions ();
#endif
#ifdef UAEGFX_INTERNAL
- picasso96_amem = NULL;
+ picasso96_amem = 0;
if (uaegfx_card_install (ctx, size)) {
picasso96_amem = get_long (uaegfx_base + CARD_RESLIST);
picasso96_amemend = picasso96_amem + size;
vers[strlen (vers) - 1] = 0;
write_log ("P96: v%d %08X %s\n", version, addr, vers);
+ if (version == 1) {
+ static int warned;
+ if (!warned)
+ gui_message("Buggy libs:picasso96/uaegfx.card detected.\nPlease replace it with official version.\n");
+ warned = 1;
+ }
if (version >= 2)
uaegfxcard_old = 0;
xfree (vers);
{
uae_u32 flags;
+ write_log ("RTG mode mask: %x\n", currprefs.picasso96_modeflags);
put_word (ABI + PSSO_BoardInfo_BitsPerCannon, 8);
- put_word (ABI + PSSO_BoardInfo_RGBFormats, picasso96_pixel_format);
- put_long (ABI + PSSO_BoardInfo_BoardType, BT_uaegfx);
- put_long (ABI + PSSO_BoardInfo_GraphicsControllerType, GCT_Unknown);
- put_long (ABI + PSSO_BoardInfo_PaletteChipType, PCT_Unknown);
+ put_word (ABI + PSSO_BoardInfo_RGBFormats, currprefs.picasso96_modeflags);
+ put_long (ABI + PSSO_BoardInfo_BoardType, picasso96_BT);
+ put_long (ABI + PSSO_BoardInfo_GraphicsControllerType, picasso96_GCT);
+ put_long (ABI + PSSO_BoardInfo_PaletteChipType, picasso96_PCT);
put_long (ABI + PSSO_BoardInfo_BoardName, uaegfx_resname);
put_long (ABI + PSSO_BoardInfo_BoardType, 1);
flags = get_long (ABI + PSSO_BoardInfo_Flags);
flags &= 0xffff0000;
- flags |= BIF_HARDWARESPRITE | BIF_BLITTER | BIF_NOMEMORYMODEMIX;
- put_long (ABI + PSSO_BoardInfo_Flags, flags);
+ flags |= BIF_BLITTER | BIF_NOMEMORYMODEMIX;
#ifndef UAEGFX_INTERNAL
- flags = get_long (ABI + PSSO_BoardInfo_Flags);
if (flags & BIF_HARDWARESPRITE) {
hwsprite = 1;
put_word (ABI + PSSO_BoardInfo_SoftSpriteFlags, 0);
} else {
hwsprite = 0;
write_log ("P96: uaegfx.card: no hardware sprite support\n");
- put_word (ABI + PSSO_BoardInfo_SoftSpriteFlags, picasso96_pixel_format);
+ put_word (ABI + PSSO_BoardInfo_SoftSpriteFlags, currprefs.picasso96_modeflags);
}
if (uaegfxcard_old && (flags & BIF_HARDWARESPRITE)) {
flags &= ~BIF_HARDWARESPRITE;
}
if (!(flags & BIF_BLITTER))
write_log ("P96: no blitter support, bogus uaegfx.card!?\n");
- put_long (ABI + PSSO_BoardInfo_Flags, flags);
+#else
+ hwsprite = 1;
+ flags |= BIF_HARDWARESPRITE;
#endif
+ put_long (ABI + PSSO_BoardInfo_Flags, flags);
if (flags & BIF_NOBLITTER)
write_log ("P96: blitter disabled in devs:monitors/uaegfx!\n");
i = 0;
unkcnt = 0;
while (newmodes[i].depth >= 0) {
+ int depth;
j = i;
/* Add a LibResolution structure to the ResolutionsList MinList in our BoardInfo */
res.DisplayID = AssignModeID (i, LibResolutionStructureCount, &unkcnt);
res.Height = newmodes[i].res.height;
res.Flags = P96F_PUBLIC;
memcpy (res.P96ID, "P96-0:", 6);
- sprintf (res.Name, "uaegfx:%dx%d", res.Width, res.Height);
+ sprintf (res.Name, "UAE:%dx%d", res.Width, res.Height);
res.Modes[PLANAR] = 0;
res.Modes[CHUNKY] = 0;
res.Modes[HICOLOR] = 0;
res.Modes[TRUECOLOR] = 0;
res.Modes[TRUEALPHA] = 0;
- do {
+ for (depth = 8; depth <= 32; depth++) {
+ if (!p96depth (depth))
+ continue;
/* Handle this display mode's depth */
/* New: Only add the modes when there is enough P96 RTG memory to hold the bitmap */
- if(allocated_gfxmem >= newmodes[i].res.width * newmodes[i].res.height * newmodes[i].depth) {
+ if(allocated_gfxmem >= newmodes[i].res.width * newmodes[i].res.height * (depth + 7) / 8) {
ModeInfoStructureCount++;
- FillBoardInfo(amem, &res, &newmodes[i]);
+ FillBoardInfo (amem, &res, &newmodes[i], depth);
amem += PSSO_ModeInfo_sizeof;
}
- i++;
- } while (newmodes[i].depth >= 0
+ }
+ while (newmodes[i].depth >= 0
&& newmodes[i].res.width == newmodes[j].res.width
- && newmodes[i].res.height == newmodes[j].res.height);
+ && newmodes[i].res.height == newmodes[j].res.height)
+ i++;
LibResolutionStructureCount++;
CopyLibResolutionStructureU2A (&res, amem);
return 1;
}
-
-static void init_picasso_screen(void)
+static void init_picasso_screen (void)
{
reloadcursor = 1;
if(set_panning_called) {
}
init_picasso_screen_called = 1;
mman_ResetWatch (p96ram_start + natmem_offset, allocated_gfxmem);
+
}
/*
uaecptr bi = m68k_areg (regs, 0);
uaecptr bmeptr = get_long (bi + PSSO_BoardInfo_BitMapExtra); /* Get our BoardInfo ptr's BitMapExtra ptr */
uae_u16 bme_width, bme_height;
+ int changed = 0;
if(oldscr == 0) {
oldscr = start_of_screen;
+ changed = 1;
}
if (oldscr != start_of_screen) {
set_gc_called = 0;
oldscr = start_of_screen;
+ changed = 1;
+ }
+
+ if (changed) {
+#if P96DX > 0
+ freesurface (p96surface);
+ p96surface = NULL;
+ if (picasso96_state.BytesPerPixel == picasso_vidinfo.pixbytes)
+ p96surface = createsurface (get_real_address (picasso96_state.Address),
+ picasso96_state.Width * picasso96_state.BytesPerPixel, picasso96_state.Width, picasso96_state.Height);
+ write_log ("P96Surface: %08X %p\n", picasso96_state.Address, p96surface);
+#endif
}
bme_width = get_word (bmeptr + PSSO_BitMapExtra_Width);
width_in_bytes = Bpp * Width;
rectstart = uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp;
- for (lines = 0; lines < Height; lines++, uae_mem += ri.BytesPerRow) {
+ for (lines = 0; lines < Height; lines++, uae_mem += ri.BytesPerRow)
do_xor8 (uae_mem, width_in_bytes, xorval);
- }
-
result = 1;
}
if (NOBLITTER)
return 0;
if (CopyRenderInfoStructureA2U (renderinfo, &ri) && Y != 0xFFFF) {
- if (ri.RGBFormat != RGBFormat)
- write_log ("Weird Stuff!\n");
-
Bpp = GetBytesPerPixel (RGBFormat);
P96TRACE(("FillRect(%d, %d, %d, %d) Pen 0x%x BPP %d BPR %d Mask 0x%x\n",
BLIT_OPCODE opcode = blitrectdata.opcode;
uae_u8 Bpp = GetBytesPerPixel (ri->RGBFormat);
- unsigned long total_width = width * Bpp;
- unsigned long linewidth = (total_width + 15) & ~15;
if (opcode == BLIT_DST) {
write_log ( "WARNING: BlitRect() being called with opcode of BLIT_DST\n" );
uae_u8 Mask = (uae_u8)m68k_dreg (regs, 6);
uae_u32 result = 0;
- if (NOBLITTER)
+ if (NOBLITTER_BLIT)
return 0;
P96TRACE(("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask));
result = BlitRect (renderinfo, (uaecptr)NULL, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC);
uae_u32 RGBFmt = m68k_dreg (regs, 7);
uae_u32 result = 0;
- if (NOBLITTER)
+ if (NOBLITTER_BLIT)
return 0;
P96TRACE(("BlitRectNoMaskComplete() op 0x%02x, %08x:(%4d,%4d) --> %08x:(%4d,%4d), wh(%4d,%4d)\n",
((uae_u16 *)mem)[bits] = (uae_u16)fgpen;
break;
case 3:
- mem[bits + 0] = fgpen >> 16;
- mem[bits + 1] = fgpen >> 8;
- mem[bits + 2] = fgpen >> 0;
+ mem[bits * 3 + 0] = fgpen >> 0;
+ mem[bits * 3 + 1] = fgpen >> 8;
+ mem[bits * 3 + 2] = fgpen >> 16;
break;
case 4:
((uae_u32 *)mem)[bits] = fgpen;
uae_u32 result = 0;
if (NOBLITTER)
- return 0;
+ return 1;
+
if(CopyRenderInfoStructureA2U (rinf, &ri) && CopyPatternStructureA2U (pinf, &pattern)) {
Bpp = GetBytesPerPixel(ri.RGBFormat);
uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset with address */
if (xshift != 0)
d = (d << xshift) | (d >> (16 - xshift));
- for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp << 4) {
+ for (cols = 0; cols < W; cols += 16, uae_mem2 += Bpp * 16) {
long bits;
long max = W - cols;
unsigned int data = d;
case 3:
{
uae_u32 *addr = (uae_u32 *)(uae_mem2 + bits * 3);
- do_put_mem_long (addr, do_get_mem_long (addr) ^ 0xffffff);
+ do_put_mem_long (addr, do_get_mem_long (addr) ^ 0x00ffffff);
}
break;
case 4:
if (NOBLITTER)
return 0;
+
if (CopyRenderInfoStructureA2U (rinf, &ri) && CopyTemplateStructureA2U (tmpl, &tmp)) {
- Bpp = GetBytesPerPixel(ri.RGBFormat);
+ Bpp = GetBytesPerPixel (ri.RGBFormat);
uae_mem = ri.Memory + Y * ri.BytesPerRow + X * Bpp; /* offset into address */
if (tmp.DrawMode & INVERS)
if (Mask != 0xFF) {
if(Bpp > 1)
Mask = 0xFF;
-
if(tmp.DrawMode == COMP) {
write_log ("WARNING - BlitTemplate() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.\n", Mask);
return 0;
uae_u8 *uae_mem2 = uae_mem;
unsigned int data = *tmpl_mem;
- for (cols = 0; cols < W; cols += 8, uae_mem2 += Bpp << 3) {
+ for (cols = 0; cols < W; cols += 8, uae_mem2 += Bpp * 8) {
unsigned int byte;
long bits;
long max = W - cols;
if (inversion)
bit_set = !bit_set;
if (bit_set)
- PixelWrite(uae_mem2, bits, fgpen, Bpp, Mask);
+ PixelWrite (uae_mem2, bits, fgpen, Bpp, Mask);
}
break;
}
byte <<= 1;
if (inversion)
bit_set = !bit_set;
- PixelWrite(uae_mem2, bits, bit_set ? fgpen : bgpen, Bpp, Mask);
+ PixelWrite (uae_mem2, bits, bit_set ? fgpen : bgpen, Bpp, Mask);
}
break;
}
{
static int p96hsync;
-#ifdef RETROPLATFORM
- rp_hsync ();
-#endif
if (currprefs.gfxmem_size == 0)
return;
if (WIN32GFX_IsPicassoScreen () && currprefs.gfx_pfullscreen && currprefs.gfx_pvsync) {
if (p96hsync <= 0) {
if (uae_boot_rom) {
int off = get_long (rtarea_base + 36) + 12 - 1;
- rtarea[off]++;
+ if (off >= 0 && off < 0x10000)
+ rtarea[off]++;
}
p96hsync = p96syncrate;
}
unsigned long rows, bitoffset = srcx & 7;
long eol_offset;
- /* if (mask != 0xFF)
- write_log ("P2C - pixel-width = %d, bit-offset = %d\n", width, bitoffset); */
-
/* Set up our bm->Planes[] pointers to the right horizontal offset */
for (j = 0; j < Depth; j++) {
uae_u8 *p = bm->Planes[j];
image2 += 2;
break;
case 3:
- do_put_mem_byte (image2++, (uae_u8)cim->Colors[v] );
- do_put_mem_word ((uae_u16 *)image2, (uae_u16)((cim->Colors[v] & 0x00FFFF00) >> 8));
- image2 += 2;
+ image2[0] = cim->Colors[v] >> 0;
+ image2[1] = cim->Colors[v] >> 8;
+ image2[2] = cim->Colors[v] >> 16;
+ image2 += 3;
break;
case 4:
((uae_u32 *)image2)[0] = cim->Colors[v];
return result;
}
+STATIC_INLINE void copyrow (uae_u8 *src, uae_u8 *dst, int x, int y, int width)
+{
+ uae_u8 *src2 = src + y * picasso96_state.BytesPerRow;
+ uae_u8 *dst2 = dst + y * picasso_vidinfo.rowbytes;
+ int endx = x + width;
+ int dstpix = picasso_vidinfo.pixbytes;
+ int srcpix = picasso96_state.BytesPerPixel;
+
+ if (picasso96_state.RGBFormat == host_mode) {
+ memcpy (dst2 + x * dstpix, src2 + x * srcpix, width * dstpix);
+ return;
+ }
+
+ switch (picasso_convert)
+ {
+ case RGBFB_B8G8R8A8_32:
+ case RGBFB_B5G6R5PC_16:
+ case RGBFB_R5G6B5PC_16:
+ case RGBFB_CLUT_8:
+ memcpy (dst2 + x * dstpix, src2 + x * srcpix, width * dstpix);
+ break;
+
+ case RGBFB_R8G8B8_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = (src2[x * 3 + 0] << 16) | (src2[x * 3 + 1] << 8) | (src2[x * 3 + 2] << 0);
+ x++;
+ }
+ break;
+ case RGBFB_B8G8R8_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = ((uae_u32*)(src2 + x * 3))[0] & 0x00ffffff;
+ x++;
+ }
+ break;
+ case RGBFB_R8G8B8A8_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = (src2[x * 4 + 0] << 16) | (src2[x * 4 + 1] << 8) | (src2[x * 4 + 2] << 0);
+ x++;
+ }
+ break;
+ case RGBFB_A8R8G8B8_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = (src2[x * 4 + 1] << 16) | (src2[x * 4 + 2] << 8) | (src2[x * 4 + 3] << 0);
+ x++;
+ }
+ break;
+ case RGBFB_A8B8G8R8_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = ((uae_u32*)src2)[0] << 8;
+ x++;
+ }
+ break;
+
+ case RGBFB_R5G6B5PC_32:
+ case RGBFB_R5G5B5PC_32:
+ case RGBFB_R5G6B5_32:
+ case RGBFB_R5G5B5_32:
+ case RGBFB_B5G6R5PC_32:
+ case RGBFB_B5G5R5PC_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ }
+ break;
+
+ case RGBFB_R5G5B5PC_16:
+ case RGBFB_R5G6B5_16:
+ case RGBFB_R5G5B5_16:
+ case RGBFB_B5G5R5PC_16:
+ while (x < endx) {
+ ((uae_u16*)dst2)[x] = (uae_u16)p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = (uae_u16)p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = (uae_u16)p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = (uae_u16)p96_rgbx16[((uae_u16*)src2)[x]];
+ x++;
+ }
+ break;
+
+ case RGBFB_R8G8B8_16:
+ break;
+ case RGBFB_B8G8R8_16:
+ break;
+ case RGBFB_R8G8B8A8_16:
+ break;
+ case RGBFB_A8R8G8B8_16:
+ break;
+ case RGBFB_A8B8G8R8_16:
+ break;
+
+ case RGBFB_B8G8R8A8_16:
+ while (x < endx) {
+ uae_u32 v;
+ v = ((uae_u32*)src2)[x];
+ ((uae_u16*)dst2)[x] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
+ x++;
+ }
+ break;
+
+ case RGBFB_CLUT_RGBFB_32:
+ while (x < endx) {
+ ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ }
+ break;
+ case RGBFB_CLUT_RGBFB_16:
+ while (x < endx) {
+ ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
+ x++;
+ }
+ break;
+ }
+}
+
+static void copyall (uae_u8 *src, uae_u8 *dst)
+{
+ int y;
+
+ if (picasso96_state.RGBFormat == host_mode) {
+ int w = picasso96_state.Width * picasso_vidinfo.pixbytes;
+ for (y = 0; y < picasso96_state.Height; y++) {
+ memcpy (dst, src, w);
+ dst += picasso_vidinfo.rowbytes;
+ src += picasso96_state.BytesPerRow;
+ }
+ } else {
+ for (y = 0; y < picasso96_state.Height; y++)
+ copyrow (src, dst, 0, y, picasso96_state.Width);
+ }
+}
+
static void flushpixels (void)
{
int i;
- int rowwidth_dst = picasso_vidinfo.width * picasso_vidinfo.pixbytes;
int rowwidth_src = picasso96_state.Width * picasso96_state.BytesPerPixel;
uae_u8 *src = p96ram_start + natmem_offset;
int off = picasso96_state.XYOffset - gfxmem_start;
uae_u8 *dst = NULL;
ULONG_PTR gwwcnt;
+
if (!picasso_vidinfo.extra_mem || !gwwbuf || src_start >= src_end)
return;
palette_changed = -1;
for (;;) {
+ int dofull;
gwwcnt = 0;
} else {
ULONG ps;
gwwcnt = gwwbufsize;
- if (mman_GetWriteWatch (src, allocated_gfxmem, gwwbuf, &gwwcnt, &ps))
+ if (mman_GetWriteWatch (src_start, src_end - src_start, gwwbuf, &gwwcnt, &ps))
break;
}
if (gwwcnt == 0)
break;
+ dofull = gwwcnt >= ((src_end - src_start) / gwwpagesize) * 80 / 100;
+
+#if P96DX > 0
+ if (p96surface && dofull && picasso_vidinfo.pixbytes == picasso96_state.BytesPerPixel) {
+ flushpixels_surface (gwwbuf, gwwcnt, src_start, src_end);
+ return;
+ }
+#endif
+
if (dst == NULL) {
if (DirectDraw_IsLocked() == FALSE) {
if (!lock)
if (doskip () && p96skipmode == 2)
break;
+ if (dofull) {
+ copyall (src + off, dst);
+ miny = 0;
+ maxy = picasso96_state.Height;
+ break;
+ }
+
for (i = 0; i < gwwcnt; i++) {
- int pscnt = gwwpagesize;
uae_u8 *p = gwwbuf[i];
if (p >= src_start && p < src_end) {
- int y, yend, realoffset;
- uae_u8 *src2, *dst2;
+ int y, x, realoffset;
if (p >= src + off) {
realoffset = p - (src + off);
}
y = realoffset / picasso96_state.BytesPerRow;
- src2 = src + y * picasso96_state.BytesPerRow + off;
- dst2 = dst + y * picasso_vidinfo.rowbytes;
-
- /* merge nearby pieces */
- while (i + 1 < gwwcnt && (uae_u8*)gwwbuf[i + 1] <= p + 1 * gwwpagesize) {
- pscnt += gwwpagesize;
- p += gwwpagesize;
- i++;
- }
-
- yend = (realoffset + pscnt + picasso96_state.BytesPerRow - 1) / picasso96_state.BytesPerRow;
- if (yend >= picasso96_state.Height)
- yend = picasso96_state.Height - 1;
-
- if (yend > maxy)
- maxy = yend;
- if (y < miny)
- miny = y;
-
- if (picasso_vidinfo.pixbytes == picasso96_state.BytesPerPixel) {
- while (y <= yend) {
- memcpy (dst2, src2, rowwidth_dst);
- src2 += picasso96_state.BytesPerRow;
- dst2 += picasso_vidinfo.rowbytes;
- y++;
- }
- } else if (picasso_vidinfo.pixbytes == 4 && picasso96_state.BytesPerPixel == 2) { /* 16->32 */
- int x;
- while (y <= yend) {
- for (x = 0; x < picasso96_state.Width;) {
- ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
- x++;
- ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
- x++;
- ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
- x++;
- ((uae_u32*)dst2)[x] = p96_rgbx16[((uae_u16*)src2)[x]];
- x++;
- }
- src2 += picasso96_state.BytesPerRow;
- dst2 += picasso_vidinfo.rowbytes;
- y++;
- }
- } else if (picasso_vidinfo.pixbytes == 4 && picasso96_state.BytesPerPixel == 1) { /* 8->32 */
- int x;
- while (y <= yend) {
- for (x = 0; x < picasso96_state.Width;) {
- ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u32*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- }
- src2 += picasso96_state.BytesPerRow;
- dst2 += picasso_vidinfo.rowbytes;
- y++;
- }
- } else if (picasso_vidinfo.pixbytes == 2 && picasso96_state.BytesPerPixel == 4) { /* 32->16 */
- int x;
- while (y <= yend) {
- for (x = 0; x < picasso96_state.Width;) {
- uae_u32 v;
- v = ((uae_u32*)src2)[x];
- ((uae_u16*)dst2)[x] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
- x++;
- v = ((uae_u32*)src2)[x];
- ((uae_u16*)dst2)[x] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
- x++;
- v = ((uae_u32*)src2)[x];
- ((uae_u16*)dst2)[x] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
- x++;
- v = ((uae_u32*)src2)[x];
- ((uae_u16*)dst2)[x] = p96_rgbx16[(((v >> (16 + 3)) & 0x1f) << 11) | (((v >> (8 + 2)) & 0x3f) << 5) | (((v >> (0 + 3)) & 0x1f) << 0)];
- x++;
- }
- src2 += picasso96_state.BytesPerRow;
- dst2 += picasso_vidinfo.rowbytes;
- y++;
- }
- } else if (picasso_vidinfo.pixbytes == 2 && picasso96_state.BytesPerPixel == 1) { /* 8->16 */
- int x;
- while (y <= yend) {
- for (x = 0; x < picasso96_state.Width;) {
- ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- ((uae_u16*)dst2)[x] = picasso_vidinfo.clut[src2[x]];
- x++;
- }
- src2 += picasso96_state.BytesPerRow;
- dst2 += picasso_vidinfo.rowbytes;
+ if (y < picasso96_state.Height) {
+ int w = gwwpagesize / picasso96_state.BytesPerPixel;
+ x = (realoffset % picasso96_state.BytesPerRow) / picasso96_state.BytesPerPixel;
+ if (x < picasso96_state.Width)
+ copyrow (src + off, dst, x, y, picasso96_state.Width - x);
+ w = (gwwpagesize - (picasso96_state.BytesPerRow - x * picasso96_state.BytesPerPixel)) / picasso96_state.BytesPerPixel;
+ if (y < miny)
+ miny = y;
+ y++;
+ while (y < picasso96_state.Height && w > 0) {
+ int maxw = w > picasso96_state.Width ? picasso96_state.Width : w;
+ copyrow (src + off, dst, 0, y, maxw);
+ w -= maxw;
y++;
}
+ if (y > maxy)
+ maxy = y;
}
+
}
}
if (doskip () && p96skipmode == 4) {
;
} else {
- DX_Invalidate (0, miny, picasso96_state.Width, maxy - miny + 1);
+ DX_Invalidate (0, miny, picasso96_state.Width, maxy - miny);
}
}
}
dl (0xfffffffe);
dw (RTS);
+ /* CalculateBytesPerRow (optimized) */
+ put_long (ABI + PSSO_BoardInfo_CalculateBytesPerRow, here ());
+ dl (0x0c400140); // cmp.w #320,d0
+ dw (0x6504); // bcs.s .l1
+ calltrap (deftrap (picasso_CalculateBytesPerRow));
+ dw (RTS);
+ dw (0x0c87); dl (0x00000010); // l1: cmp.l #10,d7
+ dw (0x640a); // bcc.s .l2
+ dw (0x7200); // moveq #0,d1
+ dl (0x123b7010); // move.b table(pc,d7.w),d1
+ dw (0x6b04); // bmi.s l3
+ dw (0xe368); // lsl.w d1,d0
+ dw (RTS); // .l2
+ dw (0x3200); // .l3 move.w d0,d1
+ dw (0xd041); // add.w d1,d0
+ dw (0xd041); // add.w d1,d0
+ dw (RTS);
+ dl (0x0000ffff); // table
+ dl (0x01010202);
+ dl (0x02020101);
+ dl (0x01010100);
+
RTGNONE(ABI, PSSO_BoardInfo_SetClock);
RTGNONE(ABI, PSSO_BoardInfo_SetMemoryMode);
RTGNONE(ABI, PSSO_BoardInfo_SetWriteMask);
RTGCALL2(ABI, PSSO_BoardInfo_SetDAC, picasso_SetDAC);
RTGCALL2(ABI, PSSO_BoardInfo_SetGC, picasso_SetGC);
RTGCALL2(ABI, PSSO_BoardInfo_SetPanning, picasso_SetPanning);
- RTGCALL2(ABI, PSSO_BoardInfo_CalculateBytesPerRow, picasso_CalculateBytesPerRow);
RTGCALL2(ABI, PSSO_BoardInfo_SetDisplay, picasso_SetDisplay);
RTGCALL2(ABI, PSSO_BoardInfo_SetSprite, picasso_SetSprite);
m68k_dreg (&ctx->regs, 1) = 0;
uaegfx_base = CallLib (ctx, exec, -0x54); /* MakeLibrary */
m68k_areg (&ctx->regs, 2) = a2;
- if (uaegfx_base) {
- m68k_areg (&ctx->regs, 1) = uaegfx_base;
- CallLib (ctx, exec, -0x18c); /* AddLibrary */
- }
+ if (!uaegfx_base)
+ return 0;
+ m68k_areg (&ctx->regs, 1) = uaegfx_base;
+ CallLib (ctx, exec, -0x18c); /* AddLibrary */
m68k_areg (&ctx->regs, 1) = EXPANSION_explibname;
m68k_dreg (&ctx->regs, 0) = 0;
put_long (uaegfx_base + CARD_EXPANSIONBASE, CallLib (ctx, exec, -0x228)); /* OpenLibrary */
*/
typedef enum {
PCT_Unknown,
- PCT_S11483, // Sierra S11483: HiColor 15 bit, oMniBus, Domino
- PCT_S15025, // Sierra S15025: TrueColor 32 bit, oMniBus
+ 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_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
#define IDC_DBG_MEM2 1782
#define IDC_DBG_MEMINPUT2 1783
#define IDC_DBG_ADDRINPUTTXT 1784
+#define IDC_RTG_SCALE 1785
+#define IDC_RTG_MATCH_DEPTH 1786
+#define IDC_RTG_8BIT 1787
+#define IDC_RTG_16BIT 1788
+#define IDC_RTG_24BIT 1789
+#define IDC_RTG_32BIT 1790
+#define IDC_DD_SURFACETYPE 1791
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
-#define _APS_NEXT_RESOURCE_VALUE 335
+#define _APS_NEXT_RESOURCE_VALUE 336
#define _APS_NEXT_COMMAND_VALUE 40045
-#define _APS_NEXT_CONTROL_VALUE 1785
+#define _APS_NEXT_CONTROL_VALUE 1788
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
#define IDC_DBG_MEM2 1782
#define IDC_DBG_MEMINPUT2 1783
#define IDC_DBG_ADDRINPUTTXT 1784
+#define IDC_RTG_SCALE 1785
+#define IDC_RTG_MATCH_DEPTH 1786
+#define IDC_RTG_8BIT 1787
+#define IDC_RTG_16BIT 1788
+#define IDC_RTG_24BIT 1789
+#define IDC_RTG_32BIT 1790
+#define IDC_DD_SURFACETYPE 1791
#define ID__FLOPPYDRIVES 40004
#define ID_FLOPPYDRIVES_DF0 40005
#define ID_ST_CONFIGURATION 40010
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 336
#define _APS_NEXT_COMMAND_VALUE 40045
-#define _APS_NEXT_CONTROL_VALUE 1785
+#define _APS_NEXT_CONTROL_VALUE 1788
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
COMBOBOX IDC_LORES,100,140,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
END\r
\r
-IDD_MEMORY DIALOGEX 0, 0, 300, 175\r
+IDD_MEMORY DIALOGEX 0, 0, 300, 239\r
STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD\r
EXSTYLE WS_EX_CONTEXTHELP\r
FONT 8, "MS Sans Serif", 0, 0, 0x1\r
BEGIN\r
- GROUPBOX "Memory Settings",-1,14,7,274,91\r
+ GROUPBOX "Memory Settings",-1,14,7,274,69\r
RTEXT "Chip:",-1,24,26,20,10,SS_CENTERIMAGE\r
CONTROL "Slider1",IDC_CHIPMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,54,22,50,20\r
EDITTEXT IDC_CHIPRAM,105,25,30,12,ES_CENTER | ES_READONLY\r
RTEXT "Z3 Fast:",IDC_Z3TEXT,139,51,30,10,SS_CENTERIMAGE\r
CONTROL "Slider1",IDC_Z3FASTMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,47,60,20\r
EDITTEXT IDC_Z3FASTRAM,243,50,30,12,ES_CENTER | ES_READONLY\r
- RTEXT "RTG: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,136,76,33,10,SS_NOTIFY | SS_CENTERIMAGE\r
- CONTROL "Slider1",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,72,60,20\r
- EDITTEXT IDC_P96RAM,243,75,30,12,ES_CENTER | ES_READONLY\r
- GROUPBOX "Advanced Memory Settings",-1,13,104,275,65\r
- RTEXT "Motherboard RAM (Low area):",-1,39,123,129,10,SS_CENTERIMAGE\r
- CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,119,59,20\r
- EDITTEXT IDC_MBRAM1,243,122,30,12,ES_CENTER | ES_READONLY\r
- RTEXT "Motherboard RAM (High area):",-1,39,148,129,10,SS_CENTERIMAGE\r
- CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,144,59,20\r
- EDITTEXT IDC_MBRAM2,243,147,30,12,ES_CENTER | ES_READONLY\r
+ RTEXT "Memory: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,25,98,53,10,SS_NOTIFY | SS_CENTERIMAGE\r
+ CONTROL "Slider1",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,94,60,20\r
+ EDITTEXT IDC_P96RAM,152,97,30,12,ES_CENTER | ES_READONLY\r
+ GROUPBOX "Advanced Memory Settings",-1,13,171,275,65\r
+ RTEXT "Motherboard RAM (Low area):",-1,39,190,129,10,SS_CENTERIMAGE\r
+ CONTROL "",IDC_MBMEM1,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,186,59,20\r
+ EDITTEXT IDC_MBRAM1,243,189,30,12,ES_CENTER | ES_READONLY\r
+ RTEXT "Motherboard RAM (High area):",-1,39,215,129,10,SS_CENTERIMAGE\r
+ CONTROL "",IDC_MBMEM2,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,180,211,59,20\r
+ EDITTEXT IDC_MBRAM2,243,214,30,12,ES_CENTER | ES_READONLY\r
+ GROUPBOX "RTG Graphics Card Settings",-1,14,81,275,87\r
+ CONTROL "Scale instead of switching resolution",IDC_RTG_SCALE,\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,134,162,10\r
+ CONTROL "Match host and RTG color depth if possible",IDC_RTG_MATCH_DEPTH,\r
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,119,163,10\r
+ COMBOBOX IDC_RTG_8BIT,211,101,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_RTG_16BIT,211,117,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_RTG_24BIT,211,133,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ COMBOBOX IDC_RTG_32BIT,211,149,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
END\r
\r
IDD_CPU DIALOGEX 0, 0, 300, 226\r
CONTROL "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,66,117,10\r
CONTROL "bsdsocket.library emulation",IDC_SOCKETS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,15,120,10\r
CONTROL "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,27,120,10\r
- CONTROL "RTG color depth matching [] Do not use color space conversion if possible.",IDC_RTGMATCHDEPTH,\r
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,40,120,10\r
- CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,53,115,10\r
+ CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,40,115,10\r
GROUPBOX "Keyboard LEDs",IDC_STATIC,7,140,85,94\r
COMBOBOX IDC_KBLED1,22,154,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
COMBOBOX IDC_KBLED2,22,173,56,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
RTEXT "Recording buffer (MB):",IDC_STATIC,160,219,83,10,SS_CENTERIMAGE | WS_TABSTOP\r
COMBOBOX IDC_STATE_BUFFERSIZE,248,217,38,65,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP\r
CONTROL "Always on top",IDC_ALWAYSONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,79,117,10\r
- CONTROL "Catweasel",IDC_CATWEASEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,66,115,10\r
+ CONTROL "Catweasel",IDC_CATWEASEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,53,115,10\r
CONTROL "USB mode",IDC_KBLED_USB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,216,64,10\r
COMBOBOX IDC_SCSIMODE,92,51,64,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
COMBOBOX IDC_LANGUAGE,103,121,179,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP\r
GROUPBOX "Language",IDC_STATIC,7,113,285,25\r
CONTROL "Disable powersaving features",IDC_POWERSAVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,92,120,10\r
- CONTROL "Magic Mouse",IDC_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,79,119,10\r
- CONTROL "uaenet.device",IDC_SANA2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,92,94,10\r
+ CONTROL "Magic Mouse",IDC_MOUSETRICK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,66,119,10\r
+ CONTROL "uaenet.device",IDC_SANA2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,161,79,94,10\r
+ COMBOBOX IDC_DD_SURFACETYPE,217,93,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP\r
+ RTEXT "Display buffer:",IDC_STATIC,159,94,52,10,SS_CENTERIMAGE\r
END\r
\r
IDD_HARDFILE DIALOGEX 0, 0, 299, 249\r
static int hwndset;
static int minimized;
static DWORD hd_mask, cd_mask;
+static int mousecapture, mousemagic;
static int recursive_device;
+static void outhex (const uae_u8 *s)
+{
+ for (;;) {
+ write_log ("%02X%02X ", s[0], s[1]);
+ if (s[0] == 0 && s[1] == 0)
+ break;
+ s += 2;
+ }
+ write_log ("\n");
+}
static char *ua (const WCHAR *s)
{
case RPIPCHM_MOUSECAPTURE: return "RPIPCHM_MOUSECAPTURE";
case RPIPCHM_DEVICECONTENT: return "RPIPCHM_DEVICECONTENT";
case RPIPCHM_PING: return "RPIPCHM_PING";
+ case RPIPCHM_SCREENCLIP: return "RPIPCHM_SCREENCLIP";
default: return "UNKNOWN";
}
static int port_insert (int num, const char *name)
{
char tmp1[100], tmp2[200];
- int i;
+ int i, type;
if (num < 0 || num > 1)
return FALSE;
}
if (strlen (name) >= sizeof (tmp2) - 1)
return FALSE;
+ type = 1;
strcpy (tmp2, name);
for (i = 1; i <= 4; i++) {
sprintf (tmp1, "Mouse%d", i);
- if (!strcmp (name, tmp1))
+ if (!strcmp (name, tmp1)) {
sprintf (tmp2, "mouse%d", i - 1);
+ type = 0;
+ break;
+ }
sprintf (tmp1, "Joystick%d", i);
- if (!strcmp (name, tmp1))
+ if (!strcmp (name, tmp1)) {
sprintf (tmp2, "joy%d", i - 1);
+ type = 0;
+ break;
+ }
sprintf (tmp1, "KeyboardLayout%d", i);
- if (!strcmp (name, tmp1))
+ if (!strcmp (name, tmp1)) {
sprintf (tmp2, "kbd%d", i);
+ type = 0;
+ break;
+ }
}
- inputdevice_joyport_config (&changed_prefs, tmp2, num, 1);
+ inputdevice_joyport_config (&changed_prefs, tmp2, num, type);
return TRUE;
}
-BOOL RPSendMessagex(UINT uMessage, WPARAM wParam, LPARAM lParam,
+static BOOL RPSendMessagex (UINT uMessage, WPARAM wParam, LPARAM lParam,
LPCVOID pData, DWORD dwDataSize, const RPGUESTINFO *pInfo, LRESULT *plResult)
{
BOOL v;
{
int res = currprefs.gfx_resolution;
- if (currprefs.gfx_afullscreen)
- return RP_SCREENMODE_FULLSCREEN;
- if (res == 0)
- return RP_SCREENMODE_1X;
- if (res == 1)
- return RP_SCREENMODE_2X;
- return RP_SCREENMODE_4X;
+ if (WIN32GFX_IsPicassoScreen ()) {
+ return currprefs.gfx_pfullscreen ? RP_SCREENMODE_FULLSCREEN : RP_SCREENMODE_1X;
+ } else {
+ if (currprefs.gfx_afullscreen)
+ return RP_SCREENMODE_FULLSCREEN;
+ if (res == 0)
+ return RP_SCREENMODE_1X;
+ if (res == 1)
+ return RP_SCREENMODE_2X;
+ return RP_SCREENMODE_4X;
+ }
}
static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM lParam,
uae_reset (wParam == RP_RESET_SOFT ? 0 : -1);
return TRUE;
case RPIPCHM_TURBO:
- warpmode (lParam);
+ {
+ if (wParam & RP_TURBO_CPU)
+ warpmode ((lParam & RP_TURBO_CPU) ? 1 : 0);
+ if (wParam & RP_TURBO_FLOPPY)
+ changed_prefs.floppy_speed = (lParam & RP_TURBO_FLOPPY) ? 0 : 100;
+ }
return TRUE;
case RPIPCHM_PAUSE:
pausemode (wParam ? 1 : 0);
return TRUE;
case RPIPCHM_VOLUME:
- currprefs.sound_volume = changed_prefs.sound_volume = wParam;
+ currprefs.sound_volume = changed_prefs.sound_volume = 100 - wParam;
set_volume (currprefs.sound_volume, 0);
return TRUE;
case RPIPCHM_ESCAPEKEY:
rp_rpescapeholdtime = lParam;
return TRUE;
case RPIPCHM_MOUSECAPTURE:
- if (wParam)
- setmouseactive (1);
+ {
+ if (wParam & RP_MOUSECAPTURE_CAPTURED)
+ setmouseactive (1);
else
setmouseactive (0);
+ }
return TRUE;
#if 0
case RPIPCHM_MINIMIZE:
{
int res = (BYTE)wParam;
minimized = 0;
- changed_prefs.gfx_afullscreen = 0;
- if (res >= RP_SCREENMODE_FULLSCREEN) {
- res = 1;
- changed_prefs.gfx_afullscreen = 1;
+ if (WIN32GFX_IsPicassoScreen ()) {
+ changed_prefs.gfx_pfullscreen = res >= RP_SCREENMODE_FULLSCREEN ? 1 : 0;
+ } else {
+ changed_prefs.gfx_afullscreen = 0;
+ if (res >= RP_SCREENMODE_FULLSCREEN) {
+ res = 1;
+ changed_prefs.gfx_afullscreen = 1;
+ }
+ changed_prefs.gfx_resolution = res;
+ if (res == 0)
+ changed_prefs.gfx_linedbl = 0;
+ else
+ changed_prefs.gfx_linedbl = 1;
+ res = 1 << res;
+ changed_prefs.gfx_size_win.width = default_width * res;
+ changed_prefs.gfx_size_win.height = default_height * res;
}
- changed_prefs.gfx_resolution = res;
- if (res == 0)
- changed_prefs.gfx_linedbl = 0;
- else
- changed_prefs.gfx_linedbl = 1;
- res = 1 << res;
- changed_prefs.gfx_size_win.width = default_width * res;
- changed_prefs.gfx_size_win.height = default_height * res;
updatewinfsmode (&changed_prefs);
- WIN32GFX_DisplayChangeRequested();
+ WIN32GFX_DisplayChangeRequested ();
hwndset = 0;
return (LRESULT)INVALID_HANDLE_VALUE;
}
xfree (s);
return ok ? TRUE : FALSE;
}
-
+ case RPIPCHM_SCREENCLIP:
+ {
+ RPSCREENCLIP *sc = (RPSCREENCLIP*)pData;
+
+ if (sc->lLeft < 0 || sc->lTop < 0) {
+ changed_prefs.gfx_xcenter_pos = -1;
+ changed_prefs.gfx_ycenter_pos = -1;
+ } else {
+ changed_prefs.gfx_xcenter_pos = sc->lLeft;
+ changed_prefs.gfx_ycenter_pos = sc->lTop;
+ }
+ if (sc->lWidth <= 0) {
+ changed_prefs.gfx_size_win.width = default_width;
+ } else {
+ changed_prefs.gfx_size_win.width = sc->lWidth << (RES_MAX - currprefs.gfx_resolution);
+ }
+ if (sc->lHeight <= 0) {
+ changed_prefs.gfx_size_win.height = default_height;
+ } else {
+ changed_prefs.gfx_size_win.height = sc->lHeight << (currprefs.gfx_linedbl ? 0 : 1);
+ }
+ fixup_prefs_dimensions (&changed_prefs);
+ }
+ return TRUE;
}
return FALSE;
}
}
xfree (rp_param);
rp_param = NULL;
+ mousecapture = 0;
return hr;
}
if (!initialized)
return;
initialized = 0;
- RPSendMessagex(RPIPCGM_CLOSED, 0, 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_CLOSED, 0, 0, NULL, 0, &guestinfo, NULL);
RPUninitializeGuest (&guestinfo);
}
LRESULT lr;
if (!initialized)
return 0;
- RPSendMessagex(RPIPCGM_PARENT, 0, 0, NULL, 0, &guestinfo, &lr);
+ RPSendMessagex (RPIPCGM_PARENT, 0, 0, NULL, 0, &guestinfo, &lr);
return (HWND)lr;
}
-void rp_fixup_options (struct uae_prefs *p)
+static void sendfeatures (void)
{
DWORD feat;
+
+ feat = RP_FEATURE_POWERLED | RP_FEATURE_SCREEN1X | RP_FEATURE_FULLSCREEN;
+ feat |= RP_FEATURE_PAUSE | RP_FEATURE_TURBO | RP_FEATURE_VOLUME | RP_FEATURE_SCREENCAPTURE;
+ if (!WIN32GFX_IsPicassoScreen ())
+ feat |= RP_FEATURE_SCREEN2X;
+ RPSendMessagex (RPIPCGM_FEATURES, feat, 0, NULL, 0, &guestinfo, NULL);
+}
+
+void rp_fixup_options (struct uae_prefs *p)
+{
int i, v;
int res;
int p96;
else
p->gfx_linedbl = 1;
- feat = RP_FEATURE_POWERLED | RP_FEATURE_SCREEN1X | RP_FEATURE_FULLSCREEN;
- feat |= RP_FEATURE_PAUSE | RP_FEATURE_TURBO | RP_FEATURE_VOLUME | RP_FEATURE_SCREENCAPTURE;
- if (!p96)
- feat |= RP_FEATURE_SCREEN2X;
- RPSendMessagex(RPIPCGM_FEATURES, feat, 0, NULL, 0, &guestinfo, NULL);
+ sendfeatures ();
/* floppy drives */
v = 0;
if (p->dfxtype[i] >= 0)
v |= 1 << i;
}
- RPSendMessagex(RPIPCGM_DEVICES, RP_DEVICE_FLOPPY, v, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_FLOPPY, v, NULL, 0, &guestinfo, NULL);
- RPSendMessagex(RPIPCGM_DEVICES, RP_DEVICE_INPUTPORT, 3, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_INPUTPORT, 3, NULL, 0, &guestinfo, NULL);
cd_mask = 0;
for (i = 0; i < currprefs.mountitems; i++) {
hd_mask |= 1 << (uci->controller - HD_CONTROLLER_SCSI0);
}
}
- RPSendMessagex(RPIPCGM_DEVICES, RP_DEVICE_HD, hd_mask, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_HD, hd_mask, NULL, 0, &guestinfo, NULL);
}
static void rp_device_change (int dev, int num, const char *name)
cd_mask &= ~(1 << num);
else
cd_mask |= 1 << num;
- RPSendMessagex(RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
}
void rp_update_leds (int led, int onoff)
switch (led)
{
case 0:
- RPSendMessage(RPIPCGM_POWERLED, onoff ? 100 : 0, 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessage (RPIPCGM_POWERLED, onoff ? 100 : 0, 0, NULL, 0, &guestinfo, NULL);
break;
case 1:
case 2:
case 3:
case 4:
- RPSendMessage(RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_FLOPPY, led - 1), onoff ? -1 : 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessage (RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_FLOPPY, led - 1), onoff ? -1 : 0, NULL, 0, &guestinfo, NULL);
break;
}
}
if (num < 0)
return;
if (onoff)
- RPSendMessage(RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_HD, num), 200, NULL, 0, &guestinfo, NULL);
+ RPSendMessage (RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_HD, num), 200, NULL, 0, &guestinfo, NULL);
}
void rp_cd_activity (int num, int onoff)
return;
if ((cd_mask & (1 << num)) != ((onoff ? 1 : 0) << num)) {
cd_mask ^= 1 << num;
- RPSendMessagex(RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL);
}
if (onoff) {
- RPSendMessage(RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_CD, num), 200, NULL, 0, &guestinfo, NULL);
+ RPSendMessage (RPIPCGM_DEVICEACTIVITY, MAKEWORD (RP_DEVICE_CD, num), 200, NULL, 0, &guestinfo, NULL);
}
}
-
void rp_update_status (struct uae_prefs *p)
{
if (!initialized)
return;
- RPSendMessagex(RPIPCGM_VOLUME, (WPARAM)p->sound_volume, 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_VOLUME, (WPARAM)(100 - p->sound_volume), 0, NULL, 0, &guestinfo, NULL);
}
-void rp_mousecapture (int captured)
+static void rp_mouse (void)
{
- if (!winok())
+ int flags = 0;
+
+ if (!initialized)
return;
- RPSendMessagex(RPIPCGM_MOUSECAPTURE, captured, 0, NULL, 0, &guestinfo, NULL);
+ if (mousemagic)
+ flags |= RP_MOUSECAPTURE_MAGICMOUSE;
+ if (mousecapture)
+ flags |= RP_MOUSECAPTURE_CAPTURED;
+ RPSendMessagex (RPIPCGM_MOUSECAPTURE, flags, 0, NULL, 0, &guestinfo, NULL);
+}
+
+void rp_mouse_capture (int captured)
+{
+ mousecapture = captured;
+ rp_mouse ();
+}
+
+void rp_mouse_magic (int magic)
+{
+ mousemagic = magic;
+ rp_mouse ();
}
void rp_activate (int active, LPARAM lParam)
{
if (!initialized)
return;
- RPSendMessagex(active ? RPIPCGM_ACTIVATED : RPIPCGM_DEACTIVATED, 0, lParam, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (active ? RPIPCGM_ACTIVATED : RPIPCGM_DEACTIVATED, 0, lParam, NULL, 0, &guestinfo, NULL);
}
#if 0
{
if (!initialized)
return;
- RPSendMessagex(RPIPCGM_TURBO, RP_TURBO_CPU, active, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_TURBO, RP_TURBO_CPU, active, NULL, 0, &guestinfo, NULL);
}
void rp_set_hwnd (HWND hWnd)
return;
rx = get_x ();
hwndset = 1;
- RPSendMessagex(RPIPCGM_SCREENMODE, rx, (LPARAM)hWnd, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_SCREENMODE, rx, (LPARAM)hWnd, NULL, 0, &guestinfo, NULL);
}
-#if 0
-void rp_moved (int zorder)
+void rp_rtg_switch (void)
{
- if (!winok())
+ if (!initialized)
return;
- RPSendMessagex(zorder ? RPIPCGM_ZORDER : RPIPCGM_MOVED, 0, 0, NULL, 0, &guestinfo, NULL);
+ sendfeatures ();
}
-#endif
static uae_u64 esctime;
static int ignorerelease;
return li.QuadPart / 10000;
}
-void rp_hsync (void)
+void rp_vsync (void)
{
uae_u64 t;
- static int cnt;
if (!initialized)
return;
- cnt--;
- if (cnt > 0)
- return;
- cnt = 100;
+ if (magicmouse_alive () != mousemagic)
+ rp_mouse_magic (magicmouse_alive ());
if (!esctime)
return;
t = gett ();
if (t >= esctime) {
- RPSendMessagex(RPIPCGM_ESCAPED, 0, 0, NULL, 0, &guestinfo, NULL);
+ RPSendMessagex (RPIPCGM_ESCAPED, 0, 0, NULL, 0, &guestinfo, NULL);
ignorerelease = 1;
esctime = 0;
}
extern void rp_cd_activity (int, int);
extern void rp_cd_change (int, int);
extern void rp_activate (int, LPARAM);
-extern void rp_mousecapture (int);
+extern void rp_mouse_capture (int);
+extern void rp_mouse_magic (int);
extern void rp_turbo (int);
extern void rp_set_hwnd (HWND);
extern int rp_checkesc (int, uae_u8*, int, int);
extern int rp_isactive (void);
-extern void rp_hsync (void);
+extern void rp_vsync (void);
extern HWND rp_getparent (void);
+extern void rp_rtg_switch (void);
extern char *rp_param;
extern int rp_rpescapekey;
recursive++;
if (!screenshot_prepared || doprepare) {
- if (!screenshot_prepare())
+ if (!screenshot_prepare ())
goto oops;
}
struct shmid_ds {
key_t key;
size_t size;
- void *addr;
+ void *addr;
char name[MAX_PATH];
void *attached;
+ int mode;
+ void *natmembase;
};
int mprotect (void *addr, size_t len, int prot);
#define CPUEMU_12 /* cycle-exact cpu&blitter */
#define ACTION_REPLAY /* Action Replay 1/2/3 support */
#define PICASSO96 /* Picasso96 display card emulation */
+#define UAEGFX_INTERNAL /* built-in libs:picasso96/uaegfx.card */
#define BSDSOCKET /* bsdsocket.library emulation */
#define CAPS /* CAPS-image support */
#define FDI2RAW /* FDI 1.0 and 2.x image support */
checkpause ();
setmaintitle (hMainWnd);
#ifdef RETROPLATFORM
- rp_mousecapture (active);
+ rp_mouse_capture (active);
+ rp_mouse_magic (magicmouse_alive ());
#endif
}
inputdevicefunc_joystick.read ();
inputdevice_handle_inputcode ();
check_prefs_changed_gfx ();
+#ifdef RETROPLATFORM
+ rp_vsync ();
+#endif
while (checkIPC (&currprefs));
if (quit_program)
break;
extern char *get_aspi_path(int);
-static get_aspi(int old)
+static get_aspi (int old)
{
if ((old == UAESCSI_SPTI || old == UAESCSI_SPTISCAN) && os_winnt_admin)
return old;
p->win32_automount_cddrives = 0;
p->win32_automount_netdrives = 0;
p->win32_kbledmode = 0;
- p->win32_uaescsimode = get_aspi(p->win32_uaescsimode);
+ p->win32_uaescsimode = get_aspi (p->win32_uaescsimode);
p->win32_borderless = 0;
p->win32_powersavedisabled = 1;
p->win32_outsidemouse = 0;
p->win32_rtgscaleifsmall = 1;
}
if (type == 1 || type == 0) {
- p->win32_uaescsimode = get_aspi(p->win32_uaescsimode);
+ p->win32_uaescsimode = get_aspi (p->win32_uaescsimode);
p->win32_midioutdev = -2;
p->win32_midiindev = 0;
p->win32_automount_removable = 0;
p->win32_automount_drives = 0;
p->win32_automount_cddrives = 0;
p->win32_automount_netdrives = 0;
+ p->picasso96_modeflags = RGBFF_CLUT | RGBFF_R5G6B5PC | RGBFF_B8G8R8A8;
}
}
return result;
}
+static void createdir (const char *path)
+{
+ CreateDirectory (path, NULL);
+}
+
void fetch_saveimagepath (char *out, int size, int dir)
{
fetch_path ("SaveimagePath", out, size);
if (dir) {
out[strlen (out) - 1] = 0;
- CreateDirectory (out, NULL);
+ createdir (out);
fetch_path ("SaveimagePath", out, size);
}
}
if (regsetstr (NULL, "ROMCheckVersion", VersionStr))
forceroms = 1;
}
+ regqueryint (NULL, "directdraw_secondary", &ddforceram);
regqueryint (NULL, "QuickStartMode", &quickstart);
reopen_console();
fetch_path ("ConfigurationPath", path, sizeof (path));
path[strlen (path) - 1] = 0;
- CreateDirectory (path, NULL);
+ createdir (path);
strcat (path, "\\Host");
- CreateDirectory (path, NULL);
+ createdir (path);
fetch_path ("ConfigurationPath", path, sizeof (path));
strcat (path, "Hardware");
- CreateDirectory (path, NULL);
+ createdir (path);
fetch_path ("StatefilePath", path, sizeof (path));
- CreateDirectory (path, NULL);
+ createdir (path);
strcat (path, "default.uss");
strcpy (savestate_fname, path);
fetch_path ("InputPath", path, sizeof (path));
- CreateDirectory (path, NULL);
+ createdir (path);
regclosetree (read_disk_history ());
read_rom_list ();
load_keyring(NULL, NULL);
strcat(tmp, "\\WinUAE");
if (remove) {
if (GetFileAttributes(tmp) != INVALID_FILE_ATTRIBUTES) {
- RemoveDirectory(tmp);
- RemoveDirectory(tmp2);
+ RemoveDirectory (tmp);
+ RemoveDirectory (tmp2);
}
} else {
- CreateDirectory(tmp2, NULL);
- CreateDirectory(tmp, NULL);
+ CreateDirectory (tmp2, NULL);
+ CreateDirectory (tmp, NULL);
}
}
}
#define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100)
#define GETBDD(x) ((x) % 100)
-#define WINUAEBETA 10
+#define WINUAEBETA 11
#define WINUAEPUBLICBETA 1
-#define WINUAEDATE MAKEBD(2008, 3, 23)
+#define WINUAEDATE MAKEBD(2008, 3, 30)
#define WINUAEEXTRA ""
#define WINUAEREV ""
uae_u32 default_freq = 0;
HWND hStatusWnd = NULL;
-uae_u16 picasso96_pixel_format = RGBFF_CHUNKY;
static uae_u8 scrlinebuf[4096 * 4]; /* this is too large, but let's rather play on the safe side here */
+static struct MultiDisplay *getdisplay (struct uae_prefs *p)
+{
+ int i;
+ int display = p->gfx_display;
+
+ i = 0;
+ while (Displays[i].name) {
+ struct MultiDisplay *md = &Displays[i];
+ if (p->gfx_display_name[0] && !strcmp (md->name, p->gfx_display_name))
+ return md;
+ if (p->gfx_display_name[0] && !strcmp (md->name2, p->gfx_display_name))
+ return md;
+ i++;
+ }
+ if (i == 0) {
+ gui_message ("no display adapters! Exiting");
+ exit (0);
+ }
+ if (display >= i)
+ display = 0;
+ return &Displays[display];
+}
+
void centerdstrect (RECT *dr)
{
if(!(currentmode->flags & (DM_DX_FULLSCREEN | DM_W_FULLSCREEN)))
RGBFTYPE colortype;
int i, j, ct, depth;
- colortype = DirectDraw_GetSurfacePixelFormat(modeDesc);
- if (colortype == RGBFB_NONE || colortype == RGBFB_R8G8B8 || colortype == RGBFB_B8G8R8 )
+ colortype = DirectDraw_GetSurfacePixelFormat (modeDesc);
+ if (colortype == RGBFB_NONE)
return DDENUMRET_OK;
- if (modeDesc->dwWidth > 2048 || modeDesc->dwHeight > 2048)
+ if (modeDesc->dwWidth > 2560 || modeDesc->dwHeight > 2048)
return DDENUMRET_OK;
ct = 1 << colortype;
depth = 0;
}
i++;
}
- picasso96_pixel_format |= ct;
i = 0;
while (DisplayModes[i].depth >= 0)
i++;
if (guid == 0) {
POINT pt = { 0, 0 };
md->primary = 1;
- GetMonitorInfo(MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&lpmi);
+ GetMonitorInfo (MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY), (LPMONITORINFO)&lpmi);
} else {
memcpy (&md->guid, guid, sizeof (GUID));
- GetMonitorInfo(hm, (LPMONITORINFO)&lpmi);
+ GetMonitorInfo (hm, (LPMONITORINFO)&lpmi);
}
md->rect = lpmi.rcMonitor;
if (md->rect.left == 0 && md->rect.top == 0)
else
sprintf (tmp, "%s (%d*%d) [%d*%d]", desc, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top, md->rect.left, md->rect.top);
md->name = my_strdup (tmp);
+ md->name2 = my_strdup (desc);
write_log ("'%s' '%s' %s\n", desc, name, outGUID(guid));
return 1;
}
} while (ret < 0);
setpriority(&priorities[currprefs.win32_active_priority]);
- setmouseactive (-1);
+ if (!rp_isactive ())
+ setmouseactive (-1);
for (i = 0; i < NUM_LEDS; i++)
gui_led (i, 0);
gui_fps (0, 0);
c |= currprefs.gfx_linedbl != changed_prefs.gfx_linedbl ? 2 : 0;
c |= currprefs.gfx_lores_mode != changed_prefs.gfx_lores_mode ? 1 : 0;
c |= currprefs.gfx_display != changed_prefs.gfx_display ? (2|4|8) : 0;
+ c |= strcmp (currprefs.gfx_display_name, changed_prefs.gfx_display_name) ? (2|4|8) : 0;
c |= currprefs.win32_alwaysontop != changed_prefs.win32_alwaysontop ? 1 : 0;
c |= currprefs.win32_borderless != changed_prefs.win32_borderless ? 1 : 0;
c |= currprefs.win32_rtgmatchdepth != changed_prefs.win32_rtgmatchdepth ? 2 : 0;
+ c |= currprefs.win32_rtgscaleifsmall != changed_prefs.win32_rtgscaleifsmall ? 2 : 0;
if (display_change_requested || c)
{
currprefs.gfx_resolution = changed_prefs.gfx_resolution;
currprefs.gfx_linedbl = changed_prefs.gfx_linedbl;
currprefs.gfx_display = changed_prefs.gfx_display;
+ strcpy (currprefs.gfx_display_name, changed_prefs.gfx_display_name);
currprefs.win32_alwaysontop = changed_prefs.win32_alwaysontop;
currprefs.win32_borderless = changed_prefs.win32_borderless;
currprefs.win32_rtgmatchdepth = changed_prefs.win32_rtgmatchdepth;
+ currprefs.win32_rtgscaleifsmall = changed_prefs.win32_rtgscaleifsmall;
inputdevice_unacquire ();
if (c & 16) {
AVIOutput_RGBinfo (red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift);
#endif
}
- alloc_colors_picasso (red_bits, green_bits, blue_bits, red_shift,green_shift, blue_shift, alpha_bits, alpha_shift, alpha, 0);
}
#ifdef PICASSO96
if (screen_is_picasso == on)
return;
screen_is_picasso = on;
+ rp_rtg_switch ();
memcpy (&wc, currentmode, sizeof (wc));
scalepicasso = 0;
} else {
mode = modeswitchneeded (&wc);
if (!mode)
- return;
+ goto end;
}
if (mode < 0) {
open_windows ();
} else {
open_screen (); // reopen everything
}
+end:
+#ifdef RETROPLATFORM
+ rp_set_hwnd (hAmigaWnd);
+#endif
}
void gfx_set_picasso_modeinfo (uae_u32 w, uae_u32 h, uae_u32 depth, RGBFTYPE rgbfmt)
{
+ alloc_colors_picasso (red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift, rgbfmt);
if (screen_is_picasso && modeswitchneeded(currentmode))
open_screen ();
}
}
if (fsw) {
- rc = Displays[currprefs.gfx_display].rect;
+ rc = getdisplay (&currprefs)->rect;
flags |= WS_EX_TOPMOST;
style = WS_POPUP;
currentmode->native_width = rc.right - rc.left;
}
#ifdef PICASSO96
- picasso_vidinfo.rowbytes = DirectDraw_GetSurfacePitch();
- picasso_vidinfo.pixbytes = DirectDraw_GetBytesPerPixel();
- picasso_vidinfo.rgbformat = DirectDraw_GetPixelFormat();
+ picasso_vidinfo.rowbytes = DirectDraw_GetSurfacePitch ();
+ picasso_vidinfo.pixbytes = DirectDraw_GetBytesPerPixel ();
+ picasso_vidinfo.rgbformat = DirectDraw_GetPixelFormat ();
picasso_vidinfo.extra_mem = 1;
picasso_vidinfo.height = currentmode->current_height;
picasso_vidinfo.width = currentmode->current_width;
void updatewinfsmode (struct uae_prefs *p)
{
- int i;
+ struct MultiDisplay *md;
fixup_prefs_dimensions (p);
if (p->gfx_afullscreen) {
p->gfx_size = p->gfx_size_win;
}
displayGUID = NULL;
- i = 0;
- while (Displays[i].name) i++;
- if (p->gfx_display >= i)
- p->gfx_display = 0;
- if (Displays[p->gfx_display].disabled)
+ md = getdisplay (p);
+ if (md->disabled) {
p->gfx_display = 0;
- if (i == 0) {
- gui_message ("no display adapters! Exiting");
- exit (0);
+ md = getdisplay (p);
}
- if (!Displays[p->gfx_display].primary)
- displayGUID = &Displays[p->gfx_display].guid;
+ if (!md->primary)
+ displayGUID = &md->guid;
if (isfullscreen () == 0)
displayGUID = NULL;
}
#define HtmlHelp(a,b,c,d) if(pHtmlHelp) (*pHtmlHelp)(a,b,c,(LPDWORD)d); else \
{ char szMessage[MAX_DPATH]; WIN32GUI_LoadUIString(IDS_NOHELP, szMessage, MAX_DPATH); gui_message(szMessage); }
-extern HWND hAmigaWnd;
extern char help_file[MAX_DPATH];
extern int mouseactive;
mm++;
}
+static int GetSettings (int all_options, HWND hwnd);
/* if drive is -1, show the full GUI, otherwise file-requester for DF[drive] */
void gui_display (int shortcut)
{
return;
here++;
gui_active++;
- screenshot_prepare();
+ screenshot_prepare ();
#ifdef D3D
D3D_guimode (TRUE);
#endif
- setpaused();
+ setpaused ();
inputdevice_unacquire ();
clearallkeys ();
setmouseactive (0);
{
int z3 = ! workprefs.address_space_24;
int fast = workprefs.chipmem_size <= 0x200000;
+ int rtg = workprefs.gfxmem_size && full_property_sheet;
#ifndef AUTOCONFIG
z3 = FALSE;
ew (hDlg, IDC_MBMEM1, z3);
ew (hDlg, IDC_MBRAM2, z3);
ew (hDlg, IDC_MBMEM2, z3);
+
+ ew (hDlg, IDC_RTG_8BIT, rtg);
+ ew (hDlg, IDC_RTG_16BIT, rtg);
+ ew (hDlg, IDC_RTG_24BIT, rtg);
+ ew (hDlg, IDC_RTG_32BIT, rtg);
+ ew (hDlg, IDC_RTG_MATCH_DEPTH, rtg);
+ ew (hDlg, IDC_RTG_SCALE, rtg);
}
static void values_to_memorydlg (HWND hDlg)
}
SendDlgItemMessage (hDlg, IDC_P96MEM, TBM_SETPOS, TRUE, mem_size);
SetDlgItemText (hDlg, IDC_P96RAM, memsize_names[msi_gfx[mem_size]]);
+ SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)"(8bit)");
+ SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)"8-bit (*)");
+ SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_SETCURSEL, (workprefs.picasso96_modeflags & RGBFF_CLUT) ? 1 : 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"(15/16bit)");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"R5G6B5PC (*)");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"R5G5B5PC");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"R5G6B5");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"R5G5B5");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"B5G6R5PC");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)"B5G5R5PC");
+ SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_SETCURSEL,
+ (workprefs.picasso96_modeflags & RGBFF_R5G6B5PC) ? 1 :
+ (workprefs.picasso96_modeflags & RGBFF_R5G5B5PC) ? 2 :
+ (workprefs.picasso96_modeflags & RGBFF_R5G6B5) ? 3 :
+ (workprefs.picasso96_modeflags & RGBFF_R5G5B5) ? 4 :
+ (workprefs.picasso96_modeflags & RGBFF_B5G6R5PC) ? 5 :
+ (workprefs.picasso96_modeflags & RGBFF_B5G5R5PC) ? 6 : 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)"(24bit)");
+ SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)"R8G8B8");
+ SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)"B8G8R8");
+ SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_SETCURSEL,
+ (workprefs.picasso96_modeflags & RGBFF_R8G8B8) ? 1 :
+ (workprefs.picasso96_modeflags & RGBFF_B8G8R8) ? 2 : 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)"(32bit)");
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)"A8R8G8B8");
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)"A8B8G8R8");
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)"R8G8B8A8");
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)"B8G8R8A8 (*)");
+ SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_SETCURSEL,
+ (workprefs.picasso96_modeflags & RGBFF_A8R8G8B8) ? 1 :
+ (workprefs.picasso96_modeflags & RGBFF_A8B8G8R8) ? 2 :
+ (workprefs.picasso96_modeflags & RGBFF_R8G8B8A8) ? 3 :
+ (workprefs.picasso96_modeflags & RGBFF_B8G8R8A8) ? 4 : 0, 0);
+ CheckDlgButton (hDlg, IDC_RTG_SCALE, workprefs.win32_rtgscaleifsmall);
+ CheckDlgButton (hDlg, IDC_RTG_MATCH_DEPTH, workprefs.win32_rtgmatchdepth);
mem_size = 0;
switch (workprefs.mbresmem_low_size) {
static INT_PTR CALLBACK MemoryDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ int v;
static int recursive = 0;
switch (msg)
{
- case WM_INITDIALOG:
- pages[MEMORY_ID] = hDlg;
- currentpage = MEMORY_ID;
+ case WM_INITDIALOG:
+ pages[MEMORY_ID] = hDlg;
+ currentpage = MEMORY_ID;
- SendDlgItemMessage (hDlg, IDC_CHIPMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_CHIP_MEM, MAX_CHIP_MEM));
- SendDlgItemMessage (hDlg, IDC_FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM));
- SendDlgItemMessage (hDlg, IDC_SLOWMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_SLOW_MEM, MAX_SLOW_MEM));
- SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, MAX_Z3_MEM));
- SendDlgItemMessage (hDlg, IDC_P96MEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_P96_MEM, MAX_P96_MEM));
- SendDlgItemMessage (hDlg, IDC_MBMEM1, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MB_MEM));
- SendDlgItemMessage (hDlg, IDC_MBMEM2, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MB_MEM));
+ SendDlgItemMessage (hDlg, IDC_CHIPMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_CHIP_MEM, MAX_CHIP_MEM));
+ SendDlgItemMessage (hDlg, IDC_FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_FAST_MEM, MAX_FAST_MEM));
+ SendDlgItemMessage (hDlg, IDC_SLOWMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_SLOW_MEM, MAX_SLOW_MEM));
+ SendDlgItemMessage (hDlg, IDC_Z3FASTMEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_Z3_MEM, MAX_Z3_MEM));
+ SendDlgItemMessage (hDlg, IDC_P96MEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_P96_MEM, MAX_P96_MEM));
+ SendDlgItemMessage (hDlg, IDC_MBMEM1, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MB_MEM));
+ SendDlgItemMessage (hDlg, IDC_MBMEM2, TBM_SETRANGE, TRUE, MAKELONG (MIN_MB_MEM, MAX_MB_MEM));
- case WM_USER:
- recursive++;
- fix_values_memorydlg ();
- values_to_memorydlg (hDlg);
- enable_for_memorydlg (hDlg);
- recursive--;
+ case WM_USER:
+ recursive++;
+ fix_values_memorydlg ();
+ values_to_memorydlg (hDlg);
+ enable_for_memorydlg (hDlg);
+ recursive--;
break;
- case WM_HSCROLL:
- workprefs.chipmem_size = memsizes[msi_chip[SendMessage (GetDlgItem (hDlg, IDC_CHIPMEM), TBM_GETPOS, 0, 0)]];
- workprefs.bogomem_size = memsizes[msi_bogo[SendMessage (GetDlgItem (hDlg, IDC_SLOWMEM), TBM_GETPOS, 0, 0)]];
- workprefs.fastmem_size = memsizes[msi_fast[SendMessage (GetDlgItem (hDlg, IDC_FASTMEM), TBM_GETPOS, 0, 0)]];
- workprefs.z3fastmem_size = memsizes[msi_z3fast[SendMessage (GetDlgItem (hDlg, IDC_Z3FASTMEM), TBM_GETPOS, 0, 0)]];
- workprefs.gfxmem_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_P96MEM), TBM_GETPOS, 0, 0)]];
- workprefs.mbresmem_low_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_MBMEM1), TBM_GETPOS, 0, 0)]];
- workprefs.mbresmem_high_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_MBMEM2), TBM_GETPOS, 0, 0)]];
- fix_values_memorydlg ();
- values_to_memorydlg (hDlg);
- enable_for_memorydlg (hDlg);
+ case WM_HSCROLL:
+ workprefs.chipmem_size = memsizes[msi_chip[SendMessage (GetDlgItem (hDlg, IDC_CHIPMEM), TBM_GETPOS, 0, 0)]];
+ workprefs.bogomem_size = memsizes[msi_bogo[SendMessage (GetDlgItem (hDlg, IDC_SLOWMEM), TBM_GETPOS, 0, 0)]];
+ workprefs.fastmem_size = memsizes[msi_fast[SendMessage (GetDlgItem (hDlg, IDC_FASTMEM), TBM_GETPOS, 0, 0)]];
+ workprefs.z3fastmem_size = memsizes[msi_z3fast[SendMessage (GetDlgItem (hDlg, IDC_Z3FASTMEM), TBM_GETPOS, 0, 0)]];
+ workprefs.gfxmem_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_P96MEM), TBM_GETPOS, 0, 0)]];
+ workprefs.mbresmem_low_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_MBMEM1), TBM_GETPOS, 0, 0)]];
+ workprefs.mbresmem_high_size = memsizes[msi_gfx[SendMessage (GetDlgItem (hDlg, IDC_MBMEM2), TBM_GETPOS, 0, 0)]];
+ fix_values_memorydlg ();
+ values_to_memorydlg (hDlg);
+ enable_for_memorydlg (hDlg);
break;
- case WM_COMMAND:
- if (recursive > 0)
- break;
- recursive++;
- values_to_memorydlg (hDlg);
- recursive--;
+ case WM_COMMAND:
+ {
+ uae_u32 mask = workprefs.picasso96_modeflags;
+ if (recursive > 0)
+ break;
+ recursive++;
+ switch (LOWORD (wParam))
+ {
+ case IDC_RTG_MATCH_DEPTH:
+ workprefs.win32_rtgmatchdepth = IsDlgButtonChecked (hDlg, IDC_RTG_MATCH_DEPTH);
+ break;
+ case IDC_RTG_SCALE:
+ workprefs.win32_rtgscaleifsmall = IsDlgButtonChecked (hDlg, IDC_RTG_SCALE);
+ break;
+ }
+ if (HIWORD (wParam) == CBN_SELENDOK || HIWORD (wParam) == CBN_KILLFOCUS || HIWORD (wParam) == CBN_EDITCHANGE) {
+ switch (LOWORD (wParam))
+ {
+ case IDC_RTG_8BIT:
+ v = SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR) {
+ mask &= ~RGBFF_CLUT;
+ if (v == 1)
+ mask |= RGBFF_CLUT;
+ }
+ break;
+ case IDC_RTG_16BIT:
+ v = SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR) {
+ mask &= ~(RGBFF_R5G6B5PC | RGBFF_R5G5B5PC | RGBFF_R5G6B5 | RGBFF_R5G5B5 | RGBFF_B5G6R5PC | RGBFF_B5G5R5PC);
+ if (v == 1)
+ mask |= RGBFF_R5G6B5PC;
+ if (v == 2)
+ mask |= RGBFF_R5G5B5PC;
+ if (v == 3)
+ mask |= RGBFF_R5G6B5;
+ if (v == 4)
+ mask |= RGBFF_R5G5B5;
+ if (v == 5)
+ mask |= RGBFF_B5G6R5PC;
+ if (v == 6)
+ mask |= RGBFF_B5G5R5PC;
+ }
+ break;
+ case IDC_RTG_24BIT:
+ v = SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR) {
+ mask &= ~(RGBFF_R8G8B8 | RGBFF_B8G8R8);
+ if (v == 1)
+ mask |= RGBFF_R8G8B8;
+ if (v == 2)
+ mask |= RGBFF_B8G8R8;
+ }
+ break;
+ case IDC_RTG_32BIT:
+ v = SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR) {
+ mask &= ~(RGBFF_A8R8G8B8 | RGBFF_A8B8G8R8 | RGBFF_R8G8B8A8 | RGBFF_B8G8R8A8);
+ if (v == 1)
+ mask |= RGBFF_A8R8G8B8;
+ if (v == 2)
+ mask |= RGBFF_A8B8G8R8;
+ if (v == 3)
+ mask |= RGBFF_R8G8B8A8;
+ if (v == 4)
+ mask |= RGBFF_B8G8R8A8;
+ }
+ break;
+ }
+ }
+ workprefs.picasso96_modeflags = mask;
+ values_to_memorydlg (hDlg);
+ recursive--;
+ }
break;
-
}
return FALSE;
}
static void enable_for_miscdlg (HWND hDlg)
{
+ ew (hDlg, IDC_DD_SURFACETYPE, full_property_sheet);
if (!full_property_sheet) {
ew (hDlg, IDC_JULIAN, TRUE);
ew (hDlg, IDC_CTRLF11, TRUE);
ew (hDlg, IDC_NOSPEED, TRUE);
ew (hDlg, IDC_NOSPEEDPAUSE, TRUE);
ew (hDlg, IDC_NOSOUND, TRUE);
- ew (hDlg, IDC_RTGMATCHDEPTH, TRUE);
ew (hDlg, IDC_DOSAVESTATE, TRUE);
ew (hDlg, IDC_SCSIMODE, FALSE);
ew (hDlg, IDC_SCSIDEVICE, FALSE);
CheckDlgButton (hDlg, IDC_JULIAN, workprefs.win32_middle_mouse);
CheckDlgButton (hDlg, IDC_CREATELOGFILE, workprefs.win32_logfile);
CheckDlgButton (hDlg, IDC_CTRLF11, workprefs.win32_ctrl_F11_is_quit);
- CheckDlgButton (hDlg, IDC_RTGMATCHDEPTH, workprefs.win32_rtgmatchdepth);
CheckDlgButton (hDlg, IDC_SHOWLEDS, workprefs.leds_on_screen);
CheckDlgButton (hDlg, IDC_SCSIDEVICE, workprefs.scsi == 1);
CheckDlgButton (hDlg, IDC_SANA2, workprefs.sana2);
misc_scsi(hDlg);
misc_lang(hDlg);
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_RESETCONTENT, 0, 0);
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)"NonLocalVRAM");
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)"DefaultRAM");
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)"LocalVRAM");
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)"SystemRAM");
+ SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_SETCURSEL, ddforceram, 0);
+
} else if (currentpage == MISC2_ID) {
CheckDlgButton (hDlg, IDC_INACTIVE_PAUSE, workprefs.win32_inactive_pause);
misc_setlang(v);
}
break;
+ case IDC_DD_SURFACETYPE:
+ v = SendDlgItemMessage(hDlg, IDC_DD_SURFACETYPE, CB_GETCURSEL, 0, 0L);
+ if (v != CB_ERR) {
+ ddforceram = v;
+ regsetint (NULL, "directdraw_secondary", ddforceram);
+ }
+ break;
}
}
} else if (currentpage == MISC2_ID) {
case IDC_JULIAN:
workprefs.win32_middle_mouse = IsDlgButtonChecked(hDlg, IDC_JULIAN);
break;
- case IDC_RTGMATCHDEPTH:
- workprefs.win32_rtgmatchdepth = IsDlgButtonChecked(hDlg, IDC_RTGMATCHDEPTH);
- break;
case IDC_SHOWLEDS:
workprefs.leds_on_screen = IsDlgButtonChecked(hDlg, IDC_SHOWLEDS);
break;
#define CONFIG_DELETE 4
void WIN32GUI_LoadUIString( DWORD id, char *string, DWORD dwStringLen );
-extern int GetSettings (int all_options, HWND);
extern int DiskSelection( HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, char *);
void InitializeListView( HWND hDlg );
extern void pre_gui_message (const char*,...);
>
</File>
<File
- RelativePath="..\resources\resource.h"
+ RelativePath="..\resources\resource"
>
</File>
</Files>
+Beta 11:
+
+- uaegfx.card is now WinUAE built-in, libs:picasso96/uaegfx.card is not
+ needed anymore (and is ignored if it exists)
+- resolution names in display preferences are now named
+ "UAE:<w>x<h>" instead of "uaegfx:<w>x<h>"
+- added new Picasso96 options to GUI
+- 24-bit display depth Picasso96 blitter routines implemented/updated
+- added all Picasso96 supported color depth modes, defaults are
+ old standard PC modes (palette mode, R5G6B5PC and B8G8R8A8)
+ NOTES:
+ - only one 8-bit,15/16-bit, 24-bit and 32-bit mode supported
+ simultaneously
+ - All "new" modes require color space conversion = slower.
+ - Not all mode color space conversions yet supported (black screen)
+ - Can be useful with old RTG compatible demos or games that require
+ specific "non-pc" display color modes
+- added "Display buffer" option to misc-panel (stored to registry)
+- "FS" scale setting is now the default
+- refresh whole screen using very optimized routine if >80% of
+ Picasso96 screen needs refreshing (faster than partial update)
+- Marvin's Marvellous Adventure clouds/score interference fixed
+ (It was really stupid bug, can only happen with AGA sprites)
+- Skid Marks hires mode car sprite problem fixed (b10)
+
Beta 10:
- MOVEM is not weird in debugger anymore
was shorter than expected
- disable hardware sprite if uaegfx.card is old version without
hardware sprite support and devs:monitors/info has softsprite=no
-- added -ddforceram and -ddforcevram debugging command line params
- try -ddforceram if you have slow P96Speed results
+- adjusted DirectDraw surface allocation parameters, perhaps helps
+ with P96Speed differences
+- added -ddforcemode <mode> command line parameter, if you have slow
+ P96Speed results compared to 1.4.6, try mode values from 1 to 3 and
+ report results.
Beta 9:
fprintf(debugfile, ts);
fprintf(debugfile, bufp);
if (!bootlogmode)
- fflush(debugfile);
+ ;//fflush(debugfile);
}
lfdetected = 0;
if (strlen(bufp) > 0 && bufp[strlen(bufp) - 1] == '\n')
+#if BLT_SIZE == 3
+static void NOINLINE BLT_NAME (unsigned int w, unsigned int h, uae_u8 *src, uae_u8 *dst, int srcpitch, int dstpitch)
+{
+ uae_u8 *src2 = src;
+ uae_u8 *dst2 = dst;
+ uae_u32 *src2_32 = (uae_u32*)src;
+ uae_u32 *dst2_32 = (uae_u32*)dst;
+ unsigned int y, x, ww, xxd;
+#ifdef BLT_TEMP
+ uae_u32 tmp;
+#endif
+ w *= BLT_SIZE;
+ ww = w / 4;
+ xxd = w - (ww * 4);
+ for(y = 0; y < h; y++) {
+ uae_u8 *src_8;
+ uae_u8 *dst_8;
+ uae_u32 *src_32 = (uae_u32*)src2;
+ uae_u32 *dst_32 = (uae_u32*)dst2;
+ for (x = 0; x < ww; x++) {
+ BLT_FUNC (src_32, dst_32);
+ src_32++; dst_32++;
+ }
+ src_8 = (uae_u8*)src_32;
+ dst_8 = (uae_u8*)dst_32;
+ for (x = 0; x < xxd; x++) {
+ BLT_FUNC (src_8, dst_8);
+ src_8++;
+ dst_8++;
+ }
+ dst2 += dstpitch;
+ src2 += srcpitch;
+ }
+}
+#else
static void NOINLINE BLT_NAME (unsigned int w, unsigned int h, uae_u8 *src, uae_u8 *dst, int srcpitch, int dstpitch)
{
uae_u8 *src2 = src;
src2 += srcpitch;
}
}
+#endif
#undef BLT_NAME
#undef BLT_FUNC
#ifdef BLT_TEMP