Added Matrox Mystique emulation. This is a work in progress, and has a few known

issues :
- Only YUV supported for scaled ILOAD operations
- Several BLTMOD formats missing
- Bad texturing in Actua Soccer
- Flickering in Croc (broken vsync waiting?)
- Turok doesn't swap buffers correctly
- Some missing features
This commit is contained in:
SarahW 2020-01-15 22:17:36 +00:00
commit 483c7db709
11 changed files with 5199 additions and 8 deletions

View file

@ -45,7 +45,7 @@ sound_sb.c sound_sb_dsp.c sound_sn76489.c sound_speaker.c sound_ssi2001.c sound_
sst39sf010.c tandy_eeprom.c tandy_rom.c t1000.c t3100e.c timer.c um8669f.c um8881f.c vid_ati_eeprom.c vid_ati_mach64.c \
vid_ati18800.c vid_ati28800.c vid_ati68860_ramdac.c vid_cga.c vid_cl5429.c vid_colorplus.c vid_compaq_cga.c vid_ega.c \
vid_et4000.c vid_et4000w32.c vid_genius.c vid_hercules.c vid_ht216.c vid_icd2061.c vid_ics2595.c vid_im1024.c \
vid_incolor.c vid_mda.c vid_olivetti_m24.c vid_oti037.c vid_oti067.c vid_paradise.c vid_pc200.c vid_pc1512.c \
vid_incolor.c vid_mda.c vid_mga.c vid_olivetti_m24.c vid_oti037.c vid_oti067.c vid_paradise.c vid_pc200.c vid_pc1512.c \
vid_pc1640.c vid_pcjr.c vid_pgc.c vid_ps1_svga.c vid_s3.c vid_s3_virge.c vid_sdac_ramdac.c vid_sigma.c \
vid_stg_ramdac.c vid_svga.c vid_svga_render.c vid_t1000.c vid_t3100e.c vid_tandy.c vid_tandysl.c vid_tgui9440.c \
vid_tkd8001_ramdac.c vid_tvga.c vid_unk_ramdac.c vid_vga.c vid_voodoo.c video.c wd76c10.c vid_wy700.c vt82c586b.c \

View file

@ -33,7 +33,7 @@ OBJ = 386.o 386_common.o 386_dynarec.o 386_dynarec_ops.o 808x.o 82091aa.o acc203
vid_ati_eeprom.o vid_ati_mach64.o vid_ati18800.o vid_ati28800.o vid_ati68860_ramdac.o vid_cga.o \
vid_cl5429.o vid_colorplus.o vid_compaq_cga.o vid_ega.o vid_et4000.o vid_et4000w32.o \
vid_et4000w32i.o vid_genius.o vid_hercules.o vid_ht216.o vid_icd2061.o vid_ics2595.o vid_im1024.o vid_incolor.o vid_mda.o \
vid_olivetti_m24.o vid_oti037.c vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_mga.o vid_olivetti_m24.o vid_oti037.c vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_pcjr.o vid_pgc.o vid_ps1_svga.o vid_s3.o vid_s3_virge.o vid_sdac_ramdac.o vid_sigma.o vid_stg_ramdac.o vid_svga.o \
vid_svga_render.o vid_t1000.o vid_t3100e.o vid_tandy.o vid_tandysl.o vid_tgui9440.o \
vid_tkd8001_ramdac.o vid_tvga.o vid_unk_ramdac.o vid_vga.o vid_voodoo.o vid_wy700.o video.o \

View file

@ -33,7 +33,7 @@ OBJ = 386.o 386_common.o 386_dynarec.o 386_dynarec_ops.o 808x.o 82091aa.o acc203
vid_ati_eeprom.o vid_ati_mach64.o vid_ati18800.o vid_ati28800.o vid_ati68860_ramdac.o vid_cga.o \
vid_cl5429.o vid_colorplus.o vid_compaq_cga.o vid_ega.o vid_et4000.o vid_et4000w32.o \
vid_et4000w32i.o vid_genius.o vid_hercules.o vid_ht216.o vid_icd2061.o vid_ics2595.o vid_im1024.o vid_incolor.o vid_mda.o \
vid_olivetti_m24.o vid_oti037.c vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_mga.o vid_olivetti_m24.o vid_oti037.c vid_oti067.o vid_paradise.o vid_pc1512.o vid_pc1640.o vid_pc200.o \
vid_pcjr.o vid_pgc.o vid_ps1_svga.o vid_s3.o vid_s3_virge.o vid_sdac_ramdac.o vid_sigma.o vid_stg_ramdac.o vid_svga.o \
vid_svga_render.o vid_t1000.o vid_t3100e.o vid_tandy.o vid_tandysl.o vid_tgui9440.o \
vid_tkd8001_ramdac.o vid_tvga.o vid_unk_ramdac.o vid_vga.o vid_voodoo.o vid_wy700.o video.o \

View file

@ -302,6 +302,8 @@ enum
GFX_PGC, /*Professional Graphics Controller */
GFX_IM1024, /*Vermont Microsystems IM1024 */
GFX_EGAWONDER800, /*ATI EGA Wonder 800+*/
GFX_MYSTIQUE, /*Matrox Mystique*/
GFX_MAX
};

View file

@ -9,4 +9,10 @@ void thread_reset_event(event_t *_event);
int thread_wait_event(event_t *event, int timeout);
void thread_destroy_event(event_t *_event);
typedef void mutex_t;
mutex_t *thread_create_mutex(void);
void thread_lock_mutex(mutex_t *mutex);
void thread_unlock_mutex(mutex_t *mutex);
void thread_destroy_mutex(mutex_t *mutex);
void thread_sleep(int t);

5130
src/vid_mga.c Normal file

File diff suppressed because it is too large Load diff

1
src/vid_mga.h Normal file
View file

@ -0,0 +1 @@
extern device_t mystique_device;

View file

@ -592,11 +592,19 @@ void svga_poll(void *p)
if (svga->vc == svga->split)
{
// pclog("VC split\n");
svga->ma = svga->maback = 0;
svga->sc = 0;
if (svga->attrregs[0x10] & 0x20)
svga->scrollcache = 0;
int ret = 1;
if (svga->line_compare)
ret = svga->line_compare(svga);
if (ret)
{
// pclog("VC split\n");
svga->ma = svga->maback = 0;
svga->sc = 0;
if (svga->attrregs[0x10] & 0x20)
svga->scrollcache = 0;
}
}
if (svga->vc == svga->dispend)
{

View file

@ -123,6 +123,11 @@ typedef struct svga_t
void (*vblank_start)(struct svga_t *svga);
/*Called when VC=R18 and friends. If this returns zero then MA resetting
is skipped. Matrox Mystique in Power mode reuses this counter for
vertical line interrupt*/
int (*line_compare)(struct svga_t *svga);
/*If set then another device is driving the monitor output and the SVGA
card should not attempt to display anything */
int override;

View file

@ -28,6 +28,7 @@
#include "vid_incolor.h"
#include "vid_colorplus.h"
#include "vid_mda.h"
#include "vid_mga.h"
#include "vid_olivetti_m24.h"
#include "vid_oti037.h"
#include "vid_oti067.h"
@ -98,6 +99,7 @@ static VIDEO_CARD video_cards[] =
{"Hercules", "hercules", &hercules_device, GFX_HERCULES, VIDEO_FLAG_TYPE_MDA, {VIDEO_ISA, 8, 16, 32, 8, 16, 32}},
{"Hercules InColor", "incolor", &incolor_device, GFX_INCOLOR, VIDEO_FLAG_TYPE_MDA, {VIDEO_ISA, 8, 16, 32, 8, 16, 32}},
{"Image Manager 1024", "im1024", &im1024_device, GFX_IM1024, VIDEO_FLAG_TYPE_CGA, {VIDEO_ISA, 8, 16, 32, 8, 16, 32}},
{"Matrox Mystique", "mystique", &mystique_device, GFX_MYSTIQUE, VIDEO_FLAG_TYPE_SPECIAL, {VIDEO_BUS, 4, 4, 4, 10, 10, 10}},
{"MDA", "mda", &mda_device, GFX_MDA, VIDEO_FLAG_TYPE_MDA, {VIDEO_ISA, 8, 16, 32, 8, 16, 32}},
{"MDSI Genius", "genius", &genius_device, GFX_GENIUS, VIDEO_FLAG_TYPE_CGA, {VIDEO_ISA, 8, 16, 32, 8, 16, 32}},
{"Number Nine 9FX (S3 Trio64)", "n9_9fx", &s3_9fx_device, GFX_N9_9FX, VIDEO_FLAG_TYPE_SPECIAL, {VIDEO_BUS, 3, 2, 4, 25, 25, 40}},

View file

@ -69,6 +69,43 @@ void thread_destroy_event(event_t *_event)
free(event);
}
typedef struct win_mutex_t
{
HANDLE handle;
} win_mutex_t;
mutex_t *thread_create_mutex(void)
{
win_mutex_t *mutex = malloc(sizeof(win_mutex_t));
mutex->handle = CreateSemaphore(NULL, 1, 1, NULL);
return mutex;
}
void thread_lock_mutex(mutex_t *_mutex)
{
win_mutex_t *mutex = (win_mutex_t *)_mutex;
WaitForSingleObject(mutex->handle, INFINITE);
}
void thread_unlock_mutex(mutex_t *_mutex)
{
win_mutex_t *mutex = (win_mutex_t *)_mutex;
ReleaseSemaphore(mutex->handle, 1, NULL);
}
void thread_destroy_mutex(mutex_t *_mutex)
{
win_mutex_t *mutex = (win_mutex_t *)_mutex;
CloseHandle(mutex->handle);
free(mutex);
}
#else
#include <pthread.h>
#include <unistd.h>