Amstrad changes :
- Add PPC512/640 emulation - Add TV display type to Sinclair PC200 - Add font selection to PC1512 - Add disc change line to PC200 Patch from JohnElliott
This commit is contained in:
parent
a5fc447950
commit
1f5fc45c04
20 changed files with 1281 additions and 138 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
#include "lpt.h"
|
#include "lpt.h"
|
||||||
#include "mouse.h"
|
#include "mouse.h"
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
|
#include "fdc.h"
|
||||||
|
|
||||||
#include "amstrad.h"
|
#include "amstrad.h"
|
||||||
|
|
||||||
|
|
@ -25,12 +26,15 @@ uint8_t amstrad_read(uint16_t port, void *priv)
|
||||||
case 0x37a:
|
case 0x37a:
|
||||||
temp = lpt1_read(port, NULL) & 0x1f;
|
temp = lpt1_read(port, NULL) & 0x1f;
|
||||||
if (romset == ROM_PC1512) return temp | 0x20;
|
if (romset == ROM_PC1512) return temp | 0x20;
|
||||||
if (romset == ROM_PC200)
|
if (romset == ROM_PC200 || romset == ROM_PPC512)
|
||||||
{
|
{
|
||||||
|
if (fdc_discchange_read())
|
||||||
|
temp |= 0x20;
|
||||||
|
/* DIP switches 4,5: Initial video mode */
|
||||||
if (video_is_cga())
|
if (video_is_cga())
|
||||||
temp |= 0x80;
|
temp |= 0x80; /* CGA 80 */
|
||||||
else if (video_is_mda())
|
else if (video_is_mda())
|
||||||
temp |= 0xc0;
|
temp |= 0xc0; /* MDA */
|
||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
if (romset == ROM_PC1640)
|
if (romset == ROM_PC1640)
|
||||||
|
|
@ -55,8 +59,13 @@ uint8_t amstrad_read(uint16_t port, void *priv)
|
||||||
}
|
}
|
||||||
return temp;
|
return temp;
|
||||||
case 0x3de:
|
case 0x3de:
|
||||||
return 0x20; /*PC200 - use external video. If internal video is being used
|
if (romset == ROM_PC200 || romset == ROM_PPC512)
|
||||||
then this port is handled in vid_pc200.c*/
|
{
|
||||||
|
/* Read DIP switches / internal display adapter status. This code is only
|
||||||
|
* reached if the IDA is disabled; if it is enabled this read will be
|
||||||
|
* handled by the video card */
|
||||||
|
}
|
||||||
|
return 0x20; /* Disable IDA */
|
||||||
case 0xdead:
|
case 0xdead:
|
||||||
return amstrad_dead;
|
return amstrad_dead;
|
||||||
}
|
}
|
||||||
|
|
@ -153,6 +162,6 @@ void amstrad_init()
|
||||||
io_sethandler(0x007a, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL, NULL);
|
io_sethandler(0x007a, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL, NULL);
|
||||||
io_sethandler(0x0378, 0x0003, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
io_sethandler(0x0378, 0x0003, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
||||||
io_sethandler(0xdead, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
io_sethandler(0xdead, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
||||||
if (romset == ROM_PC200 && gfxcard != GFX_BUILTIN)
|
if ((romset == ROM_PC200 || romset == ROM_PPC512) && gfxcard != GFX_BUILTIN)
|
||||||
io_sethandler(0x03de, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
io_sethandler(0x03de, 0x0001, amstrad_read, NULL, NULL, amstrad_write, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1421,6 +1421,11 @@ void fdc_discchange_clear(int drive)
|
||||||
disc_changed[drive] = 0;
|
disc_changed[drive] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int fdc_discchange_read()
|
||||||
|
{
|
||||||
|
return (disc_changed[fdc.drive] || drive_empty[fdc.drive]) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
void fdc_set_dskchg_activelow()
|
void fdc_set_dskchg_activelow()
|
||||||
{
|
{
|
||||||
fdc.dskchg_activelow = 1;
|
fdc.dskchg_activelow = 1;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ void fdc_reset();
|
||||||
void fdc_poll();
|
void fdc_poll();
|
||||||
void fdc_abort();
|
void fdc_abort();
|
||||||
void fdc_discchange_clear(int drive);
|
void fdc_discchange_clear(int drive);
|
||||||
|
int fdc_discchange_read();
|
||||||
void fdc_set_dskchg_activelow();
|
void fdc_set_dskchg_activelow();
|
||||||
void fdc_3f1_enable(int enable);
|
void fdc_3f1_enable(int enable);
|
||||||
void fdc_set_ps1();
|
void fdc_set_ps1();
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,8 @@ enum
|
||||||
ROM_TULIP_TC7,
|
ROM_TULIP_TC7,
|
||||||
ROM_ZD_SUPERS, /* [8088] Zenith Data Systems SupersPort */
|
ROM_ZD_SUPERS, /* [8088] Zenith Data Systems SupersPort */
|
||||||
ROM_PB410A,
|
ROM_PB410A,
|
||||||
|
ROM_PPC512,
|
||||||
|
|
||||||
ROM_MAX
|
ROM_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,9 @@ int loadbios()
|
||||||
FILE *f=NULL,*ff=NULL;
|
FILE *f=NULL,*ff=NULL;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
loadfont("mda.rom", 0);
|
loadfont("mda.rom", FONT_MDA);
|
||||||
loadfont("wy700.rom", 3);
|
loadfont("wy700.rom", FONT_WY700);
|
||||||
loadfont("8x12.bin", 4);
|
loadfont("8x12.bin", FONT_MDSI);
|
||||||
|
|
||||||
biosmask = 0xffff;
|
biosmask = 0xffff;
|
||||||
|
|
||||||
|
|
@ -85,7 +85,7 @@ int loadbios()
|
||||||
}
|
}
|
||||||
fclose(ff);
|
fclose(ff);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
loadfont("pc1512/40078.ic127", 2);
|
loadfont("pc1512/40078.ic127", FONT_CGA);
|
||||||
return 1;
|
return 1;
|
||||||
case ROM_PC1640:
|
case ROM_PC1640:
|
||||||
f=romfopen("pc1640/40044.v3","rb");
|
f=romfopen("pc1640/40044.v3","rb");
|
||||||
|
|
@ -113,7 +113,20 @@ int loadbios()
|
||||||
}
|
}
|
||||||
fclose(ff);
|
fclose(ff);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
loadfont("pc200/40109.bin", 1);
|
loadfont("pc200/40109.bin", FONT_PC200);
|
||||||
|
return 1;
|
||||||
|
case ROM_PPC512:
|
||||||
|
f=romfopen("ppc512/40107.v2","rb");
|
||||||
|
ff=romfopen("ppc512/40108.v2","rb");
|
||||||
|
if (!f || !ff) break;
|
||||||
|
for (c=0xC000;c<0x10000;c+=2)
|
||||||
|
{
|
||||||
|
rom[c]=getc(f);
|
||||||
|
rom[c+1]=getc(ff);
|
||||||
|
}
|
||||||
|
fclose(ff);
|
||||||
|
fclose(f);
|
||||||
|
loadfont("ppc512/40109.bin", FONT_PC200);
|
||||||
return 1;
|
return 1;
|
||||||
case ROM_TANDY:
|
case ROM_TANDY:
|
||||||
f=romfopen("tandy/tandy1t1.020","rb");
|
f=romfopen("tandy/tandy1t1.020","rb");
|
||||||
|
|
@ -759,7 +772,7 @@ int loadbios()
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case ROM_T3100E:
|
case ROM_T3100E:
|
||||||
loadfont("t3100e/t3100e_font.bin", 5);
|
loadfont("t3100e/t3100e_font.bin", FONT_T3100E);
|
||||||
f=romfopen("t3100e/t3100e.rom","rb");
|
f=romfopen("t3100e/t3100e.rom","rb");
|
||||||
if (!f) break;
|
if (!f) break;
|
||||||
romfread(rom,65536,1,f);
|
romfread(rom,65536,1,f);
|
||||||
|
|
@ -767,7 +780,7 @@ int loadbios()
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case ROM_T1000:
|
case ROM_T1000:
|
||||||
loadfont("t1000/t1000font.rom", 2);
|
loadfont("t1000/t1000font.rom", FONT_CGA);
|
||||||
f=romfopen("t1000/t1000.rom","rb");
|
f=romfopen("t1000/t1000.rom","rb");
|
||||||
if (!f) break;
|
if (!f) break;
|
||||||
romfread(rom, 0x8000,1,f);
|
romfread(rom, 0x8000,1,f);
|
||||||
|
|
@ -777,7 +790,7 @@ int loadbios()
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case ROM_T1200:
|
case ROM_T1200:
|
||||||
loadfont("t1200/t1000font.rom", 2);
|
loadfont("t1200/t1000font.rom", FONT_CGA);
|
||||||
f=romfopen("t1200/t1200_019e.ic15.bin","rb");
|
f=romfopen("t1200/t1200_019e.ic15.bin","rb");
|
||||||
if (!f) break;
|
if (!f) break;
|
||||||
romfread(rom, 0x8000,1,f);
|
romfread(rom, 0x8000,1,f);
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ MODEL models[] =
|
||||||
{"[8086] Amstrad PC1640", ROM_PC1640, "pc1640", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
{"[8086] Amstrad PC1640", ROM_PC1640, "pc1640", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
||||||
{"[8086] Amstrad PC2086", ROM_PC2086, "pc2086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
{"[8086] Amstrad PC2086", ROM_PC2086, "pc2086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
||||||
{"[8086] Amstrad PC3086", ROM_PC3086, "pc3086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
{"[8086] Amstrad PC3086", ROM_PC3086, "pc3086", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 640, 640, 0, ams_init, NULL},
|
||||||
|
{"[8086] Amstrad PPC512/640", ROM_PPC512, "ppc512", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL},
|
||||||
{"[8086] Olivetti M24", ROM_OLIM24, "olivetti_m24", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED|MODEL_OLIM24, 128, 640, 128, olim24_init, NULL},
|
{"[8086] Olivetti M24", ROM_OLIM24, "olivetti_m24", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED|MODEL_OLIM24, 128, 640, 128, olim24_init, NULL},
|
||||||
{"[8086] Sinclair PC200", ROM_PC200, "pc200", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL},
|
{"[8086] Sinclair PC200", ROM_PC200, "pc200", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_DISABLE_HW|MODEL_AMSTRAD, 512, 640, 128, ams_init, NULL},
|
||||||
{"[8086] Tandy 1000 SL/2", ROM_TANDY1000SL2, "tandy1000sl2", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED, 512, 768, 128, tandy1ksl2_init, NULL},
|
{"[8086] Tandy 1000 SL/2", ROM_TANDY1000SL2, "tandy1000sl2", { {"", cpus_8086}, {"", NULL}, {"", NULL}}, MODEL_GFX_FIXED, 512, 768, 128, tandy1ksl2_init, NULL},
|
||||||
|
|
@ -219,6 +220,11 @@ int model_getromset()
|
||||||
return models[model].id;
|
return models[model].id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int model_getromset_from_model(int model)
|
||||||
|
{
|
||||||
|
return models[model].id;
|
||||||
|
}
|
||||||
|
|
||||||
int model_getmodel(int romset)
|
int model_getmodel(int romset)
|
||||||
{
|
{
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ extern int model;
|
||||||
|
|
||||||
int model_count();
|
int model_count();
|
||||||
int model_getromset();
|
int model_getromset();
|
||||||
|
int model_getromset_from_model(int model);
|
||||||
int model_getmodel(int romset);
|
int model_getmodel(int romset);
|
||||||
char *model_getname();
|
char *model_getname();
|
||||||
char *model_get_internal_name();
|
char *model_get_internal_name();
|
||||||
|
|
|
||||||
11
src/nvr.c
11
src/nvr.c
|
|
@ -211,8 +211,15 @@ void writenvr(uint16_t addr, uint8_t val, void *priv)
|
||||||
are always enabled for PS/2 machines - this would mean that other peripherals
|
are always enabled for PS/2 machines - this would mean that other peripherals
|
||||||
could fire NMIs regardless of the mask state, but as there aren't any emulated
|
could fire NMIs regardless of the mask state, but as there aren't any emulated
|
||||||
MCA peripherals that do this it's currently a moot point.*/
|
MCA peripherals that do this it's currently a moot point.*/
|
||||||
if (!(models[model].flags & MODEL_MCA))
|
|
||||||
|
/* Also don't update the NMI mask on Amstrad PCs - actually
|
||||||
|
* ought not to do it for any XT because their NMI mask
|
||||||
|
* register is at 0xA0. But particularly important on the
|
||||||
|
* PC200 and PPC because their video subsystem issues NMIs */
|
||||||
|
if (!(models[model].flags & (MODEL_MCA | MODEL_AMSTRAD)))
|
||||||
|
{
|
||||||
nmi_mask = ~val & 0x80;
|
nmi_mask = ~val & 0x80;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -255,6 +262,7 @@ void loadnvr()
|
||||||
case ROM_PC200: f = nvrfopen("pc200.nvr", "rb"); break;
|
case ROM_PC200: f = nvrfopen("pc200.nvr", "rb"); break;
|
||||||
case ROM_PC2086: f = nvrfopen("pc2086.nvr", "rb"); break;
|
case ROM_PC2086: f = nvrfopen("pc2086.nvr", "rb"); break;
|
||||||
case ROM_PC3086: f = nvrfopen("pc3086.nvr", "rb"); break;
|
case ROM_PC3086: f = nvrfopen("pc3086.nvr", "rb"); break;
|
||||||
|
case ROM_PPC512: f = nvrfopen("ppc512.nvr", "rb"); break;
|
||||||
case ROM_IBMAT: f = nvrfopen("at.nvr", "rb"); break;
|
case ROM_IBMAT: f = nvrfopen("at.nvr", "rb"); break;
|
||||||
case ROM_IBMXT286: f = nvrfopen("ibmxt286.nvr", "rb"); break;
|
case ROM_IBMXT286: f = nvrfopen("ibmxt286.nvr", "rb"); break;
|
||||||
case ROM_IBMPS1_2011: f = nvrfopen("ibmps1_2011.nvr", "rb"); /*nvrmask = 127; */break;
|
case ROM_IBMPS1_2011: f = nvrfopen("ibmps1_2011.nvr", "rb"); /*nvrmask = 127; */break;
|
||||||
|
|
@ -352,6 +360,7 @@ void savenvr()
|
||||||
case ROM_PC200: f = nvrfopen("pc200.nvr", "wb"); break;
|
case ROM_PC200: f = nvrfopen("pc200.nvr", "wb"); break;
|
||||||
case ROM_PC2086: f = nvrfopen("pc2086.nvr", "wb"); break;
|
case ROM_PC2086: f = nvrfopen("pc2086.nvr", "wb"); break;
|
||||||
case ROM_PC3086: f = nvrfopen("pc3086.nvr", "wb"); break;
|
case ROM_PC3086: f = nvrfopen("pc3086.nvr", "wb"); break;
|
||||||
|
case ROM_PPC512: f = nvrfopen("ppc512.nvr", "wb"); break;
|
||||||
case ROM_IBMAT: f = nvrfopen("at.nvr", "wb"); break;
|
case ROM_IBMAT: f = nvrfopen("at.nvr", "wb"); break;
|
||||||
case ROM_IBMXT286: f = nvrfopen("ibmxt286.nvr", "wb"); break;
|
case ROM_IBMXT286: f = nvrfopen("ibmxt286.nvr", "wb"); break;
|
||||||
case ROM_IBMPS1_2011: f = nvrfopen("ibmps1_2011.nvr", "wb"); break;
|
case ROM_IBMPS1_2011: f = nvrfopen("ibmps1_2011.nvr", "wb"); break;
|
||||||
|
|
|
||||||
|
|
@ -364,7 +364,7 @@ void *ati28800k_init()
|
||||||
ati28800->ksc5601_mode_enabled = 0;
|
ati28800->ksc5601_mode_enabled = 0;
|
||||||
|
|
||||||
rom_init(&ati28800->bios_rom, "atikorvga.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
rom_init(&ati28800->bios_rom, "atikorvga.bin", 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
|
||||||
loadfont("ati_ksc5601.rom", 6);
|
loadfont("ati_ksc5601.rom", FONT_KSC5601);
|
||||||
|
|
||||||
svga_init(&ati28800->svga, ati28800, 1 << 19, /*512kb*/
|
svga_init(&ati28800->svga, ati28800, 1 << 19, /*512kb*/
|
||||||
ati28800k_recalctimings,
|
ati28800k_recalctimings,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#define GENIUS_YSIZE 1008
|
#define GENIUS_YSIZE 1008
|
||||||
|
|
||||||
void updatewindowsize(int x, int y);
|
void updatewindowsize(int x, int y);
|
||||||
void loadfont(char *s, int format);
|
|
||||||
|
|
||||||
extern uint8_t fontdat8x12[256][16];
|
extern uint8_t fontdat8x12[256][16];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,29 +8,6 @@
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vid_mda.h"
|
#include "vid_mda.h"
|
||||||
|
|
||||||
typedef struct mda_t
|
|
||||||
{
|
|
||||||
mem_mapping_t mapping;
|
|
||||||
|
|
||||||
uint8_t crtc[32];
|
|
||||||
int crtcreg;
|
|
||||||
|
|
||||||
uint8_t ctrl, stat;
|
|
||||||
|
|
||||||
int dispontime, dispofftime;
|
|
||||||
int vidtime;
|
|
||||||
|
|
||||||
int firstline, lastline;
|
|
||||||
|
|
||||||
int linepos, displine;
|
|
||||||
int vc, sc;
|
|
||||||
uint16_t ma, maback;
|
|
||||||
int con, coff, cursoron;
|
|
||||||
int dispon, blink;
|
|
||||||
int vsynctime, vadj;
|
|
||||||
|
|
||||||
uint8_t *vram;
|
|
||||||
} mda_t;
|
|
||||||
|
|
||||||
static uint32_t mdacols[256][2][2];
|
static uint32_t mdacols[256][2][2];
|
||||||
|
|
||||||
|
|
@ -261,19 +238,27 @@ void mda_poll(void *p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *mda_init()
|
void *mda_standalone_init()
|
||||||
{
|
{
|
||||||
int display_type;
|
|
||||||
int c;
|
|
||||||
mda_t *mda = malloc(sizeof(mda_t));
|
mda_t *mda = malloc(sizeof(mda_t));
|
||||||
|
|
||||||
memset(mda, 0, sizeof(mda_t));
|
memset(mda, 0, sizeof(mda_t));
|
||||||
|
mda_init(mda);
|
||||||
|
|
||||||
mda->vram = malloc(0x1000);
|
mda->vram = malloc(0x1000);
|
||||||
|
|
||||||
timer_add(mda_poll, &mda->vidtime, TIMER_ALWAYS_ENABLED, mda);
|
timer_add(mda_poll, &mda->vidtime, TIMER_ALWAYS_ENABLED, mda);
|
||||||
mem_mapping_add(&mda->mapping, 0xb0000, 0x08000, mda_read, NULL, NULL, mda_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, mda);
|
mem_mapping_add(&mda->mapping, 0xb0000, 0x08000, mda_read, NULL, NULL, mda_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, mda);
|
||||||
io_sethandler(0x03b0, 0x0010, mda_in, NULL, NULL, mda_out, NULL, NULL, mda);
|
io_sethandler(0x03b0, 0x0010, mda_in, NULL, NULL, mda_out, NULL, NULL, mda);
|
||||||
|
|
||||||
|
return mda;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void mda_init(mda_t *mda)
|
||||||
|
{
|
||||||
|
int display_type;
|
||||||
|
int c;
|
||||||
|
|
||||||
display_type = device_get_config_int("display_type");
|
display_type = device_get_config_int("display_type");
|
||||||
cgapal_rebuild(display_type, 0);
|
cgapal_rebuild(display_type, 0);
|
||||||
|
|
||||||
|
|
@ -295,8 +280,11 @@ void *mda_init()
|
||||||
mdacols[0x08][0][1] = mdacols[0x08][1][1] = cgapal[0];
|
mdacols[0x08][0][1] = mdacols[0x08][1][1] = cgapal[0];
|
||||||
mdacols[0x80][0][1] = mdacols[0x80][1][1] = cgapal[0];
|
mdacols[0x80][0][1] = mdacols[0x80][1][1] = cgapal[0];
|
||||||
mdacols[0x88][0][1] = mdacols[0x88][1][1] = cgapal[0];
|
mdacols[0x88][0][1] = mdacols[0x88][1][1] = cgapal[0];
|
||||||
|
}
|
||||||
|
|
||||||
return mda;
|
void mda_setcol(int chr, int blink, int fg, uint8_t cga_ink)
|
||||||
|
{
|
||||||
|
mdacols[chr][blink][fg] = cgapal[cga_ink];
|
||||||
}
|
}
|
||||||
|
|
||||||
void mda_close(void *p)
|
void mda_close(void *p)
|
||||||
|
|
@ -349,7 +337,7 @@ device_t mda_device =
|
||||||
{
|
{
|
||||||
"MDA",
|
"MDA",
|
||||||
0,
|
0,
|
||||||
mda_init,
|
mda_standalone_init,
|
||||||
mda_close,
|
mda_close,
|
||||||
NULL,
|
NULL,
|
||||||
mda_speed_changed,
|
mda_speed_changed,
|
||||||
|
|
|
||||||
|
|
@ -1 +1,38 @@
|
||||||
|
|
||||||
|
typedef struct mda_t
|
||||||
|
{
|
||||||
|
mem_mapping_t mapping;
|
||||||
|
|
||||||
|
uint8_t crtc[32];
|
||||||
|
int crtcreg;
|
||||||
|
|
||||||
|
uint8_t ctrl, stat;
|
||||||
|
|
||||||
|
int dispontime, dispofftime;
|
||||||
|
int vidtime;
|
||||||
|
|
||||||
|
int firstline, lastline;
|
||||||
|
|
||||||
|
int linepos, displine;
|
||||||
|
int vc, sc;
|
||||||
|
uint16_t ma, maback;
|
||||||
|
int con, coff, cursoron;
|
||||||
|
int dispon, blink;
|
||||||
|
int vsynctime, vadj;
|
||||||
|
|
||||||
|
uint8_t *vram;
|
||||||
|
} mda_t;
|
||||||
|
|
||||||
|
void mda_init(mda_t *mda);
|
||||||
|
void mda_out(uint16_t addr, uint8_t val, void *p);
|
||||||
|
uint8_t mda_in(uint16_t addr, void *p);
|
||||||
|
void mda_write(uint32_t addr, uint8_t val, void *p);
|
||||||
|
uint8_t mda_read(uint32_t addr, void *p);
|
||||||
|
void mda_recalctimings(mda_t *mda);
|
||||||
|
void mda_poll(void *p);
|
||||||
|
|
||||||
|
/* Override mapping of attribute to colour */
|
||||||
|
void mda_setcol(int chr, int blink, int fg, uint8_t cga_ink);
|
||||||
|
|
||||||
extern device_t mda_device;
|
extern device_t mda_device;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ typedef struct pc1512_t
|
||||||
|
|
||||||
uint8_t plane_write, plane_read, border;
|
uint8_t plane_write, plane_read, border;
|
||||||
|
|
||||||
|
int fontbase;
|
||||||
int linepos, displine;
|
int linepos, displine;
|
||||||
int sc, vc;
|
int sc, vc;
|
||||||
int cgadispon;
|
int cgadispon;
|
||||||
|
|
@ -220,12 +221,12 @@ static void pc1512_poll(void *p)
|
||||||
if (drawcursor)
|
if (drawcursor)
|
||||||
{
|
{
|
||||||
for (c = 0; c < 8; c++)
|
for (c = 0; c < 8; c++)
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 3) + c + 8] = cols[(fontdat[chr][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 3) + c + 8] = cols[(fontdat[chr + pc1512->fontbase][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (c = 0; c < 8; c++)
|
for (c = 0; c < 8; c++)
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 3) + c + 8] = cols[(fontdat[chr][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 3) + c + 8] = cols[(fontdat[chr + pc1512->fontbase][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||||
}
|
}
|
||||||
pc1512->ma++;
|
pc1512->ma++;
|
||||||
}
|
}
|
||||||
|
|
@ -254,13 +255,13 @@ static void pc1512_poll(void *p)
|
||||||
{
|
{
|
||||||
for (c = 0; c < 8; c++)
|
for (c = 0; c < 8; c++)
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 8] =
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 8] =
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 0xffffff;
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr + pc1512->fontbase][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0] ^ 0xffffff;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (c = 0; c < 8; c++)
|
for (c = 0; c < 8; c++)
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 8] =
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 8] =
|
||||||
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
((uint32_t *)buffer32->line[pc1512->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdat[chr + pc1512->fontbase][pc1512->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -451,6 +452,7 @@ static void pc1512_poll(void *p)
|
||||||
|
|
||||||
static void *pc1512_init()
|
static void *pc1512_init()
|
||||||
{
|
{
|
||||||
|
int display_type;
|
||||||
pc1512_t *pc1512 = malloc(sizeof(pc1512_t));
|
pc1512_t *pc1512 = malloc(sizeof(pc1512_t));
|
||||||
memset(pc1512, 0, sizeof(pc1512_t));
|
memset(pc1512, 0, sizeof(pc1512_t));
|
||||||
|
|
||||||
|
|
@ -458,10 +460,13 @@ static void *pc1512_init()
|
||||||
|
|
||||||
pc1512->cgacol = 7;
|
pc1512->cgacol = 7;
|
||||||
pc1512->cgamode = 0x12;
|
pc1512->cgamode = 0x12;
|
||||||
|
pc1512->fontbase = (device_get_config_int("codepage") & 3) * 256;
|
||||||
|
display_type = device_get_config_int("display_type");
|
||||||
|
|
||||||
timer_add(pc1512_poll, &pc1512->vidtime, TIMER_ALWAYS_ENABLED, pc1512);
|
timer_add(pc1512_poll, &pc1512->vidtime, TIMER_ALWAYS_ENABLED, pc1512);
|
||||||
mem_mapping_add(&pc1512->mapping, 0xb8000, 0x08000, pc1512_read, NULL, NULL, pc1512_write, NULL, NULL, NULL, 0, pc1512);
|
mem_mapping_add(&pc1512->mapping, 0xb8000, 0x08000, pc1512_read, NULL, NULL, pc1512_write, NULL, NULL, NULL, 0, pc1512);
|
||||||
io_sethandler(0x03d0, 0x0010, pc1512_in, NULL, NULL, pc1512_out, NULL, NULL, pc1512);
|
io_sethandler(0x03d0, 0x0010, pc1512_in, NULL, NULL, pc1512_out, NULL, NULL, pc1512);
|
||||||
|
cgapal_rebuild(display_type, 0);
|
||||||
return pc1512;
|
return pc1512;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -480,6 +485,57 @@ static void pc1512_speed_changed(void *p)
|
||||||
pc1512_recalctimings(pc1512);
|
pc1512_recalctimings(pc1512);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device_config_t pc1512_config[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.name = "display_type",
|
||||||
|
.description = "Display type",
|
||||||
|
.type = CONFIG_SELECTION,
|
||||||
|
.selection =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.description = "PC-CM (Colour)",
|
||||||
|
.value = DISPLAY_RGB
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "PC-MM (Monochrome)",
|
||||||
|
.value = DISPLAY_WHITE
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.name = "codepage",
|
||||||
|
.description = "Hardware font",
|
||||||
|
.type = CONFIG_SELECTION,
|
||||||
|
.selection =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
.description = "US English",
|
||||||
|
.value = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Danish",
|
||||||
|
.value = 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = "Greek",
|
||||||
|
.value = 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.description = ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
.default_int = 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.type = -1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
device_t pc1512_device =
|
device_t pc1512_device =
|
||||||
{
|
{
|
||||||
"Amstrad PC1512 (video)",
|
"Amstrad PC1512 (video)",
|
||||||
|
|
@ -489,5 +545,6 @@ device_t pc1512_device =
|
||||||
NULL,
|
NULL,
|
||||||
pc1512_speed_changed,
|
pc1512_speed_changed,
|
||||||
NULL,
|
NULL,
|
||||||
NULL
|
NULL,
|
||||||
|
pc1512_config
|
||||||
};
|
};
|
||||||
|
|
|
||||||
1039
src/vid_pc200.c
1039
src/vid_pc200.c
File diff suppressed because it is too large
Load diff
|
|
@ -1 +1,4 @@
|
||||||
extern device_t pc200_device;
|
extern device_t pc200_device;
|
||||||
|
extern device_t ppc512_device;
|
||||||
|
|
||||||
|
extern int pc200_is_mda;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
#include "video.h"
|
#include "video.h"
|
||||||
#include "vid_sigma.h"
|
#include "vid_sigma.h"
|
||||||
|
|
||||||
extern void loadfont(char *s, int format);
|
|
||||||
|
|
||||||
/* The Sigma Designs Color 400 is a video card from 1985, presumably intended
|
/* The Sigma Designs Color 400 is a video card from 1985, presumably intended
|
||||||
* as an EGA competitor.
|
* as an EGA competitor.
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
#define WY700_YSIZE 800
|
#define WY700_YSIZE 800
|
||||||
|
|
||||||
void updatewindowsize(int x, int y);
|
void updatewindowsize(int x, int y);
|
||||||
void loadfont(char *s, int format);
|
|
||||||
|
|
||||||
|
|
||||||
/* The Wyse 700 is an unusual video card. Though it has an MC6845 CRTC, this
|
/* The Wyse 700 is an unusual video card. Though it has an MC6845 CRTC, this
|
||||||
|
|
|
||||||
103
src/video.c
103
src/video.c
|
|
@ -151,7 +151,7 @@ char *video_card_getname(int card)
|
||||||
return video_cards[card].name;
|
return video_cards[card].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
device_t *video_card_getdevice(int card)
|
device_t *video_card_getdevice(int card, int romset)
|
||||||
{
|
{
|
||||||
switch (romset)
|
switch (romset)
|
||||||
{
|
{
|
||||||
|
|
@ -169,25 +169,30 @@ device_t *video_card_getdevice(int card)
|
||||||
return &pc1512_device;
|
return &pc1512_device;
|
||||||
|
|
||||||
case ROM_PC1640:
|
case ROM_PC1640:
|
||||||
if (gfxcard == GFX_BUILTIN)
|
if (card == GFX_BUILTIN)
|
||||||
return &pc1640_device;
|
return &pc1640_device;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROM_PC200:
|
case ROM_PC200:
|
||||||
if (gfxcard == GFX_BUILTIN)
|
if (card == GFX_BUILTIN)
|
||||||
return &pc200_device;
|
return &pc200_device;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ROM_PPC512:
|
||||||
|
if (card == GFX_BUILTIN)
|
||||||
|
return &ppc512_device;
|
||||||
|
break;
|
||||||
|
|
||||||
case ROM_OLIM24:
|
case ROM_OLIM24:
|
||||||
return &m24_device;
|
return &m24_device;
|
||||||
|
|
||||||
case ROM_PC2086:
|
case ROM_PC2086:
|
||||||
if (gfxcard == GFX_BUILTIN)
|
if (card == GFX_BUILTIN)
|
||||||
return ¶dise_pvga1a_pc2086_device;
|
return ¶dise_pvga1a_pc2086_device;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROM_PC3086:
|
case ROM_PC3086:
|
||||||
if (gfxcard == GFX_BUILTIN)
|
if (card == GFX_BUILTIN)
|
||||||
return ¶dise_pvga1a_pc3086_device;
|
return ¶dise_pvga1a_pc3086_device;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -234,11 +239,16 @@ device_t *video_card_getdevice(int card)
|
||||||
return video_cards[card].device;
|
return video_cards[card].device;
|
||||||
}
|
}
|
||||||
|
|
||||||
int video_card_has_config(int card)
|
int video_card_has_config(int card, int romset)
|
||||||
{
|
{
|
||||||
if (card == GFX_BUILTIN)
|
/* Allow builtin cards to have configuration */
|
||||||
|
device_t *device = video_card_getdevice(card, romset);
|
||||||
|
|
||||||
|
if (!device)
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
return video_cards[card].device->config ? 1 : 0;
|
}
|
||||||
|
return device->config ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int video_card_getid(char *s)
|
int video_card_getid(char *s)
|
||||||
|
|
@ -312,8 +322,16 @@ int video_is_mda()
|
||||||
{
|
{
|
||||||
switch (romset)
|
switch (romset)
|
||||||
{
|
{
|
||||||
case ROM_PC1640:
|
|
||||||
case ROM_PC200:
|
case ROM_PC200:
|
||||||
|
case ROM_PPC512:
|
||||||
|
if (gfxcard == GFX_BUILTIN)
|
||||||
|
{
|
||||||
|
/* The chipset here can emulate either CGA or MDA. Find out which */
|
||||||
|
return (pc200_is_mda);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PC1640:
|
||||||
case ROM_PC2086:
|
case ROM_PC2086:
|
||||||
case ROM_PC3086:
|
case ROM_PC3086:
|
||||||
case ROM_MEGAPC:
|
case ROM_MEGAPC:
|
||||||
|
|
@ -349,8 +367,14 @@ int video_is_cga()
|
||||||
switch (romset)
|
switch (romset)
|
||||||
{
|
{
|
||||||
case ROM_PC200:
|
case ROM_PC200:
|
||||||
if (gfxcard != GFX_BUILTIN)
|
case ROM_PPC512:
|
||||||
break;
|
if (gfxcard == GFX_BUILTIN)
|
||||||
|
{
|
||||||
|
/* The chipset here can emulate either CGA or MDA. Find out which */
|
||||||
|
return (!pc200_is_mda);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case ROM_IBMPCJR:
|
case ROM_IBMPCJR:
|
||||||
case ROM_TANDY:
|
case ROM_TANDY:
|
||||||
case ROM_TANDY1000HX:
|
case ROM_TANDY1000HX:
|
||||||
|
|
@ -394,6 +418,7 @@ int video_is_ega_vga()
|
||||||
case ROM_TANDY1000SL2:
|
case ROM_TANDY1000SL2:
|
||||||
case ROM_PC1512:
|
case ROM_PC1512:
|
||||||
case ROM_PC200:
|
case ROM_PC200:
|
||||||
|
case ROM_PPC512:
|
||||||
case ROM_OLIM24:
|
case ROM_OLIM24:
|
||||||
case ROM_T3100E:
|
case ROM_T3100E:
|
||||||
case ROM_T1000:
|
case ROM_T1000:
|
||||||
|
|
@ -514,6 +539,7 @@ void video_updatetiming()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROM_PC200:
|
case ROM_PC200:
|
||||||
|
case ROM_PPC512:
|
||||||
if (gfxcard == GFX_BUILTIN)
|
if (gfxcard == GFX_BUILTIN)
|
||||||
timing = &timing_pc200;
|
timing = &timing_pc200;
|
||||||
break;
|
break;
|
||||||
|
|
@ -676,6 +702,14 @@ void video_init()
|
||||||
device_add(&pc200_device);
|
device_add(&pc200_device);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ROM_PPC512:
|
||||||
|
if (gfxcard == GFX_BUILTIN)
|
||||||
|
{
|
||||||
|
device_add(&ppc512_device);
|
||||||
|
return;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROM_OLIM24:
|
case ROM_OLIM24:
|
||||||
|
|
@ -788,7 +822,7 @@ uint8_t fontdatksc5601_user[192][32]; /* Korean KSC-5601 user defined font */
|
||||||
|
|
||||||
int xsize=1,ysize=1;
|
int xsize=1,ysize=1;
|
||||||
|
|
||||||
void loadfont(char *s, int format)
|
void loadfont(char *s, fontformat_t format)
|
||||||
{
|
{
|
||||||
FILE *f=romfopen(s,"rb");
|
FILE *f=romfopen(s,"rb");
|
||||||
int c,d;
|
int c,d;
|
||||||
|
|
@ -800,7 +834,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case 0: /* MDA */
|
case FONT_MDA: /* MDA */
|
||||||
for (c=0;c<256;c++)
|
for (c=0;c<256;c++)
|
||||||
{
|
{
|
||||||
for (d=0;d<8;d++)
|
for (d=0;d<8;d++)
|
||||||
|
|
@ -824,33 +858,22 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1: /* PC200 */
|
case FONT_PC200: /* PC200 */
|
||||||
for (c=0;c<256;c++)
|
for (d=0;d<4;d++) /* There are 4 fonts in the ROM */
|
||||||
{
|
{
|
||||||
for (d=0;d<8;d++)
|
for (c=0;c<256;c++) /* 8x14 MDA in 8x16 cell */
|
||||||
|
{
|
||||||
|
fread(&fontdatm[256*d+c], 1, 16, f);
|
||||||
|
}
|
||||||
|
for (c=0;c<256; c++) /* 8x8 CGA in 8x16 cell */
|
||||||
{
|
{
|
||||||
fontdatm[c][d]=getc(f);
|
fread(fontdat[256*d+c], 1, 8, f);
|
||||||
|
fseek(f, 8, SEEK_CUR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (c=0;c<256;c++)
|
|
||||||
{
|
|
||||||
for (d=0;d<8;d++)
|
|
||||||
{
|
|
||||||
fontdatm[c][d+8]=getc(f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fseek(f, 4096, SEEK_SET);
|
|
||||||
for (c=0;c<256;c++)
|
|
||||||
{
|
|
||||||
for (d=0;d<8;d++)
|
|
||||||
{
|
|
||||||
fontdat[c][d]=getc(f);
|
|
||||||
}
|
|
||||||
for (d=0;d<8;d++) getc(f);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
case 2: /* CGA */
|
case FONT_CGA: /* CGA */
|
||||||
for (c=0;c<2048;c++) /* Allow up to 2048 chars */
|
for (c=0;c<2048;c++) /* Allow up to 2048 chars */
|
||||||
{
|
{
|
||||||
for (d=0;d<8;d++)
|
for (d=0;d<8;d++)
|
||||||
|
|
@ -859,7 +882,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3: /* Wyse 700 */
|
case FONT_WY700: /* Wyse 700 */
|
||||||
for (c=0;c<512;c++)
|
for (c=0;c<512;c++)
|
||||||
{
|
{
|
||||||
for (d=0;d<32;d++)
|
for (d=0;d<32;d++)
|
||||||
|
|
@ -868,7 +891,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: /* MDSI Genius */
|
case FONT_MDSI: /* MDSI Genius */
|
||||||
for (c=0;c<256;c++)
|
for (c=0;c<256;c++)
|
||||||
{
|
{
|
||||||
for (d=0;d<16;d++)
|
for (d=0;d<16;d++)
|
||||||
|
|
@ -877,7 +900,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5: /* Toshiba 3100e */
|
case FONT_T3100E: /* Toshiba 3100e */
|
||||||
for (d = 0; d < 2048; d += 512) /* Four languages... */
|
for (d = 0; d < 2048; d += 512) /* Four languages... */
|
||||||
{
|
{
|
||||||
for (c = d; c < d+256; c++)
|
for (c = d; c < d+256; c++)
|
||||||
|
|
@ -907,7 +930,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6: /* Korean KSC-5601 */
|
case FONT_KSC5601: /* Korean KSC-5601 */
|
||||||
for (c=0;c<16384;c++)
|
for (c=0;c<16384;c++)
|
||||||
{
|
{
|
||||||
for (d=0;d<32;d++)
|
for (d=0;d<32;d++)
|
||||||
|
|
@ -916,7 +939,7 @@ void loadfont(char *s, int format)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7: /* Sigma Color 400 */
|
case FONT_SIGMA400: /* Sigma Color 400 */
|
||||||
/* The first 4k of the character ROM holds an 8x8 font */
|
/* The first 4k of the character ROM holds an 8x8 font */
|
||||||
for (c = 0; c < 256; c++)
|
for (c = 0; c < 256; c++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
20
src/video.h
20
src/video.h
|
|
@ -23,8 +23,8 @@ extern BITMAP *buffer32;
|
||||||
|
|
||||||
int video_card_available(int card);
|
int video_card_available(int card);
|
||||||
char *video_card_getname(int card);
|
char *video_card_getname(int card);
|
||||||
struct device_t *video_card_getdevice(int card);
|
struct device_t *video_card_getdevice(int card, int romset);
|
||||||
int video_card_has_config(int card);
|
int video_card_has_config(int card, int romset);
|
||||||
int video_card_getid(char *s);
|
int video_card_getid(char *s);
|
||||||
int video_old_to_new(int card);
|
int video_old_to_new(int card);
|
||||||
int video_new_to_old(int card);
|
int video_new_to_old(int card);
|
||||||
|
|
@ -82,7 +82,21 @@ extern int vid_resize;
|
||||||
|
|
||||||
void video_wait_for_blit();
|
void video_wait_for_blit();
|
||||||
void video_wait_for_buffer();
|
void video_wait_for_buffer();
|
||||||
void loadfont(char *s, int format);
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
FONT_MDA, /* MDA 8x14 */
|
||||||
|
FONT_PC200, /* MDA 8x14 and CGA 8x8, four fonts */
|
||||||
|
FONT_CGA, /* CGA 8x8, two fonts */
|
||||||
|
FONT_WY700, /* Wy700 16x16, two fonts */
|
||||||
|
FONT_MDSI, /* MDSI Genius 8x12 */
|
||||||
|
FONT_T3100E, /* Toshiba T3100e, four fonts */
|
||||||
|
FONT_KSC5601, /* Korean KSC-5601 */
|
||||||
|
FONT_SIGMA400, /* Sigma Color 400, 8x8 and 8x16 */
|
||||||
|
|
||||||
|
} fontformat_t;
|
||||||
|
|
||||||
|
void loadfont(char *s, fontformat_t format);
|
||||||
|
|
||||||
void initvideo();
|
void initvideo();
|
||||||
void video_init();
|
void video_init();
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,7 @@ static void recalc_vid_list(void* hdlg, int model, int force_builtin_video)
|
||||||
int c = 0, d = 0;
|
int c = 0, d = 0;
|
||||||
int found_card = 0;
|
int found_card = 0;
|
||||||
int cur_gfxcard = gfxcard;
|
int cur_gfxcard = gfxcard;
|
||||||
|
int romset = model_getromset_from_model(model);
|
||||||
|
|
||||||
wx_sendmessage(h, WX_CB_RESETCONTENT, 0, 0);
|
wx_sendmessage(h, WX_CB_RESETCONTENT, 0, 0);
|
||||||
wx_sendmessage(h, WX_CB_SETCURSEL, 0, 0);
|
wx_sendmessage(h, WX_CB_SETCURSEL, 0, 0);
|
||||||
|
|
@ -92,7 +93,7 @@ static void recalc_vid_list(void* hdlg, int model, int force_builtin_video)
|
||||||
wx_sendmessage(h, WX_CB_SETCURSEL, 0, 0);
|
wx_sendmessage(h, WX_CB_SETCURSEL, 0, 0);
|
||||||
wx_enablewindow(h, FALSE);
|
wx_enablewindow(h, FALSE);
|
||||||
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
||||||
wx_enablewindow(h, FALSE);
|
wx_enablewindow(h, video_card_has_config(gfxcard, romset));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,6 +109,9 @@ static void recalc_vid_list(void* hdlg, int model, int force_builtin_video)
|
||||||
d++;
|
d++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cur_gfxcard == GFX_BUILTIN && !model_has_fixed_gfx(model) && !model_has_optional_gfx(model))
|
||||||
|
cur_gfxcard = 0;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
char *s = video_card_getname(c);
|
char *s = video_card_getname(c);
|
||||||
|
|
@ -116,7 +120,7 @@ static void recalc_vid_list(void* hdlg, int model, int force_builtin_video)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (video_card_available(c) && gfx_present[video_new_to_old(c)] &&
|
if (video_card_available(c) && gfx_present[video_new_to_old(c)] &&
|
||||||
((models[model].flags & MODEL_PCI) || !(video_card_getdevice(c)->flags & DEVICE_PCI)))
|
((models[model].flags & MODEL_PCI) || !(video_card_getdevice(c, romset)->flags & DEVICE_PCI)))
|
||||||
{
|
{
|
||||||
wx_sendmessage(h, WX_CB_ADDSTRING, 0, (LONG_PARAM)s);
|
wx_sendmessage(h, WX_CB_ADDSTRING, 0, (LONG_PARAM)s);
|
||||||
if (video_new_to_old(c) == gfxcard && !found_card)
|
if (video_new_to_old(c) == gfxcard && !found_card)
|
||||||
|
|
@ -135,7 +139,7 @@ static void recalc_vid_list(void* hdlg, int model, int force_builtin_video)
|
||||||
wx_enablewindow(h, TRUE);
|
wx_enablewindow(h, TRUE);
|
||||||
|
|
||||||
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
||||||
if (video_card_has_config(video_old_to_new(cur_gfxcard)))
|
if (video_card_has_config(video_old_to_new(cur_gfxcard), romset))
|
||||||
wx_enablewindow(h, TRUE);
|
wx_enablewindow(h, TRUE);
|
||||||
else
|
else
|
||||||
wx_enablewindow(h, FALSE);
|
wx_enablewindow(h, FALSE);
|
||||||
|
|
@ -1095,11 +1099,11 @@ int config_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM lParam)
|
||||||
else if (wParam == WX_ID("IDC_CONFIGUREVID"))
|
else if (wParam == WX_ID("IDC_CONFIGUREVID"))
|
||||||
{
|
{
|
||||||
h = wx_getdlgitem(hdlg, WX_ID("IDC_COMBOVID"));
|
h = wx_getdlgitem(hdlg, WX_ID("IDC_COMBOVID"));
|
||||||
wx_sendmessage(h, WX_CB_GETLBTEXT, wx_sendmessage(h, WX_CB_GETCURSEL, 0, 0),
|
wx_sendmessage(h, WX_CB_GETLBTEXT, wx_sendmessage(h, WX_CB_GETCURSEL, 0, 0), (LONG_PARAM) temp_str);
|
||||||
(LONG_PARAM) temp_str);
|
h = wx_getdlgitem(hdlg, WX_ID("IDC_COMBO1"));
|
||||||
|
temp_model = listtomodel[wx_sendmessage(h, WX_CB_GETCURSEL, 0, 0)];
|
||||||
|
|
||||||
deviceconfig_open(hdlg,
|
deviceconfig_open(hdlg, (void *)video_card_getdevice(video_card_getid(temp_str), model_getromset_from_model(temp_model)));
|
||||||
(void *) video_card_getdevice(video_card_getid(temp_str)));
|
|
||||||
}
|
}
|
||||||
else if (wParam == WX_ID("IDC_COMBOVID"))
|
else if (wParam == WX_ID("IDC_COMBOVID"))
|
||||||
{
|
{
|
||||||
|
|
@ -1112,7 +1116,7 @@ int config_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM lParam)
|
||||||
gfx = video_card_getid(temp_str);
|
gfx = video_card_getid(temp_str);
|
||||||
|
|
||||||
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
h = wx_getdlgitem(hdlg, WX_ID("IDC_CONFIGUREVID"));
|
||||||
if (video_card_has_config(gfx) && !model_has_fixed_gfx(temp_model))
|
if (video_card_has_config(gfx, model_getromset_from_model(temp_model)))
|
||||||
wx_enablewindow(h, TRUE);
|
wx_enablewindow(h, TRUE);
|
||||||
else
|
else
|
||||||
wx_enablewindow(h, FALSE);
|
wx_enablewindow(h, FALSE);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue