mirror of
https://github.com/86Box/86Box.git
synced 2026-02-26 05:53:15 -07:00
Merge branch 'master' into feature/mtrr
This commit is contained in:
42
src/machine/CMakeLists.txt
Normal file
42
src/machine/CMakeLists.txt
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
# running old operating systems and software designed for IBM
|
||||
# PC systems and compatibles from 1981 through fairly recent
|
||||
# system designs based on the PCI bus.
|
||||
#
|
||||
# This file is part of the 86Box distribution.
|
||||
#
|
||||
# CMake build script.
|
||||
#
|
||||
# Authors: David Hrdlička, <hrdlickadavid@outlook.com>
|
||||
#
|
||||
# Copyright 2020,2021 David Hrdlička.
|
||||
#
|
||||
|
||||
add_library(mch OBJECT machine.c machine_table.c m_xt.c m_xt_compaq.c
|
||||
m_xt_philips.c
|
||||
m_xt_t1000.c m_xt_t1000_vid.c m_xt_xi8088.c m_xt_zenith.c m_pcjr.c
|
||||
m_amstrad.c m_europc.c m_xt_olivetti.c m_tandy.c m_v86p.c
|
||||
m_at.c m_at_commodore.c
|
||||
m_at_t3100e.c m_at_t3100e_vid.c m_ps1.c m_ps1_hdc.c m_ps2_isa.c
|
||||
m_ps2_mca.c m_at_compaq.c m_at_286_386sx.c m_at_386dx_486.c
|
||||
m_at_socket4.c m_at_socket5.c m_at_socket7_3v.c m_at_socket7.c
|
||||
m_at_sockets7.c m_at_socket8.c m_at_slot1.c m_at_slot2.c m_at_socket370.c
|
||||
m_at_misc.c)
|
||||
|
||||
if(AN430TX)
|
||||
target_compile_definitions(mch PRIVATE USE_AN430TX)
|
||||
endif()
|
||||
|
||||
if(DESKPRO386)
|
||||
target_compile_definitions(mch PRIVATE USE_DESKPRO386)
|
||||
endif()
|
||||
|
||||
if(LASERXT)
|
||||
target_sources(mch PRIVATE m_xt_laserxt.c)
|
||||
target_compile_definitions(mch PRIVATE USE_LASERXT)
|
||||
endif()
|
||||
|
||||
if(OPEN_AT)
|
||||
target_compile_definitions(mch PRIVATE USE_OPEN_AT)
|
||||
endif()
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,6 +56,7 @@
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
@@ -64,17 +65,21 @@ machine_at_common_init_ex(const machine_t *model, int type)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
refresh_at_enable = 1;
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
pic2_init();
|
||||
dma16_init();
|
||||
|
||||
if (!(type & 4))
|
||||
device_add(&port_6x_device);
|
||||
type &= 3;
|
||||
|
||||
if (type == 1)
|
||||
device_add(&ibmat_nvr_device);
|
||||
else if (type == 0)
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,8 +163,8 @@ machine_at_ibm_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmat/62x0820.u27",
|
||||
L"roms/machines/ibmat/62x0821.u47",
|
||||
ret = bios_load_interleaved("roms/machines/ibmat/62x0820.u27",
|
||||
"roms/machines/ibmat/62x0821.u47",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -170,14 +175,15 @@ machine_at_ibm_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
//IBM AT machines with custom BIOSes
|
||||
|
||||
/* IBM AT machines with custom BIOSes */
|
||||
int
|
||||
machine_at_ibmatquadtel_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmatquadtel/BIOS_30MAR90_U27_QUADTEL_ENH_286_BIOS_3.05.01_27256.BIN",
|
||||
L"roms/machines/ibmatquadtel/BIOS_30MAR90_U47_QUADTEL_ENH_286_BIOS_3.05.01_27256.BIN",
|
||||
ret = bios_load_interleaved("roms/machines/ibmatquadtel/BIOS_30MAR90_U27_QUADTEL_ENH_286_BIOS_3.05.01_27256.BIN",
|
||||
"roms/machines/ibmatquadtel/BIOS_30MAR90_U47_QUADTEL_ENH_286_BIOS_3.05.01_27256.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -188,13 +194,14 @@ machine_at_ibmatquadtel_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ibmatami_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmatami/BIOS_5170_30APR89_U27_AMI_27256.BIN",
|
||||
L"roms/machines/ibmatami/BIOS_5170_30APR89_U47_AMI_27256.BIN",
|
||||
ret = bios_load_interleaved("roms/machines/ibmatami/BIOS_5170_30APR89_U27_AMI_27256.BIN",
|
||||
"roms/machines/ibmatami/BIOS_5170_30APR89_U47_AMI_27256.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -205,13 +212,14 @@ machine_at_ibmatami_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ibmatpx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmatpx/BIOS ROM - PhoenixBIOS A286 - Version 1.01 - Even.bin",
|
||||
L"roms/machines/ibmatpx/BIOS ROM - PhoenixBIOS A286 - Version 1.01 - Odd.bin",
|
||||
ret = bios_load_interleaved("roms/machines/ibmatpx/BIOS ROM - PhoenixBIOS A286 - Version 1.01 - Even.bin",
|
||||
"roms/machines/ibmatpx/BIOS ROM - PhoenixBIOS A286 - Version 1.01 - Odd.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -222,13 +230,14 @@ machine_at_ibmatpx_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ibmxt286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmxt286/bios_5162_21apr86_u34_78x7460_27256.bin",
|
||||
L"roms/machines/ibmxt286/bios_5162_21apr86_u35_78x7461_27256.bin",
|
||||
ret = bios_load_interleaved("roms/machines/ibmxt286/bios_5162_21apr86_u34_78x7460_27256.bin",
|
||||
"roms/machines/ibmxt286/bios_5162_21apr86_u35_78x7461_27256.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -239,13 +248,12 @@ machine_at_ibmxt286_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_SIEMENS)
|
||||
int
|
||||
machine_at_siemens_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/siemens/286BIOS.BIN",
|
||||
ret = bios_load_linear("roms/machines/siemens/286BIOS.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -255,15 +263,15 @@ machine_at_siemens_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OPEN_AT)
|
||||
int
|
||||
machine_at_open_at_init(const machine_t *model)
|
||||
machine_at_openat_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/open_at/bios.bin",
|
||||
ret = bios_load_linear("roms/machines/openat/bios.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
|
||||
@@ -12,9 +12,11 @@
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* EngiNerd <webmaster.crrc@yahoo.it>
|
||||
*
|
||||
* Copyright 2010-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2020 EngiNerd.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
@@ -33,9 +35,14 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/serial.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
int
|
||||
@@ -43,8 +50,8 @@ machine_at_mr286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/mr286/V000B200-1",
|
||||
L"roms/machines/mr286/V000B200-2",
|
||||
ret = bios_load_interleaved("roms/machines/mr286/V000B200-1",
|
||||
"roms/machines/mr286/V000B200-2",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -52,6 +59,8 @@ machine_at_mr286_init(const machine_t *model)
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -62,42 +71,22 @@ static void
|
||||
machine_at_headland_common_init(int ht386)
|
||||
{
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (ht386)
|
||||
device_add(&headland_386_device);
|
||||
device_add(&headland_ht18b_device);
|
||||
else
|
||||
device_add(&headland_device);
|
||||
device_add(&headland_gc10x_device);
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_AMI386SX)
|
||||
int
|
||||
machine_at_headland_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ami386/ami386.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
machine_at_headland_common_init(1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
machine_at_tg286m_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/tg286m/ami.bin",
|
||||
ret = bios_load_linear("roms/machines/tg286m/ami.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -110,20 +99,12 @@ machine_at_tg286m_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
at_ama932j_get_device(void)
|
||||
{
|
||||
return &oti067_ama932j_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ama932j_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ama932j/ami.bin",
|
||||
ret = bios_load_linear("roms/machines/ama932j/ami.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -131,40 +112,69 @@ machine_at_ama932j_init(const machine_t *model)
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
machine_at_headland_common_init(1);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&oti067_ama932j_device);
|
||||
|
||||
machine_at_headland_common_init(1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_quadt286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/quadt286/QUADT89L.ROM",
|
||||
L"roms/machines/quadt286/QUADT89H.ROM",
|
||||
ret = bios_load_interleaved("roms/machines/quadt286/QUADT89L.ROM",
|
||||
"roms/machines/quadt286/QUADT89H.ROM",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&headland_device);
|
||||
|
||||
device_add(&headland_gc10x_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_quadt386sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/quadt386sx/QTC-SXM-EVEN-U3-05-07.BIN",
|
||||
"roms/machines/quadt386sx/QTC-SXM-ODD-U3-05-07.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&headland_gc10x_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_neat_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/dtk386/3cto001.bin",
|
||||
ret = bios_load_linear("roms/machines/dtk386/3cto001.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -173,6 +183,8 @@ machine_at_neat_init(const machine_t *model)
|
||||
machine_at_init(model);
|
||||
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
@@ -184,7 +196,7 @@ machine_at_neat_ami_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ami286/amic206.bin",
|
||||
ret = bios_load_linear("roms/machines/ami286/AMIC206.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -193,6 +205,8 @@ machine_at_neat_ami_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
@@ -200,12 +214,13 @@ machine_at_neat_ami_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_px286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/px286/KENITEC.BIN",
|
||||
ret = bios_load_linear("roms/machines/px286/KENITEC.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -213,58 +228,42 @@ machine_at_px286_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&neat_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_goldstar386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/goldstar386/386-Goldstar-E.BIN",
|
||||
L"roms/machines/goldstar386/386-Goldstar-O.BIN",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
device_add(&neat_device);
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_micronics386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/micronics386/386-Micronics-09-00021-EVEN.BIN",
|
||||
L"roms/machines/micronics386/386-Micronics-09-00021-ODD.BIN",
|
||||
0x000f0000, 131072, 0);
|
||||
ret = bios_load_interleaved("roms/machines/micronics386/386-Micronics-09-00021-EVEN.BIN",
|
||||
"roms/machines/micronics386/386-Micronics-09-00021-ODD.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
device_add(&neat_device);
|
||||
device_add(&fdc_at_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
machine_at_scat_init(const machine_t *model, int is_v4)
|
||||
{
|
||||
machine_at_init(model);
|
||||
device_add(&fdc_at_device);
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (is_v4)
|
||||
device_add(&scat_4_device);
|
||||
@@ -279,6 +278,8 @@ machine_at_scatsx_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&scat_sx_device);
|
||||
@@ -290,7 +291,7 @@ machine_at_award286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/award286/award.bin",
|
||||
ret = bios_load_linear("roms/machines/award286/award.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -298,6 +299,9 @@ machine_at_award286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -306,7 +310,7 @@ machine_at_gdc212m_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/gdc212m/gdc212m_72h.bin",
|
||||
ret = bios_load_linear("roms/machines/gdc212m/gdc212m_72h.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -314,6 +318,11 @@ machine_at_gdc212m_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -322,7 +331,7 @@ machine_at_gw286ct_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/gw286ct/2ctc001.bin",
|
||||
ret = bios_load_linear("roms/machines/gw286ct/2ctc001.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -330,7 +339,12 @@ machine_at_gw286ct_init(const machine_t *model)
|
||||
|
||||
device_add(&f82c710_device);
|
||||
|
||||
machine_at_scat_init(model, 1);
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
device_add(&scat_4_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -341,7 +355,7 @@ machine_at_super286tr_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/super286tr/hyundai_award286.bin",
|
||||
ret = bios_load_linear("roms/machines/super286tr/hyundai_award286.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -349,6 +363,9 @@ machine_at_super286tr_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -358,7 +375,7 @@ machine_at_spc4200p_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/spc4200p/u8.01",
|
||||
ret = bios_load_linear("roms/machines/spc4200p/u8.01",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -366,6 +383,9 @@ machine_at_spc4200p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -375,8 +395,8 @@ machine_at_spc4216p_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/spc4216p/7101.u8",
|
||||
L"roms/machines/spc4216p/ac64.u10",
|
||||
ret = bios_load_interleaved("roms/machines/spc4216p/7101.U8",
|
||||
"roms/machines/spc4216p/AC64.U10",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -384,6 +404,32 @@ machine_at_spc4216p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_spc4620p_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/spc4620p/31005h.u8",
|
||||
"roms/machines/spc4620p/31005h.u10",
|
||||
0x000f0000, 131072, 0x8000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ati28800k_spc4620p_device);
|
||||
|
||||
machine_at_scat_init(model, 1);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -393,7 +439,7 @@ machine_at_kmxc02_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/kmxc02/3ctm005.bin",
|
||||
ret = bios_load_linear("roms/machines/kmxc02/3ctm005.bin",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -404,12 +450,13 @@ machine_at_kmxc02_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_deskmaster286_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/deskmaster286/SAMSUNG-DESKMASTER-28612-ROM.BIN",
|
||||
ret = bios_load_linear("roms/machines/deskmaster286/SAMSUNG-DESKMASTER-28612-ROM.BIN",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -417,46 +464,93 @@ machine_at_deskmaster286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_shuttle386sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/shuttle386sx/386-Shuttle386SX-Even.BIN",
|
||||
"roms/machines/shuttle386sx/386-Shuttle386SX-Odd.BIN",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_adi386sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/adi386sx/3iip001l.bin",
|
||||
"roms/machines/adi386sx/3iip001h.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_wd76c10_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/megapc/41651-bios lo.u18",
|
||||
L"roms/machines/megapc/211253-bios hi.u19",
|
||||
ret = bios_load_interleaved("roms/machines/megapc/41651-bios lo.u18",
|
||||
"roms/machines/megapc/211253-bios hi.u19",
|
||||
0x000f0000, 65536, 0x08000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
machine_at_common_init(model);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(¶dise_wd90c11_megapc_device);
|
||||
|
||||
device_add(&keyboard_ps2_quadtel_device);
|
||||
|
||||
device_add(&wd76c10_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(¶dise_wd90c11_megapc_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
const device_t *
|
||||
at_commodore_sl386sx_get_device(void)
|
||||
{
|
||||
return &gd5402_onboard_device;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_commodore_sl386sx_init(const machine_t *model)
|
||||
machine_at_cmdsl386sx16_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/cbm_sl386sx25/cbm-sl386sx-bios-lo-v1.04-390914-04.bin",
|
||||
L"roms/machines/cbm_sl386sx25/cbm-sl386sx-bios-hi-v1.04-390915-04.bin",
|
||||
ret = bios_load_interleaved("roms/machines/cmdsl386sx16/cbm-sl386sx-bios-lo-v1.04-390914-04.bin",
|
||||
"roms/machines/cmdsl386sx16/cbm-sl386sx-bios-hi-v1.04-390915-04.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -465,11 +559,380 @@ machine_at_commodore_sl386sx_init(const machine_t *model)
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&neat_device);
|
||||
/* Two serial ports - on the real hardware SL386SX-16, they are on the single UMC UM82C452. */
|
||||
device_add_inst(&ns16450_device, 1);
|
||||
device_add_inst(&ns16450_device, 2);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
machine_at_scamp_common_init(const machine_t *model, int is_ps2)
|
||||
{
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
if (is_ps2)
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
else
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&vlsi_scamp_device);
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
at_cmdsl386sx25_get_device(void)
|
||||
{
|
||||
return &gd5402_onboard_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_cmdsl386sx25_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/cmdsl386sx25/f000.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&gd5402_onboard_device);
|
||||
|
||||
machine_at_scamp_common_init(model, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_dataexpert386sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/dataexpert386sx/5e9f20e5ef967717086346.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_scamp_common_init(model, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
at_spc6033p_get_device(void)
|
||||
{
|
||||
return &ati28800k_spc6033p_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_spc6033p_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/spc6033p/phoenix.BIN",
|
||||
0x000f0000, 65536, 0x10000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ati28800k_spc6033p_device);
|
||||
|
||||
machine_at_scamp_common_init(model, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_awardsx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/awardsx/Unknown 386SX OPTi291 - Award (original).BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
device_add(&opti291_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_arb1374_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/arb1374/1374s.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&w83787f_ide_en_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_sbc350a_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/sbc350a/350a.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_flytech386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/flytech386/FLYTECH.BIO",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&w83787f_ide_en_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&tvga8900d_device);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
at_flytech386_get_device(void)
|
||||
{
|
||||
return &tvga8900d_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_mr1217_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/mr1217/mrbios.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&ide_isa_device);
|
||||
device_add(&keyboard_ps2_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_pja511m_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pja511m/2006915102435734.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add_inst(&fdc37c669_device, 1);
|
||||
device_add_inst(&fdc37c669_device, 2);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&ali6117d_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_prox1332_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/prox1332/D30B3AC1.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&ali6117d_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Current bugs:
|
||||
* - ctrl-alt-del produces an 8042 error
|
||||
*/
|
||||
int
|
||||
machine_at_pc8_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/pc8/ncr_35117_u127_vers.4-2.bin",
|
||||
"roms/machines/pc8/ncr_35116_u113_vers.4-2.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Current bugs:
|
||||
* - ctrl-alt-del produces an 8042 error
|
||||
*/
|
||||
int
|
||||
machine_at_3302_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/3302/f000-flex_drive_test.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (ret) {
|
||||
bios_load_aux_linear("roms/machines/3302/f800-setup_ncr3.5-013190.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&neat_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(¶dise_pvga1a_ncr3302_device);
|
||||
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Current bugs:
|
||||
* - soft-reboot after saving CMOS settings/pressing ctrl-alt-del produces an 8042 error
|
||||
*/
|
||||
int
|
||||
machine_at_pc916sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/pc916sx/ncr_386sx_u46-17_7.3.bin",
|
||||
"roms/machines/pc916sx/ncr_386sx_u12-19_7.3.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_OLIVETTI)
|
||||
int
|
||||
machine_at_m290_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/m290/m290_pep3_1.25.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 4);
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
device_add(&port_6x_olivetti_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&olivetti_eva_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/serial.h>
|
||||
@@ -64,22 +65,22 @@ cbm_io_write(uint16_t port, uint8_t val, void *p)
|
||||
|
||||
switch (val & 3) {
|
||||
case 1:
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x378);
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 3:
|
||||
lpt1_init(0x278);
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (val & 0xc) {
|
||||
case 0x4:
|
||||
serial_setup(cmd_uart, 0x2f8, 3);
|
||||
serial_setup(cmd_uart, COM2_ADDR, COM2_IRQ);
|
||||
break;
|
||||
case 0x8:
|
||||
serial_setup(cmd_uart, 0x3f8, 4);
|
||||
serial_setup(cmd_uart, COM1_ADDR, COM1_IRQ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -97,8 +98,8 @@ machine_at_cmdpc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/cmdpc30/commodore pc 30 iii even.bin",
|
||||
L"roms/machines/cmdpc30/commodore pc 30 iii odd.bin",
|
||||
ret = bios_load_interleaved("roms/machines/cmdpc30/commodore pc 30 iii even.bin",
|
||||
"roms/machines/cmdpc30/commodore pc 30 iii odd.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -108,8 +109,10 @@ machine_at_cmdpc_init(const machine_t *model)
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
cmd_uart = device_add(&i8250_device);
|
||||
|
||||
cmd_uart = device_add(&ns8250_device);
|
||||
|
||||
cbm_io_init();
|
||||
|
||||
|
||||
@@ -70,24 +70,24 @@ static uint32_t normcols[256][2];
|
||||
*
|
||||
* Bit 3: Disable built-in video (for add-on card)
|
||||
* Bit 2: Thin font
|
||||
* Bits 0,1: Font set (not currently implemented)
|
||||
*/
|
||||
* Bits 0,1: Font set (not currently implemented)
|
||||
*/
|
||||
static int8_t cpq_st_display_internal = -1;
|
||||
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_display_set(uint8_t internal)
|
||||
{
|
||||
cpq_st_display_internal = internal;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
static uint8_t
|
||||
compaq_plasma_display_get(void)
|
||||
{
|
||||
return cpq_st_display_internal;
|
||||
}
|
||||
|
||||
|
||||
typedef struct compaq_plasma_t
|
||||
typedef struct compaq_plasma_t
|
||||
{
|
||||
mem_mapping_t plasma_mapping;
|
||||
cga_t cga;
|
||||
@@ -97,10 +97,10 @@ typedef struct compaq_plasma_t
|
||||
int linepos, displine;
|
||||
uint8_t *vram;
|
||||
uint64_t dispontime, dispofftime;
|
||||
int dispon;
|
||||
int dispon, fullchange;
|
||||
} compaq_plasma_t;
|
||||
|
||||
static uint8_t cga_crtcmask[32] =
|
||||
static uint8_t cga_crtcmask[32] =
|
||||
{
|
||||
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f, 0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
@@ -112,7 +112,7 @@ static mem_mapping_t ram_mapping;
|
||||
|
||||
static void compaq_plasma_recalcattrs(compaq_plasma_t *self);
|
||||
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_recalctimings(compaq_plasma_t *self)
|
||||
{
|
||||
double _dispontime, _dispofftime, disptime;
|
||||
@@ -150,7 +150,7 @@ compaq_plasma_read(uint32_t addr, void *priv)
|
||||
}
|
||||
|
||||
/* Draw a row of text in 80-column mode */
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_text80(compaq_plasma_t *self)
|
||||
{
|
||||
uint32_t cols[2];
|
||||
@@ -184,9 +184,9 @@ compaq_plasma_text80(compaq_plasma_t *self)
|
||||
(attr & 0x80) && !drawcursor);
|
||||
|
||||
if (self->cga.cgamode & 0x20) { /* Blink */
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink)
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = normcols[attr][1];
|
||||
@@ -238,9 +238,9 @@ compaq_plasma_text40(compaq_plasma_t *self)
|
||||
(attr & 0x80) && !drawcursor);
|
||||
|
||||
if (self->cga.cgamode & 0x20) { /* Blink */
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink)
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = normcols[attr][1];
|
||||
@@ -248,12 +248,12 @@ compaq_plasma_text40(compaq_plasma_t *self)
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2 + 1] = cols[(fontdatm[chr][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[self->displine])[(x << 4) + c*2+1] = cols[(fontdatm[chr][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ compaq_plasma_text40(compaq_plasma_t *self)
|
||||
|
||||
|
||||
/* Draw a line in CGA 640x200 or Compaq Plasma 640x400 mode */
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_cgaline6(compaq_plasma_t *self)
|
||||
{
|
||||
int x, c;
|
||||
@@ -300,7 +300,7 @@ compaq_plasma_cgaline6(compaq_plasma_t *self)
|
||||
|
||||
/* Draw a line in CGA 320x200 mode. Here the CGA colours are converted to
|
||||
* dither patterns: colour 1 to 25% grey, colour 2 to 50% grey */
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_cgaline4(compaq_plasma_t *self)
|
||||
{
|
||||
int x, c;
|
||||
@@ -309,7 +309,7 @@ compaq_plasma_cgaline4(compaq_plasma_t *self)
|
||||
uint16_t addr;
|
||||
|
||||
uint16_t ma = (self->cga.crtc[13] | (self->cga.crtc[12] << 8)) & 0x7fff;
|
||||
|
||||
|
||||
/* 320*200 */
|
||||
addr = ((self->displine >> 1) & 1) * 0x2000 +
|
||||
(self->displine >> 2) * 80 +
|
||||
@@ -321,7 +321,7 @@ compaq_plasma_cgaline4(compaq_plasma_t *self)
|
||||
|
||||
for (c = 0; c < 4; c++) {
|
||||
pattern = (dat & 0xC0) >> 6;
|
||||
if (!(self->cga.cgamode & 8))
|
||||
if (!(self->cga.cgamode & 8))
|
||||
pattern = 0;
|
||||
|
||||
switch (pattern & 3) {
|
||||
@@ -366,21 +366,21 @@ compaq_plasma_out(uint16_t addr, uint8_t val, void *priv)
|
||||
self->cga.crtc[self->cga.crtcreg] = val & cga_crtcmask[self->cga.crtcreg];
|
||||
|
||||
/* Register 0x12 controls the attribute mappings for the
|
||||
* plasma screen. */
|
||||
* plasma screen. */
|
||||
if (self->cga.crtcreg == 0x12) {
|
||||
self->attrmap = val;
|
||||
self->attrmap = val;
|
||||
compaq_plasma_recalcattrs(self);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (old != val) {
|
||||
if (self->cga.crtcreg < 0xe || self->cga.crtcreg > 0x10) {
|
||||
fullchange = changeframecount;
|
||||
self->fullchange = changeframecount;
|
||||
compaq_plasma_recalctimings(self);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case 0x3d8:
|
||||
self->cga.cgamode = val;
|
||||
break;
|
||||
@@ -395,7 +395,7 @@ compaq_plasma_out(uint16_t addr, uint8_t val, void *priv)
|
||||
else
|
||||
compaq_plasma_display_set(0);
|
||||
break;
|
||||
|
||||
|
||||
case 0x23c6:
|
||||
self->port_23c6 = val;
|
||||
if (val & 8) /* Disable internal CGA */
|
||||
@@ -430,7 +430,7 @@ compaq_plasma_in(uint16_t addr, void *priv)
|
||||
case 0x3da:
|
||||
ret = self->cga.cgastat;
|
||||
break;
|
||||
|
||||
|
||||
case 0x13c6:
|
||||
if (compaq_plasma_display_get())
|
||||
ret = 8;
|
||||
@@ -450,7 +450,7 @@ static void
|
||||
compaq_plasma_poll(void *p)
|
||||
{
|
||||
compaq_plasma_t *self = (compaq_plasma_t *)p;
|
||||
|
||||
|
||||
/* Switch between internal plasma and external CRT display. */
|
||||
if (cpq_st_display_internal != -1 && cpq_st_display_internal != self->internal_monitor) {
|
||||
self->internal_monitor = cpq_st_display_internal;
|
||||
@@ -460,8 +460,8 @@ compaq_plasma_poll(void *p)
|
||||
if (!self->internal_monitor && !(self->port_23c6 & 1)) {
|
||||
cga_poll(&self->cga);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!self->linepos) {
|
||||
timer_advance_u64(&self->cga.timer, self->dispofftime);
|
||||
self->cga.cgastat |= 1;
|
||||
@@ -474,7 +474,7 @@ compaq_plasma_poll(void *p)
|
||||
if (self->cga.cgamode & 0x02) {
|
||||
if (self->cga.cgamode & 0x10)
|
||||
compaq_plasma_cgaline6(self);
|
||||
else
|
||||
else
|
||||
compaq_plasma_cgaline4(self);
|
||||
}
|
||||
else if (self->cga.cgamode & 0x01) /* High-res text */
|
||||
@@ -505,16 +505,16 @@ compaq_plasma_poll(void *p)
|
||||
if ((640 != xsize) || (400 != ysize) || video_force_resize_get()) {
|
||||
xsize = 640;
|
||||
ysize = 400;
|
||||
if (xsize < 64)
|
||||
if (xsize < 64)
|
||||
xsize = 656;
|
||||
if (ysize < 32)
|
||||
if (ysize < 32)
|
||||
ysize = 200;
|
||||
set_screen_size(xsize, ysize);
|
||||
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen(0, 0, xsize, ysize);
|
||||
frames++;
|
||||
|
||||
/* Fixed 640x400 resolution */
|
||||
@@ -524,26 +524,26 @@ compaq_plasma_poll(void *p)
|
||||
if (self->cga.cgamode & 0x02) {
|
||||
if (self->cga.cgamode & 0x10)
|
||||
video_bpp = 1;
|
||||
else
|
||||
else
|
||||
video_bpp = 2;
|
||||
|
||||
} else
|
||||
} else
|
||||
video_bpp = 0;
|
||||
self->cga.cgablink++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
{
|
||||
int n;
|
||||
|
||||
/* val behaves as follows:
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are inverse video
|
||||
* are inverse video
|
||||
* Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are bold */
|
||||
|
||||
@@ -554,15 +554,15 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
/* Initialise the attribute mapping. Start by defaulting everything
|
||||
* to black on amber, and with bold set by bit 3 */
|
||||
for (n = 0; n < 256; n++) {
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
blinkcols[n][1] = normcols[n][1] = black;
|
||||
}
|
||||
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always black on
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always black on
|
||||
* amber. */
|
||||
for (n = 0x11; n <= 0xFF; n++) {
|
||||
if ((n & 7) == 0)
|
||||
if ((n & 7) == 0)
|
||||
continue;
|
||||
if (self->attrmap & 4) { /* Inverse */
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
@@ -572,10 +572,10 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
blinkcols[n][1] = normcols[n][1] = amber;
|
||||
}
|
||||
}
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
* passed value. When blinking is enabled this also affects 81-8E. */
|
||||
for (n = 0x01; n <= 0x0E; n++) {
|
||||
if (n == 7)
|
||||
if (n == 7)
|
||||
continue;
|
||||
if (self->attrmap & 1) {
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
@@ -589,7 +589,7 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
blinkcols[n+128][1] = amber;
|
||||
}
|
||||
}
|
||||
/* Colours 07 and 0F are always amber on black. If blinking is
|
||||
/* Colours 07 and 0F are always amber on black. If blinking is
|
||||
* enabled so are 87 and 8F. */
|
||||
for (n = 0x07; n <= 0x0F; n += 8) {
|
||||
blinkcols[n][0] = normcols[n][0] = black;
|
||||
@@ -616,7 +616,7 @@ compaq_plasma_recalcattrs(compaq_plasma_t *self)
|
||||
}
|
||||
|
||||
static void *
|
||||
compaq_plasma_init(const device_t *info)
|
||||
compaq_plasma_init(const device_t *info)
|
||||
{
|
||||
int display_type;
|
||||
compaq_plasma_t *self = malloc(sizeof(compaq_plasma_t));
|
||||
@@ -648,7 +648,7 @@ compaq_plasma_init(const device_t *info)
|
||||
self->cga.rgb_type = device_get_config_int("rgb_type");
|
||||
cga_palette = (self->cga.rgb_type << 1);
|
||||
cgapal_rebuild();
|
||||
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -658,6 +658,7 @@ compaq_plasma_close(void *p)
|
||||
compaq_plasma_t *self = (compaq_plasma_t *)p;
|
||||
|
||||
free(self->vram);
|
||||
|
||||
free(self);
|
||||
}
|
||||
|
||||
@@ -669,76 +670,67 @@ compaq_plasma_speed_changed(void *p)
|
||||
compaq_plasma_recalctimings(self);
|
||||
}
|
||||
|
||||
const device_config_t compaq_plasma_config[] =
|
||||
{
|
||||
{
|
||||
"display_type", "Display type", CONFIG_SELECTION, "", CGA_RGB,
|
||||
{
|
||||
{
|
||||
"RGB", CGA_RGB
|
||||
},
|
||||
{
|
||||
"Composite", CGA_COMPOSITE
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"composite_type", "Composite type", CONFIG_SELECTION, "", COMPOSITE_OLD,
|
||||
{
|
||||
{
|
||||
"Old", COMPOSITE_OLD
|
||||
},
|
||||
{
|
||||
"New", COMPOSITE_NEW
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"rgb_type", "RGB type", CONFIG_SELECTION, "", 0,
|
||||
{
|
||||
{
|
||||
"Color", 0
|
||||
},
|
||||
{
|
||||
"Green Monochrome", 1
|
||||
},
|
||||
{
|
||||
"Amber Monochrome", 2
|
||||
},
|
||||
{
|
||||
"Gray Monochrome", 3
|
||||
},
|
||||
{
|
||||
"Color (no brown)", 4
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
const device_config_t compaq_plasma_config[] = {
|
||||
{
|
||||
.name = "display_type",
|
||||
.description = "Display type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = CGA_RGB,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "RGB", .value = CGA_RGB },
|
||||
{ .description = "Composite", .value = CGA_COMPOSITE },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "composite_type",
|
||||
.description = "Composite type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = COMPOSITE_OLD,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
{
|
||||
{ .description = "Old", .value = COMPOSITE_OLD },
|
||||
{ .description = "New", .value = COMPOSITE_NEW },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "rgb_type",
|
||||
.description = "RGB type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "Color", .value = 0 },
|
||||
{ .description = "Green Monochrome", .value = 1 },
|
||||
{ .description = "Amber Monochrome", .value = 2 },
|
||||
{ .description = "Gray Monochrome", .value = 3 },
|
||||
{ .description = "Color (no brown)", .value = 4 },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
static const device_t compaq_plasma_device =
|
||||
{
|
||||
"Compaq Plasma",
|
||||
0, 0,
|
||||
compaq_plasma_init,
|
||||
compaq_plasma_close,
|
||||
NULL,
|
||||
NULL,
|
||||
compaq_plasma_speed_changed,
|
||||
NULL,
|
||||
compaq_plasma_config
|
||||
const device_t compaq_plasma_device = {
|
||||
.name = "Compaq Plasma",
|
||||
.internal_name = "compaq_plasma",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = compaq_plasma_init,
|
||||
.close = compaq_plasma_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = compaq_plasma_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = compaq_plasma_config
|
||||
};
|
||||
|
||||
static uint8_t
|
||||
@@ -800,21 +792,13 @@ write_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
mem_write_raml_page(addr, val, &pages[addr >> 12]);
|
||||
}
|
||||
|
||||
const device_t *
|
||||
at_cpqiii_get_device(void)
|
||||
{
|
||||
return &compaq_plasma_device;
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_compaq_init(const machine_t *model, int type)
|
||||
{
|
||||
machine_at_init(model);
|
||||
|
||||
if (type != COMPAQ_DESKPRO386)
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
mem_mapping_add(&ram_mapping, 0xfa0000, 0x60000,
|
||||
@@ -822,6 +806,8 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
write_ram, write_ramw, write_raml,
|
||||
0xa0000+ram, MEM_MAPPING_INTERNAL, NULL);
|
||||
|
||||
video_reset(gfxcard);
|
||||
|
||||
switch(type) {
|
||||
case COMPAQ_PORTABLEII:
|
||||
break;
|
||||
@@ -843,6 +829,8 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
device_add(&ide_isa_device);
|
||||
break;
|
||||
}
|
||||
|
||||
machine_at_init(model);
|
||||
}
|
||||
|
||||
|
||||
@@ -851,8 +839,8 @@ machine_at_portableii_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleavedr(L"roms/machines/portableii/109740-001.rom",
|
||||
L"roms/machines/portableii/109739-001.rom",
|
||||
ret = bios_load_interleavedr("roms/machines/portableii/109740-001.rom",
|
||||
"roms/machines/portableii/109739-001.rom",
|
||||
0x000f8000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -869,8 +857,8 @@ machine_at_portableiii_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleavedr(L"roms/machines/portableiii/Compaq Portable III - BIOS - 106779-002 - Even.bin",
|
||||
L"roms/machines/portableiii/Compaq Portable III - BIOS - 106778-002 - Odd.bin",
|
||||
ret = bios_load_interleavedr("roms/machines/portableiii/Compaq Portable III - BIOS - 106779-002 - Even.bin",
|
||||
"roms/machines/portableiii/Compaq Portable III - BIOS - 106778-002 - Odd.bin",
|
||||
0x000f8000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -887,8 +875,8 @@ machine_at_portableiii386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleavedr(L"roms/machines/portableiii/Compaq Portable III - BIOS - 106779-002 - Even.bin",
|
||||
L"roms/machines/portableiii/Compaq Portable III - BIOS - 106778-002 - Odd.bin",
|
||||
ret = bios_load_interleavedr("roms/machines/portableiii/Compaq Portable III - BIOS - 106779-002 - Even.bin",
|
||||
"roms/machines/portableiii/Compaq Portable III - BIOS - 106778-002 - Odd.bin",
|
||||
0x000f8000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -898,3 +886,21 @@ machine_at_portableiii386_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
|
||||
int
|
||||
machine_at_deskpro386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linearr("roms/machines/deskpro386/1986-09-04-HI.json.bin",
|
||||
0x000fc000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_compaq_init(model, COMPAQ_DESKPRO386);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
74
src/machine/m_at_misc.c
Normal file
74
src/machine/m_at_misc.c
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of Miscellaneous, Fake, Hypervisor machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/pci.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/spd.h>
|
||||
#include <86box/video.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
#include <86box/sound.h>
|
||||
|
||||
int
|
||||
machine_at_vpc2007_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/vpc2007/13500.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
is_vpc = 1;
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&i440bx_no_agp_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977f_370_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256); /* real VPC provides invalid SPD data */
|
||||
|
||||
return ret;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,8 @@
|
||||
* Implementation of Slot 2 machines.
|
||||
*
|
||||
* Slot 2 is quite a rare type of Slot. Used mostly by Pentium II & III Xeons
|
||||
* These boards were also capable to take Slot 1 CPU's using Slot 2 to 1 adapters.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
@@ -30,12 +31,12 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/intel_flash.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/spd.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/clock.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
|
||||
@@ -44,7 +45,7 @@ machine_at_6gxu_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/6gxu/6gxu.f1c",
|
||||
ret = bios_load_linear("roms/machines/6gxu/6gxu.f1c",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -55,44 +56,23 @@ machine_at_6gxu_init(const machine_t *model)
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* On-Board SCSI. Not emulated at the moment */
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* On-Board SCSI. Not emulated at the moment */
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
|
||||
device_add(&i440gx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
device_add(&w83782d_device); /* fans: CPU, Power, System; temperatures: System, CPU, unused */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
hwm_values.voltages[1] = 1500; /* VGTL */
|
||||
|
||||
hwm_values_t machine_hwm = {
|
||||
{ /* fan speeds */
|
||||
3000, /* Chassis */
|
||||
3000, /* CPU */
|
||||
3000 /* Power */
|
||||
}, { /* temperatures */
|
||||
30, /* MB */
|
||||
0, /* unused */
|
||||
27 /* CPU */
|
||||
}, { /* voltages */
|
||||
2050, /* VCORE (2.05V by default) */
|
||||
0, /* unused */
|
||||
3300, /* +3.3V */
|
||||
RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */
|
||||
RESISTOR_DIVIDER(12000, 853, 347), /* -12V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */
|
||||
}
|
||||
};
|
||||
if (model->cpu[cpu_manufacturer].cpus[cpu_effective].cpu_type == CPU_PENTIUM2)
|
||||
machine_hwm.voltages[0] = 2800; /* set higher VCORE (2.8V) for Klamath */
|
||||
hwm_set_values(machine_hwm);
|
||||
device_add(&w83781d_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -101,7 +81,7 @@ machine_at_s2dge_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/s2dge/2gu7301.rom",
|
||||
ret = bios_load_linear("roms/machines/s2dge/2gu7301.rom",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -111,45 +91,63 @@ machine_at_s2dge_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
|
||||
device_add(&i440gx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
device_add(&w83781d_device); /* fans: CPU1, CPU2, Thermal Control; temperatures: unused, CPU1, CPU2? */
|
||||
hwm_values.fans[1] = 0; /* no CPU2 fan */
|
||||
hwm_values.temperatures[0] = 0; /* unused */
|
||||
hwm_values.temperatures[2] = 0; /* CPU2? */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_fw6400gx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/fw6400gx/FWGX1211.ROM",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
|
||||
device_add(&i440gx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&pc87309_15c_device);
|
||||
device_add(ics9xxx_get(ICS9250_08));
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
device_add(&w83781d_device); /* fans: Chassis, Power, CPU; temperatures: System, CPU, unused */
|
||||
hwm_values.temperatures[3] = 0; /* unused */
|
||||
hwm_values.voltages[1] = 1500; /* Vtt */
|
||||
|
||||
hwm_values_t machine_hwm = {
|
||||
{ /* fan speeds */
|
||||
3000, /* CPU1 */
|
||||
0, /* CPU2 */
|
||||
3000 /* Thermal Control */
|
||||
}, { /* temperatures */
|
||||
0, /* unused */
|
||||
30, /* CPU1 */
|
||||
20 /* unused (CPU2?) */
|
||||
}, { /* voltages */
|
||||
2050, /* CPU1 (2.05V by default) */
|
||||
0, /* CPU2 */
|
||||
3300, /* +3.3V */
|
||||
RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */
|
||||
RESISTOR_DIVIDER(12000, 853, 347), /* -12V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */
|
||||
}
|
||||
};
|
||||
if (model->cpu[cpu_manufacturer].cpus[cpu_effective].cpu_type == CPU_PENTIUM2)
|
||||
machine_hwm.voltages[0] = 2800; /* set higher VCORE (2.8V) for Klamath */
|
||||
hwm_set_values(machine_hwm);
|
||||
device_add(&w83781d_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -29,21 +29,24 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/intel_flash.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/spd.h>
|
||||
#include <86box/video.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
#include <86box/clock.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_ac97.h>
|
||||
|
||||
|
||||
int
|
||||
machine_at_s370slm_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/s370slm/3LM1202.rom",
|
||||
ret = bios_load_linear("roms/machines/s370slm/3LM1202.rom",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -54,51 +57,103 @@ machine_at_s370slm_init(const machine_t *model)
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440lx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&w83781d_device); /* fans: CPU, Fan 2, Chassis; temperatures: unused, CPU, unused */
|
||||
hwm_values.temperatures[0] = 0; /* unused */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
|
||||
hwm_values_t machine_hwm = {
|
||||
{ /* fan speeds */
|
||||
3000, /* CPU */
|
||||
3000, /* Fan 2 */
|
||||
3000 /* Chassis */
|
||||
}, { /* temperatures */
|
||||
0, /* unused */
|
||||
30, /* CPU */
|
||||
0 /* unused */
|
||||
}, { /* voltages */
|
||||
2050, /* CPU1 (2.05V by default) */
|
||||
0, /* unused */
|
||||
3300, /* +3.3V */
|
||||
RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */
|
||||
RESISTOR_DIVIDER(12000, 853, 347), /* -12V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */
|
||||
}
|
||||
};
|
||||
hwm_set_values(machine_hwm);
|
||||
device_add(&w83781d_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_s1857_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/s1857/BX57200A.ROM",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUND, 1, 0, 0, 0);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_370_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
if (sound_card_current == SOUND_INTERNAL) {
|
||||
device_add(&es1371_onboard_device);
|
||||
device_add(&cs4297_device); /* found on other Tyan boards around the same time */
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p6bap_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p6bap/bapa14a.BIN",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device); /* Rebranded as ET82C693A */
|
||||
device_add(&via_vt82c596b_device); /* Rebranded as ET82C696B */
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_cubx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/cubx/1008cu.004",
|
||||
ret = bios_load_linear("roms/machines/cubx/1008cu.004",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -108,52 +163,34 @@ machine_at_cubx_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x04, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x07, PCI_CARD_IDE, 2, 3, 4, 1);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(ics9xxx_get(ICS9250_08));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
|
||||
hwm_values_t machine_hwm = {
|
||||
{ /* fan speeds */
|
||||
3000, /* Chassis */
|
||||
3000, /* CPU */
|
||||
3000 /* Power */
|
||||
}, { /* temperatures */
|
||||
30, /* MB */
|
||||
30, /* JTPWR */
|
||||
30 /* CPU */
|
||||
}, { /* voltages */
|
||||
2050, /* VCORE (2.05V by default) */
|
||||
0, /* unused */
|
||||
3300, /* +3.3V */
|
||||
RESISTOR_DIVIDER(5000, 11, 16), /* +5V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(12000, 28, 10), /* +12V (28K/10K divider suggested in the W83781D datasheet) */
|
||||
RESISTOR_DIVIDER(12000, 59, 20), /* -12V (divider values bruteforced) */
|
||||
RESISTOR_DIVIDER(5000, 1, 2) /* -5V (divider values bruteforced) */
|
||||
}
|
||||
};
|
||||
hwm_set_values(machine_hwm);
|
||||
device_add(&as99127f_device);
|
||||
device_add(&as99127f_device); /* fans: Chassis, CPU, Power; temperatures: MB, JTPWR, CPU */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_atc7020bxii_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/atc7020bxii/7020s102.bin",
|
||||
ret = bios_load_linear("roms/machines/atc7020bxii/7020s102.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -163,13 +200,13 @@ machine_at_atc7020bxii_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&slc90e66_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
@@ -177,16 +214,16 @@ machine_at_atc7020bxii_init(const machine_t *model)
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_63a_init(const machine_t *model)
|
||||
machine_at_ambx133_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/63a1/63a-q3.bin",
|
||||
ret = bios_load_linear("roms/machines/ambx133/mkbx2vg2.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -196,17 +233,88 @@ machine_at_63a_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&gl518sm_2d_device); /* fans: CPUFAN1, CPUFAN2; temperature: CPU */
|
||||
hwm_values.fans[1] += 500;
|
||||
hwm_values.temperatures[0] += 4; /* CPU offset */
|
||||
hwm_values.voltages[1] = RESISTOR_DIVIDER(12000, 10, 2); /* different 12V divider in BIOS (10K/2K?) */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_awo671r_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/awo671r/a08139c.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add_inst(&w83977ef_device, 1);
|
||||
device_add_inst(&w83977ef_device, 2);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_63a1_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/63a1/63a-q3.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); // Integrated Sound?
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* Integrated Sound? */
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440zx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
@@ -219,7 +327,7 @@ machine_at_apas3_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/apas3/V0218SAG.BIN",
|
||||
ret = bios_load_linear("roms/machines/apas3/V0218SAG.BIN",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -229,18 +337,139 @@ machine_at_apas3_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_gt694va_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/gt694va/21071100.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_SOUND, 4, 1, 2, 3); /* assumed */
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c596b_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 1024);
|
||||
device_add(&w83782d_device); /* fans: CPU, unused, unused; temperatures: System, CPU1, unused */
|
||||
hwm_values.voltages[1] = 1500; /* IN1 (unknown purpose, assumed Vtt) */
|
||||
hwm_values.fans[0] = 4500; /* BIOS does not display <4411 RPM */
|
||||
hwm_values.fans[1] = 0; /* unused */
|
||||
hwm_values.fans[2] = 0; /* unused */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
|
||||
if (sound_card_current == SOUND_INTERNAL) {
|
||||
device_add(&es1371_onboard_device);
|
||||
device_add(&cs4297_device); /* assumed */
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_cuv4xls_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/cuv4xls/1005LS.001",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x04, PCI_CARD_SOUTHBRIDGE, 4, 1, 2, 3);
|
||||
pci_register_slot(0x05, PCI_CARD_SOUND, 3, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c686b_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_18));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 1024);
|
||||
device_add(&as99127f_device); /* fans: Chassis, CPU, Power; temperatures: MB, JTPWR, CPU */
|
||||
|
||||
if (sound_card_current == SOUND_INTERNAL)
|
||||
device_add(&cmi8738_onboard_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_6via90ap_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/6via90ap/90ap10.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c686b_device); /* fans: CPU1, CPU2; temperatures: CPU, System, unused */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_18));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 1024);
|
||||
hwm_values.temperatures[0] += 2; /* CPU offset */
|
||||
hwm_values.temperatures[1] += 2; /* System offset */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
|
||||
if (sound_card_current == SOUND_INTERNAL)
|
||||
device_add(&alc100_device); /* ALC100P identified on similar Acorp boards (694TA, 6VIA90A1) */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
464
src/machine/m_at_socket4.c
Normal file
464
src/machine/m_at_socket4.c
Normal file
@@ -0,0 +1,464 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of Socket 4 machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
*
|
||||
* Copyright 2010-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/pci.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/scsi_ncr53c8xx.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
void
|
||||
machine_at_premiere_common_init(const machine_t *model, int pci_switch)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | pci_switch);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
machine_at_award_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */
|
||||
pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
// device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
machine_at_sp4_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
/* Excluded: 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F, 10, 11, 12, 13, 14 */
|
||||
pci_register_slot(0x0D, PCI_CARD_IDE, 1, 2, 3, 4);
|
||||
/* Excluded: 02, 03*, 04*, 05*, 06*, 07*, 08* */
|
||||
/* Slots: 09 (04), 0A (03), 0B (02), 0C (07) */
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&ide_cmd640_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_excaliburpci_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted("roms/machines/excaliburpci/S701P.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x03, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p5mp3_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p5mp3/0205.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 1 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 3 */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&catalyst_flash_device);
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_dellxp60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted("roms/machines/dellxp60/XP60-A08.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
/* Not: 00, 02, 03, 04, 05, 06, 07, 08, 09, 0A, 0B, 0C, 0D, 0E, 0F. */
|
||||
/* Yes: 01, 10, 11, 12, 13, 14. */
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 4, 3, 3);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 4, 3, 2);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_opti560l_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted("roms/machines/opti560l/560L_A06.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 4, 4, 3, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 4, 3, 2);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&i82091aa_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ambradp60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/ambradp60/1004AF1P.BIO",
|
||||
"roms/machines/ambradp60/1004AF1P.BI1", 0x1c000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model, 0);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_valuepointp60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/valuepointp60/1006AV0M.BIO",
|
||||
"roms/machines/valuepointp60/1006AV0M.BI1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ps1_pci_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_revenge_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/revenge/1009af2_.bio",
|
||||
"roms/machines/revenge/1009af2_.bi1", 0x1c000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model, 0);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_586mc1_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/586mc1/IS.34",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_award_common_init(model);
|
||||
|
||||
device_add(&sio_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_pb520r_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/pb520r/1009bc0r.bio",
|
||||
"roms/machines/pb520r/1009bc0r.bi1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x03, PCI_CARD_VIDEO, 3, 3, 3, 3);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&ide_cmd640_pci_single_channel_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&gd5434_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&i82091aa_ide_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_excalibur_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted("roms/machines/excalibur/S75P.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&ide_opti611_vlb_device);
|
||||
device_add(&fdc37c661_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p5vl_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p5vl/SM507.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_excaliburpci2_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted("roms/machines/excaliburpci2/S722P.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&ami_1994_nvr_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p5sp4_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p5sp4/0106.001",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_sp4_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of Socket 4 and 5 machines.
|
||||
* Implementation of Socket 5 machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -28,158 +28,19 @@
|
||||
#include <86box/pci.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/intel_flash.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/scsi_ncr53c8xx.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
int
|
||||
machine_at_excalibur_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_inverted(L"roms/machines/excalibur/S75P.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ide_vlb_device);
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&fdc37c663_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
machine_at_premiere_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SPECIAL, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
machine_at_award_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_NO_IRQ_STEERING);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SPECIAL, 0, 0, 0, 0);
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 03 = Slot 1 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */
|
||||
pci_register_slot(0x07, PCI_CARD_SCSI, 1, 2, 3, 4); /* 07 = SCSI */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_batman_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/revenge/1009af2_.bio",
|
||||
L"roms/machines/revenge/1009af2_.bi1", 0x1c000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ambradp60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/ambradp60/1004AF1P.BIO",
|
||||
L"roms/machines/ambradp60/1004AF1P.BI1", 0x1c000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_VPP60)
|
||||
int
|
||||
machine_at_valuepointp60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/valuepointp60/1006AV0M.BIO",
|
||||
L"roms/machines/valuepointp60/1006AV0M.BI1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
machine_at_586mc1_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/586mc1/IS.34",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_award_common_init(model);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
@@ -187,13 +48,13 @@ machine_at_plato_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/plato/1016ax1_.bio",
|
||||
L"roms/machines/plato/1016ax1_.bi1", 0x1d000, 128);
|
||||
ret = bios_load_linear_combined("roms/machines/plato/1016ax1_.bio",
|
||||
"roms/machines/plato/1016ax1_.bi1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model);
|
||||
machine_at_premiere_common_init(model, PCI_CAN_SWITCH_TYPE);
|
||||
|
||||
device_add(&i430nx_device);
|
||||
|
||||
@@ -206,13 +67,13 @@ machine_at_ambradp90_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/ambradp90/1002AX1P.BIO",
|
||||
L"roms/machines/ambradp90/1002AX1P.BI1", 0x1d000, 128);
|
||||
ret = bios_load_linear_combined("roms/machines/ambradp90/1002AX1P.BIO",
|
||||
"roms/machines/ambradp90/1002AX1P.BI1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_premiere_common_init(model);
|
||||
machine_at_premiere_common_init(model, PCI_CAN_SWITCH_TYPE);
|
||||
|
||||
device_add(&i430nx_device);
|
||||
|
||||
@@ -225,7 +86,7 @@ machine_at_430nx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/430nx/IP.20",
|
||||
ret = bios_load_linear("roms/machines/430nx/IP.20",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -233,6 +94,8 @@ machine_at_430nx_init(const machine_t *model)
|
||||
|
||||
machine_at_award_common_init(model);
|
||||
|
||||
device_add(&sio_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&i430nx_device);
|
||||
|
||||
return ret;
|
||||
@@ -240,11 +103,11 @@ machine_at_430nx_init(const machine_t *model)
|
||||
|
||||
|
||||
int
|
||||
machine_at_p54tp4xe_init(const machine_t *model)
|
||||
machine_at_acerv30_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/p54tp4xe/t15i0302.awd",
|
||||
ret = bios_load_linear("roms/machines/acerv30/V30R01N9.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -252,18 +115,49 @@ machine_at_p54tp4xe_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
/* Award BIOS, SMC FDC37C665. */
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_apollo_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/apollo/S728P.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&ami_1995_nvr_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87332_398_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
@@ -271,12 +165,12 @@ machine_at_p54tp4xe_init(const machine_t *model)
|
||||
|
||||
|
||||
int
|
||||
machine_at_endeavor_init(const machine_t *model)
|
||||
machine_at_exp8551_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/endeavor/1006cb0_.bio",
|
||||
L"roms/machines/endeavor/1006cb0_.bi1", 0x1d000, 128);
|
||||
ret = bios_load_linear("roms/machines/exp8551/AMI20.BIO",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
@@ -285,40 +179,28 @@ machine_at_endeavor_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_ONBOARD, 4, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
at_endeavor_get_device(void)
|
||||
{
|
||||
return &s3_phoenix_trio64_onboard_pci_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_zappa_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/zappa/1006bs0_.bio",
|
||||
L"roms/machines/zappa/1006bs0_.bi1", 0x20000, 128);
|
||||
ret = bios_load_linear_combined("roms/machines/zappa/1006bs0_.bio",
|
||||
"roms/machines/zappa/1006bs0_.bi1", 0x20000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
@@ -342,101 +224,11 @@ machine_at_zappa_init(const machine_t *model)
|
||||
|
||||
|
||||
int
|
||||
machine_at_gw2kzp_init(const machine_t *model)
|
||||
machine_at_powermatev_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined(L"roms/machines/gw2k_zp/1011bs0t.bio",
|
||||
L"roms/machines/gw2k_zp/1011bs0t.bi1", 0x20000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_mb500n_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/mb500n/031396s.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_VECTRA54)
|
||||
int
|
||||
machine_at_vectra54_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/vectra54/GT0724.22",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c932qf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
machine_at_powermate_v_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/powermate_v/BIOS.ROM",
|
||||
ret = bios_load_linear("roms/machines/powermatev/BIOS.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -461,11 +253,11 @@ machine_at_powermate_v_init(const machine_t *model)
|
||||
|
||||
|
||||
int
|
||||
machine_at_acerv30_init(const machine_t *model)
|
||||
machine_at_mb500n_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/acerv30/V30R01N9.BIN",
|
||||
ret = bios_load_linear("roms/machines/mb500n/031396s.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -475,16 +267,146 @@ machine_at_acerv30_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_hawk_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/hawk/HAWK.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&ami_1994_nvr_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_pat54pv_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pat54pv/PAT54PV.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_hot543_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/hot543/543_R21.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x10, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p54sp4_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p54sp4/SI5I0204.AWD",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_sp4_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_sq588_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/sq588/sq588b03.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
/* Correct: 0D (01), 0F (02), 11 (03), 13 (04) */
|
||||
pci_register_slot(0x02, PCI_CARD_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&ide_cmd640_pci_single_channel_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
File diff suppressed because it is too large
Load Diff
556
src/machine/m_at_socket7_3v.c
Normal file
556
src/machine/m_at_socket7_3v.c
Normal file
@@ -0,0 +1,556 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of Socket 7 (Single Voltage) machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Melissa Goad, <mszoopers@protonmail.com>
|
||||
*
|
||||
* Copyright 2010-2020 Sarah Walker.
|
||||
* Copyright 2016-2020 Miran Grca.
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/pci.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/spd.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/nvr.h>
|
||||
|
||||
|
||||
static void
|
||||
machine_at_thor_common_init(const machine_t *model, int mr)
|
||||
{
|
||||
machine_at_common_init_ex(model, mr);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 2, 1);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64vplus_onboard_pci_device);
|
||||
|
||||
// device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
machine_at_p54tp4xe_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p54tp4xe_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p54tp4xe/t15i0302.awd",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_p54tp4xe_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p54tp4xe_mr_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p54tp4xe/TRITON.BIO",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_p54tp4xe_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_gw2katx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/gw2katx/1003CN0T.BIO",
|
||||
"roms/machines/gw2katx/1003CN0T.BI1", 0x20000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_thor_common_init(model, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_thor_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/thor/1006cn0_.bio",
|
||||
"roms/machines/thor/1006cn0_.bi1", 0x20000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_thor_common_init(model, 0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_mrthor_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/mrthor/mr_atx.bio",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_thor_common_init(model, 1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_endeavor_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/endeavor/1006cb0_.bio",
|
||||
"roms/machines/endeavor/1006cb0_.bi1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_ms5119_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ms5119/A37E.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0d, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0e, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0f, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_pb640_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined("roms/machines/pb640/1007CP0R.BIO",
|
||||
"roms/machines/pb640/1007CP0R.BI1", 0x1d000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430fx_rev02_device);
|
||||
device_add(&piix_rev02_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&gd5440_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_fmb_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/fmb/P5IV183.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 2, 1);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 3, 2, 1);
|
||||
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_acerm3a_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/acerm3a/r01-b3.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x10, PCI_CARD_VIDEO, 4, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&fdc37c932fr_device);
|
||||
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ap53_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ap53/ap53r2c0.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_VIDEO, 1, 2, 3, 4);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_8500tuc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/8500tuc/Tuc0221b.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&um8669f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p55t2s_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p55t2s/s6y08t.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_p5vxb_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p5vxb/P5VXB10.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_gw2kte_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined2("roms/machines/gw2kte/1008CY1T.BIO",
|
||||
"roms/machines/gw2kte/1008CY1T.BI1",
|
||||
"roms/machines/gw2kte/1008CY1T.BI2",
|
||||
"roms/machines/gw2kte/1008CY1T.BI3",
|
||||
"roms/machines/gw2kte/1008CY1T.RCV",
|
||||
0x3a000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c932fr_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ap5s_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ap5s/AP5S150.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 2, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 3, 2, 1);
|
||||
|
||||
device_add(&sis_5511_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_vectra54_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/vectra54/GT0724.22",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0D, PCI_CARD_VIDEO, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&s3_phoenix_trio64_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c931apm_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -29,22 +29,58 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/intel_flash.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/spd.h>
|
||||
#include <86box/video.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
int
|
||||
machine_at_p6rp4_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p6rp4/OR6I0106.SMC",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&p6rp4_nvr_device);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x19, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x14, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_IDE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i450kx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_cmd646_device);
|
||||
/* Input port bit 2 must be 1 or CMOS Setup is disabled. */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_686nx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/686nx/6nx.140",
|
||||
ret = bios_load_linear("roms/machines/686nx/6nx.140",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -74,7 +110,7 @@ machine_at_mb600n_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/mb600n/60915cs.rom",
|
||||
ret = bios_load_linear("roms/machines/mb600n/60915cs.rom",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -85,7 +121,7 @@ machine_at_mb600n_init(const machine_t *model)
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
@@ -99,11 +135,11 @@ machine_at_mb600n_init(const machine_t *model)
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_v60n_init(const machine_t *model)
|
||||
machine_at_acerv60n_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/v60n/V60NE5.BIN",
|
||||
ret = bios_load_linear("roms/machines/acerv60n/V60NE5.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -123,7 +159,6 @@ machine_at_v60n_init(const machine_t *model)
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&fdc37c935_device);
|
||||
device_add(&acerm3a_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -134,11 +169,11 @@ machine_at_vs440fx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined2(L"roms/machines/vs440fx/1018CS1_.bio",
|
||||
L"roms/machines/vs440fx/1018CS1_.bi1",
|
||||
L"roms/machines/vs440fx/1018CS1_.bi2",
|
||||
L"roms/machines/vs440fx/1018CS1_.bi3",
|
||||
L"roms/machines/vs440fx/1018CS1_.rcv",
|
||||
ret = bios_load_linear_combined2("roms/machines/vs440fx/1018CS1_.BIO",
|
||||
"roms/machines/vs440fx/1018CS1_.BI1",
|
||||
"roms/machines/vs440fx/1018CS1_.BI2",
|
||||
"roms/machines/vs440fx/1018CS1_.BI3",
|
||||
"roms/machines/vs440fx/1018CS1_.RCV",
|
||||
0x3a000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -163,50 +198,16 @@ machine_at_vs440fx_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_gw2kvs_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined2(L"roms/machines/gw2kvs/1011CS1T.bio",
|
||||
L"roms/machines/gw2kvs/1011CS1T.bi1",
|
||||
L"roms/machines/gw2kvs/1011CS1T.bi2",
|
||||
L"roms/machines/gw2kvs/1011CS1T.bi3",
|
||||
L"roms/machines/gw2kvs/1011CS1T.rcv",
|
||||
0x3a000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&pc87307_device);
|
||||
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_ap440fx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear_combined2(L"roms/machines/ap440fx/1011CT1_.bio",
|
||||
L"roms/machines/ap440fx/1011CT1_.bi1",
|
||||
L"roms/machines/ap440fx/1011CT1_.bi2",
|
||||
L"roms/machines/ap440fx/1011CT1_.bi3",
|
||||
L"roms/machines/ap440fx/1011CT1_.rcv",
|
||||
ret = bios_load_linear_combined2("roms/machines/ap440fx/1011CT1_.BIO",
|
||||
"roms/machines/ap440fx/1011CT1_.BI1",
|
||||
"roms/machines/ap440fx/1011CT1_.BI2",
|
||||
"roms/machines/ap440fx/1011CT1_.BI3",
|
||||
"roms/machines/ap440fx/1011CT1_.RCV",
|
||||
0x3a000, 128);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -216,7 +217,7 @@ machine_at_ap440fx_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_ONBOARD, 3, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_VIDEO, 3, 0, 0, 0);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 2, 1, 4);
|
||||
@@ -231,11 +232,11 @@ machine_at_ap440fx_init(const machine_t *model)
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_8500ttc_init(const machine_t *model)
|
||||
machine_at_8600ttc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/8500ttc/TTC0715B.ROM",
|
||||
ret = bios_load_linear("roms/machines/8600ttc/TTC0715B.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -246,7 +247,7 @@ machine_at_8500ttc_init(const machine_t *model)
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
@@ -264,7 +265,7 @@ machine_at_m6mi_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/m6mi/M6MI05.ROM",
|
||||
ret = bios_load_linear("roms/machines/m6mi/M6MI05.ROM",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -275,7 +276,7 @@ machine_at_m6mi_init(const machine_t *model)
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
@@ -302,10 +303,10 @@ machine_at_p65up5_common_init(const machine_t *model, const device_t *northbridg
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(northbridge);
|
||||
device_add(&piix3_device);
|
||||
device_add(&piix3_ioapic_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&ioapic_device);
|
||||
}
|
||||
|
||||
@@ -314,7 +315,7 @@ machine_at_p65up5_cp6nd_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/p65up5/nd6i0218.awd",
|
||||
ret = bios_load_linear("roms/machines/p65up5/ND6I0218.AWD",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
|
||||
@@ -33,21 +33,24 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/intel_flash.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/sst_flash.h>
|
||||
#include <86box/spd.h>
|
||||
#include <86box/hwm.h>
|
||||
#include <86box/video.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/machine.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_ac97.h>
|
||||
#include <86box/clock.h>
|
||||
|
||||
|
||||
int
|
||||
machine_at_ax59pro_init(const machine_t *model)
|
||||
machine_at_p5a_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ax59pro/AX59P236.BIN",
|
||||
ret = bios_load_linear("roms/machines/p5a/1011.005",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -57,18 +60,153 @@ machine_at_ax59pro_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x03, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
device_add(&w83781d_p5a_device); /* fans: Chassis, CPU, Power; temperatures: MB, unused, CPU */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_m579_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/m579/MS6260S_Socket7_ALi_M1542_AMI.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x03, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4);
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_5aa_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/5aa/GA-5AA.F7b",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x03, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_5ax_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/5ax/5AX.F4",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x03, PCI_CARD_SOUTHBRIDGE_PMU, 1, 2, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE_USB, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&ali1541_device);
|
||||
device_add(&ali1543c_device); /* +0 */
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ax59pro_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ax59pro/AX59P236.BIN",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 0, 0);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -79,7 +217,7 @@ machine_at_mvp3_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ficva503p/je4333.bin",
|
||||
ret = bios_load_linear("roms/machines/ficva503p/je4333.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -89,16 +227,93 @@ machine_at_mvp3_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0a, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x01, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_ficva503a_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/ficva503a/jn4116.bin",
|
||||
0x000c0000, 262144, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c686a_device); /* fans: CPU1, Chassis; temperatures: CPU, System, unused */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
hwm_values.temperatures[0] += 2; /* CPU offset */
|
||||
hwm_values.temperatures[1] += 2; /* System offset */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
|
||||
if (sound_card_current == SOUND_INTERNAL)
|
||||
device_add(&wm9701a_device); /* on daughtercard */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_at_5emapro_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/5emapro/5emo1aa2.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init_ex(model, 2);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_1);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 3, 4);
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
|
||||
device_add(&via_mvp3_device); /* Rebranded as EQ82C6638 */
|
||||
device_add(&via_vt82c686a_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&via_vt82c686_hwm_device); /* fans: CPU1, Chassis; temperatures: CPU, System, unused */
|
||||
hwm_values.temperatures[0] += 2; /* CPU offset */
|
||||
hwm_values.temperatures[1] += 2; /* System offset */
|
||||
hwm_values.temperatures[2] = 0; /* unused */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* Memory management
|
||||
* ~~~~~~~~~~~~~~~~~
|
||||
*
|
||||
*
|
||||
* Motherboard memory is divided into:
|
||||
* - Conventional memory: Either 512k or 640k
|
||||
* - Upper memory: Either 512k or 384k, depending on
|
||||
@@ -25,7 +25,7 @@
|
||||
* The BIOS setup screen allows some or
|
||||
* all of this to be used as EMS; the
|
||||
* remainder is XMS.
|
||||
*
|
||||
*
|
||||
* Additional memory (either EMS or XMS) can also be provided
|
||||
* by ISA expansion cards.
|
||||
*
|
||||
@@ -40,7 +40,7 @@
|
||||
* Bit 6: Always 1 } These bits select which motherboard
|
||||
* Bit 5: Always 0 } function to access.
|
||||
* Bit 4: Set to treat upper RAM as XMS
|
||||
* Bit 3: Enable external RAM boards?
|
||||
* Bit 3: Enable external RAM boards?
|
||||
* Bit 2: Set for 640k conventional memory, clear for 512k
|
||||
* Bit 1: Enable RAM beyond 1Mb.
|
||||
* Bit 0: Enable EMS.
|
||||
@@ -69,7 +69,7 @@
|
||||
* OUT 0x4208, 0x80 will page in the first 16k page at 0xD4000.
|
||||
* OUT 0x218, 0x80 will page in the 129th 16k page at 0xD0000.
|
||||
* etc.
|
||||
*
|
||||
*
|
||||
* To use EMS from DOS, you will need the Toshiba EMS driver
|
||||
* (TOSHEMM.ZIP). This supports the above system, plus further
|
||||
* ranges of ports at 0x_2A8, 0x_2B8, 0x_2C8.
|
||||
@@ -104,7 +104,7 @@
|
||||
* 01 0 => 3, 4, 5
|
||||
* 01 1 => 3, 5, 4
|
||||
* 10 0 => 4, -, 3
|
||||
* 10 1 => 3, -, 4
|
||||
* 10 1 => 3, -, 4
|
||||
* 010 => set memory mappings
|
||||
* bit 4 set if upper RAM is XMS
|
||||
* bit 3 enable add-on memory boards beyond 5Mb?
|
||||
@@ -163,6 +163,7 @@
|
||||
#include "cpu.h"
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_at_t3100e.h>
|
||||
|
||||
@@ -236,7 +237,7 @@ t3100e_log(const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
/* Given a memory address (which ought to be in the page frame at 0xD0000),
|
||||
/* Given a memory address (which ought to be in the page frame at 0xD0000),
|
||||
* which page does it relate to? */
|
||||
static int addr_to_page(uint32_t addr)
|
||||
{
|
||||
@@ -247,7 +248,7 @@ static int addr_to_page(uint32_t addr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* And vice versa: Given a page slot, which memory address does it
|
||||
/* And vice versa: Given a page slot, which memory address does it
|
||||
* correspond to? */
|
||||
static uint32_t page_to_addr(int pg)
|
||||
{
|
||||
@@ -255,7 +256,7 @@ static uint32_t page_to_addr(int pg)
|
||||
}
|
||||
|
||||
/* Given an EMS page ID, return its physical address in RAM. */
|
||||
uint32_t t3100e_ems_execaddr(struct t3100e_ems_regs *regs,
|
||||
uint32_t t3100e_ems_execaddr(struct t3100e_ems_regs *regs,
|
||||
int pg, uint16_t val)
|
||||
{
|
||||
uint32_t addr;
|
||||
@@ -295,14 +296,14 @@ static int port_to_page(uint16_t addr)
|
||||
{
|
||||
switch (addr)
|
||||
{
|
||||
case 0x208: return 0;
|
||||
case 0x4208: return 1;
|
||||
case 0x8208: return 2;
|
||||
case 0xC208: return 3;
|
||||
case 0x218: return 4;
|
||||
case 0x4218: return 5;
|
||||
case 0x8218: return 6;
|
||||
case 0xC218: return 7;
|
||||
case 0x208: return 0;
|
||||
case 0x4208: return 1;
|
||||
case 0x8208: return 2;
|
||||
case 0xC208: return 3;
|
||||
case 0x218: return 4;
|
||||
case 0x4218: return 5;
|
||||
case 0x8218: return 6;
|
||||
case 0xC218: return 7;
|
||||
case 0x258: return 8;
|
||||
case 0x4258: return 9;
|
||||
case 0x8258: return 10;
|
||||
@@ -330,12 +331,12 @@ void dump_mappings()
|
||||
if (mm == &ram_mid_mapping ) name = "MID ";
|
||||
if (mm == &ram_high_mapping) name = "HIGH";
|
||||
if (mm == &t3100e_ems.upper_mapping) name = "UPPR";
|
||||
if (mm == &t3100e_ems.mapping[0])
|
||||
if (mm == &t3100e_ems.mapping[0])
|
||||
{
|
||||
name = "EMS0";
|
||||
offset = t3100e_ems.page_exec[0];
|
||||
}
|
||||
if (mm == &t3100e_ems.mapping[1])
|
||||
if (mm == &t3100e_ems.mapping[1])
|
||||
{
|
||||
name = "EMS1";
|
||||
offset = t3100e_ems.page_exec[1];
|
||||
@@ -345,14 +346,14 @@ void dump_mappings()
|
||||
name = "EMS2";
|
||||
offset = t3100e_ems.page_exec[2];
|
||||
}
|
||||
if (mm == &t3100e_ems.mapping[3])
|
||||
if (mm == &t3100e_ems.mapping[3])
|
||||
{
|
||||
name = "EMS3";
|
||||
offset = t3100e_ems.page_exec[3];
|
||||
}
|
||||
|
||||
t3100e_log(" %p | base=%05x size=%05x %c @ %06x %s\n", mm,
|
||||
mm->base, mm->size, mm->enable ? 'Y' : 'N',
|
||||
t3100e_log(" %p | base=%05x size=%05x %c @ %06x %s\n", mm,
|
||||
mm->base, mm->size, mm->enable ? 'Y' : 'N',
|
||||
offset, name);
|
||||
|
||||
mm = mm->next;
|
||||
@@ -364,21 +365,23 @@ void t3100e_map_ram(uint8_t val)
|
||||
int n;
|
||||
int32_t upper_len;
|
||||
|
||||
t3100e_log("OUT 0x8084, %02x [ set memory mapping :", val | 0x40);
|
||||
#ifdef ENABLE_T3100E_LOG
|
||||
t3100e_log("OUT 0x8084, %02x [ set memory mapping :", val | 0x40);
|
||||
if (val & 1) t3100e_log("ENABLE_EMS ");
|
||||
if (val & 2) t3100e_log("ENABLE_XMS ");
|
||||
if (val & 4) t3100e_log("640K ");
|
||||
if (val & 8) t3100e_log("X8X ");
|
||||
if (val & 16) t3100e_log("UPPER_IS_XMS ");
|
||||
t3100e_log("\n");
|
||||
#endif
|
||||
|
||||
/* Bit 2 controls size of conventional memory */
|
||||
if (val & 4)
|
||||
if (val & 4)
|
||||
{
|
||||
t3100e_ems.upper_base = 0xA0000;
|
||||
t3100e_ems.upper_pages = 24;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
t3100e_ems.upper_base = 0x80000;
|
||||
t3100e_ems.upper_pages = 32;
|
||||
@@ -399,7 +402,7 @@ void t3100e_map_ram(uint8_t val)
|
||||
mem_mapping_disable(&ram_high_mapping);
|
||||
}
|
||||
|
||||
/* Bit 4 set if upper RAM is mapped to high memory
|
||||
/* Bit 4 set if upper RAM is mapped to high memory
|
||||
* (and bit 1 set if XMS enabled) */
|
||||
if ((val & 0x12) == 0x12)
|
||||
{
|
||||
@@ -416,7 +419,7 @@ void t3100e_map_ram(uint8_t val)
|
||||
/* Recalculate EMS mappings */
|
||||
for (n = 0; n < 4; n++)
|
||||
{
|
||||
t3100e_ems_out(t3100e_ems_page_reg[n], t3100e_ems.page[n],
|
||||
t3100e_ems_out(t3100e_ems_page_reg[n], t3100e_ems.page[n],
|
||||
&t3100e_ems);
|
||||
}
|
||||
|
||||
@@ -458,7 +461,7 @@ uint8_t t3100e_sys_in(uint16_t addr, void *p)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
|
||||
|
||||
/* The low 4 bits always seem to be 0x0C. The high 4 are a
|
||||
/* The low 4 bits always seem to be 0x0C. The high 4 are a
|
||||
* notification sent by the keyboard controller when it detects
|
||||
* an [Fn] key combination */
|
||||
t3100e_log("IN 0x8084\n");
|
||||
@@ -475,10 +478,10 @@ void t3100e_sys_out(uint16_t addr, uint8_t val, void *p)
|
||||
switch (val & 0xE0)
|
||||
{
|
||||
case 0x00: /* Set serial port IRQs. Not implemented */
|
||||
t3100e_log("OUT 0x8084, %02x [ set serial port IRQs]\n", val);
|
||||
t3100e_log("OUT 0x8084, %02x [ set serial port IRQs]\n", val);
|
||||
break;
|
||||
case 0x40: /* Set RAM mappings. */
|
||||
t3100e_map_ram(val & 0x1F);
|
||||
t3100e_map_ram(val & 0x1F);
|
||||
break;
|
||||
|
||||
case 0x80: /* Set video options. */
|
||||
@@ -518,7 +521,7 @@ uint8_t t3100e_config_get(void)
|
||||
prt_switch = (type_b ? 2 : 0);
|
||||
switch(type_a)
|
||||
{
|
||||
/* Since a T3100e cannot have an internal 5.25" drive, mark 5.25" A: drive as
|
||||
/* Since a T3100e cannot have an internal 5.25" drive, mark 5.25" A: drive as
|
||||
* being external, and set the internal type based on type_b. */
|
||||
case 1: /* 360k */
|
||||
case 2: /* 1.2Mb */
|
||||
@@ -533,7 +536,7 @@ uint8_t t3100e_config_get(void)
|
||||
}
|
||||
break;
|
||||
case 4: value |= 0x01; /* 720k */
|
||||
if (type_a == type_b)
|
||||
if (type_a == type_b)
|
||||
{
|
||||
value &= (~8); /* Two internal drives */
|
||||
prt_switch = 0; /* No external drive */
|
||||
@@ -541,7 +544,7 @@ uint8_t t3100e_config_get(void)
|
||||
break;
|
||||
case 5: /* 1.4M */
|
||||
case 7: /* 2.8M */
|
||||
if (type_a == type_b)
|
||||
if (type_a == type_b)
|
||||
{
|
||||
value &= (~8); /* Two internal drives */
|
||||
prt_switch = 0; /* No external drive */
|
||||
@@ -549,7 +552,7 @@ uint8_t t3100e_config_get(void)
|
||||
break;
|
||||
case 6: /* 3-mode */
|
||||
value |= 0x10;
|
||||
if (type_a == type_b)
|
||||
if (type_a == type_b)
|
||||
{
|
||||
value &= (~8); /* Two internal drives */
|
||||
prt_switch = 0; /* No external drive */
|
||||
@@ -570,7 +573,7 @@ uint8_t t3100e_config_get(void)
|
||||
uint8_t t3100e_ems_in(uint16_t addr, void *p)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)p;
|
||||
|
||||
|
||||
int page = port_to_page(addr);
|
||||
if (page >= 0)
|
||||
return regs->page[page];
|
||||
@@ -620,7 +623,7 @@ static uint8_t ems_read_ram(uint32_t addr, void *priv)
|
||||
|
||||
if (pg < 0) return 0xFF;
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
return ram[addr];
|
||||
return ram[addr];
|
||||
}
|
||||
|
||||
|
||||
@@ -631,11 +634,11 @@ static uint16_t ems_read_ramw(uint32_t addr, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
int pg = addr_to_page(addr);
|
||||
|
||||
if (pg < 0) return 0xFF;
|
||||
if (pg < 0) return 0xFFFF;
|
||||
//t3100e_log("ems_read_ramw addr=%05x ", addr);
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
//t3100e_log("-> %06x val=%04x\n", addr, *(uint16_t *)&ram[addr]);
|
||||
return *(uint16_t *)&ram[addr];
|
||||
//t3100e_log("-> %06x val=%04x\n", addr, *(uint16_t *)&ram[addr]);
|
||||
return *(uint16_t *)&ram[addr];
|
||||
}
|
||||
|
||||
|
||||
@@ -644,9 +647,9 @@ static uint32_t ems_read_raml(uint32_t addr, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
int pg = addr_to_page(addr);
|
||||
|
||||
if (pg < 0) return 0xFF;
|
||||
if (pg < 0) return 0xFFFFFFFF;
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
return *(uint32_t *)&ram[addr];
|
||||
return *(uint32_t *)&ram[addr];
|
||||
}
|
||||
|
||||
/* Write RAM in the EMS page frame */
|
||||
@@ -657,7 +660,7 @@ static void ems_write_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
|
||||
if (pg < 0) return;
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
ram[addr] = val;
|
||||
ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -671,7 +674,7 @@ static void ems_write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
//t3100e_log("-> %06x val=%04x\n", addr, val);
|
||||
|
||||
*(uint16_t *)&ram[addr] = val;
|
||||
*(uint16_t *)&ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -682,19 +685,19 @@ static void ems_write_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
|
||||
if (pg < 0) return;
|
||||
addr = regs->page_exec[pg] + (addr & 0x3FFF);
|
||||
*(uint32_t *)&ram[addr] = val;
|
||||
*(uint32_t *)&ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Read RAM in the upper area. This is basically what the 'remapped'
|
||||
/* Read RAM in the upper area. This is basically what the 'remapped'
|
||||
* mapping in mem.c does, except that the upper area can move around */
|
||||
static uint8_t upper_read_ram(uint32_t addr, void *priv)
|
||||
{
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
return ram[addr];
|
||||
return ram[addr];
|
||||
}
|
||||
|
||||
static uint16_t upper_read_ramw(uint32_t addr, void *priv)
|
||||
@@ -702,7 +705,7 @@ static uint16_t upper_read_ramw(uint32_t addr, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
return *(uint16_t *)&ram[addr];
|
||||
return *(uint16_t *)&ram[addr];
|
||||
}
|
||||
|
||||
static uint32_t upper_read_raml(uint32_t addr, void *priv)
|
||||
@@ -710,7 +713,7 @@ static uint32_t upper_read_raml(uint32_t addr, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
return *(uint32_t *)&ram[addr];
|
||||
return *(uint32_t *)&ram[addr];
|
||||
}
|
||||
|
||||
|
||||
@@ -719,7 +722,7 @@ static void upper_write_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
ram[addr] = val;
|
||||
ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -728,7 +731,7 @@ static void upper_write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
*(uint16_t *)&ram[addr] = val;
|
||||
*(uint16_t *)&ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -738,7 +741,7 @@ static void upper_write_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
struct t3100e_ems_regs *regs = (struct t3100e_ems_regs *)priv;
|
||||
|
||||
addr = (addr - (1024 * mem_size)) + regs->upper_base;
|
||||
*(uint32_t *)&ram[addr] = val;
|
||||
*(uint32_t *)&ram[addr] = val;
|
||||
}
|
||||
|
||||
|
||||
@@ -748,7 +751,7 @@ int machine_at_t3100e_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/t3100e/t3100e.rom",
|
||||
ret = bios_load_linear("roms/machines/t3100e/t3100e.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -757,34 +760,38 @@ int machine_at_t3100e_init(const machine_t *model)
|
||||
int pg;
|
||||
|
||||
memset(&t3100e_ems, 0, sizeof(t3100e_ems));
|
||||
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
device_add(&keyboard_at_toshiba_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
{
|
||||
device_add(&fdc_at_device);
|
||||
}
|
||||
|
||||
/* Hook up system control port */
|
||||
io_sethandler(0x8084, 0x0001,
|
||||
io_sethandler(0x8084, 0x0001,
|
||||
t3100e_sys_in, NULL, NULL,
|
||||
t3100e_sys_out, NULL, NULL, &t3100e_ems);
|
||||
|
||||
/* Start monitoring all 16 EMS registers */
|
||||
for (pg = 0; pg < 16; pg++)
|
||||
for (pg = 0; pg < 16; pg++)
|
||||
{
|
||||
io_sethandler(t3100e_ems_page_reg[pg], 0x0001,
|
||||
io_sethandler(t3100e_ems_page_reg[pg], 0x0001,
|
||||
t3100e_ems_in, NULL, NULL,
|
||||
t3100e_ems_out, NULL, NULL, &t3100e_ems);
|
||||
t3100e_ems_out, NULL, NULL, &t3100e_ems);
|
||||
}
|
||||
|
||||
/* Map the EMS page frame */
|
||||
for (pg = 0; pg < 4; pg++)
|
||||
{
|
||||
t3100e_log("Adding memory map at %x for page %d\n", page_to_addr(pg), pg);
|
||||
mem_mapping_add(&t3100e_ems.mapping[pg],
|
||||
page_to_addr(pg), 16384,
|
||||
mem_mapping_add(&t3100e_ems.mapping[pg],
|
||||
page_to_addr(pg), 16384,
|
||||
ems_read_ram, ems_read_ramw, ems_read_raml,
|
||||
ems_write_ram, ems_write_ramw, ems_write_raml,
|
||||
NULL, MEM_MAPPING_EXTERNAL,
|
||||
NULL, MEM_MAPPING_EXTERNAL,
|
||||
&t3100e_ems);
|
||||
/* Start them all off disabled */
|
||||
mem_mapping_disable(&t3100e_ems.mapping[pg]);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* Selecting a character height of 3 seems to be sufficient to
|
||||
* convert the 640x200 graphics mode to 640x400 (and, by
|
||||
* analogy, 320x200 to 320x400).
|
||||
*
|
||||
*
|
||||
* Horiz-----> Vert------> I ch
|
||||
* 38 28 2D 0A 1F 06 19 1C 02 07 06 07 CO40
|
||||
* 71 50 5A 0A 1F 06 19 1C 02 07 06 07 CO80
|
||||
@@ -86,7 +86,7 @@ static uint32_t normcols[256][2];
|
||||
*
|
||||
* Bit 3: Disable built-in video (for add-on card)
|
||||
* Bit 2: Thin font
|
||||
* Bits 0,1: Font set (not currently implemented)
|
||||
* Bits 0,1: Font set (not currently implemented)
|
||||
*/
|
||||
static uint8_t st_video_options;
|
||||
static int8_t st_display_internal = -1;
|
||||
@@ -111,7 +111,7 @@ typedef struct t3100e_t
|
||||
{
|
||||
mem_mapping_t mapping;
|
||||
|
||||
cga_t cga; /* The CGA is used for the external
|
||||
cga_t cga; /* The CGA is used for the external
|
||||
* display; most of its registers are
|
||||
* ignored by the plasma display. */
|
||||
|
||||
@@ -121,7 +121,7 @@ typedef struct t3100e_t
|
||||
uint8_t attrmap; /* Attribute mapping register */
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
|
||||
|
||||
int linepos, displine;
|
||||
int vc;
|
||||
int dispon;
|
||||
@@ -154,12 +154,12 @@ void t3100e_out(uint16_t addr, uint8_t val, void *p)
|
||||
case 0x3d1: case 0x3d3: case 0x3d5: case 0x3d7:
|
||||
/* Register 0x12 controls the attribute mappings for the
|
||||
* plasma screen. */
|
||||
if (t3100e->cga.crtcreg == 0x12)
|
||||
if (t3100e->cga.crtcreg == 0x12)
|
||||
{
|
||||
t3100e->attrmap = val;
|
||||
t3100e->attrmap = val;
|
||||
t3100e_recalcattrs(t3100e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
cga_out(addr, val, &t3100e->cga);
|
||||
|
||||
t3100e_recalctimings(t3100e);
|
||||
@@ -191,7 +191,7 @@ uint8_t t3100e_in(uint16_t addr, void *p)
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return cga_in(addr, &t3100e->cga);
|
||||
}
|
||||
|
||||
@@ -201,19 +201,17 @@ uint8_t t3100e_in(uint16_t addr, void *p)
|
||||
void t3100e_write(uint32_t addr, uint8_t val, void *p)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *)p;
|
||||
egawrites++;
|
||||
|
||||
t3100e->vram[addr & 0x7fff] = val;
|
||||
sub_cycles(4);
|
||||
cycles -= 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
uint8_t t3100e_read(uint32_t addr, void *p)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *)p;
|
||||
egareads++;
|
||||
sub_cycles(4);
|
||||
cycles -= 4;
|
||||
|
||||
return t3100e->vram[addr & 0x7fff];
|
||||
}
|
||||
@@ -284,8 +282,8 @@ void t3100e_text_row80(t3100e_t *t3100e)
|
||||
|
||||
if (t3100e->cga.cgamode & 0x20) /* Blink */
|
||||
{
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink) cols[1] = cols[0];
|
||||
}
|
||||
else
|
||||
@@ -354,8 +352,8 @@ void t3100e_text_row40(t3100e_t *t3100e)
|
||||
|
||||
if (t3100e->cga.cgamode & 0x20) /* Blink */
|
||||
{
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink) cols[1] = cols[0];
|
||||
}
|
||||
else
|
||||
@@ -367,7 +365,7 @@ void t3100e_text_row40(t3100e_t *t3100e)
|
||||
{
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2 + 1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (amber ^ black);
|
||||
}
|
||||
}
|
||||
@@ -375,7 +373,7 @@ void t3100e_text_row40(t3100e_t *t3100e)
|
||||
{
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t3100e->displine])[(x << 4) + c*2+1] = cols[(fontdatm[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
@@ -463,7 +461,7 @@ void t3100e_cgaline4(t3100e_t *t3100e)
|
||||
switch (pattern & 3)
|
||||
{
|
||||
case 0: ink0 = ink1 = black; break;
|
||||
case 1: if (t3100e->displine & 1)
|
||||
case 1: if (t3100e->displine & 1)
|
||||
{
|
||||
ink0 = black; ink1 = black;
|
||||
}
|
||||
@@ -472,7 +470,7 @@ void t3100e_cgaline4(t3100e_t *t3100e)
|
||||
ink0 = amber; ink1 = black;
|
||||
}
|
||||
break;
|
||||
case 2: if (t3100e->displine & 1)
|
||||
case 2: if (t3100e->displine & 1)
|
||||
{
|
||||
ink0 = black; ink1 = amber;
|
||||
}
|
||||
@@ -539,20 +537,20 @@ void t3100e_poll(void *p)
|
||||
}
|
||||
|
||||
/* Graphics */
|
||||
if (t3100e->cga.cgamode & 0x02)
|
||||
if (t3100e->cga.cgamode & 0x02)
|
||||
{
|
||||
if (t3100e->cga.cgamode & 0x10)
|
||||
t3100e_cgaline6(t3100e);
|
||||
else t3100e_cgaline4(t3100e);
|
||||
}
|
||||
else
|
||||
else
|
||||
if (t3100e->cga.cgamode & 0x01) /* High-res text */
|
||||
{
|
||||
t3100e_text_row80(t3100e);
|
||||
t3100e_text_row80(t3100e);
|
||||
}
|
||||
else
|
||||
{
|
||||
t3100e_text_row40(t3100e);
|
||||
t3100e_text_row40(t3100e);
|
||||
}
|
||||
}
|
||||
t3100e->displine++;
|
||||
@@ -592,14 +590,14 @@ void t3100e_poll(void *p)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen(0, 0, xsize, ysize);
|
||||
|
||||
frames++;
|
||||
/* Fixed 640x400 resolution */
|
||||
video_res_x = T3100E_XSIZE;
|
||||
video_res_y = T3100E_YSIZE;
|
||||
|
||||
if (t3100e->cga.cgamode & 0x02)
|
||||
if (t3100e->cga.cgamode & 0x02)
|
||||
{
|
||||
if (t3100e->cga.cgamode & 0x10)
|
||||
video_bpp = 1;
|
||||
@@ -619,10 +617,10 @@ void t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
int n;
|
||||
|
||||
/* val behaves as follows:
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are inverse video
|
||||
* are inverse video
|
||||
* Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are bold */
|
||||
|
||||
@@ -635,12 +633,12 @@ void t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
for (n = 0; n < 256; n++)
|
||||
{
|
||||
boldcols[n] = (n & 8) != 0;
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
blinkcols[n][0] = normcols[n][0] = amber;
|
||||
blinkcols[n][1] = normcols[n][1] = black;
|
||||
}
|
||||
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always black on
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always black on
|
||||
* amber. */
|
||||
for (n = 0x11; n <= 0xFF; n++)
|
||||
{
|
||||
@@ -657,7 +655,7 @@ void t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
}
|
||||
if (t3100e->attrmap & 8) boldcols[n] = 1; /* Bold */
|
||||
}
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
* passed value. When blinking is enabled this also affects 81-8E. */
|
||||
for (n = 0x01; n <= 0x0E; n++)
|
||||
{
|
||||
@@ -678,7 +676,7 @@ void t3100e_recalcattrs(t3100e_t *t3100e)
|
||||
}
|
||||
if (t3100e->attrmap & 2) boldcols[n] = 1;
|
||||
}
|
||||
/* Colours 07 and 0F are always amber on black. If blinking is
|
||||
/* Colours 07 and 0F are always amber on black. If blinking is
|
||||
* enabled so are 87 and 8F. */
|
||||
for (n = 0x07; n <= 0x0F; n += 8)
|
||||
{
|
||||
@@ -715,7 +713,7 @@ void *t3100e_init(const device_t *info)
|
||||
{
|
||||
t3100e_t *t3100e = malloc(sizeof(t3100e_t));
|
||||
memset(t3100e, 0, sizeof(t3100e_t));
|
||||
loadfont(L"roms/machines/t3100e/t3100e_font.bin", 5);
|
||||
loadfont("roms/machines/t3100e/t3100e_font.bin", 5);
|
||||
cga_init(&t3100e->cga);
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t3100e);
|
||||
|
||||
@@ -755,19 +753,20 @@ void t3100e_close(void *p)
|
||||
void t3100e_speed_changed(void *p)
|
||||
{
|
||||
t3100e_t *t3100e = (t3100e_t *)p;
|
||||
|
||||
|
||||
t3100e_recalctimings(t3100e);
|
||||
}
|
||||
|
||||
const device_t t3100e_device =
|
||||
{
|
||||
"Toshiba T3100e",
|
||||
0,
|
||||
0,
|
||||
t3100e_init,
|
||||
t3100e_close,
|
||||
NULL,
|
||||
NULL,
|
||||
t3100e_speed_changed,
|
||||
NULL
|
||||
const device_t t3100e_device = {
|
||||
.name = "Toshiba T3100e",
|
||||
.internal_name = "t3100e",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = t3100e_init,
|
||||
.close = t3100e_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = t3100e_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* f000:db3e 0x8..0xc
|
||||
* f000:d7f8
|
||||
* f000:db5f
|
||||
* f000:e172
|
||||
* f000:e172
|
||||
* f000:ecc5 801a video setup error
|
||||
* f000:d6c9 copyright output
|
||||
* f000:e1b7
|
||||
@@ -58,7 +58,7 @@
|
||||
* read low 4 nibble at jim 0xa
|
||||
* read low 4 nibble at jim 0xa
|
||||
* return first nibble<<4|second nibble in ah
|
||||
* f000:f046 seldom compares ret
|
||||
* f000:f046 seldom compares ret
|
||||
* f000:fe87 0 -> ds
|
||||
*
|
||||
* Memory:
|
||||
@@ -67,7 +67,7 @@
|
||||
* 0000:046a: 00 jim 250 01 jim 350
|
||||
*
|
||||
* WARNING THIS IS A WORK-IN-PROGRESS MODULE. USE AT OWN RISK.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
@@ -615,7 +615,7 @@ europc_boot(const device_t *info)
|
||||
mouse_bus_set_irq(sys->mouse, 2);
|
||||
/* Configure the port for (Bus Mouse Compatible) Mouse. */
|
||||
b |= 0x01;
|
||||
} else if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
} else if (joystick_type)
|
||||
b |= 0x02; /* enable port as joysticks */
|
||||
sys->nvr.regs[MRTC_CONF_C] = b;
|
||||
|
||||
@@ -666,37 +666,38 @@ europc_close(void *priv)
|
||||
free(nvr->fn);
|
||||
}
|
||||
|
||||
|
||||
static const device_config_t europc_config[] = {
|
||||
{
|
||||
"js9", "JS9 Jumper (JIM)", CONFIG_INT, "", 0,
|
||||
{
|
||||
{
|
||||
"Disabled (250h)", 0
|
||||
},
|
||||
{
|
||||
"Enabled (350h)", 1
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
},
|
||||
.name = "js9",
|
||||
.description = "JS9 Jumper (JIM)",
|
||||
.type = CONFIG_INT,
|
||||
.default_string = "",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "Disabled (250h)", .value = 0 },
|
||||
{ .description = "Enabled (350h)", .value = 1 },
|
||||
{ .description = "" }
|
||||
},
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
const device_t europc_device = {
|
||||
"EuroPC System Board",
|
||||
0, 0,
|
||||
europc_boot, europc_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
europc_config
|
||||
.name = "EuroPC System Board",
|
||||
.internal_name = "europc",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = europc_boot,
|
||||
.close = europc_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = europc_config
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* This function sets up the Scheider EuroPC machine.
|
||||
*
|
||||
@@ -710,14 +711,14 @@ machine_europc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/europc/50145",
|
||||
ret = bios_load_linear("roms/machines/europc/50145",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_common_init(model);
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
nmi_init();
|
||||
|
||||
|
||||
@@ -1,904 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the Olivetti M24.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/ppi.h>
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_speaker.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
#define STAT_TTIMEOUT 0x20
|
||||
#define STAT_LOCK 0x10
|
||||
#define STAT_CD 0x08
|
||||
#define STAT_SYSFLAG 0x04
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
|
||||
typedef struct {
|
||||
/* Video stuff. */
|
||||
mem_mapping_t mapping;
|
||||
uint8_t crtc[32];
|
||||
int crtcreg;
|
||||
uint8_t monitor_type, port_23c6;
|
||||
uint8_t *vram;
|
||||
uint8_t charbuffer[256];
|
||||
uint8_t ctrl;
|
||||
uint32_t base;
|
||||
uint8_t cgamode, cgacol;
|
||||
uint8_t stat;
|
||||
int linepos, displine;
|
||||
int sc, vc;
|
||||
int con, coff, cursoron, blink;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
int lineff;
|
||||
uint16_t ma, maback;
|
||||
int dispon;
|
||||
uint64_t dispontime, dispofftime;
|
||||
pc_timer_t timer;
|
||||
int firstline, lastline;
|
||||
|
||||
/* Keyboard stuff. */
|
||||
int wantirq;
|
||||
uint8_t command;
|
||||
uint8_t status;
|
||||
uint8_t out;
|
||||
uint8_t output_port;
|
||||
int param,
|
||||
param_total;
|
||||
uint8_t params[16];
|
||||
uint8_t scan[7];
|
||||
|
||||
/* Mouse stuff. */
|
||||
int mouse_mode;
|
||||
int x, y, b;
|
||||
pc_timer_t send_delay_timer;
|
||||
} olim24_t;
|
||||
|
||||
static video_timings_t timing_m24 = {VIDEO_ISA, 8,16,32, 8,16,32};
|
||||
|
||||
|
||||
static uint8_t crtcmask[32] = {
|
||||
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x7f, 0x7f,
|
||||
0xf3, 0x1f, 0x7f, 0x1f, 0x3f, 0xff, 0x3f, 0xff,
|
||||
0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0,
|
||||
key_queue_end = 0;
|
||||
|
||||
|
||||
|
||||
#ifdef ENABLE_M24VID_LOG
|
||||
int m24vid_do_log = ENABLE_M24VID_LOG;
|
||||
|
||||
|
||||
static void
|
||||
m24_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (m24vid_do_log) {
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stdlog, fmt, ap);
|
||||
va_end(ap);
|
||||
fflush(stdlog);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define m24_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
recalc_timings(olim24_t *m24)
|
||||
{
|
||||
double _dispontime, _dispofftime, disptime;
|
||||
|
||||
if (m24->cgamode & 1) {
|
||||
disptime = m24->crtc[0] + 1;
|
||||
_dispontime = m24->crtc[1];
|
||||
} else {
|
||||
disptime = (m24->crtc[0] + 1) << 1;
|
||||
_dispontime = m24->crtc[1] << 1;
|
||||
}
|
||||
|
||||
_dispofftime = disptime - _dispontime;
|
||||
_dispontime *= CGACONST / 2;
|
||||
_dispofftime *= CGACONST / 2;
|
||||
m24->dispontime = (uint64_t)(_dispontime);
|
||||
m24->dispofftime = (uint64_t)(_dispofftime);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
uint8_t old;
|
||||
|
||||
switch (addr) {
|
||||
case 0x3d4:
|
||||
m24->crtcreg = val & 31;
|
||||
break;
|
||||
|
||||
case 0x3d5:
|
||||
old = m24->crtc[m24->crtcreg];
|
||||
m24->crtc[m24->crtcreg] = val & crtcmask[m24->crtcreg];
|
||||
if (old != val) {
|
||||
if (m24->crtcreg < 0xe || m24->crtcreg > 0x10) {
|
||||
fullchange = changeframecount;
|
||||
recalc_timings(m24);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x3d8:
|
||||
m24->cgamode = val;
|
||||
break;
|
||||
|
||||
case 0x3d9:
|
||||
m24->cgacol = val;
|
||||
break;
|
||||
|
||||
case 0x3de:
|
||||
m24->ctrl = val;
|
||||
m24->base = (val & 0x08) ? 0x4000 : 0;
|
||||
break;
|
||||
|
||||
case 0x13c6:
|
||||
m24->monitor_type = val;
|
||||
break;
|
||||
|
||||
case 0x23c6:
|
||||
m24->port_23c6 = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (addr) {
|
||||
case 0x3d4:
|
||||
ret = m24->crtcreg;
|
||||
break;
|
||||
|
||||
case 0x3d5:
|
||||
ret = m24->crtc[m24->crtcreg];
|
||||
break;
|
||||
|
||||
case 0x3da:
|
||||
ret = m24->stat;
|
||||
break;
|
||||
|
||||
case 0x13c6:
|
||||
ret = m24->monitor_type;
|
||||
break;
|
||||
|
||||
case 0x23c6:
|
||||
ret = m24->port_23c6;
|
||||
break;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
int offset;
|
||||
|
||||
m24->vram[addr & 0x7FFF]=val;
|
||||
offset = ((timer_get_remaining_u64(&m24->timer) / CGACONST) * 4) & 0xfc;
|
||||
m24->charbuffer[offset] = m24->vram[addr & 0x7fff];
|
||||
m24->charbuffer[offset | 1] = m24->vram[addr & 0x7fff];
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
vid_read(uint32_t addr, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
return(m24->vram[addr & 0x7FFF]);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
vid_poll(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
uint16_t ca = (m24->crtc[15] | (m24->crtc[14] << 8)) & 0x3fff;
|
||||
int drawcursor;
|
||||
int x, c, xs_temp, ys_temp;
|
||||
int oldvc;
|
||||
uint8_t chr, attr;
|
||||
uint16_t dat, dat2;
|
||||
int cols[4];
|
||||
int col;
|
||||
int oldsc;
|
||||
|
||||
if (!m24->linepos) {
|
||||
timer_advance_u64(&m24->timer, m24->dispofftime);
|
||||
m24->stat |= 1;
|
||||
m24->linepos = 1;
|
||||
oldsc = m24->sc;
|
||||
if ((m24->crtc[8] & 3) == 3)
|
||||
m24->sc = (m24->sc << 1) & 7;
|
||||
if (m24->dispon) {
|
||||
if (m24->displine < m24->firstline) {
|
||||
m24->firstline = m24->displine;
|
||||
}
|
||||
m24->lastline = m24->displine;
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
if ((m24->cgamode & 0x12) == 0x12) {
|
||||
((uint32_t *)buffer32->line[m24->displine])[c] = 0;
|
||||
if (m24->cgamode & 1)
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 3) + 8] = 0;
|
||||
else
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 4) + 8] = 0;
|
||||
} else {
|
||||
((uint32_t *)buffer32->line[m24->displine])[c] = (m24->cgacol & 15) + 16;
|
||||
if (m24->cgamode & 1)
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 3) + 8] = (m24->cgacol & 15) + 16;
|
||||
else
|
||||
((uint32_t *)buffer32->line[m24->displine])[c + (m24->crtc[1] << 4) + 8] = (m24->cgacol & 15) + 16;
|
||||
}
|
||||
}
|
||||
if (m24->cgamode & 1) {
|
||||
for (x = 0; x < m24->crtc[1]; x++) {
|
||||
chr = m24->charbuffer[ x << 1];
|
||||
attr = m24->charbuffer[(x << 1) + 1];
|
||||
drawcursor = ((m24->ma == ca) && m24->con && m24->cursoron);
|
||||
if (m24->cgamode & 0x20) {
|
||||
cols[1] = (attr & 15) + 16;
|
||||
cols[0] = ((attr >> 4) & 7) + 16;
|
||||
if ((m24->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = (attr & 15) + 16;
|
||||
cols[0] = (attr >> 4) + 16;
|
||||
}
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 3) + c + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
m24->ma++;
|
||||
}
|
||||
} else if (!(m24->cgamode & 2)) {
|
||||
for (x = 0; x < m24->crtc[1]; x++) {
|
||||
chr = m24->vram[((m24->ma << 1) & 0x3fff) + m24->base];
|
||||
attr = m24->vram[(((m24->ma << 1) + 1) & 0x3fff) + m24->base];
|
||||
drawcursor = ((m24->ma == ca) && m24->con && m24->cursoron);
|
||||
if (m24->cgamode & 0x20) {
|
||||
cols[1] = (attr & 15) + 16;
|
||||
cols[0] = ((attr >> 4) & 7) + 16;
|
||||
if ((m24->blink & 16) && (attr & 0x80))
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = (attr & 15) + 16;
|
||||
cols[0] = (attr >> 4) + 16;
|
||||
}
|
||||
m24->ma++;
|
||||
if (drawcursor) {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0] ^ 15;
|
||||
} else {
|
||||
for (c = 0; c < 8; c++)
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[(fontdatm[chr][((m24->sc & 7) << 1) | m24->lineff] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
} else if (!(m24->cgamode & 16)) {
|
||||
cols[0] = (m24->cgacol & 15) | 16;
|
||||
col = (m24->cgacol & 16) ? 24 : 16;
|
||||
if (m24->cgamode & 4) {
|
||||
cols[1] = col | 3;
|
||||
cols[2] = col | 4;
|
||||
cols[3] = col | 7;
|
||||
} else if (m24->cgacol & 32) {
|
||||
cols[1] = col | 3;
|
||||
cols[2] = col | 5;
|
||||
cols[3] = col | 7;
|
||||
} else {
|
||||
cols[1] = col | 2;
|
||||
cols[2] = col | 4;
|
||||
cols[3] = col | 6;
|
||||
}
|
||||
for (x = 0; x < m24->crtc[1]; x++) {
|
||||
dat = (m24->vram[((m24->ma << 1) & 0x1fff) + ((m24->sc & 1) * 0x2000) + m24->base] << 8) |
|
||||
m24->vram[((m24->ma << 1) & 0x1fff) + ((m24->sc & 1) * 0x2000) + 1 + m24->base];
|
||||
m24->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 8] =
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + (c << 1) + 1 + 8] = cols[dat >> 14];
|
||||
dat <<= 2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (m24->ctrl & 1 || ((m24->monitor_type & 8) && (m24->port_23c6 & 1))) {
|
||||
dat2 = ((m24->sc & 1) * 0x4000) | (m24->lineff * 0x2000);
|
||||
cols[0] = 0; cols[1] = /*(m24->cgacol & 15)*/15 + 16;
|
||||
} else {
|
||||
dat2 = (m24->sc & 1) * 0x2000;
|
||||
cols[0] = 0; cols[1] = (m24->cgacol & 15) + 16;
|
||||
}
|
||||
|
||||
for (x = 0; x < m24->crtc[1]; x++) {
|
||||
dat = (m24->vram[((m24->ma << 1) & 0x1fff) + dat2] << 8) | m24->vram[((m24->ma << 1) & 0x1fff) + dat2 + 1];
|
||||
m24->ma++;
|
||||
for (c = 0; c < 16; c++) {
|
||||
((uint32_t *)buffer32->line[m24->displine])[(x << 4) + c + 8] = cols[dat >> 15];
|
||||
dat <<= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cols[0] = ((m24->cgamode & 0x12) == 0x12) ? 0 : (m24->cgacol & 15) + 16;
|
||||
if (m24->cgamode & 1) hline(buffer32, 0, m24->displine, (m24->crtc[1] << 3) + 16, cols[0]);
|
||||
else hline(buffer32, 0, m24->displine, (m24->crtc[1] << 4) + 16, cols[0]);
|
||||
}
|
||||
|
||||
if (m24->cgamode & 1)
|
||||
x = (m24->crtc[1] << 3) + 16;
|
||||
else
|
||||
x = (m24->crtc[1] << 4) + 16;
|
||||
|
||||
m24->sc = oldsc;
|
||||
if (m24->vc == m24->crtc[7] && !m24->sc)
|
||||
m24->stat |= 8;
|
||||
m24->displine++;
|
||||
if (m24->displine >= 720) m24->displine = 0;
|
||||
} else {
|
||||
timer_advance_u64(&m24->timer, m24->dispontime);
|
||||
if (m24->dispon) m24->stat &= ~1;
|
||||
m24->linepos = 0;
|
||||
m24->lineff ^= 1;
|
||||
if (m24->lineff) {
|
||||
m24->ma = m24->maback;
|
||||
} else {
|
||||
if (m24->vsynctime) {
|
||||
m24->vsynctime--;
|
||||
if (!m24->vsynctime)
|
||||
m24->stat &= ~8;
|
||||
}
|
||||
if (m24->sc == (m24->crtc[11] & 31) || ((m24->crtc[8] & 3) == 3 && m24->sc == ((m24->crtc[11] & 31) >> 1))) {
|
||||
m24->con = 0;
|
||||
m24->coff = 1;
|
||||
}
|
||||
if (m24->vadj) {
|
||||
m24->sc++;
|
||||
m24->sc &= 31;
|
||||
m24->ma = m24->maback;
|
||||
m24->vadj--;
|
||||
if (!m24->vadj) {
|
||||
m24->dispon = 1;
|
||||
m24->ma = m24->maback = (m24->crtc[13] | (m24->crtc[12] << 8)) & 0x3fff;
|
||||
m24->sc = 0;
|
||||
}
|
||||
} else if (m24->sc == m24->crtc[9] || ((m24->crtc[8] & 3) == 3 && m24->sc == (m24->crtc[9] >> 1))) {
|
||||
m24->maback = m24->ma;
|
||||
m24->sc = 0;
|
||||
oldvc = m24->vc;
|
||||
m24->vc++;
|
||||
m24->vc &= 127;
|
||||
|
||||
if (m24->vc == m24->crtc[6])
|
||||
m24->dispon=0;
|
||||
|
||||
if (oldvc == m24->crtc[4]) {
|
||||
m24->vc = 0;
|
||||
m24->vadj = m24->crtc[5];
|
||||
if (!m24->vadj) m24->dispon = 1;
|
||||
if (!m24->vadj) m24->ma = m24->maback = (m24->crtc[13] | (m24->crtc[12] << 8)) & 0x3fff;
|
||||
if ((m24->crtc[10] & 0x60) == 0x20)
|
||||
m24->cursoron = 0;
|
||||
else
|
||||
m24->cursoron = m24->blink & 16;
|
||||
}
|
||||
|
||||
if (m24->vc == m24->crtc[7]) {
|
||||
m24->dispon = 0;
|
||||
m24->displine = 0;
|
||||
m24->vsynctime = (m24->crtc[3] >> 4) + 1;
|
||||
if (m24->crtc[7]) {
|
||||
if (m24->cgamode & 1)
|
||||
x = (m24->crtc[1] << 3) + 16;
|
||||
else
|
||||
x = (m24->crtc[1] << 4) + 16;
|
||||
m24->lastline++;
|
||||
|
||||
xs_temp = x;
|
||||
ys_temp = (m24->lastline - m24->firstline);
|
||||
|
||||
if ((xs_temp > 0) && (ys_temp > 0)) {
|
||||
if (xsize < 64) xs_temp = 656;
|
||||
if (ysize < 32) ys_temp = 200;
|
||||
if (!enable_overscan)
|
||||
xs_temp -= 16;
|
||||
|
||||
if ((xs_temp != xsize) || (ys_temp != ysize) || video_force_resize_get()) {
|
||||
xsize = xs_temp;
|
||||
ysize = ys_temp;
|
||||
set_screen_size(xsize, ysize + (enable_overscan ? 16 : 0));
|
||||
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
video_blit_memtoscreen_8(0, m24->firstline - 8, 0, (m24->lastline - m24->firstline) + 16,
|
||||
xsize, (m24->lastline - m24->firstline) + 16);
|
||||
} else
|
||||
video_blit_memtoscreen_8(8, m24->firstline, 0, (m24->lastline - m24->firstline),
|
||||
xsize, (m24->lastline - m24->firstline));
|
||||
}
|
||||
|
||||
frames++;
|
||||
|
||||
video_res_x = xsize;
|
||||
video_res_y = ysize;
|
||||
if (m24->cgamode & 1) {
|
||||
video_res_x /= 8;
|
||||
video_res_y /= (m24->crtc[9] + 1) * 2;
|
||||
video_bpp = 0;
|
||||
} else if (!(m24->cgamode & 2)) {
|
||||
video_res_x /= 16;
|
||||
video_res_y /= (m24->crtc[9] + 1) * 2;
|
||||
video_bpp = 0;
|
||||
} else if (!(m24->cgamode & 16)) {
|
||||
video_res_x /= 2;
|
||||
video_res_y /= 2;
|
||||
video_bpp = 2;
|
||||
} else if (!(m24->ctrl & 1)) {
|
||||
video_res_y /= 2;
|
||||
video_bpp = 1;
|
||||
}
|
||||
}
|
||||
m24->firstline = 1000;
|
||||
m24->lastline = 0;
|
||||
m24->blink++;
|
||||
}
|
||||
} else {
|
||||
m24->sc++;
|
||||
m24->sc &= 31;
|
||||
m24->ma = m24->maback;
|
||||
}
|
||||
if ((m24->sc == (m24->crtc[10] & 31) || ((m24->crtc[8] & 3) == 3 && m24->sc == ((m24->crtc[10] & 31) >> 1))))
|
||||
m24->con = 1;
|
||||
}
|
||||
if (m24->dispon && (m24->cgamode & 1)) {
|
||||
for (x = 0; x < (m24->crtc[1] << 1); x++)
|
||||
m24->charbuffer[x] = m24->vram[(((m24->ma << 1) + x) & 0x3fff) + m24->base];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
speed_changed(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
recalc_timings(m24);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
kbd_poll(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
timer_advance_u64(&m24->send_delay_timer, 1000 * TIMER_USEC);
|
||||
if (m24->wantirq) {
|
||||
m24->wantirq = 0;
|
||||
picint(2);
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("M24: take IRQ\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!(m24->status & STAT_OFULL) && key_queue_start != key_queue_end) {
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("Reading %02X from the key queue at %i\n",
|
||||
m24->out, key_queue_start);
|
||||
#endif
|
||||
m24->out = key_queue[key_queue_start];
|
||||
key_queue_start = (key_queue_start + 1) & 0xf;
|
||||
m24->status |= STAT_OFULL;
|
||||
m24->status &= ~STAT_IFULL;
|
||||
m24->wantirq = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
kbd_adddata(uint16_t val)
|
||||
{
|
||||
key_queue[key_queue_end] = val;
|
||||
key_queue_end = (key_queue_end + 1) & 0xf;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
kbd_adddata_ex(uint16_t val)
|
||||
{
|
||||
kbd_adddata_process(val, kbd_adddata);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("M24: write %04X %02X\n", port, val);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (ram[8] == 0xc3) {
|
||||
output = 3;
|
||||
}
|
||||
#endif
|
||||
switch (port) {
|
||||
case 0x60:
|
||||
if (m24->param != m24->param_total) {
|
||||
m24->params[m24->param++] = val;
|
||||
if (m24->param == m24->param_total) {
|
||||
switch (m24->command) {
|
||||
case 0x11:
|
||||
m24->mouse_mode = 0;
|
||||
m24->scan[0] = m24->params[0];
|
||||
m24->scan[1] = m24->params[1];
|
||||
m24->scan[2] = m24->params[2];
|
||||
m24->scan[3] = m24->params[3];
|
||||
m24->scan[4] = m24->params[4];
|
||||
m24->scan[5] = m24->params[5];
|
||||
m24->scan[6] = m24->params[6];
|
||||
break;
|
||||
|
||||
case 0x12:
|
||||
m24->mouse_mode = 1;
|
||||
m24->scan[0] = m24->params[0];
|
||||
m24->scan[1] = m24->params[1];
|
||||
m24->scan[2] = m24->params[2];
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("M24: bad keyboard command complete %02X\n", m24->command);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m24->command = val;
|
||||
switch (val) {
|
||||
case 0x01: /*Self-test*/
|
||||
break;
|
||||
|
||||
case 0x05: /*Read ID*/
|
||||
kbd_adddata(0x00);
|
||||
break;
|
||||
|
||||
case 0x11:
|
||||
m24->param = 0;
|
||||
m24->param_total = 9;
|
||||
break;
|
||||
|
||||
case 0x12:
|
||||
m24->param = 0;
|
||||
m24->param_total = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("M24: bad keyboard command %02X\n", val);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x61:
|
||||
ppi.pb = val;
|
||||
|
||||
speaker_update();
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_ctr_set_gate(&pit->counters[2], val & 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
kbd_read(uint16_t port, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x60:
|
||||
ret = m24->out;
|
||||
if (key_queue_start == key_queue_end) {
|
||||
m24->status &= ~STAT_OFULL;
|
||||
m24->wantirq = 0;
|
||||
} else {
|
||||
m24->out = key_queue[key_queue_start];
|
||||
key_queue_start = (key_queue_start + 1) & 0xf;
|
||||
m24->status |= STAT_OFULL;
|
||||
m24->status &= ~STAT_IFULL;
|
||||
m24->wantirq = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x61:
|
||||
ret = ppi.pb;
|
||||
break;
|
||||
|
||||
case 0x64:
|
||||
ret = m24->status;
|
||||
m24->status &= ~(STAT_RTIMEOUT | STAT_TTIMEOUT);
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("\nBad M24 keyboard read %04X\n", port);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ms_poll(int x, int y, int z, int b, void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
m24->x += x;
|
||||
m24->y += y;
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 1) && !(m24->b & 1))
|
||||
kbd_adddata(m24->scan[0]);
|
||||
if (!(b & 1) && (m24->b & 1))
|
||||
kbd_adddata(m24->scan[0] | 0x80);
|
||||
m24->b = (m24->b & ~1) | (b & 1);
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 2) && !(m24->b & 2))
|
||||
kbd_adddata(m24->scan[2]);
|
||||
if (!(b & 2) && (m24->b & 2))
|
||||
kbd_adddata(m24->scan[2] | 0x80);
|
||||
m24->b = (m24->b & ~2) | (b & 2);
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 4) && !(m24->b & 4))
|
||||
kbd_adddata(m24->scan[1]);
|
||||
if (!(b & 4) && (m24->b & 4))
|
||||
kbd_adddata(m24->scan[1] | 0x80);
|
||||
m24->b = (m24->b & ~4) | (b & 4);
|
||||
|
||||
if (m24->mouse_mode) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 12) return(0xff);
|
||||
|
||||
if (!m24->x && !m24->y) return(0xff);
|
||||
|
||||
m24->y = -m24->y;
|
||||
|
||||
if (m24->x < -127) m24->x = -127;
|
||||
if (m24->x > 127) m24->x = 127;
|
||||
if (m24->x < -127) m24->x = 0x80 | ((-m24->x) & 0x7f);
|
||||
|
||||
if (m24->y < -127) m24->y = -127;
|
||||
if (m24->y > 127) m24->y = 127;
|
||||
if (m24->y < -127) m24->y = 0x80 | ((-m24->y) & 0x7f);
|
||||
|
||||
kbd_adddata(0xfe);
|
||||
kbd_adddata(m24->x);
|
||||
kbd_adddata(m24->y);
|
||||
|
||||
m24->x = m24->y = 0;
|
||||
} else {
|
||||
while (m24->x < -4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24->x += 4;
|
||||
kbd_adddata(m24->scan[3]);
|
||||
}
|
||||
while (m24->x > 4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24->x -= 4;
|
||||
kbd_adddata(m24->scan[4]);
|
||||
}
|
||||
while (m24->y < -4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24->y += 4;
|
||||
kbd_adddata(m24->scan[5]);
|
||||
}
|
||||
while (m24->y > 4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24->y -= 4;
|
||||
kbd_adddata(m24->scan[6]);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m24_read(uint16_t port, void *priv)
|
||||
{
|
||||
switch (port) {
|
||||
case 0x66:
|
||||
return 0x00;
|
||||
case 0x67:
|
||||
return 0x20 | 0x40 | 0x0C;
|
||||
}
|
||||
|
||||
return(0xff);
|
||||
}
|
||||
|
||||
static void
|
||||
vid_close(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
free(m24->vram);
|
||||
|
||||
free(m24);
|
||||
}
|
||||
|
||||
const device_t m24_device = {
|
||||
"Olivetti M24",
|
||||
0, 0,
|
||||
NULL, vid_close, NULL,
|
||||
NULL,
|
||||
speed_changed,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
kbd_reset(void *priv)
|
||||
{
|
||||
olim24_t *m24 = (olim24_t *)priv;
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
m24->status = STAT_LOCK | STAT_CD;
|
||||
m24->wantirq = 0;
|
||||
keyboard_scan = 1;
|
||||
m24->param = m24->param_total = 0;
|
||||
m24->mouse_mode = 0;
|
||||
m24->scan[0] = 0x1c;
|
||||
m24->scan[1] = 0x53;
|
||||
m24->scan[2] = 0x01;
|
||||
m24->scan[3] = 0x4b;
|
||||
m24->scan[4] = 0x4d;
|
||||
m24->scan[5] = 0x48;
|
||||
m24->scan[6] = 0x50;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_olim24_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_low.bin",
|
||||
L"roms/machines/olivetti_m24/olivetti_m24_version_1.43_high.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
olim24_t *m24;
|
||||
|
||||
m24 = (olim24_t *)malloc(sizeof(olim24_t));
|
||||
memset(m24, 0x00, sizeof(olim24_t));
|
||||
|
||||
machine_common_init(model);
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, m24);
|
||||
|
||||
/* Initialize the video adapter. */
|
||||
// loadfont(L"roms/machines/olivetti_m24/ATT-FONT-DUMPED-VERIFIED.BIN", 1);
|
||||
loadfont(L"roms/machines/olivetti_m24/m24 graphics board go380 258 pqbq.bin", 1);
|
||||
m24->vram = malloc(0x8000);
|
||||
overscan_x = overscan_y = 16;
|
||||
mem_mapping_add(&m24->mapping, 0xb8000, 0x08000,
|
||||
vid_read, NULL, NULL,
|
||||
vid_write, NULL, NULL, NULL, 0, m24);
|
||||
io_sethandler(0x03d0, 16, vid_in, NULL, NULL, vid_out, NULL, NULL, m24);
|
||||
timer_add(&m24->timer, vid_poll, m24, 1);
|
||||
device_add_ex(&m24_device, m24);
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m24);
|
||||
cga_palette = 0;
|
||||
cgapal_rebuild();
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
io_sethandler(0x0060, 2,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, m24);
|
||||
io_sethandler(0x0064, 1,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, m24);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
kbd_reset(m24);
|
||||
timer_add(&m24->send_delay_timer, kbd_poll, m24, 1);
|
||||
|
||||
/* Tell mouse driver about our internal mouse. */
|
||||
mouse_reset();
|
||||
mouse_set_poll(ms_poll, m24);
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <86box/86box.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/pic.h>
|
||||
@@ -79,6 +81,7 @@ typedef struct {
|
||||
int dispon;
|
||||
int con, coff, cursoron, blink;
|
||||
int vsynctime;
|
||||
int fullchange;
|
||||
int vadj;
|
||||
uint16_t ma, maback;
|
||||
uint64_t dispontime, dispofftime;
|
||||
@@ -160,7 +163,7 @@ vid_out(uint16_t addr, uint8_t val, void *p)
|
||||
pcjr->crtc[pcjr->crtcreg] = val & crtcmask[pcjr->crtcreg];
|
||||
if (old != val) {
|
||||
if (pcjr->crtcreg < 0xe || pcjr->crtcreg > 0x10) {
|
||||
fullchange = changeframecount;
|
||||
pcjr->fullchange = changeframecount;
|
||||
recalc_timings(pcjr);
|
||||
}
|
||||
}
|
||||
@@ -221,7 +224,6 @@ vid_write(uint32_t addr, uint8_t val, void *p)
|
||||
|
||||
if (pcjr->memctrl == -1) return;
|
||||
|
||||
egawrites++;
|
||||
pcjr->b8000[addr & 0x3fff] = val;
|
||||
}
|
||||
|
||||
@@ -232,8 +234,7 @@ vid_read(uint32_t addr, void *p)
|
||||
pcjr_t *pcjr = (pcjr_t *)p;
|
||||
|
||||
if (pcjr->memctrl == -1) return(0xff);
|
||||
|
||||
egareads++;
|
||||
|
||||
return(pcjr->b8000[addr & 0x3fff]);
|
||||
}
|
||||
|
||||
@@ -256,7 +257,7 @@ vid_poll(void *p)
|
||||
pcjr->stat &= ~1;
|
||||
pcjr->linepos = 1;
|
||||
oldsc = pcjr->sc;
|
||||
if ((pcjr->crtc[8] & 3) == 3)
|
||||
if ((pcjr->crtc[8] & 3) == 3)
|
||||
pcjr->sc = (pcjr->sc << 1) & 7;
|
||||
if (pcjr->dispon) {
|
||||
uint16_t offset = 0;
|
||||
@@ -294,7 +295,7 @@ vid_poll(void *p)
|
||||
switch ((pcjr->array[0] & 0x13) | ((pcjr->array[3] & 0x08) << 5)) {
|
||||
case 0x13: /*320x200x16*/
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 3) + 8] = buffer32->line[(pcjr->displine << 1)][(x << 3) + 9] =
|
||||
@@ -313,7 +314,7 @@ vid_poll(void *p)
|
||||
break;
|
||||
case 0x12: /*160x200x16*/
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + 8] = buffer32->line[(pcjr->displine << 1)][(x << 4) + 9] =
|
||||
@@ -360,7 +361,7 @@ vid_poll(void *p)
|
||||
if (pcjr->array[3] & 4) {
|
||||
cols[1] = pcjr->array[ ((attr & 15) & pcjr->array[1]) + 16] + 16;
|
||||
cols[0] = pcjr->array[(((attr >> 4) & 7) & pcjr->array[1]) + 16] + 16;
|
||||
if ((pcjr->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
if ((pcjr->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = pcjr->array[((attr & 15) & pcjr->array[1]) + 16] + 16;
|
||||
@@ -395,7 +396,7 @@ vid_poll(void *p)
|
||||
if (pcjr->array[3] & 4) {
|
||||
cols[1] = pcjr->array[ ((attr & 15) & pcjr->array[1]) + 16] + 16;
|
||||
cols[0] = pcjr->array[(((attr >> 4) & 7) & pcjr->array[1]) + 16] + 16;
|
||||
if ((pcjr->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
if ((pcjr->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = pcjr->array[((attr & 15) & pcjr->array[1]) + 16] + 16;
|
||||
@@ -404,9 +405,9 @@ vid_poll(void *p)
|
||||
pcjr->ma++;
|
||||
if (pcjr->sc & 8) {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(pcjr->displine << 1)][(x << 4) + (c << 1) + 1 + 8] =
|
||||
buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(pcjr->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] = cols[0];
|
||||
}
|
||||
} else {
|
||||
@@ -432,7 +433,7 @@ vid_poll(void *p)
|
||||
cols[2] = pcjr->array[2 + 16] + 16;
|
||||
cols[3] = pcjr->array[3 + 16] + 16;
|
||||
for (x = 0; x < pcjr->crtc[1]; x++) {
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
dat = (pcjr->vram[((pcjr->ma << 1) & mask) + offset] << 8) |
|
||||
pcjr->vram[((pcjr->ma << 1) & mask) + offset + 1];
|
||||
pcjr->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
@@ -491,11 +492,11 @@ vid_poll(void *p)
|
||||
pcjr->stat |= 8;
|
||||
}
|
||||
pcjr->displine++;
|
||||
if (pcjr->displine >= 360)
|
||||
if (pcjr->displine >= 360)
|
||||
pcjr->displine = 0;
|
||||
} else {
|
||||
timer_advance_u64(&pcjr->timer, pcjr->dispontime);
|
||||
if (pcjr->dispon)
|
||||
if (pcjr->dispon)
|
||||
pcjr->stat |= 1;
|
||||
pcjr->linepos = 0;
|
||||
if (pcjr->vsynctime) {
|
||||
@@ -504,9 +505,9 @@ vid_poll(void *p)
|
||||
pcjr->stat &= ~8;
|
||||
}
|
||||
}
|
||||
if (pcjr->sc == (pcjr->crtc[11] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[11] & 31) >> 1))) {
|
||||
pcjr->con = 0;
|
||||
pcjr->coff = 1;
|
||||
if (pcjr->sc == (pcjr->crtc[11] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[11] & 31) >> 1))) {
|
||||
pcjr->con = 0;
|
||||
pcjr->coff = 1;
|
||||
}
|
||||
if (pcjr->vadj) {
|
||||
pcjr->sc++;
|
||||
@@ -524,14 +525,14 @@ vid_poll(void *p)
|
||||
oldvc = pcjr->vc;
|
||||
pcjr->vc++;
|
||||
pcjr->vc &= 127;
|
||||
if (pcjr->vc == pcjr->crtc[6])
|
||||
if (pcjr->vc == pcjr->crtc[6])
|
||||
pcjr->dispon = 0;
|
||||
if (oldvc == pcjr->crtc[4]) {
|
||||
pcjr->vc = 0;
|
||||
pcjr->vadj = pcjr->crtc[5];
|
||||
if (!pcjr->vadj)
|
||||
if (!pcjr->vadj)
|
||||
pcjr->dispon = 1;
|
||||
if (!pcjr->vadj)
|
||||
if (!pcjr->vadj)
|
||||
pcjr->ma = pcjr->maback = (pcjr->crtc[13] | (pcjr->crtc[12] << 8)) & 0x3fff;
|
||||
if ((pcjr->crtc[10] & 0x60) == 0x20) pcjr->cursoron = 0;
|
||||
else pcjr->cursoron = pcjr->blink & 16;
|
||||
@@ -565,18 +566,18 @@ vid_poll(void *p)
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(0, (pcjr->firstline - 4) << 1, 0, ((pcjr->lastline - pcjr->firstline) + 8) << 1,
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(0, (pcjr->firstline - 4) << 1,
|
||||
xsize, ((pcjr->lastline - pcjr->firstline) + 8) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (pcjr->firstline - 4) << 1, 0, ((pcjr->lastline - pcjr->firstline) + 8) << 1,
|
||||
video_blit_memtoscreen_8(0, (pcjr->firstline - 4) << 1,
|
||||
xsize, ((pcjr->lastline - pcjr->firstline) + 8) << 1);
|
||||
} else {
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(8, pcjr->firstline << 1, 0, (pcjr->lastline - pcjr->firstline) << 1,
|
||||
if (pcjr->composite)
|
||||
video_blit_memtoscreen(8, pcjr->firstline << 1,
|
||||
xsize, (pcjr->lastline - pcjr->firstline) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, pcjr->firstline << 1, 0, (pcjr->lastline - pcjr->firstline) << 1,
|
||||
video_blit_memtoscreen_8(8, pcjr->firstline << 1,
|
||||
xsize, (pcjr->lastline - pcjr->firstline) << 1);
|
||||
}
|
||||
}
|
||||
@@ -594,7 +595,7 @@ vid_poll(void *p)
|
||||
pcjr->sc &= 31;
|
||||
pcjr->ma = pcjr->maback;
|
||||
}
|
||||
if ((pcjr->sc == (pcjr->crtc[10] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[10] & 31) >> 1))))
|
||||
if ((pcjr->sc == (pcjr->crtc[10] & 31) || ((pcjr->crtc[8] & 3) == 3 && pcjr->sc == ((pcjr->crtc[10] & 31) >> 1))))
|
||||
pcjr->con = 1;
|
||||
}
|
||||
}
|
||||
@@ -616,12 +617,17 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
case 0x61:
|
||||
pcjr->pb = val;
|
||||
|
||||
timer_process();
|
||||
|
||||
if (cassette != NULL)
|
||||
pc_cas_set_motor(cassette, (pcjr->pb & 0x08) == 0);
|
||||
|
||||
speaker_update();
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
if (speaker_enable)
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_ctr_set_gate(&pit->counters[2], val & 1);
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
sn76489_mute = speaker_mute = 1;
|
||||
switch (val & 0x60) {
|
||||
case 0x00:
|
||||
@@ -636,7 +642,7 @@ kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
case 0xa0:
|
||||
nmi_mask = val & 0x80;
|
||||
pit_ctr_set_using_timer(&pit->counters[1], !(val & 0x20));
|
||||
pit_devs[0].set_using_timer(pit_devs[0].data, 1, !(val & 0x20));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -655,21 +661,25 @@ kbd_read(uint16_t port, void *priv)
|
||||
case 0x60:
|
||||
ret = pcjr->pa;
|
||||
break;
|
||||
|
||||
|
||||
case 0x61:
|
||||
ret = pcjr->pb;
|
||||
break;
|
||||
|
||||
|
||||
case 0x62:
|
||||
ret = (pcjr->latched ? 1 : 0);
|
||||
ret |= 0x02; /*Modem card not installed*/
|
||||
if ((pcjr->pb & 0x08) || (cassette == NULL))
|
||||
ret |= (ppispeakon ? 0x10 : 0);
|
||||
else
|
||||
ret |= (pc_cas_get_inp(cassette) ? 0x10 : 0);
|
||||
ret |= (ppispeakon ? 0x10 : 0);
|
||||
ret |= (ppispeakon ? 0x20 : 0);
|
||||
ret |= (pcjr->data ? 0x40: 0);
|
||||
if (pcjr->data)
|
||||
ret |= 0x40;
|
||||
break;
|
||||
|
||||
|
||||
case 0xa0:
|
||||
pcjr->latched = 0;
|
||||
ret = 0;
|
||||
@@ -760,46 +770,50 @@ speed_changed(void *priv)
|
||||
recalc_timings(pcjr);
|
||||
}
|
||||
|
||||
void
|
||||
pit_irq0_timer_pcjr(int new_out, int old_out)
|
||||
{
|
||||
if (new_out && !old_out) {
|
||||
picint(1);
|
||||
pit_devs[0].ctr_clock(pit_devs[0].data, 1);
|
||||
}
|
||||
|
||||
if (!new_out)
|
||||
picintc(1);
|
||||
}
|
||||
|
||||
static const device_config_t pcjr_config[] = {
|
||||
{
|
||||
"display_type", "Display type", CONFIG_SELECTION, "", PCJR_RGB,
|
||||
{
|
||||
{
|
||||
"RGB", PCJR_RGB
|
||||
},
|
||||
{
|
||||
"Composite", PCJR_COMPOSITE
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
.name = "display_type",
|
||||
.description = "Display type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = PCJR_RGB,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "RGB", .value = PCJR_RGB },
|
||||
{ .description = "Composite", .value = PCJR_COMPOSITE },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
static const device_t pcjr_device = {
|
||||
const device_t pcjr_device = {
|
||||
"IBM PCjr",
|
||||
0, 0,
|
||||
NULL, NULL, NULL,
|
||||
"pcjr",
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
{ NULL },
|
||||
speed_changed,
|
||||
NULL,
|
||||
pcjr_config
|
||||
};
|
||||
|
||||
|
||||
const device_t *
|
||||
pcjr_get_device(void)
|
||||
{
|
||||
return &pcjr_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_pcjr_init(const machine_t *model)
|
||||
{
|
||||
@@ -808,7 +822,7 @@ machine_pcjr_init(const machine_t *model)
|
||||
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmpcjr/bios.rom",
|
||||
ret = bios_load_linear("roms/machines/ibmpcjr/bios.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -826,7 +840,8 @@ machine_pcjr_init(const machine_t *model)
|
||||
cpu_set();
|
||||
|
||||
/* Initialize the video controller. */
|
||||
loadfont(L"roms/video/mda/mda.rom", 0);
|
||||
video_reset(gfxcard);
|
||||
loadfont("roms/video/mda/mda.rom", 0);
|
||||
mem_mapping_add(&pcjr->mapping, 0xb8000, 0x08000,
|
||||
vid_read, NULL, NULL,
|
||||
vid_write, NULL, NULL, NULL, 0, pcjr);
|
||||
@@ -849,15 +864,15 @@ machine_pcjr_init(const machine_t *model)
|
||||
keyboard_set_table(scancode_xt);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
|
||||
/* Technically it's the SN76496N, but the NCR 8496 is a drop-in replacement for it. */
|
||||
device_add(&ncr8496_device);
|
||||
/* Technically it's the SN76496N, but the SN76489 is identical to the SN76496N. */
|
||||
device_add(&sn76489_device);
|
||||
|
||||
nmi_mask = 0x80;
|
||||
|
||||
device_add(&fdc_pcjr_device);
|
||||
|
||||
device_add(&i8250_pcjr_device);
|
||||
serial_set_next_inst(2); /* So that serial_standalone_init() won't do anything. */
|
||||
device_add(&ns8250_pcjr_device);
|
||||
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the IBM PS/1 models 2011, 2121 and 2133.
|
||||
* Emulation of the IBM PS/1 models 2011, 2121.
|
||||
*
|
||||
* Model 2011: The initial model, using a 10MHz 80286.
|
||||
*
|
||||
@@ -48,6 +48,8 @@
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/lpt.h>
|
||||
@@ -57,30 +59,16 @@
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_sn76489.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/sound.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
sn76489_t sn76489;
|
||||
uint8_t status, ctrl;
|
||||
uint64_t timer_latch;
|
||||
pc_timer_t timer_count;
|
||||
int timer_enable;
|
||||
uint8_t fifo[2048];
|
||||
int fifo_read_idx, fifo_write_idx;
|
||||
int fifo_threshold;
|
||||
uint8_t dac_val;
|
||||
int16_t buffer[SOUNDBUFLEN];
|
||||
int pos;
|
||||
} ps1snd_t;
|
||||
|
||||
typedef struct {
|
||||
int model;
|
||||
|
||||
rom_t high_rom;
|
||||
rom_t mid_rom, high_rom;
|
||||
|
||||
uint8_t ps1_91,
|
||||
ps1_92,
|
||||
@@ -97,178 +85,6 @@ typedef struct {
|
||||
} ps1_t;
|
||||
|
||||
|
||||
static void
|
||||
update_irq_status(ps1snd_t *snd)
|
||||
{
|
||||
if (((snd->status & snd->ctrl) & 0x12) && (snd->ctrl & 0x01))
|
||||
picint(1 << 7);
|
||||
else
|
||||
picintc(1 << 7);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
snd_read(uint16_t port, void *priv)
|
||||
{
|
||||
ps1snd_t *snd = (ps1snd_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port & 7) {
|
||||
case 0: /* ADC data */
|
||||
snd->status &= ~0x10;
|
||||
update_irq_status(snd);
|
||||
ret = 0;
|
||||
break;
|
||||
|
||||
case 2: /* status */
|
||||
ret = snd->status;
|
||||
ret |= (snd->ctrl & 0x01);
|
||||
if ((snd->fifo_write_idx - snd->fifo_read_idx) >= 2048)
|
||||
ret |= 0x08; /* FIFO full */
|
||||
if (snd->fifo_read_idx == snd->fifo_write_idx)
|
||||
ret |= 0x04; /* FIFO empty */
|
||||
break;
|
||||
|
||||
case 3: /* FIFO timer */
|
||||
/*
|
||||
* The PS/1 Technical Reference says this should return
|
||||
* thecurrent value, but the PS/1 BIOS and Stunt Island
|
||||
* expect it not to change.
|
||||
*/
|
||||
ret = snd->timer_latch;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
snd_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
ps1snd_t *snd = (ps1snd_t *)priv;
|
||||
|
||||
switch (port & 7) {
|
||||
case 0: /* DAC output */
|
||||
if ((snd->fifo_write_idx - snd->fifo_read_idx) < 2048) {
|
||||
snd->fifo[snd->fifo_write_idx & 2047] = val;
|
||||
snd->fifo_write_idx++;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: /* control */
|
||||
snd->ctrl = val;
|
||||
if (! (val & 0x02))
|
||||
snd->status &= ~0x02;
|
||||
update_irq_status(snd);
|
||||
break;
|
||||
|
||||
case 3: /* timer reload value */
|
||||
snd->timer_latch = val;
|
||||
if (val)
|
||||
timer_set_delay_u64(&snd->timer_count, ((0xff-val) * TIMER_USEC));
|
||||
else
|
||||
timer_disable(&snd->timer_count);
|
||||
break;
|
||||
|
||||
case 4: /* almost empty */
|
||||
snd->fifo_threshold = val * 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
snd_update(ps1snd_t *snd)
|
||||
{
|
||||
for (; snd->pos < sound_pos_global; snd->pos++)
|
||||
snd->buffer[snd->pos] = (int8_t)(snd->dac_val ^ 0x80) * 0x20;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
snd_callback(void *priv)
|
||||
{
|
||||
ps1snd_t *snd = (ps1snd_t *)priv;
|
||||
|
||||
snd_update(snd);
|
||||
|
||||
if (snd->fifo_read_idx != snd->fifo_write_idx) {
|
||||
snd->dac_val = snd->fifo[snd->fifo_read_idx & 2047];
|
||||
snd->fifo_read_idx++;
|
||||
}
|
||||
|
||||
if ((snd->fifo_write_idx - snd->fifo_read_idx) == snd->fifo_threshold)
|
||||
snd->status |= 0x02; /*FIFO almost empty*/
|
||||
|
||||
snd->status |= 0x10; /*ADC data ready*/
|
||||
update_irq_status(snd);
|
||||
|
||||
timer_advance_u64(&snd->timer_count, snd->timer_latch * TIMER_USEC);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
snd_get_buffer(int32_t *buffer, int len, void *priv)
|
||||
{
|
||||
ps1snd_t *snd = (ps1snd_t *)priv;
|
||||
int c;
|
||||
|
||||
snd_update(snd);
|
||||
|
||||
for (c = 0; c < len * 2; c++)
|
||||
buffer[c] += snd->buffer[c >> 1];
|
||||
|
||||
snd->pos = 0;
|
||||
}
|
||||
|
||||
|
||||
static void *
|
||||
snd_init(const device_t *info)
|
||||
{
|
||||
ps1snd_t *snd;
|
||||
|
||||
snd = malloc(sizeof(ps1snd_t));
|
||||
memset(snd, 0x00, sizeof(ps1snd_t));
|
||||
|
||||
sn76489_init(&snd->sn76489, 0x0205, 0x0001, SN76496, 4000000);
|
||||
|
||||
io_sethandler(0x0200, 1, snd_read,NULL,NULL, snd_write,NULL,NULL, snd);
|
||||
io_sethandler(0x0202, 6, snd_read,NULL,NULL, snd_write,NULL,NULL, snd);
|
||||
|
||||
timer_add(&snd->timer_count, snd_callback, snd, 0);
|
||||
|
||||
sound_add_handler(snd_get_buffer, snd);
|
||||
|
||||
return(snd);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
snd_close(void *priv)
|
||||
{
|
||||
ps1snd_t *snd = (ps1snd_t *)priv;
|
||||
|
||||
free(snd);
|
||||
}
|
||||
|
||||
|
||||
static const device_t snd_device = {
|
||||
"PS/1 Audio Card",
|
||||
0, 0,
|
||||
snd_init, snd_close, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
recalc_memory(ps1_t *ps)
|
||||
{
|
||||
@@ -300,7 +116,7 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
|
||||
}
|
||||
ps->ps1_92 = val & ~1;
|
||||
} else {
|
||||
ps->ps1_92 = val;
|
||||
ps->ps1_92 = val;
|
||||
}
|
||||
mem_a20_alt = val & 2;
|
||||
mem_a20_recalc();
|
||||
@@ -324,25 +140,31 @@ ps1_write(uint16_t port, uint8_t val, void *priv)
|
||||
break;
|
||||
|
||||
case 0x0102:
|
||||
lpt1_remove();
|
||||
if (val & 0x04)
|
||||
serial_setup(ps->uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
else
|
||||
if (!(ps->ps1_94 & 0x80)) {
|
||||
lpt1_remove();
|
||||
serial_remove(ps->uart);
|
||||
if (val & 0x10) {
|
||||
switch ((val >> 5) & 3) {
|
||||
case 0:
|
||||
lpt1_init(0x03bc);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x0378);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x0278);
|
||||
break;
|
||||
if (val & 0x04) {
|
||||
if (val & 0x08)
|
||||
serial_setup(ps->uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps->uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
if (val & 0x10) {
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps->ps1_102 = val;
|
||||
}
|
||||
ps->ps1_102 = val;
|
||||
break;
|
||||
|
||||
case 0x0103:
|
||||
@@ -448,18 +270,22 @@ ps1_setup(int model)
|
||||
ps->uart = device_add_inst(&ns16450_device, 1);
|
||||
|
||||
lpt1_remove();
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
device_add(&ps_nvr_device);
|
||||
|
||||
if (model == 2011) {
|
||||
rom_init(&ps->high_rom,
|
||||
L"roms/machines/ibmps1es/f80000.bin",
|
||||
"roms/machines/ibmps1es/f80000.bin",
|
||||
0xf80000, 0x80000, 0x7ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
lpt2_remove();
|
||||
|
||||
device_add(&snd_device);
|
||||
device_add(&ps1snd_device);
|
||||
|
||||
device_add(&fdc_at_actlow_device);
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current == 1) {
|
||||
@@ -467,17 +293,21 @@ ps1_setup(int model)
|
||||
|
||||
ps1_hdc_inform(priv, &ps->ps1_91);
|
||||
}
|
||||
}
|
||||
|
||||
if (model == 2121) {
|
||||
/* Enable the PS/1 VGA controller. */
|
||||
device_add(&ps1vga_device);
|
||||
} else if (model == 2121) {
|
||||
io_sethandler(0x00e0, 2,
|
||||
ps1_read, NULL, NULL, ps1_write, NULL, NULL, ps);
|
||||
|
||||
#if 0
|
||||
if (rom_present("roms/machines/ibmps1_2121/F80000.BIN")) {
|
||||
rom_init(&ps->mid_rom,
|
||||
"roms/machines/ibmps1_2121/F80000.BIN",
|
||||
0xf80000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
}
|
||||
rom_init(&ps->high_rom,
|
||||
L"roms/machines/ibmps1_2121/fc0000.bin",
|
||||
0xfc0000, 0x20000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
#endif
|
||||
"roms/machines/ibmps1_2121/FC0000.BIN",
|
||||
0xfc0000, 0x40000, 0x3ffff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
/* Initialize the video controller. */
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
@@ -487,44 +317,26 @@ ps1_setup(int model)
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
device_add(&snd_device);
|
||||
device_add(&ps1snd_device);
|
||||
}
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_PS1M2133)
|
||||
if (model == 2133) {
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Enable the PS/1 VGA controller. */
|
||||
if (model == 2011)
|
||||
device_add(&ps1vga_device);
|
||||
else
|
||||
device_add(&ibm_ps1_2121_device);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ps1_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
refresh_at_enable = 1;
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
device_add(&ps_nvr_device);
|
||||
|
||||
device_add(&keyboard_ps2_ps1_device);
|
||||
device_add(&port_6x_device);
|
||||
|
||||
/* Audio uses ports 200h and 202-207h, so only initialize gameport on 201h. */
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_201_device);
|
||||
standalone_gameport_type = &gameport_201_device;
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +345,7 @@ machine_ps1_m2011_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmps1es/f80000.bin",
|
||||
ret = bios_load_linear("roms/machines/ibmps1es/f80000.bin",
|
||||
0x000e0000, 131072, 0x60000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -552,7 +364,7 @@ machine_ps1_m2121_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmps1_2121/fc0000.bin",
|
||||
ret = bios_load_linear("roms/machines/ibmps1_2121/FC0000.BIN",
|
||||
0x000e0000, 131072, 0x20000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -564,26 +376,3 @@ machine_ps1_m2121_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_PS1M2133)
|
||||
int
|
||||
machine_ps1_m2133_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmps1_2133/ps1_2133_52g2974_rom.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
ps1_common_init(model);
|
||||
|
||||
ps1_setup(2133);
|
||||
|
||||
nmi_mask = 0x80;
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* disk drives for this bus commonly have an 'A' suffix to
|
||||
* identify them as 'ATBUS'.
|
||||
*
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* In XTA-IDE, which is slightly older, the programming
|
||||
* interface of the IBM PC/XT (which used the MFM controller
|
||||
* from Xebec) was kept, and, so, it uses an 8bit data path.
|
||||
* Disk drives for this bus commonly have the 'X' suffix to
|
||||
@@ -38,7 +38,7 @@
|
||||
* data byte per transfer. XTIDE uses regular IDE drives,
|
||||
* and uses the regular ATA/IDE programming interface, just
|
||||
* with the extra register.
|
||||
*
|
||||
*
|
||||
* NOTE: We should probably find a nicer way to integrate our Disk
|
||||
* Type table with the main code, so the user can only select
|
||||
* items from that list...
|
||||
@@ -82,9 +82,6 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#define __USE_LARGEFILE64
|
||||
#define _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE64_SOURCE
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
@@ -847,7 +844,7 @@ do_send:
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case STATE_SDATA:
|
||||
if (! no_data) {
|
||||
/* Perform DMA. */
|
||||
@@ -1040,7 +1037,7 @@ do_recv:
|
||||
case CMD_FORMAT_TRACK:
|
||||
do_format(dev, drive, ccb);
|
||||
break;
|
||||
|
||||
|
||||
case CMD_SEEK:
|
||||
if (! drive->present) {
|
||||
dev->ssb.not_ready = 1;
|
||||
@@ -1150,7 +1147,7 @@ hdc_read(uint16_t port, void *priv)
|
||||
break;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -1349,17 +1346,20 @@ ps1_hdc_close(void *priv)
|
||||
free(dev);
|
||||
}
|
||||
|
||||
|
||||
const device_t ps1_hdc_device = {
|
||||
"PS/1 2011 Fixed Disk Controller",
|
||||
DEVICE_ISA | DEVICE_PS2,
|
||||
0,
|
||||
ps1_hdc_init, ps1_hdc_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL
|
||||
.name = "PS/1 2011 Fixed Disk Controller",
|
||||
.internal_name = "ps1_hdc",
|
||||
.flags = DEVICE_ISA | DEVICE_PS2,
|
||||
.local = 0,
|
||||
.init = ps1_hdc_init,
|
||||
.close = ps1_hdc_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Very nasty.
|
||||
*
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
@@ -15,6 +16,7 @@
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/port_92.h>
|
||||
#include <86box/serial.h>
|
||||
#include <86box/hdc.h>
|
||||
@@ -24,174 +26,194 @@
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
static uint8_t ps2_91, ps2_94, ps2_102, ps2_103, ps2_104, ps2_105, ps2_190;
|
||||
static serial_t *ps2_uart;
|
||||
typedef struct {
|
||||
int model;
|
||||
int cpu_type;
|
||||
|
||||
uint8_t ps2_91,
|
||||
ps2_92,
|
||||
ps2_94,
|
||||
ps2_102,
|
||||
ps2_103,
|
||||
ps2_104,
|
||||
ps2_105,
|
||||
ps2_190;
|
||||
|
||||
serial_t *uart;
|
||||
} ps2_isa_t;
|
||||
|
||||
|
||||
static struct
|
||||
static void
|
||||
ps2_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
uint8_t status, int_status;
|
||||
uint8_t attention, ctrl;
|
||||
} ps2_hd;
|
||||
ps2_isa_t *ps2 = (ps2_isa_t *)priv;
|
||||
|
||||
switch (port) {
|
||||
case 0x0094:
|
||||
ps2->ps2_94 = val;
|
||||
break;
|
||||
|
||||
static uint8_t ps2_read(uint16_t port, void *p)
|
||||
{
|
||||
uint8_t temp;
|
||||
|
||||
switch (port)
|
||||
{
|
||||
case 0x91:
|
||||
temp = ps2_91;
|
||||
ps2_91 = 0;
|
||||
return temp;
|
||||
case 0x94:
|
||||
return ps2_94;
|
||||
case 0x102:
|
||||
return ps2_102 | 8;
|
||||
case 0x103:
|
||||
return ps2_103;
|
||||
case 0x104:
|
||||
return ps2_104;
|
||||
case 0x105:
|
||||
return ps2_105;
|
||||
case 0x190:
|
||||
return ps2_190;
|
||||
|
||||
#ifdef FIXME
|
||||
case 0x322:
|
||||
temp = ps2_hd.status;
|
||||
break;
|
||||
case 0x324:
|
||||
temp = ps2_hd.int_status;
|
||||
ps2_hd.int_status &= ~0x02;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
temp = 0xff;
|
||||
break;
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
static void ps2_write(uint16_t port, uint8_t val, void *p)
|
||||
{
|
||||
switch (port)
|
||||
{
|
||||
case 0x94:
|
||||
ps2_94 = val;
|
||||
break;
|
||||
case 0x102:
|
||||
case 0x0102:
|
||||
if (!(ps2->ps2_94 & 0x80)) {
|
||||
lpt1_remove();
|
||||
if (val & 0x04)
|
||||
serial_setup(ps2_uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
else
|
||||
serial_remove(ps2_uart);
|
||||
if (val & 0x10)
|
||||
{
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(0x3bc);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x378);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x278);
|
||||
break;
|
||||
}
|
||||
serial_remove(ps2->uart);
|
||||
if (val & 0x04) {
|
||||
if (val & 0x08)
|
||||
serial_setup(ps2->uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps2->uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
ps2_102 = val;
|
||||
break;
|
||||
case 0x103:
|
||||
ps2_103 = val;
|
||||
break;
|
||||
case 0x104:
|
||||
ps2_104 = val;
|
||||
break;
|
||||
case 0x105:
|
||||
ps2_105 = val;
|
||||
break;
|
||||
case 0x190:
|
||||
ps2_190 = val;
|
||||
break;
|
||||
if (val & 0x10) {
|
||||
switch ((val >> 5) & 3) {
|
||||
case 0:
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2->ps2_102 = val;
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef FIXME
|
||||
case 0x322:
|
||||
ps2_hd.ctrl = val;
|
||||
if (val & 0x80)
|
||||
ps2_hd.status |= 0x02;
|
||||
break;
|
||||
case 0x324:
|
||||
ps2_hd.attention = val & 0xf0;
|
||||
if (ps2_hd.attention)
|
||||
ps2_hd.status = 0x14;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
case 0x0103:
|
||||
ps2->ps2_103 = val;
|
||||
break;
|
||||
|
||||
case 0x0104:
|
||||
ps2->ps2_104 = val;
|
||||
break;
|
||||
|
||||
case 0x0105:
|
||||
ps2->ps2_105 = val;
|
||||
break;
|
||||
|
||||
case 0x0190:
|
||||
ps2->ps2_190 = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void ps2board_init(void)
|
||||
static uint8_t
|
||||
ps2_read(uint16_t port, void *priv)
|
||||
{
|
||||
io_sethandler(0x0091, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0094, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0102, 0x0004, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0190, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
#ifdef FIXME
|
||||
io_sethandler(0x0320, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0322, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0324, 0x0001, ps2_read, NULL, NULL, ps2_write, NULL, NULL, NULL);
|
||||
#endif
|
||||
ps2_isa_t *ps2 = (ps2_isa_t *)priv;
|
||||
uint8_t temp = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x0091:
|
||||
temp = ps2->ps2_91;
|
||||
ps2->ps2_91 = 0;
|
||||
break;
|
||||
|
||||
case 0x0094:
|
||||
temp = ps2->ps2_94;
|
||||
break;
|
||||
|
||||
case 0x0102:
|
||||
temp = ps2->ps2_102 | 0x08;
|
||||
break;
|
||||
|
||||
case 0x0103:
|
||||
temp = ps2->ps2_103;
|
||||
break;
|
||||
|
||||
case 0x0104:
|
||||
temp = ps2->ps2_104;
|
||||
break;
|
||||
|
||||
case 0x0105:
|
||||
temp = ps2->ps2_105;
|
||||
break;
|
||||
|
||||
case 0x0190:
|
||||
temp = ps2->ps2_190;
|
||||
break;
|
||||
}
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ps2_isa_setup(int model, int cpu_type)
|
||||
{
|
||||
ps2_isa_t *ps2;
|
||||
void *priv;
|
||||
|
||||
ps2 = (ps2_isa_t *)malloc(sizeof(ps2_isa_t));
|
||||
memset(ps2, 0x00, sizeof(ps2_isa_t));
|
||||
ps2->model = model;
|
||||
ps2->cpu_type = cpu_type;
|
||||
|
||||
|
||||
io_sethandler(0x0091, 1,
|
||||
ps2_read, NULL, NULL, ps2_write, NULL, NULL, ps2);
|
||||
io_sethandler(0x0094, 1,
|
||||
ps2_read, NULL, NULL, ps2_write, NULL, NULL, ps2);
|
||||
io_sethandler(0x0102, 4,
|
||||
ps2_read, NULL, NULL, ps2_write, NULL, NULL, ps2);
|
||||
io_sethandler(0x0190, 1,
|
||||
ps2_read, NULL, NULL, ps2_write, NULL, NULL, ps2);
|
||||
|
||||
ps2->uart = device_add_inst(&ns16450_device, 1);
|
||||
|
||||
lpt1_remove();
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
|
||||
device_add(&port_92_device);
|
||||
|
||||
ps2_190 = 0;
|
||||
mem_remap_top(384);
|
||||
|
||||
ps2_uart = device_add_inst(&ns16450_device, 1);
|
||||
device_add(&ps_nvr_device);
|
||||
|
||||
lpt1_init(0x3bc);
|
||||
|
||||
memset(&ps2_hd, 0, sizeof(ps2_hd));
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current == 1) {
|
||||
priv = device_add(&ps1_hdc_device);
|
||||
ps1_hdc_inform(priv, &ps2->ps2_91);
|
||||
}
|
||||
|
||||
device_add(&ps1vga_device);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ps2_isa_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
refresh_at_enable = 1;
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_at);
|
||||
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&port_6x_ps2_device);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_ps2_m30_286_init(const machine_t *model)
|
||||
{
|
||||
void *priv;
|
||||
int ret;
|
||||
|
||||
int ret;
|
||||
ret = bios_load_linear("roms/machines/ibmps2_m30_286/33f5381a.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmps2_m30_286/33f5381a.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
ps2_isa_common_init(model);
|
||||
|
||||
machine_common_init(model);
|
||||
ps2_isa_setup(30, 286);
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
device_add(&fdc_at_ps1_device);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_at);
|
||||
dma16_init();
|
||||
device_add(&keyboard_ps2_ps2_device);
|
||||
device_add(&ps_nvr_device);
|
||||
pic2_init();
|
||||
ps2board_init();
|
||||
device_add(&ps1vga_device);
|
||||
|
||||
/* Enable the builtin HDC. */
|
||||
if (hdc_current == 1) {
|
||||
priv = device_add(&ps1_hdc_device);
|
||||
|
||||
ps1_hdc_inform(priv, &ps2_91);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,13 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/nvr_ps2.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/port_92.h>
|
||||
#include <86box/serial.h>
|
||||
#include <86box/video.h>
|
||||
@@ -76,27 +78,27 @@ static struct
|
||||
uint8_t setup;
|
||||
uint8_t sys_ctrl_port_a;
|
||||
uint8_t subaddr_lo, subaddr_hi;
|
||||
|
||||
|
||||
uint8_t memory_bank[8];
|
||||
|
||||
|
||||
uint8_t io_id;
|
||||
|
||||
mem_mapping_t shadow_mapping;
|
||||
uint16_t planar_id;
|
||||
|
||||
mem_mapping_t split_mapping;
|
||||
mem_mapping_t expansion_mapping;
|
||||
mem_mapping_t cache_mapping;
|
||||
|
||||
|
||||
uint8_t (*planar_read)(uint16_t port);
|
||||
void (*planar_write)(uint16_t port, uint8_t val);
|
||||
|
||||
|
||||
uint8_t mem_regs[3];
|
||||
|
||||
|
||||
uint32_t split_addr, split_size;
|
||||
uint32_t split_phys;
|
||||
|
||||
|
||||
uint8_t mem_pos_regs[8];
|
||||
uint8_t mem_2mb_pos_regs[8];
|
||||
|
||||
|
||||
int pending_cache_miss;
|
||||
|
||||
serial_t *uart;
|
||||
@@ -104,7 +106,7 @@ static struct
|
||||
|
||||
/*The model 70 type 3/4 BIOS performs cache testing. Since 86Box doesn't have any
|
||||
proper cache emulation, it's faked a bit here.
|
||||
|
||||
|
||||
Port E2 is used for cache diagnostics. Bit 7 seems to be set on a cache miss,
|
||||
toggling bit 2 seems to clear this. The BIOS performs at least the following
|
||||
tests :
|
||||
@@ -122,7 +124,7 @@ static struct
|
||||
This behaviour is required to pass the timer interrupt test on the 486 version
|
||||
- the BIOS uses a fixed length loop that will terminate too early on a 486/25
|
||||
if it executes from internal cache.
|
||||
|
||||
|
||||
To handle this, 86Box uses some basic heuristics :
|
||||
- If cache is enabled but RAM is disabled, accesses to low memory go directly
|
||||
to cache memory.
|
||||
@@ -200,7 +202,7 @@ static uint32_t ps2_read_cache_raml(uint32_t addr, void *priv)
|
||||
}
|
||||
static void ps2_write_cache_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
ps2_mca_log("ps2_write_cache_ram: addr=%08x val=%02x %04x:%04x %i\n", addr, val, CS,cpu_state.pc, ins);
|
||||
ps2_mca_log("ps2_write_cache_ram: addr=%08x val=%02x %04x:%04x %i\n", addr, val, CS,cpu_state.pc);
|
||||
ps2_cache[addr] = val;
|
||||
}
|
||||
|
||||
@@ -209,37 +211,6 @@ void ps2_cache_clean(void)
|
||||
memset(ps2_cache_valid, 0, sizeof(ps2_cache_valid));
|
||||
}
|
||||
|
||||
static uint8_t ps2_read_shadow_ram(uint32_t addr, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
return mem_read_ram(addr, priv);
|
||||
}
|
||||
static uint16_t ps2_read_shadow_ramw(uint32_t addr, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
return mem_read_ramw(addr, priv);
|
||||
}
|
||||
static uint32_t ps2_read_shadow_raml(uint32_t addr, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
return mem_read_raml(addr, priv);
|
||||
}
|
||||
static void ps2_write_shadow_ram(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
mem_write_ram(addr, val, priv);
|
||||
}
|
||||
static void ps2_write_shadow_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
mem_write_ramw(addr, val, priv);
|
||||
}
|
||||
static void ps2_write_shadow_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
{
|
||||
addr = (addr & 0x1ffff) + 0xe0000;
|
||||
mem_write_raml(addr, val, priv);
|
||||
}
|
||||
|
||||
static uint8_t ps2_read_split_ram(uint32_t addr, void *priv)
|
||||
{
|
||||
addr = (addr % (ps2.split_size << 10)) + ps2.split_phys;
|
||||
@@ -282,9 +253,9 @@ static uint8_t model_50_read(uint16_t port)
|
||||
switch (port)
|
||||
{
|
||||
case 0x100:
|
||||
return 0xff;
|
||||
return ps2.planar_id & 0xff;
|
||||
case 0x101:
|
||||
return 0xfb;
|
||||
return ps2.planar_id >> 8;
|
||||
case 0x102:
|
||||
return ps2.option[0];
|
||||
case 0x103:
|
||||
@@ -306,9 +277,9 @@ static uint8_t model_55sx_read(uint16_t port)
|
||||
switch (port)
|
||||
{
|
||||
case 0x100:
|
||||
return 0xff;
|
||||
return ps2.planar_id & 0xff;
|
||||
case 0x101:
|
||||
return 0xfb;
|
||||
return ps2.planar_id >> 8;
|
||||
case 0x102:
|
||||
return ps2.option[0];
|
||||
case 0x103:
|
||||
@@ -330,9 +301,9 @@ static uint8_t model_70_type3_read(uint16_t port)
|
||||
switch (port)
|
||||
{
|
||||
case 0x100:
|
||||
return 0xff;
|
||||
return ps2.planar_id & 0xff;
|
||||
case 0x101:
|
||||
return 0xf9;
|
||||
return ps2.planar_id >> 8;
|
||||
case 0x102:
|
||||
return ps2.option[0];
|
||||
case 0x103:
|
||||
@@ -354,9 +325,9 @@ static uint8_t model_80_read(uint16_t port)
|
||||
switch (port)
|
||||
{
|
||||
case 0x100:
|
||||
return 0xff;
|
||||
return ps2.planar_id & 0xff;
|
||||
case 0x101:
|
||||
return 0xfd;
|
||||
return ps2.planar_id >> 8;
|
||||
case 0x102:
|
||||
return ps2.option[0];
|
||||
case 0x103:
|
||||
@@ -388,22 +359,22 @@ static void model_50_write(uint16_t port, uint8_t val)
|
||||
if (val & 0x04)
|
||||
{
|
||||
if (val & 0x08)
|
||||
serial_setup(ps2.uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
serial_setup(ps2.uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps2.uart, SERIAL2_ADDR, SERIAL2_IRQ);
|
||||
serial_setup(ps2.uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
if (val & 0x10)
|
||||
{
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x378);
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x278);
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -427,6 +398,92 @@ static void model_50_write(uint16_t port, uint8_t val)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void model_55sx_mem_recalc(void)
|
||||
{
|
||||
int i, j, state;
|
||||
#ifdef ENABLE_PS2_MCA_LOG
|
||||
int enabled_mem = 0;
|
||||
#endif
|
||||
int base = 0, remap_size = (ps2.option[3] & 0x10) ? 384 : 256;
|
||||
int bit_mask = 0x00, max_rows = 4;
|
||||
int bank_to_rows[16] = { 4, 2, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0 };
|
||||
|
||||
ps2_mca_log("%02X %02X\n", ps2.option[1], ps2.option[3]);
|
||||
|
||||
mem_remap_top(remap_size);
|
||||
mem_set_mem_state(0x00000000, (mem_size + 384) * 1024, MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL);
|
||||
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_DISABLED);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
max_rows = bank_to_rows[(ps2.memory_bank[i] >> 4) & 0x0f];
|
||||
|
||||
if (max_rows == 0)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < max_rows; j++)
|
||||
{
|
||||
if (ps2.memory_bank[i] & (1 << j)) {
|
||||
ps2_mca_log("Set memory at %06X-%06X to internal\n", (base * 1024), (base * 1024) + (((base > 0) ? 1024 : 640) * 1024) - 1);
|
||||
mem_set_mem_state(base * 1024, ((base > 0) ? 1024 : 640) * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
#ifdef ENABLE_PS2_MCA_LOG
|
||||
enabled_mem += 1024;
|
||||
#endif
|
||||
bit_mask |= (1 << (j + (i << 2)));
|
||||
}
|
||||
base += 1024;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_PS2_MCA_LOG
|
||||
ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask);
|
||||
#endif
|
||||
|
||||
if (ps2.option[3] & 0x10)
|
||||
{
|
||||
/* Enable ROM. */
|
||||
ps2_mca_log("Enable ROM\n");
|
||||
state = MEM_READ_EXTANY;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Disable ROM. */
|
||||
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01))
|
||||
{
|
||||
/* Disable RAM between 640 kB and 1 MB. */
|
||||
ps2_mca_log("Disable ROM, enable RAM\n");
|
||||
state = MEM_READ_INTERNAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
ps2_mca_log("Disable ROM, disable RAM\n");
|
||||
state = MEM_READ_DISABLED;
|
||||
}
|
||||
}
|
||||
|
||||
/* Write always disabled. */
|
||||
state |= MEM_WRITE_DISABLED;
|
||||
|
||||
mem_set_mem_state(0xe0000, 0x20000, state);
|
||||
|
||||
/* if (!(ps2.option[3] & 0x08))
|
||||
{
|
||||
ps2_mca_log("Memory not yet configured\n");
|
||||
return;
|
||||
} */
|
||||
|
||||
ps2_mca_log("Enable shadow mapping at %06X-%06X\n", (mem_size * 1024), (mem_size * 1024) + (remap_size * 1024) - 1);
|
||||
|
||||
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01)) {
|
||||
ps2_mca_log("Set memory at %06X-%06X to internal\n", (mem_size * 1024), (mem_size * 1024) + (remap_size * 1024) - 1);
|
||||
mem_set_mem_state(mem_size * 1024, remap_size * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
}
|
||||
|
||||
flushmmucache_nopc();
|
||||
}
|
||||
|
||||
|
||||
static void model_55sx_write(uint16_t port, uint8_t val)
|
||||
{
|
||||
switch (port)
|
||||
@@ -442,56 +499,42 @@ static void model_55sx_write(uint16_t port, uint8_t val)
|
||||
if (val & 0x04)
|
||||
{
|
||||
if (val & 0x08)
|
||||
serial_setup(ps2.uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
serial_setup(ps2.uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps2.uart, SERIAL2_ADDR, SERIAL2_IRQ);
|
||||
serial_setup(ps2.uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
if (val & 0x10)
|
||||
{
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x378);
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x278);
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
break;
|
||||
case 0x103:
|
||||
ps2_mca_log("Write POS1: %02X\n", val);
|
||||
ps2.option[1] = val;
|
||||
break;
|
||||
model_55sx_mem_recalc();
|
||||
break;
|
||||
case 0x104:
|
||||
ps2.memory_bank[ps2.option[3] & 7] &= ~0xf;
|
||||
ps2.memory_bank[ps2.option[3] & 7] |= (val & 0xf);
|
||||
ps2_mca_log("Write memory bank %i %02x\n", ps2.option[3] & 7, val);
|
||||
ps2_mca_log("Write memory bank %i: %02X\n", ps2.option[3] & 7, val);
|
||||
model_55sx_mem_recalc();
|
||||
break;
|
||||
case 0x105:
|
||||
ps2_mca_log("Write POS3 %02x\n", val);
|
||||
ps2_mca_log("Write POS3: %02X\n", val);
|
||||
ps2.option[3] = val;
|
||||
shadowbios = !(val & 0x10);
|
||||
shadowbios_write = val & 0x10;
|
||||
|
||||
if (shadowbios)
|
||||
{
|
||||
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_INTERNAL | MEM_WRITE_DISABLED);
|
||||
mem_mapping_disable(&ps2.shadow_mapping);
|
||||
}
|
||||
else
|
||||
{
|
||||
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
mem_mapping_enable(&ps2.shadow_mapping);
|
||||
}
|
||||
|
||||
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20))
|
||||
mem_set_mem_state(mem_size * 1024, 256 * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
else
|
||||
mem_set_mem_state(mem_size * 1024, 256 * 1024, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
model_55sx_mem_recalc();
|
||||
break;
|
||||
case 0x106:
|
||||
ps2.subaddr_lo = val;
|
||||
@@ -516,27 +559,35 @@ static void model_70_type3_write(uint16_t port, uint8_t val)
|
||||
if (val & 0x04)
|
||||
{
|
||||
if (val & 0x08)
|
||||
serial_setup(ps2.uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
serial_setup(ps2.uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps2.uart, SERIAL2_ADDR, SERIAL2_IRQ);
|
||||
serial_setup(ps2.uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
if (val & 0x10)
|
||||
{
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x378);
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x278);
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ps2.option[0] = val;
|
||||
break;
|
||||
case 0x103:
|
||||
if (ps2.planar_id == 0xfff9)
|
||||
ps2.option[1] = (ps2.option[1] & 0x0f) | (val & 0xf0);
|
||||
break;
|
||||
case 0x104:
|
||||
if (ps2.planar_id == 0xfff9)
|
||||
ps2.option[2] = val;
|
||||
break;
|
||||
case 0x105:
|
||||
ps2.option[3] = val;
|
||||
break;
|
||||
@@ -564,22 +615,22 @@ static void model_80_write(uint16_t port, uint8_t val)
|
||||
if (val & 0x04)
|
||||
{
|
||||
if (val & 0x08)
|
||||
serial_setup(ps2.uart, SERIAL1_ADDR, SERIAL1_IRQ);
|
||||
serial_setup(ps2.uart, COM1_ADDR, COM1_IRQ);
|
||||
else
|
||||
serial_setup(ps2.uart, SERIAL2_ADDR, SERIAL2_IRQ);
|
||||
serial_setup(ps2.uart, COM2_ADDR, COM2_IRQ);
|
||||
}
|
||||
if (val & 0x10)
|
||||
{
|
||||
switch ((val >> 5) & 3)
|
||||
{
|
||||
case 0:
|
||||
lpt1_init(0x3bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
break;
|
||||
case 1:
|
||||
lpt1_init(0x378);
|
||||
lpt1_init(LPT1_ADDR);
|
||||
break;
|
||||
case 2:
|
||||
lpt1_init(0x278);
|
||||
lpt1_init(LPT2_ADDR);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -652,7 +703,7 @@ uint8_t ps2_mca_read(uint16_t port, void *p)
|
||||
temp = ps2.planar_read(port);
|
||||
else if (!(ps2.setup & PS2_SETUP_VGA))
|
||||
temp = ps2.pos_vga;
|
||||
else if (ps2.adapter_setup & PS2_ADAPTER_SETUP)
|
||||
else if (ps2.adapter_setup & PS2_ADAPTER_SETUP)
|
||||
temp = mca_read(port);
|
||||
else
|
||||
temp = 0xff;
|
||||
@@ -697,7 +748,7 @@ uint8_t ps2_mca_read(uint16_t port, void *p)
|
||||
else
|
||||
temp = 0xff;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
temp = 0xff;
|
||||
break;
|
||||
@@ -778,16 +829,17 @@ static void ps2_mca_write(uint16_t port, uint8_t val, void *p)
|
||||
|
||||
static void ps2_mca_board_common_init()
|
||||
{
|
||||
io_sethandler(0x0091, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0094, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0096, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0100, 0x0008, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0091, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0094, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0096, 0x0001, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
io_sethandler(0x0100, 0x0008, ps2_mca_read, NULL, NULL, ps2_mca_write, NULL, NULL, NULL);
|
||||
|
||||
device_add(&port_92_device);
|
||||
device_add(&port_6x_ps2_device);
|
||||
device_add(&port_92_device);
|
||||
|
||||
ps2.setup = 0xff;
|
||||
|
||||
lpt1_init(0x3bc);
|
||||
ps2.setup = 0xff;
|
||||
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
}
|
||||
|
||||
static uint8_t ps2_mem_expansion_read(int port, void *p)
|
||||
@@ -817,13 +869,8 @@ static void ps2_mca_mem_fffc_init(int start_mb)
|
||||
{
|
||||
uint32_t planar_size, expansion_start;
|
||||
|
||||
if (start_mb == 2) {
|
||||
planar_size = 0x160000;
|
||||
expansion_start = 0x260000;
|
||||
} else {
|
||||
planar_size = (start_mb - 1) << 20;
|
||||
expansion_start = start_mb << 20;
|
||||
}
|
||||
planar_size = (start_mb - 1) << 20;
|
||||
expansion_start = start_mb << 20;
|
||||
|
||||
mem_mapping_set_addr(&ram_high_mapping, 0x100000, planar_size);
|
||||
|
||||
@@ -874,12 +921,42 @@ static void ps2_mca_mem_fffc_init(int start_mb)
|
||||
mem_mapping_disable(&ps2.expansion_mapping);
|
||||
}
|
||||
|
||||
static void ps2_mca_board_model_50_init()
|
||||
{
|
||||
static void ps2_mca_mem_d071_init(int start_mb)
|
||||
{
|
||||
uint32_t planar_size, expansion_start;
|
||||
|
||||
planar_size = (start_mb - 1) << 20;
|
||||
expansion_start = start_mb << 20;
|
||||
|
||||
mem_mapping_set_addr(&ram_high_mapping, 0x100000, planar_size);
|
||||
|
||||
ps2.mem_pos_regs[0] = 0xd0;
|
||||
ps2.mem_pos_regs[1] = 0x71;
|
||||
ps2.mem_pos_regs[4] = (mem_size / 1024) - start_mb;
|
||||
|
||||
mca_add(ps2_mem_expansion_read, ps2_mem_expansion_write, ps2_mem_expansion_feedb, NULL, NULL);
|
||||
mem_mapping_add(&ps2.expansion_mapping,
|
||||
expansion_start,
|
||||
(mem_size - (start_mb << 10)) << 10,
|
||||
mem_read_ram,
|
||||
mem_read_ramw,
|
||||
mem_read_raml,
|
||||
mem_write_ram,
|
||||
mem_write_ramw,
|
||||
mem_write_raml,
|
||||
&ram[expansion_start],
|
||||
MEM_MAPPING_INTERNAL,
|
||||
NULL);
|
||||
mem_mapping_disable(&ps2.expansion_mapping);
|
||||
}
|
||||
|
||||
|
||||
static void ps2_mca_board_model_50_init(int slots)
|
||||
{
|
||||
ps2_mca_board_common_init();
|
||||
|
||||
mem_remap_top(384);
|
||||
mca_init(4);
|
||||
mca_init(slots);
|
||||
device_add(&keyboard_ps2_mca_2_device);
|
||||
|
||||
ps2.planar_read = model_50_read;
|
||||
@@ -891,31 +968,18 @@ static void ps2_mca_board_model_50_init()
|
||||
ps2_mca_mem_fffc_init(2);
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
}
|
||||
|
||||
static void ps2_mca_board_model_55sx_init()
|
||||
{
|
||||
static void ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots)
|
||||
{
|
||||
ps2_mca_board_common_init();
|
||||
|
||||
mem_mapping_add(&ps2.shadow_mapping,
|
||||
(mem_size+256) * 1024,
|
||||
128*1024,
|
||||
ps2_read_shadow_ram,
|
||||
ps2_read_shadow_ramw,
|
||||
ps2_read_shadow_raml,
|
||||
ps2_write_shadow_ram,
|
||||
ps2_write_shadow_ramw,
|
||||
ps2_write_shadow_raml,
|
||||
&ram[0xe0000],
|
||||
MEM_MAPPING_INTERNAL,
|
||||
NULL);
|
||||
|
||||
|
||||
mem_remap_top(256);
|
||||
ps2.option[1] = 0x00;
|
||||
ps2.option[2] = 0x00;
|
||||
ps2.option[3] = 0x10;
|
||||
|
||||
|
||||
memset(ps2.memory_bank, 0xf0, 8);
|
||||
switch (mem_size/1024)
|
||||
{
|
||||
@@ -949,24 +1013,38 @@ static void ps2_mca_board_model_55sx_init()
|
||||
ps2.memory_bank[0] = 0x01;
|
||||
ps2.memory_bank[1] = 0x01;
|
||||
break;
|
||||
}
|
||||
|
||||
mca_init(4);
|
||||
}
|
||||
|
||||
mca_init(slots);
|
||||
device_add(&keyboard_ps2_mca_device);
|
||||
|
||||
ps2.planar_read = model_55sx_read;
|
||||
ps2.planar_write = model_55sx_write;
|
||||
if (has_sec_nvram == 1)
|
||||
device_add(&ps2_nvr_55ls_device);
|
||||
else if (has_sec_nvram == 2)
|
||||
device_add(&ps2_nvr_device);
|
||||
|
||||
ps2.planar_read = model_55sx_read;
|
||||
ps2.planar_write = model_55sx_write;
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
|
||||
model_55sx_mem_recalc();
|
||||
}
|
||||
|
||||
static void mem_encoding_update()
|
||||
static void mem_encoding_update(void)
|
||||
{
|
||||
mem_mapping_disable(&ps2.split_mapping);
|
||||
|
||||
|
||||
if (ps2.split_size > 0)
|
||||
mem_set_mem_state(ps2.split_addr, ps2.split_size << 10, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
if (((mem_size << 10) - (1 << 20)) > 0)
|
||||
mem_set_mem_state(1 << 20, (mem_size << 10) - (1 << 20), MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
|
||||
ps2.split_addr = ((uint32_t) (ps2.mem_regs[0] & 0xf)) << 20;
|
||||
|
||||
if (!ps2.split_addr)
|
||||
ps2.split_addr = 1 << 20;
|
||||
|
||||
if (ps2.mem_regs[1] & 2) {
|
||||
mem_set_mem_state(0xe0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_INTERNAL);
|
||||
ps2_mca_log("PS/2 Model 80-111: ROM space enabled\n");
|
||||
@@ -993,12 +1071,17 @@ static void mem_encoding_update()
|
||||
ps2.split_phys = 0xa0000;
|
||||
}
|
||||
|
||||
mem_set_mem_state(ps2.split_addr, ps2.split_size << 10, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||
mem_mapping_set_exec(&ps2.split_mapping, &ram[ps2.split_phys]);
|
||||
mem_mapping_set_addr(&ps2.split_mapping, ps2.split_addr, ps2.split_size << 10);
|
||||
|
||||
ps2_mca_log("PS/2 Model 80-111: Split memory block enabled at %08X\n", ps2.split_addr);
|
||||
} else
|
||||
} else {
|
||||
ps2.split_size = 0;
|
||||
ps2_mca_log("PS/2 Model 80-111: Split memory block disabled\n");
|
||||
}
|
||||
|
||||
flushmmucache_nopc();
|
||||
}
|
||||
|
||||
static uint8_t mem_encoding_read(uint16_t addr, void *p)
|
||||
@@ -1043,7 +1126,7 @@ static uint8_t mem_encoding_read_cached(uint16_t addr, void *p)
|
||||
static void mem_encoding_write_cached(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
uint8_t old;
|
||||
|
||||
|
||||
switch (addr)
|
||||
{
|
||||
case 0xe0:
|
||||
@@ -1072,9 +1155,9 @@ static void mem_encoding_write_cached(uint16_t addr, uint8_t val, void *p)
|
||||
#if 1
|
||||
// FIXME: Look into this!!!
|
||||
if (val & 0x01)
|
||||
ram_mid_mapping.flags |= MEM_MAPPING_ROM;
|
||||
ram_mid_mapping.flags |= MEM_MAPPING_ROM_WS;
|
||||
else
|
||||
ram_mid_mapping.flags &= ~MEM_MAPPING_ROM;
|
||||
ram_mid_mapping.flags &= ~MEM_MAPPING_ROM_WS;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
@@ -1094,19 +1177,19 @@ static void mem_encoding_write_cached(uint16_t addr, uint8_t val, void *p)
|
||||
}
|
||||
}
|
||||
|
||||
static void ps2_mca_board_model_70_type34_init(int is_type4)
|
||||
{
|
||||
static void ps2_mca_board_model_70_type34_init(int is_type4, int slots)
|
||||
{
|
||||
ps2_mca_board_common_init();
|
||||
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
mca_init(4);
|
||||
mca_init(slots);
|
||||
device_add(&keyboard_ps2_mca_device);
|
||||
|
||||
ps2.planar_read = model_70_type3_read;
|
||||
ps2.planar_write = model_70_type3_write;
|
||||
|
||||
|
||||
device_add(&ps2_nvr_device);
|
||||
|
||||
|
||||
io_sethandler(0x00e0, 0x0003, mem_encoding_read_cached, NULL, NULL, mem_encoding_write_cached, NULL, NULL, NULL);
|
||||
|
||||
ps2.mem_regs[1] = 2;
|
||||
@@ -1131,12 +1214,12 @@ static void ps2_mca_board_model_70_type34_init(int is_type4)
|
||||
ps2.option[2] = 0x02;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (is_type4)
|
||||
ps2.option[2] |= 0x04; /*486 CPU*/
|
||||
|
||||
mem_mapping_add(&ps2.split_mapping,
|
||||
(mem_size+256) * 1024,
|
||||
(mem_size+256) * 1024,
|
||||
256*1024,
|
||||
ps2_read_split_ram,
|
||||
ps2_read_split_ramw,
|
||||
@@ -1150,8 +1233,8 @@ static void ps2_mca_board_model_70_type34_init(int is_type4)
|
||||
mem_mapping_disable(&ps2.split_mapping);
|
||||
|
||||
mem_mapping_add(&ps2.cache_mapping,
|
||||
0,
|
||||
is_type4 ? (8 * 1024) : (64 * 1024),
|
||||
0,
|
||||
(is_type4) ? (8 * 1024) : (64 * 1024),
|
||||
ps2_read_cache_ram,
|
||||
ps2_read_cache_ramw,
|
||||
ps2_read_cache_raml,
|
||||
@@ -1163,31 +1246,47 @@ static void ps2_mca_board_model_70_type34_init(int is_type4)
|
||||
NULL);
|
||||
mem_mapping_disable(&ps2.cache_mapping);
|
||||
|
||||
if (mem_size > 8192)
|
||||
{
|
||||
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
|
||||
ps2_mca_mem_fffc_init(8);
|
||||
}
|
||||
if (ps2.planar_id == 0xfff9) {
|
||||
if (mem_size > 4096)
|
||||
{
|
||||
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
|
||||
if (mem_size > 12288) {
|
||||
ps2_mca_mem_d071_init(4);
|
||||
} else {
|
||||
ps2_mca_mem_fffc_init(4);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (mem_size > 8192)
|
||||
{
|
||||
/* Only 8 MB supported on planar, create a memory expansion card for the rest */
|
||||
if (mem_size > 16384)
|
||||
ps2_mca_mem_d071_init(8);
|
||||
else {
|
||||
ps2_mca_mem_fffc_init(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
}
|
||||
|
||||
static void ps2_mca_board_model_80_type2_init(int is486)
|
||||
{
|
||||
{
|
||||
ps2_mca_board_common_init();
|
||||
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
mca_init(8);
|
||||
device_add(&keyboard_ps2_mca_device);
|
||||
|
||||
|
||||
ps2.planar_read = model_80_read;
|
||||
ps2.planar_write = model_80_write;
|
||||
|
||||
|
||||
device_add(&ps2_nvr_device);
|
||||
|
||||
|
||||
io_sethandler(0x00e0, 0x0002, mem_encoding_read, NULL, NULL, mem_encoding_write, NULL, NULL, NULL);
|
||||
|
||||
|
||||
ps2.mem_regs[1] = 2;
|
||||
|
||||
/* Note by Kotori: I rewrote this because the original code was using
|
||||
@@ -1221,7 +1320,7 @@ static void ps2_mca_board_model_80_type2_init(int is486)
|
||||
ps2.mem_regs[0] |= ((mem_size/1024) & 0x0f);
|
||||
|
||||
mem_mapping_add(&ps2.split_mapping,
|
||||
(mem_size+256) * 1024,
|
||||
(mem_size+256) * 1024,
|
||||
256*1024,
|
||||
ps2_read_split_ram,
|
||||
ps2_read_split_ramw,
|
||||
@@ -1233,15 +1332,21 @@ static void ps2_mca_board_model_80_type2_init(int is486)
|
||||
MEM_MAPPING_INTERNAL,
|
||||
NULL);
|
||||
mem_mapping_disable(&ps2.split_mapping);
|
||||
|
||||
|
||||
if ((mem_size > 4096) && !is486)
|
||||
{
|
||||
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
|
||||
ps2_mca_mem_fffc_init(4);
|
||||
/* Only 4 MB supported on planar, create a memory expansion card for the rest */
|
||||
if (mem_size > 12288)
|
||||
ps2_mca_mem_d071_init(4);
|
||||
else {
|
||||
ps2_mca_mem_fffc_init(4);
|
||||
}
|
||||
}
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ps1vga_mca_device);
|
||||
|
||||
ps2.split_size = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -1249,14 +1354,17 @@ static void
|
||||
machine_ps2_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
dma16_init();
|
||||
ps2_dma_init();
|
||||
device_add(&ps_nvr_device);
|
||||
device_add(&ps_no_nmi_nvr_device);
|
||||
pic2_init();
|
||||
|
||||
pit_ps2_init();
|
||||
int pit_type = ((pit_mode == -1 && is486) || pit_mode == 1) ? PIT_8254_FAST : PIT_8254;
|
||||
pit_ps2_init(pit_type);
|
||||
|
||||
nmi_mask = 0x80;
|
||||
|
||||
@@ -1269,11 +1377,11 @@ machine_ps2_model_50_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmps2_m50/90x7420.zm13",
|
||||
L"roms/machines/ibmps2_m50/90x7429.zm18",
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m50/90x7420.zm13",
|
||||
"roms/machines/ibmps2_m50/90x7429.zm18",
|
||||
0x000f0000, 131072, 0);
|
||||
ret &= bios_load_aux_interleaved(L"roms/machines/ibmps2_m50/90x7423.zm14",
|
||||
L"roms/machines/ibmps2_m50/90x7426.zm16",
|
||||
ret &= bios_load_aux_interleaved("roms/machines/ibmps2_m50/90x7423.zm14",
|
||||
"roms/machines/ibmps2_m50/90x7426.zm16",
|
||||
0x000e0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1281,7 +1389,31 @@ machine_ps2_model_50_init(const machine_t *model)
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2_mca_board_model_50_init();
|
||||
ps2.planar_id = 0xfbff;
|
||||
ps2_mca_board_model_50_init(4);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_ps2_model_60_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m50/90x7420.zm13",
|
||||
"roms/machines/ibmps2_m50/90x7429.zm18",
|
||||
0x000f0000, 131072, 0);
|
||||
ret &= bios_load_aux_interleaved("roms/machines/ibmps2_m50/90x7423.zm14",
|
||||
"roms/machines/ibmps2_m50/90x7426.zm16",
|
||||
0x000e0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2.planar_id = 0xf7ff;
|
||||
ps2_mca_board_model_50_init(8);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1292,8 +1424,8 @@ machine_ps2_model_55sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmps2_m55sx/33f8146.zm41",
|
||||
L"roms/machines/ibmps2_m55sx/33f8145.zm40",
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m55sx/33f8146.zm41",
|
||||
"roms/machines/ibmps2_m55sx/33f8145.zm40",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1301,19 +1433,40 @@ machine_ps2_model_55sx_init(const machine_t *model)
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2_mca_board_model_55sx_init();
|
||||
ps2.planar_id = 0xfffb;
|
||||
ps2_mca_board_model_55sx_init(0, 4);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_ps2_model_65sx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m65sx/64F3608.BIN",
|
||||
"roms/machines/ibmps2_m65sx/64F3611.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2.planar_id = 0xe3ff;
|
||||
ps2_mca_board_model_55sx_init(1, 8);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_ps2_model_70_type3_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmps2_m70_type3/70-a_even.bin",
|
||||
L"roms/machines/ibmps2_m70_type3/70-a_odd.bin",
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m70_type3/70-a_even.bin",
|
||||
"roms/machines/ibmps2_m70_type3/70-a_odd.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1321,41 +1474,41 @@ machine_ps2_model_70_type3_init(const machine_t *model)
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2_mca_board_model_70_type34_init(0);
|
||||
ps2.planar_id = 0xf9ff;
|
||||
|
||||
ps2_mca_board_model_70_type34_init(0, 4);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#if defined(DEV_BRANCH) && defined(USE_PS2M70T4)
|
||||
int
|
||||
machine_ps2_model_70_type4_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmps2_m70_type4/70-b_even.bin",
|
||||
L"roms/machines/ibmps2_m70_type4/70-b_odd.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2_mca_board_model_70_type34_init(1);
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
machine_ps2_model_80_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/ibmps2_m80/15f6637.bin",
|
||||
L"roms/machines/ibmps2_m80/15f6639.bin",
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m80/15f6637.bin",
|
||||
"roms/machines/ibmps2_m80/15f6639.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2.planar_id = 0xfdff;
|
||||
ps2_mca_board_model_80_type2_init(0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_ps2_model_80_axx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/ibmps2_m80/64f4356.bin",
|
||||
"roms/machines/ibmps2_m80/64f4355.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1363,7 +1516,9 @@ machine_ps2_model_80_init(const machine_t *model)
|
||||
|
||||
machine_ps2_common_init(model);
|
||||
|
||||
ps2_mca_board_model_80_type2_init(0);
|
||||
ps2.planar_id = 0xfff9;
|
||||
|
||||
ps2_mca_board_model_70_type34_init(0, 8);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ typedef struct {
|
||||
int con, coff,
|
||||
cursoron,
|
||||
blink;
|
||||
int fullchange;
|
||||
int vsynctime;
|
||||
int vadj;
|
||||
uint16_t ma, maback;
|
||||
@@ -105,7 +106,7 @@ typedef struct {
|
||||
} t1kvid_t;
|
||||
|
||||
typedef struct {
|
||||
wchar_t *path;
|
||||
char *path;
|
||||
|
||||
int state;
|
||||
int count;
|
||||
@@ -298,11 +299,11 @@ static const scancode scancode_tandy[512] = {
|
||||
{ {0}, {0} }, { {0}, {0} }, /*140*/
|
||||
{ {0}, {0} }, { {0}, {0} },
|
||||
{ {0x46, 0}, {0xc6, 0} }, { {0x47, 0}, {0xc7, 0} }, /*144*/
|
||||
{ {0x48, 0}, {0xc8, 0} }, { {0x49, 0}, {0xc9, 0} },
|
||||
{ {0}, {0} }, { {0x4b, 0}, {0xcb, 0} }, /*148*/
|
||||
{ {0}, {0} }, { {0x4d, 0}, {0xcd, 0} },
|
||||
{ {0x29, 0}, {0xa9, 0} }, { {0x49, 0}, {0xc9, 0} },
|
||||
{ {0}, {0} }, { {0x2b, 0}, {0xab, 0} }, /*148*/
|
||||
{ {0}, {0} }, { {0x4e, 0}, {0xce, 0} },
|
||||
{ {0}, {0} }, { {0x4f, 0}, {0xcf, 0} }, /*14c*/
|
||||
{ {0x50, 0}, {0xd0, 0} }, { {0x51, 0}, {0xd1, 0} },
|
||||
{ {0x4a, 0}, {0xca, 0} }, { {0x51, 0}, {0xd1, 0} },
|
||||
{ {0x52, 0}, {0xd2, 0} }, { {0x53, 0}, {0xd3, 0} }, /*150*/
|
||||
{ {0}, {0} }, { {0}, {0} },
|
||||
{ {0}, {0} }, { {0}, {0} }, /*154*/
|
||||
@@ -520,6 +521,9 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
t1kvid_t *vid = dev->vid;
|
||||
uint8_t old;
|
||||
|
||||
if ((addr >= 0x3d0) && (addr <= 0x3d7))
|
||||
addr = (addr & 0xff9) | 0x004;
|
||||
|
||||
switch (addr) {
|
||||
case 0x03d4:
|
||||
vid->crtcreg = val & 0x1f;
|
||||
@@ -533,7 +537,7 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
vid->crtc[vid->crtcreg] = val & crtcmask[vid->crtcreg];
|
||||
if (old != val) {
|
||||
if (vid->crtcreg < 0xe || vid->crtcreg > 0x10) {
|
||||
fullchange = changeframecount;
|
||||
vid->fullchange = changeframecount;
|
||||
recalc_timings(dev);
|
||||
}
|
||||
}
|
||||
@@ -554,7 +558,7 @@ vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
break;
|
||||
|
||||
case 0x03de:
|
||||
if (vid->array_index & 16)
|
||||
if (vid->array_index & 16)
|
||||
val &= 0xf;
|
||||
vid->array[vid->array_index & 0x1f] = val;
|
||||
if (dev->is_sl2) {
|
||||
@@ -589,6 +593,9 @@ vid_in(uint16_t addr, void *priv)
|
||||
t1kvid_t *vid = dev->vid;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
if ((addr >= 0x3d0) && (addr <= 0x3d7))
|
||||
addr = (addr & 0xff9) | 0x004;
|
||||
|
||||
switch (addr) {
|
||||
case 0x03d4:
|
||||
ret = vid->crtcreg;
|
||||
@@ -615,7 +622,6 @@ vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
|
||||
if (vid->memctrl == -1) return;
|
||||
|
||||
egawrites++;
|
||||
if (dev->is_sl2) {
|
||||
if (vid->array[5] & 1)
|
||||
vid->b8000[addr & 0xffff] = val;
|
||||
@@ -637,7 +643,6 @@ vid_read(uint32_t addr, void *priv)
|
||||
|
||||
if (vid->memctrl == -1) return(0xff);
|
||||
|
||||
egareads++;
|
||||
if (dev->is_sl2) {
|
||||
if (vid->array[5] & 1)
|
||||
return(vid->b8000[addr & 0xffff]);
|
||||
@@ -671,7 +676,7 @@ vid_poll(void *priv)
|
||||
vid->stat |= 1;
|
||||
vid->linepos = 1;
|
||||
oldsc = vid->sc;
|
||||
if ((vid->crtc[8] & 3) == 3)
|
||||
if ((vid->crtc[8] & 3) == 3)
|
||||
vid->sc = (vid->sc << 1) & 7;
|
||||
if (vid->dispon) {
|
||||
if (vid->displine < vid->firstline) {
|
||||
@@ -712,7 +717,7 @@ vid_poll(void *priv)
|
||||
}
|
||||
if (dev->is_sl2 && (vid->array[5] & 1)) { /*640x200x16*/
|
||||
for (x = 0; x < vid->crtc[1]*2; x++) {
|
||||
dat = (vid->vram[(vid->ma << 1) & 0xffff] << 8) |
|
||||
dat = (vid->vram[(vid->ma << 1) & 0xffff] << 8) |
|
||||
vid->vram[((vid->ma << 1) + 1) & 0xffff];
|
||||
vid->ma++;
|
||||
buffer32->line[(vid->displine << 1)][(x << 2) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 2) + 8] =
|
||||
@@ -726,7 +731,7 @@ vid_poll(void *priv)
|
||||
}
|
||||
} else if ((vid->array[3] & 0x10) && (vid->mode & 1)) { /*320x200x16*/
|
||||
for (x = 0; x < vid->crtc[1]; x++) {
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000)] << 8) |
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000)] << 8) |
|
||||
vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000) + 1];
|
||||
vid->ma++;
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + 8] =
|
||||
@@ -745,10 +750,10 @@ vid_poll(void *priv)
|
||||
} else if (vid->array[3] & 0x10) { /*160x200x16*/
|
||||
for (x = 0; x < vid->crtc[1]; x++) {
|
||||
if (dev->is_sl2) {
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
|
||||
vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1];
|
||||
} else {
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000)] << 8) |
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000)] << 8) |
|
||||
vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 3) * 0x2000) + 1];
|
||||
}
|
||||
vid->ma++;
|
||||
@@ -794,7 +799,7 @@ vid_poll(void *priv)
|
||||
if (vid->mode & 0x20) {
|
||||
cols[1] = vid->array[ ((attr & 15) & vid->array[1]) + 16] + 16;
|
||||
cols[0] = vid->array[(((attr >> 4) & 7) & vid->array[1]) + 16] + 16;
|
||||
if ((vid->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
if ((vid->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = vid->array[((attr & 15) & vid->array[1]) + 16] + 16;
|
||||
@@ -807,8 +812,13 @@ vid_poll(void *priv)
|
||||
}
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
if (vid->sc == 8) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
} else {
|
||||
buffer32->line[(vid->displine << 1)][(x << 3) + c + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 3) + c + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
@@ -827,7 +837,7 @@ vid_poll(void *priv)
|
||||
if (vid->mode & 0x20) {
|
||||
cols[1] = vid->array[ ((attr & 15) & vid->array[1]) + 16] + 16;
|
||||
cols[0] = vid->array[(((attr >> 4) & 7) & vid->array[1]) + 16] + 16;
|
||||
if ((vid->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
if ((vid->blink & 16) && (attr & 0x80) && !drawcursor)
|
||||
cols[1] = cols[0];
|
||||
} else {
|
||||
cols[1] = vid->array[((attr & 15) & vid->array[1]) + 16] + 16;
|
||||
@@ -840,9 +850,15 @@ vid_poll(void *priv)
|
||||
cols[0];
|
||||
} else {
|
||||
for (c = 0; c < 8; c++) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
if (vid->sc == 8) {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
} else {
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 8] =
|
||||
buffer32->line[(vid->displine << 1)][(x << 4) + (c << 1) + 1 + 8] = buffer32->line[(vid->displine << 1) + 1][(x << 4) + (c << 1) + 1 + 8] =
|
||||
cols[(fontdat[chr][vid->sc & 7] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (drawcursor) {
|
||||
@@ -873,7 +889,7 @@ vid_poll(void *priv)
|
||||
cols[2] = vid->array[(cols[2] & vid->array[1]) + 16] + 16;
|
||||
cols[3] = vid->array[(cols[3] & vid->array[1]) + 16] + 16;
|
||||
for (x = 0; x < vid->crtc[1]; x++) {
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
|
||||
vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000) + 1];
|
||||
vid->ma++;
|
||||
for (c = 0; c < 8; c++) {
|
||||
@@ -884,7 +900,7 @@ vid_poll(void *priv)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
cols[0] = 0;
|
||||
cols[0] = 0;
|
||||
cols[1] = vid->array[(vid->col & vid->array[1]) + 16] + 16;
|
||||
for (x = 0; x < vid->crtc[1]; x++) {
|
||||
dat = (vid->vram[((vid->ma << 1) & 0x1fff) + ((vid->sc & 1) * 0x2000)] << 8) |
|
||||
@@ -930,11 +946,11 @@ vid_poll(void *priv)
|
||||
if (vid->vc == vid->crtc[7] && !vid->sc)
|
||||
vid->stat |= 8;
|
||||
vid->displine++;
|
||||
if (vid->displine >= 360)
|
||||
if (vid->displine >= 360)
|
||||
vid->displine = 0;
|
||||
} else {
|
||||
timer_advance_u64(&vid->timer, vid->dispontime);
|
||||
if (vid->dispon)
|
||||
if (vid->dispon)
|
||||
vid->stat &= ~1;
|
||||
vid->linepos = 0;
|
||||
if (vid->vsynctime) {
|
||||
@@ -942,9 +958,9 @@ vid_poll(void *priv)
|
||||
if (! vid->vsynctime)
|
||||
vid->stat &= ~8;
|
||||
}
|
||||
if (vid->sc == (vid->crtc[11] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[11] & 31) >> 1))) {
|
||||
vid->con = 0;
|
||||
vid->coff = 1;
|
||||
if (vid->sc == (vid->crtc[11] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[11] & 31) >> 1))) {
|
||||
vid->con = 0;
|
||||
vid->coff = 1;
|
||||
}
|
||||
if (vid->vadj) {
|
||||
vid->sc++;
|
||||
@@ -968,12 +984,12 @@ vid_poll(void *priv)
|
||||
vid->vc &= 255;
|
||||
else
|
||||
vid->vc &= 127;
|
||||
if (vid->vc == vid->crtc[6])
|
||||
if (vid->vc == vid->crtc[6])
|
||||
vid->dispon = 0;
|
||||
if (oldvc == vid->crtc[4]) {
|
||||
vid->vc = 0;
|
||||
vid->vadj = vid->crtc[5];
|
||||
if (! vid->vadj)
|
||||
if (! vid->vadj)
|
||||
vid->dispon = 1;
|
||||
if (! vid->vadj) {
|
||||
if (dev->is_sl2 && (vid->array[5] & 1))
|
||||
@@ -1016,18 +1032,18 @@ vid_poll(void *priv)
|
||||
}
|
||||
|
||||
if (enable_overscan) {
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(0, (vid->firstline - 4) << 1, 0, ((vid->lastline - vid->firstline) + 8) << 1,
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(0, (vid->firstline - 4) << 1, 0, ((vid->lastline - vid->firstline) + 8) << 1,
|
||||
video_blit_memtoscreen_8(0, (vid->firstline - 4) << 1,
|
||||
xsize, ((vid->lastline - vid->firstline) + 8) << 1);
|
||||
} else {
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(8, vid->firstline << 1, 0, (vid->lastline - vid->firstline) << 1,
|
||||
if (!dev->is_sl2 && vid->composite)
|
||||
video_blit_memtoscreen(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
else
|
||||
video_blit_memtoscreen_8(8, vid->firstline << 1, 0, (vid->lastline - vid->firstline) << 1,
|
||||
video_blit_memtoscreen_8(8, vid->firstline << 1,
|
||||
xsize, (vid->lastline - vid->firstline) << 1);
|
||||
}
|
||||
}
|
||||
@@ -1068,7 +1084,7 @@ vid_poll(void *priv)
|
||||
vid->sc &= 31;
|
||||
vid->ma = vid->maback;
|
||||
}
|
||||
if ((vid->sc == (vid->crtc[10] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[10] & 31) >> 1))))
|
||||
if ((vid->sc == (vid->crtc[10] & 31) || ((vid->crtc[8] & 3) == 3 && vid->sc == ((vid->crtc[10] & 31) >> 1))))
|
||||
vid->con = 1;
|
||||
}
|
||||
}
|
||||
@@ -1127,72 +1143,66 @@ vid_init(tandy_t *dev)
|
||||
}
|
||||
|
||||
|
||||
static const device_config_t vid_config[] = {
|
||||
const device_config_t vid_config[] = {
|
||||
{
|
||||
"display_type", "Display type", CONFIG_SELECTION, "", TANDY_RGB,
|
||||
{
|
||||
{
|
||||
"RGB", TANDY_RGB
|
||||
},
|
||||
{
|
||||
"Composite", TANDY_COMPOSITE
|
||||
},
|
||||
{
|
||||
""
|
||||
}
|
||||
}
|
||||
.name = "display_type",
|
||||
.description = "Display type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = TANDY_RGB,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "RGB", .value = TANDY_RGB },
|
||||
{ .description = "Composite", .value = TANDY_COMPOSITE },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{
|
||||
"", "", -1
|
||||
}
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
static const device_t vid_device = {
|
||||
"Tandy 1000",
|
||||
0, 0,
|
||||
NULL, vid_close, NULL,
|
||||
NULL,
|
||||
vid_speed_changed,
|
||||
NULL,
|
||||
vid_config
|
||||
const device_t vid_device = {
|
||||
.name = "Tandy 1000",
|
||||
.internal_name = "tandy1000_video",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = vid_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = vid_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = vid_config
|
||||
};
|
||||
|
||||
static const device_t vid_device_hx = {
|
||||
"Tandy 1000 HX",
|
||||
0, 0,
|
||||
NULL, vid_close, NULL,
|
||||
NULL,
|
||||
vid_speed_changed,
|
||||
NULL,
|
||||
vid_config
|
||||
const device_t vid_device_hx = {
|
||||
.name = "Tandy 1000 HX",
|
||||
.internal_name = "tandy1000_hx_video",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = vid_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = vid_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = vid_config
|
||||
};
|
||||
|
||||
static const device_t vid_device_sl = {
|
||||
"Tandy 1000SL2",
|
||||
0, 1,
|
||||
NULL, vid_close, NULL,
|
||||
NULL,
|
||||
vid_speed_changed,
|
||||
NULL,
|
||||
NULL
|
||||
const device_t vid_device_sl = {
|
||||
.name = "Tandy 1000SL2",
|
||||
.internal_name = "tandy1000_sl_video",
|
||||
.flags = 0,
|
||||
.local = 1,
|
||||
.init = NULL,
|
||||
.close = vid_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = vid_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
|
||||
const device_t *
|
||||
tandy1k_get_device(void)
|
||||
{
|
||||
return &vid_device;
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
tandy1k_hx_get_device(void)
|
||||
{
|
||||
return &vid_device_hx;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
eep_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
@@ -1282,21 +1292,22 @@ eep_init(const device_t *info)
|
||||
|
||||
switch (info->local) {
|
||||
case TYPE_TANDY1000HX:
|
||||
eep->path = L"tandy1000hx.bin";
|
||||
eep->path = "tandy1000hx.bin";
|
||||
break;
|
||||
|
||||
case TYPE_TANDY1000SL2:
|
||||
eep->path = L"tandy1000sl2.bin";
|
||||
eep->path = "tandy1000sl2.bin";
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
f = nvr_fopen(eep->path, L"rb");
|
||||
f = nvr_fopen(eep->path, "rb");
|
||||
if (f != NULL) {
|
||||
if (fread(eep->store, 1, 128, f) != 128)
|
||||
fatal("eep_init(): Error reading Tandy EEPROM\n");
|
||||
(void)fclose(f);
|
||||
}
|
||||
} else
|
||||
memset(eep->store, 0x00, 128);
|
||||
|
||||
io_sethandler(0x037c, 1, NULL,NULL,NULL, eep_write,NULL,NULL, eep);
|
||||
|
||||
@@ -1310,7 +1321,7 @@ eep_close(void *priv)
|
||||
t1keep_t *eep = (t1keep_t *)priv;
|
||||
FILE *f = NULL;
|
||||
|
||||
f = nvr_fopen(eep->path, L"wb");
|
||||
f = nvr_fopen(eep->path, "wb");
|
||||
if (f != NULL) {
|
||||
(void)fwrite(eep->store, 128, 1, f);
|
||||
(void)fclose(f);
|
||||
@@ -1319,25 +1330,34 @@ eep_close(void *priv)
|
||||
free(eep);
|
||||
}
|
||||
|
||||
|
||||
static const device_t eep_1000hx_device = {
|
||||
"Tandy 1000HX EEPROM",
|
||||
0, TYPE_TANDY1000HX,
|
||||
eep_init, eep_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL
|
||||
.name = "Tandy 1000HX EEPROM",
|
||||
.internal_name = "eep_1000hx",
|
||||
.flags = 0,
|
||||
.local = TYPE_TANDY1000HX,
|
||||
.init = eep_init,
|
||||
.close = eep_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
|
||||
static const device_t eep_1000sl2_device = {
|
||||
"Tandy 1000SL2 EEPROM",
|
||||
0, TYPE_TANDY1000SL2,
|
||||
eep_init, eep_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL
|
||||
.name = "Tandy 1000SL2 EEPROM",
|
||||
.internal_name = "eep_1000sl2",
|
||||
.flags = 0,
|
||||
.local = TYPE_TANDY1000SL2,
|
||||
.init = eep_init,
|
||||
.close = eep_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
tandy_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
@@ -1447,8 +1467,8 @@ init_rom(tandy_t *dev)
|
||||
dev->rom = (uint8_t *)malloc(0x80000);
|
||||
|
||||
#if 1
|
||||
if (! rom_load_interleaved(L"roms/machines/tandy1000sl2/8079047.hu1",
|
||||
L"roms/machines/tandy1000sl2/8079048.hu2",
|
||||
if (! rom_load_interleaved("roms/machines/tandy1000sl2/8079047.hu1",
|
||||
"roms/machines/tandy1000sl2/8079048.hu2",
|
||||
0x000000, 0x80000, 0, dev->rom)) {
|
||||
tandy_log("TANDY: unable to load BIOS for 1000/SL2 !\n");
|
||||
free(dev->rom);
|
||||
@@ -1456,8 +1476,8 @@ init_rom(tandy_t *dev)
|
||||
return;
|
||||
}
|
||||
#else
|
||||
f = rom_fopen(L"roms/machines/tandy1000sl2/8079047.hu1", L"rb");
|
||||
ff = rom_fopen(L"roms/machines/tandy1000sl2/8079048.hu2", L"rb");
|
||||
f = rom_fopen("roms/machines/tandy1000sl2/8079047.hu1", "rb");
|
||||
ff = rom_fopen("roms/machines/tandy1000sl2/8079048.hu2", "rb");
|
||||
for (c = 0x0000; c < 0x80000; c += 2) {
|
||||
dev->rom[c] = getc(f);
|
||||
dev->rom[c + 1] = getc(ff);
|
||||
@@ -1494,13 +1514,15 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
mem_mapping_set_addr(&ram_low_mapping, 0, dev->base);
|
||||
|
||||
device_add(&keyboard_tandy_device);
|
||||
keyboard_set_table(scancode_tandy);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
video_reset(gfxcard);
|
||||
|
||||
switch(type) {
|
||||
case TYPE_TANDY:
|
||||
keyboard_set_table(scancode_tandy);
|
||||
io_sethandler(0x00a0, 1,
|
||||
tandy_read,NULL,NULL,tandy_write,NULL,NULL,dev);
|
||||
vid_init(dev);
|
||||
@@ -1509,6 +1531,7 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
break;
|
||||
|
||||
case TYPE_TANDY1000HX:
|
||||
keyboard_set_table(scancode_tandy);
|
||||
io_sethandler(0x00a0, 1,
|
||||
tandy_read,NULL,NULL,tandy_write,NULL,NULL,dev);
|
||||
vid_init(dev);
|
||||
@@ -1529,8 +1552,7 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
break;
|
||||
}
|
||||
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
eep_data_out = 0x0000;
|
||||
}
|
||||
@@ -1548,7 +1570,7 @@ machine_tandy_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linearr(L"roms/machines/tandy/tandy1t1.020",
|
||||
ret = bios_load_linearr("roms/machines/tandy/tandy1t1.020",
|
||||
0x000f0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1565,7 +1587,7 @@ machine_tandy1000hx_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/tandy1000hx/v020000.u12",
|
||||
ret = bios_load_linear("roms/machines/tandy1000hx/v020000.u12",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -1582,8 +1604,8 @@ machine_tandy1000sl2_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved(L"roms/machines/tandy1000sl2/8079047.hu1",
|
||||
L"roms/machines/tandy1000sl2/8079048.hu2",
|
||||
ret = bios_load_interleaved("roms/machines/tandy1000sl2/8079047.hu1",
|
||||
"roms/machines/tandy1000sl2/8079048.hu2",
|
||||
0x000f0000, 65536, 0x18000);
|
||||
|
||||
if (bios_only || !ret)
|
||||
|
||||
96
src/machine/m_v86p.c
Normal file
96
src/machine/m_v86p.c
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Victor V86P portable computer emulation.
|
||||
*
|
||||
* Author: Lubomir Rintel, <lkundrak@v3.sk>
|
||||
*
|
||||
* Copyright 2021 Lubomir Rintel.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the:
|
||||
*
|
||||
* Free Software Foundation, Inc.
|
||||
* 59 Temple Place - Suite 330
|
||||
* Boston, MA 02111-1307
|
||||
* USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <86box/86box.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/mem.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/video.h>
|
||||
|
||||
int
|
||||
machine_v86p_init(const machine_t *model)
|
||||
{
|
||||
int ret, rom = 0;
|
||||
|
||||
ret = bios_load_interleavedr("roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_122089_Even.rom",
|
||||
"roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_122089_Odd.rom",
|
||||
0x000f8000, 65536, 0);
|
||||
|
||||
if (!ret) {
|
||||
/* Try an older version of the BIOS. */
|
||||
rom = 1;
|
||||
ret = bios_load_interleavedr("roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_090489_Even.rom",
|
||||
"roms/machines/v86p/INTEL8086AWD_BIOS_S3.1_V86P_090489_Odd.rom",
|
||||
0x000f8000, 65536, 0);
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
/* Try JVERNET's BIOS. */
|
||||
rom = 2;
|
||||
ret = bios_load_linear("roms/machines/v86p/V86P.ROM",
|
||||
0x000f0000, 65536, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (rom == 2)
|
||||
loadfont("roms/machines/v86p/V86P.FON", 8);
|
||||
else
|
||||
loadfont("roms/machines/v86p/v86pfont.rom", 8);
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
device_add(&ct_82c100_device);
|
||||
device_add(&f82c606_device);
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&f82c425_video_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -11,26 +11,26 @@
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/ibm_5161.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
#include <86box/chipset.h>
|
||||
|
||||
static void
|
||||
machine_xt_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
nmi_init();
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,16 +39,16 @@ machine_pc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmpc/BIOS_5150_24APR81_U33.BIN",
|
||||
ret = bios_load_linear("roms/machines/ibmpc/BIOS_5150_24APR81_U33.BIN",
|
||||
0x000fe000, 40960, 0);
|
||||
if (ret) {
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U29 - 5700019.bin",
|
||||
bios_load_aux_linear("roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U29 - 5700019.bin",
|
||||
0x000f6000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U30 - 5700027.bin",
|
||||
bios_load_aux_linear("roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U30 - 5700027.bin",
|
||||
0x000f8000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U31 - 5700035.bin",
|
||||
bios_load_aux_linear("roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U31 - 5700035.bin",
|
||||
0x000fa000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U32 - 5700043.bin",
|
||||
bios_load_aux_linear("roms/machines/ibmpc/IBM 5150 - Cassette BASIC version C1.00 - U32 - 5700043.bin",
|
||||
0x000fc000, 8192, 0);
|
||||
}
|
||||
|
||||
@@ -68,19 +68,19 @@ machine_pc82_init(const machine_t *model)
|
||||
{
|
||||
int ret, ret2;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmpc82/pc102782.bin",
|
||||
ret = bios_load_linear("roms/machines/ibmpc82/pc102782.bin",
|
||||
0x000fe000, 40960, 0);
|
||||
if (ret) {
|
||||
ret2 = bios_load_aux_linear(L"roms/machines/ibmpc82/ibm-basic-1.10.rom",
|
||||
ret2 = bios_load_aux_linear("roms/machines/ibmpc82/ibm-basic-1.10.rom",
|
||||
0x000f6000, 32768, 0);
|
||||
if (!ret2) {
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc82/basicc11.f6",
|
||||
bios_load_aux_linear("roms/machines/ibmpc82/basicc11.f6",
|
||||
0x000f6000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc82/basicc11.f8",
|
||||
bios_load_aux_linear("roms/machines/ibmpc82/basicc11.f8",
|
||||
0x000f8000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc82/basicc11.fa",
|
||||
bios_load_aux_linear("roms/machines/ibmpc82/basicc11.fa",
|
||||
0x000fa000, 8192, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmpc82/basicc11.fc",
|
||||
bios_load_aux_linear("roms/machines/ibmpc82/basicc11.fc",
|
||||
0x000fc000, 8192, 0);
|
||||
}
|
||||
}
|
||||
@@ -111,15 +111,15 @@ machine_xt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmxt/xt.rom",
|
||||
ret = bios_load_linear("roms/machines/ibmxt/xt.rom",
|
||||
0x000f0000, 65536, 0);
|
||||
if (!ret) {
|
||||
ret = bios_load_linear(L"roms/machines/ibmxt/1501512.u18",
|
||||
ret = bios_load_linear("roms/machines/ibmxt/1501512.u18",
|
||||
0x000fe000, 65536, 0x6000);
|
||||
if (ret) {
|
||||
bios_load_aux_linear(L"roms/machines/ibmxt/1501512.u18",
|
||||
bios_load_aux_linear("roms/machines/ibmxt/1501512.u18",
|
||||
0x000f8000, 24576, 0);
|
||||
bios_load_aux_linear(L"roms/machines/ibmxt/5000027.u19",
|
||||
bios_load_aux_linear("roms/machines/ibmxt/5000027.u19",
|
||||
0x000f0000, 32768, 0);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ machine_genxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/genxt/pcxt.rom",
|
||||
ret = bios_load_linear("roms/machines/genxt/pcxt.rom",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -151,18 +151,17 @@ machine_genxt_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt86_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN",
|
||||
ret = bios_load_linear("roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN",
|
||||
0x000fe000, 65536, 0x6000);
|
||||
if (ret) {
|
||||
(void) bios_load_aux_linear(L"roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN",
|
||||
(void) bios_load_aux_linear("roms/machines/ibmxt86/BIOS_5160_09MAY86_U18_59X7268_62X0890_27256_F800.BIN",
|
||||
0x000f8000, 24576, 0);
|
||||
(void) bios_load_aux_linear(L"roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN",
|
||||
(void) bios_load_aux_linear("roms/machines/ibmxt86/BIOS_5160_09MAY86_U19_62X0819_68X4370_27256_F000.BIN",
|
||||
0x000f0000, 32768, 0);
|
||||
}
|
||||
|
||||
@@ -186,13 +185,44 @@ machine_xt_clone_init(const machine_t *model)
|
||||
machine_xt_common_init(model);
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_americxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/americxt/AMERICXT.ROM",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_amixt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/amixt/ami_8088_bios_31jan89.bin",
|
||||
ret = bios_load_linear("roms/machines/amixt/ami_8088_bios_31jan89.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_znic_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/znic/ibmzen.rom",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -209,7 +239,7 @@ machine_xt_dtk_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/dtk/dtk_erso_2.42_2764.bin",
|
||||
ret = bios_load_linear("roms/machines/dtk/dtk_erso_2.42_2764.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -226,7 +256,7 @@ machine_xt_jukopc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/jukopc/000o001.bin",
|
||||
ret = bios_load_linear("roms/machines/jukopc/000o001.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -239,11 +269,11 @@ machine_xt_jukopc_init(const machine_t *model)
|
||||
|
||||
|
||||
int
|
||||
machine_xt_open_xt_init(const machine_t *model)
|
||||
machine_xt_openxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/open_xt/pcxt31.bin",
|
||||
ret = bios_load_linear("roms/machines/openxt/pcxt31.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -254,31 +284,34 @@ machine_xt_open_xt_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_hed919_init(const machine_t *model)
|
||||
machine_xt_pcxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/hed919/Hedaka_HED-919_bios_version_3.28f.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
ret = bios_load_linear("roms/machines/pcxt/u18.rom",
|
||||
0x000f8000, 65536, 0);
|
||||
if (ret) {
|
||||
bios_load_aux_linear("roms/machines/pcxt/u19.rom",
|
||||
0x000f0000, 32768, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
if (mem_size > 640)
|
||||
mem_remap_top(mem_size - 640);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_pxxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/pxxt/000p001.bin",
|
||||
ret = bios_load_linear("roms/machines/pxxt/000p001.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -286,5 +319,245 @@ machine_xt_pxxt_init(const machine_t *model)
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return 1;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_iskra3104_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/iskra3104/198.bin",
|
||||
"roms/machines/iskra3104/199.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_pc4i_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pc4i/NCR_PC4i_BIOSROM_1985.BIN",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_mpc1600_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/mpc1600/mpc4.34_merged.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc82_device);
|
||||
|
||||
machine_xt_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_pcspirit_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pcspirit/u1101.bin",
|
||||
0x000fe000, 16384, 0);
|
||||
|
||||
if (ret) {
|
||||
bios_load_aux_linear("roms/machines/pcspirit/u1103.bin",
|
||||
0x000fc000, 8192, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc82_device);
|
||||
|
||||
machine_xt_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_pc700_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pc700/multitech pc-700 3.1.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
|
||||
machine_xt_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_pc500_init(const machine_t* model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/pc500/rom404.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
|
||||
machine_xt_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_vendex_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/vendex/Vendex Turbo 888 XT - ROM BIOS - VER 2.03C.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_super16t_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/super16t/Hyundai SUPER-16T - System BIOS HEA v1.12Ta (16k)(MBM27128)(1986).BIN",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_super16te_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/super16te/Hyundai SUPER-16TE - System BIOS v2.00Id (16k)(D27128A)(1989).BIN",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_top88_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/top88/Hyosung Topstar 88T - BIOS version 3.0.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_kaypropc_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/kaypropc/Kaypro_v2.03K.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_sansx16_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/sansx16/tmm27128ad.bin.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_bw230_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/bw230/bondwell.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_clone_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -37,13 +37,12 @@
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/machine.h>
|
||||
|
||||
|
||||
int
|
||||
machine_xt_compaq_init(const machine_t *model)
|
||||
machine_xt_compaq_deskpro_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/portable/compaq portable plus 100666-001 rev c u47.bin",
|
||||
ret = bios_load_linear("roms/machines/deskpro/Compaq - BIOS - Revision J - 106265-002.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -51,17 +50,45 @@ machine_xt_compaq_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
lpt1_remove();
|
||||
lpt1_init(0x03bc);
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_compaq_portable_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/portable/compaq portable plus 100666-001 rev c u47.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
if (joystick_type)
|
||||
device_add(&gameport_device);
|
||||
|
||||
lpt1_remove();
|
||||
lpt1_init(LPT_MDA_ADDR);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include <86box/timer.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/keyboard.h>
|
||||
|
||||
@@ -139,7 +140,7 @@ machine_xt_laserxt_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/ltxt/27c64.bin",
|
||||
ret = bios_load_linear("roms/machines/ltxt/27c64.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -158,7 +159,7 @@ machine_xt_lxt3_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/lxt3/27c64d.bin",
|
||||
ret = bios_load_linear("roms/machines/lxt3/27c64d.bin",
|
||||
0x000fe000, 8192, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -166,13 +167,14 @@ machine_xt_lxt3_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_lxt3_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
laserxt_init(1);
|
||||
|
||||
|
||||
866
src/machine/m_xt_olivetti.c
Normal file
866
src/machine/m_xt_olivetti.c
Normal file
@@ -0,0 +1,866 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the Olivetti XT-compatible machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* EngiNerd <webmaster.crrc@yahoo.it>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van Kempen.
|
||||
* Copyright 2020 EngiNerd.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/ppi.h>
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_speaker.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/vid_cga.h>
|
||||
#include <86box/vid_ogc.h>
|
||||
#include <86box/vid_colorplus.h>
|
||||
#include <86box/vid_cga_comp.h>
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
#define STAT_TTIMEOUT 0x20
|
||||
#define STAT_LOCK 0x10
|
||||
#define STAT_CD 0x08
|
||||
#define STAT_SYSFLAG 0x04
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
#define PLANTRONICS_MODE 1
|
||||
#define OLIVETTI_OGC_MODE 0
|
||||
|
||||
#define CGA_RGB 0
|
||||
#define CGA_COMPOSITE 1
|
||||
|
||||
typedef struct {
|
||||
/* Keyboard stuff. */
|
||||
int wantirq;
|
||||
uint8_t command;
|
||||
uint8_t status;
|
||||
uint8_t out;
|
||||
uint8_t output_port;
|
||||
int param,
|
||||
param_total;
|
||||
uint8_t params[16];
|
||||
uint8_t scan[7];
|
||||
|
||||
/* Mouse stuff. */
|
||||
int mouse_mode;
|
||||
int x, y, b;
|
||||
pc_timer_t send_delay_timer;
|
||||
} m24_kbd_t;
|
||||
|
||||
typedef struct {
|
||||
ogc_t ogc;
|
||||
colorplus_t colorplus;
|
||||
int mode;
|
||||
} m19_vid_t;
|
||||
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0,
|
||||
key_queue_end = 0;
|
||||
|
||||
video_timings_t timing_m19_vid = {VIDEO_ISA, 8, 16, 32, 8, 16, 32};
|
||||
|
||||
const device_t m19_vid_device;
|
||||
|
||||
|
||||
#ifdef ENABLE_M24VID_LOG
|
||||
int m24vid_do_log = ENABLE_M24VID_LOG;
|
||||
|
||||
|
||||
static void
|
||||
m24_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (m24vid_do_log) {
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stdlog, fmt, ap);
|
||||
va_end(ap);
|
||||
fflush(stdlog);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define m24_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_poll(void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *)priv;
|
||||
|
||||
timer_advance_u64(&m24_kbd->send_delay_timer, 1000 * TIMER_USEC);
|
||||
if (m24_kbd->wantirq) {
|
||||
m24_kbd->wantirq = 0;
|
||||
picint(2);
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("M24: take IRQ\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!(m24_kbd->status & STAT_OFULL) && key_queue_start != key_queue_end) {
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("Reading %02X from the key queue at %i\n",
|
||||
m24_kbd->out, key_queue_start);
|
||||
#endif
|
||||
m24_kbd->out = key_queue[key_queue_start];
|
||||
key_queue_start = (key_queue_start + 1) & 0xf;
|
||||
m24_kbd->status |= STAT_OFULL;
|
||||
m24_kbd->status &= ~STAT_IFULL;
|
||||
m24_kbd->wantirq = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_adddata(uint16_t val)
|
||||
{
|
||||
key_queue[key_queue_end] = val;
|
||||
key_queue_end = (key_queue_end + 1) & 0xf;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_adddata_ex(uint16_t val)
|
||||
{
|
||||
kbd_adddata_process(val, m24_kbd_adddata);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *)priv;
|
||||
|
||||
#if ENABLE_KEYBOARD_LOG
|
||||
m24_log("M24: write %04X %02X\n", port, val);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (ram[8] == 0xc3)
|
||||
output = 3;
|
||||
#endif
|
||||
switch (port) {
|
||||
case 0x60:
|
||||
if (m24_kbd->param != m24_kbd->param_total) {
|
||||
m24_kbd->params[m24_kbd->param++] = val;
|
||||
if (m24_kbd->param == m24_kbd->param_total) {
|
||||
switch (m24_kbd->command) {
|
||||
case 0x11:
|
||||
m24_kbd->mouse_mode = 0;
|
||||
m24_kbd->scan[0] = m24_kbd->params[0];
|
||||
m24_kbd->scan[1] = m24_kbd->params[1];
|
||||
m24_kbd->scan[2] = m24_kbd->params[2];
|
||||
m24_kbd->scan[3] = m24_kbd->params[3];
|
||||
m24_kbd->scan[4] = m24_kbd->params[4];
|
||||
m24_kbd->scan[5] = m24_kbd->params[5];
|
||||
m24_kbd->scan[6] = m24_kbd->params[6];
|
||||
break;
|
||||
|
||||
case 0x12:
|
||||
m24_kbd->mouse_mode = 1;
|
||||
m24_kbd->scan[0] = m24_kbd->params[0];
|
||||
m24_kbd->scan[1] = m24_kbd->params[1];
|
||||
m24_kbd->scan[2] = m24_kbd->params[2];
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("M24: bad keyboard command complete %02X\n", m24_kbd->command);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m24_kbd->command = val;
|
||||
switch (val) {
|
||||
case 0x01: /*Self-test*/
|
||||
break;
|
||||
|
||||
case 0x05: /*Read ID*/
|
||||
m24_kbd_adddata(0x00);
|
||||
break;
|
||||
|
||||
case 0x11:
|
||||
m24_kbd->param = 0;
|
||||
m24_kbd->param_total = 9;
|
||||
break;
|
||||
|
||||
case 0x12:
|
||||
m24_kbd->param = 0;
|
||||
m24_kbd->param_total = 4;
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("M24: bad keyboard command %02X\n", val);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x61:
|
||||
ppi.pb = val;
|
||||
|
||||
speaker_update();
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m24_kbd_read(uint16_t port, void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *)priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x60:
|
||||
ret = m24_kbd->out;
|
||||
if (key_queue_start == key_queue_end) {
|
||||
m24_kbd->status &= ~STAT_OFULL;
|
||||
m24_kbd->wantirq = 0;
|
||||
} else {
|
||||
m24_kbd->out = key_queue[key_queue_start];
|
||||
key_queue_start = (key_queue_start + 1) & 0xf;
|
||||
m24_kbd->status |= STAT_OFULL;
|
||||
m24_kbd->status &= ~STAT_IFULL;
|
||||
m24_kbd->wantirq = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x61:
|
||||
ret = ppi.pb;
|
||||
break;
|
||||
|
||||
case 0x64:
|
||||
ret = m24_kbd->status;
|
||||
m24_kbd->status &= ~(STAT_RTIMEOUT | STAT_TTIMEOUT);
|
||||
break;
|
||||
|
||||
default:
|
||||
m24_log("\nBad M24 keyboard read %04X\n", port);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_close(void *priv)
|
||||
{
|
||||
m24_kbd_t *kbd = (m24_kbd_t *)priv;
|
||||
|
||||
/* Stop the timer. */
|
||||
timer_disable(&kbd->send_delay_timer);
|
||||
|
||||
/* Disable scanning. */
|
||||
keyboard_scan = 0;
|
||||
|
||||
keyboard_send = NULL;
|
||||
|
||||
io_removehandler(0x0060, 2,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
io_removehandler(0x0064, 1,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
|
||||
free(kbd);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_reset(void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *)priv;
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
m24_kbd->status = STAT_LOCK | STAT_CD;
|
||||
m24_kbd->wantirq = 0;
|
||||
keyboard_scan = 1;
|
||||
m24_kbd->param = m24_kbd->param_total = 0;
|
||||
m24_kbd->mouse_mode = 0;
|
||||
m24_kbd->scan[0] = 0x1c;
|
||||
m24_kbd->scan[1] = 0x53;
|
||||
m24_kbd->scan[2] = 0x01;
|
||||
m24_kbd->scan[3] = 0x4b;
|
||||
m24_kbd->scan[4] = 0x4d;
|
||||
m24_kbd->scan[5] = 0x48;
|
||||
m24_kbd->scan[6] = 0x50;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ms_poll(int x, int y, int z, int b, void *priv)
|
||||
{
|
||||
m24_kbd_t *m24_kbd = (m24_kbd_t *)priv;
|
||||
|
||||
m24_kbd->x += x;
|
||||
m24_kbd->y += y;
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 1) && !(m24_kbd->b & 1))
|
||||
m24_kbd_adddata(m24_kbd->scan[0]);
|
||||
if (!(b & 1) && (m24_kbd->b & 1))
|
||||
m24_kbd_adddata(m24_kbd->scan[0] | 0x80);
|
||||
m24_kbd->b = (m24_kbd->b & ~1) | (b & 1);
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 2) && !(m24_kbd->b & 2))
|
||||
m24_kbd_adddata(m24_kbd->scan[2]);
|
||||
if (!(b & 2) && (m24_kbd->b & 2))
|
||||
m24_kbd_adddata(m24_kbd->scan[2] | 0x80);
|
||||
m24_kbd->b = (m24_kbd->b & ~2) | (b & 2);
|
||||
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14) return(0xff);
|
||||
|
||||
if ((b & 4) && !(m24_kbd->b & 4))
|
||||
m24_kbd_adddata(m24_kbd->scan[1]);
|
||||
if (!(b & 4) && (m24_kbd->b & 4))
|
||||
m24_kbd_adddata(m24_kbd->scan[1] | 0x80);
|
||||
m24_kbd->b = (m24_kbd->b & ~4) | (b & 4);
|
||||
|
||||
if (m24_kbd->mouse_mode) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 12) return(0xff);
|
||||
|
||||
if (!m24_kbd->x && !m24_kbd->y) return(0xff);
|
||||
|
||||
m24_kbd->y = -m24_kbd->y;
|
||||
|
||||
if (m24_kbd->x < -127) m24_kbd->x = -127;
|
||||
if (m24_kbd->x > 127) m24_kbd->x = 127;
|
||||
if (m24_kbd->x < -127) m24_kbd->x = 0x80 | ((-m24_kbd->x) & 0x7f);
|
||||
|
||||
if (m24_kbd->y < -127) m24_kbd->y = -127;
|
||||
if (m24_kbd->y > 127) m24_kbd->y = 127;
|
||||
if (m24_kbd->y < -127) m24_kbd->y = 0x80 | ((-m24_kbd->y) & 0x7f);
|
||||
|
||||
m24_kbd_adddata(0xfe);
|
||||
m24_kbd_adddata(m24_kbd->x);
|
||||
m24_kbd_adddata(m24_kbd->y);
|
||||
|
||||
m24_kbd->x = m24_kbd->y = 0;
|
||||
} else {
|
||||
while (m24_kbd->x < -4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24_kbd->x += 4;
|
||||
m24_kbd_adddata(m24_kbd->scan[3]);
|
||||
}
|
||||
while (m24_kbd->x > 4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24_kbd->x -= 4;
|
||||
m24_kbd_adddata(m24_kbd->scan[4]);
|
||||
}
|
||||
while (m24_kbd->y < -4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24_kbd->y += 4;
|
||||
m24_kbd_adddata(m24_kbd->scan[5]);
|
||||
}
|
||||
while (m24_kbd->y > 4) {
|
||||
if (((key_queue_end - key_queue_start) & 0xf) > 14)
|
||||
return(0xff);
|
||||
m24_kbd->y -= 4;
|
||||
m24_kbd_adddata(m24_kbd->scan[6]);
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m24_kbd_init(m24_kbd_t *kbd)
|
||||
{
|
||||
|
||||
/* Initialize the keyboard. */
|
||||
io_sethandler(0x0060, 2,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
io_sethandler(0x0064, 1,
|
||||
m24_kbd_read, NULL, NULL, m24_kbd_write, NULL, NULL, kbd);
|
||||
keyboard_send = m24_kbd_adddata_ex;
|
||||
m24_kbd_reset(kbd);
|
||||
timer_add(&kbd->send_delay_timer, m24_kbd_poll, kbd, 1);
|
||||
|
||||
/* Tell mouse driver about our internal mouse. */
|
||||
mouse_reset();
|
||||
mouse_set_poll(ms_poll, kbd);
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
keyboard_set_is_amstrad(0);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_out(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
int oldmode = vid->mode;
|
||||
|
||||
/* activating plantronics mode */
|
||||
if (addr == 0x3dd) {
|
||||
/* already in graphics mode */
|
||||
if ((val & 0x30) && (vid->ogc.cga.cgamode & 0x2))
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
else
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
/* setting graphics mode */
|
||||
} else if (addr == 0x3d8) {
|
||||
if ((val & 0x2) && (vid->colorplus.control & 0x30))
|
||||
vid->mode = PLANTRONICS_MODE;
|
||||
else
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
}
|
||||
/* video mode changed */
|
||||
if (oldmode != vid->mode) {
|
||||
/* activate Plantronics emulation */
|
||||
if (vid->mode == PLANTRONICS_MODE){
|
||||
timer_disable(&vid->ogc.cga.timer);
|
||||
timer_set_delay_u64(&vid->colorplus.cga.timer, 0);
|
||||
/* return to OGC mode */
|
||||
} else {
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
timer_set_delay_u64(&vid->ogc.cga.timer, 0);
|
||||
}
|
||||
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
}
|
||||
|
||||
colorplus_out(addr, val, &vid->colorplus);
|
||||
ogc_out(addr, val, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m19_vid_in(uint16_t addr, void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
|
||||
if (vid->mode == PLANTRONICS_MODE)
|
||||
return colorplus_in(addr, &vid->colorplus);
|
||||
else
|
||||
return ogc_in(addr, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static uint8_t
|
||||
m19_vid_read(uint32_t addr, void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
|
||||
vid->colorplus.cga.mapping = vid->ogc.cga.mapping;
|
||||
if (vid->mode == PLANTRONICS_MODE)
|
||||
return colorplus_read(addr, &vid->colorplus);
|
||||
else
|
||||
return ogc_read(addr, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_write(uint32_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
|
||||
colorplus_write(addr, val, &vid->colorplus);
|
||||
ogc_write(addr, val, &vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_close(void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
|
||||
free(vid->ogc.cga.vram);
|
||||
free(vid->colorplus.cga.vram);
|
||||
free(vid);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_speed_changed(void *priv)
|
||||
{
|
||||
m19_vid_t *vid = (m19_vid_t *)priv;
|
||||
|
||||
colorplus_recalctimings(&vid->colorplus);
|
||||
ogc_recalctimings(&vid->ogc);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
m19_vid_init(m19_vid_t *vid)
|
||||
{
|
||||
device_context(&m19_vid_device);
|
||||
|
||||
/* int display_type; */
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_m19_vid);
|
||||
|
||||
/* display_type = device_get_config_int("display_type"); */
|
||||
|
||||
/* OGC emulation part begin */
|
||||
loadfont_ex("roms/machines/m19/BIOS.BIN", 1, 90);
|
||||
/* composite is not working yet */
|
||||
vid->ogc.cga.composite = 0; // (display_type != CGA_RGB);
|
||||
vid->ogc.cga.revision = device_get_config_int("composite_type");
|
||||
vid->ogc.cga.snow_enabled = device_get_config_int("snow_enabled");
|
||||
|
||||
vid->ogc.cga.vram = malloc(0x8000);
|
||||
|
||||
/* cga_comp_init(vid->ogc.cga.revision); */
|
||||
|
||||
vid->ogc.cga.rgb_type = device_get_config_int("rgb_type");
|
||||
cga_palette = (vid->ogc.cga.rgb_type << 1);
|
||||
cgapal_rebuild();
|
||||
ogc_mdaattr_rebuild();
|
||||
|
||||
/* color display */
|
||||
if (device_get_config_int("rgb_type")==0 || device_get_config_int("rgb_type") == 4)
|
||||
vid->ogc.mono_display = 0;
|
||||
else
|
||||
vid->ogc.mono_display = 1;
|
||||
/* OGC emulation part end */
|
||||
|
||||
/* Plantronics emulation part begin*/
|
||||
/* composite is not working yet */
|
||||
vid->colorplus.cga.composite = 0; //(display_type != CGA_RGB);
|
||||
/* vid->colorplus.cga.snow_enabled = device_get_config_int("snow_enabled"); */
|
||||
|
||||
vid->colorplus.cga.vram = malloc(0x8000);
|
||||
|
||||
/* vid->colorplus.cga.cgamode = 0x1; */
|
||||
/* Plantronics emulation part end*/
|
||||
|
||||
timer_add(&vid->ogc.cga.timer, ogc_poll, &vid->ogc, 1);
|
||||
timer_add(&vid->colorplus.cga.timer, colorplus_poll, &vid->colorplus, 1);
|
||||
timer_disable(&vid->colorplus.cga.timer);
|
||||
mem_mapping_add(&vid->ogc.cga.mapping, 0xb8000, 0x08000, m19_vid_read, NULL, NULL, m19_vid_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, vid);
|
||||
io_sethandler(0x03d0, 0x0010, m19_vid_in, NULL, NULL, m19_vid_out, NULL, NULL, vid);
|
||||
|
||||
vid->mode = OLIVETTI_OGC_MODE;
|
||||
|
||||
device_context_restore();
|
||||
}
|
||||
|
||||
const device_t m24_kbd_device = {
|
||||
.name = "Olivetti M24 keyboard and mouse",
|
||||
.internal_name = "m24_kbd",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = m24_kbd_close,
|
||||
.reset = m24_kbd_reset,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_config_t m19_vid_config[] = {
|
||||
{
|
||||
/* Olivetti / ATT compatible displays */
|
||||
.name = "rgb_type",
|
||||
.description = "RGB type",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = CGA_RGB,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "Color", .value = 0 },
|
||||
{ .description = "Green Monochrome", .value = 1 },
|
||||
{ .description = "Amber Monochrome", .value = 2 },
|
||||
{ .description = "Gray Monochrome", .value = 3 },
|
||||
{ .description = "" }
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "snow_enabled",
|
||||
.description = "Snow emulation",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1,
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
const device_t m19_vid_device = {
|
||||
.name = "Olivetti M19 graphics card",
|
||||
.internal_name = "m19_vid",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
.close = m19_vid_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = m19_vid_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = m19_vid_config
|
||||
};
|
||||
|
||||
static uint8_t
|
||||
m24_read(uint16_t port, void *priv)
|
||||
{
|
||||
uint8_t ret = 0x00;
|
||||
int i, fdd_count = 0;
|
||||
|
||||
switch (port) {
|
||||
/*
|
||||
* port 66:
|
||||
* DIPSW-0 on mainboard (off=present=1)
|
||||
* bit 7 - 2764 (off) / 2732 (on) ROM (BIOS < 1.36)
|
||||
* bit 7 - Use (off) / do not use (on) memory bank 1 (BIOS >= 1.36)
|
||||
* bit 6 - n/a
|
||||
* bit 5 - 8530 (off) / 8250 (on) SCC
|
||||
* bit 4 - 8087 present
|
||||
* bits 3-0 - installed memory
|
||||
*/
|
||||
case 0x66:
|
||||
/* Switch 5 - 8087 present */
|
||||
if (hasfpu)
|
||||
ret |= 0x10;
|
||||
/*
|
||||
* Switches 1, 2, 3, 4 - installed memory
|
||||
* Switch 8 - Use memory bank 1
|
||||
*/
|
||||
switch (mem_size) {
|
||||
case 128:
|
||||
ret |= 0x1;
|
||||
break;
|
||||
case 256:
|
||||
ret |= 0x2|0x80;
|
||||
break;
|
||||
case 384:
|
||||
ret |= 0x1|0x2|0x80;
|
||||
break;
|
||||
case 512:
|
||||
ret |= 0x8;
|
||||
break;
|
||||
case 640:
|
||||
default:
|
||||
ret |= 0x1|0x8|0x80;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* port 67:
|
||||
* DIPSW-1 on mainboard (off=present=1)
|
||||
* bits 7-6 - number of drives
|
||||
* bits 5-4 - display adapter
|
||||
* bit 3 - video scroll CPU (on) / slow scroll (off)
|
||||
* bit 2 - BIOS HD on mainboard (on) / on controller (off)
|
||||
* bit 1 - FDD fast (off) / slow (on) start drive
|
||||
* bit 0 - 96 TPI (720 KB 3.5") (off) / 48 TPI (360 KB 5.25") FDD drive
|
||||
*
|
||||
* Display adapter:
|
||||
* off off 80x25 mono
|
||||
* off on 40x25 color
|
||||
* on off 80x25 color
|
||||
* on on EGA/VGA (works only for BIOS ROM 1.43)
|
||||
*/
|
||||
case 0x67:
|
||||
for (i = 0; i < FDD_NUM; i++) {
|
||||
if (fdd_get_flags(i))
|
||||
fdd_count++;
|
||||
}
|
||||
|
||||
/* Switches 7, 8 - floppy drives. */
|
||||
if (!fdd_count)
|
||||
ret |= 0x00;
|
||||
else
|
||||
ret |= ((fdd_count - 1) << 6);
|
||||
|
||||
/* Switches 5, 6 - monitor type */
|
||||
if (video_is_mda())
|
||||
ret |= 0x30;
|
||||
else if (video_is_cga())
|
||||
ret |= 0x20; /* 0x10 would be 40x25 */
|
||||
else
|
||||
ret |= 0x0;
|
||||
|
||||
/* Switch 3 - Disable internal BIOS HD */
|
||||
ret |= 0x4;
|
||||
|
||||
/* Switch 2 - Set fast startup */
|
||||
ret |= 0x2;
|
||||
}
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_m24_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
m24_kbd_t *m24_kbd;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/m24/olivetti_m24_bios_version_1.44_low_even.bin",
|
||||
"roms/machines/m24/olivetti_m24_bios_version_1.44_high_odd.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
m24_kbd = (m24_kbd_t *) malloc(sizeof(m24_kbd_t));
|
||||
memset(m24_kbd, 0x00, sizeof(m24_kbd_t));
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
/* On-board FDC can be disabled only on M24SP */
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
/* Address 66-67 = mainboard dip-switch settings */
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
nmi_init();
|
||||
|
||||
video_reset(gfxcard);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ogc_m24_device);
|
||||
|
||||
m24_kbd_init(m24_kbd);
|
||||
device_add_ex(&m24_kbd_device, m24_kbd);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Current bugs:
|
||||
* - handles only 360kb floppy drives (drive type and capacity selectable with jumpers mapped to unknown memory locations)
|
||||
*/
|
||||
int
|
||||
machine_xt_m240_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/m240/olivetti_m240_pch6_2.04_low.bin",
|
||||
"roms/machines/m240/olivetti_m240_pch5_2.04_high.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
/* Address 66-67 = mainboard dip-switch settings */
|
||||
io_sethandler(0x0066, 2, m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
/*
|
||||
* port 60: should return jumper settings only under unknown conditions
|
||||
* SWB on mainboard (off=1)
|
||||
* bit 7 - use BIOS HD on mainboard (on) / on controller (off)
|
||||
* bit 6 - use OCG/CGA display adapter (on) / other display adapter (off)
|
||||
*/
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
device_add(&port_6x_olivetti_device);
|
||||
|
||||
/* FIXME: make sure this is correct?? */
|
||||
device_add(&at_nvr_device);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
if (joystick_type)
|
||||
device_add(&gameport_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Current bugs:
|
||||
* - 640x400x2 graphics mode not supported (bit 0 of register 0x3de cannot be set)
|
||||
* - optional mouse emulation missing
|
||||
* - setting CPU speed at 4.77MHz sometimes throws a timer error. If the machine is hard-resetted, the error disappears.
|
||||
*/
|
||||
int
|
||||
machine_xt_m19_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/m19/BIOS.BIN",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
m19_vid_t *vid;
|
||||
|
||||
/* Do not move memory allocation elsewhere. */
|
||||
vid = (m19_vid_t *) malloc(sizeof(m19_vid_t));
|
||||
memset(vid, 0x00, sizeof(m19_vid_t));
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
video_reset(gfxcard);
|
||||
|
||||
m19_vid_init(vid);
|
||||
device_add_ex(&m19_vid_device, vid);
|
||||
|
||||
device_add(&keyboard_xt_olivetti_device);
|
||||
|
||||
pit_set_clock(14318184.0);
|
||||
|
||||
return ret;
|
||||
}
|
||||
206
src/machine/m_xt_philips.c
Normal file
206
src/machine/m_xt_philips.c
Normal file
@@ -0,0 +1,206 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Emulation of the Philips XT-compatible machines.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: EngiNerd <webmaster.crrc@yahoo.it>
|
||||
*
|
||||
* Copyright 2020-2021 EngiNerd.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/ibm_5161.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/chipset.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/video.h>
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t reg;
|
||||
} philips_t;
|
||||
|
||||
|
||||
#ifdef ENABLE_PHILIPS_LOG
|
||||
int philips_do_log = ENABLE_PHILIPS_LOG;
|
||||
static void
|
||||
philips_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (philips_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define philips_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static void
|
||||
philips_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
philips_t *dev = (philips_t *) priv;
|
||||
|
||||
switch (port) {
|
||||
/* port 0xc0
|
||||
* bit 7: turbo
|
||||
* bits 4-5: rtc read/set (I2C Bus SDA/SCL?)
|
||||
* bit 2: parity disabled
|
||||
*/
|
||||
case 0xc0:
|
||||
dev->reg = val;
|
||||
if (val & 0x80)
|
||||
cpu_dynamic_switch(cpu);
|
||||
else
|
||||
cpu_dynamic_switch(0);
|
||||
break;
|
||||
}
|
||||
|
||||
philips_log("Philips XT Mainboard: Write %02x at %02x\n", val, port);
|
||||
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
philips_read(uint16_t port, void *priv)
|
||||
{
|
||||
philips_t *dev = (philips_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
/* port 0xc0
|
||||
* bit 7: turbo
|
||||
* bits 4-5: rtc read/set
|
||||
* bit 2: parity disabled
|
||||
*/
|
||||
case 0xc0:
|
||||
ret = dev->reg;
|
||||
break;
|
||||
}
|
||||
|
||||
philips_log("Philips XT Mainboard: Read %02x at %02x\n", ret, port);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
philips_close(void *priv)
|
||||
{
|
||||
philips_t *dev = (philips_t *) priv;
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static void *
|
||||
philips_init(const device_t *info)
|
||||
{
|
||||
philips_t *dev = (philips_t *) malloc(sizeof(philips_t));
|
||||
memset(dev, 0, sizeof(philips_t));
|
||||
|
||||
dev->reg = 0x40;
|
||||
|
||||
io_sethandler(0x0c0, 0x01, philips_read, NULL, NULL, philips_write, NULL, NULL, dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
const device_t philips_device = {
|
||||
.name = "Philips XT Mainboard",
|
||||
.internal_name = "philips",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = philips_init,
|
||||
.close = philips_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
void
|
||||
machine_xt_philips_common_init(const machine_t *model)
|
||||
{
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
nmi_init();
|
||||
|
||||
standalone_gameport_type = &gameport_device;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
|
||||
device_add(&philips_device);
|
||||
|
||||
device_add(&xta_hd20_device);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_p3105_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p3105/philipsnms9100.bin",
|
||||
0x000fc000, 16384, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_philips_common_init(model);
|
||||
|
||||
/* On-board FDC cannot be disabled */
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_p3120_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/p3120/philips_p3120.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_xt_philips_common_init(model);
|
||||
|
||||
device_add(&gc100a_device);
|
||||
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -9,16 +9,16 @@
|
||||
* Implementation of the Toshiba T1000 and T1200 portables.
|
||||
*
|
||||
* The T1000 is the T3100e's little brother -- a real laptop
|
||||
* with a rechargeable battery.
|
||||
* with a rechargeable battery.
|
||||
*
|
||||
* Features: 80C88 at 4.77MHz
|
||||
* - 512k system RAM
|
||||
* - 640x200 monochrome LCD
|
||||
* - 82-key keyboard
|
||||
* - 82-key keyboard
|
||||
* - Real-time clock. Not the normal 146818, but a TC8521,
|
||||
* which is a 4-bit chip.
|
||||
* - A ROM drive (128k, 256k or 512k) which acts as a mini
|
||||
* hard drive and contains a copy of DOS 2.11.
|
||||
* hard drive and contains a copy of DOS 2.11.
|
||||
* - 160 bytes of non-volatile RAM for the CONFIG.SYS used
|
||||
* when booting from the ROM drive. Possibly physically
|
||||
* located in the keyboard controller RAM.
|
||||
@@ -40,7 +40,7 @@
|
||||
* and programming level.
|
||||
*
|
||||
* 01F2h: If hard drive is present, low 4 bits are 0Ch [20Mb]
|
||||
* or 0Dh [10Mb].
|
||||
* or 0Dh [10Mb].
|
||||
*
|
||||
* The hard drive is a 20MB (615/2/26) RLL 3.5" drive.
|
||||
*
|
||||
@@ -154,7 +154,7 @@ typedef struct {
|
||||
uint8_t turbo;
|
||||
|
||||
/* NVRAM control */
|
||||
uint8_t nvr_c0;
|
||||
uint8_t nvr_c0;
|
||||
uint8_t nvr_tick;
|
||||
int nvr_addr;
|
||||
uint8_t nvr_active;
|
||||
@@ -239,8 +239,7 @@ tc8521_time_get(uint8_t *regs, struct tm *tm)
|
||||
else
|
||||
tm->tm_hour = ((nibbles(TC8521_HOUR) % 12) +
|
||||
(regs[TC8521_HOUR10] & 0x02) ? 12 : 0);
|
||||
//FIXME: wday
|
||||
tm->tm_wday = 1; /* Dummy value so it is not uninitialized. */
|
||||
tm->tm_wday = regs[TC8521_WEEKDAY];
|
||||
tm->tm_mday = nibbles(TC8521_DAY);
|
||||
tm->tm_mon = (nibbles(TC8521_MONTH) - 1);
|
||||
tm->tm_year = (nibbles(TC8521_YEAR) + 1980);
|
||||
@@ -358,7 +357,7 @@ static uint32_t
|
||||
ems_execaddr(t1000_t *sys, int pg, uint16_t val)
|
||||
{
|
||||
if (!(val & 0x80)) return(0); /* Bit 7 reset => not mapped */
|
||||
if (!sys->ems_pages) return(0); /* No EMS available: all used by
|
||||
if (!sys->ems_pages) return(0); /* No EMS available: all used by
|
||||
* HardRAM or conventional RAM */
|
||||
val &= 0x7f;
|
||||
|
||||
@@ -455,7 +454,7 @@ ems_set_port(t1000_t *sys, uint8_t val)
|
||||
#endif
|
||||
if (sys->ems_port) {
|
||||
for (n = 0; n <= 0xc000; n += 0x4000) {
|
||||
io_removehandler(sys->ems_port+n, 1,
|
||||
io_removehandler(sys->ems_port+n, 1,
|
||||
ems_in,NULL,NULL, ems_out,NULL,NULL, sys);
|
||||
}
|
||||
sys->ems_port = 0;
|
||||
@@ -469,7 +468,7 @@ ems_set_port(t1000_t *sys, uint8_t val)
|
||||
} else {
|
||||
sys->ems_port = 0x208 | (val << 4);
|
||||
for (n = 0; n <= 0xc000; n += 0x4000) {
|
||||
io_sethandler(sys->ems_port+n, 1,
|
||||
io_sethandler(sys->ems_port+n, 1,
|
||||
ems_in,NULL,NULL, ems_out,NULL,NULL, sys);
|
||||
}
|
||||
sys->ems_port = 0;
|
||||
@@ -498,7 +497,7 @@ ems_read_ram(uint32_t addr, void *priv)
|
||||
if (pg < 0) return(0xff);
|
||||
addr = sys->page_exec[pg] + (addr & 0x3fff);
|
||||
|
||||
return(ram[addr]);
|
||||
return(ram[addr]);
|
||||
}
|
||||
|
||||
|
||||
@@ -569,7 +568,7 @@ ems_write_ramw(uint32_t addr, uint16_t val, void *priv)
|
||||
t1000_log("-> %06x val=%04x\n", addr, val);
|
||||
#endif
|
||||
|
||||
if (*(uint16_t *)&ram[addr] != val) nvr_dosave = 1;
|
||||
if (*(uint16_t *)&ram[addr] != val) nvr_dosave = 1;
|
||||
|
||||
*(uint16_t *)&ram[addr] = val;
|
||||
}
|
||||
@@ -584,7 +583,7 @@ ems_write_raml(uint32_t addr, uint32_t val, void *priv)
|
||||
if (pg < 0) return;
|
||||
|
||||
addr = sys->page_exec[pg] + (addr & 0x3fff);
|
||||
if (*(uint32_t *)&ram[addr] != val) nvr_dosave = 1;
|
||||
if (*(uint32_t *)&ram[addr] != val) nvr_dosave = 1;
|
||||
|
||||
*(uint32_t *)&ram[addr] = val;
|
||||
}
|
||||
@@ -621,7 +620,7 @@ read_ctl(uint16_t addr, void *priv)
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = (sys->sys_ctl[addr & 0x0f]);
|
||||
ret = (sys->sys_ctl[addr & 0x0f]);
|
||||
}
|
||||
|
||||
return(ret);
|
||||
@@ -664,8 +663,8 @@ write_ctl(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
t1000_video_enable(val & 0x01 ? 0 : 1);
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
|
||||
case 0x0f: /* EMS control */
|
||||
switch (sys->sys_ctl[0x0e]) {
|
||||
case 0x50:
|
||||
@@ -735,7 +734,7 @@ t1000_write_nvram(uint16_t addr, uint8_t val, void *priv)
|
||||
|
||||
case 0xc1: /* Write next byte to NVRAM */
|
||||
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;
|
||||
sys->t1000_nvram[sys->nvr_addr] = val;
|
||||
}
|
||||
@@ -774,7 +773,7 @@ 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)
|
||||
if (sys->t1200_nvram[addr & 0x7FF] != value)
|
||||
nvr_dosave = 1;
|
||||
|
||||
sys->t1200_nvram[addr & 0x7FF] = value;
|
||||
@@ -802,9 +801,9 @@ t1000_write_rom_ctl(uint16_t addr, uint8_t val, void *priv)
|
||||
sys->rom_offset = ((val & 0x7f) * 0x10000) % T1000_ROMSIZE;
|
||||
mem_mapping_set_addr(&sys->rom_mapping, 0xa0000, 0x10000);
|
||||
mem_mapping_set_exec(&sys->rom_mapping, sys->romdrive + sys->rom_offset);
|
||||
mem_mapping_enable(&sys->rom_mapping);
|
||||
mem_mapping_enable(&sys->rom_mapping);
|
||||
} else {
|
||||
mem_mapping_disable(&sys->rom_mapping);
|
||||
mem_mapping_disable(&sys->rom_mapping);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -842,14 +841,6 @@ t1000_read_roml(uint32_t addr, void *priv)
|
||||
return(*(uint32_t *)(&sys->romdrive[sys->rom_offset + (addr & 0xffff)]));
|
||||
}
|
||||
|
||||
|
||||
const device_t *
|
||||
t1000_get_device(void)
|
||||
{
|
||||
return(&t1000_video_device);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_t1000_init(const machine_t *model)
|
||||
{
|
||||
@@ -858,7 +849,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/t1000/t1000.rom",
|
||||
ret = bios_load_linear("roms/machines/t1000/t1000.rom",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -870,7 +861,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
t1000.ems_port_index = 7; /* EMS disabled */
|
||||
|
||||
/* Load the T1000 CGA Font ROM. */
|
||||
loadfont(L"roms/machines/t1000/t1000font.rom", 2);
|
||||
loadfont("roms/machines/t1000/t1000font.bin", 2);
|
||||
|
||||
/*
|
||||
* The ROM drive is optional.
|
||||
@@ -878,7 +869,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
* If the file is missing, continue to boot; the BIOS will
|
||||
* complain 'No ROM drive' but boot normally from floppy.
|
||||
*/
|
||||
f = rom_fopen(L"roms/machines/t1000/t1000dos.rom", L"rb");
|
||||
f = rom_fopen("roms/machines/t1000/t1000dos.rom", "rb");
|
||||
if (f != NULL) {
|
||||
t1000.romdrive = malloc(T1000_ROMSIZE);
|
||||
if (t1000.romdrive) {
|
||||
@@ -890,7 +881,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
}
|
||||
mem_mapping_add(&t1000.rom_mapping, 0xa0000, 0x10000,
|
||||
t1000_read_rom,t1000_read_romw,t1000_read_roml,
|
||||
NULL,NULL,NULL, NULL, MEM_MAPPING_INTERNAL, &t1000);
|
||||
NULL,NULL,NULL, NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
mem_mapping_disable(&t1000.rom_mapping);
|
||||
|
||||
/* Map the EMS page frame */
|
||||
@@ -920,7 +911,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
t1000.fdc = device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
@@ -951,7 +942,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/t1200/t1200_019e.ic15.bin",
|
||||
ret = bios_load_linear("roms/machines/t1200/t1200_019e.ic15.bin",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
@@ -961,13 +952,13 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
t1000.is_t1200 = 1;
|
||||
t1000.ems_port_index = 7; /* EMS disabled */
|
||||
|
||||
/* Load the T1200 CGA Font ROM. */
|
||||
loadfont(L"roms/machines/t1200/t1000font.bin", 2);
|
||||
/* Load the T1000 CGA Font ROM. */
|
||||
loadfont("roms/machines/t1000/t1000font.bin", 2);
|
||||
|
||||
/* Map the EMS page frame */
|
||||
for (pg = 0; pg < 4; pg++) {
|
||||
mem_mapping_add(&t1000.mapping[pg],
|
||||
0xd0000 + (0x4000 * pg), 16384,
|
||||
mem_mapping_add(&t1000.mapping[pg],
|
||||
0xd0000 + (0x4000 * pg), 16384,
|
||||
ems_read_ram,ems_read_ramw,ems_read_raml,
|
||||
ems_write_ram,ems_write_ramw,ems_write_raml,
|
||||
NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
@@ -985,10 +976,10 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
mem_mapping_add(&t1000.nvr_mapping,
|
||||
0x000f0000, 2048,
|
||||
read_t1200_nvram, NULL, NULL,
|
||||
write_t1200_nvram, NULL, NULL,
|
||||
NULL, 0, &t1000);
|
||||
write_t1200_nvram, NULL, NULL,
|
||||
NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_device);
|
||||
t1000.fdc = device_add(&fdc_xt_t1x00_device);
|
||||
nmi_init();
|
||||
@@ -1021,7 +1012,7 @@ t1000_configsys_load(void)
|
||||
int size;
|
||||
|
||||
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("t1000_config.nvr"), "rb");
|
||||
if (f != NULL) {
|
||||
size = sizeof(t1000.t1000_nvram);
|
||||
if (fread(t1000.t1000_nvram, 1, size, f) != size)
|
||||
@@ -1037,7 +1028,7 @@ t1000_configsys_save(void)
|
||||
FILE *f;
|
||||
int size;
|
||||
|
||||
f = plat_fopen(nvr_path(L"t1000_config.nvr"), L"wb");
|
||||
f = plat_fopen(nvr_path("t1000_config.nvr"), "wb");
|
||||
if (f != NULL) {
|
||||
size = sizeof(t1000.t1000_nvram);
|
||||
if (fwrite(t1000.t1000_nvram, 1, size, f) != size)
|
||||
@@ -1054,7 +1045,7 @@ t1200_state_load(void)
|
||||
int size;
|
||||
|
||||
memset(t1000.t1200_nvram, 0, sizeof(t1000.t1200_nvram));
|
||||
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"rb");
|
||||
f = plat_fopen(nvr_path("t1200_state.nvr"), "rb");
|
||||
if (f != NULL) {
|
||||
size = sizeof(t1000.t1200_nvram);
|
||||
if (fread(t1000.t1200_nvram, 1, size, f) != size)
|
||||
@@ -1070,7 +1061,7 @@ t1200_state_save(void)
|
||||
FILE *f;
|
||||
int size;
|
||||
|
||||
f = plat_fopen(nvr_path(L"t1200_state.nvr"), L"wb");
|
||||
f = plat_fopen(nvr_path("t1200_state.nvr"), "wb");
|
||||
if (f != NULL) {
|
||||
size = sizeof(t1000.t1200_nvram);
|
||||
if (fwrite(t1000.t1200_nvram, 1, size, f) != size)
|
||||
@@ -1087,7 +1078,7 @@ t1000_emsboard_load(void)
|
||||
FILE *f;
|
||||
|
||||
if (mem_size > 512) {
|
||||
f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"rb");
|
||||
f = plat_fopen(nvr_path("t1000_ems.nvr"), "rb");
|
||||
if (f != NULL) {
|
||||
fread(&ram[512 * 1024], 1024, (mem_size - 512), f);
|
||||
fclose(f);
|
||||
@@ -1102,7 +1093,7 @@ t1000_emsboard_save(void)
|
||||
FILE *f;
|
||||
|
||||
if (mem_size > 512) {
|
||||
f = plat_fopen(nvr_path(L"t1000_ems.nvr"), L"wb");
|
||||
f = plat_fopen(nvr_path("t1000_ems.nvr"), "wb");
|
||||
if (f != NULL) {
|
||||
fwrite(&ram[512 * 1024], 1024, (mem_size - 512), f);
|
||||
fclose(f);
|
||||
|
||||
@@ -103,7 +103,7 @@ typedef struct t1000_t
|
||||
{
|
||||
mem_mapping_t mapping;
|
||||
|
||||
cga_t cga; /* The CGA is used for the external
|
||||
cga_t cga; /* The CGA is used for the external
|
||||
* display; most of its registers are
|
||||
* ignored by the plasma display. */
|
||||
|
||||
@@ -113,12 +113,13 @@ typedef struct t1000_t
|
||||
uint8_t attrmap; /* Attribute mapping register */
|
||||
|
||||
uint64_t dispontime, dispofftime;
|
||||
|
||||
|
||||
int linepos, displine;
|
||||
int vc;
|
||||
int dispon;
|
||||
int vsynctime;
|
||||
uint8_t video_options;
|
||||
uint8_t backlight, invert;
|
||||
|
||||
uint8_t *vram;
|
||||
} t1000_t;
|
||||
@@ -144,12 +145,12 @@ static void t1000_out(uint16_t addr, uint8_t val, void *p)
|
||||
case 0x3d1: case 0x3d3: case 0x3d5: case 0x3d7:
|
||||
/* Register 0x12 controls the attribute mappings for the
|
||||
* LCD screen. */
|
||||
if (t1000->cga.crtcreg == 0x12)
|
||||
if (t1000->cga.crtcreg == 0x12)
|
||||
{
|
||||
t1000->attrmap = val;
|
||||
t1000->attrmap = val;
|
||||
t1000_recalcattrs(t1000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
cga_out(addr, val, &t1000->cga);
|
||||
|
||||
t1000_recalctimings(t1000);
|
||||
@@ -181,7 +182,7 @@ static uint8_t t1000_in(uint16_t addr, void *p)
|
||||
return val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return cga_in(addr, &t1000->cga);
|
||||
}
|
||||
|
||||
@@ -191,17 +192,15 @@ static uint8_t t1000_in(uint16_t addr, void *p)
|
||||
static void t1000_write(uint32_t addr, uint8_t val, void *p)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *)p;
|
||||
egawrites++;
|
||||
|
||||
t1000->vram[addr & 0x3fff] = val;
|
||||
sub_cycles(4);
|
||||
cycles -= 4;
|
||||
}
|
||||
|
||||
|
||||
static uint8_t t1000_read(uint32_t addr, void *p)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *)p;
|
||||
egareads++;
|
||||
sub_cycles(4);
|
||||
cycles -= 4;
|
||||
|
||||
return t1000->vram[addr & 0x3fff];
|
||||
}
|
||||
@@ -272,8 +271,8 @@ static void t1000_text_row80(t1000_t *t1000)
|
||||
|
||||
if (t1000->cga.cgamode & 0x20) /* Blink */
|
||||
{
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink) cols[1] = cols[0];
|
||||
}
|
||||
else
|
||||
@@ -344,8 +343,8 @@ static void t1000_text_row40(t1000_t *t1000)
|
||||
|
||||
if (t1000->cga.cgamode & 0x20) /* Blink */
|
||||
{
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
cols[1] = blinkcols[attr][1];
|
||||
cols[0] = blinkcols[attr][0];
|
||||
if (blink) cols[1] = cols[0];
|
||||
}
|
||||
else
|
||||
@@ -357,7 +356,7 @@ static void t1000_text_row40(t1000_t *t1000)
|
||||
{
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2 + 1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0] ^ (blue ^ grey);
|
||||
}
|
||||
}
|
||||
@@ -365,7 +364,7 @@ static void t1000_text_row40(t1000_t *t1000)
|
||||
{
|
||||
for (c = 0; c < 8; c++)
|
||||
{
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2] =
|
||||
((uint32_t *)buffer32->line[t1000->displine])[(x << 4) + c*2+1] = cols[(fontdat[bold][sc] & (1 << (c ^ 7))) ? 1 : 0];
|
||||
}
|
||||
}
|
||||
@@ -433,7 +432,7 @@ static void t1000_cgaline4(t1000_t *t1000)
|
||||
{
|
||||
default:
|
||||
case 0: ink0 = ink1 = grey; break;
|
||||
case 1: if (t1000->displine & 1)
|
||||
case 1: if (t1000->displine & 1)
|
||||
{
|
||||
ink0 = grey; ink1 = grey;
|
||||
}
|
||||
@@ -442,7 +441,7 @@ static void t1000_cgaline4(t1000_t *t1000)
|
||||
ink0 = blue; ink1 = grey;
|
||||
}
|
||||
break;
|
||||
case 2: if (t1000->displine & 1)
|
||||
case 2: if (t1000->displine & 1)
|
||||
{
|
||||
ink0 = grey; ink1 = blue;
|
||||
}
|
||||
@@ -473,10 +472,10 @@ static void t1000_poll(void *p)
|
||||
|
||||
/* Set the font used for the external display */
|
||||
t1000->cga.fontbase = ((t1000->video_options & 3) * 256);
|
||||
|
||||
|
||||
if (t1000->enabled) /* Disable internal chipset */
|
||||
mem_mapping_enable(&t1000->mapping);
|
||||
else
|
||||
else
|
||||
mem_mapping_disable(&t1000->mapping);
|
||||
}
|
||||
/* Switch between internal plasma and external CRT display. */
|
||||
@@ -504,20 +503,20 @@ static void t1000_poll(void *p)
|
||||
}
|
||||
|
||||
/* Graphics */
|
||||
if (t1000->cga.cgamode & 0x02)
|
||||
if (t1000->cga.cgamode & 0x02)
|
||||
{
|
||||
if (t1000->cga.cgamode & 0x10)
|
||||
t1000_cgaline6(t1000);
|
||||
else t1000_cgaline4(t1000);
|
||||
}
|
||||
else
|
||||
else
|
||||
if (t1000->cga.cgamode & 0x01) /* High-res text */
|
||||
{
|
||||
t1000_text_row80(t1000);
|
||||
t1000_text_row80(t1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
t1000_text_row40(t1000);
|
||||
t1000_text_row40(t1000);
|
||||
}
|
||||
}
|
||||
t1000->displine++;
|
||||
@@ -557,14 +556,14 @@ static void t1000_poll(void *p)
|
||||
if (video_force_resize_get())
|
||||
video_force_resize_set(0);
|
||||
}
|
||||
video_blit_memtoscreen(0, 0, 0, ysize, xsize, ysize);
|
||||
video_blit_memtoscreen(0, 0, xsize, ysize);
|
||||
|
||||
frames++;
|
||||
/* Fixed 640x200 resolution */
|
||||
video_res_x = T1000_XSIZE;
|
||||
video_res_y = T1000_YSIZE;
|
||||
|
||||
if (t1000->cga.cgamode & 0x02)
|
||||
if (t1000->cga.cgamode & 0x02)
|
||||
{
|
||||
if (t1000->cga.cgamode & 0x10)
|
||||
video_bpp = 1;
|
||||
@@ -582,28 +581,43 @@ static void t1000_recalcattrs(t1000_t *t1000)
|
||||
int n;
|
||||
|
||||
/* val behaves as follows:
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 0: Attributes 01-06, 08-0E are inverse video
|
||||
* Bit 1: Attributes 01-06, 08-0E are bold
|
||||
* Bit 2: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are inverse video
|
||||
* are inverse video
|
||||
* Bit 3: Attributes 11-16, 18-1F, 21-26, 28-2F ... F1-F6, F8-FF
|
||||
* are bold */
|
||||
|
||||
/* Set up colours */
|
||||
blue = makecol(0x2D, 0x39, 0x5A);
|
||||
grey = makecol(0x85, 0xa0, 0xD6);
|
||||
if (t1000->invert) {
|
||||
if (t1000->backlight) {
|
||||
grey = makecol(0x2D, 0x39, 0x5A);
|
||||
blue = makecol(0x85, 0xa0, 0xD6);
|
||||
} else {
|
||||
grey = makecol(0x0f, 0x21, 0x3f);
|
||||
blue = makecol(0x1C, 0x71, 0x31);
|
||||
}
|
||||
} else {
|
||||
if (t1000->backlight) {
|
||||
blue = makecol(0x2D, 0x39, 0x5A);
|
||||
grey = makecol(0x85, 0xa0, 0xD6);
|
||||
} else {
|
||||
blue = makecol(0x0f, 0x21, 0x3f);
|
||||
grey = makecol(0x1C, 0x71, 0x31);
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialise the attribute mapping. Start by defaulting everything
|
||||
* to grey on blue, and with bold set by bit 3 */
|
||||
for (n = 0; n < 256; n++)
|
||||
{
|
||||
boldcols[n] = (n & 8) != 0;
|
||||
blinkcols[n][0] = normcols[n][0] = blue;
|
||||
blinkcols[n][0] = normcols[n][0] = blue;
|
||||
blinkcols[n][1] = normcols[n][1] = grey;
|
||||
}
|
||||
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always grey on
|
||||
/* Colours 0x11-0xFF are controlled by bits 2 and 3 of the
|
||||
* passed value. Exclude x0 and x8, which are always grey on
|
||||
* blue. */
|
||||
for (n = 0x11; n <= 0xFF; n++)
|
||||
{
|
||||
@@ -620,7 +634,7 @@ static void t1000_recalcattrs(t1000_t *t1000)
|
||||
}
|
||||
if (t1000->attrmap & 8) boldcols[n] = 1; /* Bold */
|
||||
}
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
/* Set up the 01-0E range, controlled by bits 0 and 1 of the
|
||||
* passed value. When blinking is enabled this also affects 81-8E. */
|
||||
for (n = 0x01; n <= 0x0E; n++)
|
||||
{
|
||||
@@ -641,7 +655,7 @@ static void t1000_recalcattrs(t1000_t *t1000)
|
||||
}
|
||||
if (t1000->attrmap & 2) boldcols[n] = 1;
|
||||
}
|
||||
/* Colours 07 and 0F are always blue on grey. If blinking is
|
||||
/* Colours 07 and 0F are always blue on grey. If blinking is
|
||||
* enabled so are 87 and 8F. */
|
||||
for (n = 0x07; n <= 0x0F; n += 8)
|
||||
{
|
||||
@@ -678,12 +692,15 @@ static void *t1000_init(const device_t *info)
|
||||
{
|
||||
t1000_t *t1000 = malloc(sizeof(t1000_t));
|
||||
memset(t1000, 0, sizeof(t1000_t));
|
||||
loadfont(L"roms/machines/t1000/t1000font.bin", 8);
|
||||
loadfont("roms/machines/t1000/t1000font.bin", 8);
|
||||
cga_init(&t1000->cga);
|
||||
video_inform(VIDEO_FLAG_TYPE_CGA, &timing_t1000);
|
||||
|
||||
t1000->internal = 1;
|
||||
|
||||
t1000->backlight = device_get_config_int("backlight");
|
||||
t1000->invert = device_get_config_int("invert");
|
||||
|
||||
/* 16k video RAM */
|
||||
t1000->vram = malloc(0x4000);
|
||||
|
||||
@@ -719,52 +736,62 @@ static void t1000_close(void *p)
|
||||
static void t1000_speed_changed(void *p)
|
||||
{
|
||||
t1000_t *t1000 = (t1000_t *)p;
|
||||
|
||||
|
||||
t1000_recalctimings(t1000);
|
||||
}
|
||||
|
||||
static const device_config_t t1000_config[] =
|
||||
{
|
||||
{
|
||||
.name = "display_language",
|
||||
.description = "Language",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "USA",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "Danish",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.type = -1
|
||||
}
|
||||
static const device_config_t t1000_config[] = {
|
||||
{
|
||||
.name = "display_language",
|
||||
.description = "Language",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection = {
|
||||
{ .description = "USA", .value = 0 },
|
||||
{ .description = "Danish", .value = 1 }
|
||||
},
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "backlight",
|
||||
.description = "Enable backlight",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "invert",
|
||||
.description = "Invert colors",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_int = 0
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
const device_t t1000_video_device = {
|
||||
"Toshiba T1000 Video",
|
||||
0, 0,
|
||||
t1000_init, t1000_close, NULL,
|
||||
NULL,
|
||||
t1000_speed_changed,
|
||||
NULL,
|
||||
t1000_config
|
||||
.name = "Toshiba T1000 Video",
|
||||
.internal_name = "t1000_video",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = t1000_init,
|
||||
.close = t1000_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = t1000_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = t1000_config
|
||||
};
|
||||
|
||||
|
||||
const device_t t1200_video_device = {
|
||||
"Toshiba T1200 Video",
|
||||
0, 0,
|
||||
t1000_init, t1000_close, NULL,
|
||||
NULL,
|
||||
t1000_speed_changed,
|
||||
NULL,
|
||||
t1000_config
|
||||
.name = "Toshiba T1200 Video",
|
||||
.internal_name = "t1200_video",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = t1000_init,
|
||||
.close = t1000_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = t1000_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = t1000_config
|
||||
};
|
||||
|
||||
@@ -11,13 +11,16 @@
|
||||
#include <86box/device.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/nmi.h>
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/flash.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/port_6x.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include "cpu.h"
|
||||
@@ -72,97 +75,126 @@ xi8088_bios_128kb(void)
|
||||
static void *
|
||||
xi8088_init(const device_t *info)
|
||||
{
|
||||
/* even though the bios by default turns the turbo off when controlling by hotkeys, pcem always starts at full speed */
|
||||
xi8088.turbo = 1;
|
||||
xi8088.turbo_setting = device_get_config_int("turbo_setting");
|
||||
xi8088.bios_128kb = device_get_config_int("bios_128kb");
|
||||
|
||||
mem_set_mem_state(0x0a0000, 0x20000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
mem_set_mem_state(0x0c0000, 0x08000, device_get_config_int("umb_c0000h_c7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0c8000, 0x08000, device_get_config_int("umb_c8000h_cffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0d0000, 0x08000, device_get_config_int("umb_d0000h_d7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0d8000, 0x08000, device_get_config_int("umb_d8000h_dffff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0e0000, 0x08000, device_get_config_int("umb_e0000h_e7fff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0e8000, 0x08000, device_get_config_int("umb_e8000h_effff") ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0x0f0000, 0x10000, MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
|
||||
return &xi8088;
|
||||
}
|
||||
|
||||
|
||||
static const device_config_t xi8088_config[] =
|
||||
{
|
||||
{
|
||||
.name = "turbo_setting",
|
||||
.description = "Turbo",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "Always at selected speed",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "Hotkeys (starts off)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
.default_int = 0
|
||||
static const device_config_t xi8088_config[] = {
|
||||
{
|
||||
.name = "turbo_setting",
|
||||
.description = "Turbo",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection = {
|
||||
{
|
||||
.description = "Always at selected speed",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "BIOS setting + Hotkeys (off during POST)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
.name = "bios_128kb",
|
||||
.description = "BIOS size",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection =
|
||||
{
|
||||
{
|
||||
.description = "64KB",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "128KB",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
.default_int = 1
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "bios_128kb",
|
||||
.description = "BIOS size",
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection = {
|
||||
{
|
||||
.description = "64KB starting from 0xF0000",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "128KB starting from 0xE0000 (address MSB inverted, last 64KB first)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
{
|
||||
.type = -1
|
||||
}
|
||||
.default_int = 1
|
||||
},
|
||||
{
|
||||
.name = "umb_c0000h_c7fff",
|
||||
.description = "Map 0xc0000-0xc7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_c8000h_cffff",
|
||||
.description = "Map 0xc8000-0xcffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_d0000h_d7fff",
|
||||
.description = "Map 0xd0000-0xd7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_d8000h_dffff",
|
||||
.description = "Map 0xd8000-0xdffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_e0000h_e7fff",
|
||||
.description = "Map 0xe0000-0xe7fff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{
|
||||
.name = "umb_e8000h_effff",
|
||||
.description = "Map 0xe8000-0xeffff as UMB",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_int = 0
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
|
||||
const device_t xi8088_device =
|
||||
{
|
||||
"Xi8088",
|
||||
0,
|
||||
0,
|
||||
xi8088_init,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
xi8088_config
|
||||
const device_t xi8088_device = {
|
||||
.name = "Xi8088",
|
||||
.internal_name = "xi8088",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = xi8088_init,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = xi8088_config
|
||||
};
|
||||
|
||||
|
||||
const device_t *
|
||||
xi8088_get_device(void)
|
||||
{
|
||||
return &xi8088_device;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
machine_xt_xi8088_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (bios_only) {
|
||||
ret = bios_load_linear_inverted(L"roms/machines/xi8088/bios-xi8088-128k.bin",
|
||||
ret = bios_load_linear_inverted("roms/machines/xi8088/bios-xi8088-128k.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
ret |= bios_load_linear(L"roms/machines/xi8088/bios-xi8088.bin",
|
||||
ret |= bios_load_linear("roms/machines/xi8088/bios-xi8088.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
} else {
|
||||
device_add(&xi8088_device);
|
||||
|
||||
if (xi8088_bios_128kb()) {
|
||||
ret = bios_load_linear_inverted(L"roms/machines/xi8088/bios-xi8088-128k.bin",
|
||||
ret = bios_load_linear_inverted("roms/machines/xi8088/bios-xi8088-128k.bin",
|
||||
0x000e0000, 131072, 0);
|
||||
} else {
|
||||
ret = bios_load_linear(L"roms/machines/xi8088/bios-xi8088.bin",
|
||||
ret = bios_load_linear("roms/machines/xi8088/bios-xi8088.bin",
|
||||
0x000f0000, 65536, 0);
|
||||
}
|
||||
}
|
||||
@@ -170,15 +202,18 @@ machine_xt_xi8088_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
/* TODO: set UMBs? See if PCem always sets when we have > 640KB ram and avoids conflicts when a peripheral uses the same memory space */
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_ps2_xi8088_device);
|
||||
device_add(&port_6x_xi8088_device);
|
||||
nmi_init();
|
||||
device_add(&ibmat_nvr_device);
|
||||
pic2_init();
|
||||
if (joystick_type != JOYSTICK_TYPE_NONE)
|
||||
device_add(&gameport_device);
|
||||
standalone_gameport_type = &gameport_device;
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* TheCollector1995, <mariogplayer@gmail.com>
|
||||
* EngiNerd <webmaster.crrc@yahoo.it>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2020 EngiNerd.
|
||||
*/
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
@@ -42,6 +44,8 @@
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/serial.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/vid_cga.h>
|
||||
|
||||
|
||||
typedef struct {
|
||||
@@ -72,20 +76,20 @@ zenith_scratchpad_init(const device_t *info)
|
||||
zenith_t *dev;
|
||||
|
||||
dev = (zenith_t *)malloc(sizeof(zenith_t));
|
||||
memset(dev, 0x00, sizeof(zenith_t));
|
||||
|
||||
memset(dev, 0x00, sizeof(zenith_t));
|
||||
|
||||
dev->scratchpad_ram = malloc(0x4000);
|
||||
|
||||
|
||||
mem_mapping_add(&dev->scratchpad_mapping, 0xf0000, 0x4000,
|
||||
zenith_scratchpad_read, NULL, NULL,
|
||||
zenith_scratchpad_write, NULL, NULL,
|
||||
dev->scratchpad_ram, MEM_MAPPING_EXTERNAL, dev);
|
||||
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
static void
|
||||
zenith_scratchpad_close(void *p)
|
||||
{
|
||||
zenith_t *dev = (zenith_t *)p;
|
||||
@@ -94,42 +98,106 @@ zenith_scratchpad_close(void *p)
|
||||
free(dev);
|
||||
}
|
||||
|
||||
|
||||
static const device_t zenith_scratchpad_device = {
|
||||
"Zenith scratchpad RAM",
|
||||
0, 0,
|
||||
zenith_scratchpad_init, zenith_scratchpad_close, NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
.name = "Zenith scratchpad RAM",
|
||||
.internal_name = "zenith_scratchpad",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = zenith_scratchpad_init,
|
||||
.close = zenith_scratchpad_close,
|
||||
.reset = NULL,
|
||||
{ .available = NULL },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
void
|
||||
machine_zenith_init(const machine_t *model){
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
device_add(&zenith_scratchpad_device);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_zenith_device);
|
||||
|
||||
nmi_init();
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Current bugs and limitations:
|
||||
* - missing NVRAM implementation
|
||||
*/
|
||||
int
|
||||
machine_xt_zenith_init(const machine_t *model)
|
||||
{
|
||||
machine_xt_z184_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear(L"roms/machines/zdsupers/z184m v3.1d.10d",
|
||||
ret = bios_load_linear("roms/machines/zdsupers/z184m v3.1d.10d",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
machine_common_init(model);
|
||||
|
||||
if (fdc_type == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt2_remove();
|
||||
lpt1_init(0x278);
|
||||
device_add(&i8250_device);
|
||||
serial_set_next_inst(2); /* So that serial_standalone_init() won't do anything. */
|
||||
device_add(&zenith_scratchpad_device);
|
||||
pit_ctr_set_out_func(&pit->counters[1], pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
nmi_init();
|
||||
device_add(&ns8250_device);
|
||||
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
|
||||
|
||||
device_add(&cga_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_xt_z151_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
ret = bios_load_linear("roms/machines/zdsz151/444-229-18.bin",
|
||||
0x000fc000, 32768, 0);
|
||||
if (ret) {
|
||||
bios_load_aux_linear("roms/machines/zdsz151/444-260-18.bin",
|
||||
0x000f8000, 16384, 0);
|
||||
}
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Current bugs and limitations:
|
||||
* - Memory board support for EMS currently missing
|
||||
*/
|
||||
int
|
||||
machine_xt_z159_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/zdsz159/z159m v2.9e.10d",
|
||||
0x000f8000, 32768, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_zenith_init(model);
|
||||
|
||||
/* parallel port is on the memory board */
|
||||
lpt1_remove(); /* only one parallel port */
|
||||
lpt2_remove();
|
||||
lpt1_init(0x278);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <86box/86box.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/timer.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/cartridge.h>
|
||||
#include <86box/dma.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
@@ -34,14 +36,16 @@
|
||||
#include <86box/rom.h>
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/serial.h>
|
||||
#include <86box/gameport.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/video.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/isamem.h>
|
||||
|
||||
|
||||
int bios_only = 0;
|
||||
int machine;
|
||||
int AT, PCI;
|
||||
// int AT, PCI;
|
||||
|
||||
|
||||
#ifdef ENABLE_MACHINE_LOG
|
||||
@@ -71,18 +75,39 @@ machine_init_ex(int m)
|
||||
int ret = 0;
|
||||
|
||||
if (!bios_only) {
|
||||
machine_log("Initializing as \"%s\"\n", machine_getname_ex(m));
|
||||
machine_log("Initializing as \"%s\"\n", machine_getname());
|
||||
|
||||
is_vpc = 0;
|
||||
standalone_gameport_type = NULL;
|
||||
gameport_instance_id = 0;
|
||||
|
||||
/* Set up the architecture flags. */
|
||||
AT = IS_ARCH(machine, MACHINE_AT);
|
||||
PCI = IS_ARCH(machine, MACHINE_PCI);
|
||||
// AT = IS_AT(machine);
|
||||
// PCI = IS_ARCH(machine, MACHINE_BUS_PCI);
|
||||
|
||||
/* Resize the memory. */
|
||||
cpu_set();
|
||||
pc_speed_changed();
|
||||
|
||||
/* Reset the memory state. */
|
||||
mem_reset();
|
||||
smbase = is_am486dxl ? 0x00060000 : 0x00030000;
|
||||
|
||||
lpt_init();
|
||||
|
||||
smbase = 0x30000;
|
||||
if (cassette_enable)
|
||||
device_add(&cassette_device);
|
||||
|
||||
cart_reset();
|
||||
|
||||
/* Prepare some video-related things if we're using internal
|
||||
or no video. */
|
||||
video_pre_reset(gfxcard);
|
||||
|
||||
/* Reset any ISA memory cards. */
|
||||
isamem_reset();
|
||||
|
||||
/* Reset the fast off stuff. */
|
||||
cpu_fast_off_reset();
|
||||
}
|
||||
|
||||
/* All good, boot the machine! */
|
||||
@@ -92,6 +117,14 @@ machine_init_ex(int m)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
if (gfxcard != VID_NONE) {
|
||||
if (ibm8514_enabled) {
|
||||
ibm8514_device_add();
|
||||
}
|
||||
if (xga_enabled)
|
||||
xga_device_add();
|
||||
}
|
||||
|
||||
/* Reset the graphics card (or do nothing if it was already done
|
||||
by the machine's init function). */
|
||||
video_reset(gfxcard);
|
||||
@@ -112,15 +145,32 @@ int
|
||||
machine_available(int m)
|
||||
{
|
||||
int ret;
|
||||
device_t *d = (device_t *) machine_getdevice(m);
|
||||
|
||||
bios_only = 1;
|
||||
ret = machine_init_ex(m);
|
||||
|
||||
ret = device_available(d);
|
||||
/* Do not check via machine_init_ex() if the device is not NULL and
|
||||
it has a CONFIG_BIOS field. */
|
||||
if ((d == NULL) || (ret != -1))
|
||||
ret = machine_init_ex(m);
|
||||
|
||||
bios_only = 0;
|
||||
return ret;
|
||||
|
||||
return !!ret;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pit_irq0_timer(int new_out, int old_out)
|
||||
{
|
||||
if (new_out && !old_out)
|
||||
picint(1);
|
||||
|
||||
if (!new_out)
|
||||
picintc(1);
|
||||
}
|
||||
|
||||
void
|
||||
machine_common_init(const machine_t *model)
|
||||
{
|
||||
@@ -128,7 +178,10 @@ machine_common_init(const machine_t *model)
|
||||
pic_init();
|
||||
dma_init();
|
||||
|
||||
cpu_set();
|
||||
int pit_type = IS_AT(machine) ? PIT_8254 : PIT_8253;
|
||||
/* Select fast PIT if needed */
|
||||
if ((pit_mode == -1 && is486) || pit_mode == 1)
|
||||
pit_type += 2;
|
||||
|
||||
pit_common_init(!!AT, pit_irq0_timer, NULL);
|
||||
pit_common_init(pit_type, pit_irq0_timer, NULL);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user