Fixed the PCjr - now works even if the emulator is started set to it, and keyboard works fine.

This commit is contained in:
OBattler
2018-11-02 11:35:56 +01:00
parent 58c827a9e8
commit 07cbe9a017

View File

@@ -8,7 +8,7 @@
* *
* Emulation of the IBM PCjr. * Emulation of the IBM PCjr.
* *
* Version: @(#)m_pcjr.c 1.0.9 2018/09/19 * Version: @(#)m_pcjr.c 1.0.10 2018/11/02
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -27,6 +27,7 @@
#include <wchar.h> #include <wchar.h>
#define HAVE_STDARG_H #define HAVE_STDARG_H
#include "../86box.h" #include "../86box.h"
#include "../cpu/cpu.h"
#include "../io.h" #include "../io.h"
#include "../nmi.h" #include "../nmi.h"
#include "../pic.h" #include "../pic.h"
@@ -749,6 +750,12 @@ machine_pcjr_init(const machine_t *model)
pit_init(); pit_init();
pit_set_out_func(&pit, 0, pit_irq0_timer_pcjr); pit_set_out_func(&pit, 0, pit_irq0_timer_pcjr);
cpu_set();
if (machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].cpu_type >= CPU_286)
setrtcconst(machines[machine].cpu[cpu_manufacturer].cpus[cpu_effective].rspeed);
else
setrtcconst(14318184.0);
if (serial_enabled[0]) if (serial_enabled[0])
serial_setup(1, 0x2f8, 3); serial_setup(1, 0x2f8, 3);
@@ -763,6 +770,7 @@ machine_pcjr_init(const machine_t *model)
device_add_ex(&pcjr_device, pcjr); device_add_ex(&pcjr_device, pcjr);
/* Initialize the keyboard. */ /* Initialize the keyboard. */
keyboard_scan = 1;
key_queue_start = key_queue_end = 0; key_queue_start = key_queue_end = 0;
io_sethandler(0x0060, 4, io_sethandler(0x0060, 4,
kbd_read, NULL, NULL, kbd_write, NULL, NULL, pcjr); kbd_read, NULL, NULL, kbd_write, NULL, NULL, pcjr);