Do not allow mouse capturing if no mouse configured, patch from VARCem;

Reimplemented saving of all the non-volatile things of the Toshiba T1000 and T1200;
Applied the latest T1200 patch from John Elliott;
Applied the latest ATI Korean VGA patch from greatpsycho.
This commit is contained in:
OBattler
2018-03-19 04:19:19 +01:00
parent 089041a5f3
commit 473fd383d2
10 changed files with 234 additions and 101 deletions

View File

@@ -51,7 +51,7 @@
* NOTE: Still need to figure out a way to load/save ConfigSys and * NOTE: Still need to figure out a way to load/save ConfigSys and
* HardRAM stuff. Needs to be linked in to the NVR code. * HardRAM stuff. Needs to be linked in to the NVR code.
* *
* Version: @(#)m_xt_t1000.c 1.0.3 2018/03/18 * Version: @(#)m_xt_t1000.c 1.0.4 2018/03/19
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -96,6 +96,7 @@
#include "../device.h" #include "../device.h"
#include "../keyboard.h" #include "../keyboard.h"
#include "../lpt.h" #include "../lpt.h"
#include "../mem.h"
#include "../floppy/fdd.h" #include "../floppy/fdd.h"
#include "../floppy/fdc.h" #include "../floppy/fdc.h"
#include "../game/gameport.h" #include "../game/gameport.h"
@@ -141,7 +142,8 @@ typedef struct {
mem_mapping_t rom_mapping; mem_mapping_t rom_mapping;
/* CONFIG.SYS drive. */ /* CONFIG.SYS drive. */
uint8_t config[160]; uint8_t t1000_nvram[160];
uint8_t t1200_nvram[160];
/* System control registers */ /* System control registers */
uint8_t sys_ctl[16]; uint8_t sys_ctl[16];
@@ -153,6 +155,7 @@ typedef struct {
uint8_t nvr_tick; uint8_t nvr_tick;
int nvr_addr; int nvr_addr;
uint8_t nvr_active; uint8_t nvr_active;
mem_mapping_t nvr_mapping; /* T1200 NVRAM mapping */
/* EMS data */ /* EMS data */
uint8_t ems_reg[4]; uint8_t ems_reg[4];
@@ -662,7 +665,7 @@ t1000_read_nvram(uint16_t addr, void *priv)
switch (addr) { switch (addr) {
case 0xc2: /* Read next byte from NVRAM */ case 0xc2: /* Read next byte from NVRAM */
if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) if (sys->nvr_addr >= 0 && sys->nvr_addr < 160)
tmp = sys->t1000_nvram[sys->nvr_addr]; tmp = sys->t1000_nvram[sys->nvr_addr];
sys->nvr_addr++; sys->nvr_addr++;
break; break;
@@ -696,9 +699,9 @@ t1000_write_nvram(uint16_t addr, uint8_t val, void *priv)
break; break;
case 0xc1: /* Write next byte to NVRAM */ case 0xc1: /* Write next byte to NVRAM */
if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) { if (sys->nvr_addr >= 0 && sys->nvr_addr < 160) {
if (sys->t1000_nvram[sys->nvr_addr] != val) if (sys->t1000_nvram[sys->nvr_addr] != val)
nvr_dosave = 1; nvr_dosave = 1;
sys->t1000_nvram[sys->nvr_addr] = val; sys->t1000_nvram[sys->nvr_addr] = val;
} }
sys->nvr_addr++; sys->nvr_addr++;
@@ -722,6 +725,26 @@ t1000_write_nvram(uint16_t addr, uint8_t val, void *priv)
} }
} }
static
uint8_t read_t1200_nvram(uint32_t addr, void *priv)
{
t1000_t *sys = (t1000_t *)priv;
return sys->t1200_nvram[addr & 0x7FF];
}
static void write_t1200_nvram(uint32_t addr, uint8_t value, void *priv)
{
t1000_t *sys = (t1000_t *)priv;
if (sys->t1200_nvram[addr & 0x7FF] != value)
nvr_dosave = 1;
sys->t1200_nvram[addr & 0x7FF] = value;
}
/* Port 0xC8 controls the ROM drive */ /* Port 0xC8 controls the ROM drive */
static uint8_t static uint8_t
@@ -898,6 +921,12 @@ machine_xt_t1200_init(const machine_t *model)
read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000); read_ctl,NULL,NULL, write_ctl,NULL,NULL, &t1000);
machine_common_init(model); machine_common_init(model);
mem_mapping_add(&t1000.nvr_mapping,
0x000f0000, 2048,
read_t1200_nvram, NULL, NULL,
write_t1200_nvram, NULL, NULL,
NULL, 0, &t1000);
pit_set_out_func(&pit, 1, pit_refresh_timer_xt); pit_set_out_func(&pit, 1, pit_refresh_timer_xt);
device_add(&keyboard_xt_device); device_add(&keyboard_xt_device);
@@ -918,36 +947,62 @@ t1000_syskey(uint8_t andmask, uint8_t ormask, uint8_t xormask)
t1000.syskeys ^= xormask; t1000.syskeys ^= xormask;
} }
#if 0
static void static void
t1000_configsys_load(void) t1000_configsys_load(void)
{ {
FILE *f; FILE *f;
memset(t1000.t1000_nvram, 0x1a, sizeof(t1000.t1000_nvram)); memset(t1000.t1000_nvram, 0x1a, sizeof(t1000.t1000_nvram));
f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"rb"); f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"rb");
if (f != NULL) { if (f != NULL) {
fread(t1000.t1000_nvram, sizeof(t1000.t1000_nvram), 1, f); fread(t1000.t1000_nvram, sizeof(t1000.t1000_nvram), 1, f);
fclose(f); fclose(f);
} }
} }
static void static void
t1000_configsys_save(void) t1000_configsys_save(void)
{ {
FILE *f; FILE *f;
f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb"); f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb");
if (f != NULL) { if (f != NULL) {
fwrite(t1000.t1000_nvram, sizeof(t1000.t1000_nvram), 1, f);
fclose(f);
}
}
static void
t1200_state_load(void)
{
FILE *f;
memset(t1000.t1200_nvram, 0x1a, sizeof(t1000.t1200_nvram));
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"rb");
if (f != NULL) {
fread(t1000.t1200_nvram, sizeof(t1000.t1200_nvram), 1, f);
fclose(f);
}
}
static void
t1200_state_save(void)
{
FILE *f;
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"wb");
if (f != NULL) {
fwrite(t1000.t1200_nvram, sizeof(t1000.t1200_nvram), 1, f); fwrite(t1000.t1200_nvram, sizeof(t1000.t1200_nvram), 1, f);
fclose(f); fclose(f);
} }
} }
/* All RAM beyond 512k is non-volatile */ /* All RAM beyond 512k is non-volatile */
static void static void
t1000_emsboard_load(void) t1000_emsboard_load(void)
{ {
@@ -962,7 +1017,7 @@ t1000_emsboard_load(void)
} }
} }
static void static void
t1000_emsboard_save(void) t1000_emsboard_save(void)
{ {
@@ -975,4 +1030,35 @@ t1000_emsboard_save(void)
fclose(f); fclose(f);
} }
} }
} }
void
t1000_nvr_load(void)
{
t1000_emsboard_load();
t1000_configsys_load();
}
void
t1000_nvr_save(void)
{
t1000_emsboard_save();
t1000_configsys_save();
}
void
t1200_nvr_load(void)
{
t1000_emsboard_load();
t1200_state_load();
}
void
t1200_nvr_save(void)
{
t1000_emsboard_save();
t1200_state_save();

View File

@@ -8,7 +8,7 @@
* *
* Definitions for the Toshiba T1000/T1200 machines. * Definitions for the Toshiba T1000/T1200 machines.
* *
* Version: @(#)m_xt_t1000.h 1.0.3 2018/03/18 * Version: @(#)m_xt_t1000.h 1.0.4 2018/03/19
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -49,11 +49,11 @@ extern void t1000_display_set(uint8_t internal);
extern void t1000_syskey(uint8_t amask, uint8_t omask, uint8_t xmask); extern void t1000_syskey(uint8_t amask, uint8_t omask, uint8_t xmask);
extern void t1000_configsys_load(void); extern void t1000_nvr_load(void);
extern void t1000_configsys_save(void); extern void t1000_nvr_save(void);
extern void t1000_emsboard_load(void); extern void t1200_nvr_load(void);
extern void t1000_emsboard_save(void); extern void t1200_nvr_save(void);
#endif /*MACHINE_T1000_H*/ #endif /*MACHINE_T1000_H*/

View File

@@ -11,7 +11,7 @@
* TODO: Add the Genius bus- and serial mouse. * TODO: Add the Genius bus- and serial mouse.
* Remove the '3-button' flag from mouse types. * Remove the '3-button' flag from mouse types.
* *
* Version: @(#)mouse.c 1.0.23 2018/03/18 * Version: @(#)mouse.c 1.0.24 2018/03/19
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com> * Fred N. van Kempen, <decwiz@yahoo.com>
@@ -109,7 +109,7 @@ mouse_close(void)
void void
mouse_reset(void) mouse_reset(void)
{ {
if (mouse_curr != NULL) if ((mouse_curr != NULL) || (mouse_type == MOUSE_TYPE_INTERNAL))
return; /* Mouse already initialized. */ return; /* Mouse already initialized. */
pclog("MOUSE: reset(type=%d, '%s')\n", pclog("MOUSE: reset(type=%d, '%s')\n",
@@ -142,7 +142,8 @@ mouse_process(void)
{ {
static int poll_delay = 2; static int poll_delay = 2;
if (mouse_curr == NULL) return; if ((mouse_curr != NULL) || (mouse_type == MOUSE_TYPE_INTERNAL))
return;
if (--poll_delay) return; if (--poll_delay) return;
@@ -192,9 +193,8 @@ mouse_get_from_internal_name(char *s)
int c = 0; int c = 0;
while (mouse_devices[c].internal_name != NULL) { while (mouse_devices[c].internal_name != NULL) {
if (! strcmp((char *)mouse_devices[c].internal_name, s)) { if (! strcmp((char *)mouse_devices[c].internal_name, s))
return(c); return(c);
}
c++; c++;
} }

View File

@@ -10,7 +10,7 @@
* *
* NOTE: I should re-do 'intclk' using a TM struct. * NOTE: I should re-do 'intclk' using a TM struct.
* *
* Version: @(#)nvr.c 1.0.2 2018/03/11 * Version: @(#)nvr.c 1.0.3 2018/03/19
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -53,9 +53,13 @@
#include <time.h> #include <time.h>
#include <wchar.h> #include <wchar.h>
#include "86box.h" #include "86box.h"
#include "device.h"
#include "machine/machine.h" #include "machine/machine.h"
#include "machine/m_xt_t1000.h"
#include "mem.h"
#include "pic.h" #include "pic.h"
#include "pit.h" #include "pit.h"
#include "rom.h"
#include "timer.h" #include "timer.h"
#include "plat.h" #include "plat.h"
#include "nvr.h" #include "nvr.h"
@@ -234,6 +238,11 @@ nvr_load(void)
} }
} }
if (romset == ROM_T1000)
t1000_nvr_load();
else if (romset == ROM_T1200)
t1200_nvr_load();
/* Get the local RTC running! */ /* Get the local RTC running! */
if (saved_nvr->start != NULL) if (saved_nvr->start != NULL)
saved_nvr->start(saved_nvr); saved_nvr->start(saved_nvr);
@@ -261,6 +270,11 @@ nvr_save(void)
} }
} }
if (romset == ROM_T1000)
t1000_nvr_save();
else if (romset == ROM_T1200)
t1200_nvr_save();
/* Device is clean again. */ /* Device is clean again. */
nvr_dosave = 0; nvr_dosave = 0;

View File

@@ -8,7 +8,7 @@
* *
* Main emulator module where most things are controlled. * Main emulator module where most things are controlled.
* *
* Version: @(#)pc.c 1.0.65 2018/03/18 * Version: @(#)pc.c 1.0.66 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -127,7 +127,6 @@ int cpu_manufacturer = 0, /* (C) cpu manufacturer */
enable_external_fpu = 0; /* (C) enable external FPU */ enable_external_fpu = 0; /* (C) enable external FPU */
int enable_sync = 0; /* (C) enable time sync */ int enable_sync = 0; /* (C) enable time sync */
/* Statistics. */ /* Statistics. */
extern int extern int
mmuflush, mmuflush,

View File

@@ -8,13 +8,15 @@
* *
* ATI 28800 emulation (VGA Charger and Korean VGA) * ATI 28800 emulation (VGA Charger and Korean VGA)
* *
* Version: @(#)vid_ati28800.c 1.0.13 2018/03/18 * Version: @(#)vid_ati28800.c 1.0.14 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
* greatpsycho,
* *
* Copyright 2008-2018 Sarah Walker. * Copyright 2008-2018 Sarah Walker.
* Copyright 2016-2018 Miran Grca. * Copyright 2016-2018 Miran Grca.
* Copyright 2018 greatpsycho.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
@@ -60,8 +62,6 @@ typedef struct ati28800_t
int index; int index;
uint32_t memory; uint32_t memory;
} ati28800_t;
uint8_t port_03dd_val; uint8_t port_03dd_val;
uint16_t get_korean_font_kind; uint16_t get_korean_font_kind;
@@ -70,6 +70,7 @@ int get_korean_font_enabled;
int get_korean_font_index; int get_korean_font_index;
uint16_t get_korean_font_base; uint16_t get_korean_font_base;
int ksc5601_mode_enabled; int ksc5601_mode_enabled;
} ati28800_t;
static void ati28800_out(uint16_t addr, uint8_t val, void *p) static void ati28800_out(uint16_t addr, uint8_t val, void *p)
@@ -154,41 +155,51 @@ void ati28800k_out(uint16_t addr, uint8_t val, void *p)
case 0x1CF: case 0x1CF:
if(ati28800->index == 0xBF && ((ati28800->regs[0xBF] ^ val) & 0x20)) if(ati28800->index == 0xBF && ((ati28800->regs[0xBF] ^ val) & 0x20))
{ {
ksc5601_mode_enabled = val & 0x20; ati28800->ksc5601_mode_enabled = val & 0x20;
svga_recalctimings(svga); svga_recalctimings(svga);
} }
ati28800_out(oldaddr, val, p); ati28800_out(oldaddr, val, p);
break; break;
case 0x3DD: case 0x3DD:
port_03dd_val = val; ati28800->port_03dd_val = val;
if(val == 1) get_korean_font_enabled = 0; if(val == 1) ati28800->get_korean_font_enabled = 0;
if(in_get_korean_font_kind_set) if(ati28800->in_get_korean_font_kind_set)
{ {
get_korean_font_kind = (val << 8) | (get_korean_font_kind & 0xFF); ati28800->get_korean_font_kind = (val << 8) | (ati28800->get_korean_font_kind & 0xFF);
get_korean_font_enabled = 1; ati28800->get_korean_font_enabled = 1;
get_korean_font_index = 0; ati28800->get_korean_font_index = 0;
in_get_korean_font_kind_set = 0; ati28800->in_get_korean_font_kind_set = 0;
} }
break; break;
case 0x3DE: case 0x3DE:
in_get_korean_font_kind_set = 0; ati28800->in_get_korean_font_kind_set = 0;
switch(port_03dd_val) if(ati28800->get_korean_font_enabled && (ati28800->regs[0xBF] & 0x20))
{
if((ati28800->get_korean_font_base & 0x7F) > 0x20 && (ati28800->get_korean_font_base & 0x7F) < 0x7F)
fontdatksc5601_user[(ati28800->get_korean_font_kind & 4) * 24 + (ati28800->get_korean_font_base & 0x7F) - 0x20].chr[ati28800->get_korean_font_index] = val;
ati28800->get_korean_font_index++;
ati28800->get_korean_font_index &= 0x1F;
}
else
{
switch(ati28800->port_03dd_val)
{ {
case 0x10: case 0x10:
get_korean_font_base = ((val & 0x7F) << 7) | (get_korean_font_base & 0x7F); ati28800->get_korean_font_base = ((val & 0x7F) << 7) | (ati28800->get_korean_font_base & 0x7F);
break; break;
case 8: case 8:
get_korean_font_base = (get_korean_font_base & 0x3F80) | (val & 0x7F); ati28800->get_korean_font_base = (ati28800->get_korean_font_base & 0x3F80) | (val & 0x7F);
break; break;
case 1: case 1:
get_korean_font_kind = (get_korean_font_kind & 0xFF00) | val; ati28800->get_korean_font_kind = (ati28800->get_korean_font_kind & 0xFF00) | val;
if(val & 2) in_get_korean_font_kind_set = 1; if(val & 2)
break; ati28800->in_get_korean_font_kind_set = 1;
default:
break; break;
} }
break; break;
}
default: default:
ati28800_out(oldaddr, val, p); ati28800_out(oldaddr, val, p);
break; break;
@@ -301,20 +312,24 @@ uint8_t ati28800k_in(uint16_t addr, void *p)
switch (addr) switch (addr)
{ {
case 0x3DE: case 0x3DE:
if(get_korean_font_enabled && (ati28800->regs[0xBF] & 0x20)) if (ati28800->get_korean_font_enabled && (ati28800->regs[0xBF] & 0x20))
{ {
switch(get_korean_font_kind >> 8) switch(ati28800->get_korean_font_kind >> 8)
{ {
case 4: /* ROM font */ case 4: /* ROM font */
temp = fontdatksc5601[get_korean_font_base].chr[get_korean_font_index++]; temp = fontdatksc5601[ati28800->get_korean_font_base].chr[ati28800->get_korean_font_index++];
break; break;
case 2: /* User defined font - TODO : Should be implemented later */ case 2: /* User defined font */
temp = 0; if((ati28800->get_korean_font_base & 0x7F) > 0x20 && (ati28800->get_korean_font_base & 0x7F) < 0x7F)
temp = fontdatksc5601_user[(ati28800->get_korean_font_kind & 4) * 24 + (ati28800->get_korean_font_base & 0x7F) - 0x20].chr[ati28800->get_korean_font_index];
else
temp = 0xFF;
ati28800->get_korean_font_index++;
break; break;
default: default:
break; break;
} }
get_korean_font_index &= 0x1F; ati28800->get_korean_font_index &= 0x1F;
} }
break; break;
default: default:
@@ -378,9 +393,11 @@ static void ati28800_recalctimings(svga_t *svga)
void ati28800k_recalctimings(svga_t *svga) void ati28800k_recalctimings(svga_t *svga)
{ {
ati28800_t *ati28800 = (ati28800_t *) svga->p;
ati28800_recalctimings(svga); ati28800_recalctimings(svga);
if (svga->render == svga_render_text_80 && ksc5601_mode_enabled) if (svga->render == svga_render_text_80 && ati28800->ksc5601_mode_enabled)
{ {
svga->render = svga_render_text_80_ksc5601; svga->render = svga_render_text_80_ksc5601;
} }
@@ -394,13 +411,13 @@ ati28800k_init(const device_t *info)
ati28800->memory = device_get_config_int("memory"); ati28800->memory = device_get_config_int("memory");
port_03dd_val = 0; ati28800->port_03dd_val = 0;
get_korean_font_base = 0; ati28800->get_korean_font_base = 0;
get_korean_font_index = 0; ati28800->get_korean_font_index = 0;
get_korean_font_enabled = 0; ati28800->get_korean_font_enabled = 0;
get_korean_font_kind = 0; ati28800->get_korean_font_kind = 0;
in_get_korean_font_kind_set = 0; ati28800->in_get_korean_font_kind_set = 0;
ksc5601_mode_enabled = 0; ati28800->ksc5601_mode_enabled = 0;
rom_init(&ati28800->bios_rom, BIOS_ATIKOR_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL); rom_init(&ati28800->bios_rom, BIOS_ATIKOR_PATH, 0xc0000, 0x8000, 0x7fff, 0, MEM_MAPPING_EXTERNAL);
loadfont(FONT_ATIKOR_PATH, 6); loadfont(FONT_ATIKOR_PATH, 6);
@@ -543,7 +560,7 @@ void ati28800k_add_status_info(char *s, int max_len, void *p)
svga_add_status_info(s, max_len, &ati28800->svga); svga_add_status_info(s, max_len, &ati28800->svga);
sprintf(temps, "Korean SVGA mode enabled : %s\n\n", ksc5601_mode_enabled ? "Yes" : "No"); sprintf(temps, "Korean SVGA mode enabled : %s\n\n", ati28800->ksc5601_mode_enabled ? "Yes" : "No");
strncat(s, temps, max_len); strncat(s, temps, max_len);
} }

View File

@@ -8,7 +8,7 @@
* *
* SVGA renderers. * SVGA renderers.
* *
* Version: @(#)vid_svga_render.c 1.0.9 2018/03/15 * Version: @(#)vid_svga_render.c 1.0.10 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -311,6 +311,9 @@ void svga_render_text_80_ksc5601(svga_t *svga)
if(x + xinc < svga->hdisp && (chr & nextchr & 0x80)) if(x + xinc < svga->hdisp && (chr & nextchr & 0x80))
{ {
if((chr == 0xc9 || chr == 0xfe) && (nextchr > 0xa0 && nextchr < 0xff))
dat = fontdatksc5601_user[(chr == 0xfe ? 96 : 0) + (nextchr & 0x7F) - 0x20].chr[svga->sc];
else
dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)].chr[svga->sc]; dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)].chr[svga->sc];
} }
else else
@@ -358,6 +361,9 @@ void svga_render_text_80_ksc5601(svga_t *svga)
} }
} }
if((chr == 0xc9 || chr == 0xfe) && (nextchr > 0xa0 && nextchr < 0xff))
dat = fontdatksc5601_user[(chr == 0xfe ? 96 : 0) + (nextchr & 0x7F) - 0x20].chr[svga->sc + 16];
else
dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)].chr[svga->sc + 16]; dat = fontdatksc5601[((chr & 0x7F) << 7) | (nextchr & 0x7F)].chr[svga->sc + 16];
if (svga->seqregs[1] & 1) if (svga->seqregs[1] & 1)
{ {

View File

@@ -40,7 +40,7 @@
* W = 3 bus clocks * W = 3 bus clocks
* L = 4 bus clocks * L = 4 bus clocks
* *
* Version: @(#)video.c 1.0.20 2018/03/18 * Version: @(#)video.c 1.0.21 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -79,7 +79,8 @@ uint8_t fontdat[2048][8]; /* IBM CGA font */
uint8_t fontdatm[2048][16]; /* IBM MDA font */ uint8_t fontdatm[2048][16]; /* IBM MDA font */
uint8_t fontdatw[512][32]; /* Wyse700 font */ uint8_t fontdatw[512][32]; /* Wyse700 font */
uint8_t fontdat8x12[256][16]; /* MDSI Genius font */ uint8_t fontdat8x12[256][16]; /* MDSI Genius font */
dbcs_font_t *fontdatksc5601;; /* Korean KSC-5601 font */ dbcs_font_t *fontdatksc5601; /* Korean KSC-5601 font */
dbcs_font_t *fontdatksc5601_user; /* Korean KSC-5601 user defined font */
uint32_t pal_lookup[256]; uint32_t pal_lookup[256];
int xsize = 1, int xsize = 1,
ysize = 1; ysize = 1;
@@ -661,6 +662,11 @@ video_close(void)
free(fontdatksc5601); free(fontdatksc5601);
fontdatksc5601 = NULL; fontdatksc5601 = NULL;
} }
if (fontdatksc5601_user) {
free(fontdatksc5601_user);
fontdatksc5601_user = NULL;
}
} }
@@ -773,13 +779,14 @@ loadfont(wchar_t *s, int format)
if (!fontdatksc5601) if (!fontdatksc5601)
fontdatksc5601 = malloc(16384 * sizeof(dbcs_font_t)); fontdatksc5601 = malloc(16384 * sizeof(dbcs_font_t));
if (!fontdatksc5601_user)
fontdatksc5601_user = malloc(192 * sizeof(dbcs_font_t));
for (c = 0; c < 16384; c++) for (c = 0; c < 16384; c++)
{ {
for (d = 0; d < 32; d++) for (d = 0; d < 32; d++)
{
fontdatksc5601[c].chr[d]=getc(f); fontdatksc5601[c].chr[d]=getc(f);
} }
}
break; break;
} }

View File

@@ -8,7 +8,7 @@
* *
* Definitions for the video controller module. * Definitions for the video controller module.
* *
* Version: @(#)video.h 1.0.24 2018/03/18 * Version: @(#)video.h 1.0.24 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -176,6 +176,7 @@ extern int fullchange;
extern uint8_t fontdat[2048][8]; extern uint8_t fontdat[2048][8];
extern uint8_t fontdatm[2048][16]; extern uint8_t fontdatm[2048][16];
extern dbcs_font_t *fontdatksc5601; extern dbcs_font_t *fontdatksc5601;
extern dbcs_font_t *fontdatksc5601_user;
extern uint32_t *video_6to8, extern uint32_t *video_6to8,
*video_15to32, *video_15to32,
*video_16to32; *video_16to32;

View File

@@ -8,7 +8,7 @@
* *
* user Interface module for WinAPI on Windows. * user Interface module for WinAPI on Windows.
* *
* Version: @(#)win_ui.c 1.0.22 2018/02/15 * Version: @(#)win_ui.c 1.0.23 2018/03/19
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -1056,6 +1056,9 @@ plat_mouse_capture(int on)
{ {
RECT rect; RECT rect;
if (mouse_type == MOUSE_TYPE_NONE)
return;
if (on && !mouse_capture) { if (on && !mouse_capture) {
/* Enable the in-app mouse. */ /* Enable the in-app mouse. */
GetClipCursor(&oldclip); GetClipCursor(&oldclip);