diff --git a/src/machines/m_at.c b/src/machines/m_at.c index fbb148f..0cdde6e 100644 --- a/src/machines/m_at.c +++ b/src/machines/m_at.c @@ -8,7 +8,7 @@ * * Standard PC/AT implementation. * - * Version: @(#)m_at.c 1.0.9 2018/05/06 + * Version: @(#)m_at.c 1.0.10 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -76,6 +76,17 @@ machine_at_init(const machine_t *model, void *arg) } +void +machine_at_ibm_init(const machine_t *model, void *arg) +{ + machine_at_init(model, arg); + + mem_remap_top(384); + + device_add(&fdc_at_device); +} + + void machine_at_ps2_init(const machine_t *model, void *arg) { @@ -110,30 +121,3 @@ machine_at_ps2_ide_init(const machine_t *model, void *arg) device_add(&ide_isa_2ch_opt_device); } - - -void -machine_at_top_remap_init(const machine_t *model, void *arg) -{ - machine_at_init(model, arg); - - mem_remap_top_384k(); -} - - -void -machine_at_ide_top_remap_init(const machine_t *model, void *arg) -{ - machine_at_ide_init(model, arg); - - mem_remap_top_384k(); -} - - -void -machine_at_ibm_init(const machine_t *model, void *arg) -{ - machine_at_top_remap_init(model, arg); - - device_add(&fdc_at_device); -} diff --git a/src/machines/m_at_commodore.c b/src/machines/m_at_commodore.c index 2d3c5fc..fc7743a 100644 --- a/src/machines/m_at_commodore.c +++ b/src/machines/m_at_commodore.c @@ -8,7 +8,7 @@ * * Implementation of the Commodore PC3 system. * - * Version: @(#)m_at_commodore.c 1.0.7 2018/05/06 + * Version: @(#)m_at_commodore.c 1.0.8 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -42,6 +42,7 @@ #include #include "../emu.h" #include "../io.h" +#include "../mem.h" #include "../device.h" #include "../devices/ports/parallel.h" #include "../devices/ports/serial.h" @@ -90,7 +91,9 @@ pc3_init(void) void machine_at_cmdpc_init(const machine_t *model, void *arg) { - machine_at_ide_top_remap_init(model, arg); + machine_at_ide_init(model, arg); + + mem_remap_top(384); device_add(&fdc_at_device); diff --git a/src/machines/m_at_compaq.c b/src/machines/m_at_compaq.c index d7c7a19..bdee6dc 100644 --- a/src/machines/m_at_compaq.c +++ b/src/machines/m_at_compaq.c @@ -8,7 +8,7 @@ * * Emulation of various Compaq PC's. * - * Version: @(#)m_at_compaq.c 1.0.6 2018/05/06 + * Version: @(#)m_at_compaq.c 1.0.7 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -120,7 +120,10 @@ write_raml(uint32_t addr, uint32_t val, void *priv) void machine_at_compaq_init(const machine_t *model, void *arg) { - machine_at_top_remap_init(model, arg); + machine_at_init(model, arg); + + mem_remap_top(384); + device_add(&fdc_at_device); mem_mapping_add(&ram_mapping, 0xfa0000, 0x60000, diff --git a/src/machines/m_at_neat.c b/src/machines/m_at_neat.c index ffc4cd6..cc89199 100644 --- a/src/machines/m_at_neat.c +++ b/src/machines/m_at_neat.c @@ -10,7 +10,7 @@ * * This is the chipset used in the AMI 286 clone model. * - * Version: @(#)m_at_neat.c 1.0.6 2018/05/06 + * Version: @(#)m_at_neat.c 1.0.7 2018/07/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -44,6 +44,7 @@ #include #include "../emu.h" #include "../io.h" +#include "../mem.h" #include "../device.h" #include "../devices/input/keyboard.h" #include "../devices/floppy/fdd.h" @@ -134,6 +135,7 @@ void machine_at_neat_init(const machine_t *model, void *arg) { machine_at_init(model, arg); + device_add(&fdc_at_device); neat_init(); @@ -145,7 +147,11 @@ machine_at_neat_ami_init(const machine_t *model, void *arg) { machine_at_common_init(model, arg); + /* For testing, enable the remap (no shadowram.) */ + mem_remap_top(384); + device_add(&keyboard_at_ami_device); + device_add(&fdc_at_device); neat_init(); diff --git a/src/machines/m_ps1.c b/src/machines/m_ps1.c index 5936033..d9e03f0 100644 --- a/src/machines/m_ps1.c +++ b/src/machines/m_ps1.c @@ -22,7 +22,7 @@ * The reserved 384K is remapped to the top of extended memory. * If this is not done then you get an error on startup. * - * Version: @(#)m_ps1.c 1.0.19 2018/05/06 + * Version: @(#)m_ps1.c 1.0.20 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -556,7 +556,7 @@ ps1_common_init(const machine_t *model, void *arg) machine_common_init(model, arg); game_enabled = i; - mem_remap_top_384k(); + mem_remap_top(384); pit_set_out_func(&pit, 1, pit_refresh_timer_at); diff --git a/src/machines/m_ps2_mca.c b/src/machines/m_ps2_mca.c index 05d0a3a..5f1e01a 100644 --- a/src/machines/m_ps2_mca.c +++ b/src/machines/m_ps2_mca.c @@ -8,7 +8,7 @@ * * Implementation of MCA-based PS/2 machines. * - * Version: @(#)m_ps2_mca.c 1.0.16 2018/08/20 + * Version: @(#)m_ps2_mca.c 1.0.17 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -861,7 +861,8 @@ static void ps2_mca_board_model_50_init() { ps2_mca_board_common_init(); - mem_remap_top_384k(); + mem_remap_top(384); + mca_init(4); ps2.planar_read = model_50_read; @@ -893,7 +894,7 @@ static void ps2_mca_board_model_55sx_init() MEM_MAPPING_INTERNAL, NULL); - mem_remap_top_256k(); + mem_remap_top(256); ps2.option[3] = 0x10; memset(ps2.memory_bank, 0xf0, 8); diff --git a/src/machines/machine.h b/src/machines/machine.h index 0429be0..0743cd9 100644 --- a/src/machines/machine.h +++ b/src/machines/machine.h @@ -8,7 +8,7 @@ * * Handling of the emulated machines. * - * Version: @(#)machine.h 1.0.21 2018/06/14 + * Version: @(#)machine.h 1.0.22 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -259,14 +259,11 @@ extern void machine_common_init(const machine_t *, void *); extern void machine_at_common_init(const machine_t *, void *); extern void machine_at_init(const machine_t *, void *); +extern void machine_at_ibm_init(const machine_t *, void *); extern void machine_at_ps2_init(const machine_t *, void *); extern void machine_at_common_ide_init(const machine_t *, void *); extern void machine_at_ide_init(const machine_t *, void *); extern void machine_at_ps2_ide_init(const machine_t *, void *); -extern void machine_at_top_remap_init(const machine_t *, void *); -extern void machine_at_ide_top_remap_init(const machine_t *, void *); - -extern void machine_at_ibm_init(const machine_t *, void *); extern void machine_at_t3100e_init(const machine_t *, void *); diff --git a/src/mem.c b/src/mem.c index 4d82787..0e6506f 100644 --- a/src/mem.c +++ b/src/mem.c @@ -12,7 +12,7 @@ * the DYNAMIC_TABLES=1 enables this. Will eventually go * away, either way... * - * Version: @(#)mem.c 1.0.16 2018/08/20 + * Version: @(#)mem.c 1.0.17 2018/08/20 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -1763,22 +1763,23 @@ mem_init(void) } -static void -mem_remap_top(int max_size) +void +mem_remap_top(int kb) { uint32_t start = (mem_size >= 1024) ? mem_size : 1024; int size = mem_size - 640; -pclog("MEM: remapping top %iKB (mem=%i)\n", max_size, mem_size); +pclog("MEM: remapping top %iKB (mem=%i)\n", kb, mem_size); if (mem_size <= 640) return; - if (size > max_size) - size = max_size; + if (size > kb) + size = kb; mem_set_mem_state(start * 1024, size * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL); mem_mapping_set_addr(&ram_remapped_mapping, start * 1024, size * 1024); #if 0 + //FIXME: was this a typo for mem_remapped_mapping? --FvK mem_mapping_set_exec(&ram_split_mapping, ram + (start * 1024)); #endif @@ -1786,20 +1787,6 @@ pclog("MEM: remapping top %iKB (mem=%i)\n", max_size, mem_size); } -void -mem_remap_top_256k(void) -{ - mem_remap_top(256); -} - - -void -mem_remap_top_384k(void) -{ - mem_remap_top(384); -} - - void mem_reset_page_blocks(void) { diff --git a/src/mem.h b/src/mem.h index e4b4b94..0370843 100644 --- a/src/mem.h +++ b/src/mem.h @@ -8,7 +8,7 @@ * * Definitions for the memory interface. * - * Version: @(#)mem.h 1.0.8 2018/08/20 + * Version: @(#)mem.h 1.0.9 2018/08/20 * * Authors: Fred N. van Kempen, * Sarah Walker, @@ -259,8 +259,7 @@ extern void mem_add_bios(void); extern void mem_init(void); extern void mem_reset(void); -extern void mem_remap_top_256k(void); -extern void mem_remap_top_384k(void); +extern void mem_remap_top(int kb); extern uint8_t port_92_read(uint16_t port, void *priv); extern void port_92_write(uint16_t port, uint8_t val, void *priv); diff --git a/src/version.h b/src/version.h index e55a72c..8c2d0b7 100644 --- a/src/version.h +++ b/src/version.h @@ -8,7 +8,7 @@ * * Define application version and build info. * - * Version: @(#)version.h 1.0.17 2018/07/28 + * Version: @(#)version.h 1.0.18 2018/08/12 * * Author: Fred N. van Kempen, * @@ -55,7 +55,7 @@ #define EMU_VER_MAJOR 0 #define EMU_VER_MINOR 1 #define EMU_VER_REV 6 -#define EMU_VER_PATCH 2 +#define EMU_VER_PATCH 3 /* Standard C preprocessor macros. */