Added usable 3DFX emulation.
This commit is contained in:
parent
c11a771530
commit
708cf896d1
10 changed files with 2863 additions and 309 deletions
|
|
@ -285,7 +285,7 @@ int driveempty[2];
|
|||
|
||||
#define AMIBIOS (romset==ROM_AMI386 || romset==ROM_AMI486 || romset == ROM_WIN486)
|
||||
|
||||
int GAMEBLASTER, GUS, SSI2001;
|
||||
int GAMEBLASTER, GUS, SSI2001, voodoo_enabled;
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
|||
6
src/pc.c
6
src/pc.c
|
|
@ -246,7 +246,6 @@ void initpc()
|
|||
// CPUID=(is486 && (cpuspeed==7 || cpuspeed>=9));
|
||||
// pclog("Init - CPUID %i %i\n",CPUID,cpuspeed);
|
||||
shadowbios=0;
|
||||
voodoo_init();
|
||||
|
||||
#if __unix
|
||||
if (cdrom_drive == -1)
|
||||
|
|
@ -294,7 +293,8 @@ void resetpchard()
|
|||
device_add(&cms_device);
|
||||
if (SSI2001)
|
||||
device_add(&ssi2001_device);
|
||||
|
||||
if (voodoo_enabled)
|
||||
device_add(&voodoo_device);
|
||||
pc_reset();
|
||||
|
||||
resetide();
|
||||
|
|
@ -486,6 +486,7 @@ void loadconfig(char *fn)
|
|||
GAMEBLASTER = config_get_int(NULL, "gameblaster", 0);
|
||||
GUS = config_get_int(NULL, "gus", 0);
|
||||
SSI2001 = config_get_int(NULL, "ssi2001", 0);
|
||||
voodoo_enabled = config_get_int(NULL, "voodoo", 0);
|
||||
|
||||
model = config_get_int(NULL, "model", 14);
|
||||
|
||||
|
|
@ -540,6 +541,7 @@ void saveconfig()
|
|||
config_set_int(NULL, "gameblaster", GAMEBLASTER);
|
||||
config_set_int(NULL, "gus", GUS);
|
||||
config_set_int(NULL, "ssi2001", SSI2001);
|
||||
config_set_int(NULL, "voodoo", voodoo_enabled);
|
||||
|
||||
config_set_int(NULL, "model", model);
|
||||
config_set_int(NULL, "cpu_manufacturer", cpu_manufacturer);
|
||||
|
|
|
|||
11
src/pc.rc
11
src/pc.rc
|
|
@ -51,13 +51,13 @@ BEGIN
|
|||
END
|
||||
END
|
||||
|
||||
ConfigureDlg DIALOGEX 0, 0, 232+40, 256
|
||||
ConfigureDlg DIALOGEX 0, 0, 232+40, 272
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Configure PCem"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,64,232,50,14, WS_TABSTOP
|
||||
PUSHBUTTON "Cancel",IDCANCEL,128,232,50,14, WS_TABSTOP
|
||||
DEFPUSHBUTTON "OK",IDOK,64,248,50,14, WS_TABSTOP
|
||||
PUSHBUTTON "Cancel",IDCANCEL,128,248,50,14, WS_TABSTOP
|
||||
COMBOBOX IDC_COMBO1,62,16,157,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
COMBOBOX IDC_COMBOVID,62,36,157,120,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
|
||||
PUSHBUTTON "Configure", IDC_CONFIGUREVID, 224, 36, 40, 14, WS_TABSTOP
|
||||
|
|
@ -74,6 +74,8 @@ BEGIN
|
|||
CONTROL "Gravis Ultrasound",IDC_CHECKGUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,188,118,10
|
||||
CONTROL "Innovation SSI-2001",IDC_CHECKSSI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,204,118,10
|
||||
CONTROL "Composite CGA",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,220,118,10
|
||||
CONTROL "Voodoo Graphics",IDC_CHECKVOODOO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,236,118,10
|
||||
PUSHBUTTON "Configure", IDC_CONFIGUREVOODOO, 224, 236, 40, 14, WS_TABSTOP
|
||||
LTEXT "Machine :",IDC_STATIC,15,16,40,10
|
||||
LTEXT "Video :",IDC_STATIC,15,36,34,10
|
||||
LTEXT "CPU type :",IDC_STATIC,15,56,34,10
|
||||
|
|
@ -161,10 +163,11 @@ BEGIN
|
|||
LTEXT "", IDC_TEXT1, 7, 38, 136, 12
|
||||
END
|
||||
|
||||
StatusDlg DIALOGEX 0,0,186,186+20
|
||||
StatusDlg DIALOGEX 0,0,186,186+20+180
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Status"
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "1",IDC_STEXT_DEVICE,16,16,180,1000
|
||||
LTEXT "1",IDC_STEXT1,16,186,180,1000
|
||||
END
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@
|
|||
#define IDC_CHECK4 1013
|
||||
#define IDC_CHECKGUS 1014
|
||||
#define IDC_CHECKSSI 1015
|
||||
#define IDC_CHECKVOODOO 1016
|
||||
#define IDC_STATIC 1020
|
||||
#define IDC_EDIT1 1030
|
||||
#define IDC_EDIT2 1031
|
||||
|
|
@ -82,6 +83,7 @@
|
|||
|
||||
#define IDC_CONFIGUREVID 1200
|
||||
#define IDC_CONFIGURESND 1201
|
||||
#define IDC_CONFIGUREVOODOO 1202
|
||||
|
||||
#define IDC_CONFIG_BASE 1200
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,20 @@ extern uint8_t edatlookup[4][4];
|
|||
|
||||
uint8_t svga_rotate[8][256];
|
||||
|
||||
/*Primary SVGA device. As multiple video cards are not yet supported this is the
|
||||
only SVGA device.*/
|
||||
static svga_t *svga_pri;
|
||||
|
||||
svga_t *svga_get_pri()
|
||||
{
|
||||
return svga_pri;
|
||||
}
|
||||
void svga_set_override(svga_t *svga, int val)
|
||||
{
|
||||
if (svga->override && !val)
|
||||
svga->fullchange = changeframecount;
|
||||
svga->override = val;
|
||||
}
|
||||
|
||||
void svga_out(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
|
|
@ -441,12 +455,14 @@ void svga_poll(void *p)
|
|||
|
||||
if (svga->hwcursor_on || svga->overlay_on)
|
||||
svga->changedvram[svga->ma >> 12] = svga->changedvram[(svga->ma >> 12) + 1] = 2;
|
||||
|
||||
svga->render(svga);
|
||||
|
||||
if (!svga->override)
|
||||
svga->render(svga);
|
||||
|
||||
if (svga->overlay_on)
|
||||
{
|
||||
svga->overlay_draw(svga, svga->displine);
|
||||
if (!svga->override)
|
||||
svga->overlay_draw(svga, svga->displine);
|
||||
svga->overlay_on--;
|
||||
if (svga->overlay_on && svga->interlace)
|
||||
svga->overlay_on--;
|
||||
|
|
@ -454,7 +470,8 @@ void svga_poll(void *p)
|
|||
|
||||
if (svga->hwcursor_on)
|
||||
{
|
||||
svga->hwcursor_draw(svga, svga->displine);
|
||||
if (!svga->override)
|
||||
svga->hwcursor_draw(svga, svga->displine);
|
||||
svga->hwcursor_on--;
|
||||
if (svga->hwcursor_on && svga->interlace)
|
||||
svga->hwcursor_on--;
|
||||
|
|
@ -561,7 +578,8 @@ void svga_poll(void *p)
|
|||
wx = x;
|
||||
wy = svga->lastline - svga->firstline;
|
||||
|
||||
svga_doblit(svga->firstline_draw, svga->lastline_draw + 1, wx, wy, svga);
|
||||
if (!svga->override)
|
||||
svga_doblit(svga->firstline_draw, svga->lastline_draw + 1, wx, wy, svga);
|
||||
|
||||
readflash = 0;
|
||||
|
||||
|
|
@ -685,6 +703,9 @@ int svga_init(svga_t *svga, void *p, int memsize,
|
|||
|
||||
timer_add(svga_poll, &svga->vidtime, TIMER_ALWAYS_ENABLED, svga);
|
||||
vramp = svga->vram;
|
||||
|
||||
svga_pri = svga;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -692,6 +713,8 @@ void svga_close(svga_t *svga)
|
|||
{
|
||||
free(svga->changedvram);
|
||||
free(svga->vram);
|
||||
|
||||
svga_pri = NULL;
|
||||
}
|
||||
|
||||
#define egacycles 1
|
||||
|
|
|
|||
|
|
@ -103,6 +103,9 @@ typedef struct svga_t
|
|||
|
||||
void (*overlay_draw)(struct svga_t *svga, int displine);
|
||||
|
||||
/*If set then another device is driving the monitor output and the SVGA
|
||||
card should not attempt to display anything */
|
||||
int override;
|
||||
void *p;
|
||||
} svga_t;
|
||||
|
||||
|
|
@ -134,3 +137,6 @@ extern uint8_t svga_rotate[8][256];
|
|||
|
||||
void svga_out(uint16_t addr, uint8_t val, void *p);
|
||||
uint8_t svga_in(uint16_t addr, void *p);
|
||||
|
||||
svga_t *svga_get_pri();
|
||||
void svga_set_override(svga_t *svga, int val);
|
||||
|
|
|
|||
3099
src/vid_voodoo.c
3099
src/vid_voodoo.c
File diff suppressed because it is too large
Load diff
|
|
@ -1 +1 @@
|
|||
void voodoo_init();
|
||||
extern device_t voodoo_device;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "resources.h"
|
||||
#include "sound.h"
|
||||
#include "video.h"
|
||||
#include "vid_voodoo.h"
|
||||
#include "win.h"
|
||||
|
||||
extern int is486;
|
||||
|
|
@ -25,7 +26,7 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
int c, d;
|
||||
int rom, gfx, mem, fpu;
|
||||
int temp_cpu, temp_cpu_m, temp_model;
|
||||
int temp_GAMEBLASTER, temp_GUS, temp_SSI2001, temp_sound_card_current;
|
||||
int temp_GAMEBLASTER, temp_GUS, temp_SSI2001, temp_voodoo, temp_sound_card_current;
|
||||
// pclog("Dialog msg %i %08X\n",message,message);
|
||||
switch (message)
|
||||
{
|
||||
|
|
@ -133,6 +134,9 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
h=GetDlgItem(hdlg, IDC_CHECK4);
|
||||
SendMessage(h, BM_SETCHECK, cga_comp, 0);
|
||||
|
||||
h=GetDlgItem(hdlg, IDC_CHECKVOODOO);
|
||||
SendMessage(h, BM_SETCHECK, voodoo_enabled, 0);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_COMBOCHC);
|
||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"A little");
|
||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)"A bit");
|
||||
|
|
@ -205,10 +209,13 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
h = GetDlgItem(hdlg, IDC_CHECKSSI);
|
||||
temp_SSI2001 = SendMessage(h, BM_GETCHECK, 0, 0);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_CHECKVOODOO);
|
||||
temp_voodoo = SendMessage(h, BM_GETCHECK, 0, 0);
|
||||
|
||||
h = GetDlgItem(hdlg, IDC_COMBOSND);
|
||||
temp_sound_card_current = settings_list_to_sound[SendMessage(h, CB_GETCURSEL, 0, 0)];
|
||||
|
||||
if (temp_model != model || gfx != gfxcard || mem != mem_size || fpu != hasfpu || temp_GAMEBLASTER != GAMEBLASTER || temp_GUS != GUS || temp_SSI2001 != SSI2001 || temp_sound_card_current != sound_card_current)
|
||||
if (temp_model != model || gfx != gfxcard || mem != mem_size || fpu != hasfpu || temp_GAMEBLASTER != GAMEBLASTER || temp_GUS != GUS || temp_SSI2001 != SSI2001 || temp_sound_card_current != sound_card_current || temp_voodoo != voodoo_enabled)
|
||||
{
|
||||
if (MessageBox(NULL,"This will reset PCem!\nOkay to continue?","PCem",MB_OKCANCEL)==IDOK)
|
||||
{
|
||||
|
|
@ -222,6 +229,7 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
GUS = temp_GUS;
|
||||
SSI2001 = temp_SSI2001;
|
||||
sound_card_current = temp_sound_card_current;
|
||||
voodoo_enabled = temp_voodoo;
|
||||
|
||||
mem_resize();
|
||||
loadbios();
|
||||
|
|
@ -372,6 +380,10 @@ static BOOL CALLBACK config_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
else
|
||||
EnableWindow(h, FALSE);
|
||||
break;
|
||||
|
||||
case IDC_CONFIGUREVOODOO:
|
||||
deviceconfig_open(hdlg, (void *)&voodoo_device);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ static BOOL CALLBACK status_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPAR
|
|||
device_add_status_info(device_s, 4096);
|
||||
#endif
|
||||
SendDlgItemMessage(hdlg, IDC_STEXT_DEVICE, WM_SETTEXT, (WPARAM)NULL, (LPARAM)device_s);
|
||||
#ifdef DYNAREC
|
||||
device_s[0] = 0;
|
||||
device_add_status_info(device_s, 4096);
|
||||
SendDlgItemMessage(hdlg, IDC_STEXT1, WM_SETTEXT, (WPARAM)NULL, (LPARAM)device_s);
|
||||
#endif
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue