Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
commit
a03d0f0461
@ -64,6 +64,7 @@ option(MUNT "MUNT" ON)
|
|||||||
option(VRAMDUMP "Video RAM dumping" OFF)
|
option(VRAMDUMP "Video RAM dumping" OFF)
|
||||||
option(DINPUT "DirectInput" OFF)
|
option(DINPUT "DirectInput" OFF)
|
||||||
option(DISCORD "Discord integration" ON)
|
option(DISCORD "Discord integration" ON)
|
||||||
|
option(CPPTHREADS "C++11 threads" ON)
|
||||||
|
|
||||||
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
|
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
|
||||||
|
|
||||||
|
@ -92,7 +92,6 @@
|
|||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/version.h>
|
#include <86box/version.h>
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,11 @@ endif()
|
|||||||
# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon
|
# MACOSX_BUNDLE prepares a macOS application bundle including with the app icon
|
||||||
add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
add_executable(86Box WIN32 MACOSX_BUNDLE 86box.c config.c log.c random.c timer.c io.c acpi.c apm.c
|
||||||
dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c
|
dma.c ddma.c nmi.c pic.c pit.c port_6x.c port_92.c ppi.c pci.c mca.c usb.c
|
||||||
device.c nvr.c nvr_at.c nvr_ps2.c rtmidi_midi.cpp ${APP_ICON_MACOSX})
|
device.c nvr.c nvr_at.c nvr_ps2.c ${APP_ICON_MACOSX})
|
||||||
|
|
||||||
|
if(CPPTHREADS)
|
||||||
|
target_sources(86Box PRIVATE thread.cpp)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
target_link_libraries(86Box "-framework AppKit")
|
target_link_libraries(86Box "-framework AppKit")
|
||||||
|
13
src/config.c
13
src/config.c
@ -64,7 +64,6 @@
|
|||||||
#include <86box/snd_mpu401.h>
|
#include <86box/snd_mpu401.h>
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/plat_dir.h>
|
#include <86box/plat_dir.h>
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
|
|
||||||
@ -831,9 +830,9 @@ load_machine(void)
|
|||||||
|
|
||||||
mem_size = config_get_int(cat, "mem_size", 64);
|
mem_size = config_get_int(cat, "mem_size", 64);
|
||||||
#if 0
|
#if 0
|
||||||
if (mem_size < (((machines[machine].flags & MACHINE_AT) &&
|
if (mem_size < ((machine_has_bus(machine, MACHINE_AT) &&
|
||||||
(machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram))
|
(machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram))
|
||||||
mem_size = (((machines[machine].flags & MACHINE_AT) && (machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram);
|
mem_size = (((machine_has_bus(machine, MACHINE_AT) && (machines[machine].ram_granularity < 128)) ? machines[machine].min_ram*1024 : machines[machine].min_ram);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (mem_size > 2097152)
|
if (mem_size > 2097152)
|
||||||
@ -874,13 +873,13 @@ load_video(void)
|
|||||||
char *p;
|
char *p;
|
||||||
int free_p = 0;
|
int free_p = 0;
|
||||||
|
|
||||||
if (machines[machine].flags & MACHINE_VIDEO_ONLY) {
|
if (machine_has_flags(machine, MACHINE_VIDEO_ONLY)) {
|
||||||
config_delete_var(cat, "gfxcard");
|
config_delete_var(cat, "gfxcard");
|
||||||
gfxcard = VID_INTERNAL;
|
gfxcard = VID_INTERNAL;
|
||||||
} else {
|
} else {
|
||||||
p = config_get_string(cat, "gfxcard", NULL);
|
p = config_get_string(cat, "gfxcard", NULL);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
if (machines[machine].flags & MACHINE_VIDEO) {
|
if (machine_has_flags(machine, MACHINE_VIDEO)) {
|
||||||
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
||||||
strcpy(p, "internal");
|
strcpy(p, "internal");
|
||||||
} else {
|
} else {
|
||||||
@ -1120,7 +1119,7 @@ load_storage_controllers(void)
|
|||||||
|
|
||||||
p = config_get_string(cat, "hdc", NULL);
|
p = config_get_string(cat, "hdc", NULL);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
if (machines[machine].flags & MACHINE_HDC) {
|
if (machine_has_flags(machine, MACHINE_HDC)) {
|
||||||
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
||||||
strcpy(p, "internal");
|
strcpy(p, "internal");
|
||||||
} else {
|
} else {
|
||||||
@ -1948,7 +1947,7 @@ load_other_peripherals(void)
|
|||||||
|
|
||||||
p = config_get_string(cat, "hdc", NULL);
|
p = config_get_string(cat, "hdc", NULL);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
if (machines[machine].flags & MACHINE_HDC) {
|
if (machine_has_flags(machine, MACHINE_HDC)) {
|
||||||
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
p = (char *)malloc((strlen("internal")+1)*sizeof(char));
|
||||||
strcpy(p, "internal");
|
strcpy(p, "internal");
|
||||||
} else {
|
} else {
|
||||||
|
22
src/device.c
22
src/device.c
@ -646,29 +646,29 @@ device_set_config_mac(const char *s, int val)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
device_is_valid(const device_t *device, int mflags)
|
device_is_valid(const device_t *device, int m)
|
||||||
{
|
{
|
||||||
if (device == NULL) return(1);
|
if (device == NULL) return(1);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_AT) && !(mflags & MACHINE_BUS_ISA16)) return(0);
|
if ((device->flags & DEVICE_AT) && !machine_has_bus(m, MACHINE_BUS_ISA16)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_CBUS) && !(mflags & MACHINE_BUS_CBUS)) return(0);
|
if ((device->flags & DEVICE_CBUS) && !machine_has_bus(m, MACHINE_BUS_CBUS)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_ISA) && !(mflags & MACHINE_BUS_ISA)) return(0);
|
if ((device->flags & DEVICE_ISA) && !machine_has_bus(m, MACHINE_BUS_ISA)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_MCA) && !(mflags & MACHINE_BUS_MCA)) return(0);
|
if ((device->flags & DEVICE_MCA) && !machine_has_bus(m, MACHINE_BUS_MCA)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_EISA) && !(mflags & MACHINE_BUS_EISA)) return(0);
|
if ((device->flags & DEVICE_EISA) && !machine_has_bus(m, MACHINE_BUS_EISA)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_VLB) && !(mflags & MACHINE_BUS_VLB)) return(0);
|
if ((device->flags & DEVICE_VLB) && !machine_has_bus(m, MACHINE_BUS_VLB)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_PCI) && !(mflags & MACHINE_BUS_PCI)) return(0);
|
if ((device->flags & DEVICE_PCI) && !machine_has_bus(m, MACHINE_BUS_PCI)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_AGP) && !(mflags & MACHINE_BUS_AGP)) return(0);
|
if ((device->flags & DEVICE_AGP) && !machine_has_bus(m, MACHINE_BUS_AGP)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_PS2) && !(mflags & MACHINE_BUS_PS2)) return(0);
|
if ((device->flags & DEVICE_PS2) && !machine_has_bus(m, MACHINE_BUS_PS2)) return(0);
|
||||||
|
|
||||||
if ((device->flags & DEVICE_AC97) && !(mflags & MACHINE_BUS_AC97)) return(0);
|
if ((device->flags & DEVICE_AC97) && !machine_has_bus(m, MACHINE_BUS_AC97)) return(0);
|
||||||
|
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ cart_reset(void)
|
|||||||
cart_image_close(1);
|
cart_image_close(1);
|
||||||
cart_image_close(0);
|
cart_image_close(0);
|
||||||
|
|
||||||
if (!(machines[machine].flags & MACHINE_CARTRIDGE))
|
if (!machine_has_cartridge(machine))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
|
@ -1063,7 +1063,7 @@ write_output(atkbd_t *dev, uint8_t val)
|
|||||||
val |= ((dev->mem[0] << 4) & 0x10);
|
val |= ((dev->mem[0] << 4) & 0x10);
|
||||||
|
|
||||||
/*IRQ 12*/
|
/*IRQ 12*/
|
||||||
if ((dev->output_port ^ val) & 0x20) {
|
if ((old ^ val) & 0x20) {
|
||||||
if (val & 0x20)
|
if (val & 0x20)
|
||||||
picint(1 << 12);
|
picint(1 << 12);
|
||||||
else
|
else
|
||||||
@ -1071,26 +1071,23 @@ write_output(atkbd_t *dev, uint8_t val)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*IRQ 1*/
|
/*IRQ 1*/
|
||||||
if ((dev->output_port ^ val) & 0x10) {
|
if ((old ^ val) & 0x10) {
|
||||||
if (val & 0x10)
|
if (val & 0x10)
|
||||||
picint(1 << 1);
|
picint(1 << 1);
|
||||||
else
|
else
|
||||||
picintc(1 << 1);
|
picintc(1 << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev->output_port ^ val) & 0x02) { /*A20 enable change*/
|
if ((old ^ val) & 0x02) { /*A20 enable change*/
|
||||||
mem_a20_key = val & 0x02;
|
mem_a20_key = val & 0x02;
|
||||||
mem_a20_recalc();
|
mem_a20_recalc();
|
||||||
flushmmucache();
|
flushmmucache();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do this here to avoid an infinite reset loop. */
|
|
||||||
dev->output_port = val;
|
|
||||||
|
|
||||||
/* 0 holds the CPU in the RESET state, 1 releases it. To simplify this,
|
/* 0 holds the CPU in the RESET state, 1 releases it. To simplify this,
|
||||||
we just do everything on release. */
|
we just do everything on release. */
|
||||||
if ((val & 0x01) && !(old & 0x01)) {
|
if ((old ^ val) & 0x01) { /*Reset*/
|
||||||
if (val & 0x01) {
|
if (! (val & 0x01)) { /* Pin 0 selected. */
|
||||||
/* Pin 0 selected. */
|
/* Pin 0 selected. */
|
||||||
kbd_log("write_output(): Pulse reset!\n");
|
kbd_log("write_output(): Pulse reset!\n");
|
||||||
softresetx86(); /*Pulse reset!*/
|
softresetx86(); /*Pulse reset!*/
|
||||||
@ -1098,6 +1095,9 @@ write_output(atkbd_t *dev, uint8_t val)
|
|||||||
flushmmucache();
|
flushmmucache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Do this here to avoid an infinite reset loop. */
|
||||||
|
dev->output_port = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,15 +111,15 @@ postcard_init(const device_t *info)
|
|||||||
{
|
{
|
||||||
postcard_reset();
|
postcard_reset();
|
||||||
|
|
||||||
if (machines[machine].flags & MACHINE_MCA)
|
if (machine_has_bus(machine, MACHINE_BUS_MCA))
|
||||||
postcard_port = 0x680; /* MCA machines */
|
postcard_port = 0x680; /* MCA machines */
|
||||||
else if (strstr(machines[machine].name, " PS/2 ") || strstr(machines[machine].name, " PS/1 "))
|
else if (strstr(machines[machine].name, " PS/2 ") || strstr(machine_getname_ex(machine), " PS/1 "))
|
||||||
postcard_port = 0x190; /* ISA PS/2 machines */
|
postcard_port = 0x190; /* ISA PS/2 machines */
|
||||||
else if (strstr(machines[machine].name, " IBM XT "))
|
else if (strstr(machines[machine].name, " IBM XT "))
|
||||||
postcard_port = 0x60; /* IBM XT */
|
postcard_port = 0x60; /* IBM XT */
|
||||||
else if (strstr(machines[machine].name, " IBM PCjr"))
|
else if (strstr(machines[machine].name, " IBM PCjr"))
|
||||||
postcard_port = 0x10; /* IBM PCjr */
|
postcard_port = 0x10; /* IBM PCjr */
|
||||||
else if (strstr(machines[machine].name, " Compaq ") && !(machines[machine].flags & MACHINE_PCI))
|
else if (strstr(machines[machine].name, " Compaq ") && !machine_has_bus(machine, MACHINE_BUS_PCI))
|
||||||
postcard_port = 0x84; /* ISA Compaq machines */
|
postcard_port = 0x84; /* ISA Compaq machines */
|
||||||
else
|
else
|
||||||
postcard_port = 0x80; /* AT and clone machines */
|
postcard_port = 0x80; /* AT and clone machines */
|
||||||
|
@ -360,7 +360,7 @@ gameport_add(const device_t *gameport_type)
|
|||||||
{
|
{
|
||||||
/* Prevent a standalone game port from being added later on, unless this
|
/* Prevent a standalone game port from being added later on, unless this
|
||||||
is an unused Super I/O game port (no MACHINE_GAMEPORT machine flag). */
|
is an unused Super I/O game port (no MACHINE_GAMEPORT machine flag). */
|
||||||
if (!(gameport_type->local & GAMEPORT_SIO) || (machines[machine].flags & MACHINE_GAMEPORT))
|
if (!(gameport_type->local & GAMEPORT_SIO) || machine_has_flags(machine, MACHINE_GAMEPORT))
|
||||||
standalone_gameport_type = NULL;
|
standalone_gameport_type = NULL;
|
||||||
|
|
||||||
/* Add game port device. */
|
/* Add game port device. */
|
||||||
|
@ -145,7 +145,7 @@ extern void device_speed_changed(void);
|
|||||||
extern void device_force_redraw(void);
|
extern void device_force_redraw(void);
|
||||||
extern void device_get_name(const device_t *d, int bus, char *name);
|
extern void device_get_name(const device_t *d, int bus, char *name);
|
||||||
|
|
||||||
extern int device_is_valid(const device_t *, int machine_flags);
|
extern int device_is_valid(const device_t *, int m);
|
||||||
|
|
||||||
extern int device_get_config_int(const char *name);
|
extern int device_get_config_int(const char *name);
|
||||||
extern int device_get_config_int_ex(const char *s, int dflt_int);
|
extern int device_get_config_int_ex(const char *s, int dflt_int);
|
||||||
|
@ -189,6 +189,7 @@ extern int AT, PCI;
|
|||||||
extern int machine_count(void);
|
extern int machine_count(void);
|
||||||
extern int machine_available(int m);
|
extern int machine_available(int m);
|
||||||
extern char *machine_getname(void);
|
extern char *machine_getname(void);
|
||||||
|
extern char *machine_getname_ex(int m);
|
||||||
extern char *machine_get_internal_name(void);
|
extern char *machine_get_internal_name(void);
|
||||||
extern int machine_get_machine_from_internal_name(char *s);
|
extern int machine_get_machine_from_internal_name(char *s);
|
||||||
extern void machine_init(void);
|
extern void machine_init(void);
|
||||||
@ -197,6 +198,13 @@ extern const device_t *machine_getdevice(int m);
|
|||||||
#endif
|
#endif
|
||||||
extern char *machine_get_internal_name_ex(int m);
|
extern char *machine_get_internal_name_ex(int m);
|
||||||
extern int machine_get_nvrmask(int m);
|
extern int machine_get_nvrmask(int m);
|
||||||
|
extern int machine_has_flags(int m, int flags);
|
||||||
|
extern int machine_has_bus(int m, int bus_flags);
|
||||||
|
extern int machine_has_cartridge(int m);
|
||||||
|
extern int machine_get_min_ram(int m);
|
||||||
|
extern int machine_get_max_ram(int m);
|
||||||
|
extern int machine_get_ram_granularity(int m);
|
||||||
|
extern int machine_get_type(int m);
|
||||||
extern void machine_close(void);
|
extern void machine_close(void);
|
||||||
|
|
||||||
|
|
||||||
|
@ -95,7 +95,8 @@ extern void midi_in_sysex(uint8_t *buffer, uint32_t len);
|
|||||||
#define MIDI_INPUT_INTERNAL_NAME "midi_in"
|
#define MIDI_INPUT_INTERNAL_NAME "midi_in"
|
||||||
|
|
||||||
#ifdef EMU_DEVICE_H
|
#ifdef EMU_DEVICE_H
|
||||||
extern const device_t system_midi_device;
|
extern const device_t rtmidi_device;
|
||||||
|
extern const device_t rtmidi_input_device;
|
||||||
#ifdef USE_FLUIDSYNTH
|
#ifdef USE_FLUIDSYNTH
|
||||||
extern const device_t fluidsynth_device;
|
extern const device_t fluidsynth_device;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1 +0,0 @@
|
|||||||
extern const device_t midi_input_device;
|
|
13
src/include/86box/midi_rtmidi.h
Normal file
13
src/include/86box/midi_rtmidi.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern int rtmidi_get_num_devs(void);
|
||||||
|
extern void rtmidi_get_dev_name(int num, char *s);
|
||||||
|
extern int rtmidi_in_get_num_devs(void);
|
||||||
|
extern void rtmidi_in_get_dev_name(int num, char *s);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
@ -1 +0,0 @@
|
|||||||
extern const device_t system_midi_device;
|
|
@ -170,7 +170,7 @@ typedef void event_t;
|
|||||||
typedef void mutex_t;
|
typedef void mutex_t;
|
||||||
|
|
||||||
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
|
extern thread_t *thread_create(void (*thread_func)(void *param), void *param);
|
||||||
extern int thread_wait(thread_t *arg, int timeout);
|
extern int thread_wait(thread_t *arg);
|
||||||
extern event_t *thread_create_event(void);
|
extern event_t *thread_create_event(void);
|
||||||
extern void thread_set_event(event_t *arg);
|
extern void thread_set_event(event_t *arg);
|
||||||
extern void thread_reset_event(event_t *arg);
|
extern void thread_reset_event(event_t *arg);
|
||||||
@ -180,7 +180,6 @@ extern void thread_destroy_event(event_t *arg);
|
|||||||
#define MUTEX_DEFAULT_SPIN_COUNT 1024
|
#define MUTEX_DEFAULT_SPIN_COUNT 1024
|
||||||
|
|
||||||
extern mutex_t *thread_create_mutex(void);
|
extern mutex_t *thread_create_mutex(void);
|
||||||
extern mutex_t *thread_create_mutex_with_spin_count(unsigned int spin_count);
|
|
||||||
extern void thread_close_mutex(mutex_t *arg);
|
extern void thread_close_mutex(mutex_t *arg);
|
||||||
extern int thread_wait_mutex(mutex_t *arg);
|
extern int thread_wait_mutex(mutex_t *arg);
|
||||||
extern int thread_release_mutex(mutex_t *mutex);
|
extern int thread_release_mutex(mutex_t *mutex);
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
extern void plat_midi_init(void);
|
|
||||||
extern void plat_midi_close(void);
|
|
||||||
|
|
||||||
extern void plat_midi_play_msg(uint8_t *msg);
|
|
||||||
extern void plat_midi_play_sysex(uint8_t *sysex, unsigned int len);
|
|
||||||
extern int plat_midi_write(uint8_t val);
|
|
||||||
|
|
||||||
extern int plat_midi_get_num_devs(void);
|
|
||||||
extern void plat_midi_get_dev_name(int num, char *s);
|
|
||||||
|
|
||||||
extern void plat_midi_input_init(void);
|
|
||||||
extern void plat_midi_input_close(void);
|
|
||||||
|
|
||||||
extern int plat_midi_in_get_num_devs(void);
|
|
||||||
extern void plat_midi_in_get_dev_name(int num, char *s);
|
|
@ -202,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)
|
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;
|
ps2_cache[addr] = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -402,10 +402,9 @@ static void model_50_write(uint16_t port, uint8_t val)
|
|||||||
static void model_55sx_mem_recalc(void)
|
static void model_55sx_mem_recalc(void)
|
||||||
{
|
{
|
||||||
int i, j, state, enabled_mem = 0;
|
int i, j, state, enabled_mem = 0;
|
||||||
/* WARNING: Undocumented behavior - when bit 3 of POS5 is set (ie. memory has been configured),
|
int base = 0, remap_size = (ps2.option[3] & 0x10) ? 384 : 256;
|
||||||
bit 1 of POS5 behaves like bit 4. */
|
int bit_mask = 0x00, max_rows = 4;
|
||||||
int base = 0, remap_size = (ps2.option[3] & 0x11) ? 384 : 256;
|
int bank_to_rows[16] = { 4, 2, 1, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0 };
|
||||||
int bit_mask = 0x00;
|
|
||||||
|
|
||||||
ps2_mca_log("%02X %02X\n", ps2.option[1], ps2.option[3]);
|
ps2_mca_log("%02X %02X\n", ps2.option[1], ps2.option[3]);
|
||||||
|
|
||||||
@ -413,15 +412,14 @@ static void model_55sx_mem_recalc(void)
|
|||||||
mem_set_mem_state(0x00000000, (mem_size + 384) * 1024, MEM_READ_EXTERNAL | MEM_WRITE_EXTERNAL);
|
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);
|
mem_set_mem_state(0x000e0000, 0x00020000, MEM_READ_EXTANY | MEM_WRITE_DISABLED);
|
||||||
|
|
||||||
if (!(ps2.option[3] & 0x08))
|
|
||||||
{
|
|
||||||
ps2_mca_log("Memory not yet configured\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
for (j = 0; j < 4; j++)
|
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)) {
|
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);
|
ps2_mca_log("Set memory at %06X-%06X to internal\n", (base * 1024), (base * 1024) + (((base > 0) ? 1024 : 640) * 1024) - 1);
|
||||||
@ -435,7 +433,7 @@ static void model_55sx_mem_recalc(void)
|
|||||||
|
|
||||||
ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask);
|
ps2_mca_log("Enabled memory: %i kB (%02X)\n", enabled_mem, bit_mask);
|
||||||
|
|
||||||
if (ps2.option[3] & 0x11)
|
if (ps2.option[3] & 0x10)
|
||||||
{
|
{
|
||||||
/* Enable ROM. */
|
/* Enable ROM. */
|
||||||
ps2_mca_log("Enable ROM\n");
|
ps2_mca_log("Enable ROM\n");
|
||||||
@ -444,7 +442,7 @@ static void model_55sx_mem_recalc(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Disable ROM. */
|
/* Disable ROM. */
|
||||||
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01) && (ps2.option[3] & 0x08))
|
if ((ps2.option[1] & 1) && !(ps2.option[3] & 0x20) && (bit_mask & 0x01))
|
||||||
{
|
{
|
||||||
/* Disable RAM between 640 kB and 1 MB. */
|
/* Disable RAM between 640 kB and 1 MB. */
|
||||||
ps2_mca_log("Disable ROM, enable RAM\n");
|
ps2_mca_log("Disable ROM, enable RAM\n");
|
||||||
@ -462,9 +460,15 @@ static void model_55sx_mem_recalc(void)
|
|||||||
|
|
||||||
mem_set_mem_state(0xe0000, 0x20000, state);
|
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);
|
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)) {
|
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);
|
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);
|
mem_set_mem_state(mem_size * 1024, remap_size * 1024, MEM_READ_INTERNAL | MEM_WRITE_INTERNAL);
|
||||||
}
|
}
|
||||||
@ -942,7 +946,7 @@ static void ps2_mca_board_model_55sx_init()
|
|||||||
|
|
||||||
ps2.option[1] = 0x00;
|
ps2.option[1] = 0x00;
|
||||||
ps2.option[2] = 0x00;
|
ps2.option[2] = 0x00;
|
||||||
ps2.option[3] = 0x30;
|
ps2.option[3] = 0x10;
|
||||||
|
|
||||||
memset(ps2.memory_bank, 0xf0, 8);
|
memset(ps2.memory_bank, 0xf0, 8);
|
||||||
switch (mem_size/1024)
|
switch (mem_size/1024)
|
||||||
|
@ -366,9 +366,8 @@ const machine_t machines[] = {
|
|||||||
{ "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_pb410a_init, NULL },
|
{ "[ACC 2168] Packard Bell PB410A", "pb410a", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_pb410a_init, NULL },
|
||||||
/* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */
|
/* Uses an ACER/NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware (V4.01H). */
|
||||||
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_acera1g_init, at_acera1g_get_device },
|
{ "[ALi M1429G] Acer A1G", "acera1g", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 4096, 36864, 1024, 127, machine_at_acera1g_init, at_acera1g_get_device },
|
||||||
/* There are two similar BIOS strings with -H, and one with -U, so I'm going to
|
/* This has an AMIKey-2, which is an updated version of type 'H'. */
|
||||||
give it an AMIKey H KBC firmware. */
|
{ "[ALi M1429G] Kaimei SA-486 VL-BUS M.B.", "win486", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_winbios1429_init, NULL },
|
||||||
{ "[ALi M1429G] Kaimei 486", "win486", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_VLB | MACHINE_IDE, 1024, 32768, 1024, 127, machine_at_winbios1429_init, NULL },
|
|
||||||
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
|
/* Uses an Intel KBC with Phoenix MultiKey KBC firmware. */
|
||||||
{ "[SiS 461] DEC DECpc LPV", "decpclpv", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_decpclpv_init, NULL },
|
{ "[SiS 461] DEC DECpc LPV", "decpclpv", MACHINE_TYPE_486_S2, CPU_PKG_SOCKET3, 0, 0, 0, 0, 0, 0, 0, MACHINE_AT | MACHINE_BUS_PS2 | MACHINE_IDE_DUAL | MACHINE_VIDEO, 1024, 32768, 1024, 127, machine_at_decpclpv_init, NULL },
|
||||||
/* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */
|
/* Uses an NEC 90M002A (UPD82C42C, 8042 clone) with unknown firmware. */
|
||||||
@ -979,6 +978,59 @@ machine_get_nvrmask(int m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_has_flags(int m, int flags)
|
||||||
|
{
|
||||||
|
return(machines[m].flags & flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_has_bus(int m, int bus_flags)
|
||||||
|
{
|
||||||
|
return(machines[m].flags & bus_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_has_cartridge(int m)
|
||||||
|
{
|
||||||
|
return(machine_has_flags(m, MACHINE_CARTRIDGE) ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_get_min_ram(int m)
|
||||||
|
{
|
||||||
|
return(machines[m].min_ram);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_get_max_ram(int m)
|
||||||
|
{
|
||||||
|
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
|
||||||
|
return MIN(((int) machines[m].max_ram), 2097152);
|
||||||
|
#else
|
||||||
|
return MIN(((int) machines[m].max_ram), 3145728);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_get_ram_granularity(int m)
|
||||||
|
{
|
||||||
|
return(machines[m].ram_granularity);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
machine_get_type(int m)
|
||||||
|
{
|
||||||
|
return(machines[m].type);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
machine_get_machine_from_internal_name(char *s)
|
machine_get_machine_from_internal_name(char *s)
|
||||||
{
|
{
|
||||||
|
@ -406,7 +406,7 @@ spd_write_drbs_interleaved(uint8_t *regs, uint8_t reg_min, uint8_t reg_max, uint
|
|||||||
{
|
{
|
||||||
uint8_t row, dimm;
|
uint8_t row, dimm;
|
||||||
uint8_t drb;
|
uint8_t drb;
|
||||||
uint16_t size, size_acc;
|
uint16_t size, size_acc = 0;
|
||||||
uint16_t rows[SPD_MAX_SLOTS];
|
uint16_t rows[SPD_MAX_SLOTS];
|
||||||
|
|
||||||
/* No SPD: split SIMMs into pairs as if they were "DIMM"s. */
|
/* No SPD: split SIMMs into pairs as if they were "DIMM"s. */
|
||||||
|
@ -172,6 +172,7 @@ poll_thread(void *arg)
|
|||||||
thread_set_event(poll_state);
|
thread_set_event(poll_state);
|
||||||
|
|
||||||
/* Create a waitable event. */
|
/* Create a waitable event. */
|
||||||
|
pcap_log("PCAP: Creating event...\n");
|
||||||
evt = thread_create_event();
|
evt = thread_create_event();
|
||||||
|
|
||||||
/* As long as the channel is open.. */
|
/* As long as the channel is open.. */
|
||||||
@ -185,8 +186,6 @@ poll_thread(void *arg)
|
|||||||
if (pcap == NULL)
|
if (pcap == NULL)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Wait for the next packet to arrive. */
|
|
||||||
tx = network_tx_queue_check();
|
|
||||||
if (network_get_wait() || (poll_card->set_link_state && poll_card->set_link_state(poll_card->priv)) || (poll_card->wait && poll_card->wait(poll_card->priv)))
|
if (network_get_wait() || (poll_card->set_link_state && poll_card->set_link_state(poll_card->priv)) || (poll_card->wait && poll_card->wait(poll_card->priv)))
|
||||||
data = NULL;
|
data = NULL;
|
||||||
else
|
else
|
||||||
@ -208,11 +207,14 @@ poll_thread(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wait for the next packet to arrive. */
|
||||||
|
tx = network_tx_queue_check();
|
||||||
|
|
||||||
if (tx)
|
if (tx)
|
||||||
network_do_tx();
|
network_do_tx();
|
||||||
|
|
||||||
/* If we did not get anything, wait a while. */
|
/* If we did not get anything, wait a while. */
|
||||||
if ((data == NULL) && !tx)
|
if (!tx)
|
||||||
thread_wait_event(evt, 10);
|
thread_wait_event(evt, 10);
|
||||||
|
|
||||||
/* Release ownership of the device. */
|
/* Release ownership of the device. */
|
||||||
@ -224,7 +226,8 @@ poll_thread(void *arg)
|
|||||||
thread_destroy_event(evt);
|
thread_destroy_event(evt);
|
||||||
|
|
||||||
pcap_log("PCAP: polling stopped.\n");
|
pcap_log("PCAP: polling stopped.\n");
|
||||||
thread_set_event(poll_state);
|
if (poll_state != NULL)
|
||||||
|
thread_set_event(poll_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@
|
|||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <stdatomic.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -107,7 +108,7 @@ int nic_do_log = ENABLE_NIC_LOG;
|
|||||||
|
|
||||||
|
|
||||||
/* Local variables. */
|
/* Local variables. */
|
||||||
static volatile int net_wait = 0;
|
static volatile atomic_int net_wait = 0;
|
||||||
static mutex_t *network_mutex;
|
static mutex_t *network_mutex;
|
||||||
static uint8_t *network_mac;
|
static uint8_t *network_mac;
|
||||||
static uint8_t network_timer_active = 0;
|
static uint8_t network_timer_active = 0;
|
||||||
@ -388,8 +389,8 @@ network_attach(void *dev, uint8_t *mac, NETRXCB rx, NETWAITCB wait, NETSETLINKST
|
|||||||
network_set_wait(0);
|
network_set_wait(0);
|
||||||
|
|
||||||
/* Create the network events. */
|
/* Create the network events. */
|
||||||
poll_data.wake_poll_thread = thread_create_event();
|
|
||||||
poll_data.poll_complete = thread_create_event();
|
poll_data.poll_complete = thread_create_event();
|
||||||
|
poll_data.wake_poll_thread = thread_create_event();
|
||||||
|
|
||||||
/* Activate the platform module. */
|
/* Activate the platform module. */
|
||||||
switch(network_type) {
|
switch(network_type) {
|
||||||
@ -671,9 +672,7 @@ network_card_get_from_internal_name(char *s)
|
|||||||
void
|
void
|
||||||
network_set_wait(int wait)
|
network_set_wait(int wait)
|
||||||
{
|
{
|
||||||
network_wait(1);
|
|
||||||
net_wait = wait;
|
net_wait = wait;
|
||||||
network_wait(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -682,8 +681,6 @@ network_get_wait(void)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
network_wait(1);
|
|
||||||
ret = net_wait;
|
ret = net_wait;
|
||||||
network_wait(0);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -154,6 +154,8 @@ ctr_tick(ctr_t *ctr)
|
|||||||
/* This is true for all modes */
|
/* This is true for all modes */
|
||||||
ctr_load_count(ctr);
|
ctr_load_count(ctr);
|
||||||
ctr->state = 2;
|
ctr->state = 2;
|
||||||
|
if ((ctr->m & 0x07) == 0x01)
|
||||||
|
ctr_set_out(ctr, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ scsi_card_init(void)
|
|||||||
|
|
||||||
/* On-board SCSI controllers get the first bus, so if one is present,
|
/* On-board SCSI controllers get the first bus, so if one is present,
|
||||||
increase our instance number here. */
|
increase our instance number here. */
|
||||||
if (machines[machine].flags & MACHINE_SCSI)
|
if (machine_has_flags(machine, MACHINE_SCSI))
|
||||||
max--;
|
max--;
|
||||||
|
|
||||||
/* Do not initialize any controllers if we have do not have any SCSI
|
/* Do not initialize any controllers if we have do not have any SCSI
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
add_library(snd OBJECT sound.c openal.c snd_opl.c snd_opl_nuked.c snd_resid.cc
|
add_library(snd OBJECT sound.c openal.c snd_opl.c snd_opl_nuked.c snd_resid.cc
|
||||||
midi.c midi_system.c snd_speaker.c snd_pssj.c snd_lpt_dac.c snd_ac97_codec.c snd_ac97_via.c
|
midi.c midi_rtmidi.cpp snd_speaker.c snd_pssj.c snd_lpt_dac.c snd_ac97_codec.c snd_ac97_via.c
|
||||||
snd_lpt_dss.c snd_adlib.c snd_adlibgold.c snd_ad1848.c snd_audiopci.c
|
snd_lpt_dss.c snd_adlib.c snd_adlibgold.c snd_ad1848.c snd_audiopci.c
|
||||||
snd_azt2316a.c snd_cms.c snd_cs423x.c snd_gus.c snd_sb.c snd_sb_dsp.c
|
snd_azt2316a.c snd_cms.c snd_cs423x.c snd_gus.c snd_sb.c snd_sb_dsp.c
|
||||||
snd_emu8k.c snd_mpu401.c snd_sn76489.c snd_ssi2001.c snd_wss.c snd_ym7128.c)
|
snd_emu8k.c snd_mpu401.c snd_sn76489.c snd_ssi2001.c snd_wss.c snd_ym7128.c)
|
||||||
|
@ -28,9 +28,7 @@
|
|||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
#include <86box/device.h>
|
#include <86box/device.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/midi.h>
|
#include <86box/midi.h>
|
||||||
#include <86box/midi_input.h>
|
|
||||||
|
|
||||||
|
|
||||||
int midi_device_current = 0;
|
int midi_device_current = 0;
|
||||||
@ -84,14 +82,14 @@ static const MIDI_DEVICE devices[] =
|
|||||||
{ "mt32", &mt32_device },
|
{ "mt32", &mt32_device },
|
||||||
{ "cm32l", &cm32l_device },
|
{ "cm32l", &cm32l_device },
|
||||||
#endif
|
#endif
|
||||||
{ SYSTEM_MIDI_INTERNAL_NAME, &system_midi_device },
|
{ SYSTEM_MIDI_INTERNAL_NAME, &rtmidi_device },
|
||||||
{ "", NULL }
|
{ "", NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static const MIDI_IN_DEVICE midi_in_devices[] =
|
static const MIDI_IN_DEVICE midi_in_devices[] =
|
||||||
{
|
{
|
||||||
{ "none", NULL },
|
{ "none", NULL },
|
||||||
{ MIDI_INPUT_INTERNAL_NAME, &midi_input_device },
|
{ MIDI_INPUT_INTERNAL_NAME, &rtmidi_input_device },
|
||||||
{ "", NULL }
|
{ "", NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ void fluidsynth_close(void* p)
|
|||||||
|
|
||||||
data->on = 0;
|
data->on = 0;
|
||||||
thread_set_event(data->event);
|
thread_set_event(data->event);
|
||||||
thread_wait(data->thread_h, -1);
|
thread_wait(data->thread_h);
|
||||||
|
|
||||||
if (data->synth) {
|
if (data->synth) {
|
||||||
f_delete_fluid_synth(data->synth);
|
f_delete_fluid_synth(data->synth);
|
||||||
|
@ -240,7 +240,7 @@ void mt32_close(void* p)
|
|||||||
|
|
||||||
mt32_on = 0;
|
mt32_on = 0;
|
||||||
thread_set_event(event);
|
thread_set_event(event);
|
||||||
thread_wait(thread_h, -1);
|
thread_wait(thread_h);
|
||||||
|
|
||||||
event = NULL;
|
event = NULL;
|
||||||
start_event = NULL;
|
start_event = NULL;
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include <86box/86box.h>
|
#include <86box/86box.h>
|
||||||
|
#include <86box/device.h>
|
||||||
#include <86box/midi.h>
|
#include <86box/midi.h>
|
||||||
#include <86box/plat_midi.h>
|
#include <86box/midi_rtmidi.h>
|
||||||
#include <86box/config.h>
|
#include <86box/config.h>
|
||||||
|
|
||||||
|
|
||||||
@ -42,19 +43,43 @@ static const int midi_lengths[8] = {3, 3, 3, 3, 2, 2, 3, 1};
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
plat_midi_write(uint8_t val)
|
rtmidi_write(uint8_t val)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void plat_midi_init(void)
|
void
|
||||||
|
rtmidi_play_msg(uint8_t *msg)
|
||||||
{
|
{
|
||||||
|
if (midiout)
|
||||||
|
midiout->sendMessage(msg, midi_lengths[(msg[0] >> 4) & 7]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
|
||||||
|
{
|
||||||
|
if (midiout)
|
||||||
|
midiout->sendMessage(sysex, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void*
|
||||||
|
rtmidi_init(const device_t *info)
|
||||||
|
{
|
||||||
|
midi_device_t* dev = (midi_device_t*)malloc(sizeof(midi_device_t));
|
||||||
|
memset(dev, 0, sizeof(midi_device_t));
|
||||||
|
|
||||||
|
dev->play_msg = rtmidi_play_msg;
|
||||||
|
dev->play_sysex = rtmidi_play_sysex;
|
||||||
|
dev->write = rtmidi_write;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!midiout) midiout = new RtMidiOut;
|
if (!midiout) midiout = new RtMidiOut;
|
||||||
} catch (RtMidiError& error) {
|
} catch (RtMidiError& error) {
|
||||||
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
|
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
midi_out_id = config_get_int((char*)SYSTEM_MIDI_NAME, (char*)"midi", 0);
|
midi_out_id = config_get_int((char*)SYSTEM_MIDI_NAME, (char*)"midi", 0);
|
||||||
@ -70,14 +95,18 @@ void plat_midi_init(void)
|
|||||||
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
|
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
|
||||||
delete midiout;
|
delete midiout;
|
||||||
midiout = nullptr;
|
midiout = nullptr;
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
midi_init(dev);
|
||||||
|
|
||||||
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_midi_close(void)
|
rtmidi_close(void *p)
|
||||||
{
|
{
|
||||||
if (!midiout)
|
if (!midiout)
|
||||||
return;
|
return;
|
||||||
@ -86,11 +115,13 @@ plat_midi_close(void)
|
|||||||
|
|
||||||
delete midiout;
|
delete midiout;
|
||||||
midiout = nullptr;
|
midiout = nullptr;
|
||||||
|
|
||||||
|
midi_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
plat_midi_get_num_devs(void)
|
rtmidi_get_num_devs(void)
|
||||||
{
|
{
|
||||||
if (!midiout) {
|
if (!midiout) {
|
||||||
try {
|
try {
|
||||||
@ -105,30 +136,14 @@ plat_midi_get_num_devs(void)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_midi_play_msg(uint8_t *msg)
|
rtmidi_get_dev_name(int num, char *s)
|
||||||
{
|
|
||||||
if (midiout)
|
|
||||||
midiout->sendMessage(msg, midi_lengths[(msg[0] >> 4) & 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
plat_midi_get_dev_name(int num, char *s)
|
|
||||||
{
|
{
|
||||||
strcpy(s, midiout->getPortName(num).c_str());
|
strcpy(s, midiout->getPortName(num).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_midi_play_sysex(uint8_t *sysex, unsigned int len)
|
rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, void *userData)
|
||||||
{
|
|
||||||
if (midiout)
|
|
||||||
midiout->sendMessage(sysex, len);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
plat_midi_callback(double timeStamp, std::vector<unsigned char> *message, void *userData)
|
|
||||||
{
|
{
|
||||||
if (message->size() <= 3)
|
if (message->size() <= 3)
|
||||||
midi_in_msg(message->data());
|
midi_in_msg(message->data());
|
||||||
@ -137,15 +152,18 @@ plat_midi_callback(double timeStamp, std::vector<unsigned char> *message, void *
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void*
|
||||||
plat_midi_input_init(void)
|
rtmidi_input_init(const device_t *info)
|
||||||
{
|
{
|
||||||
|
midi_device_t* dev = (midi_device_t*)malloc(sizeof(midi_device_t));
|
||||||
|
memset(dev, 0, sizeof(midi_device_t));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!midiin)
|
if (!midiin)
|
||||||
midiin = new RtMidiIn;
|
midiin = new RtMidiIn;
|
||||||
} catch (RtMidiError& error) {
|
} catch (RtMidiError& error) {
|
||||||
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
|
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
midi_in_id = config_get_int((char*)SYSTEM_MIDI_NAME, (char*)"midi_input", 0);
|
midi_in_id = config_get_int((char*)SYSTEM_MIDI_NAME, (char*)"midi_input", 0);
|
||||||
@ -161,16 +179,24 @@ plat_midi_input_init(void)
|
|||||||
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
|
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
|
||||||
delete midiin;
|
delete midiin;
|
||||||
midiin = nullptr;
|
midiin = nullptr;
|
||||||
return;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
midiin->setCallback(plat_midi_callback);
|
midiin->setCallback(rtmidi_input_callback);
|
||||||
|
|
||||||
|
midi_in_init(dev, &midi_in);
|
||||||
|
|
||||||
|
midi_in->midi_realtime = device_get_config_int("realtime");
|
||||||
|
midi_in->thruchan = device_get_config_int("thruchan");
|
||||||
|
midi_in->midi_clockout = device_get_config_int("clockout");
|
||||||
|
|
||||||
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_midi_input_close(void)
|
rtmidi_input_close(void* p)
|
||||||
{
|
{
|
||||||
midiin->cancelCallback();
|
midiin->cancelCallback();
|
||||||
midiin->closePort();
|
midiin->closePort();
|
||||||
@ -178,12 +204,12 @@ plat_midi_input_close(void)
|
|||||||
delete midiin;
|
delete midiin;
|
||||||
midiin = nullptr;
|
midiin = nullptr;
|
||||||
|
|
||||||
return;
|
midi_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
plat_midi_in_get_num_devs(void)
|
rtmidi_in_get_num_devs(void)
|
||||||
{
|
{
|
||||||
if (!midiin) {
|
if (!midiin) {
|
||||||
try {
|
try {
|
||||||
@ -198,9 +224,65 @@ plat_midi_in_get_num_devs(void)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
plat_midi_in_get_dev_name(int num, char *s)
|
rtmidi_in_get_dev_name(int num, char *s)
|
||||||
{
|
{
|
||||||
strcpy(s, midiin->getPortName(num).c_str());
|
strcpy(s, midiin->getPortName(num).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const device_config_t system_midi_config[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"midi", "MIDI out device", CONFIG_MIDI, "", 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"", "", -1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const device_config_t midi_input_config[] =
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"midi_input", "MIDI in device", CONFIG_MIDI_IN, "", 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"realtime", "MIDI Real time", CONFIG_BINARY, "", 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"thruchan", "MIDI Thru", CONFIG_BINARY, "", 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"clockout", "MIDI Clockout", CONFIG_BINARY, "", 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"", "", -1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const device_t rtmidi_device =
|
||||||
|
{
|
||||||
|
SYSTEM_MIDI_NAME,
|
||||||
|
0, 0,
|
||||||
|
rtmidi_init,
|
||||||
|
rtmidi_close,
|
||||||
|
NULL,
|
||||||
|
{ rtmidi_get_num_devs },
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
system_midi_config
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const device_t rtmidi_input_device =
|
||||||
|
{
|
||||||
|
MIDI_INPUT_NAME,
|
||||||
|
0, 0,
|
||||||
|
rtmidi_input_init,
|
||||||
|
rtmidi_input_close,
|
||||||
|
NULL,
|
||||||
|
{ rtmidi_in_get_num_devs },
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
midi_input_config
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -1,139 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <wchar.h>
|
|
||||||
#include <86box/86box.h>
|
|
||||||
#include <86box/device.h>
|
|
||||||
#include <86box/plat.h>
|
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/midi.h>
|
|
||||||
#include <86box/midi_input.h>
|
|
||||||
|
|
||||||
|
|
||||||
void* system_midi_init(const device_t *info)
|
|
||||||
{
|
|
||||||
midi_device_t* dev = malloc(sizeof(midi_device_t));
|
|
||||||
memset(dev, 0, sizeof(midi_device_t));
|
|
||||||
|
|
||||||
dev->play_msg = plat_midi_play_msg;
|
|
||||||
dev->play_sysex = plat_midi_play_sysex;
|
|
||||||
dev->write = plat_midi_write;
|
|
||||||
|
|
||||||
plat_midi_init();
|
|
||||||
|
|
||||||
midi_init(dev);
|
|
||||||
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
void* midi_input_init(const device_t *info)
|
|
||||||
{
|
|
||||||
midi_device_t* dev = malloc(sizeof(midi_device_t));
|
|
||||||
memset(dev, 0, sizeof(midi_device_t));
|
|
||||||
|
|
||||||
plat_midi_input_init();
|
|
||||||
|
|
||||||
midi_in_init(dev, &midi_in);
|
|
||||||
|
|
||||||
midi_in->midi_realtime = device_get_config_int("realtime");
|
|
||||||
midi_in->thruchan = device_get_config_int("thruchan");
|
|
||||||
midi_in->midi_clockout = device_get_config_int("clockout");
|
|
||||||
|
|
||||||
return dev;
|
|
||||||
}
|
|
||||||
|
|
||||||
void system_midi_close(void* p)
|
|
||||||
{
|
|
||||||
plat_midi_close();
|
|
||||||
|
|
||||||
midi_close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void midi_input_close(void* p)
|
|
||||||
{
|
|
||||||
plat_midi_input_close();
|
|
||||||
|
|
||||||
midi_close();
|
|
||||||
}
|
|
||||||
|
|
||||||
int system_midi_available(void)
|
|
||||||
{
|
|
||||||
return plat_midi_get_num_devs();
|
|
||||||
}
|
|
||||||
|
|
||||||
int midi_input_available(void)
|
|
||||||
{
|
|
||||||
return plat_midi_in_get_num_devs();
|
|
||||||
}
|
|
||||||
|
|
||||||
static const device_config_t system_midi_config[] =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
.name = "midi",
|
|
||||||
.description = "MIDI out device",
|
|
||||||
.type = CONFIG_MIDI,
|
|
||||||
.default_int = 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.type = -1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
static const device_config_t midi_input_config[] =
|
|
||||||
{
|
|
||||||
{
|
|
||||||
.name = "midi_input",
|
|
||||||
.description = "MIDI in device",
|
|
||||||
.type = CONFIG_MIDI_IN,
|
|
||||||
.default_int = 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = "realtime",
|
|
||||||
.description = "MIDI Real time",
|
|
||||||
.type = CONFIG_BINARY,
|
|
||||||
.default_int = 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = "thruchan",
|
|
||||||
.description = "MIDI Thru",
|
|
||||||
.type = CONFIG_BINARY,
|
|
||||||
.default_int = 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = "clockout",
|
|
||||||
.description = "MIDI Clockout",
|
|
||||||
.type = CONFIG_BINARY,
|
|
||||||
.default_int = 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.type = -1
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const device_t system_midi_device =
|
|
||||||
{
|
|
||||||
SYSTEM_MIDI_NAME,
|
|
||||||
0, 0,
|
|
||||||
system_midi_init,
|
|
||||||
system_midi_close,
|
|
||||||
NULL,
|
|
||||||
{ system_midi_available },
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
system_midi_config
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
const device_t midi_input_device =
|
|
||||||
{
|
|
||||||
MIDI_INPUT_NAME,
|
|
||||||
0, 0,
|
|
||||||
midi_input_init,
|
|
||||||
midi_input_close,
|
|
||||||
NULL,
|
|
||||||
{ midi_input_available },
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
midi_input_config
|
|
||||||
};
|
|
@ -1703,7 +1703,7 @@ mpu401_device_add(void)
|
|||||||
if (!mpu401_standalone_enable)
|
if (!mpu401_standalone_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (machines[machine].flags & MACHINE_MCA)
|
if (machine_has_bus(machine, MACHINE_BUS_MCA))
|
||||||
device_add(&mpu401_mca_device);
|
device_add(&mpu401_mca_device);
|
||||||
else
|
else
|
||||||
device_add(&mpu401_device);
|
device_add(&mpu401_device);
|
||||||
|
@ -506,7 +506,7 @@ sound_cd_thread_end(void)
|
|||||||
|
|
||||||
sound_log("Waiting for CD Audio thread to terminate...\n");
|
sound_log("Waiting for CD Audio thread to terminate...\n");
|
||||||
thread_set_event(sound_cd_event);
|
thread_set_event(sound_cd_event);
|
||||||
thread_wait(sound_cd_thread_h, -1);
|
thread_wait(sound_cd_thread_h);
|
||||||
sound_log("CD Audio thread terminated...\n");
|
sound_log("CD Audio thread terminated...\n");
|
||||||
|
|
||||||
if (sound_cd_event) {
|
if (sound_cd_event) {
|
||||||
|
127
src/thread.cpp
Normal file
127
src/thread.cpp
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
#include <mutex>
|
||||||
|
#include <thread>
|
||||||
|
#include <condition_variable>
|
||||||
|
|
||||||
|
#include <86box/plat.h>
|
||||||
|
|
||||||
|
struct event_cpp11_t
|
||||||
|
{
|
||||||
|
std::condition_variable cond;
|
||||||
|
std::mutex mutex;
|
||||||
|
bool state = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
|
||||||
|
thread_t *
|
||||||
|
thread_create(void (*thread_rout)(void *param), void *param)
|
||||||
|
{
|
||||||
|
auto thread = new std::thread([thread_rout, param] {
|
||||||
|
thread_rout(param);
|
||||||
|
});
|
||||||
|
return thread;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
thread_wait(thread_t *arg)
|
||||||
|
{
|
||||||
|
auto thread = reinterpret_cast<std::thread*>(arg);
|
||||||
|
thread->join();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mutex_t *
|
||||||
|
thread_create_mutex(void)
|
||||||
|
{
|
||||||
|
auto mutex = new std::mutex;
|
||||||
|
return mutex;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
thread_wait_mutex(mutex_t *_mutex)
|
||||||
|
{
|
||||||
|
if (_mutex == nullptr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||||
|
mutex->lock();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
thread_release_mutex(mutex_t *_mutex)
|
||||||
|
{
|
||||||
|
if (_mutex == nullptr)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||||
|
mutex->unlock();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
thread_close_mutex(mutex_t *_mutex)
|
||||||
|
{
|
||||||
|
auto mutex = reinterpret_cast<std::mutex*>(_mutex);
|
||||||
|
delete mutex;
|
||||||
|
}
|
||||||
|
|
||||||
|
event_t *
|
||||||
|
thread_create_event()
|
||||||
|
{
|
||||||
|
auto ev = new event_cpp11_t;
|
||||||
|
return ev;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
thread_wait_event(event_t *handle, int timeout)
|
||||||
|
{
|
||||||
|
auto event = reinterpret_cast<event_cpp11_t*>(handle);
|
||||||
|
auto lock = std::unique_lock<std::mutex>(event->mutex);
|
||||||
|
|
||||||
|
if (timeout < 0) {
|
||||||
|
event->cond.wait(lock, [event] { return event->state; });
|
||||||
|
} else {
|
||||||
|
auto to = std::chrono::system_clock::now() + std::chrono::milliseconds(timeout);
|
||||||
|
std::cv_status status;
|
||||||
|
|
||||||
|
do {
|
||||||
|
status = event->cond.wait_until(lock, to);
|
||||||
|
} while ((status != std::cv_status::timeout) && !event->state);
|
||||||
|
|
||||||
|
if (status == std::cv_status::timeout) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
thread_set_event(event_t *handle)
|
||||||
|
{
|
||||||
|
auto event = reinterpret_cast<event_cpp11_t*>(handle);
|
||||||
|
{
|
||||||
|
auto lock = std::unique_lock<std::mutex>(event->mutex);
|
||||||
|
event->state = true;
|
||||||
|
}
|
||||||
|
event->cond.notify_all();
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
thread_reset_event(event_t *handle)
|
||||||
|
{
|
||||||
|
auto event = reinterpret_cast<event_cpp11_t*>(handle);
|
||||||
|
auto lock = std::unique_lock<std::mutex>(event->mutex);
|
||||||
|
event->state = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
thread_destroy_event(event_t *handle)
|
||||||
|
{
|
||||||
|
auto event = reinterpret_cast<event_cpp11_t*>(handle);
|
||||||
|
delete event;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,33 +1,13 @@
|
|||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
add_library(plat OBJECT unix.c)
|
||||||
find_package(ALSA)
|
|
||||||
if (ALSA_FOUND)
|
|
||||||
set(PLAT_SOURCES linux_midi_alsa.c)
|
|
||||||
else()
|
|
||||||
set(PLAT_SOURCES unix_midi.c)
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
set(PLAT_SOURCES unix_midi.c)
|
|
||||||
endif()
|
|
||||||
add_library(plat STATIC ${PLAT_SOURCES} unix_thread.c)
|
|
||||||
add_library(ui STATIC unix.c unix_sdl.c unix_cdrom.c)
|
|
||||||
target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64)
|
|
||||||
target_link_libraries(ui dl)
|
|
||||||
|
|
||||||
find_package(SDL2 REQUIRED)
|
if (NOT CPPTHREADS)
|
||||||
include_directories(${SDL2_INCLUDE_DIRS})
|
target_sources(plat PRIVATE unix_thread.c)
|
||||||
if(MINGW)
|
|
||||||
target_link_libraries(ui SDL2::SDL2-static)
|
|
||||||
else()
|
|
||||||
if (TARGET SDL2::SDL2)
|
|
||||||
target_link_libraries(ui SDL2::SDL2)
|
|
||||||
else()
|
|
||||||
target_link_libraries(ui ${SDL2_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if (ALSA_FOUND)
|
|
||||||
target_link_libraries(plat ALSA::ALSA)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
target_link_libraries(86Box Threads::Threads)
|
target_link_libraries(86Box Threads::Threads)
|
||||||
|
|
||||||
|
add_library(ui OBJECT unix_sdl.c unix_cdrom.c)
|
||||||
|
target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64)
|
||||||
|
target_link_libraries(ui dl)
|
||||||
|
@ -1,326 +0,0 @@
|
|||||||
#include <alsa/asoundlib.h>
|
|
||||||
#include <86box/86box.h>
|
|
||||||
#include <86box/config.h>
|
|
||||||
#include <86box/midi.h>
|
|
||||||
#include <86box/plat.h>
|
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
|
|
||||||
#define MAX_MIDI_DEVICES 128
|
|
||||||
|
|
||||||
static struct
|
|
||||||
{
|
|
||||||
int card;
|
|
||||||
int device;
|
|
||||||
int sub;
|
|
||||||
char name[50];
|
|
||||||
} midi_devices[MAX_MIDI_DEVICES], midi_in_devices[MAX_MIDI_DEVICES];
|
|
||||||
|
|
||||||
static int midi_device_count = 0, midi_in_device_count = 0;
|
|
||||||
|
|
||||||
static int midi_queried = 0, midi_in_queried = 0;
|
|
||||||
|
|
||||||
static snd_rawmidi_t *midiout = NULL, *midiin = NULL;
|
|
||||||
|
|
||||||
static void plat_midi_query()
|
|
||||||
{
|
|
||||||
int status;
|
|
||||||
int card = -1;
|
|
||||||
|
|
||||||
midi_queried = 1;
|
|
||||||
|
|
||||||
if ((status = snd_card_next(&card)) < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (card < 0)
|
|
||||||
return; /*No cards*/
|
|
||||||
|
|
||||||
while (card >= 0)
|
|
||||||
{
|
|
||||||
char *shortname;
|
|
||||||
|
|
||||||
if ((status = snd_card_get_name(card, &shortname)) >= 0)
|
|
||||||
{
|
|
||||||
snd_ctl_t *ctl;
|
|
||||||
char name[32];
|
|
||||||
|
|
||||||
sprintf(name, "hw:%i", card);
|
|
||||||
|
|
||||||
if ((status = snd_ctl_open(&ctl, name, 0)) >= 0)
|
|
||||||
{
|
|
||||||
int device = -1;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
status = snd_ctl_rawmidi_next_device(ctl, &device);
|
|
||||||
if (status >= 0 && device != -1)
|
|
||||||
{
|
|
||||||
snd_rawmidi_info_t *info;
|
|
||||||
int sub_nr, sub;
|
|
||||||
|
|
||||||
snd_rawmidi_info_alloca(&info);
|
|
||||||
snd_rawmidi_info_set_device(info, device);
|
|
||||||
snd_rawmidi_info_set_stream(info, SND_RAWMIDI_STREAM_OUTPUT);
|
|
||||||
snd_ctl_rawmidi_info(ctl, info);
|
|
||||||
sub_nr = snd_rawmidi_info_get_subdevices_count(info);
|
|
||||||
//pclog("sub_nr=%i\n",sub_nr);
|
|
||||||
|
|
||||||
for (sub = 0; sub < sub_nr; sub++)
|
|
||||||
{
|
|
||||||
snd_rawmidi_info_set_subdevice(info, sub);
|
|
||||||
|
|
||||||
if (snd_ctl_rawmidi_info(ctl, info) == 0)
|
|
||||||
{
|
|
||||||
//pclog("%s: MIDI device=%i:%i:%i\n", shortname, card, device,sub);
|
|
||||||
|
|
||||||
midi_devices[midi_device_count].card = card;
|
|
||||||
midi_devices[midi_device_count].device = device;
|
|
||||||
midi_devices[midi_device_count].sub = sub;
|
|
||||||
snprintf(midi_devices[midi_device_count].name, 50, "%s (%i:%i:%i)", shortname, card, device, sub);
|
|
||||||
midi_device_count++;
|
|
||||||
if (midi_device_count >= MAX_MIDI_DEVICES)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (device >= 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (snd_card_next(&card) < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_init()
|
|
||||||
{
|
|
||||||
char portname[32];
|
|
||||||
int midi_id;
|
|
||||||
|
|
||||||
if (!midi_queried)
|
|
||||||
plat_midi_query();
|
|
||||||
|
|
||||||
midi_id = config_get_int(SYSTEM_MIDI_NAME, "midi", 0);
|
|
||||||
|
|
||||||
sprintf(portname, "hw:%i,%i,%i", midi_devices[midi_id].card,
|
|
||||||
midi_devices[midi_id].device,
|
|
||||||
midi_devices[midi_id].sub);
|
|
||||||
//pclog("Opening MIDI port %s\n", portname);
|
|
||||||
|
|
||||||
if (snd_rawmidi_open(NULL, &midiout, portname, SND_RAWMIDI_SYNC) < 0)
|
|
||||||
{
|
|
||||||
//pclog("Failed to open MIDI\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_close()
|
|
||||||
{
|
|
||||||
if (midiout != NULL)
|
|
||||||
{
|
|
||||||
snd_rawmidi_close(midiout);
|
|
||||||
midiout = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static int midi_pos, midi_len;
|
|
||||||
static uint8_t midi_command[4];
|
|
||||||
static int midi_lengths[8] = {3, 3, 3, 3, 2, 2, 3, 1};
|
|
||||||
static int midi_insysex;
|
|
||||||
static uint8_t midi_sysex_data[65536];
|
|
||||||
|
|
||||||
int plat_midi_write(uint8_t val)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_play_sysex(uint8_t *sysex, unsigned int len)
|
|
||||||
{
|
|
||||||
if (midiout)
|
|
||||||
{
|
|
||||||
snd_rawmidi_write(midiout, (const void*)sysex, (size_t)len);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_play_msg(uint8_t *msg)
|
|
||||||
{
|
|
||||||
plat_midi_play_sysex(msg, midi_lengths[(msg[0] >> 4) & 7]);
|
|
||||||
}
|
|
||||||
|
|
||||||
int plat_midi_get_num_devs()
|
|
||||||
{
|
|
||||||
if (!midi_queried)
|
|
||||||
plat_midi_query();
|
|
||||||
|
|
||||||
return midi_device_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_get_dev_name(int num, char *s)
|
|
||||||
{
|
|
||||||
strcpy(s, midi_devices[num].name);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void plat_midi_query_in()
|
|
||||||
{
|
|
||||||
int status;
|
|
||||||
int card = -1;
|
|
||||||
|
|
||||||
midi_in_queried = 1;
|
|
||||||
|
|
||||||
if ((status = snd_card_next(&card)) < 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (card < 0)
|
|
||||||
return; /*No cards*/
|
|
||||||
|
|
||||||
while (card >= 0)
|
|
||||||
{
|
|
||||||
char *shortname;
|
|
||||||
|
|
||||||
if ((status = snd_card_get_name(card, &shortname)) >= 0)
|
|
||||||
{
|
|
||||||
snd_ctl_t *ctl;
|
|
||||||
char name[32];
|
|
||||||
|
|
||||||
sprintf(name, "hw:%i", card);
|
|
||||||
|
|
||||||
if ((status = snd_ctl_open(&ctl, name, 0)) >= 0)
|
|
||||||
{
|
|
||||||
int device = -1;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
status = snd_ctl_rawmidi_next_device(ctl, &device);
|
|
||||||
if (status >= 0 && device != -1)
|
|
||||||
{
|
|
||||||
snd_rawmidi_info_t *info;
|
|
||||||
int sub_nr, sub;
|
|
||||||
|
|
||||||
snd_rawmidi_info_alloca(&info);
|
|
||||||
snd_rawmidi_info_set_device(info, device);
|
|
||||||
snd_rawmidi_info_set_stream(info, SND_RAWMIDI_STREAM_INPUT);
|
|
||||||
snd_ctl_rawmidi_info(ctl, info);
|
|
||||||
sub_nr = snd_rawmidi_info_get_subdevices_count(info);
|
|
||||||
//pclog("sub_nr=%i\n",sub_nr);
|
|
||||||
|
|
||||||
for (sub = 0; sub < sub_nr; sub++)
|
|
||||||
{
|
|
||||||
snd_rawmidi_info_set_subdevice(info, sub);
|
|
||||||
|
|
||||||
if (snd_ctl_rawmidi_info(ctl, info) == 0)
|
|
||||||
{
|
|
||||||
//pclog("%s: MIDI device=%i:%i:%i\n", shortname, card, device,sub);
|
|
||||||
|
|
||||||
midi_in_devices[midi_device_count].card = card;
|
|
||||||
midi_in_devices[midi_device_count].device = device;
|
|
||||||
midi_in_devices[midi_device_count].sub = sub;
|
|
||||||
snprintf(midi_in_devices[midi_device_count].name, 50, "%s (%i:%i:%i)", shortname, card, device, sub);
|
|
||||||
midi_in_device_count++;
|
|
||||||
if (midi_in_device_count >= MAX_MIDI_DEVICES)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} while (device >= 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (snd_card_next(&card) < 0)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mutex_t* midiinmtx = NULL;
|
|
||||||
|
|
||||||
static void plat_midi_in_thread(void* param)
|
|
||||||
{
|
|
||||||
int sysexpos = 0;
|
|
||||||
uint8_t midimsg[3];
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
thread_wait_mutex(midiinmtx);
|
|
||||||
if (midiin == NULL)
|
|
||||||
{
|
|
||||||
thread_release_mutex(midiinmtx);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (snd_rawmidi_read(midiin, midimsg, 1) > 0)
|
|
||||||
{
|
|
||||||
if (midimsg[0] == 0xF0)
|
|
||||||
{
|
|
||||||
MIDI_InSysexBuf[sysexpos++] = 0xF0;
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
snd_rawmidi_read(midiin, &MIDI_InSysexBuf[sysexpos++], 1);
|
|
||||||
if (MIDI_InSysexBuf[sysexpos - 1] == 0xF7)
|
|
||||||
{
|
|
||||||
midi_in_sysex(MIDI_InSysexBuf, sysexpos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (midimsg[0] & 0x80)
|
|
||||||
{
|
|
||||||
int lengthofmsg = midi_lengths[(midimsg[0] >> 4) & 7] - 1;
|
|
||||||
snd_rawmidi_read(midiin, midimsg + 1, lengthofmsg);
|
|
||||||
midi_in_msg(midimsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
thread_release_mutex(midiinmtx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_input_init(void)
|
|
||||||
{
|
|
||||||
char portname[32];
|
|
||||||
int midi_id;
|
|
||||||
snd_rawmidi_params_t* params;
|
|
||||||
int err;
|
|
||||||
|
|
||||||
snd_rawmidi_params_malloc(¶ms);
|
|
||||||
if (!params) return;
|
|
||||||
if (!midi_in_queried)
|
|
||||||
plat_midi_query_in();
|
|
||||||
|
|
||||||
|
|
||||||
midi_id = config_get_int(MIDI_INPUT_NAME, "midi_input", 0);
|
|
||||||
|
|
||||||
sprintf(portname, "hw:%i,%i,%i", midi_in_devices[midi_id].card,
|
|
||||||
midi_in_devices[midi_id].device,
|
|
||||||
midi_in_devices[midi_id].sub);
|
|
||||||
//pclog("Opening MIDI port %s\n", portname);
|
|
||||||
|
|
||||||
if (snd_rawmidi_open(NULL, &midiin, portname, SND_RAWMIDI_NONBLOCK) < 0)
|
|
||||||
{
|
|
||||||
//pclog("Failed to open MIDI\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
midiin = thread_create_mutex();
|
|
||||||
thread_create(plat_midi_in_thread, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_input_close(void)
|
|
||||||
{
|
|
||||||
if (midiinmtx) thread_wait_mutex(midiinmtx);
|
|
||||||
if (midiin != NULL)
|
|
||||||
{
|
|
||||||
snd_rawmidi_close(midiin);
|
|
||||||
midiin = NULL;
|
|
||||||
}
|
|
||||||
if (midiinmtx)
|
|
||||||
{
|
|
||||||
thread_release_mutex(midiinmtx);
|
|
||||||
thread_close_mutex(midiinmtx);
|
|
||||||
}
|
|
||||||
midiinmtx = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
int plat_midi_in_get_num_devs(void)
|
|
||||||
{
|
|
||||||
if (!midi_queried)
|
|
||||||
plat_midi_query_in();
|
|
||||||
|
|
||||||
return midi_in_device_count;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_in_get_dev_name(int num, char *s)
|
|
||||||
{
|
|
||||||
strcpy(s, midi_in_devices[num].name);
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
#include <inttypes.h>
|
|
||||||
void plat_midi_init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_close(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_play_msg(uint8_t *msg)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_play_sysex(uint8_t *sysex, unsigned int len)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int plat_midi_write(uint8_t val)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int plat_midi_get_num_devs(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_get_dev_name(int num, char *s)
|
|
||||||
{
|
|
||||||
s[0] = ' ';
|
|
||||||
s[1] = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_input_init(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_input_close(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int plat_midi_in_get_num_devs(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void plat_midi_in_get_dev_name(int num, char *s)
|
|
||||||
{
|
|
||||||
s[0] = ' ';
|
|
||||||
s[1] = 0;
|
|
||||||
}
|
|
@ -134,9 +134,9 @@ sdl_blit_shim(int x, int y, int w, int h)
|
|||||||
params.w = w;
|
params.w = w;
|
||||||
params.h = h;
|
params.h = h;
|
||||||
if (!(!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)))
|
if (!(!sdl_enabled || (x < 0) || (y < 0) || (w <= 0) || (h <= 0) || (w > 2048) || (h > 2048) || (buffer32 == NULL) || (sdl_render == NULL) || (sdl_tex == NULL)))
|
||||||
video_copy(interpixels, &(buffer32->line[y][x]), h * (2048 + 64) * sizeof(uint32_t));
|
video_copy(interpixels, &(buffer32->line[y][x]), h * 2048 * sizeof(uint32_t));
|
||||||
if (screenshots)
|
if (screenshots)
|
||||||
video_screenshot(interpixels, 0, 0, (2048 + 64));
|
video_screenshot(interpixels, 0, 0, 2048);
|
||||||
blitreq = 1;
|
blitreq = 1;
|
||||||
video_blit_complete();
|
video_blit_complete();
|
||||||
}
|
}
|
||||||
@ -198,7 +198,7 @@ sdl_blit(int x, int y, int w, int h)
|
|||||||
r_src.y = y;
|
r_src.y = y;
|
||||||
r_src.w = w;
|
r_src.w = w;
|
||||||
r_src.h = h;
|
r_src.h = h;
|
||||||
SDL_UpdateTexture(sdl_tex, &r_src, interpixels, (2048 + 64) * 4);
|
SDL_UpdateTexture(sdl_tex, &r_src, interpixels, 2048 * 4);
|
||||||
blitreq = 0;
|
blitreq = 0;
|
||||||
|
|
||||||
sdl_real_blit(&r_src);
|
sdl_real_blit(&r_src);
|
||||||
|
@ -53,9 +53,9 @@ thread_create(void (*thread_rout)(void *param), void *param)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
thread_wait(thread_t *arg, int timeout)
|
thread_wait(thread_t *arg)
|
||||||
{
|
{
|
||||||
return pthread_join(*(pthread_t*)(arg), NULL) != 0;
|
return pthread_join(*(pthread_t*)(arg), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,14 +144,6 @@ thread_create_mutex(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mutex_t *
|
|
||||||
thread_create_mutex_with_spin_count(unsigned int spin_count)
|
|
||||||
{
|
|
||||||
/* Setting spin count of a mutex is not possible with pthreads. */
|
|
||||||
return thread_create_mutex();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
thread_wait_mutex(mutex_t *_mutex)
|
thread_wait_mutex(mutex_t *_mutex)
|
||||||
{
|
{
|
||||||
|
@ -3459,7 +3459,7 @@ void mach64_close(void *p)
|
|||||||
|
|
||||||
mach64->thread_run = 0;
|
mach64->thread_run = 0;
|
||||||
thread_set_event(mach64->wake_fifo_thread);
|
thread_set_event(mach64->wake_fifo_thread);
|
||||||
thread_wait(mach64->fifo_thread, -1);
|
thread_wait(mach64->fifo_thread);
|
||||||
thread_destroy_event(mach64->wake_fifo_thread);
|
thread_destroy_event(mach64->wake_fifo_thread);
|
||||||
thread_destroy_event(mach64->fifo_not_full_event);
|
thread_destroy_event(mach64->fifo_not_full_event);
|
||||||
|
|
||||||
|
@ -69,6 +69,9 @@ int egaswitchread, egaswitches=9;
|
|||||||
int update_overscan = 0;
|
int update_overscan = 0;
|
||||||
|
|
||||||
|
|
||||||
|
uint8_t ega_in(uint16_t addr, void *p);
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ega_out(uint16_t addr, uint8_t val, void *p)
|
ega_out(uint16_t addr, uint8_t val, void *p)
|
||||||
{
|
{
|
||||||
@ -145,6 +148,9 @@ ega_out(uint16_t addr, uint8_t val, void *p)
|
|||||||
ega->vidclock = val & 4;
|
ega->vidclock = val & 4;
|
||||||
ega->miscout = val;
|
ega->miscout = val;
|
||||||
ega->overscan_color = ega->vres ? pallook16[ega->attrregs[0x11] & 0x0f] : pallook64[ega->attrregs[0x11] & 0x3f];
|
ega->overscan_color = ega->vres ? pallook16[ega->attrregs[0x11] & 0x0f] : pallook64[ega->attrregs[0x11] & 0x3f];
|
||||||
|
io_removehandler(0x03a0, 0x0020, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
||||||
|
if (!(val & 1))
|
||||||
|
io_sethandler(0x03a0, 0x0020, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
||||||
if ((o ^ val) & 0x80)
|
if ((o ^ val) & 0x80)
|
||||||
ega_recalctimings(ega);
|
ega_recalctimings(ega);
|
||||||
break;
|
break;
|
||||||
@ -237,10 +243,13 @@ ega_out(uint16_t addr, uint8_t val, void *p)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ega_in(uint16_t addr, void *p)
|
|
||||||
|
uint8_t
|
||||||
|
ega_in(uint16_t addr, void *p)
|
||||||
{
|
{
|
||||||
ega_t *ega = (ega_t *)p;
|
ega_t *ega = (ega_t *)p;
|
||||||
uint8_t ret = 0xff;
|
uint8_t ret = 0xff;
|
||||||
|
uint16_t port = addr;
|
||||||
|
|
||||||
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(ega->miscout & 1))
|
if (((addr & 0xfff0) == 0x3d0 || (addr & 0xfff0) == 0x3b0) && !(ega->miscout & 1))
|
||||||
addr ^= 0x60;
|
addr ^= 0x60;
|
||||||
@ -979,6 +988,8 @@ ega_init(ega_t *ega, int monitor_type, int is_mono)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
io_sethandler(0x03a0, 0x0020, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
||||||
} else {
|
} else {
|
||||||
for (c = 0; c < 256; c++) {
|
for (c = 0; c < 256; c++) {
|
||||||
pallook64[c] = makecol32(((c >> 2) & 1) * 0xaa, ((c >> 1) & 1) * 0xaa, (c & 1) * 0xaa);
|
pallook64[c] = makecol32(((c >> 2) & 1) * 0xaa, ((c >> 1) & 1) * 0xaa, (c & 1) * 0xaa);
|
||||||
@ -988,6 +999,8 @@ ega_init(ega_t *ega, int monitor_type, int is_mono)
|
|||||||
if ((c & 0x17) == 6)
|
if ((c & 0x17) == 6)
|
||||||
pallook16[c] = makecol32(0xaa, 0x55, 0);
|
pallook16[c] = makecol32(0xaa, 0x55, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ega->miscout |= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ega->pallook = pallook16;
|
ega->pallook = pallook16;
|
||||||
@ -1078,7 +1091,7 @@ ega_standalone_init(const device_t *info)
|
|||||||
ega->vrammask = ega->vram_limit - 1;
|
ega->vrammask = ega->vram_limit - 1;
|
||||||
|
|
||||||
mem_mapping_add(&ega->mapping, 0xa0000, 0x20000, ega_read, NULL, NULL, ega_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, ega);
|
mem_mapping_add(&ega->mapping, 0xa0000, 0x20000, ega_read, NULL, NULL, ega_write, NULL, NULL, NULL, MEM_MAPPING_EXTERNAL, ega);
|
||||||
io_sethandler(0x03a0, 0x0040, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
io_sethandler(0x03c0, 0x0020, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
||||||
|
|
||||||
if (info->local == EGA_ATI) {
|
if (info->local == EGA_ATI) {
|
||||||
io_sethandler(0x01ce, 0x0002, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
io_sethandler(0x01ce, 0x0002, ega_in, NULL, NULL, ega_out, NULL, NULL, ega);
|
||||||
|
@ -5036,7 +5036,7 @@ mystique_close(void *p)
|
|||||||
|
|
||||||
mystique->thread_run = 0;
|
mystique->thread_run = 0;
|
||||||
thread_set_event(mystique->wake_fifo_thread);
|
thread_set_event(mystique->wake_fifo_thread);
|
||||||
thread_wait(mystique->fifo_thread, -1);
|
thread_wait(mystique->fifo_thread);
|
||||||
thread_destroy_event(mystique->wake_fifo_thread);
|
thread_destroy_event(mystique->wake_fifo_thread);
|
||||||
thread_destroy_event(mystique->fifo_not_full_event);
|
thread_destroy_event(mystique->fifo_not_full_event);
|
||||||
thread_close_mutex(mystique->dma.lock);
|
thread_close_mutex(mystique->dma.lock);
|
||||||
|
@ -2624,7 +2624,7 @@ pgc_close(void *priv)
|
|||||||
pgc_log("PGC: waiting for thread to stop...\n");
|
pgc_log("PGC: waiting for thread to stop...\n");
|
||||||
#endif
|
#endif
|
||||||
// while (dev->stopped);
|
// while (dev->stopped);
|
||||||
thread_wait(dev->pgc_thread, -1);
|
thread_wait(dev->pgc_thread);
|
||||||
#ifdef ENABLE_PGC_LOG
|
#ifdef ENABLE_PGC_LOG
|
||||||
pgc_log("PGC: thread stopped, closing up.\n");
|
pgc_log("PGC: thread stopped, closing up.\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -4097,7 +4097,7 @@ static void s3_virge_close(void *p)
|
|||||||
|
|
||||||
virge->render_thread_run = 0;
|
virge->render_thread_run = 0;
|
||||||
thread_set_event(virge->wake_render_thread);
|
thread_set_event(virge->wake_render_thread);
|
||||||
thread_wait(virge->render_thread, -1);
|
thread_wait(virge->render_thread);
|
||||||
thread_destroy_event(virge->not_full_event);
|
thread_destroy_event(virge->not_full_event);
|
||||||
thread_destroy_event(virge->wake_main_thread);
|
thread_destroy_event(virge->wake_main_thread);
|
||||||
thread_destroy_event(virge->wake_render_thread);
|
thread_destroy_event(virge->wake_render_thread);
|
||||||
|
@ -274,7 +274,7 @@ void
|
|||||||
video_pre_reset(int card)
|
video_pre_reset(int card)
|
||||||
{
|
{
|
||||||
if ((card == VID_NONE) || \
|
if ((card == VID_NONE) || \
|
||||||
(card == VID_INTERNAL) || (machines[machine].flags & MACHINE_VIDEO_ONLY))
|
(card == VID_INTERNAL) || machine_has_flags(machine, MACHINE_VIDEO_ONLY))
|
||||||
video_prepare();
|
video_prepare();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,13 +287,13 @@ video_reset(int card)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
vid_table_log("VIDEO: reset (gfxcard=%d, internal=%d)\n",
|
vid_table_log("VIDEO: reset (gfxcard=%d, internal=%d)\n",
|
||||||
card, (machines[machine].flags & MACHINE_VIDEO)?1:0);
|
card, machine_has_flags(machine, MACHINE_VIDEO) ? 1 : 0);
|
||||||
|
|
||||||
loadfont("roms/video/mda/mda.rom", 0);
|
loadfont("roms/video/mda/mda.rom", 0);
|
||||||
|
|
||||||
/* Do not initialize internal cards here. */
|
/* Do not initialize internal cards here. */
|
||||||
if (!(card == VID_NONE) && \
|
if (!(card == VID_NONE) && \
|
||||||
!(card == VID_INTERNAL) && !(machines[machine].flags & MACHINE_VIDEO_ONLY)) {
|
!(card == VID_INTERNAL) && !machine_has_flags(machine, MACHINE_VIDEO_ONLY)) {
|
||||||
vid_table_log("VIDEO: initializing '%s'\n", video_cards[card].name);
|
vid_table_log("VIDEO: initializing '%s'\n", video_cards[card].name);
|
||||||
|
|
||||||
video_prepare();
|
video_prepare();
|
||||||
|
@ -1048,7 +1048,7 @@ void *voodoo_card_init()
|
|||||||
|
|
||||||
voodoo->force_blit_count = 0;
|
voodoo->force_blit_count = 0;
|
||||||
voodoo->can_blit = 0;
|
voodoo->can_blit = 0;
|
||||||
voodoo->force_blit_mutex = thread_create_mutex_with_spin_count(MUTEX_DEFAULT_SPIN_COUNT);
|
voodoo->force_blit_mutex = thread_create_mutex();
|
||||||
|
|
||||||
return voodoo;
|
return voodoo;
|
||||||
}
|
}
|
||||||
@ -1172,7 +1172,7 @@ void *voodoo_2d3d_card_init(int type)
|
|||||||
|
|
||||||
voodoo->force_blit_count = 0;
|
voodoo->force_blit_count = 0;
|
||||||
voodoo->can_blit = 0;
|
voodoo->can_blit = 0;
|
||||||
voodoo->force_blit_mutex = thread_create_mutex_with_spin_count(MUTEX_DEFAULT_SPIN_COUNT);
|
voodoo->force_blit_mutex = thread_create_mutex();
|
||||||
|
|
||||||
return voodoo;
|
return voodoo;
|
||||||
}
|
}
|
||||||
@ -1241,22 +1241,22 @@ void voodoo_card_close(voodoo_t *voodoo)
|
|||||||
|
|
||||||
voodoo->fifo_thread_run = 0;
|
voodoo->fifo_thread_run = 0;
|
||||||
thread_set_event(voodoo->wake_fifo_thread);
|
thread_set_event(voodoo->wake_fifo_thread);
|
||||||
thread_wait(voodoo->fifo_thread, -1);
|
thread_wait(voodoo->fifo_thread);
|
||||||
voodoo->render_thread_run[0] = 0;
|
voodoo->render_thread_run[0] = 0;
|
||||||
thread_set_event(voodoo->wake_render_thread[0]);
|
thread_set_event(voodoo->wake_render_thread[0]);
|
||||||
thread_wait(voodoo->render_thread[0], -1);
|
thread_wait(voodoo->render_thread[0]);
|
||||||
if (voodoo->render_threads >= 2) {
|
if (voodoo->render_threads >= 2) {
|
||||||
voodoo->render_thread_run[1] = 0;
|
voodoo->render_thread_run[1] = 0;
|
||||||
thread_set_event(voodoo->wake_render_thread[1]);
|
thread_set_event(voodoo->wake_render_thread[1]);
|
||||||
thread_wait(voodoo->render_thread[1], -1);
|
thread_wait(voodoo->render_thread[1]);
|
||||||
}
|
}
|
||||||
if (voodoo->render_threads == 4) {
|
if (voodoo->render_threads == 4) {
|
||||||
voodoo->render_thread_run[2] = 0;
|
voodoo->render_thread_run[2] = 0;
|
||||||
thread_set_event(voodoo->wake_render_thread[2]);
|
thread_set_event(voodoo->wake_render_thread[2]);
|
||||||
thread_wait(voodoo->render_thread[2], -1);
|
thread_wait(voodoo->render_thread[2]);
|
||||||
voodoo->render_thread_run[3] = 0;
|
voodoo->render_thread_run[3] = 0;
|
||||||
thread_set_event(voodoo->wake_render_thread[3]);
|
thread_set_event(voodoo->wake_render_thread[3]);
|
||||||
thread_wait(voodoo->render_thread[3], -1);
|
thread_wait(voodoo->render_thread[3]);
|
||||||
}
|
}
|
||||||
thread_destroy_event(voodoo->fifo_not_full_event);
|
thread_destroy_event(voodoo->fifo_not_full_event);
|
||||||
thread_destroy_event(voodoo->wake_main_thread);
|
thread_destroy_event(voodoo->wake_main_thread);
|
||||||
|
@ -831,7 +831,7 @@ video_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Account for overscan. */
|
/* Account for overscan. */
|
||||||
buffer32 = create_bitmap(2048 + 64, 2048 + 64);
|
buffer32 = create_bitmap(2048, 2048);
|
||||||
|
|
||||||
for (c = 0; c < 64; c++) {
|
for (c = 0; c < 64; c++) {
|
||||||
cgapal[c + 64].r = (((c & 4) ? 2 : 0) | ((c & 0x10) ? 1 : 0)) * 21;
|
cgapal[c + 64].r = (((c & 4) ? 2 : 0) | ((c & 0x10) ? 1 : 0)) * 21;
|
||||||
@ -889,7 +889,7 @@ video_close(void)
|
|||||||
{
|
{
|
||||||
thread_run = 0;
|
thread_run = 0;
|
||||||
thread_set_event(blit_data.wake_blit_thread);
|
thread_set_event(blit_data.wake_blit_thread);
|
||||||
thread_wait(blit_data.blit_thread, -1);
|
thread_wait(blit_data.blit_thread);
|
||||||
thread_destroy_event(blit_data.buffer_not_in_use);
|
thread_destroy_event(blit_data.buffer_not_in_use);
|
||||||
thread_destroy_event(blit_data.blit_complete);
|
thread_destroy_event(blit_data.blit_complete);
|
||||||
thread_destroy_event(blit_data.wake_blit_thread);
|
thread_destroy_event(blit_data.wake_blit_thread);
|
||||||
|
@ -15,14 +15,18 @@
|
|||||||
|
|
||||||
enable_language(RC)
|
enable_language(RC)
|
||||||
|
|
||||||
add_library(plat OBJECT win.c win_dynld.c win_cdrom.c win_thread.c
|
add_library(plat OBJECT win.c win_dynld.c win_cdrom.c win_keyboard.c
|
||||||
win_keyboard.c win_crashdump.c win_mouse.c)
|
win_crashdump.c win_mouse.c)
|
||||||
|
|
||||||
add_library(ui OBJECT win_ui.c win_icon.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
add_library(ui OBJECT win_ui.c win_icon.c win_stbar.c win_sdl.c win_dialog.c win_about.c
|
||||||
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
win_settings.c win_devconf.c win_snd_gain.c win_specify_dim.c win_new_floppy.c
|
||||||
win_jsconf.c win_media_menu.c win_preferences.c win_discord.c glad.c win_opengl.c
|
win_jsconf.c win_media_menu.c win_preferences.c win_discord.c glad.c win_opengl.c
|
||||||
win_opengl_glslp.c 86Box.rc)
|
win_opengl_glslp.c 86Box.rc)
|
||||||
|
|
||||||
|
if(NOT CPPTHREADS)
|
||||||
|
target_sources(plat PRIVATE win_thread.c)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
# MSVC complains when we include the manifest from 86Box.rc...
|
# MSVC complains when we include the manifest from 86Box.rc...
|
||||||
# On the bright side, CMake supports passing the manifest as a source
|
# On the bright side, CMake supports passing the manifest as a source
|
||||||
|
@ -163,6 +163,9 @@ endif
|
|||||||
ifndef DYNAREC
|
ifndef DYNAREC
|
||||||
DYNAREC := y
|
DYNAREC := y
|
||||||
endif
|
endif
|
||||||
|
ifndef CPPTHREADS
|
||||||
|
CPPTHREADS := y
|
||||||
|
endif
|
||||||
ifeq ($(DYNAREC), y)
|
ifeq ($(DYNAREC), y)
|
||||||
ifeq ($(ARM), y)
|
ifeq ($(ARM), y)
|
||||||
ifeq ($(NEW_DYNAREC), n)
|
ifeq ($(NEW_DYNAREC), n)
|
||||||
@ -370,6 +373,12 @@ MUNTOBJ := midi_mt32.o \
|
|||||||
Synth.o Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
|
Synth.o Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CPPTHREADS), y)
|
||||||
|
THREADOBJ := thread.o
|
||||||
|
else
|
||||||
|
THREADOBJ := win_thread.o
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(VNC), y)
|
ifeq ($(VNC), y)
|
||||||
OPTS += -DUSE_VNC
|
OPTS += -DUSE_VNC
|
||||||
RFLAGS += -DUSE_VNC
|
RFLAGS += -DUSE_VNC
|
||||||
@ -466,7 +475,7 @@ CXXFLAGS := $(CFLAGS)
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
MAINOBJ := 86box.o config.o log.o random.o timer.o io.o acpi.o apm.o dma.o ddma.o \
|
MAINOBJ := 86box.o config.o log.o random.o timer.o io.o acpi.o apm.o dma.o ddma.o \
|
||||||
nmi.o pic.o pit.o port_6x.o port_92.o ppi.o pci.o mca.o \
|
nmi.o pic.o pit.o port_6x.o port_92.o ppi.o pci.o mca.o \
|
||||||
usb.o device.o nvr.o nvr_at.o nvr_ps2.o rtmidi_midi.o \
|
usb.o device.o nvr.o nvr_at.o nvr_ps2.o \
|
||||||
$(VNCOBJ)
|
$(VNCOBJ)
|
||||||
|
|
||||||
MEMOBJ := catalyst_flash.o i2c_eeprom.o intel_flash.o mem.o rom.o smram.o spd.o sst_flash.o
|
MEMOBJ := catalyst_flash.o i2c_eeprom.o intel_flash.o mem.o rom.o smram.o spd.o sst_flash.o
|
||||||
@ -608,7 +617,7 @@ SNDOBJ := sound.o \
|
|||||||
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
|
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
|
||||||
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
|
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
|
||||||
wave8580_PST.o wave.o \
|
wave8580_PST.o wave.o \
|
||||||
midi.o midi_system.o \
|
midi.o midi_rtmidi.o \
|
||||||
snd_speaker.o \
|
snd_speaker.o \
|
||||||
snd_pssj.o \
|
snd_pssj.o \
|
||||||
snd_lpt_dac.o snd_lpt_dss.o \
|
snd_lpt_dac.o snd_lpt_dss.o \
|
||||||
@ -672,7 +681,7 @@ VOODOOOBJ := vid_voodoo.o vid_voodoo_banshee.o \
|
|||||||
vid_voodoo_texture.o
|
vid_voodoo_texture.o
|
||||||
|
|
||||||
PLATOBJ := win.o \
|
PLATOBJ := win.o \
|
||||||
win_dynld.o win_thread.o \
|
win_dynld.o \
|
||||||
win_cdrom.o win_keyboard.o \
|
win_cdrom.o win_keyboard.o \
|
||||||
win_crashdump.o \
|
win_crashdump.o \
|
||||||
win_mouse.o
|
win_mouse.o
|
||||||
@ -693,7 +702,7 @@ endif
|
|||||||
OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \
|
OBJ := $(MAINOBJ) $(CPUOBJ) $(CHIPSETOBJ) $(MCHOBJ) $(DEVOBJ) $(MEMOBJ) \
|
||||||
$(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) $(MINIVHDOBJ) \
|
$(FDDOBJ) $(GAMEOBJ) $(CDROMOBJ) $(ZIPOBJ) $(MOOBJ) $(HDDOBJ) $(MINIVHDOBJ) \
|
||||||
$(NETOBJ) $(PRINTOBJ) $(SCSIOBJ) $(SIOOBJ) $(SNDOBJ) $(VIDOBJ) $(VOODOOOBJ) \
|
$(NETOBJ) $(PRINTOBJ) $(SCSIOBJ) $(SIOOBJ) $(SNDOBJ) $(VIDOBJ) $(VOODOOOBJ) \
|
||||||
$(PLATOBJ) $(UIOBJ) $(FSYNTHOBJ) $(MUNTOBJ) $(DEVBROBJ) $(MINITRACEOBJ)
|
$(PLATOBJ) $(UIOBJ) $(FSYNTHOBJ) $(MUNTOBJ) $(DEVBROBJ) $(MINITRACEOBJ) $(THREADOBJ)
|
||||||
ifdef EXOBJ
|
ifdef EXOBJ
|
||||||
OBJ += $(EXOBJ)
|
OBJ += $(EXOBJ)
|
||||||
endif
|
endif
|
||||||
|
@ -274,7 +274,7 @@ END
|
|||||||
|
|
||||||
#define STR_OK "OK"
|
#define STR_OK "OK"
|
||||||
#define STR_CANCEL "Annuler"
|
#define STR_CANCEL "Annuler"
|
||||||
#define STR_GLOBAL "Sauver ces paramètres comme valeurs par défaut &globales"
|
#define STR_GLOBAL "Sauvegarder ces paramètres comme valeurs par défaut &globales"
|
||||||
#define STR_DEFAULT "&Défaut"
|
#define STR_DEFAULT "&Défaut"
|
||||||
#define STR_LANGUAGE "Langue:"
|
#define STR_LANGUAGE "Langue:"
|
||||||
#define STR_ICONSET "Ensemble d'icônes:"
|
#define STR_ICONSET "Ensemble d'icônes:"
|
||||||
@ -478,9 +478,9 @@ BEGIN
|
|||||||
IDS_2118 "Côntrolleur interne"
|
IDS_2118 "Côntrolleur interne"
|
||||||
IDS_2119 "Sortir"
|
IDS_2119 "Sortir"
|
||||||
IDS_2120 "Pas de ROMs trouvées"
|
IDS_2120 "Pas de ROMs trouvées"
|
||||||
IDS_2121 "Voulez-vous sauver les paramètres ?"
|
IDS_2121 "Voulez-vous sauvegarder les paramètres ?"
|
||||||
IDS_2122 "Cela entraînera la réinitialisation complète de la machine émulée."
|
IDS_2122 "Cela entraînera la réinitialisation complète de la machine émulée."
|
||||||
IDS_2123 "Sauver"
|
IDS_2123 "Sauvegarder"
|
||||||
IDS_2124 "À propos de 86Box"
|
IDS_2124 "À propos de 86Box"
|
||||||
IDS_2125 "86Box v" EMU_VERSION
|
IDS_2125 "86Box v" EMU_VERSION
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ BEGIN
|
|||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "退出(&x)...", IDM_ACTION_EXIT
|
MENUITEM "退出(&x)...", IDM_ACTION_EXIT
|
||||||
END
|
END
|
||||||
POPUP "视图(&V)"
|
POPUP "显示(&V)"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "隐藏状态栏(&H)", IDM_VID_HIDE_STATUS_BAR
|
MENUITEM "隐藏状态栏(&H)", IDM_VID_HIDE_STATUS_BAR
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
@ -69,7 +69,7 @@ BEGIN
|
|||||||
MENUITEM "全屏拉伸(&F)", IDM_VID_FS_FULL
|
MENUITEM "全屏拉伸(&F)", IDM_VID_FS_FULL
|
||||||
MENUITEM "&4:3", IDM_VID_FS_43
|
MENUITEM "&4:3", IDM_VID_FS_43
|
||||||
MENUITEM "保持比例(&S)", IDM_VID_FS_KEEPRATIO
|
MENUITEM "保持比例(&S)", IDM_VID_FS_KEEPRATIO
|
||||||
MENUITEM "整数倍放大&I", IDM_VID_FS_INT
|
MENUITEM "整数倍放大(&I)", IDM_VID_FS_INT
|
||||||
END
|
END
|
||||||
POPUP "E&GA/(S)VGA 设置"
|
POPUP "E&GA/(S)VGA 设置"
|
||||||
BEGIN
|
BEGIN
|
||||||
@ -115,7 +115,7 @@ BEGIN
|
|||||||
POPUP "记录日志(&L)"
|
POPUP "记录日志(&L)"
|
||||||
BEGIN
|
BEGIN
|
||||||
# ifdef ENABLE_BUSLOGIC_LOG
|
# ifdef ENABLE_BUSLOGIC_LOG
|
||||||
MENUITEM "启用 总线Logic 日志\tCtrl+F4", IDM_LOG_BUSLOGIC
|
MENUITEM "启用 BusLogic 日志\tCtrl+F4", IDM_LOG_BUSLOGIC
|
||||||
# endif
|
# endif
|
||||||
# ifdef ENABLE_CDROM_LOG
|
# ifdef ENABLE_CDROM_LOG
|
||||||
MENUITEM "启用 CD-ROM 日志\tCtrl+F5", IDM_LOG_CDROM
|
MENUITEM "启用 CD-ROM 日志\tCtrl+F5", IDM_LOG_CDROM
|
||||||
@ -382,7 +382,7 @@ END
|
|||||||
#define STR_ISAMEM_2 "扩展卡 2:"
|
#define STR_ISAMEM_2 "扩展卡 2:"
|
||||||
#define STR_ISAMEM_3 "扩展卡 3:"
|
#define STR_ISAMEM_3 "扩展卡 3:"
|
||||||
#define STR_ISAMEM_4 "扩展卡 4:"
|
#define STR_ISAMEM_4 "扩展卡 4:"
|
||||||
#define STR_BUGGER "ISABugger device"
|
#define STR_BUGGER "ISABugger 设备"
|
||||||
#define STR_POSTCARD "自检卡(POST)"
|
#define STR_POSTCARD "自检卡(POST)"
|
||||||
|
|
||||||
#define FONT_SIZE 9
|
#define FONT_SIZE 9
|
||||||
@ -408,7 +408,7 @@ BEGIN
|
|||||||
IDS_2056 "86Box 找不到支持的 ROM 镜像.\n\n请<a href=""https://github.com/86Box/roms/releases/latest"">下载</a>ROM包并解压到 ""roms"" 文件夹."
|
IDS_2056 "86Box 找不到支持的 ROM 镜像.\n\n请<a href=""https://github.com/86Box/roms/releases/latest"">下载</a>ROM包并解压到 ""roms"" 文件夹."
|
||||||
IDS_2057 "(空)"
|
IDS_2057 "(空)"
|
||||||
IDS_2058 "ZIP 镜像 (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0所有文件 (*.*)\0*.*\0"
|
IDS_2058 "ZIP 镜像 (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0所有文件 (*.*)\0*.*\0"
|
||||||
IDS_2059 "Turbo"
|
IDS_2059 "加速"
|
||||||
IDS_2060 "开"
|
IDS_2060 "开"
|
||||||
IDS_2061 "关"
|
IDS_2061 "关"
|
||||||
IDS_2062 "所有镜像 (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0基本扇区镜像 (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0表面镜像 (*.86F)\0*.86F\0"
|
IDS_2062 "所有镜像 (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0基本扇区镜像 (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0表面镜像 (*.86F)\0*.86F\0"
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
#define GLOBAL
|
#define GLOBAL
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#ifdef USE_VNC
|
#ifdef USE_VNC
|
||||||
# include <86box/vnc.h>
|
# include <86box/vnc.h>
|
||||||
@ -250,28 +249,28 @@ has_language_changed(uint32_t id)
|
|||||||
void
|
void
|
||||||
set_language(uint32_t id)
|
set_language(uint32_t id)
|
||||||
{
|
{
|
||||||
if (id == 0xFFFF)
|
if (id == 0xFFFF) {
|
||||||
{
|
set_language(lang_sys);
|
||||||
set_language(lang_sys);
|
lang_id = id;
|
||||||
lang_id = id;
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (lang_id != id) {
|
if (lang_id != id) {
|
||||||
/* Set our new language ID. */
|
/* Set our new language ID. */
|
||||||
lang_id = id;
|
lang_id = id;
|
||||||
SetThreadUILanguage(lang_id);
|
SetThreadUILanguage(lang_id);
|
||||||
|
|
||||||
/* Load the strings table for this ID. */
|
/* Load the strings table for this ID. */
|
||||||
LoadCommonStrings();
|
LoadCommonStrings();
|
||||||
|
|
||||||
/* Reload main menu */
|
/* Reload main menu */
|
||||||
menuMain = LoadMenu(hinstance, L"MainMenu");
|
menuMain = LoadMenu(hinstance, L"MainMenu");
|
||||||
|
if (hwndMain != NULL)
|
||||||
SetMenu(hwndMain, menuMain);
|
SetMenu(hwndMain, menuMain);
|
||||||
|
|
||||||
/* Re-init all the menus */
|
/* Re-init all the menus */
|
||||||
ResetAllMenus();
|
ResetAllMenus();
|
||||||
media_menu_init();
|
media_menu_init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#include <86box/config.h>
|
#include <86box/config.h>
|
||||||
#include <86box/device.h>
|
#include <86box/device.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
#include <86box/midi_rtmidi.h>
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#include <86box/win.h>
|
#include <86box/win.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
@ -97,9 +97,9 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
val_int = config_get_int((char *) config_device.name,
|
val_int = config_get_int((char *) config_device.name,
|
||||||
(char *) config->name, config->default_int);
|
(char *) config->name, config->default_int);
|
||||||
|
|
||||||
num = plat_midi_get_num_devs();
|
num = rtmidi_get_num_devs();
|
||||||
for (c = 0; c < num; c++) {
|
for (c = 0; c < num; c++) {
|
||||||
plat_midi_get_dev_name(c, s);
|
rtmidi_get_dev_name(c, s);
|
||||||
mbstowcs(lptsTemp, s, strlen(s) + 1);
|
mbstowcs(lptsTemp, s, strlen(s) + 1);
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp);
|
||||||
if (val_int == c)
|
if (val_int == c)
|
||||||
@ -112,9 +112,9 @@ deviceconfig_dlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
val_int = config_get_int((char *) config_device.name,
|
val_int = config_get_int((char *) config_device.name,
|
||||||
(char *) config->name, config->default_int);
|
(char *) config->name, config->default_int);
|
||||||
|
|
||||||
num = plat_midi_in_get_num_devs();
|
num = rtmidi_in_get_num_devs();
|
||||||
for (c = 0; c < num; c++) {
|
for (c = 0; c < num; c++) {
|
||||||
plat_midi_in_get_dev_name(c, s);
|
rtmidi_in_get_dev_name(c, s);
|
||||||
mbstowcs(lptsTemp, s, strlen(s) + 1);
|
mbstowcs(lptsTemp, s, strlen(s) + 1);
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)(LPCSTR)lptsTemp);
|
||||||
if (val_int == c)
|
if (val_int == c)
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#include <86box/zip.h>
|
#include <86box/zip.h>
|
||||||
#include <86box/win.h>
|
#include <86box/win.h>
|
||||||
|
|
||||||
#define MACHINE_HAS_IDE (machines[machine].flags & MACHINE_IDE_QUAD)
|
#define MACHINE_HAS_IDE (machine_has_flags(machine, MACHINE_IDE_QUAD))
|
||||||
#define MACHINE_HAS_SCSI (machines[machine].flags & MACHINE_SCSI_DUAL)
|
#define MACHINE_HAS_SCSI (machine_has_flags(machine, MACHINE_SCSI_DUAL))
|
||||||
|
|
||||||
#define CASSETTE_FIRST 0
|
#define CASSETTE_FIRST 0
|
||||||
#define CARTRIDGE_FIRST CASSETTE_FIRST + 1
|
#define CARTRIDGE_FIRST CASSETTE_FIRST + 1
|
||||||
@ -403,7 +403,7 @@ media_menu_load_submenus()
|
|||||||
static inline int
|
static inline int
|
||||||
is_valid_cartridge(void)
|
is_valid_cartridge(void)
|
||||||
{
|
{
|
||||||
return ((machines[machine].flags & MACHINE_CARTRIDGE) ? 1 : 0);
|
return (machine_has_cartridge(machine));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,10 +62,10 @@ typedef LONG atomic_flag;
|
|||||||
|
|
||||||
static const int INIT_WIDTH = 640;
|
static const int INIT_WIDTH = 640;
|
||||||
static const int INIT_HEIGHT = 400;
|
static const int INIT_HEIGHT = 400;
|
||||||
static const int BUFFERPIXELS = 4460544; /* Same size as render_buffer, pow(2048+64,2). */
|
static const int BUFFERPIXELS = 4194304; /* Same size as render_buffer, pow(2048+64,2). */
|
||||||
static const int BUFFERBYTES = 17842176; /* Pixel is 4 bytes. */
|
static const int BUFFERBYTES = 16777216; /* Pixel is 4 bytes. */
|
||||||
static const int BUFFERCOUNT = 3; /* How many buffers to use for pixel transfer (2-3 is commonly recommended). */
|
static const int BUFFERCOUNT = 3; /* How many buffers to use for pixel transfer (2-3 is commonly recommended). */
|
||||||
static const int ROW_LENGTH = 2112; /* Source buffer row lenght (including padding) */
|
static const int ROW_LENGTH = 2048; /* Source buffer row lenght (including padding) */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A dedicated OpenGL thread.
|
* @brief A dedicated OpenGL thread.
|
||||||
@ -947,7 +947,7 @@ void opengl_close(void)
|
|||||||
|
|
||||||
SetEvent(sync_objects.closing);
|
SetEvent(sync_objects.closing);
|
||||||
|
|
||||||
thread_wait(thread, -1);
|
thread_wait(thread);
|
||||||
|
|
||||||
thread_close_mutex(resize_info.mutex);
|
thread_close_mutex(resize_info.mutex);
|
||||||
thread_close_mutex(options.mutex);
|
thread_close_mutex(options.mutex);
|
||||||
|
@ -244,10 +244,10 @@ sdl_blit(int x, int y, int w, int h)
|
|||||||
|
|
||||||
SDL_LockTexture(sdl_tex, 0, &pixeldata, &pitch);
|
SDL_LockTexture(sdl_tex, 0, &pixeldata, &pitch);
|
||||||
|
|
||||||
video_copy(pixeldata, &(buffer32->line[y][x]), h * (2048 + 64) * sizeof(uint32_t));
|
video_copy(pixeldata, &(buffer32->line[y][x]), h * 2048 * sizeof(uint32_t));
|
||||||
|
|
||||||
if (screenshots)
|
if (screenshots)
|
||||||
video_screenshot((uint32_t *) pixeldata, 0, 0, (2048 + 64));
|
video_screenshot((uint32_t *) pixeldata, 0, 0, 2048);
|
||||||
|
|
||||||
SDL_UnlockTexture(sdl_tex);
|
SDL_UnlockTexture(sdl_tex);
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ sdl_init_texture(void)
|
|||||||
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_SOFTWARE);
|
sdl_render = SDL_CreateRenderer(sdl_win, -1, SDL_RENDERER_SOFTWARE);
|
||||||
|
|
||||||
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
sdl_tex = SDL_CreateTexture(sdl_render, SDL_PIXELFORMAT_ARGB8888,
|
||||||
SDL_TEXTUREACCESS_STREAMING, (2048 + 64), (2048 + 64));
|
SDL_TEXTUREACCESS_STREAMING, 2048, 2048);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,6 @@
|
|||||||
#include <86box/snd_mpu401.h>
|
#include <86box/snd_mpu401.h>
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
#include <86box/plat.h>
|
#include <86box/plat.h>
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#include <86box/win.h>
|
#include <86box/win.h>
|
||||||
#include "../disk/minivhd/minivhd.h"
|
#include "../disk/minivhd/minivhd.h"
|
||||||
@ -318,7 +317,7 @@ win_settings_init(void)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
/* Machine category */
|
/* Machine category */
|
||||||
temp_machine_type = machines[machine].type;
|
temp_machine_type = machine_get_type(machine);
|
||||||
temp_machine = machine;
|
temp_machine = machine;
|
||||||
temp_cpu_f = cpu_f;
|
temp_cpu_f = cpu_f;
|
||||||
temp_wait_states = cpu_waitstates;
|
temp_wait_states = cpu_waitstates;
|
||||||
@ -786,13 +785,13 @@ win_settings_machine_recalc_machine(HWND hdlg)
|
|||||||
|
|
||||||
win_settings_machine_recalc_cpu_m(hdlg);
|
win_settings_machine_recalc_cpu_m(hdlg);
|
||||||
|
|
||||||
if ((machines[temp_machine].ram_granularity & 1023)) {
|
if (machine_get_ram_granularity(temp_machine) & 1023) {
|
||||||
/* KB granularity */
|
/* KB granularity */
|
||||||
h = GetDlgItem(hdlg, IDC_MEMSPIN);
|
h = GetDlgItem(hdlg, IDC_MEMSPIN);
|
||||||
SendMessage(h, UDM_SETRANGE, 0, (machines[temp_machine].min_ram << 16) | machines[temp_machine].max_ram);
|
SendMessage(h, UDM_SETRANGE, 0, (machine_get_min_ram(temp_machine) << 16) | machine_get_max_ram(temp_machine));
|
||||||
|
|
||||||
accel.nSec = 0;
|
accel.nSec = 0;
|
||||||
accel.nInc = machines[temp_machine].ram_granularity;
|
accel.nInc = machine_get_ram_granularity(temp_machine);
|
||||||
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel);
|
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel);
|
||||||
|
|
||||||
SendMessage(h, UDM_SETPOS, 0, temp_mem_size);
|
SendMessage(h, UDM_SETPOS, 0, temp_mem_size);
|
||||||
@ -802,15 +801,10 @@ win_settings_machine_recalc_machine(HWND hdlg)
|
|||||||
} else {
|
} else {
|
||||||
/* MB granularity */
|
/* MB granularity */
|
||||||
h = GetDlgItem(hdlg, IDC_MEMSPIN);
|
h = GetDlgItem(hdlg, IDC_MEMSPIN);
|
||||||
#if (!(defined __amd64__ || defined _M_X64 || defined __aarch64__ || defined _M_ARM64))
|
SendMessage(h, UDM_SETRANGE, 0, (machine_get_min_ram(temp_machine) << 6) | (machine_get_max_ram(temp_machine) >> 10));
|
||||||
i = MIN(machines[temp_machine].max_ram, 2097152);
|
|
||||||
#else
|
|
||||||
i = MIN(machines[temp_machine].max_ram, 3145728);
|
|
||||||
#endif
|
|
||||||
SendMessage(h, UDM_SETRANGE, 0, (machines[temp_machine].min_ram << 6) | (i >> 10));
|
|
||||||
|
|
||||||
accel.nSec = 0;
|
accel.nSec = 0;
|
||||||
accel.nInc = machines[temp_machine].ram_granularity >> 10;
|
accel.nInc = machine_get_ram_granularity(temp_machine) >> 10;
|
||||||
|
|
||||||
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel);
|
SendMessage(h, UDM_SETACCEL, 1, (LPARAM)&accel);
|
||||||
|
|
||||||
@ -820,8 +814,8 @@ win_settings_machine_recalc_machine(HWND hdlg)
|
|||||||
SendMessage(h, WM_SETTEXT, 0, win_get_string(IDS_2086));
|
SendMessage(h, WM_SETTEXT, 0, win_get_string(IDS_2086));
|
||||||
}
|
}
|
||||||
|
|
||||||
settings_enable_window(hdlg, IDC_MEMSPIN, machines[temp_machine].min_ram != machines[temp_machine].max_ram);
|
settings_enable_window(hdlg, IDC_MEMSPIN, machine_get_min_ram(temp_machine) != machine_get_max_ram(temp_machine));
|
||||||
settings_enable_window(hdlg, IDC_MEMTEXT, machines[temp_machine].min_ram != machines[temp_machine].max_ram);
|
settings_enable_window(hdlg, IDC_MEMTEXT, machine_get_min_ram(temp_machine) != machine_get_max_ram(temp_machine));
|
||||||
|
|
||||||
free(lptsTemp);
|
free(lptsTemp);
|
||||||
}
|
}
|
||||||
@ -844,7 +838,7 @@ machine_type_available(int id)
|
|||||||
|
|
||||||
if ((id > 0) && (id < MACHINE_TYPE_MAX)) {
|
if ((id > 0) && (id < MACHINE_TYPE_MAX)) {
|
||||||
while (machine_get_internal_name_ex(c) != NULL) {
|
while (machine_get_internal_name_ex(c) != NULL) {
|
||||||
if (machine_available(c) && (machines[c].type == id))
|
if (machine_available(c) && (machine_get_type(c) == id))
|
||||||
return 1;
|
return 1;
|
||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
@ -891,8 +885,8 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
settings_reset_content(hdlg, IDC_COMBO_MACHINE);
|
settings_reset_content(hdlg, IDC_COMBO_MACHINE);
|
||||||
memset(listtomachine, 0x00, sizeof(listtomachine));
|
memset(listtomachine, 0x00, sizeof(listtomachine));
|
||||||
while (machine_get_internal_name_ex(c) != NULL) {
|
while (machine_get_internal_name_ex(c) != NULL) {
|
||||||
if (machine_available(c) && (machines[c].type == temp_machine_type)) {
|
if (machine_available(c) && (machine_get_type(c) == temp_machine_type)) {
|
||||||
stransi = (char *)machines[c].name;
|
stransi = machine_getname_ex(c);
|
||||||
mbstowcs(lptsTemp, stransi, strlen(stransi) + 1);
|
mbstowcs(lptsTemp, stransi, strlen(stransi) + 1);
|
||||||
settings_add_string(hdlg, IDC_COMBO_MACHINE, (LPARAM) lptsTemp);
|
settings_add_string(hdlg, IDC_COMBO_MACHINE, (LPARAM) lptsTemp);
|
||||||
listtomachine[d] = c;
|
listtomachine[d] = c;
|
||||||
@ -946,8 +940,8 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
c = d = 0;
|
c = d = 0;
|
||||||
memset(listtomachine, 0x00, sizeof(listtomachine));
|
memset(listtomachine, 0x00, sizeof(listtomachine));
|
||||||
while (machine_get_internal_name_ex(c) != NULL) {
|
while (machine_get_internal_name_ex(c) != NULL) {
|
||||||
if (machine_available(c) && (machines[c].type == temp_machine_type)) {
|
if (machine_available(c) && (machine_get_type(c) == temp_machine_type)) {
|
||||||
stransi = (char *)machines[c].name;
|
stransi = machine_getname_ex(c);
|
||||||
mbstowcs(lptsTemp, stransi, strlen(stransi) + 1);
|
mbstowcs(lptsTemp, stransi, strlen(stransi) + 1);
|
||||||
settings_add_string(hdlg, IDC_COMBO_MACHINE, (LPARAM) lptsTemp);
|
settings_add_string(hdlg, IDC_COMBO_MACHINE, (LPARAM) lptsTemp);
|
||||||
listtomachine[d] = c;
|
listtomachine[d] = c;
|
||||||
@ -1023,13 +1017,13 @@ win_settings_machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
SendMessage(h, WM_GETTEXT, 255, (LPARAM) lptsTemp);
|
SendMessage(h, WM_GETTEXT, 255, (LPARAM) lptsTemp);
|
||||||
wcstombs(stransi, lptsTemp, 512);
|
wcstombs(stransi, lptsTemp, 512);
|
||||||
sscanf(stransi, "%u", &temp_mem_size);
|
sscanf(stransi, "%u", &temp_mem_size);
|
||||||
if (!(machines[temp_machine].ram_granularity & 1023))
|
if (!(machine_get_ram_granularity(temp_machine) & 1023))
|
||||||
temp_mem_size = temp_mem_size << 10;
|
temp_mem_size = temp_mem_size << 10;
|
||||||
temp_mem_size &= ~(machines[temp_machine].ram_granularity - 1);
|
temp_mem_size &= ~(machine_get_ram_granularity(temp_machine) - 1);
|
||||||
if (temp_mem_size < machines[temp_machine].min_ram)
|
if (temp_mem_size < machine_get_min_ram(temp_machine))
|
||||||
temp_mem_size = machines[temp_machine].min_ram;
|
temp_mem_size = machine_get_min_ram(temp_machine);
|
||||||
else if (temp_mem_size > machines[temp_machine].max_ram)
|
else if (temp_mem_size > machine_get_max_ram(temp_machine))
|
||||||
temp_mem_size = machines[temp_machine].max_ram;
|
temp_mem_size = machine_get_max_ram(temp_machine);
|
||||||
free(stransi);
|
free(stransi);
|
||||||
free(lptsTemp);
|
free(lptsTemp);
|
||||||
|
|
||||||
@ -1080,7 +1074,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/* Skip "internal" if machine doesn't have it. */
|
/* Skip "internal" if machine doesn't have it. */
|
||||||
if ((c == 1) && !(machines[temp_machine].flags & MACHINE_VIDEO)) {
|
if ((c == 1) && !machine_has_flags(temp_machine, MACHINE_VIDEO)) {
|
||||||
c++;
|
c++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1091,7 +1085,7 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
if (video_card_available(c) &&
|
if (video_card_available(c) &&
|
||||||
device_is_valid(video_card_getdevice(c), machines[temp_machine].flags)) {
|
device_is_valid(video_card_getdevice(c), temp_machine)) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_VIDEO, win_get_string(IDS_2103));
|
settings_add_string(hdlg, IDC_COMBO_VIDEO, win_get_string(IDS_2103));
|
||||||
else if (c == 1)
|
else if (c == 1)
|
||||||
@ -1109,12 +1103,12 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
settings_process_messages();
|
settings_process_messages();
|
||||||
}
|
}
|
||||||
|
|
||||||
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY));
|
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !machine_has_flags(temp_machine, MACHINE_VIDEO_ONLY));
|
||||||
e = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
e = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e));
|
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e));
|
||||||
settings_enable_window(hdlg, IDC_CHECK_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI));
|
settings_enable_window(hdlg, IDC_CHECK_VOODOO, machine_has_bus(temp_machine, MACHINE_BUS_PCI));
|
||||||
settings_set_check(hdlg, IDC_CHECK_VOODOO, temp_voodoo);
|
settings_set_check(hdlg, IDC_CHECK_VOODOO, temp_voodoo);
|
||||||
settings_enable_window(hdlg, IDC_BUTTON_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI) && temp_voodoo);
|
settings_enable_window(hdlg, IDC_BUTTON_VOODOO, machine_has_bus(temp_machine, MACHINE_BUS_PCI) && temp_voodoo);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
@ -1157,10 +1151,10 @@ mouse_valid(int num, int m)
|
|||||||
const device_t *dev;
|
const device_t *dev;
|
||||||
|
|
||||||
if ((num == MOUSE_TYPE_INTERNAL) &&
|
if ((num == MOUSE_TYPE_INTERNAL) &&
|
||||||
!(machines[m].flags & MACHINE_MOUSE)) return(0);
|
!machine_has_flags(m, MACHINE_MOUSE)) return(0);
|
||||||
|
|
||||||
dev = mouse_get_device(num);
|
dev = mouse_get_device(num);
|
||||||
return(device_is_valid(dev, machines[m].flags));
|
return(device_is_valid(dev, m));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1294,7 +1288,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
settings_reset_content(hdlg, IDC_COMBO_SOUND);
|
settings_reset_content(hdlg, IDC_COMBO_SOUND);
|
||||||
while (1) {
|
while (1) {
|
||||||
/* Skip "internal" if machine doesn't have it. */
|
/* Skip "internal" if machine doesn't have it. */
|
||||||
if ((c == 1) && !(machines[temp_machine].flags & MACHINE_SOUND)) {
|
if ((c == 1) && !machine_has_flags(temp_machine, MACHINE_SOUND)) {
|
||||||
c++;
|
c++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1307,7 +1301,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (sound_card_available(c)) {
|
if (sound_card_available(c)) {
|
||||||
sound_dev = sound_card_getdevice(c);
|
sound_dev = sound_card_getdevice(c);
|
||||||
|
|
||||||
if (device_is_valid(sound_dev, machines[temp_machine].flags)) {
|
if (device_is_valid(sound_dev, temp_machine)) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_SOUND, win_get_string(IDS_2103));
|
settings_add_string(hdlg, IDC_COMBO_SOUND, win_get_string(IDS_2103));
|
||||||
else if (c == 1)
|
else if (c == 1)
|
||||||
@ -1377,15 +1371,15 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401);
|
settings_set_check(hdlg, IDC_CHECK_MPU401, temp_mpu401);
|
||||||
settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow());
|
settings_enable_window(hdlg, IDC_CHECK_MPU401, mpu401_standalone_allow());
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401);
|
settings_enable_window(hdlg, IDC_CONFIGURE_MPU401, mpu401_standalone_allow() && temp_mpu401);
|
||||||
settings_enable_window(hdlg, IDC_CHECK_CMS, (machines[temp_machine].flags & MACHINE_BUS_ISA));
|
settings_enable_window(hdlg, IDC_CHECK_CMS, machine_has_bus(temp_machine, MACHINE_BUS_ISA));
|
||||||
settings_set_check(hdlg, IDC_CHECK_CMS, temp_GAMEBLASTER);
|
settings_set_check(hdlg, IDC_CHECK_CMS, temp_GAMEBLASTER);
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_CMS, (machines[temp_machine].flags & MACHINE_BUS_ISA) && temp_GAMEBLASTER);
|
settings_enable_window(hdlg, IDC_CONFIGURE_CMS, machine_has_bus(temp_machine, MACHINE_BUS_ISA) && temp_GAMEBLASTER);
|
||||||
settings_enable_window(hdlg, IDC_CHECK_GUS, (machines[temp_machine].flags & MACHINE_BUS_ISA16));
|
settings_enable_window(hdlg, IDC_CHECK_GUS, machine_has_bus(temp_machine, MACHINE_BUS_ISA16));
|
||||||
settings_set_check(hdlg, IDC_CHECK_GUS, temp_GUS);
|
settings_set_check(hdlg, IDC_CHECK_GUS, temp_GUS);
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_GUS, (machines[temp_machine].flags & MACHINE_BUS_ISA16) && temp_GUS);
|
settings_enable_window(hdlg, IDC_CONFIGURE_GUS, machine_has_bus(temp_machine, MACHINE_BUS_ISA16) && temp_GUS);
|
||||||
settings_enable_window(hdlg, IDC_CHECK_SSI, (machines[temp_machine].flags & MACHINE_BUS_ISA));
|
settings_enable_window(hdlg, IDC_CHECK_SSI, machine_has_bus(temp_machine, MACHINE_BUS_ISA));
|
||||||
settings_set_check(hdlg, IDC_CHECK_SSI, temp_SSI2001);
|
settings_set_check(hdlg, IDC_CHECK_SSI, temp_SSI2001);
|
||||||
settings_enable_window(hdlg, IDC_CONFIGURE_SSI, (machines[temp_machine].flags & MACHINE_BUS_ISA) && temp_SSI2001);
|
settings_enable_window(hdlg, IDC_CONFIGURE_SSI, machine_has_bus(temp_machine, MACHINE_BUS_ISA) && temp_SSI2001);
|
||||||
settings_set_check(hdlg, IDC_CHECK_FLOAT, temp_float);
|
settings_set_check(hdlg, IDC_CHECK_FLOAT, temp_float);
|
||||||
|
|
||||||
free(lptsTemp);
|
free(lptsTemp);
|
||||||
@ -1440,7 +1434,7 @@ win_settings_sound_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case IDC_CONFIGURE_MPU401:
|
case IDC_CONFIGURE_MPU401:
|
||||||
temp_deviceconfig |= deviceconfig_open(hdlg, (machines[temp_machine].flags & MACHINE_MCA) ?
|
temp_deviceconfig |= deviceconfig_open(hdlg, machine_has_bus(temp_machine, MACHINE_BUS_MCA) ?
|
||||||
(void *)&mpu401_mca_device : (void *)&mpu401_device);
|
(void *)&mpu401_mca_device : (void *)&mpu401_device);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1589,7 +1583,7 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
settings_reset_content(hdlg, IDC_COMBO_HDC);
|
settings_reset_content(hdlg, IDC_COMBO_HDC);
|
||||||
while (1) {
|
while (1) {
|
||||||
/* Skip "internal" if machine doesn't have it. */
|
/* Skip "internal" if machine doesn't have it. */
|
||||||
if ((c == 1) && !(machines[temp_machine].flags & MACHINE_HDC)) {
|
if ((c == 1) && !machine_has_flags(temp_machine, MACHINE_HDC)) {
|
||||||
c++;
|
c++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1602,7 +1596,7 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (hdc_available(c)) {
|
if (hdc_available(c)) {
|
||||||
hdc_dev = hdc_get_device(c);
|
hdc_dev = hdc_get_device(c);
|
||||||
|
|
||||||
if (device_is_valid(hdc_dev, machines[temp_machine].flags)) {
|
if (device_is_valid(hdc_dev, temp_machine)) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_HDC, win_get_string(IDS_2103));
|
settings_add_string(hdlg, IDC_COMBO_HDC, win_get_string(IDS_2103));
|
||||||
else if (c == 1)
|
else if (c == 1)
|
||||||
@ -1634,7 +1628,7 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (fdc_card_available(c)) {
|
if (fdc_card_available(c)) {
|
||||||
fdc_dev = fdc_card_getdevice(c);
|
fdc_dev = fdc_card_getdevice(c);
|
||||||
|
|
||||||
if (device_is_valid(fdc_dev, machines[temp_machine].flags)) {
|
if (device_is_valid(fdc_dev, temp_machine)) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_FDC, win_get_string(IDS_2118));
|
settings_add_string(hdlg, IDC_COMBO_FDC, win_get_string(IDS_2118));
|
||||||
else
|
else
|
||||||
@ -1665,7 +1659,7 @@ win_settings_storage_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (scsi_card_available(c)) {
|
if (scsi_card_available(c)) {
|
||||||
scsi_dev = scsi_card_getdevice(c);
|
scsi_dev = scsi_card_getdevice(c);
|
||||||
|
|
||||||
if (device_is_valid(scsi_dev, machines[temp_machine].flags)) {
|
if (device_is_valid(scsi_dev, temp_machine)) {
|
||||||
for (e = 0; e < SCSI_BUS_MAX; e++) {
|
for (e = 0; e < SCSI_BUS_MAX; e++) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_SCSI_1 + e, win_get_string(IDS_2103));
|
settings_add_string(hdlg, IDC_COMBO_SCSI_1 + e, win_get_string(IDS_2103));
|
||||||
@ -1823,7 +1817,7 @@ win_settings_network_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
if (device_name[0] == L'\0')
|
if (device_name[0] == L'\0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (network_card_available(c) && device_is_valid(network_card_getdevice(c), machines[temp_machine].flags)) {
|
if (network_card_available(c) && device_is_valid(network_card_getdevice(c), temp_machine)) {
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
settings_add_string(hdlg, IDC_COMBO_NET, win_get_string(IDS_2103));
|
settings_add_string(hdlg, IDC_COMBO_NET, win_get_string(IDS_2103));
|
||||||
else
|
else
|
||||||
|
@ -522,12 +522,12 @@ ui_sb_update_panes(void)
|
|||||||
sb_ready = 0;
|
sb_ready = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cart_int = (machines[machine].flags & MACHINE_CARTRIDGE) ? 1 : 0;
|
cart_int = machine_has_cartridge(machine) ? 1 : 0;
|
||||||
mfm_int = (machines[machine].flags & MACHINE_MFM) ? 1 : 0;
|
mfm_int = machine_has_flags(machine, MACHINE_MFM) ? 1 : 0;
|
||||||
xta_int = (machines[machine].flags & MACHINE_XTA) ? 1 : 0;
|
xta_int = machine_has_flags(machine, MACHINE_XTA) ? 1 : 0;
|
||||||
esdi_int = (machines[machine].flags & MACHINE_ESDI) ? 1 : 0;
|
esdi_int = machine_has_flags(machine, MACHINE_ESDI) ? 1 : 0;
|
||||||
ide_int = (machines[machine].flags & MACHINE_IDE_QUAD) ? 1 : 0;
|
ide_int = machine_has_flags(machine, MACHINE_IDE_QUAD) ? 1 : 0;
|
||||||
scsi_int = (machines[machine].flags & MACHINE_SCSI_DUAL) ? 1 : 0;
|
scsi_int = machine_has_flags(machine, MACHINE_SCSI_DUAL) ? 1 : 0;
|
||||||
|
|
||||||
c_mfm = hdd_count(HDD_BUS_MFM);
|
c_mfm = hdd_count(HDD_BUS_MFM);
|
||||||
c_esdi = hdd_count(HDD_BUS_ESDI);
|
c_esdi = hdd_count(HDD_BUS_ESDI);
|
||||||
|
@ -45,14 +45,11 @@ thread_create(void (*func)(void *param), void *param)
|
|||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
thread_wait(thread_t *arg, int timeout)
|
thread_wait(thread_t *arg)
|
||||||
{
|
{
|
||||||
if (arg == NULL) return(0);
|
if (arg == NULL) return(0);
|
||||||
|
|
||||||
if (timeout == -1)
|
if (WaitForSingleObject(arg, INFINITE)) return(1);
|
||||||
timeout = INFINITE;
|
|
||||||
|
|
||||||
if (WaitForSingleObject(arg, timeout)) return(1);
|
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -133,17 +130,6 @@ thread_create_mutex(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
mutex_t *
|
|
||||||
thread_create_mutex_with_spin_count(unsigned int spin_count)
|
|
||||||
{
|
|
||||||
mutex_t *mutex = malloc(sizeof(CRITICAL_SECTION));
|
|
||||||
|
|
||||||
InitializeCriticalSectionAndSpinCount(mutex, spin_count);
|
|
||||||
|
|
||||||
return mutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
thread_wait_mutex(mutex_t *mutex)
|
thread_wait_mutex(mutex_t *mutex)
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
#include <86box/nvr.h>
|
#include <86box/nvr.h>
|
||||||
#include <86box/video.h>
|
#include <86box/video.h>
|
||||||
#include <86box/vid_ega.h> // for update_overscan
|
#include <86box/vid_ega.h> // for update_overscan
|
||||||
#include <86box/plat_midi.h>
|
|
||||||
#include <86box/plat_dynld.h>
|
#include <86box/plat_dynld.h>
|
||||||
#include <86box/ui.h>
|
#include <86box/ui.h>
|
||||||
#include <86box/win.h>
|
#include <86box/win.h>
|
||||||
@ -54,8 +53,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Platform Public data, specific. */
|
/* Platform Public data, specific. */
|
||||||
HWND hwndMain, /* application main window */
|
HWND hwndMain = NULL, /* application main window */
|
||||||
hwndRender; /* machine render window */
|
hwndRender = NULL; /* machine render window */
|
||||||
HMENU menuMain; /* application main menu */
|
HMENU menuMain; /* application main menu */
|
||||||
RECT oldclip; /* mouse rect */
|
RECT oldclip; /* mouse rect */
|
||||||
int sbar_height = 23; /* statusbar height */
|
int sbar_height = 23; /* statusbar height */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user