static uaecptr bplpt[MAX_PLANES];
-uae_u16 bplcon0;
+static uae_u16 bplcon0;
static uae_u16 bplcon1, bplcon2, bplcon3, bplcon4;
static uae_u32 bplcon0_res, bplcon0_planes, bplcon0_planes_limit;
static int diwstrt, diwstop, diwhigh;
return;
}
+#ifdef WITH_SPECIALMONITORS
+ specialmonitor_gaudio((v & 0x0100) != 0, vpos);
+#endif
+
// UHRES, BYPASS
if (va & (0x0080 | 0x0020)) {
not_safe_mode |= 1;
#include "memory.h"
bool emulate_specialmonitors(struct vidbuffer *src, struct vidbuffer *dst);
-void specialmonitor_store_fmode(int vpos, int hpos, uae_u16 fmode);
void specialmonitor_reset(void);
bool specialmonitor_need_genlock(void);
bool specialmonitor_uses_control_lines(void);
bool specialmonitor_linebased(void);
void genlock_infotext(uae_u8*, struct vidbuffer*);
+void specialmonitor_store_fmode(int vpos, int hpos, uae_u16 fmode);
+void specialmonitor_gaudio(bool, int);
+
extern const TCHAR *specialmonitorfriendlynames[];
extern const TCHAR *specialmonitormanufacturernames[];
extern const TCHAR *specialmonitorconfignames[];
extern uae_u16 bplcon0;
static uae_u8 graffiti_palette[256 * 4];
+static bool graffiti_gaudio;
static bool specialmonitor_setresolution(struct vidbuffer *src, struct vidbuffer *dst, int width, int height, bool nativeposition)
{
return v;
}
+void specialmonitor_gaudio(bool gaudio, int vpos)
+{
+ graffiti_gaudio |= gaudio;
+}
+
static bool graffiti(struct vidbuffer *src, struct vidbuffer *dst)
{
struct vidbuf_description *avidinfo = &adisplays[dst->monitor_id].gfxvidinfo;
int ystart, yend, isntsc;
int xstart, xend;
uae_u8 *srcbuf, *srcend;
- uae_u8 *dstbuf;
+ uae_u8 *dstbuf, *dstbufend;
bool command, hires, found;
int xadd, xpixadd, extrapix;
int waitline = 0, dbl;
uae_u8 read_mask = 0xff, color = 0, color2 = 0;
- if (!(bplcon0 & 0x0100)) // GAUD
+ if (!graffiti_gaudio) {
return false;
+ }
+ graffiti_gaudio = false;
command = true;
found = false;
}
srcbuf = src->bufmem + (((ystart << VRES_MAX) - src->yoffset) / avidinfo->ychange) * src->rowbytes + (((xstart << RES_MAX) - src->xoffset) / avidinfo->xchange) * src->pixbytes;
+
+ srcbuf = src->bufmem;
+
srcend = src->bufmem + (((yend << VRES_MAX) - src->yoffset) / avidinfo->ychange) * src->rowbytes;
extrapix = 0;
dstbuf = dst->bufmem + (((ystart << VRES_MAX) - src->yoffset) / avidinfo->ychange) * dst->rowbytes + (((xstart << RES_MAX) - src->xoffset) / avidinfo->xchange) * dst->pixbytes;
+ dstbufend = dst->bufmemend - 8 * dst->width_allocated * dst->pixbytes;
y = 0;
- while (srcend > srcbuf && dst->bufmemend > dstbuf) {
+ while (srcend > srcbuf && dstbufend > dstbuf) {
uae_u8 *srcp = srcbuf + extrapix;
uae_u8 *dstp = dstbuf;
x = xstart;
+ bool first = true;
while (x < xend) {
+ if (command && first) {
+ if (FR(src, srcp) || FG(src, srcp) || FB(src, srcp) || FI(src, srcp)) {
+ first = false;
+ } else {
+ x += xpixadd;
+ srcp += xadd;
+ dstp += dst->pixbytes * xpixadd;
+ continue;
+ }
+ }
+
uae_u8 mask = 0x80;
uae_u8 chunky[4] = { 0, 0, 0, 0 };
while (mask) {
command = false;
dbl = 1;
waitline = 2;
- if (0 && (cmd & 16)) {
+ if (cmd & 16) {
hires = true;
xadd /= 2;
xpixadd /= 2;
panel_width_draw = px == 2 ? 352 : 336;
pxcnt = 3;
hires = false;
- srcxoffset = (112 << RES_MAX) - 360;
+ srcxoffset = (112 << RES_MAX) - 360; // 112*4-360=88 (312) 112*4-272=176 (172)
if (px > 2)
return false;
total_width = 336 + 336 + 352;
panel_width_draw = 512;
pxcnt = 2;
hires = true;
- srcxoffset = (128 << RES_MAX) - 360;
+ srcxoffset = (128 << RES_MAX) - 360; // 128*4-360=152 (312) 128*4-272=240 (172)
if (px > 1)
return false;
total_width = 512 + 512;