This commit is contained in:
OBattler
2022-07-22 18:51:28 +02:00
9 changed files with 2148 additions and 2276 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -344,15 +344,6 @@ extern int machine_ppc512_init(const machine_t *);
extern int machine_pc2086_init(const machine_t *);
extern int machine_pc3086_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *pc1512_get_device(void);
extern const device_t *pc1640_get_device(void);
extern const device_t *pc200_get_device(void);
extern const device_t *ppc512_get_device(void);
extern const device_t *pc2086_get_device(void);
extern const device_t *pc3086_get_device(void);
#endif
/* m_at.c */
extern void machine_at_common_init_ex(const machine_t *, int type);
extern void machine_at_common_init(const machine_t *);
@@ -425,14 +416,6 @@ extern int machine_at_awardsx_init(const machine_t *);
extern int machine_at_pc916sx_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_ama932j_get_device(void);
extern const device_t *at_flytech386_get_device(void);
extern const device_t *at_cmdsl386sx25_get_device(void);
extern const device_t *at_spc4620p_get_device(void);
extern const device_t *at_spc6033p_get_device(void);
#endif
/* m_at_386dx_486.c */
extern int machine_at_acc386_init(const machine_t *);
extern int machine_at_asus386_init(const machine_t *);
@@ -516,15 +499,6 @@ extern int machine_at_actionpc2600_init(const machine_t *);
extern int machine_at_m919_init(const machine_t *);
extern int machine_at_spc7700plw_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_acera1g_get_device(void);
extern const device_t *at_vect486vl_get_device(void);
extern const device_t *at_d824_get_device(void);
extern const device_t *at_pcs46c_get_device(void);
extern const device_t *at_valuepoint433_get_device(void);
extern const device_t *at_sbc490_get_device(void);
#endif
/* m_at_commodore.c */
extern int machine_at_cmdpc_init(const machine_t *);
@@ -535,9 +509,6 @@ extern int machine_at_portableiii386_init(const machine_t *);
#if defined(DEV_BRANCH) && defined(USE_DESKPRO386)
extern int machine_at_deskpro386_init(const machine_t *);
#endif
#ifdef EMU_DEVICE_H
extern const device_t *at_cpqiii_get_device(void);
#endif
/* m_at_socket4.c */
extern void machine_at_premiere_common_init(const machine_t *, int);
@@ -562,10 +533,6 @@ extern int machine_at_p5vl_init(const machine_t *);
extern int machine_at_excaliburpci2_init(const machine_t *);
extern int machine_at_p5sp4_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_pb520r_get_device(void);
#endif
/* m_at_socket5.c */
extern int machine_at_plato_init(const machine_t *);
extern int machine_at_ambradp90_init(const machine_t *);
@@ -609,14 +576,6 @@ extern int machine_at_gw2kte_init(const machine_t *);
extern int machine_at_ap5s_init(const machine_t *);
extern int machine_at_vectra54_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_endeavor_get_device(void);
#define at_vectra54_get_device at_endeavor_get_device
extern const device_t *at_thor_get_device(void);
#define at_mrthor_get_device at_thor_get_device
extern const device_t *at_pb640_get_device(void);
#endif
/* m_at_socket7.c */
extern int machine_at_acerv35n_init(const machine_t *);
extern int machine_at_p55t2p4_init(const machine_t *);
@@ -658,11 +617,6 @@ extern int machine_at_ms5146_init(const machine_t *);
extern int machine_at_m560_init(const machine_t *);
extern int machine_at_ms5164_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_presario2240_get_device(void);
#define at_presario4500_get_device at_presario2240_get_device
#endif
/* m_at_sockets7.c */
extern int machine_at_p5a_init(const machine_t *);
extern int machine_at_m579_init(const machine_t *);
@@ -718,14 +672,6 @@ extern int machine_at_vei8_init(const machine_t *);
extern int machine_at_borapro_init(const machine_t *);
extern int machine_at_ms6168_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_s1846_get_device(void);
#define at_s1857_get_device at_s1846_get_device
#define at_gt694va_get_device at_s1846_get_device
extern const device_t *at_ms6168_get_device(void);
#define at_borapro_get_device at_ms6168_get_device
#endif
/* m_at_slot2.c */
extern int machine_at_6gxu_init(const machine_t *);
extern int machine_at_s2dge_init(const machine_t *);
@@ -743,9 +689,6 @@ extern int machine_at_s370sba_init(const machine_t *);
extern int machine_at_apas3_init(const machine_t *);
extern int machine_at_gt694va_init(const machine_t *);
extern int machine_at_cuv4xls_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *at_cuv4xls_get_device(void);
#endif
extern int machine_at_6via90ap_init(const machine_t *);
extern int machine_at_s1857_init(const machine_t *);
extern int machine_at_p6bap_init(const machine_t *);
@@ -764,22 +707,12 @@ extern const device_t europc_device;
/* m_xt_olivetti.c */
extern int machine_xt_m24_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *m24_get_device(void);
#endif
extern int machine_xt_m240_init(const machine_t *);
extern int machine_xt_m19_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *m19_get_device(void);
#endif
/* m_pcjr.c */
extern int machine_pcjr_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *pcjr_get_device(void);
#endif
/* m_ps1.c */
extern int machine_ps1_m2011_init(const machine_t *);
extern int machine_ps1_m2121_init(const machine_t *);
@@ -811,12 +744,6 @@ extern int machine_tandy1000sl2_init(const machine_t *);
/* m_v86p.c */
extern int machine_v86p_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *tandy1k_get_device(void);
extern const device_t *tandy1k_hx_get_device(void);
extern const device_t *tandy1k_sl_get_device(void);
#endif
/* m_xt.c */
extern int machine_pc_init(const machine_t *);
extern int machine_pc82_init(const machine_t *);
@@ -866,24 +793,13 @@ extern int machine_xt_p3120_init(const machine_t *);
extern int machine_xt_t1000_init(const machine_t *);
extern int machine_xt_t1200_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *t1000_get_device(void);
extern const device_t *t1200_get_device(void);
#endif
/* m_xt_zenith.c */
extern int machine_xt_z184_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *z184_get_device(void);
#endif
extern int machine_xt_z151_init(const machine_t *);
extern int machine_xt_z159_init(const machine_t *);
/* m_xt_xi8088.c */
extern int machine_xt_xi8088_init(const machine_t *);
#ifdef EMU_DEVICE_H
extern const device_t *xi8088_get_device(void);
#endif
#endif /*EMU_MACHINE_H*/

View File

@@ -61,7 +61,6 @@ static uint16_t smi_irq_mask = 0x0000,
static void (*update_pending)(void);
#ifdef ENABLE_PIC_LOG
int pic_do_log = ENABLE_PIC_LOG;

View File

@@ -15,10 +15,10 @@
*/
#if defined __has_include
# if __has_include (<RtMidi.h>)
# if __has_include(<RtMidi.h>)
# include <RtMidi.h>
# endif
# if __has_include (<rtmidi/RtMidi.h>)
# if __has_include(<rtmidi/RtMidi.h>)
# include <rtmidi/RtMidi.h>
# endif
#endif
@@ -38,16 +38,15 @@ extern "C"
// Disable c99-designator to avoid the warnings in rtmidi_*_device
#ifdef __clang__
#if __has_warning("-Wc99-designator")
#pragma clang diagnostic ignored "-Wc99-designator"
#endif
# if __has_warning("-Wc99-designator")
# pragma clang diagnostic ignored "-Wc99-designator"
# endif
#endif
static RtMidiOut * midiout = nullptr;
static RtMidiIn * midiin = nullptr;
static RtMidiOut *midiout = nullptr;
static RtMidiIn *midiin = nullptr;
static int midi_out_id = 0, midi_in_id = 0;
static const int midi_lengths[8] = {3, 3, 3, 3, 2, 2, 3, 1};
static const int midi_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 1 };
int
rtmidi_write(uint8_t val)
@@ -55,7 +54,6 @@ rtmidi_write(uint8_t val)
return 0;
}
void
rtmidi_play_msg(uint8_t *msg)
{
@@ -63,7 +61,6 @@ rtmidi_play_msg(uint8_t *msg)
midiout->sendMessage(msg, midi_lengths[(msg[0] >> 4) & 7]);
}
void
rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
{
@@ -71,11 +68,10 @@ rtmidi_play_sysex(uint8_t *sysex, unsigned int len)
midiout->sendMessage(sysex, len);
}
void*
rtmidi_output_init(const device_t *info)
{
midi_device_t* dev = (midi_device_t*)malloc(sizeof(midi_device_t));
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;
@@ -83,22 +79,23 @@ rtmidi_output_init(const device_t *info)
dev->write = rtmidi_write;
try {
if (!midiout) midiout = new RtMidiOut;
} catch (RtMidiError& error) {
if (!midiout)
midiout = new RtMidiOut;
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
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);
try {
midiout->openPort(midi_out_id);
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Fallback to default MIDI output port: %s\n", error.getMessage().c_str());
try {
midiout->openPort(0);
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
delete midiout;
midiout = nullptr;
@@ -111,7 +108,6 @@ rtmidi_output_init(const device_t *info)
return dev;
}
void
rtmidi_output_close(void *p)
{
@@ -126,14 +122,13 @@ rtmidi_output_close(void *p)
midi_out_close();
}
int
rtmidi_out_get_num_devs(void)
{
if (!midiout) {
try {
midiout = new RtMidiOut;
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI output: %s\n", error.getMessage().c_str());
}
}
@@ -141,14 +136,12 @@ rtmidi_out_get_num_devs(void)
return midiout ? midiout->getPortCount() : 0;
}
void
rtmidi_out_get_dev_name(int num, char *s)
{
strcpy(s, midiout->getPortName(num).c_str());
}
void
rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, void *userData)
{
@@ -158,31 +151,30 @@ rtmidi_input_callback(double timeStamp, std::vector<unsigned char> *message, voi
midi_in_msg(message->data(), message->size());
}
void*
rtmidi_input_init(const device_t *info)
{
midi_device_t* dev = (midi_device_t*)malloc(sizeof(midi_device_t));
midi_device_t *dev = (midi_device_t *) malloc(sizeof(midi_device_t));
memset(dev, 0, sizeof(midi_device_t));
try {
if (!midiin)
midiin = new RtMidiIn;
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
return nullptr;
}
midi_in_id = config_get_int((char*)MIDI_INPUT_NAME, (char*)"midi_input", 0);
midi_in_id = config_get_int((char *) MIDI_INPUT_NAME, (char *) "midi_input", 0);
try {
midiin->openPort(midi_in_id);
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Fallback to default MIDI input port: %s\n", error.getMessage().c_str());
try {
midiin->openPort(0);
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
delete midiin;
midiin = nullptr;
@@ -204,9 +196,8 @@ rtmidi_input_init(const device_t *info)
return dev;
}
void
rtmidi_input_close(void* p)
rtmidi_input_close(void *p)
{
midiin->cancelCallback();
midiin->closePort();
@@ -217,14 +208,13 @@ rtmidi_input_close(void* p)
midi_out_close();
}
int
rtmidi_in_get_num_devs(void)
{
if (!midiin) {
try {
midiin = new RtMidiIn;
} catch (RtMidiError& error) {
} catch (RtMidiError &error) {
pclog("Failed to initialize MIDI input: %s\n", error.getMessage().c_str());
}
}
@@ -232,7 +222,6 @@ rtmidi_in_get_num_devs(void)
return midiin ? midiin->getPortCount() : 0;
}
void
rtmidi_in_get_dev_name(int num, char *s)
{
@@ -240,6 +229,7 @@ rtmidi_in_get_dev_name(int num, char *s)
}
static const device_config_t system_midi_config[] = {
// clang-format off
{
.name = "midi",
.description = "MIDI out device",
@@ -248,9 +238,11 @@ static const device_config_t system_midi_config[] = {
.default_int = 0
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
static const device_config_t midi_input_config[] = {
// clang-format off
{
.name = "midi_input",
.description = "MIDI in device",
@@ -280,6 +272,7 @@ static const device_config_t midi_input_config[] = {
.default_int = 1
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
const device_t rtmidi_output_device = {
@@ -309,5 +302,4 @@ const device_t rtmidi_input_device = {
.force_redraw = NULL,
.config = midi_input_config
};
}

View File

@@ -31,6 +31,9 @@ ifeq ($(DEV_BUILD), y)
ifndef DEBUG
DEBUG := y
endif
ifndef GDBSTUB
GDBSTUB := n
endif
ifndef DEV_BRANCH
DEV_BRANCH := y
endif
@@ -92,6 +95,9 @@ else
ifndef DEBUG
DEBUG := n
endif
ifndef GDBSTUB
GDBSTUB := n
endif
ifndef DEV_BRANCH
DEV_BRANCH := n
endif
@@ -506,6 +512,10 @@ OPTS += -DUSE_OLIVETTI
DEVBROBJ += olivetti_eva.o
endif
ifeq ($(GDBSTUB), y)
OPTS += -DUSE_GDBSTUB
DEVBROBJ += gdbstub.o
endif
endif