Another major change round. VNC moved to top level. More cleanups of global data, all VM processing now handled in pc.c (out of the platforms, yay!), and some video cleanups. This build MAY have issues with window sizes, resizing, and fullscreen will not work until the next build- sorry.

This commit is contained in:
waltje
2017-10-19 04:27:04 -04:00
parent bcffcb4d22
commit 1d60a99ea3
36 changed files with 1244 additions and 1001 deletions

View File

@@ -8,7 +8,7 @@
*
* Emulation of the old and new IBM CGA graphics cards.
*
* Version: @(#)vid_cga.c 1.0.5 2017/10/16
* Version: @(#)vid_cga.c 1.0.7 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -402,7 +402,7 @@ void cga_poll(void *p)
ysize = cga->lastline - cga->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
if (cga->composite)

View File

@@ -8,7 +8,7 @@
*
* Plantronics ColorPlus emulation.
*
* Version: @(#)vid_colorplus.c 1.0.1 2017/10/16
* Version: @(#)vid_colorplus.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -321,7 +321,7 @@ void colorplus_poll(void *p)
ysize = colorplus->cga.lastline - colorplus->cga.firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
if (colorplus->cga.composite)

View File

@@ -9,7 +9,7 @@
* Emulation of the EGA, Chips & Technologies SuperEGA, and
* AX JEGA graphics cards.
*
* Version: @(#)vid_ega.c 1.0.6 2017/10/16
* Version: @(#)vid_ega.c 1.0.8 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -687,9 +687,9 @@ void ega_poll(void *p)
}
if (ega->vres)
updatewindowsize(xsize + x_add_ex, (ysize << 1) + y_add_ex);
set_screen_size(xsize + x_add_ex, (ysize << 1) + y_add_ex);
else
updatewindowsize(xsize + x_add_ex, ysize + y_add_ex);
set_screen_size(xsize + x_add_ex, ysize + y_add_ex);
}
if (enable_overscan)

View File

@@ -8,7 +8,7 @@
*
* MDSI Genius VHR emulation.
*
* Version: @(#)vid_genius.c 1.0.1 2017/10/16
* Version: @(#)vid_genius.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -557,7 +557,7 @@ void genius_poll(void *p)
ysize = GENIUS_YSIZE;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen_8(0, 0, xsize, ysize);

View File

@@ -8,7 +8,7 @@
*
* Hercules emulation.
*
* Version: @(#)vid_hercules.c 1.0.2 2017/10/16
* Version: @(#)vid_hercules.c 1.0.4 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -290,7 +290,7 @@ void hercules_poll(void *p)
// printf("Resize to %i,%i - R1 %i\n",xsize,ysize,crtcm[1]);
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen_8(0, hercules->firstline, xsize, ysize);
frames++;

View File

@@ -8,7 +8,7 @@
*
* Hercules InColor emulation.
*
* Version: @(#)vid_herculesplus.c 1.0.1 2017/10/16
* Version: @(#)vid_herculesplus.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -639,7 +639,7 @@ void herculesplus_poll(void *p)
ysize = herculesplus->lastline - herculesplus->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen(0, herculesplus->firstline, 0, herculesplus->lastline - herculesplus->firstline, xsize, herculesplus->lastline - herculesplus->firstline);
frames++;

View File

@@ -8,7 +8,7 @@
*
* Hercules InColor emulation.
*
* Version: @(#)vid_incolor.c 1.0.1 2017/10/16
* Version: @(#)vid_incolor.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -986,7 +986,7 @@ void incolor_poll(void *p)
ysize = incolor->lastline - incolor->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen(0, incolor->firstline, 0, incolor->lastline - incolor->firstline, xsize, incolor->lastline - incolor->firstline);
frames++;

View File

@@ -8,7 +8,7 @@
*
* MDA emulation.
*
* Version: @(#)vid_mda.c 1.0.2 2017/10/16
* Version: @(#)vid_mda.c 1.0.4 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -249,7 +249,7 @@ void mda_poll(void *p)
ysize = mda->lastline - mda->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen_8(0, mda->firstline, xsize, mda->lastline - mda->firstline);
frames++;

View File

@@ -8,7 +8,7 @@
*
* Olivetti M24 video emulation- essentially double-res CGA.
*
* Version: @(#)vid_olivetti_m24.c 1.0.1 2017/10/16
* Version: @(#)vid_olivetti_m24.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -410,7 +410,7 @@ void m24_poll(void *p)
ysize = m24->lastline - m24->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize + 16);
set_screen_size(xsize, ysize + 16);
}
video_blit_memtoscreen_8(0, m24->firstline - 8, xsize, (m24->lastline - m24->firstline) + 16);

View File

@@ -15,7 +15,7 @@
* time as between 12 and 46 cycles. We currently always use
* the lower number.
*
* Version: @(#)vid_pc1512.c 1.0.1 2017/10/16
* Version: @(#)vid_pc1512.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -419,7 +419,7 @@ static void pc1512_poll(void *p)
ysize = pc1512->lastline - pc1512->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
video_blit_memtoscreen_8(0, pc1512->firstline - 4, xsize, (pc1512->lastline - pc1512->firstline) + 8);

View File

@@ -8,7 +8,7 @@
*
* Video emulation for IBM PCjr.
*
* Version: @(#)vid_pcjr.c 1.0.1 2017/10/16
* Version: @(#)vid_pcjr.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -509,7 +509,7 @@ void pcjr_poll(void *p)
ysize = pcjr->lastline - pcjr->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
if (pcjr->composite)

View File

@@ -11,7 +11,7 @@
* This is intended to be used by another SVGA driver,
* and not as a card in it's own right.
*
* Version: @(#)vid_svga.c 1.0.5 2017/10/16
* Version: @(#)vid_svga.c 1.0.7 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -1617,30 +1617,13 @@ void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
return;
}
if (((wx!=xsize) || ((wy + 1)!=ysize)) && !vid_resize)
{
xsize=wx;
ysize=wy+1;
if (xsize<64) xsize=640;
if (ysize<32) ysize=200;
if ((xsize > 2032) || (ysize > 2032))
{
x_add = 0;
y_add = 0;
suppress_overscan = 1;
}
else
{
suppress_overscan = 0;
}
updatewindowsize(xsize + x_add,ysize + y_add);
}
if (vid_resize)
if (((wx!=xsize) || ((wy+1)!=ysize)))
{
/* Screen res has changed.. fix up, and let them know. */
xsize = wx;
ysize = wy + 1;
ysize = wy+1;
if (xsize<64) xsize = 640;
if (ysize<32) ysize = 200;
if ((xsize > 2032) || (ysize > 2032))
{
@@ -1652,6 +1635,8 @@ void svga_doblit(int y1, int y2, int wx, int wy, svga_t *svga)
{
suppress_overscan = 0;
}
set_screen_size(xsize+x_add,ysize+y_add);
}
if (enable_overscan && !suppress_overscan)

View File

@@ -8,7 +8,7 @@
*
* Emulation of the Tandy Model 1000 video.
*
* Version: @(#)vid_tandy.c 1.0.1 2017/10/16
* Version: @(#)vid_tandy.c 1.0.2 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -546,7 +546,7 @@ void tandy_poll(void *p)
ysize = tandy->lastline - tandy->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
if (tandy->composite)

View File

@@ -8,7 +8,7 @@
*
* Emulation of the Tandy Model 1000/SL video.
*
* Version: @(#)vid_tandysl.c 1.0.1 2017/10/16
* Version: @(#)vid_tandysl.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -615,7 +615,7 @@ static void tandysl_poll(void *p)
ysize = tandy->lastline - tandy->firstline;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, (ysize << 1) + 16);
set_screen_size(xsize, (ysize << 1) + 16);
}
video_blit_memtoscreen_8(0, tandy->firstline-4, xsize, (tandy->lastline - tandy->firstline) + 8);

View File

@@ -8,7 +8,7 @@
*
* Wyse-700 emulation.
*
* Version: @(#)vid_wy700.c 1.0.1 2017/10/16
* Version: @(#)vid_wy700.c 1.0.3 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -866,7 +866,7 @@ void wy700_poll(void *p)
ysize = WY700_YSIZE;
if (xsize < 64) xsize = 656;
if (ysize < 32) ysize = 200;
updatewindowsize(xsize, ysize);
set_screen_size(xsize, ysize);
}
video_blit_memtoscreen_8(0, 0, xsize, ysize);

View File

@@ -40,7 +40,7 @@
* W = 3 bus clocks
* L = 4 bus clocks
*
* Version: @(#)video.c 1.0.2 2017/10/13
* Version: @(#)video.c 1.0.4 2017/10/18
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -73,33 +73,35 @@ enum {
};
int vid_cga_contrast = 0;
BITMAP *screen = NULL;
BITMAP *buffer= NULL,
*buffer32= NULL;
uint8_t fontdat[256][8]; /* IBM CGA font */
uint8_t fontdatm[256][16]; /* IBM MDA font */
uint8_t fontdatw[512][32]; /* Wyse700 font */
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
uint32_t pal_lookup[256];
int xsize = 1,
ysize = 1;
int cga_palette = 0;
int video_fullscreen = 0,
video_fullscreen_scale,
video_fullscreen_first;
uint32_t *video_6to8,
*video_15to32,
*video_16to32;
BITMAP *screen;
uint32_t *video_6to8 = NULL,
*video_15to32 = NULL,
*video_16to32 = NULL;
int egareads = 0,
egawrites = 0,
changeframecount = 2;
uint8_t rotatevga[8][256];
int frames = 0;
int fullchange;
int fullchange = 0;
uint8_t edatlookup[4][4];
int enable_overscan;
int overscan_x,
overscan_y;
int force_43;
int video_timing_b,
video_timing_w,
video_timing_l;
int video_res_x,
video_res_y,
video_bpp;
int video_speed = 0;
int overscan_x = 0,
overscan_y = 0;
int video_timing_b = 0,
video_timing_w = 0,
video_timing_l = 0;
int video_res_x = 0,
video_res_y = 0,
video_bpp = 0;
int video_timing[6][4] = {
{ VIDEO_ISA, 8, 16, 32 },
{ VIDEO_ISA, 6, 8, 16 },
@@ -108,14 +110,6 @@ int video_timing[6][4] = {
{ VIDEO_BUS, 4, 5, 10 },
{ VIDEO_BUS, 3, 3, 4 }
};
BITMAP *buffer,
*buffer32;
uint8_t fontdat[256][8];
uint8_t fontdatm[256][16];
uint8_t fontdatw[512][32]; /* Wyse700 font */
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
int xsize=1,
ysize=1;
PALETTE cgapal = {
{0,0,0}, {0,42,0}, {42,0,0}, {42,21,0},
{0,0,0}, {0,42,42}, {42,0,42}, {42,42,42},
@@ -181,7 +175,6 @@ PALETTE cgapal_mono[6] = {
{0x34,0x35,0x33},{0x37,0x37,0x34},{0x3e,0x3e,0x3a},{0x3f,0x3f,0x3b},
}
};
uint32_t pal_lookup[256];
static struct {
@@ -193,11 +186,11 @@ static struct {
event_t *wake_blit_thread;
event_t *blit_complete;
event_t *buffer_not_in_use;
} blit_data;
} blit_data;
static void (*memtoscreen_func)(int x, int y, int y1, int y2, int w, int h);
static void (*memtoscreen_8_func)(int x, int y, int w, int h);
static void (*blit_func)(int x, int y, int y1, int y2, int w, int h);
static void (*blit8_func)(int x, int y, int w, int h);
static
@@ -208,9 +201,9 @@ void blit_thread(void *param)
thread_reset_event(blit_data.wake_blit_thread);
if (blit_data.blit8)
memtoscreen_8_func(blit_data.x, blit_data.y, blit_data.w, blit_data.h);
blit8_func(blit_data.x, blit_data.y, blit_data.w, blit_data.h);
else
memtoscreen_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.y1, blit_data.y2, blit_data.w, blit_data.h);
blit_data.busy = 0;
thread_set_event(blit_data.blit_complete);
@@ -221,8 +214,8 @@ void blit_thread(void *param)
void
video_setblit(void(*blit8)(int,int,int,int),void(*blit)(int,int,int,int,int,int))
{
memtoscreen_func = blit;
memtoscreen_8_func = blit8;
blit_func = blit;
blit8_func = blit8;
}
@@ -297,6 +290,9 @@ cgapal_rebuild(void)
{
int c;
/* We cannot do this (yet) if we have not been enabled yet. */
if (video_6to8 == NULL) return;
for (c=0; c<256; c++) {
pal_lookup[c] = makecol(video_6to8[cgapal[c].r],
video_6to8[cgapal[c].g],
@@ -482,6 +478,8 @@ video_init(void)
{
int c, d, e;
pclog("VIDEO: initializing..\n");
/* Account for overscan. */
buffer32 = create_bitmap(2048, 2048);
@@ -583,7 +581,10 @@ loadfont(wchar_t *s, int format)
int c,d;
f = rom_fopen(s, L"rb");
if (f == NULL) return;
if (f == NULL) {
pclog("VIDEO: cannot load font '%ls', fmt=%d\n", s, format);
return;
}
switch (format) {
case 0: /* MDA */

View File

@@ -57,8 +57,6 @@ extern int video_res_x,
video_res_y,
video_bpp;
extern int vid_resize;
extern int winsizex,
winsizey;
extern int cga_palette;
extern int vid_cga_contrast;
extern int video_grayscale;