Skip to content

Commit

Permalink
Winuae integrate (#20)
Browse files Browse the repository at this point in the history
* Small sprite optimization

* Layout B CD32 key fix

* Fullscreen OSD font update fix

* Do not save GUI size if not visible, do not close GUI when emulation window is minimized and GUI is about to open.

* Wait until last line is complete before finishing it.

* Harddrive limit bumped to 50, check limit.

* Quickstart disk image/executable drag&drop check, insert in harddrives if archive with multiple executables.

* Option to force (unconnected) floppy data line high.

* Add delay between LD reply bytes

* ALG Marbella Vice needs LD Frame # Mode command.

* Force floppy data pullup = high if ALG mode.

* 5200b7

* Add CIA IO ports to CIA debug output

* Overscan+ HBSTRT parameter calculation fix (relative to endhpos)

* Better NTSC vertical positioning in normal overscan mode.

* Genlock positioning/scaling fixes. Manual offset config entries added.

* ALG/Picmatic emulation updates.

* Input remapping fixes.

* ALG LD status info update.

* 5200b8

* Reduce LDP ACK delay. It was far too long. (Picmatic Zorton Brothers hang fix)

* CIA E-clock mode on the fly change support

* Fix Harddrives panel shortcut keys

* Only show "OCS Denise blanking bug" black lines in Overscan+ or higher.

* Fix 68040 MMU MOVES special case

* Quickstart ALG/Picmatic PAL/NTSC selection

* 68060 custom register byte write bug emulation fix

* Genlock adjustable blanking support, fix scaling.

* 5200b9

* temp move for merge

* Integrated latest from WinUAE

* Hide the very last OCS-only line if mode is not at least Overscan+

* Disk swapper: insert new image in cursor position, allow multiple identical images, fix removal cursor position.

* Add unused qualifier bit combination for future use

* 5200b10

* temp move

* Moved file back

* Fix genlock emulation in single line mode

* temp move

* moved file back

---------

Co-authored-by: Toni Wilen <[email protected]>
  • Loading branch information
emoon and tonioni authored Feb 17, 2024
1 parent 741ee54 commit fb67cf9
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions uae_src/specialmonitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2524,17 +2524,20 @@ static bool do_genlock(struct vidbuffer *src, struct vidbuffer *dst, bool double
genlock_image_file[0] = 0;
}

if (avidinfo->ychange == 1)
if (avidinfo->ychange == 1) {
vdbl = 0; // double
else
} else {
vdbl = 1; // single
doublelines = false;
}

if (avidinfo->xchange == 1)
if (avidinfo->xchange == 1) {
hdbl = 0; // shres
else if (avidinfo->xchange == 2)
} else if (avidinfo->xchange == 2) {
hdbl = 1; // hires
else
} else {
hdbl = 2; // lores
}

get_mode_blanking_limits(&xstart, &xend, &ystart, &yend);

Expand Down Expand Up @@ -2614,7 +2617,7 @@ static bool do_genlock(struct vidbuffer *src, struct vidbuffer *dst, bool double

uae_u8 r = 0, g = 0, b = 0, a = 0;
for (y = ystart; y < yend; y++) {
int yoff = (y * 2 + oddlines) - src->yoffset;
int yoff = ((y * 2 + oddlines) - src->yoffset) >> vdbl;
if (yoff < 0)
continue;
if (yoff >= src->inheight)
Expand All @@ -2625,13 +2628,13 @@ static bool do_genlock(struct vidbuffer *src, struct vidbuffer *dst, bool double
bool ztoggle = false;
uae_u8 *line = src->bufmem + yoff * src->rowbytes;
uae_u8 *lineprev = yoff > 0 ? src->bufmem + (yoff - 1) * src->rowbytes : NULL;
uae_u8 *dstline = dst->bufmem + ((y * 2 + oddlines) - dst->yoffset) * dst->rowbytes;
uae_u8 *dstline = dst->bufmem + (((y * 2 + oddlines) - dst->yoffset) >> vdbl) * dst->rowbytes;
uae_u8 *line_genlock = row_map_genlock[yoff];
int gy = ((y * 2 + oddlines) - src->yoffset + offsety - gen_yoffset) * deltay / 65536;
int gy = (((y * 2 + oddlines) - src->yoffset + offsety - gen_yoffset) >> vdbl) * deltay / 65536;
if (genlock_image_upsidedown)
gy = (genlock_image_height - 1) - gy;
uae_u8 *image_genlock = genlock_image + gy * genlock_image_pitch;
r = g = b;
r = g = b = 0;
a = amix1;
noise_add = (quickrand() & 15) | 1;
uae_u8 *s = line;
Expand All @@ -2641,37 +2644,37 @@ static bool do_genlock(struct vidbuffer *src, struct vidbuffer *dst, bool double
for (x = 0; x < src->inwidth; x++) {
uae_u8 *s2 = s + src->rowbytes;
uae_u8 *d2 = d + dst->rowbytes;
if (x < hblank_left_start || x >= hblank_right_stop)
continue;
if ((!zclken && is_transparent(*s_genlock)) || (zclken && ztoggle)) {
a = amix2;
if (genlock_error) {
r = 0x00;
g = 0x00;
b = 0xdd;
} else if (genlock_blank) {
r = g = b = 0;
} else if (genlock_image) {
int gx = (x + offsetx - gen_xoffset) * deltax / 65536;
if (gx >= 0 && gx < genlock_image_width && gy >= 0 && gy < genlock_image_height) {
uae_u8 *s_genlock_image = image_genlock + gx * genlock_image_pixbytes;
r = s_genlock_image[genlock_image_red_index];
g = s_genlock_image[genlock_image_green_index];
b = s_genlock_image[genlock_image_blue_index];
} else {
if (x >= hblank_left_start && x < hblank_right_stop) {
if ((!zclken && is_transparent(*s_genlock)) || (zclken && ztoggle)) {
a = amix2;
if (genlock_error) {
r = 0x00;
g = 0x00;
b = 0xdd;
} else if (genlock_blank) {
r = g = b = 0;
} else if (genlock_image) {
int gx = (x + offsetx - gen_xoffset) * deltax / 65536;
if (gx >= 0 && gx < genlock_image_width && gy >= 0 && gy < genlock_image_height) {
uae_u8 *s_genlock_image = image_genlock + gx * genlock_image_pixbytes;
r = s_genlock_image[genlock_image_red_index];
g = s_genlock_image[genlock_image_green_index];
b = s_genlock_image[genlock_image_blue_index];
} else {
r = g = b = 0;
}
} else {
r = g = b = get_noise();
}
if (mix2) {
r = (mix1 * r + mix2 * FVR(src, s)) / 256;
g = (mix1 * g + mix2 * FVG(src, s)) / 256;
b = (mix1 * b + mix2 * FVB(src, s)) / 256;
}
PUT_PRGBA(d, d2, dst, r, g, b, a, 0, doublelines, false);
} else {
r = g = b = get_noise();
PUT_AMIGARGBA(d, s, d2, s2, dst, 0, doublelines, false);
}
if (mix2) {
r = (mix1 * r + mix2 * FVR(src, s)) / 256;
g = (mix1 * g + mix2 * FVG(src, s)) / 256;
b = (mix1 * b + mix2 * FVB(src, s)) / 256;
}
PUT_PRGBA(d, d2, dst, r, g, b, a, 0, doublelines, false);
} else {
PUT_AMIGARGBA(d, s, d2, s2, dst, 0, doublelines, false);
}
s += src->pixbytes;
d += dst->pixbytes;
Expand Down

0 comments on commit fb67cf9

Please sign in to comment.