From d6e4291a681af49493e4997c38224556b630e7db Mon Sep 17 00:00:00 2001 From: OBattler Date: Thu, 16 Aug 2018 03:18:53 +0200 Subject: [PATCH] The Trigem 286M is now correctly initialized without IDE, fixes non-IDE hard disk controllers (eg. MFM); A small change to how the video font array resetting is done, to correctly allow for internal Korean graphics cards, fixes the emulator segfaulting in some cases with the Trigem 286M and the internal Korean ET4000AX. --- src/machine/m_at_headland.c | 5 ++++- src/pc.c | 3 ++- src/video/vid_table.c | 17 +++++++++++------ src/video/video.c | 6 +++--- src/video/video.h | 1 + 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/machine/m_at_headland.c b/src/machine/m_at_headland.c index b16b8b794..4a0f9861c 100644 --- a/src/machine/m_at_headland.c +++ b/src/machine/m_at_headland.c @@ -533,7 +533,10 @@ headland_init(void) void machine_at_headland_init(const machine_t *model) { - machine_at_common_ide_init(model); + if (romset == ROM_TG286M) + machine_at_common_init(model); + else + machine_at_common_ide_init(model); device_add(&keyboard_at_ami_device); device_add(&fdc_at_device); diff --git a/src/pc.c b/src/pc.c index 25edae69a..ef1381563 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Main emulator module where most things are controlled. * - * Version: @(#)pc.c 1.0.74 2018/08/04 + * Version: @(#)pc.c 1.0.75 2018/08/16 * * Authors: Sarah Walker, * Miran Grca, @@ -766,6 +766,7 @@ pc_reset_hard_init(void) scsi_disk_hard_reset(); /* Initialize the actual machine and its basic modules. */ + video_font_reset(); /* Reset (deallocate) the video font arrays. */ machine_init(); fdd_reset(); diff --git a/src/video/vid_table.c b/src/video/vid_table.c index 7f49f74c5..d329e655f 100644 --- a/src/video/vid_table.c +++ b/src/video/vid_table.c @@ -8,7 +8,7 @@ * * Define all known video cards. * - * Version: @(#)vid_table.c 1.0.32 2018/08/16 + * Version: @(#)vid_table.c 1.0.33 2018/08/16 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -196,6 +196,16 @@ vid_table_log(const char *fmt, ...) } +void +video_font_reset(void) +{ + if (fontdatksc5601) { + free(fontdatksc5601); + fontdatksc5601 = NULL; + } +} + + void video_reset(int card) { @@ -206,11 +216,6 @@ video_reset(int card) cga_palette = 0; cgapal_rebuild(); - if (fontdatksc5601) { - free(fontdatksc5601); - fontdatksc5601 = NULL; - } - /* Do not initialize internal cards here. */ if (!(card == GFX_NONE) && \ !(card == GFX_INTERNAL) && !machines[machine].fixed_gfxcard) { diff --git a/src/video/video.c b/src/video/video.c index a296f16ef..c31afb3e9 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -40,7 +40,7 @@ * W = 3 bus clocks * L = 4 bus clocks * - * Version: @(#)video.c 1.0.23 2018/05/25 + * Version: @(#)video.c 1.0.24 2018/08/16 * * Authors: Sarah Walker, * Miran Grca, @@ -79,8 +79,8 @@ uint8_t fontdat[2048][8]; /* IBM CGA font */ uint8_t fontdatm[2048][16]; /* IBM MDA font */ uint8_t fontdatw[512][32]; /* Wyse700 font */ uint8_t fontdat8x12[256][16]; /* MDSI Genius font */ -dbcs_font_t *fontdatksc5601; /* Korean KSC-5601 font */ -dbcs_font_t *fontdatksc5601_user; /* Korean KSC-5601 user defined font */ +dbcs_font_t *fontdatksc5601 = NULL; /* Korean KSC-5601 font */ +dbcs_font_t *fontdatksc5601_user = NULL; /* Korean KSC-5601 user defined font */ uint32_t pal_lookup[256]; int xsize = 1, ysize = 1; diff --git a/src/video/video.h b/src/video/video.h index fdf3cc34b..ed960d9bb 100644 --- a/src/video/video.h +++ b/src/video/video.h @@ -243,6 +243,7 @@ extern void updatewindowsize(int x, int y); extern void video_init(void); extern void video_close(void); +extern void video_font_reset(void); extern void video_reset(int card); extern uint8_t video_force_resize_get(void); extern void video_force_resize_set(uint8_t res);