2021-09-06 23:12:01 +02:00
|
|
|
/*
|
2022-11-13 16:37:58 -05:00
|
|
|
* 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.
|
2021-09-06 23:12:01 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* This file is part of the 86Box distribution.
|
2021-09-06 23:12:01 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* Victor V86P portable computer emulation.
|
2021-09-06 23:12:01 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* Authors: Lubomir Rintel, <lkundrak@v3.sk>
|
2021-09-06 23:12:01 +02:00
|
|
|
*
|
2022-11-13 16:37:58 -05:00
|
|
|
* Copyright 2021 Lubomir Rintel.
|
2021-09-06 23:12:01 +02:00
|
|
|
*
|
|
|
|
|
* 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
|
2022-11-13 16:37:58 -05:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2021-09-06 23:12:01 +02:00
|
|
|
* 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>
|
2022-10-24 23:06:25 +02:00
|
|
|
#include <86box/hdc.h>
|
2021-09-06 23:12:01 +02:00
|
|
|
#include <86box/keyboard.h>
|
2021-09-07 23:41:17 +02:00
|
|
|
#include <86box/chipset.h>
|
2021-09-06 23:12:01 +02:00
|
|
|
#include <86box/sio.h>
|
|
|
|
|
#include <86box/video.h>
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
machine_v86p_init(const machine_t *model)
|
|
|
|
|
{
|
2023-05-11 03:02:36 -04:00
|
|
|
int ret;
|
2023-06-09 23:46:54 -04:00
|
|
|
int rom_id = 0;
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
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);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
if (!ret) {
|
|
|
|
|
/* Try an older version of the BIOS. */
|
2023-06-09 23:46:54 -04:00
|
|
|
rom_id = 1;
|
2022-07-27 15:17:53 -04:00
|
|
|
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);
|
|
|
|
|
}
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
if (!ret) {
|
|
|
|
|
/* Try JVERNET's BIOS. */
|
2023-06-09 23:46:54 -04:00
|
|
|
rom_id = 2;
|
2022-07-27 15:17:53 -04:00
|
|
|
ret = bios_load_linear("roms/machines/v86p/V86P.ROM",
|
|
|
|
|
0x000f0000, 65536, 0);
|
|
|
|
|
}
|
2021-09-07 23:57:26 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
if (bios_only || !ret)
|
|
|
|
|
return ret;
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2023-06-09 23:46:54 -04:00
|
|
|
if (rom_id == 2)
|
2022-07-27 15:17:53 -04:00
|
|
|
loadfont("roms/machines/v86p/V86P.FON", 8);
|
|
|
|
|
else
|
|
|
|
|
loadfont("roms/machines/v86p/v86pfont.rom", 8);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
machine_common_init(model);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
device_add(&ct_82c100_device);
|
|
|
|
|
device_add(&f82c606_device);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
device_add(&keyboard_xt_device);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2024-07-20 01:14:35 -04:00
|
|
|
if (fdc_current[0] == FDC_INTERNAL)
|
2022-07-27 15:17:53 -04:00
|
|
|
device_add(&fdc_xt_device);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2023-02-06 04:12:46 -05:00
|
|
|
if (gfxcard[0] == VID_INTERNAL)
|
2022-07-27 15:17:53 -04:00
|
|
|
device_add(&f82c425_video_device);
|
2021-09-06 23:12:01 +02:00
|
|
|
|
2024-07-08 00:40:52 -04:00
|
|
|
if (hdc_current <= HDC_INTERNAL)
|
2022-10-24 23:06:25 +02:00
|
|
|
device_add(&st506_xt_victor_v86p_device);
|
|
|
|
|
|
2022-07-27 15:17:53 -04:00
|
|
|
return ret;
|
2021-09-06 23:12:01 +02:00
|
|
|
}
|