mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 04:45:31 -07:00
Merge pull request #1687 from 86Box/master
Bring the branch up to part with master.
This commit is contained in:
@@ -463,17 +463,17 @@ cga_poll(void *p)
|
||||
|
||||
if (enable_overscan) {
|
||||
if (cga->composite)
|
||||
video_blit_memtoscreen(0, (cga->firstline - 4) << 1, 0, ((cga->lastline - cga->firstline) + 8) << 1,
|
||||
video_blit_memtoscreen(0, (cga->firstline - 4) << 1,
|
||||
xsize, ((cga->lastline - cga->firstline) + 8) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (cga->firstline - 4) << 1, 0, ((cga->lastline - cga->firstline) + 8) << 1,
|
||||
video_blit_memtoscreen_8(0, (cga->firstline - 4) << 1,
|
||||
xsize, ((cga->lastline - cga->firstline) + 8) << 1);
|
||||
} else {
|
||||
if (cga->composite)
|
||||
video_blit_memtoscreen(8, cga->firstline << 1, 0, (cga->lastline - cga->firstline) << 1,
|
||||
video_blit_memtoscreen(8, cga->firstline << 1,
|
||||
xsize, (cga->lastline - cga->firstline) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, cga->firstline << 1, 0, (cga->lastline - cga->firstline) << 1,
|
||||
video_blit_memtoscreen_8(8, cga->firstline << 1,
|
||||
xsize, (cga->lastline - cga->firstline) << 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,9 +326,9 @@ void colorplus_poll(void *p)
|
||||
}
|
||||
|
||||
if (colorplus->cga.composite)
|
||||
video_blit_memtoscreen(0, colorplus->cga.firstline - 4, 0, (colorplus->cga.lastline - colorplus->cga.firstline) + 8, xsize, (colorplus->cga.lastline - colorplus->cga.firstline) + 8);
|
||||
video_blit_memtoscreen(0, colorplus->cga.firstline - 4, xsize, (colorplus->cga.lastline - colorplus->cga.firstline) + 8);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, colorplus->cga.firstline - 4, 0, (colorplus->cga.lastline - colorplus->cga.firstline) + 8, xsize, (colorplus->cga.lastline - colorplus->cga.firstline) + 8);
|
||||
video_blit_memtoscreen_8(0, colorplus->cga.firstline - 4, xsize, (colorplus->cga.lastline - colorplus->cga.firstline) + 8);
|
||||
frames++;
|
||||
|
||||
video_res_x = xsize - 16;
|
||||
|
||||
@@ -340,14 +340,14 @@ compaq_cga_poll(void *p)
|
||||
|
||||
if (enable_overscan) {
|
||||
if (self->cga.composite)
|
||||
video_blit_memtoscreen(0, self->cga.firstline - 8, 0, (self->cga.lastline - self->cga.firstline) + 16, xsize, (self->cga.lastline - self->cga.firstline) + 16);
|
||||
video_blit_memtoscreen(0, self->cga.firstline - 8, xsize, (self->cga.lastline - self->cga.firstline) + 16);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, self->cga.firstline - 8, 0, (self->cga.lastline - self->cga.firstline) + 16, xsize, (self->cga.lastline - self->cga.firstline) + 16);
|
||||
video_blit_memtoscreen_8(0, self->cga.firstline - 8, xsize, (self->cga.lastline - self->cga.firstline) + 16);
|
||||
} else {
|
||||
if (self->cga.composite)
|
||||
video_blit_memtoscreen(8, self->cga.firstline, 0, self->cga.lastline - self->cga.firstline, xsize, self->cga.lastline - self->cga.firstline);
|
||||
video_blit_memtoscreen(8, self->cga.firstline, xsize, self->cga.lastline - self->cga.firstline);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, self->cga.firstline, 0, self->cga.lastline - self->cga.firstline, xsize, self->cga.lastline - self->cga.firstline);
|
||||
video_blit_memtoscreen_8(8, self->cga.firstline, xsize, self->cga.lastline - self->cga.firstline);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <86box/vid_ega.h>
|
||||
|
||||
|
||||
void ega_doblit(int y1, int y2, int wx, int wy, ega_t *ega);
|
||||
void ega_doblit(int wx, int wy, ega_t *ega);
|
||||
|
||||
|
||||
#define BIOS_IBM_PATH "roms/video/ega/ibm_6277356_ega_card_u44_27128.bin"
|
||||
@@ -597,10 +597,10 @@ ega_poll(void *p)
|
||||
|
||||
if (ega->vres) {
|
||||
wy = (ega->lastline - ega->firstline) << 1;
|
||||
ega_doblit(ega->firstline_draw << 1, (ega->lastline_draw + 1) << 1, wx, wy, ega);
|
||||
ega_doblit(wx, wy, ega);
|
||||
} else {
|
||||
wy = ega->lastline - ega->firstline;
|
||||
ega_doblit(ega->firstline_draw, ega->lastline_draw + 1, wx, wy, ega);
|
||||
ega_doblit(wx, wy, ega);
|
||||
}
|
||||
|
||||
frames++;
|
||||
@@ -658,7 +658,7 @@ ega_poll(void *p)
|
||||
|
||||
|
||||
void
|
||||
ega_doblit(int y1, int y2, int wx, int wy, ega_t *ega)
|
||||
ega_doblit(int wx, int wy, ega_t *ega)
|
||||
{
|
||||
int y_add = (enable_overscan) ? overscan_y : 0;
|
||||
int x_add = (enable_overscan) ? overscan_x : 0;
|
||||
@@ -675,15 +675,8 @@ ega_doblit(int y1, int y2, int wx, int wy, ega_t *ega)
|
||||
bottom <<= 1;
|
||||
}
|
||||
|
||||
if ((wx <= 0) || (wy <= 0)) {
|
||||
video_blit_memtoscreen(x_start, y_start, 0, 0, 0, 0);
|
||||
if ((wx <= 0) || (wy <= 0))
|
||||
return;
|
||||
}
|
||||
|
||||
if (y1 > y2) {
|
||||
video_blit_memtoscreen(x_start, y_start, 0, 0, xsize + x_add, ysize + y_add);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ega->vres)
|
||||
ega->y_add <<= 1;
|
||||
@@ -734,7 +727,7 @@ ega_doblit(int y1, int y2, int wx, int wy, ega_t *ega)
|
||||
}
|
||||
}
|
||||
|
||||
video_blit_memtoscreen(x_start, y_start, y1, y2 + y_add, xsize + x_add, ysize + y_add);
|
||||
video_blit_memtoscreen(x_start, y_start, xsize + x_add, ysize + y_add);
|
||||
|
||||
if (ega->vres)
|
||||
ega->y_add >>= 1;
|
||||
|
||||
@@ -584,7 +584,7 @@ static void f82c425_poll(void *p)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen(0, 0, xsize, ysize);
|
||||
frames++;
|
||||
|
||||
/* Fixed 640x200 resolution */
|
||||
|
||||
@@ -689,7 +689,7 @@ genius_poll(void *p)
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
|
||||
video_blit_memtoscreen_8(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen_8(0, 0, xsize, ysize);
|
||||
|
||||
frames++;
|
||||
/* Fixed 728x1008 resolution */
|
||||
|
||||
@@ -517,9 +517,9 @@ hercules_poll(void *priv)
|
||||
}
|
||||
|
||||
if (enable_overscan)
|
||||
video_blit_memtoscreen_8(0, dev->firstline, 0, ysize + 28, xsize + 16, ysize + 28);
|
||||
video_blit_memtoscreen_8(0, dev->firstline, xsize + 16, ysize + 28);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, dev->firstline + 14, 0, ysize + 14, xsize, ysize);
|
||||
video_blit_memtoscreen_8(8, dev->firstline + 14, xsize, ysize);
|
||||
frames++;
|
||||
// if ((dev->ctrl & 2) && (dev->ctrl2 & 1)) {
|
||||
if (dev->ctrl & 0x02) {
|
||||
|
||||
@@ -581,7 +581,7 @@ herculesplus_poll(void *priv)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen_8(0, dev->firstline, 0, dev->lastline - dev->firstline, xsize, dev->lastline - dev->firstline);
|
||||
video_blit_memtoscreen_8(0, dev->firstline, xsize, dev->lastline - dev->firstline);
|
||||
frames++;
|
||||
if ((dev->ctrl & HERCULESPLUS_CTRL_GRAPH) && (dev->ctrl2 & HERCULESPLUS_CTRL2_GRAPH)) {
|
||||
video_res_x = dev->crtc[1] * 16;
|
||||
|
||||
@@ -998,7 +998,7 @@ incolor_poll(void *priv)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, dev->firstline, 0, dev->lastline - dev->firstline, xsize, dev->lastline - dev->firstline);
|
||||
video_blit_memtoscreen(0, dev->firstline, xsize, dev->lastline - dev->firstline);
|
||||
frames++;
|
||||
if ((dev->ctrl & INCOLOR_CTRL_GRAPH) && (dev->ctrl2 & INCOLOR_CTRL2_GRAPH)) {
|
||||
video_res_x = dev->crtc[1] * 16;
|
||||
|
||||
@@ -230,7 +230,7 @@ void mda_poll(void *p)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen_8(0, mda->firstline, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen_8(0, mda->firstline, xsize, ysize);
|
||||
frames++;
|
||||
video_res_x = mda->crtc[1];
|
||||
video_res_y = mda->crtc[6];
|
||||
|
||||
@@ -474,17 +474,17 @@ nga_poll(void *priv)
|
||||
/* nga specific */
|
||||
if (enable_overscan) {
|
||||
if (nga->cga.composite)
|
||||
video_blit_memtoscreen(0, (nga->cga.firstline - 8), 0, (nga->cga.lastline - nga->cga.firstline) + 16,
|
||||
video_blit_memtoscreen(0, (nga->cga.firstline - 8),
|
||||
xsize, (nga->cga.lastline - nga->cga.firstline) + 16);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (nga->cga.firstline - 8), 0, (nga->cga.lastline - nga->cga.firstline) + 16,
|
||||
video_blit_memtoscreen_8(0, (nga->cga.firstline - 8),
|
||||
xsize, (nga->cga.lastline - nga->cga.firstline) + 16);
|
||||
} else {
|
||||
if (nga->cga.composite)
|
||||
video_blit_memtoscreen(8, nga->cga.firstline, 0, (nga->cga.lastline - nga->cga.firstline),
|
||||
video_blit_memtoscreen(8, nga->cga.firstline,
|
||||
xsize, (nga->cga.lastline - nga->cga.firstline));
|
||||
else
|
||||
video_blit_memtoscreen_8(8, nga->cga.firstline, 0, (nga->cga.lastline - nga->cga.firstline),
|
||||
video_blit_memtoscreen_8(8, nga->cga.firstline,
|
||||
xsize, (nga->cga.lastline - nga->cga.firstline));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -489,17 +489,17 @@ ogc_poll(void *priv)
|
||||
/* ogc specific */
|
||||
if (enable_overscan) {
|
||||
if (ogc->cga.composite)
|
||||
video_blit_memtoscreen(0, (ogc->cga.firstline - 8), 0, (ogc->cga.lastline - ogc->cga.firstline) + 16,
|
||||
video_blit_memtoscreen(0, (ogc->cga.firstline - 8),
|
||||
xsize, (ogc->cga.lastline - ogc->cga.firstline) + 16);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (ogc->cga.firstline - 8), 0, (ogc->cga.lastline - ogc->cga.firstline) + 16,
|
||||
video_blit_memtoscreen_8(0, (ogc->cga.firstline - 8),
|
||||
xsize, (ogc->cga.lastline - ogc->cga.firstline) + 16);
|
||||
} else {
|
||||
if (ogc->cga.composite)
|
||||
video_blit_memtoscreen(8, ogc->cga.firstline, 0, (ogc->cga.lastline - ogc->cga.firstline),
|
||||
video_blit_memtoscreen(8, ogc->cga.firstline,
|
||||
xsize, (ogc->cga.lastline - ogc->cga.firstline));
|
||||
else
|
||||
video_blit_memtoscreen_8(8, ogc->cga.firstline, 0, (ogc->cga.lastline - ogc->cga.firstline),
|
||||
video_blit_memtoscreen_8(8, ogc->cga.firstline,
|
||||
xsize, (ogc->cga.lastline - ogc->cga.firstline));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2493,7 +2493,7 @@ pgc_cga_poll(pgc_t *dev)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen_8(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen_8(0, 0, xsize, ysize);
|
||||
frames++;
|
||||
|
||||
/* We have a fixed 640x400 screen for CGA modes. */
|
||||
@@ -2578,7 +2578,7 @@ pgc_poll(void *priv)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen(0, 0, xsize, ysize);
|
||||
frames++;
|
||||
|
||||
video_res_x = dev->screenw;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -758,7 +758,7 @@ sigma_poll(void *p)
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
|
||||
video_blit_memtoscreen_8(0, sigma->firstline - 4, 0, (sigma->lastline - sigma->firstline) + 8, xsize, (sigma->lastline - sigma->firstline) + 8);
|
||||
video_blit_memtoscreen_8(0, sigma->firstline - 4, xsize, (sigma->lastline - sigma->firstline) + 8);
|
||||
frames++;
|
||||
|
||||
video_res_x = xsize - 16;
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#include <86box/vid_svga_render.h>
|
||||
|
||||
|
||||
void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga);
|
||||
void svga_doblit(int wx, int wy, svga_t *svga);
|
||||
|
||||
extern int cyc_total;
|
||||
extern uint8_t edatlookup[4][4];
|
||||
@@ -929,10 +929,10 @@ svga_poll(void *p)
|
||||
if (!svga->override) {
|
||||
if (svga->vertical_linedbl) {
|
||||
wy = (svga->lastline - svga->firstline) << 1;
|
||||
svga_doblit(svga->firstline_draw << 1, (svga->lastline_draw + 1) << 1, wx, wy, svga);
|
||||
svga_doblit(wx, wy, svga);
|
||||
} else {
|
||||
wy = svga->lastline - svga->firstline;
|
||||
svga_doblit(svga->firstline_draw, svga->lastline_draw + 1, wx, wy, svga);
|
||||
svga_doblit(wx, wy, svga);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1450,7 +1450,7 @@ svga_read_linear(uint32_t addr, void *p)
|
||||
|
||||
|
||||
void
|
||||
svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
|
||||
svga_doblit(int wx, int wy, svga_t *svga)
|
||||
{
|
||||
int y_add, x_add, y_start, x_start, bottom;
|
||||
uint32_t *p;
|
||||
@@ -1469,15 +1469,8 @@ svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
|
||||
bottom <<= 1;
|
||||
}
|
||||
|
||||
if ((wx <= 0) || (wy <= 0)) {
|
||||
video_blit_memtoscreen(x_start, y_start, 0, 0, 0, 0);
|
||||
if ((wx <= 0) || (wy <= 0))
|
||||
return;
|
||||
}
|
||||
|
||||
if (y1 > y2) {
|
||||
video_blit_memtoscreen(x_start, y_start, 0, 0, xsize + x_add, ysize + y_add);
|
||||
return;
|
||||
}
|
||||
|
||||
if (svga->vertical_linedbl)
|
||||
svga->y_add <<= 1;
|
||||
@@ -1531,7 +1524,7 @@ svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
|
||||
}
|
||||
}
|
||||
|
||||
video_blit_memtoscreen(x_start, y_start, y1, y2 + y_add, xsize + x_add, ysize + y_add);
|
||||
video_blit_memtoscreen(x_start, y_start, xsize + x_add, ysize + y_add);
|
||||
|
||||
if (svga->vertical_linedbl)
|
||||
svga->vertical_linedbl >>= 1;
|
||||
|
||||
@@ -147,7 +147,8 @@ video_cards[] = {
|
||||
{ "n9_9fx_pci", &s3_9fx_pci_device },
|
||||
{ "px_trio64_pci", &s3_phoenix_trio64_pci_device },
|
||||
{ "elsawin2kprox_pci", &s3_elsa_winner2000_pro_x_pci_device },
|
||||
{ "mirovideo40sv_pci", &s3_mirovideo_40sv_968_pci_device },
|
||||
{ "mirovideo40sv_pci", &s3_mirovideo_40sv_ergo_968_pci_device },
|
||||
{ "px_vision968_pci", &s3_phoenix_vision968_pci_device },
|
||||
{ "spea_mercury64p_pci", &s3_spea_mercury_p64v_pci_device },
|
||||
{ "px_vision868_pci", &s3_phoenix_vision868_pci_device },
|
||||
{ "px_trio64vplus_pci", &s3_phoenix_trio64vplus_pci_device },
|
||||
@@ -191,6 +192,7 @@ video_cards[] = {
|
||||
{ "px_s3_v7_805_vlb", &s3_spea_mirage_86c805_vlb_device },
|
||||
{ "stealth64v_vlb", &s3_diamond_stealth64_964_vlb_device },
|
||||
{ "mirocrystal20sv_vlb", &s3_mirocrystal_20sv_964_vlb_device },
|
||||
{ "mirocrystal20sd_vlb", &s3_mirocrystal_20sd_864_vlb_device },
|
||||
{ "bahamas64_vlb", &s3_bahamas64_vlb_device },
|
||||
{ "px_vision864_vlb", &s3_phoenix_vision864_vlb_device },
|
||||
{ "stealthse_vlb", &s3_diamond_stealth_se_vlb_device },
|
||||
@@ -199,6 +201,7 @@ video_cards[] = {
|
||||
{ "n9_9fx_vlb", &s3_9fx_vlb_device },
|
||||
{ "px_trio64_vlb", &s3_phoenix_trio64_vlb_device },
|
||||
{ "spea_miragep64_vlb", &s3_spea_mirage_p64_vlb_device },
|
||||
{ "px_vision968_vlb", &s3_phoenix_vision968_vlb_device },
|
||||
{ "px_vision868_vlb", &s3_phoenix_vision868_vlb_device },
|
||||
{ "ht216_32", &ht216_32_standalone_device },
|
||||
{ "virge325_vlb", &s3_virge_325_vlb_device },
|
||||
|
||||
@@ -655,7 +655,7 @@ skip_draw:
|
||||
thread_release_mutex(voodoo->force_blit_mutex);
|
||||
|
||||
if (voodoo->dirty_line_high > voodoo->dirty_line_low || force_blit)
|
||||
svga_doblit(0, voodoo->v_disp, voodoo->h_disp, voodoo->v_disp-1, voodoo->svga);
|
||||
svga_doblit(voodoo->h_disp, voodoo->v_disp-1, voodoo->svga);
|
||||
if (voodoo->clutData_dirty)
|
||||
{
|
||||
voodoo->clutData_dirty = 0;
|
||||
|
||||
@@ -870,7 +870,7 @@ void wy700_poll(void *p)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen_8(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen_8(0, 0, xsize, ysize);
|
||||
|
||||
frames++;
|
||||
/* Fixed 1280x800 resolution */
|
||||
|
||||
@@ -74,7 +74,6 @@
|
||||
|
||||
volatile int screenshots = 0;
|
||||
bitmap_t *buffer32 = NULL;
|
||||
bitmap_t *render_buffer = NULL;
|
||||
uint8_t fontdat[2048][8]; /* IBM CGA font */
|
||||
uint8_t fontdatm[2048][16]; /* IBM MDA font */
|
||||
uint8_t fontdatw[512][32]; /* Wyse700 font */
|
||||
@@ -245,7 +244,7 @@ const uint32_t shade[5][256] =
|
||||
|
||||
|
||||
static struct {
|
||||
int x, y, y1, y2, w, h;
|
||||
int x, y, w, h;
|
||||
int busy;
|
||||
int buffer_in_use;
|
||||
|
||||
@@ -256,7 +255,7 @@ static struct {
|
||||
} blit_data;
|
||||
|
||||
|
||||
static void (*blit_func)(int x, int y, int y1, int y2, int w, int h);
|
||||
static void (*blit_func)(int x, int y, int w, int h);
|
||||
|
||||
|
||||
#ifdef ENABLE_VIDEO_LOG
|
||||
@@ -280,7 +279,7 @@ video_log(const char *fmt, ...)
|
||||
|
||||
|
||||
void
|
||||
video_setblit(void(*blit)(int,int,int,int,int,int))
|
||||
video_setblit(void(*blit)(int,int,int,int))
|
||||
{
|
||||
blit_func = blit;
|
||||
}
|
||||
@@ -318,7 +317,7 @@ static png_infop info_ptr;
|
||||
|
||||
|
||||
static void
|
||||
video_take_screenshot(const char *fn, int startx, int starty, int y1, int y2, int w, int h)
|
||||
video_take_screenshot(const char *fn)
|
||||
{
|
||||
int i, x, y;
|
||||
png_bytep *b_rgb = NULL;
|
||||
@@ -350,25 +349,26 @@ video_take_screenshot(const char *fn, int startx, int starty, int y1, int y2, in
|
||||
|
||||
png_init_io(png_ptr, fp);
|
||||
|
||||
png_set_IHDR(png_ptr, info_ptr, w, h,
|
||||
png_set_IHDR(png_ptr, info_ptr, blit_data.w, blit_data.h,
|
||||
8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE,
|
||||
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE);
|
||||
|
||||
b_rgb = (png_bytep *) malloc(sizeof(png_bytep) * h);
|
||||
b_rgb = (png_bytep *) malloc(sizeof(png_bytep) * blit_data.h);
|
||||
if (b_rgb == NULL) {
|
||||
video_log("[video_take_screenshot] Unable to Allocate RGB Bitmap Memory");
|
||||
fclose(fp);
|
||||
return;
|
||||
}
|
||||
|
||||
for (y = 0; y < h; ++y) {
|
||||
for (y = 0; y < blit_data.h; ++y) {
|
||||
b_rgb[y] = (png_byte *) malloc(png_get_rowbytes(png_ptr, info_ptr));
|
||||
for (x = 0; x < w; ++x) {
|
||||
temp = render_buffer->dat[(y * w) + x];
|
||||
|
||||
b_rgb[y][(x) * 3 + 0] = (temp >> 16) & 0xff;
|
||||
b_rgb[y][(x) * 3 + 1] = (temp >> 8) & 0xff;
|
||||
b_rgb[y][(x) * 3 + 2] = temp & 0xff;
|
||||
for (x = 0; x < blit_data.w; ++x) {
|
||||
if (buffer32 == NULL)
|
||||
memset(&(b_rgb[y][x * 3]), 0x00, 3);
|
||||
else {
|
||||
temp = buffer32->line[blit_data.y + y][blit_data.x + x];
|
||||
memcpy(&(b_rgb[y][x * 3]), &temp, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ video_take_screenshot(const char *fn, int startx, int starty, int y1, int y2, in
|
||||
png_write_end(png_ptr, NULL);
|
||||
|
||||
/* cleanup heap allocation */
|
||||
for (i = 0; i < h; i++)
|
||||
for (i = 0; i < blit_data.h; i++)
|
||||
if (b_rgb[i]) free(b_rgb[i]);
|
||||
|
||||
if (b_rgb) free(b_rgb);
|
||||
@@ -389,7 +389,7 @@ video_take_screenshot(const char *fn, int startx, int starty, int y1, int y2, in
|
||||
|
||||
|
||||
static void
|
||||
video_screenshot(int x, int y, int y1, int y2, int w, int h)
|
||||
video_screenshot(void)
|
||||
{
|
||||
char path[1024], fn[128];
|
||||
|
||||
@@ -408,7 +408,7 @@ video_screenshot(int x, int y, int y1, int y2, int w, int h)
|
||||
|
||||
video_log("taking screenshot to: %s\n", path);
|
||||
|
||||
video_take_screenshot((const char *) path, x, y, y1, y2, w, h);
|
||||
video_take_screenshot((const char *) path);
|
||||
png_destroy_write_struct(&png_ptr, &info_ptr);
|
||||
}
|
||||
|
||||
@@ -418,10 +418,12 @@ video_transform_copy(uint32_t *dst, uint32_t *src, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
*dst = video_color_transform(*src);
|
||||
dst++;
|
||||
src++;
|
||||
if ((dst != NULL) && (src != NULL)) {
|
||||
for (i = 0; i < len; i++) {
|
||||
*dst = video_color_transform(*src);
|
||||
dst++;
|
||||
src++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -436,28 +438,22 @@ void blit_thread(void *param)
|
||||
thread_reset_event(blit_data.wake_blit_thread);
|
||||
MTR_BEGIN("video", "blit_thread");
|
||||
|
||||
if (blit_data.y2 > 0) {
|
||||
for (yy = blit_data.y1; yy < blit_data.y2; yy++) {
|
||||
if ((video_grayscale || invert_display) && (blit_data.h > 0)) {
|
||||
for (yy = 0; yy < blit_data.h; yy++) {
|
||||
if (((blit_data.y + yy) >= 0) && ((blit_data.y + yy) < buffer32->h)) {
|
||||
if (video_grayscale || invert_display)
|
||||
video_transform_copy(&(render_buffer->dat)[yy * blit_data.w], &(buffer32->line[blit_data.y + yy][blit_data.x]), blit_data.w);
|
||||
else
|
||||
memcpy(&(render_buffer->dat)[yy * blit_data.w], &(buffer32->line[blit_data.y + yy][blit_data.x]), blit_data.w << 2);
|
||||
video_transform_copy(&(buffer32->line[blit_data.y + yy][blit_data.x]), &(buffer32->line[blit_data.y + yy][blit_data.x]), blit_data.w);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (screenshots) {
|
||||
if (render_buffer != NULL)
|
||||
video_screenshot(blit_data.x, blit_data.y, blit_data.y1, blit_data.y2, blit_data.w, blit_data.h);
|
||||
video_screenshot();
|
||||
screenshots--;
|
||||
video_log("screenshot taken, %i left\n", screenshots);
|
||||
}
|
||||
|
||||
if (blit_func)
|
||||
blit_func(blit_data.x, blit_data.y,
|
||||
blit_data.y1, blit_data.y2,
|
||||
blit_data.w, blit_data.h);
|
||||
blit_func(blit_data.x, blit_data.y, blit_data.w, blit_data.h);
|
||||
|
||||
blit_data.busy = 0;
|
||||
|
||||
@@ -468,7 +464,7 @@ void blit_thread(void *param)
|
||||
|
||||
|
||||
void
|
||||
video_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h)
|
||||
video_blit_memtoscreen(int x, int y, int w, int h)
|
||||
{
|
||||
MTR_BEGIN("video", "video_blit_memtoscreen");
|
||||
|
||||
@@ -481,8 +477,6 @@ video_blit_memtoscreen(int x, int y, int y1, int y2, int w, int h)
|
||||
blit_data.buffer_in_use = 1;
|
||||
blit_data.x = x;
|
||||
blit_data.y = y;
|
||||
blit_data.y1 = y1;
|
||||
blit_data.y2 = y2;
|
||||
blit_data.w = w;
|
||||
blit_data.h = h;
|
||||
|
||||
@@ -546,7 +540,7 @@ video_blend(int x, int y)
|
||||
|
||||
|
||||
void
|
||||
video_blit_memtoscreen_8(int x, int y, int y1, int y2, int w, int h)
|
||||
video_blit_memtoscreen_8(int x, int y, int w, int h)
|
||||
{
|
||||
int yy, xx;
|
||||
|
||||
@@ -563,7 +557,7 @@ video_blit_memtoscreen_8(int x, int y, int y1, int y2, int w, int h)
|
||||
}
|
||||
}
|
||||
|
||||
video_blit_memtoscreen(x, y, y1, y2, w, h);
|
||||
video_blit_memtoscreen(x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
@@ -833,7 +827,6 @@ video_init(void)
|
||||
|
||||
/* Account for overscan. */
|
||||
buffer32 = create_bitmap(2048 + 64, 2048 + 64);
|
||||
render_buffer = create_bitmap(2048 + 64, 2048 + 64);
|
||||
|
||||
for (c = 0; c < 64; c++) {
|
||||
cgapal[c + 64].r = (((c & 4) ? 2 : 0) | ((c & 0x10) ? 1 : 0)) * 21;
|
||||
@@ -902,7 +895,6 @@ video_close(void)
|
||||
free(video_8togs);
|
||||
free(video_6to8);
|
||||
|
||||
destroy_bitmap(render_buffer);
|
||||
destroy_bitmap(buffer32);
|
||||
|
||||
if (fontdatksc5601) {
|
||||
|
||||
Reference in New Issue
Block a user