#include "rommgr.h"
#include "xwin.h"
#include "devices.h"
+#include "gfxfilter.h"
#include "pcem/device.h"
#include "pcem/vid_s3_virge.h"
#include "pcem/vid_cl5429.h"
vram_ram_a8 = 0;
}
+extern uae_u8 *getpcembuffer32(int, int, int);
+
// PCEM
void video_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h)
{
struct picasso_vidbuf_description *vidinfo = &picasso_vidinfo[gb->monitor_id];
for (int yy = y1; yy < y2 && yy < vidinfo->height; yy++) {
uae_u8 *d = gb->gfxboard_surface + yy * vidinfo->rowbytes;
- extern uae_u8 *getpcembuffer32(int, int, int);
uae_u8 *s = getpcembuffer32(x, y, yy);
memcpy(d, s, vidinfo->width * vidinfo->pixbytes);
}
if (addr & 0x800000) {
v = do_byteswap_32(v);
} else if (addr & 0x400000) {
- v = do_byteswap_32(v);
+ v = (v >> 16) | (v << 16);
} else {
;
}
if (addr & 0x800000) {
l = do_byteswap_32(l);
} else if (addr & 0x400000) {
- l = do_byteswap_32(l);
+ l = (l >> 16) | (l << 16);
} else {
;
}
}
return 0;
}
+
+
+bool gfxboard_isgfxboardscreen(int monid)
+{
+ int index = rtg_visible[monid];
+ if (index < 0)
+ return false;
+ struct rtgboardconfig *rbc = &currprefs.rtgboards[index];
+ struct rtggfxboard *gb = &rtggfxboards[rbc->rtg_index];
+ return gb->active && rtg_visible[monid] >= 0;
+}
+uae_u8 *gfxboard_getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette)
+{
+ int index = rtg_visible[monid];
+ if (index < 0)
+ return NULL;
+ struct rtgboardconfig *rbc = &currprefs.rtgboards[index];
+
+ if (rbc->rtgmem_type < GFXBOARD_HARDWARE) {
+ return uaegfx_getrtgbuffer(monid, widthp, heightp, pitch, depth, palette);
+ }
+
+ struct rtggfxboard *gb = &rtggfxboards[rbc->rtg_index];
+ struct picasso_vidbuf_description *vidinfo = &picasso_vidinfo[monid];
+ struct picasso96_state_struct *state = &picasso96_state[monid];
+
+ if (!gb->pcemdev)
+ return NULL;
+
+ int width = state->VirtualWidth;
+ int height = state->VirtualHeight;
+ if (!width || !height)
+ return NULL;
+
+ uae_u8 *dst = xmalloc(uae_u8, width * height * 4);
+ if (!dst)
+ return NULL;
+
+ uae_u8 *d = dst;
+ for (int yy = 0; yy < height; yy++) {
+ uae_u8 *s = getpcembuffer32(32, 0, yy);
+ memcpy(d, s, width * 4);
+ d += width * 4;
+ }
+
+ *widthp = width;
+ *heightp = height;
+ *pitch = width * 4;
+ *depth = 4 * 8;
+
+ return dst;
+}
+void gfxboard_freertgbuffer(int monid, uae_u8 *dst)
+{
+ int index = rtg_visible[monid];
+ if (index < 0) {
+ uaegfx_freertgbuffer(monid, dst);
+ return;
+ }
+ struct rtgboardconfig *rbc = &currprefs.rtgboards[index];
+
+ if (rbc->rtgmem_type < GFXBOARD_HARDWARE) {
+ uaegfx_freertgbuffer(monid, dst);
+ return;
+ }
+
+ xfree(dst);
+}
extern bool gfxboard_set(int monid, bool rtg);
extern void gfxboard_resize(int width, int height, void *p);
+uae_u8 *gfxboard_getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette);
+void gfxboard_freertgbuffer(int monid, uae_u8 *dst);
+bool gfxboard_isgfxboardscreen(int monid);
+
extern struct gfxboard_func a2410_func;
extern struct gfxboard_func harlequin_func;
uae_u8 *getfilterbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth);
void freefilterbuffer(int monid, uae_u8*);
-uae_u8 *getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette);
-void freertgbuffer(int monid, uae_u8 *dst);
+uae_u8 *uaegfx_getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette);
+void uaegfx_freertgbuffer(int monid, uae_u8 *dst);
extern void getrtgfilterrect2(int monid, RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height);
void uae_time_calibrate(void);
uae_time_t uae_time(void);
+extern int syncbase;
+
#ifdef _WIN32
void uae_time_use_rdtsc(bool enable);
uae_u32 read_system_time(void);
#include "threaddep/thread.h"
#include "zfile.h"
#include "savestate.h"
+#include "gfxboard.h"
#define MAX_AVI_SIZE (0x80000000 - 0x1000000)
avioutput_fps = ispal() ? 50 : 60;
if (avioutput_originalsize || WIN32GFX_IsPicassoScreen(mon)) {
int pitch;
- if (!WIN32GFX_IsPicassoScreen(mon)) {
+ if (!gfxboard_isgfxboardscreen(0)) {
getfilterbuffer(0, &avioutput_width, &avioutput_height, &pitch, &avioutput_bits);
} else {
- freertgbuffer(0, getrtgbuffer(0, &avioutput_width, &avioutput_height, &pitch, &avioutput_bits, NULL));
+ gfxboard_freertgbuffer(0, gfxboard_getrtgbuffer(0, &avioutput_width, &avioutput_height, &pitch, &avioutput_bits, NULL));
}
}
mem = NULL;
dpitch = ((aviout_width_out * avioutput_bits + 31) & ~31) / 8;
if (original || WIN32GFX_IsPicassoScreen(mon)) {
- if (!WIN32GFX_IsPicassoScreen(mon)) {
+ if (!gfxboard_isgfxboardscreen(aviout_monid)) {
src = getfilterbuffer(aviout_monid, &w, &h, &spitch, &d);
maxw = vidinfo->outbuffer->outwidth;
maxh = vidinfo->outbuffer->outheight;
} else {
- src = mem = getrtgbuffer(aviout_monid, &w, &h, &spitch, &d, NULL);
+ src = mem = gfxboard_getrtgbuffer(aviout_monid, &w, &h, &spitch, &d, NULL);
maxw = w;
maxh = h;
}
src += spitch;
}
if (mem)
- freertgbuffer(aviout_monid, mem);
+ gfxboard_freertgbuffer(aviout_monid, mem);
return 1;
}
#endif
}
}
-uae_u8 *getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette)
+uae_u8 *uaegfx_getrtgbuffer(int monid, int *widthp, int *heightp, int *pitch, int *depth, uae_u8 *palette)
{
struct picasso_vidbuf_description *vidinfo = &picasso_vidinfo[monid];
struct picasso96_state_struct *state = &picasso96_state[monid];
return dst;
}
-void freertgbuffer(int monid, uae_u8 *dst)
+void uaegfx_freertgbuffer(int monid, uae_u8 *dst)
{
xfree (dst);
}
#include "drawing.h"
#include "fsdb.h"
#include "zfile.h"
-#include "picasso96_win.h"
+#include "gfxboard.h"
#include "png.h"
int screenshot_width = 0, screenshot_height = 0;
int screenshot_xoffset = -1, screenshot_yoffset = -1;
- if (WIN32GFX_IsPicassoScreen(mon)) {
- src = mem = getrtgbuffer(monid, &width, &height, &spitch, &bits, pal);
+ if (gfxboard_isgfxboardscreen(monid)) {
+ src = mem = gfxboard_getrtgbuffer(monid, &width, &height, &spitch, &bits, pal);
needfree = true;
rgb_bb2 = 8;
rgb_gb2 = 8;
if (width == 0 || height == 0) {
if (needfree) {
if (WIN32GFX_IsPicassoScreen(mon))
- freertgbuffer(0, mem);
+ gfxboard_freertgbuffer(0, mem);
else
freefilterbuffer(0, mem);
}
if (!(lpvBits = xmalloc(uae_u8, bi->bmiHeader.biSizeImage))) {
if (needfree) {
if (WIN32GFX_IsPicassoScreen(mon))
- freertgbuffer(monid, mem);
+ gfxboard_freertgbuffer(monid, mem);
else
freefilterbuffer(monid, mem);
}
src += spitch;
}
if (needfree) {
- if (WIN32GFX_IsPicassoScreen(mon))
- freertgbuffer(monid, mem);
+ if (gfxboard_isgfxboardscreen(monid))
+ gfxboard_freertgbuffer(monid, mem);
else
freefilterbuffer(monid, mem);
}
nojoy = true;
}
+ if (p->rtg_hardwaresprite && !p->gfx_api) {
+ error_log(_T("DirectDraw is not RTG hardware sprite compatible."));
+ p->rtg_hardwaresprite = false;
+ }
+ if (p->rtgboards[0].rtgmem_type >= GFXBOARD_HARDWARE) {
+ p->rtg_hardwareinterrupt = false;
+ p->rtg_hardwaresprite = false;
+ p->win32_rtgmatchdepth = false;
+ p->color_mode = 5;
+ if (p->ppc_model && !p->gfx_api) {
+ error_log(_T("Graphics board and PPC: Direct3D enabled."));
+ p->gfx_api = os_win7 ? 2 : 1;
+ }
+ }
+
struct MultiDisplay *md = getdisplay(p, 0);
for (int j = 0; j < MAX_AMIGADISPLAYS; j++) {
if (p->gfx_monitor[j].gfx_size_fs.special == WH_NATIVE) {
p->color_mode = p->color_mode == 5 ? 2 : 5;
}
}
- if (p->rtg_hardwaresprite && !p->gfx_api) {
- error_log (_T("DirectDraw is not RTG hardware sprite compatible."));
- p->rtg_hardwaresprite = false;
- }
- if (p->rtgboards[0].rtgmem_type >= GFXBOARD_HARDWARE) {
- p->rtg_hardwareinterrupt = false;
- p->rtg_hardwaresprite = false;
- p->win32_rtgmatchdepth = false;
- if (gfxboard_need_byteswap (&p->rtgboards[0]))
- p->color_mode = 5;
- if (p->ppc_model && !p->gfx_api) {
- error_log (_T("Graphics board and PPC: Direct3D enabled."));
- p->gfx_api = os_win7 ? 2 : 1;
- }
- }
if ((p->gfx_apmode[0].gfx_vsyncmode || p->gfx_apmode[1].gfx_vsyncmode) ) {
if (p->produce_sound && sound_devices[p->win32_soundcard]->type == SOUND_DEVICE_DS) {
p->win32_soundcard = 0;