From 4f7ed89eceaaec4a809b679d51dc76fa9bb285d0 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 22 Feb 2025 17:49:08 +0100 Subject: [PATCH 001/272] tc0060dca: make stream alloc adaptive, make chip stereo, and do table lookup at write instead of at stream update --- src/mame/taito/opwolf.cpp | 28 ++++++++++++++-------------- src/mame/taito/tc0060dca.cpp | 31 ++++++++++++++++--------------- src/mame/taito/tc0060dca.h | 6 +++--- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 397d7640f168a..101af3ca61ec4 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -758,7 +758,7 @@ void opwolf_state::opwolf_adpcm_b_w(offs_t offset, uint8_t data) m_adpcm_pos[0] = start; m_adpcm_end[0] = end; m_msm[0]->reset_w(0); - m_tc0060dca[0]->set_level(m_adpcm_b[5]); + m_tc0060dca[0]->level_w(3, m_adpcm_b[5]); //logerror("TRIGGER MSM1\n"); } @@ -781,7 +781,7 @@ void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) m_adpcm_pos[1] = start; m_adpcm_end[1] = end; m_msm[1]->reset_w(0); - m_tc0060dca[1]->set_level(m_adpcm_c[5]); + m_tc0060dca[1]->level_w(3, m_adpcm_c[5]); //logerror("TRIGGER MSM2\n"); } @@ -934,9 +934,9 @@ void opwolf_state::opwolf(machine_config &config) ymsnd.add_route(0, "lspeaker", 1.0); ymsnd.add_route(1, "rspeaker", 1.0); - TC0060DCA(config, m_tc0060dca[0], 384000); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + TC0060DCA(config, m_tc0060dca[0]); + m_tc0060dca[0]->add_route(0, "lspeaker", 1.0); + m_tc0060dca[0]->add_route(1, "rspeaker", 1.0); MSM5205(config, m_msm[0], 384000); m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); @@ -944,9 +944,9 @@ void opwolf_state::opwolf(machine_config &config) m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - TC0060DCA(config, m_tc0060dca[1], 384000); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + TC0060DCA(config, m_tc0060dca[1]); + m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); + m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); MSM5205(config, m_msm[1], 384000); m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); @@ -1013,9 +1013,9 @@ void opwolf_state::opwolfb(machine_config &config) /* OSC clocks unknown for the ymsnd.add_route(0, "lspeaker", 1.0); ymsnd.add_route(1, "rspeaker", 1.0); - TC0060DCA(config, m_tc0060dca[0], 384000); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + TC0060DCA(config, m_tc0060dca[0]); + m_tc0060dca[0]->add_route(0, "lspeaker", 1.0); + m_tc0060dca[0]->add_route(1, "rspeaker", 1.0); MSM5205(config, m_msm[0], 384000); m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); @@ -1023,9 +1023,9 @@ void opwolf_state::opwolfb(machine_config &config) /* OSC clocks unknown for the m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - TC0060DCA(config, m_tc0060dca[1], 384000); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "lspeaker", 1.0); - m_tc0060dca[1]->add_route(ALL_OUTPUTS, "rspeaker", 1.0); + TC0060DCA(config, m_tc0060dca[1]); + m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); + m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); MSM5205(config, m_msm[1], 384000); m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); diff --git a/src/mame/taito/tc0060dca.cpp b/src/mame/taito/tc0060dca.cpp index b90a9f091313f..7e47d4fbc1565 100755 --- a/src/mame/taito/tc0060dca.cpp +++ b/src/mame/taito/tc0060dca.cpp @@ -2,7 +2,7 @@ // copyright-holders:R. Belmont /*************************************************************************** - tc0060dca.cpp - Taito TC0060DCA programmable volume control + tc0060dca.cpp - Taito TC0060DCA stereo programmable volume control Emulation by R. Belmont, volume curve measured by Stephen Leary ***************************************************************************/ @@ -12,43 +12,44 @@ #include -DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA programmable volume control") +DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA") tc0060dca_device::tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0060DCA, tag, owner, clock), device_sound_interface(mconfig, *this), - m_stream(nullptr), - m_level(0) + m_stream(nullptr) { } -void tc0060dca_device::set_level(u8 level) +void tc0060dca_device::level_w(offs_t offset, u8 data) { m_stream->update(); - m_level = level; + + for (int i = 0; i < 2; i++) + { + if (BIT(offset, i)) + m_gain[i] = m_atten_table[data]; + } } void tc0060dca_device::device_start() { - m_stream = stream_alloc(8, 2, clock(), STREAM_DEFAULT_FLAGS); + m_stream = stream_alloc(2, 2, SAMPLE_RATE_OUTPUT_ADAPTIVE); for (int x = 0; x < 256; x++) - { m_atten_table[x] = 1.0 / (1.0 + exp(-10 * ((x / 256.0) - 0.6))); - } - save_item(NAME(m_level)); + m_gain[0] = m_gain[1] = m_atten_table[0xff]; + save_item(NAME(m_gain)); } void tc0060dca_device::sound_stream_update(sound_stream &stream, std::vector const &inputs, std::vector &outputs) { - for (int i = 0; i < inputs[0].samples(); i++) + for (int i = 0; i < outputs[0].samples(); i++) { const stream_buffer::sample_t l = inputs[0].get(i); const stream_buffer::sample_t r = inputs[1].get(i); - outputs[0].put(i, l * m_atten_table[m_level]); - outputs[1].put(i, r * m_atten_table[m_level]); + outputs[0].put(i, l * m_gain[0]); + outputs[1].put(i, r * m_gain[1]); } } - - diff --git a/src/mame/taito/tc0060dca.h b/src/mame/taito/tc0060dca.h index 0cbfefc9a5859..96e20fd799f22 100755 --- a/src/mame/taito/tc0060dca.h +++ b/src/mame/taito/tc0060dca.h @@ -8,9 +8,9 @@ class tc0060dca_device : public device_t, public device_sound_interface { public: - tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - void set_level(u8 level); + void level_w(offs_t offset, u8 data); protected: // device_t override @@ -21,7 +21,7 @@ class tc0060dca_device : public device_t, public device_sound_interface private: sound_stream *m_stream; - u8 m_level; + float m_gain[2]; float m_atten_table[256]; }; From 161f08f3c5f9e0f036c10437aeda0357321404b7 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 22 Feb 2025 20:47:25 +0100 Subject: [PATCH 002/272] opwolf: add todo note about sound routing --- src/mame/taito/opwolf.cpp | 4 ++++ src/mame/taito/tc0060dca.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 101af3ca61ec4..1faea4ebcf464 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -268,6 +268,10 @@ Raine source has standard Asuka/Mofflot sprite/tile priority: Raine simply kludges in this value, failing to read it from a register. So what is controlling priority. +Sound routing is wrong: according to schematics, msm0 goes to tc0060dca0 input 0, +msm1 goes to tc0060dca0 input 1. ym2151 (mono) and tc0060dca0 outputs go to +tc0060dca1 inputs. The 2nd tc0060dca is for total volume (opwolf_adpcm_d_w and +opwolf_adpcm_e_w), outputs go to left/right speakers. ***************************************************************************/ diff --git a/src/mame/taito/tc0060dca.cpp b/src/mame/taito/tc0060dca.cpp index 7e47d4fbc1565..c931c1717ffdb 100755 --- a/src/mame/taito/tc0060dca.cpp +++ b/src/mame/taito/tc0060dca.cpp @@ -12,7 +12,7 @@ #include -DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA") +DEFINE_DEVICE_TYPE(TC0060DCA, tc0060dca_device, "tc0060dca", "Taito TC0060DCA volume control") tc0060dca_device::tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TC0060DCA, tag, owner, clock), From c28dccddba1734d7475f53a59f13504f4a140bb8 Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 23 Feb 2025 15:48:07 +0900 Subject: [PATCH 003/272] vsystem/vsystem_spr.cpp: Fix spelling error (#13402) --- src/mame/vsystem/vsystem_spr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/vsystem/vsystem_spr.cpp b/src/mame/vsystem/vsystem_spr.cpp index 33f63734af643..2df3f612f7cb6 100644 --- a/src/mame/vsystem/vsystem_spr.cpp +++ b/src/mame/vsystem/vsystem_spr.cpp @@ -29,7 +29,7 @@ - 5 bit of palette selection for the mixer - Scaling (x/y) - Flipping -- Indipendent sorting list +- Independent sorting list - 1 bit of pri for the mixer Note that this chip can be connected to a VS9210 which adds a level of indirection for From 7fd5d31a790854cbb87e9115f3896db46f5cce83 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 23 Feb 2025 12:48:24 +0100 Subject: [PATCH 004/272] misc/gms.cpp: added a couple more inputs for baile --- src/mame/misc/gms.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index ef821d96b991b..b762f9e667176 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -1312,11 +1312,11 @@ static INPUT_PORTS_START( baile ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Tie Bet" ) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Player Bet" ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Banker Bet" ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Bet Modifier" ) - PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "Flip Card / Show Odds" ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) From b6c653f663d4c03f1271caf6eeb33aa708e35fb2 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 23 Feb 2025 14:51:16 +0100 Subject: [PATCH 005/272] misc/gms.cpp: added a couple more inputs for sscs --- src/mame/misc/gms.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index b762f9e667176..4a99032366d71 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -1093,8 +1093,8 @@ static INPUT_PORTS_START( sscs ) PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME( "Open card" ) PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME( "1 key" ) // also used for up in the 'secret' test mode PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON6 ) // used for down in the 'secret' test mode - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Abandon" ) PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME( "Look at the card" ) From b9da31c7533696b99f79bde46a41ce9db72b5f62 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 23 Feb 2025 19:07:08 +0100 Subject: [PATCH 006/272] video/zr36060.cpp: hookup Codec and Video register handlers --- src/devices/bus/pci/zr36057.cpp | 2 +- src/devices/video/zr36060.cpp | 617 ++++++++++++++++++++++++++++++-- src/devices/video/zr36060.h | 77 ++++ 3 files changed, 671 insertions(+), 25 deletions(-) diff --git a/src/devices/bus/pci/zr36057.cpp b/src/devices/bus/pci/zr36057.cpp index a286850b64564..5e9d0ddc27159 100644 --- a/src/devices/bus/pci/zr36057.cpp +++ b/src/devices/bus/pci/zr36057.cpp @@ -40,7 +40,7 @@ Known mix-ins: #define LOG_WARN (1U << 1) #define LOG_PO (1U << 2) // PostOffice interactions -#define VERBOSE (LOG_GENERAL | LOG_WARN | LOG_PO) +#define VERBOSE (LOG_GENERAL | LOG_WARN) //#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" diff --git a/src/devices/video/zr36060.cpp b/src/devices/video/zr36060.cpp index 29c19dfdaadc6..8e40618273764 100644 --- a/src/devices/video/zr36060.cpp +++ b/src/devices/video/zr36060.cpp @@ -5,6 +5,8 @@ #include "zr36060.h" #define VERBOSE (LOG_GENERAL) +//#define LOG_OUTPUT_FUNC osd_printf_info + #include "logmacro.h" DEFINE_DEVICE_TYPE(ZR36060, zr36060_device, "zr36060", "Zoran ZR36060 Integrated JPEG codec") @@ -31,39 +33,606 @@ void zr36060_device::device_start() void zr36060_device::device_reset() { + m_load = false; + m_syncrst = false; + m_code_mstr = true; + m_codec_mode = 0x80; } void zr36060_device::regs_map(address_map &map) { -// map(0x000, 0x000) LOAD Parameters -// map(0x001, 0x001) Code FIFO Status (r/o) -// map(0x002, 0x002) Code Interface -// map(0x003, 0x003) Codec Mode - -// map(0x005, 0x005) Maximum Block Code -// map(0x006, 0x006) Markers Enable -// map(0x007, 0x007) Interrupt Mask -// map(0x008, 0x008) Interrupt Status (r/o) -// map(0x009, 0x00c) Target Net Code Volume -// map(0x00d, 0x010) Target Data Code Volume -// map(0x011, 0x012) Scale Factor -// map(0x013, 0x015) Allocation Factor -// map(0x016, 0x019) Accumulated Code Volume -// map(0x01a, 0x01d) Accumulated Total Activity -// map(0x01e, 0x021) Accumulated Truncated Bits + // Codec Control Registers + map(0x000, 0x000).rw(FUNC(zr36060_device::load_r), FUNC(zr36060_device::load_w)); + map(0x001, 0x001).r(FUNC(zr36060_device::code_fifo_status_r)); + map(0x002, 0x002).rw(FUNC(zr36060_device::code_if_r), FUNC(zr36060_device::code_if_w)); + map(0x003, 0x003).rw(FUNC(zr36060_device::codec_mode_r), FUNC(zr36060_device::codec_mode_w)); + + map(0x005, 0x005).rw(FUNC(zr36060_device::mbcv_r), FUNC(zr36060_device::mbcv_w)); + map(0x006, 0x006).rw(FUNC(zr36060_device::markers_enable_r), FUNC(zr36060_device::markers_enable_w)); + map(0x007, 0x007).rw(FUNC(zr36060_device::irq_mask_r), FUNC(zr36060_device::irq_mask_w)); + map(0x008, 0x008).r(FUNC(zr36060_device::irq_status_r)); + map(0x009, 0x00c).rw(FUNC(zr36060_device::tcv_net_r), FUNC(zr36060_device::tcv_net_w)); + map(0x00d, 0x010).rw(FUNC(zr36060_device::tcv_data_r), FUNC(zr36060_device::tcv_data_w)); + map(0x011, 0x012).rw(FUNC(zr36060_device::sf_r), FUNC(zr36060_device::sf_w)); + map(0x013, 0x015).rw(FUNC(zr36060_device::af_r), FUNC(zr36060_device::af_w)); + + map(0x016, 0x019).rw(FUNC(zr36060_device::acv_r), FUNC(zr36060_device::acv_w)); + map(0x01a, 0x01d).rw(FUNC(zr36060_device::act_r), FUNC(zr36060_device::act_w)); + map(0x01e, 0x021).rw(FUNC(zr36060_device::acv_trun_r), FUNC(zr36060_device::acv_trun_w)); map(0x022, 0x022).lr8(NAME([this] (offs_t offset) { LOG("Read Device ID\n"); return 0x33; })); map(0x023, 0x023).lr8(NAME([this] (offs_t offset) { LOG("Read Revision ID\n"); return 0x01; })); // map(0x024, 0x025) Test Control -// map(0x030, 0x030) Video Control -// map(0x031, 0x031) Video Polarity -// map(0x032, 0x032) Scaling -// map(0x033, 0x035) Background Color -// map(0x036, 0x041) Sync Generator -// map(0x042, 0x049) Active Area -// map(0x04a, 0x051) SUBIMG Window + // Video Registers + map(0x030, 0x030).rw(FUNC(zr36060_device::video_control_r), FUNC(zr36060_device::video_control_w)); + map(0x031, 0x031).rw(FUNC(zr36060_device::video_polarity_r), FUNC(zr36060_device::video_polarity_w)); + map(0x032, 0x032).rw(FUNC(zr36060_device::video_scaling_r), FUNC(zr36060_device::video_scaling_w)); + // Background Color + map(0x033, 0x033).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.y; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.y = data; LOG("Background Color Y %02x\n", data); }) + ); + map(0x034, 0x034).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.u; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.u = data; LOG("Background Color U %02x\n", data); }) + ); + map(0x035, 0x035).lrw8( + NAME([this] (offs_t offset) { return m_bg_color.v; }), + NAME([this] (offs_t offset, u8 data) { m_bg_color.v = data; LOG("Background Color V %02x\n", data); }) + ); + // Sync Generator + map(0x036, 0x037).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.vtotal >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.vtotal &= offset ? 0xff00 : 0x00ff; + m_sync_gen.vtotal |= (data << shift); + LOG("Sync Generator: Vtotal [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.vtotal, m_sync_gen.vtotal + 1 + ); + }) + ); + map(0x038, 0x039).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.htotal >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.htotal &= offset ? 0x0300 : 0x00ff; + m_sync_gen.htotal |= (data << shift); + LOG("Sync Generator: Htotal [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.htotal, m_sync_gen.htotal + 1 + ); + }) + ); + map(0x03a, 0x03a).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.vsync_size; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.vsync_size = data; + LOG("Sync Generator: VsyncSize %02x -> %d\n" + , data + , m_sync_gen.vsync_size + 1 + ); + }) + ); + map(0x03b, 0x03b).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.hsync_size; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.hsync_size = data; + LOG("Sync Generator: HsyncSize %02x -> %d\n" + , data + , m_sync_gen.hsync_size + 1 + ); + }) + ); + map(0x03c, 0x03c).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.bvstart; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.bvstart = data; + LOG("Sync Generator: BVstart %02x -> %d\n" + , data + , m_sync_gen.bvstart + 1 + ); + }) + ); + map(0x03d, 0x03d).lrw8( + NAME([this] (offs_t offset) { return m_sync_gen.bhstart; }), + NAME([this] (offs_t offset, u8 data) { + m_sync_gen.bhstart = data; + LOG("Sync Generator: BHstart %02x -> %d\n" + , data + , m_sync_gen.bhstart + 1 + ); + }) + ); + map(0x03e, 0x03f).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.bvend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.bvend &= offset ? 0xff00 : 0x00ff; + m_sync_gen.bvend |= (data << shift); + LOG("Sync Generator: BVend [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.bvend, m_sync_gen.bvend + ); + }) + ); + map(0x040, 0x041).lrw8( + NAME([this] (offs_t offset) { + return (m_sync_gen.bhend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_sync_gen.bhend &= offset ? 0x0300 : 0x00ff; + m_sync_gen.bhend |= (data << shift); + LOG("Sync Generator: BHend [%01x] %02x -> %04x %d\n" + , offset, data + , m_sync_gen.bhend, m_sync_gen.bhend + ); + }) + ); + + // Active Area + map(0x042, 0x043).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.vstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.vstart &= offset ? 0xff00 : 0x00ff; + m_active_area.vstart |= (data << shift); + LOG("Active Area: Vstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.vstart, m_active_area.vstart + 1 + ); + }) + ); + map(0x044, 0x045).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.vend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.vend &= offset ? 0xff00 : 0x00ff; + m_active_area.vend |= (data << shift); + LOG("Active Area: Vend [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.vend, m_active_area.vend + ); + }) + ); + map(0x046, 0x047).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.hstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.hstart &= offset ? 0x0300 : 0x00ff; + m_active_area.hstart |= (data << shift); + LOG("Active Area: Hstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.hstart, m_active_area.hstart + 1 + ); + }) + ); + map(0x048, 0x049).lrw8( + NAME([this] (offs_t offset) { + return (m_active_area.hend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_active_area.hend &= offset ? 0x0300 : 0x00ff; + m_active_area.hend |= (data << shift); + LOG("Active Area: Hend [%01x] %02x -> %04x %d\n" + , offset, data + , m_active_area.hend, m_active_area.hend + 1 + ); + }) + ); + + // SUBIMG Window + map(0x04a, 0x04b).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.svstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.svstart &= offset ? 0xff00 : 0x00ff; + m_subimg_window.svstart |= (data << shift); + LOG("SUBIMG Window: SVstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.svstart, m_subimg_window.svstart + 1 + ); + }) + ); + map(0x04c, 0x04d).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.svend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.svend &= offset ? 0xff00 : 0x00ff; + m_subimg_window.svend |= (data << shift); + LOG("SUBIMG Window: SVend [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.svend, m_subimg_window.svend + ); + }) + ); + map(0x04e, 0x04f).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.shstart >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.shstart &= offset ? 0x0300 : 0x00ff; + m_subimg_window.shstart |= (data << shift); + LOG("SUBIMG Window: SHstart [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.shstart, m_subimg_window.shstart + 1 + ); + }) + ); + map(0x050, 0x051).lrw8( + NAME([this] (offs_t offset) { + return (m_subimg_window.shend >> (offset ? 0 : 8)) & 0xff; } + ), + NAME([this] (offs_t offset, u8 data) { + const u8 shift = offset ? 0 : 8; + m_subimg_window.shend &= offset ? 0x0300 : 0x00ff; + m_subimg_window.shend |= (data << shift); + LOG("SUBIMG Window: SHend [%01x] %02x -> %04x %d\n" + , offset, data + , m_subimg_window.shend, m_subimg_window.shend + 1 + ); + }) + ); + + // JPEG Markers Array + map(0x060, 0x3ff).ram(); +} + +/************************************** + * + * Codec Control Registers + * + *************************************/ + +/* + * [0x000] LOAD Parameters + * x--- ---- LOAD parameters if 1 + * ---- ---x SyncRst resets video sync generator if 1 (keeps h/vpos to 0,0 until goes off) + */ +u8 zr36060_device::load_r(offs_t offset) +{ + return (m_load << 7) | (m_syncrst << 0); +} + +void zr36060_device::load_w(offs_t offset, u8 data) +{ + m_load = !!(BIT(data, 7)); + m_syncrst = !!(BIT(data, 0)); + LOG("LOAD Parameters %02x: LOAD %d SYNCRST %d\n", data, m_load, m_syncrst); +} + +/* + * [0x001] Code FIFO status (r/o) + * x--- ---- Busy Status for LOAD operation (takes ~100ms to complete) + * ---- -x-- CBUSY Code FIFO empty/full condition (same as /CBUSY pin) + * ---- -0-- Code FIFO not full/not empty + * ---- -1-- Code FIFO full/empty + * ---- --xx CFIFO Code FIFO fullness state + * ---- --00 < 1/4 + * ---- --01 >= 1/4 && < 1/2 + * ---- --10 >= 1/2 && < 3/4 + * ---- --11 >= 3/4 + */ +u8 zr36060_device::code_fifo_status_r(offs_t offset) +{ + return 0; +} + +/* + * [0x002] Code Interface + * x--- ---- Code16 code bus width, slave mode only + * 0--- ---- 8-bit code bus + * 1--- ---- 16-bit code bus + * -x-- ---- Endian, must be 0 in Master mode or 8-bit Slave + * ---- -x-- CFIS number of clocks in Master mode, must be 0 in Code Slave + * ---- ---x CodeMstr ZR36060 is Master or Slave of the Code bus + * ---- ---0 Code Slave mode + * ---- ---1 Code Master mode + */ +u8 zr36060_device::code_if_r(offs_t offset) +{ + return (m_code16 << 7) | (m_endian << 6) | (m_cfis << 2) | (m_code_mstr); +} + +void zr36060_device::code_if_w(offs_t offset, u8 data) +{ + m_code16 = !!(BIT(data, 7)); + m_endian = !!(BIT(data, 6)); + m_cfis = !!(BIT(data, 2)); + m_code_mstr = !!(BIT(data, 0)); + LOG("Code Interface %02x:\n", data); + LOG("\tCODE16 %d-bit, Endian %d, CFIS %d VCLKx2, CodeMstr %s\n" + , m_code16 ? 16 : 8 + , m_endian + , m_cfis + 1 + , m_code_mstr ? "Code Master" : "Code Slave" + ); +} + +/* + * [0x003] Codec Mode + * x--- ---- COMP + * -x-- ---- ATP + * --x- ---- PASS2 + * ---x ---- TLM + * ---- -x-- BRC + * ---- --x- FSF + * 1100 0100 Auto Two-Pass Compression + * 1000 0100 Statistical Compression Pass + * 1010 0100 Compression Pass with Variable Scale Factor + * 1010 0110 Compression Pass with Fixed Scale Factor + * 1011 0000 Tables-Only Compression Pass + * 0000 0000 Decompression Pass + * ???? ???? + */ +u8 zr36060_device::codec_mode_r(offs_t offset) +{ + return m_codec_mode; +} + +void zr36060_device::codec_mode_w(offs_t offset, u8 data) +{ + m_codec_mode = data; + LOG("Codec Mode %02x\n", data); + LOG("\tCOMP %d, ATP %d, PASS2 %d, TLM %d, BRC %d, FSF %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 2) + , BIT(data, 1) + ); +} + +/* + * [0x005] Maxiumum Block Code Volume + * xxxx xxxx value * 2 + */ +u8 zr36060_device::mbcv_r(offs_t offset) +{ + return m_mbcv; +} + +void zr36060_device::mbcv_w(offs_t offset, u8 data) +{ + m_mbcv = data; + LOG("Maximum Block Code Volume %02x -> %d\n", m_mbcv, m_mbcv * 2); +} + +/* + * [0x006] Markers Enable [for Compression modes only] + * x--- ---- APP + * -x-- ---- COM + * --x- ---- DRI + * ---x ---- DQT + * ---- x--- DHT + * ---- ---? + */ +u8 zr36060_device::markers_enable_r(offs_t offset) +{ + return m_markers_enable; +} + +void zr36060_device::markers_enable_w(offs_t offset, u8 data) +{ + m_markers_enable = data; + LOG("Markers Enable %02x\n", data); + LOG("\tAPP %d COM %d DRI %d DQT %d DHT %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 3) + ); +} + +/* + * [0x007] Interrupt Mask + * ---- x--- EOAV End-Of-Active-Video + * ---- -x-- EOI + * ---- --x- END + * ---- ---x DATERR + */ +u8 zr36060_device::irq_mask_r(offs_t offset) +{ + return m_irq_mask; +} + +void zr36060_device::irq_mask_w(offs_t offset, u8 data) +{ + m_irq_mask = data; + LOG("IRQ Mask %02x\n", data); +} + +/* + * [0x008] Interrupt Status + * same as above plus + * xx-- ---- ProCnt 2-bit cyclic Process counter + */ +u8 zr36060_device::irq_status_r(offs_t offset) +{ + return m_irq_status; +} + +/* + * [0x009 - 0x00c] Target Net Code Volume + */ +u8 zr36060_device::tcv_net_r(offs_t offset) +{ + return m_tcv_net[offset]; +} + +void zr36060_device::tcv_net_w(offs_t offset, u8 data) +{ + m_tcv_net[offset] = data; + LOG("Target Net Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x00d - 0x010] Target Data Code Volume + */ +u8 zr36060_device::tcv_data_r(offs_t offset) +{ + return m_tcv_data[offset]; +} + +void zr36060_device::tcv_data_w(offs_t offset, u8 data) +{ + m_tcv_data[offset] = data; + LOG("Target Data Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x011 - 0x012] Scale Factor + */ + u8 zr36060_device::sf_r(offs_t offset) + { + return m_sf[offset]; + } + +void zr36060_device::sf_w(offs_t offset, u8 data) +{ + m_sf[offset] = data; + LOG("Scale Factor [%01x] %02x\n", offset, data); +} + +/* + * [0x013 - 0x015] Allocation Factor + */ +u8 zr36060_device::af_r(offs_t offset) +{ + return m_af[offset]; +} + +void zr36060_device::af_w(offs_t offset, u8 data) +{ + m_af[offset] = data; + LOG("Allocation Factor [%01x] %02x\n", offset, data); +} + +/* + * [0x016 - 0x019] Accumulated Code Volume + */ +u8 zr36060_device::acv_r(offs_t offset) +{ + return m_acv[offset]; +} + +void zr36060_device::acv_w(offs_t offset, u8 data) +{ + m_acv[offset] = data; + LOG("Accumulated Code Volume [%01x] %02x\n", offset, data); +} + +/* + * [0x01a - 0x01d] Accumulated Total Activity + */ +u8 zr36060_device::act_r(offs_t offset) +{ + return m_act[offset]; +} + +void zr36060_device::act_w(offs_t offset, u8 data) +{ + m_act[offset] = data; + LOG("Accumulated Total Activity [%01x] %02x\n", offset, data); +} + +/* + * [0x01e - 0x021] Accumulated Truncated Bits + */ +u8 zr36060_device::acv_trun_r(offs_t offset) +{ + return m_acv_trun[offset]; +} + +void zr36060_device::acv_trun_w(offs_t offset, u8 data) +{ + m_acv_trun[offset] = data; + LOG("Accumulated Truncated Bits [%01x] %02x\n", offset, data); +} - map(0x060, 0x3ff).ram(); // JPEG Markers Array +/************************************** + * + * Video Registers + * + *************************************/ + +u8 zr36060_device::video_control_r(offs_t offset) +{ + return m_video_control; +} + +void zr36060_device::video_control_w(offs_t offset, u8 data) +{ + m_video_control = data; + LOG("Video Control %02x\n", data); + LOG("\tVideo8 %d, Range %s, FIDet %s, FIVedge %s, FIExt %d SyncMstr %s\n" + , BIT(data, 7) ? 8 : 16 + , BIT(data, 6) ? "CCIR-601" : "Full scale" + , BIT(data, 3) ? "FI high/VSYNC latch middle of line" : "FI low/VSYNC latch HSYNC pulse" + , BIT(data, 2) ? "Trailing edge VSYNC" : "Leading edge VSYNC" + , BIT(data, 1) // uses FI pin if high + , BIT(data, 0) ? "Master" : "Slave" + ); +} + +u8 zr36060_device::video_polarity_r(offs_t offset) +{ + return m_video_polarity; +} + +void zr36060_device::video_polarity_w(offs_t offset, u8 data) +{ + m_video_polarity = data; + LOG("Video Polarity %02x\n", data); + LOG("\tVCLKPol %d, PValPol %d, PoePol %d, SImgPol %d, BLPol %d, FIPol %d, HSPol %d, VSPol %d\n" + , BIT(data, 7) + , BIT(data, 6) + , BIT(data, 5) + , BIT(data, 4) + , BIT(data, 3) + , BIT(data, 2) + , BIT(data, 1) + , BIT(data, 0) + ); +} + +u8 zr36060_device::video_scaling_r(offs_t offset) +{ + return (m_vscale << 2) | (m_hscale); +} + +void zr36060_device::video_scaling_w(offs_t offset, u8 data) +{ + m_vscale = BIT(data, 2); + m_hscale = data & 3; + LOG("Scaling %02x\n", data); + LOG("\tVScale %d:1 ratio, HScale %d:1 ratio\n" + , m_vscale + 1 + // NOTE: 8:1 is illegal + , 1 << m_hscale + ); } /************************************** diff --git a/src/devices/video/zr36060.h b/src/devices/video/zr36060.h index 86e3877b9159c..58267460c7465 100644 --- a/src/devices/video/zr36060.h +++ b/src/devices/video/zr36060.h @@ -24,6 +24,83 @@ class zr36060_device : public device_t, public device_memory_interface u16 m_address; address_space_config m_space_config; + + // Codec Control + u8 load_r(offs_t offset); + void load_w(offs_t offset, u8 data); + u8 code_fifo_status_r(offs_t offset); + u8 code_if_r(offs_t offset); + void code_if_w(offs_t offset, u8 data); + u8 codec_mode_r(offs_t offset); + void codec_mode_w(offs_t offset, u8 data); + u8 mbcv_r(offs_t offset); + void mbcv_w(offs_t offset, u8 data); + u8 markers_enable_r(offs_t offset); + void markers_enable_w(offs_t offset, u8 data); + u8 irq_mask_r(offs_t offset); + void irq_mask_w(offs_t offset, u8 data); + u8 irq_status_r(offs_t offset); + u8 tcv_net_r(offs_t offset); + void tcv_net_w(offs_t offset, u8 data); + u8 tcv_data_r(offs_t offset); + void tcv_data_w(offs_t offset, u8 data); + u8 sf_r(offs_t offset); + void sf_w(offs_t offset, u8 data); + u8 af_r(offs_t offset); + void af_w(offs_t offset, u8 data); + u8 acv_r(offs_t offset); + void acv_w(offs_t offset, u8 data); + u8 act_r(offs_t offset); + void act_w(offs_t offset, u8 data); + u8 acv_trun_r(offs_t offset); + void acv_trun_w(offs_t offset, u8 data); + + bool m_syncrst; + bool m_load; + bool m_code16; + bool m_endian; + bool m_cfis; + bool m_code_mstr; + u8 m_codec_mode; + u8 m_mbcv; + u8 m_markers_enable; + u8 m_irq_mask, m_irq_status; + // these are all forms of floating-point registers + u8 m_tcv_net[4], m_tcv_data[4]; + u8 m_sf[2]; + u8 m_af[3]; // 24-bits + u8 m_acv[4], m_act[4], m_acv_trun[4]; + + // Video Registers + u8 video_control_r(offs_t offset); + void video_control_w(offs_t offset, u8 data); + u8 video_polarity_r(offs_t offset); + void video_polarity_w(offs_t offset, u8 data); + u8 video_scaling_r(offs_t offset); + void video_scaling_w(offs_t offset, u8 data); + + u8 m_video_control; + u8 m_video_polarity; + u8 m_hscale, m_vscale; + + struct { + u8 y, u, v; + } m_bg_color; + + struct { + u16 vtotal, htotal; + u8 vsync_size, hsync_size; + u8 bvstart, bhstart; + u16 bvend, bhend; + } m_sync_gen; + + struct { + u16 vstart, vend, hstart, hend; + } m_active_area; + + struct { + u16 svstart, svend, shstart, shend; + } m_subimg_window; }; DECLARE_DEVICE_TYPE(ZR36060, zr36060_device) From 8a31902316f124f6dec36e9d882bec181dcfeb92 Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Mon, 24 Feb 2025 04:04:17 +0100 Subject: [PATCH 007/272] Draw 80 Poker driver improvements: [Roberto Fresca, Grull Osgo] - Added the DIP switch via AY8910. - Battery sensor through T1 line. - Rewrite the input system for players. - Improved coin inputs. - Added and documented the DIP switches fuctionalities. - Lamps support. - Mech Counters support. - Added hopper device. - Added default init for video memory. - Fixed a bug in read NVRAM decode. - Added AY-8910 callback for the DIP switch. - Added support for Wild 1 cocktail mode. - Added button-lamps clickable layout for both games. - System is playable with almost complete functionality. --- src/mame/igt/drw80pkr.cpp | 481 ++++++++++++++++++++++++----------- src/mame/layout/drw80pkr.lay | 166 ++++++++++++ src/mame/mame.lst | 2 +- 3 files changed, 499 insertions(+), 150 deletions(-) create mode 100644 src/mame/layout/drw80pkr.lay diff --git a/src/mame/igt/drw80pkr.cpp b/src/mame/igt/drw80pkr.cpp index 08c3e347e4e0a..b9d984fc8e2f2 100644 --- a/src/mame/igt/drw80pkr.cpp +++ b/src/mame/igt/drw80pkr.cpp @@ -1,36 +1,124 @@ // license:BSD-3-Clause -// copyright-holders:Jim Stolis -/********************************************************************************** +// copyright-holders: Jim Stolis, Roberto Fresca, Grull Osgo +/******************************************************************************************************* + DRAW 80 POKER + Sircoma / IGT - DRAW 80 POKER + Driver by Jim Stolis, Roberto Fresca & Grull Osgo. - Driver by Jim Stolis. + --- Technical Notes --- - --- Technical Notes --- + Name: Draw 80 Poker + Company: IGT - International Game Technology + Year: 1982 - Name: Draw 80 Poker - Company: IGT - International Game Technology - Year: 1982 + Hardware: - Hardware: + CPU = INTEL 8039 ; Intel MCS-48 family of 8-bit microcontrollers + VIDEO = SYS 6545 ; CRTC M6845 compatible + SND = AY-3-8912 ; AY8910 compatible - CPU = INTEL 8039 ; I8039 compatible - VIDEO = SYS 6545 ; CRTC6845 compatible - SND = AY-3-8912 ; AY8910 compatible + History: - History: + This is one of the first video machines produced by IGT. Originally, the + company was called SIRCOMA and was founded in 1979. It became a public + company in 1981 and changed its name to IGT. - This is one of the first video machines produced by IGT. Originally, the - company was called SIRCOMA and was founded in 1979. It became a public - company in 1981 and changed its name to IGT. -***********************************************************************************/ + Coinage: + + DSW#3 OFF ON OFF ON + DSW#4 OFF OFF ON ON + + Coin1 1 3 5 10 + A/S/H 4+4 12+12 20+20 40+40 + G 20+4 60+12 100+20 200+40 + + +******************************************************************************************************** + + Notes by game: + ------------- + + * Draw 80 Poker: + + Draw 80 Poker challenges even the most skilled players with a computerized dealer. Each hand + offers players the choice to stand pat, discard, and draw from a reshuffled deck. Players can + wager one to eight coins or skill points per hand. + + Draw 80 Poker where excitement, reliability, and the potential for earnings come together + in a thrilling experience. + + Please note: The operation of these games and their features may be subject to state and local + laws or regulations. This content is not intended to solicit the sale or operation of these + games in jurisdictions where such activities are not legally permitted. + + + Features: + + - Available in 13" color screen or 19" b/w screen. + - Microprocessor based circuitry with back-up battery for memory. + - High security cash box system (optional). + - Multiply coin entry, single coin option. + - Keyed reset for anti-cheat override. + - Ticket or token dispenser (optional, check local law). + - Credit register. + - Cashbox door. + - Dual coin entry. + - Star-point button switches. + + + * Wild 1 (Quick Change Kit): + + The IGT Drop In Amusement is a compact, versatile video unit designed for easy installation + on bar tops, cocktail tables, or virtually any flat horizontal surface. It offers the exciting + benefit of having all the Quick Change games in a single unit. + + Servicing and game conversions can be done without removing the Drop In Amusement from its location, + making it incredibly convenient. Turn unused space into a profitable opportunity with this innovative + solution. + + +******************************************************************************************************** + + Updates [2025-02-24] + + - Added the DIP switch via AY8910. + - Battery sensor through T1 line. + - Rewrite the input system for players. + - Improved coin inputs. + - Added and documented the DIP switches fuctionalities. + - Lamps support. + - Mech Counters support. + - Added hopper device. + - Added default init for video memory. + - Fixed a bug in read NVRAM decode. + - Added AY-8910 callback for the DIP switch. + - Added support for Wild 1 cocktail mode. + - Added button-lamps clickable layout for both games. + - System is playable with almost complete functionality. + + + TODO: + + - Find the unknown remaining DIP switches. + - Fix the credits addition after each reset. + - Support for the IGT ABC type coin acceptor. + - Reversed and find the unknown port access via P1 and P2. + - Rewrite I/O handlers to simplify the if/then nested scheme toward switch statements. + - Find the coin lock line for documentation. + - Find if there is a diverter or weight sensor line. + - Fix the coin in line for drw80pkr. + + +*******************************************************************************************************/ #include "emu.h" #include "cpu/mcs48/mcs48.h" #include "machine/nvram.h" +#include "machine/ticket.h" #include "video/mc6845.h" #include "sound/ay8910.h" #include "emupal.h" @@ -38,6 +126,8 @@ #include "speaker.h" #include "tilemap.h" +#include "drw80pkr.lh" + namespace { @@ -50,10 +140,13 @@ class drw80pkr_state : public driver_device m_gfxdecode(*this, "gfxdecode"), m_crtc(*this, "crtc"), m_aysnd(*this, "aysnd"), - m_mainbank(*this, "mainbank") + m_mainbank(*this, "mainbank"), + m_hopper(*this, "hopper"), + m_lamps(*this, "lamp%u", 0U) + { } - void init_drw80pkr(); + void init_drw80pkr(); void drw80pkr(machine_config &config); protected: @@ -71,14 +164,16 @@ class drw80pkr_state : public driver_device uint8_t m_attract_mode; uint8_t m_active_bank; uint8_t m_pkr_io_ram[0x100]; - uint16_t m_video_ram[0x0400]; - uint8_t m_color_ram[0x0400]; + uint16_t m_video_ram[0x0400] = {}; + uint8_t m_color_ram[0x0400] = {}; required_device m_maincpu; required_device m_gfxdecode; required_device m_crtc; required_device m_aysnd; required_memory_bank m_mainbank; + required_device m_hopper; + output_finder<8> m_lamps; void p1_w(uint8_t data); void p2_w(uint8_t data); @@ -98,22 +193,29 @@ class drw80pkr_state : public driver_device void io_map(address_map &map) ATTR_COLD; void map(address_map &map) ATTR_COLD; -}; +}; #define DATA_NVRAM_SIZE 0x100 +/*********************************** +* Machine Start * +***********************************/ + void drw80pkr_state::machine_start() { subdevice("nvram")->set_base(m_pkr_io_ram, sizeof(m_pkr_io_ram)); m_active_bank = 0; + m_lamps.resolve(); + m_t1 = 1; // battery level sensor (1 = battery ok) } -/***************** -* Write Handlers * -******************/ + +/*********************************** +* Write Handlers * +***********************************/ void drw80pkr_state::p1_w(uint8_t data) { @@ -146,17 +248,20 @@ void drw80pkr_state::bus_w(uint8_t data) void drw80pkr_state::io_w(offs_t offset, uint8_t data) { uint16_t n_offs; - + if (m_p2 == 0x3f || m_p2 == 0x7f) { n_offs = ((m_p1 & 0xc0) << 2 ) + offset; if (m_p2 == 0x3f) { - m_video_ram[n_offs] = data; // low address - } else { - m_color_ram[n_offs] = data & 0x0f; // color palette - m_video_ram[n_offs] += ((data & 0xf0) << 4 ); // high address + m_video_ram[n_offs] = data; // low address + } + else + { + m_color_ram[n_offs] = data & 0x0f; // color palette + m_video_ram[n_offs] += ((data & 0xf0) << 4 ); // high address + } m_bg_tilemap->mark_tile_dirty(n_offs); @@ -168,20 +273,47 @@ void drw80pkr_state::io_w(offs_t offset, uint8_t data) if (m_p2 == 0xd7) m_crtc->register_w(data); - if (m_p2 == 0xfb) { + if (m_p2 == 0xfb) + { m_pkr_io_ram[offset] = data; } if (m_p2 == 0xff) { - if (m_p1 == 0xdf) + if (m_p1 == 0xdb || m_p1 == 0xef || m_p1 == 0xf7 || m_p1 == 0xfb) { - m_attract_mode = data; // Latch this for use in input reads (0x01 = attract mode, 0x00 = game in progress) + // unknown, most likely lamps, meters, hopper etc. } - if (m_p1 == 0xdb || m_p1 == 0xef || m_p1 == 0xf7 || m_p1 == 0xfb) + // rewrite output decoder + if (m_p1 == 0xf7 || m_p1 == 0xef || m_p1 == 0xdf) { - // unknown, most likely lamps, meters, hopper etc. + // to rewrite with switch + if(m_p1 == 0xf7) // /P1.3 + { + machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin in counter + machine().bookkeeping().coin_counter_w(1, data & 0x02); // credits paid + machine().bookkeeping().coin_counter_w(2, data & 0x04); // credits bet + machine().bookkeeping().coin_counter_w(3, data & 0x08); // coin out counter + m_hopper->motor_w(BIT(data, 4) && BIT(data, 5)); + } + + if(m_p1 == 0xef) // /P1.4 + { + m_lamps[0] = BIT(data, 0); // bet lamp + m_lamps[1] = BIT(data, 1); // start (deal/draw) + m_lamps[2] = BIT(data, 2); // hold + m_lamps[3] = BIT(data, 3); // hold + m_lamps[4] = BIT(data, 4); // hold + m_lamps[5] = BIT(data, 5); // hold + m_lamps[6] = BIT(data, 6); // hold + m_lamps[7] = BIT(data, 7); // unknown + } + + if(m_p1 == 0xdf) // /P1.5 + { + m_attract_mode = data; // latch this for use in input reads (0x01 = attract mode, 0x00 = game in progress) + } } // ay8910 control port @@ -194,9 +326,10 @@ void drw80pkr_state::io_w(offs_t offset, uint8_t data) } } -/**************** -* Read Handlers * -****************/ + +/*********************************** +* Read Handlers * +***********************************/ int drw80pkr_state::t0_r() { @@ -226,8 +359,7 @@ uint8_t drw80pkr_state::bus_r() uint8_t drw80pkr_state::io_r(offs_t offset) { uint8_t ret; - uint16_t kbdin; - + ret = 0x00; if (m_p2 == 0x3b) @@ -235,17 +367,13 @@ uint8_t drw80pkr_state::io_r(offs_t offset) // unknown } - if (m_p2 == 0x7b) - { - ret = m_pkr_io_ram[offset]; - } - if (m_p2 == 0xf7) { // unknown } - if (m_p2 == 0xfb) + if ((m_p2 == 0xfb) | (m_p2 == 0x7b)) // Some reads done with extra P2.7 low, but nvram access requires only P2.2 low.(some bug?) + // Writes don't have this behaviour. { ret = m_pkr_io_ram[offset]; } @@ -259,57 +387,49 @@ uint8_t drw80pkr_state::io_r(offs_t offset) if (m_p1 == 0xfe) { - // Dip switches tied to sound chip - // - // TODO: Unknown switch positions, but found the following flipping bits: - // SW.? = Double Up Option - // SW.? = Coin Denomination - // SW.4 = Payout Type (0=cash, 1=credit) - // SW.? = Use Joker in Deck - // - ret = 0x77; // double-up with credit payout + return m_aysnd->data_r(); + // DIP switches tied to sound chip } - + if ((m_attract_mode == 0x01 && m_p1 == 0xef) || m_p1 == 0xf7) { - // TODO: Get Input Port Values - kbdin = ((ioport("IN1")->read() & 0xaf ) << 8) + ioport("IN0")->read(); - - switch (kbdin) - { - // The following is very incorrect, but does allow you to - // play slightly with very messed up hold buttons etc. - // - // Open/Close the door with 'O' - // Press '5' (twice) with door open to play credit - // Press '1' to draw/deal - // - case 0x0000: ret = 0x00; break; - case 0x0001: ret = 0x01; break; /* Door */ - case 0x4000: ret = 0x00; break; - case 0x8000: ret = 0x00; break; /* Hand Pay */ - case 0x0002: ret = 0x00; break; /* Books */ - case 0x0004: ret = 0x0e; break; /* Coin In */ - case 0x0008: ret = 0x0d; break; /* Start */ - case 0x0010: ret = 0x00; break; /* Discard */ - case 0x0020: ret = 0x00; break; /* Cancel */ - case 0x0040: ret = 0x01; break; /* Hold 1 */ - case 0x0080: ret = 0x02; break; /* Hold 2 */ - case 0x0100: ret = 0x03; break; /* Hold 3 */ - case 0x0200: ret = 0x04; break; /* Hold 4 */ - case 0x0400: ret = 0x05; break; /* Hold 5 */ - case 0x0800: ret = 0x00; break; /* Bet */ + if(m_p1 == 0xef) + return ioport("IN1")->read(); + + if(m_p1 == 0xf7) + { + switch (ioport("IN2")->read()) + { + case 0x0000: ret = 0x80; break; + case 0x0001: ret = 0x81; break; // HOLD 4 P1 + case 0x0002: ret = 0x82; break; // HOLD 3 P1 + case 0x0004: ret = 0x83; break; // HOLD 2 P1 + case 0x0008: ret = 0x84; break; // HOLD 1 P1 + case 0x0010: ret = 0x85; break; // START P1 + case 0x0020: ret = 0x86; break; // BET P1 + case 0x0040: ret = 0x87; break; // HOLD 5 P1 + case 0x0080: ret = 0x88; break; // HOLD 4 P2 + case 0x0100: ret = 0x90; break; // HOLD 3 P2 + case 0x0200: ret = 0x98; break; // HOLD 2 P2 + case 0x0400: ret = 0xa0; break; // HOLD 1 P2 + case 0x0800: ret = 0xa8; break; // START P2 + case 0x1000: ret = 0xb0; break; // BET P2 + case 0x2000: ret = 0xb8; break; // HOLD P2 + case 0x4000: ret = 0x40; break; // Hopper coin out + case 0x8000: ret = 0x00; break; // Books/Door + } + return ret; } } + ret = 0x00; } - return ret; } -/**************************** -* Video/Character functions * -****************************/ +/*********************************** +* Video Hardware * +***********************************/ TILE_GET_INFO_MEMBER(drw80pkr_state::get_bg_tile_info) { @@ -355,15 +475,15 @@ void drw80pkr_state::drw80pkr_palette(palette_device &palette) const } -/************************* -* Graphics Layouts * -*************************/ +/***************************************** +* Graphics Layouts * +*****************************************/ static const gfx_layout charlayout = { - 8,8, /* 8x8 characters */ - RGN_FRAC(1,2), /* 512 characters */ - 2, /* 2 bitplanes */ + 8,8, // 8x8 characters + RGN_FRAC(1,2), // 512 characters + 2, // 2 bitplanes { 0, RGN_FRAC(1,2) }, { STEP8(0,1) }, { STEP8(0,8) }, @@ -371,18 +491,18 @@ static const gfx_layout charlayout = }; -/****************************** -* Graphics Decode Information * -******************************/ +/***************************************** +* Graphics Decode Information * +*****************************************/ static GFXDECODE_START( gfx_drw80pkr ) GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 16 ) GFXDECODE_END -/************** -* Driver Init * -***************/ +/***************************************** +* Driver Init * +*****************************************/ void drw80pkr_state::init_drw80pkr() { @@ -390,9 +510,9 @@ void drw80pkr_state::init_drw80pkr() } -/************************* -* Memory map information * -*************************/ +/***************************************** +* Memory Map Information * +*****************************************/ void drw80pkr_state::map(address_map &map) { @@ -404,37 +524,95 @@ void drw80pkr_state::io_map(address_map &map) map(0x00, 0xff).rw(FUNC(drw80pkr_state::io_r), FUNC(drw80pkr_state::io_w)); } -/************************* -* Input ports * -*************************/ + +/***************************************** +* Input Ports * +*****************************************/ static INPUT_PORTS_START( drw80pkr ) - // Unknown at this time - // These are temporary buttons for testing only - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_DOOR ) PORT_TOGGLE - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) PORT_NAME("Books") - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START1 ) PORT_NAME("Start") - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Discard") PORT_CODE(KEYCODE_2) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_POKER_CANCEL ) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) - - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hopper") PORT_TOGGLE PORT_CODE(KEYCODE_H) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT) - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) + + PORT_START("IN1") //$EF + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer A + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer B + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer C + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(2) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(2) + + PORT_START("IN2") //$F7 + PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) PORT_IMPULSE(2) + PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_POKER_HOLD3 ) PORT_IMPULSE(2) + PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_POKER_HOLD2 ) PORT_IMPULSE(2) + PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_POKER_HOLD1 ) PORT_IMPULSE(2) // Double -> YES / HIGH + PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_GAMBLE_DEAL ) PORT_IMPULSE(2) PORT_CODE(KEYCODE_1) + PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_GAMBLE_BET ) PORT_IMPULSE(2) PORT_NAME("Bet") // switch the control for cocktail mode. + PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_POKER_HOLD5 ) PORT_IMPULSE(2) // Double -> NO / LOW + + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 4 + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 3 + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 2 + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 1 + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode deal/draw + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode bet + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 5 + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x01, "Pair of Aces" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x01, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x02, 0x02, "Joker Enable" ) PORT_DIPLOCATION("SW1:7") + PORT_DIPSETTING( 0x02, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Enabled" ) + PORT_DIPSETTING( 0x00, "Disabled" ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Payout Type" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x10, "Cash" ) + PORT_DIPSETTING( 0x00, "Credits" ) + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2") + PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 1C_5C ) ) + PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) + PORT_DIPNAME( 0x80, 0x00, "Coin Acceptor Type" ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x80, "Type ABC" ) + PORT_DIPSETTING( 0x00, "Single Pulse" ) +INPUT_PORTS_END + + +static INPUT_PORTS_START( drw80wld ) + PORT_INCLUDE( drw80pkr ) + + PORT_MODIFY("IN1") //$EF + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_A) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-2") PORT_CODE(KEYCODE_S) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) // coin sequencer A + PORT_BIT( 0x10, IP_ACTIVE_LOW , IPT_COIN2 ) // coin sequencer B + PORT_BIT( 0x20, IP_ACTIVE_LOW , IPT_COIN3 ) // coin sequencer C + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_G) + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_H) + + PORT_MODIFY("IN2") + PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("Hold 4 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 4 + PORT_BIT( 0x0100, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("Hold 3 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 3 + PORT_BIT( 0x0200, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_W) PORT_NAME("Hold 2 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 2 + PORT_BIT( 0x0400, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("Hold 1 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 1 + PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("Deal (cocktail mode)") PORT_IMPULSE(2) // cocktail mode deal/draw + PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_Y) PORT_NAME("Bet") PORT_IMPULSE(2) // cocktail mode bet (switch the control for cocktail mode) + PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("Hold 5 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 5 INPUT_PORTS_END -/************************* -* Machine Driver * -*************************/ + +/***************************************** +* Machine Driver * +*****************************************/ void drw80pkr_state::drw80pkr(machine_config &config) { @@ -456,7 +634,7 @@ void drw80pkr_state::drw80pkr(machine_config &config) // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(8_MHz_XTAL / 2, 256, 0, 192, 257, 0, 216); // 4 MHz? + screen.set_raw(8_MHz_XTAL / 2, 256, 0, 192, 257, 0, 216); // 4 MHz? screen.set_screen_update(FUNC(drw80pkr_state::screen_update)); screen.set_palette("palette"); @@ -464,7 +642,7 @@ void drw80pkr_state::drw80pkr(machine_config &config) PALETTE(config, "palette", FUNC(drw80pkr_state::drw80pkr_palette), 16 * 16); - MC6845(config, m_crtc, 8_MHz_XTAL / 16); // 0.5 MHz? + MC6845(config, m_crtc, 8_MHz_XTAL / 16); // 0.5 MHz? m_crtc->set_screen("screen"); m_crtc->set_show_border_area(false); m_crtc->set_char_width(8); @@ -474,33 +652,37 @@ void drw80pkr_state::drw80pkr(machine_config &config) SPEAKER(config, "mono").front_center(); AY8912(config, m_aysnd, 20000000/12).add_route(ALL_OUTPUTS, "mono", 0.75); + m_aysnd->port_a_read_callback().set_ioport("DSW1"); + + HOPPER(config, m_hopper, attotime::from_msec(150)); } -/************************* -* Rom Load * -*************************/ + +/***************************************** +* Rom Load * +*****************************************/ ROM_START( drw80pkr ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(73223555) SHA1(229999ec00a1353f0d4928c65c8975079060c5af) ) - ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(f8158f2b) SHA1(da3b30cfd49cd0e8a48d78fd3f82b2b4ab33670c) ) + ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) ) + ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(5a6ad467) SHA1(0128bd70b65244a0f68031d5f451bf115eeb7609) ) ROM_REGION( 0x002000, "gfx1", 0 ) - ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(0eefe598) SHA1(ed10aac345b10e35fb15babdd3ac30ebe2b8fc0f) ) - ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(522a96d0) SHA1(48f855a132413493353fbf6a44a1feb34ae6726d) ) + ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) ) + ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) ) ROM_REGION( 0x100, "proms", 0 ) ROM_LOAD( "cap13.u92", 0x0000, 0x0100, CRC(be67a8d9) SHA1(24b8cd19a5ec09779a737f6fc8c07b44f1226c8f) ) ROM_END -ROM_START( drw80pk2 ) +ROM_START( drw80wld ) ROM_REGION( 0x2000, "maincpu", 0 ) - ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(0f3e97d2) SHA1(aa9e4015246284f32435d7320de667e075412e5b) ) - ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(5a6ad467) SHA1(0128bd70b65244a0f68031d5f451bf115eeb7609) ) + ROM_LOAD( "pm0.u81", 0x0000, 0x1000, CRC(73223555) SHA1(229999ec00a1353f0d4928c65c8975079060c5af) ) + ROM_LOAD( "pm1.u82", 0x1000, 0x1000, CRC(f8158f2b) SHA1(da3b30cfd49cd0e8a48d78fd3f82b2b4ab33670c) ) ROM_REGION( 0x002000, "gfx1", 0 ) - ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(97f5eb92) SHA1(f6c7bb42ccef8a78e8d56104ad942ae5b8e5b0df) ) - ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(2a3a750d) SHA1(db6183d11b2865b011c3748dc472cf5858dde78f) ) + ROM_LOAD( "cg0-a.u74", 0x0000, 0x1000, CRC(0eefe598) SHA1(ed10aac345b10e35fb15babdd3ac30ebe2b8fc0f) ) + ROM_LOAD( "cg1-a.u76", 0x1000, 0x1000, CRC(57d39a16) SHA1(c3d826c2d427bcaabed6a71c1c34d5411afdace8) ) ROM_REGION( 0x100, "proms", 0 ) ROM_LOAD( "cap13.u92", 0x0000, 0x0100, CRC(be67a8d9) SHA1(24b8cd19a5ec09779a737f6fc8c07b44f1226c8f) ) @@ -508,10 +690,11 @@ ROM_END } // Anonymous namespace -/************************* -* Game Drivers * -*************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1982, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker", MACHINE_NOT_WORKING ) -GAME( 1983, drw80pk2, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker - Minn", MACHINE_NOT_WORKING ) +/***************************************** +* Game Drivers * +*****************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1983, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker (Minn)", MACHINE_NOT_WORKING, layout_drw80pkr) +GAMEL( 1982, drw80wld, 0, drw80pkr, drw80wld, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Wild 1 (Quick Change Kit)", MACHINE_NOT_WORKING, layout_drw80pkr) diff --git a/src/mame/layout/drw80pkr.lay b/src/mame/layout/drw80pkr.lay new file mode 100644 index 0000000000000..e08a407e452e0 --- /dev/null +++ b/src/mame/layout/drw80pkr.lay @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 2520b51b0f2d2..84d9bca4662ec 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20806,8 +20806,8 @@ spk205us spk306us @source:igt/drw80pkr.cpp -drw80pk2 drw80pkr +drw80wld @source:igt/fortune1.cpp babydad From 67d0a1e2d521a8d948bc576394c31b573835fa9f Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 13:12:35 +0100 Subject: [PATCH 008/272] leland_v: remove uneeded screen always update flag --- src/mame/cinematronics/leland_v.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mame/cinematronics/leland_v.cpp b/src/mame/cinematronics/leland_v.cpp index d9938e7141eb9..622cceb29cb80 100644 --- a/src/mame/cinematronics/leland_v.cpp +++ b/src/mame/cinematronics/leland_v.cpp @@ -508,7 +508,6 @@ void leland_state::leland_video(machine_config &config) PALETTE(config, m_palette).set_format(palette_device::BGR_233, 1024); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_video_attributes(VIDEO_ALWAYS_UPDATE); m_screen->set_raw(14.318181_MHz_XTAL / 2, 424, 0, 320, 256, 0, 240); m_screen->set_screen_update(FUNC(leland_state::screen_update)); m_screen->set_palette(m_palette); From 6addc09da6ee16ac537dd4c46183ba5edb6f28f0 Mon Sep 17 00:00:00 2001 From: m1macrophage <168948267+m1macrophage@users.noreply.github.com> Date: Mon, 24 Feb 2025 04:17:41 -0800 Subject: [PATCH 009/272] linn/linndrum.cpp: Added interactive layout for the LinnDrum. (#13404) * linn/linndrum.cpp: Added interactive layout for LinnDrum. * linn/linndrum.cpp: Spell tuning correctly. --- src/mame/layout/linn_linndrum.lay | 714 ++++++++++++++++++++++++++++++ src/mame/linn/linndrum.cpp | 170 +++++-- 2 files changed, 843 insertions(+), 41 deletions(-) create mode 100644 src/mame/layout/linn_linndrum.lay diff --git a/src/mame/layout/linn_linndrum.lay b/src/mame/layout/linn_linndrum.lay new file mode 100644 index 0000000000000..66530763c41ca --- /dev/null +++ b/src/mame/layout/linn_linndrum.lay @@ -0,0 +1,714 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mame/linn/linndrum.cpp b/src/mame/linn/linndrum.cpp index 2613e06dc6267..608b3cd4a8869 100644 --- a/src/mame/linn/linndrum.cpp +++ b/src/mame/linn/linndrum.cpp @@ -17,8 +17,7 @@ variations, which brings the total to 24 different sounds. The driver is based on the LinnDrum's service manual and schematics, and is intended as an educational tool. -Most of the digital functionality is emulated, though it is not very usable due -to the lack of a layout. Audio is not yet emulated. +Most of the digital functionality is emulated. Audio is not yet emulated. PCBoards: * CPU board. 2 sections in schematics: @@ -34,16 +33,17 @@ to the lack of a layout. Audio is not yet emulated. Usage: -Since there is no layout yet, usability is limited. +The driver includes a (mostly) interactive layout, including buttons, LEDs and +sliders. The only non-interactive widgets right now are the knobs (such as +tuning and volume). Those will display their current value, but they can only +be modified by the Slider Control menu. -Run the driver with `-log`: +Since there is no audio, the driver logs triggers and other info. To see these +run the driver with `-log`: ./mame -window linndrum -log Tail the log file: (on linux): tail -f error.log - -Press a few of the assigned buttons (B for bass drum, N for snare, T for toms), -and see the voice triggers in the log. */ #include "emu.h" @@ -53,6 +53,8 @@ and see the voice triggers in the log. #include "machine/rescap.h" #include "machine/timer.h" +#include "linn_linndrum.lh" + #define LOG_KEYBOARD (1U << 1) #define LOG_DEBOUNCE (1U << 2) #define LOG_TEMPO (1U << 3) @@ -368,6 +370,8 @@ void linndrum_state::linndrum(machine_config &config) TIMER(config, m_debounce_timer).configure_generic( // 556, U30B. FUNC(linndrum_state::debounce_timer_elapsed)); + config.set_default_layout(layout_linn_linndrum); + // Latches connected to cathodes of LEDs (through resistors), so they are // active-low. @@ -413,51 +417,51 @@ DECLARE_INPUT_CHANGED_MEMBER(linndrum_state::tempo_pot_adjusted) // PORT_NAMEs are based on the annotations in the schematic. INPUT_PORTS_START(linndrum) PORT_START("keyboard_col_0") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("1") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("2") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("3") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("4") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("5") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("6") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("1") PORT_CODE(KEYCODE_1) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("2") PORT_CODE(KEYCODE_2) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("3") PORT_CODE(KEYCODE_3) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("4") PORT_CODE(KEYCODE_4) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("5") PORT_CODE(KEYCODE_5) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_START("keyboard_col_1") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("7") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG/PAT.") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG#") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("END") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("DELETE") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("INSERT") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("7") PORT_CODE(KEYCODE_7) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG/PAT.") PORT_CODE(KEYCODE_Q) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SONG#") PORT_CODE(KEYCODE_W) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("END") PORT_CODE(KEYCODE_E) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("DELETE") PORT_CODE(KEYCODE_R) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("INSERT") PORT_CODE(KEYCODE_T) PORT_START("keyboard_col_2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("<-") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("->") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ENTER") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("STORE") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LOAD") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXT.SYNC") PORT_CODE(KEYCODE_S) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("<-") PORT_CODE(KEYCODE_Y) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("->") PORT_CODE(KEYCODE_U) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ENTER") PORT_CODE(KEYCODE_I) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("STORE") PORT_CODE(KEYCODE_P) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LOAD") PORT_CODE(KEYCODE_COLON) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("EXT.SYNC") PORT_CODE(KEYCODE_L) PORT_START("keyboard_col_3") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BPM/TRIG.") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SIDESTICK") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 1") PORT_CODE(KEYCODE_N) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 2") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 3") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BPM/TRIG.") PORT_CODE(KEYCODE_O) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SIDESTICK") PORT_CODE(KEYCODE_Z) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 1") PORT_CODE(KEYCODE_X) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 2") PORT_CODE(KEYCODE_C) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("SNARE 3") PORT_CODE(KEYCODE_V) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 1") PORT_CODE(KEYCODE_B) PORT_START("keyboard_col_4") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 2") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CRASH") - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PERC.") PORT_CODE(KEYCODE_P) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA1 / HIHAT1") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA2 / HIHAT2") - PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 1 / HIHAT O") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BASS 2") PORT_CODE(KEYCODE_N) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CRASH") PORT_CODE(KEYCODE_M) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("PERC.") PORT_CODE(KEYCODE_COMMA) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA1 / HIHAT1") PORT_CODE(KEYCODE_A) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CABASA2 / HIHAT2") PORT_CODE(KEYCODE_S) + PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 1 / HIHAT O") PORT_CODE(KEYCODE_D) PORT_START("keyboard_col_5") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 2 / HI TOM") - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("HI CONGA / MID TOM") PORT_CODE(KEYCODE_T) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LO CONGA / LO TOM") - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("COWBELL / RIDE 1") - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CLAPS / RIDE 2") PORT_CODE(KEYCODE_L) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TAMP 2 / HI TOM") PORT_CODE(KEYCODE_F) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("HI CONGA / MID TOM") PORT_CODE(KEYCODE_G) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("LO CONGA / LO TOM") PORT_CODE(KEYCODE_H) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("COWBELL / RIDE 1") PORT_CODE(KEYCODE_J) + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("CLAPS / RIDE 2") PORT_CODE(KEYCODE_K) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) // The play-stop button and footswitch input are both connected together @@ -482,6 +486,90 @@ INPUT_PORTS_START(linndrum) PORT_START("pot_tempo") PORT_ADJUSTER(50, "TEMPO") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(linndrum_state::tempo_pot_adjusted), 0) + + PORT_START("pot_volume") + PORT_ADJUSTER(100, "MASTER VOLUME") + + PORT_START("pot_tuning_1") + PORT_ADJUSTER(50, "SNARE TUNING"); + PORT_START("pot_tuning_2") + PORT_ADJUSTER(50, "HI TOM TUNING"); + PORT_START("pot_tuning_3") + PORT_ADJUSTER(50, "MID TOM TUNING"); + PORT_START("pot_tuning_4") + PORT_ADJUSTER(50, "LO TOM TUNING"); + PORT_START("pot_tuning_5") + PORT_ADJUSTER(50, "HI CONGAS TUNING"); + PORT_START("pot_tuning_6") + PORT_ADJUSTER(50, "LO CONGAS TUNING"); + PORT_START("pot_tuning_7") + PORT_ADJUSTER(50, "HIHAT DECAY"); + + PORT_START("pot_pan_1") + PORT_ADJUSTER(50, "BASS PAN") + PORT_START("pot_pan_2") + PORT_ADJUSTER(50, "SNARE PAN") + PORT_START("pot_pan_3") + PORT_ADJUSTER(50, "SIDESTICK PAN") + PORT_START("pot_pan_4") + PORT_ADJUSTER(50, "HIHAT PAN") + PORT_START("pot_pan_5") + PORT_ADJUSTER(50, "HI TOM PAN") + PORT_START("pot_pan_6") + PORT_ADJUSTER(50, "MID TOM PAN") + PORT_START("pot_pan_7") + PORT_ADJUSTER(50, "LO TOM PAN") + PORT_START("pot_pan_8") + PORT_ADJUSTER(50, "RIDE PAN") + PORT_START("pot_pan_9") + PORT_ADJUSTER(50, "CRASH PAN") + PORT_START("pot_pan_10") + PORT_ADJUSTER(50, "CABASA PAN") + PORT_START("pot_pan_11") + PORT_ADJUSTER(50, "TAMB PAN") + PORT_START("pot_pan_12") + PORT_ADJUSTER(50, "HI CONGA PAN") + PORT_START("pot_pan_13") + PORT_ADJUSTER(50, "LO CONGA PAN") + PORT_START("pot_pan_14") + PORT_ADJUSTER(50, "COWBELL PAN") + PORT_START("pot_pan_15") + PORT_ADJUSTER(50, "CLAPS PAN") + PORT_START("pot_pan_16") + PORT_ADJUSTER(50, "CLICK PAN") + + PORT_START("pot_gain_1") + PORT_ADJUSTER(100, "BASS GAIN") + PORT_START("pot_gain_2") + PORT_ADJUSTER(100, "SNARE GAIN") + PORT_START("pot_gain_3") + PORT_ADJUSTER(100, "SIDESTICK GAIN") + PORT_START("pot_gain_4") + PORT_ADJUSTER(100, "HIHAT GAIN") + PORT_START("pot_gain_5") + PORT_ADJUSTER(100, "HI TOM GAIN") + PORT_START("pot_gain_6") + PORT_ADJUSTER(100, "MID TOM GAIN") + PORT_START("pot_gain_7") + PORT_ADJUSTER(100, "LO TOM GAIN") + PORT_START("pot_gain_8") + PORT_ADJUSTER(100, "RIDE GAIN") + PORT_START("pot_gain_9") + PORT_ADJUSTER(100, "CRASH GAIN") + PORT_START("pot_gain_10") + PORT_ADJUSTER(100, "CABASA GAIN") + PORT_START("pot_gain_11") + PORT_ADJUSTER(100, "TAMB GAIN") + PORT_START("pot_gain_12") + PORT_ADJUSTER(100, "HI CONGA GAIN") + PORT_START("pot_gain_13") + PORT_ADJUSTER(100, "LO CONGA GAIN") + PORT_START("pot_gain_14") + PORT_ADJUSTER(100, "COWBELL GAIN") + PORT_START("pot_gain_15") + PORT_ADJUSTER(100, "CLAPS GAIN") + PORT_START("pot_gain_16") + PORT_ADJUSTER(100, "CLICK GAIN") INPUT_PORTS_END ROM_START(linndrum) From 9960028d9c2ce6e48ad1c52e2d9ed00f751969d3 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 25 Feb 2025 00:05:33 +1100 Subject: [PATCH 010/272] misc/vgmplay.cpp: Give visual feedback for playing/paused and loop state. --- src/mame/layout/vgmplay.lay | 24 ++++++++++++++++-------- src/mame/virtual/vgmplay.cpp | 31 ++++++++++++++++++++++++------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/mame/layout/vgmplay.lay b/src/mame/layout/vgmplay.lay index 0101a2375cd66..9cc22dd7115af 100644 --- a/src/mame/layout/vgmplay.lay +++ b/src/mame/layout/vgmplay.lay @@ -108,9 +108,10 @@ license:CC0-1.0 + - + ]]> @@ -122,9 +123,11 @@ license:CC0-1.0 + + - + ]]> @@ -136,9 +139,11 @@ license:CC0-1.0 + + - + ]]> @@ -150,9 +155,10 @@ license:CC0-1.0 + - + ]]> @@ -164,9 +170,11 @@ license:CC0-1.0 + + - + ]]> @@ -269,10 +277,10 @@ license:CC0-1.0 - - + + - + diff --git a/src/mame/virtual/vgmplay.cpp b/src/mame/virtual/vgmplay.cpp index 0433c40f6c431..eb39cb463e57b 100644 --- a/src/mame/virtual/vgmplay.cpp +++ b/src/mame/virtual/vgmplay.cpp @@ -8,11 +8,16 @@ #define QSOUND_LLE -#include "imagedev/snapquik.h" +#include "mega32x.h" +#include "vboysound.h" +#include "wswansound.h" #include "cpu/h6280/h6280.h" #include "cpu/m6502/rp2a03.h" #include "cpu/m68000/m68000.h" + +#include "imagedev/snapquik.h" + #include "sound/ay8910.h" #include "sound/c140.h" #include "sound/c352.h" @@ -43,11 +48,6 @@ #include "sound/ymopn.h" #include "sound/ymz280b.h" -#include "mega32x.h" -#include "vboysound.h" -#include "wswansound.h" - -#include "vgmplay.lh" #include "debugger.h" #include "softlist_dev.h" #include "speaker.h" @@ -62,6 +62,8 @@ #include #include +#include "vgmplay.lh" + #define AS_IO16LE 1 #define AS_IO16BE 4 @@ -278,7 +280,7 @@ class vgmplay_device : public cpu_device void pause(); bool paused() const { return m_paused; } void play(); - void toggle_loop() { m_loop = !m_loop; } + void toggle_loop() { m_loop = !m_loop; m_loop_led = m_loop ? 1 : 0; } protected: virtual void device_start() override ATTR_COLD; @@ -337,6 +339,8 @@ class vgmplay_device : public cpu_device uint32_t handle_pcm_write(uint32_t address); void blocks_clear(); + output_finder<> m_playing_led; + output_finder<> m_loop_led; output_finder m_act_leds; led_expiry_list m_act_led_expiries; std::unique_ptr m_act_led_index; @@ -537,6 +541,8 @@ class vgmplay_state : public driver_device vgmplay_device::vgmplay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, VGMPLAY, tag, owner, clock), + m_playing_led(*this, "playing"), + m_loop_led(*this, "loop"), m_act_leds(*this, "led_act_%u", 0U), m_file_config("file", ENDIANNESS_LITTLE, 8, 32), m_io_config("io", ENDIANNESS_LITTLE, 8, 32), @@ -553,6 +559,8 @@ void vgmplay_device::device_start() m_io16le = &space(AS_IO16LE); m_io16be = &space(AS_IO16BE); + m_playing_led.resolve(); + m_loop_led.resolve(); m_act_leds.resolve(); m_act_led_index = std::make_unique(CT_COUNT); for (vgm_chip led = vgm_chip(0); led != CT_COUNT; led = vgm_chip(led + 1)) @@ -574,6 +582,8 @@ void vgmplay_device::device_reset() { m_state = RESET; m_paused = false; + m_playing_led = 1; + m_loop_led = m_loop ? 1 : 0; m_ym2612_stream_offset = 0; std::fill(std::begin(m_upd7759_bank), std::end(m_upd7759_bank), 0); @@ -638,19 +648,26 @@ void vgmplay_device::stop() { device_reset(); m_paused = true; + m_playing_led = 0; } void vgmplay_device::pause() { m_paused = !m_paused; + m_playing_led = m_paused ? 0 : 1; } void vgmplay_device::play() { if (m_paused && m_state != DONE) + { m_paused = false; + m_playing_led = 1; + } else + { device_reset(); + } } uint32_t vgmplay_device::execute_min_cycles() const noexcept From ac35492ee512d716a400e0bc27d0cb50729a613d Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 24 Feb 2025 17:24:21 +0100 Subject: [PATCH 011/272] New software list items marked not working ------------------------------------------ pc98_cd: FreeBSD(98) Nyuumon Kit (2.1.OR) [sampson] --- hash/pc98_cd.xml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/hash/pc98_cd.xml b/hash/pc98_cd.xml index c39c86b8d8ca7..14165f4bdb798 100644 --- a/hash/pc98_cd.xml +++ b/hash/pc98_cd.xml @@ -16,7 +16,29 @@ license:CC0-1.0 --> - + + + + + + FreeBSD(98) Nyuumon Kit (2.1.OR) + 1995 + Shuwa System + + + + + + + + + + FreeBSD(98) Nyuumon Kit (2.1.OR) 1995 Shuwa System @@ -32,7 +33,9 @@ boot.flp: cannot read CD-ROM device at install time atapi.flp: cannot read HDD device when partitioning Fumbles HDD detection at Heads greater than 8, Sectors greater than 17 ]]> - + + + From ab1224c744eaadebeeb06fc8e0f6afe95a155004 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 24 Feb 2025 18:08:14 +0100 Subject: [PATCH 013/272] New systems marked not working ------------------------------ Baibian Shuangkou [little0] Chaoji Mingxing [little0] --- src/mame/mame.lst | 2 ++ src/mame/misc/ddz.cpp | 53 ++++++++++++++++++++++++++----------- src/mame/skeleton/vgame.cpp | 2 +- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 84d9bca4662ec..10b78aa755e44 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -29680,7 +29680,9 @@ fredmesp lottof2 @source:misc/ddz.cpp +baibians btlfront +cjmx crzclass ddz diff --git a/src/mame/misc/ddz.cpp b/src/mame/misc/ddz.cpp index f7002ec562185..2af520209a701 100644 --- a/src/mame/misc/ddz.cpp +++ b/src/mame/misc/ddz.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese +// copyright-holders: Angelo Salese + /**************************************************************************** 招级疯斗 - "Zhaoji Fengdou" - "Crazy Class" HW @@ -37,6 +38,7 @@ if you reverse the letters you get 'bug in vfprintf : bad base' so I suspect the data is in reverse order and maybe some blocks scrambled about. +trivia: TJF is an acronym for Tai Ji Feng ****************************************************************************/ #include "emu.h" @@ -47,6 +49,7 @@ so I suspect the data is in reverse order and maybe some blocks scrambled about. #include "machine/vrender0.h" #include "sound/vrender0.h" #include "video/vrender0.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -68,19 +71,17 @@ class ddz_state : public driver_device { } - void init_ddz(); - void ddz(machine_config &config); + void init_ddz() ATTR_COLD; + void ddz(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - // memory pointers required_shared_ptr m_workram; required_region_ptr m_encdata; - // devices required_device m_maincpu; required_device m_vr0soc; @@ -126,11 +127,11 @@ void ddz_state::machine_reset() void ddz_state::ddz(machine_config &config) { - SE3208(config, m_maincpu, 14318180 * 3); // TODO : different between each PCBs + SE3208(config, m_maincpu, 14'318'180 * 3); // TODO : different between each PCBs m_maincpu->set_addrmap(AS_PROGRAM, &ddz_state::ddz_mem); m_maincpu->iackx_cb().set(m_vr0soc, FUNC(vrender0soc_device::irq_callback)); - VRENDER0_SOC(config, m_vr0soc, 14318180 * 3); + VRENDER0_SOC(config, m_vr0soc, 14'318'180 * 3); m_vr0soc->set_host_cpu_tag(m_maincpu); } @@ -180,6 +181,26 @@ ROM_START( crzclass ) // rom4 not populated ROM_END +ROM_START( baibians ) // same PCB as crzclass + ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) + + ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) + ROM_LOAD("rom1", 0x000000, 0x400000, CRC(b9a61efe) SHA1(e0114c231bf301779033b357bc65b133f2ab00be) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom2", 0x400000, 0x400000, CRC(8b17c3a8) SHA1(b7c65fe9c262ec819ecb0d92e885c6b67d1ee938) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom3", 0x800000, 0x400000, CRC(41b9b943) SHA1(3379ddf851818209cfede641e7bcc4be8b982034) ) // SHARP LH28F320BJD-TTL80 + // rom4 not populated +ROM_END + +ROM_START( cjmx ) // same PCB as crzclass, but this one has an Amazon LF instead of the VRenderZero + ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) + + ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) + ROM_LOAD("rom1", 0x000000, 0x400000, CRC(518ff760) SHA1(68e3fc3269060e0abd8473abfc141f038d63e4e4) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom2", 0x400000, 0x400000, CRC(9caa6b70) SHA1(9914793ac772b9ae113f820c181a653ab8a9634d) ) // SHARP LH28F320BJD-TTL80 + ROM_LOAD("rom3", 0x800000, 0x400000, CRC(738db095) SHA1(073c92d8d22cbec5e6f5f5e4c25e532d2ab914d5) ) // SHARP LH28F320BJD-TTL80 + // rom4 not populated +ROM_END + ROM_START( btlfront ) ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) @@ -194,18 +215,20 @@ ROM_END void ddz_state::init_ddz() { uint8_t *ipl = reinterpret_cast(memregion("ipl")->base()); - for(uint32_t x=0;x Date: Mon, 24 Feb 2025 18:28:11 +0100 Subject: [PATCH 014/272] leland: no need to check for scanline>0 for partial updates (update_partial already checks if scanline is out of bounds) --- src/mame/cinematronics/leland_m.cpp | 6 ++---- src/mame/cinematronics/leland_v.cpp | 16 ++++------------ 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/mame/cinematronics/leland_m.cpp b/src/mame/cinematronics/leland_m.cpp index 3cdd5eb2fff32..89a130312906c 100644 --- a/src/mame/cinematronics/leland_m.cpp +++ b/src/mame/cinematronics/leland_m.cpp @@ -34,11 +34,9 @@ #define VERBOSE LOG_WARN #include "logmacro.h" -/* Internal routines */ - - +/* Internal routines */ /************************************* * @@ -105,7 +103,6 @@ u8 leland_state::cerberus_dial_2_r() * *************************************/ - void leland_state::alleymas_joystick_kludge(u8 data) { /* catch the case where they clear this memory location at PC $1827 and change */ @@ -859,6 +856,7 @@ void ataxx_state::ataxx_battery_ram_w(offs_t offset, u8 data) } else if ((m_master_bank & 0x30) == 0x20) { + m_screen->update_partial(m_screen->vpos() - 1); m_ataxx_qram[((m_master_bank & 0xc0) << 8) | offset] = data; m_tilemap->mark_tile_dirty(((m_master_bank & 0x80) << 8) | offset); } diff --git a/src/mame/cinematronics/leland_v.cpp b/src/mame/cinematronics/leland_v.cpp index 622cceb29cb80..13318af892d2b 100644 --- a/src/mame/cinematronics/leland_v.cpp +++ b/src/mame/cinematronics/leland_v.cpp @@ -154,9 +154,7 @@ void ataxx_state::video_start() void leland_state::scroll_w(offs_t offset, u8 data) { - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); + m_screen->update_partial(m_screen->vpos() - 1); /* adjust the proper scroll value */ switch (offset) @@ -185,12 +183,10 @@ void leland_state::scroll_w(offs_t offset, u8 data) void leland_state::gfx_port_w(u8 data) { - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); - if (m_gfxbank != data) { + m_screen->update_partial(m_screen->vpos() - 1); + m_gfxbank = data; m_tilemap->mark_all_dirty(); } @@ -274,11 +270,7 @@ void leland_state::vram_port_w(offs_t offset, u8 data, int num) int inc = (offset >> 2) & 2; int trans = (offset >> 4) & num; - /* don't fully understand why this is needed. Isn't the - video RAM just one big RAM? */ - int scanline = m_screen->vpos(); - if (scanline > 0) - m_screen->update_partial(scanline - 1); + m_screen->update_partial(m_screen->vpos() - 1); if (addr >= 0xf000) LOGMASKED(LOG_COMM, "%s:%s comm write %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, data); From 56a55eb6ce792eab2c336a9b891a0ea2808dbc9e Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 18:37:08 +0100 Subject: [PATCH 015/272] screen: remember last partial updates reset time because of scheduler time travel issue --- src/emu/screen.cpp | 19 +++++++++++++++++++ src/emu/screen.h | 7 ++++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index b14e9c39d8493..f2fbb290303d8 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -555,6 +555,7 @@ screen_device::screen_device(const machine_config &mconfig, const char *tag, dev , m_curbitmap(0) , m_curtexture(0) , m_changed(true) + , m_last_partial_reset(attotime::zero) , m_last_partial_scan(0) , m_partial_scan_hpos(0) , m_color(rgb_t(0xff, 0xff, 0xff, 0xff)) @@ -877,6 +878,7 @@ void screen_device::device_start() save_item(NAME(m_visarea.min_y)); save_item(NAME(m_visarea.max_x)); save_item(NAME(m_visarea.max_y)); + save_item(NAME(m_last_partial_reset)); save_item(NAME(m_last_partial_scan)); save_item(NAME(m_frame_period)); save_item(NAME(m_brightness)); @@ -1169,6 +1171,14 @@ bool screen_device::update_partial(int scanline) return false; } + // skip if we already rendered this frame + // this can happen if the executing cpu timeslice is in the previous frame while scanline 0 already started + if (m_last_partial_scan == 0 && m_last_partial_reset > machine().time()) + { + LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); + return false; + } + // set the range of scanlines to render rectangle clip(m_visarea); clip.sety((std::max)(clip.top(), m_last_partial_scan), (std::min)(clip.bottom(), scanline)); @@ -1279,6 +1289,14 @@ void screen_device::update_now() return; } + // skip if we already rendered this frame + // this can happen if the executing cpu timeslice is in the previous frame while scanline 0 already started + if (m_last_partial_scan == 0 && m_partial_scan_hpos == 0 && m_last_partial_reset > machine().time()) + { + LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); + return; + } + LOG_PARTIAL_UPDATES(("update_now(): Y=%d, X=%d, last partial %d, partial hpos %d (vis %d %d)\n", current_vpos, current_hpos, m_last_partial_scan, m_partial_scan_hpos, m_visarea.right(), m_visarea.bottom())); // start off by doing a partial update up to the line before us, in case that was necessary @@ -1394,6 +1412,7 @@ void screen_device::update_now() void screen_device::reset_partial_updates() { + m_last_partial_reset = machine().time(); m_last_partial_scan = 0; m_partial_scan_hpos = 0; m_partial_updates_this_frame = 0; diff --git a/src/emu/screen.h b/src/emu/screen.h index 5eb88f08f27f9..9100ae5bacc55 100644 --- a/src/emu/screen.h +++ b/src/emu/screen.h @@ -461,7 +461,7 @@ class screen_device : public device_t screen_update_rgb32_delegate m_screen_update_rgb32; // screen update callback (32-bit RGB) devcb_write_line m_screen_vblank; // screen vblank line callback devcb_write32 m_scanline_cb; // screen scanline callback - optional_device m_palette; // our palette + optional_device m_palette; // our palette u32 m_video_attributes; // flags describing the video system optional_memory_region m_svg_region; // the region in which the svg data is in @@ -485,6 +485,7 @@ class screen_device : public device_t u8 m_curbitmap; // current bitmap index u8 m_curtexture; // current texture index bool m_changed; // has this bitmap changed? + attotime m_last_partial_reset; // last time partial updates were reset s32 m_last_partial_scan; // scanline of last partial update s32 m_partial_scan_hpos; // horizontal pixel last rendered on this partial scanline bitmap_argb32 m_screen_overlay_bitmap; // screen overlay bitmap @@ -504,7 +505,7 @@ class screen_device : public device_t emu_timer * m_scanline0_timer; // scanline 0 timer emu_timer * m_scanline_timer; // scanline timer u64 m_frame_number; // the current frame number - u32 m_partial_updates_this_frame;// partial update counter this frame + u32 m_partial_updates_this_frame; // partial update counter this frame bool m_is_primary_screen; @@ -517,7 +518,7 @@ class screen_device : public device_t vblank_state_delegate m_callback; }; - std::vector> m_callback_list; // list of VBLANK callbacks + std::vector> m_callback_list; // list of VBLANK callbacks // auto-sizing bitmaps class auto_bitmap_item From 6783d93bd3d8609fa97e5887b81a90c2acf49979 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 24 Feb 2025 19:08:16 +0100 Subject: [PATCH 016/272] capcom/cps1_v.cpp: fix #13413 --- hash/pc98_cd.xml | 5 +++-- src/mame/capcom/cps1_v.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hash/pc98_cd.xml b/hash/pc98_cd.xml index 046facd00822c..d2891eec43749 100644 --- a/hash/pc98_cd.xml +++ b/hash/pc98_cd.xml @@ -25,8 +25,9 @@ license:CC0-1.0 --> - FreeBSD(98) Nyuumon Kit (2.1.OR) - 1995 + + FreeBSD(98) Nyuumon Kit (2.1.0R) + 1996 Shuwa System Date: Mon, 24 Feb 2025 19:45:35 +0100 Subject: [PATCH 017/272] ddragon3_v: small cleanup to source code spacing --- src/emu/screen.cpp | 4 +- src/mame/technos/ddragon3.cpp | 1 - src/mame/technos/ddragon3_v.cpp | 192 +++++++++++++++----------------- 3 files changed, 93 insertions(+), 104 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index f2fbb290303d8..8082b7ddad225 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -1172,7 +1172,7 @@ bool screen_device::update_partial(int scanline) } // skip if we already rendered this frame - // this can happen if the executing cpu timeslice is in the previous frame while scanline 0 already started + // this can happen if a cpu timeslice that called update_partial is in the previous frame while scanline 0 already started if (m_last_partial_scan == 0 && m_last_partial_reset > machine().time()) { LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); @@ -1290,7 +1290,7 @@ void screen_device::update_now() } // skip if we already rendered this frame - // this can happen if the executing cpu timeslice is in the previous frame while scanline 0 already started + // this can happen if a cpu timeslice that called update_now is in the previous frame while scanline 0 already started if (m_last_partial_scan == 0 && m_partial_scan_hpos == 0 && m_last_partial_reset > machine().time()) { LOG_PARTIAL_UPDATES(("skipped because frame was already rendered\n")); diff --git a/src/mame/technos/ddragon3.cpp b/src/mame/technos/ddragon3.cpp index f1b8cb27ca538..7734aee2f439c 100644 --- a/src/mame/technos/ddragon3.cpp +++ b/src/mame/technos/ddragon3.cpp @@ -234,7 +234,6 @@ void wwfwfest_state::wwfwfest_irq_ack_w(offs_t offset, uint16_t data) { if (offset == 0) m_maincpu->set_input_line(3, CLEAR_LINE); - else m_maincpu->set_input_line(2, CLEAR_LINE); } diff --git a/src/mame/technos/ddragon3_v.cpp b/src/mame/technos/ddragon3_v.cpp index d7e18d044bc73..2bd0dfcae8ed1 100644 --- a/src/mame/technos/ddragon3_v.cpp +++ b/src/mame/technos/ddragon3_v.cpp @@ -13,14 +13,14 @@ void ddragon3_state::ddragon3_scroll_w(offs_t offset, uint16_t data, uint16_t me { switch (offset) { - case 0: COMBINE_DATA(&m_fg_scrollx); break; // Scroll X, BG1 - case 1: COMBINE_DATA(&m_fg_scrolly); break; // Scroll Y, BG1 - case 2: COMBINE_DATA(&m_bg_scrollx); break; // Scroll X, BG0 - case 3: COMBINE_DATA(&m_bg_scrolly); break; // Scroll Y, BG0 - case 4: break; // Unknown write - case 5: flip_screen_set(data & 0x01); break; // Flip Screen + case 0: COMBINE_DATA(&m_fg_scrollx); break; // Scroll X, BG1 + case 1: COMBINE_DATA(&m_fg_scrolly); break; // Scroll Y, BG1 + case 2: COMBINE_DATA(&m_bg_scrollx); break; // Scroll X, BG0 + case 3: COMBINE_DATA(&m_bg_scrolly); break; // Scroll Y, BG0 + case 4: break; // Unknown write + case 5: flip_screen_set(data & 0x01); break; // Flip Screen case 6: - COMBINE_DATA(&m_bg_tilebase); // BG Tile Base + COMBINE_DATA(&m_bg_tilebase); // BG Tile Base m_bg_tilebase &= 0x1ff; m_bg_tilemap->mark_all_dirty(); break; @@ -63,23 +63,15 @@ void ddragon3_state::ddragon3_bg_videoram_w(offs_t offset, uint16_t data, uint16 - /*****************************************************************************************************************************************************/ - - TILE_GET_INFO_MEMBER(ddragon3_state::get_fg_tile_info) { - uint16_t *tilebase; - int tileno,colbank; - - tilebase = &m_fg_videoram[tile_index*2]; - tileno = (tilebase[1] & 0x1fff); - colbank = (tilebase[0] & 0x000f); - tileinfo.set(1, - tileno, - colbank, - TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)); + uint16_t *tilebase = &m_fg_videoram[tile_index * 2]; + int tileno = (tilebase[1] & 0x1fff); + int colbank = (tilebase[0] & 0x000f); + + tileinfo.set(1, tileno, colbank, TILE_FLIPYX((tilebase[0] & 0x00c0) >> 6)); } @@ -92,30 +84,23 @@ void ddragon3_state::ddragon3_fg_videoram_w(offs_t offset, uint16_t data, uint16 - /*****************************************************************************************************************************************************/ /* 8x8 text layer - wwfwfest only */ TILE_GET_INFO_MEMBER(wwfwfest_state::get_fg0_tile_info) { - uint16_t *tilebase; - int tileno; - int colbank; - tilebase = &m_fg0_videoram[tile_index*2]; - tileno = (tilebase[0] & 0x00ff) | ((tilebase[1] & 0x000f) << 8); - colbank = (tilebase[1] & 0x00f0) >> 4; - tileinfo.set(3, - tileno, - colbank, - 0); + uint16_t *tilebase = &m_fg0_videoram[tile_index * 2]; + int tileno = (tilebase[0] & 0x00ff) | ((tilebase[1] & 0x000f) << 8); + int colbank = (tilebase[1] & 0x00f0) >> 4; + + tileinfo.set(3, tileno, colbank, 0); } void wwfwfest_state::wwfwfest_fg0_videoram_w(offs_t offset, uint16_t data) { - /* Videoram is 8 bit, upper & lower byte writes end up in the same place due to m68k byte smearing */ - m_fg0_videoram[offset]=data&0xff; - - m_fg0_tilemap->mark_tile_dirty(offset/2); + // Videoram is 8 bit, upper & lower byte writes end up in the same place due to m68k byte smearing + m_fg0_videoram[offset] = data & 0xff; + m_fg0_tilemap->mark_tile_dirty(offset / 2); } /*****************************************************************************************************************************************************/ @@ -138,7 +123,7 @@ void wwfwfest_state::video_start() { ddragon3_state::video_start(); - m_fg0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wwfwfest_state::get_fg0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8,64,32); + m_fg0_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(wwfwfest_state::get_fg0_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); m_fg0_tilemap->set_transparent_pen(0); } @@ -179,52 +164,54 @@ void ddragon3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec int length = m_spriteram->bytes(); gfx_element *gfx = m_gfxdecode->gfx(2); uint16_t *source = buffered_spriteram16; - uint16_t *finish = source + length/2; + uint16_t *finish = source + length / 2; - while( source512-16) xpos -=512; + if (source[1] & 0x0001) + { + int xpos = (source[5] & 0x00ff) | (source[1] & 0x0004) << 6; + if (xpos > 512 - 16) xpos -= 512; xpos += m_sprite_xoff; - ypos = (source[0] & 0x00ff) | (source[1] & 0x0002) << 7; + + int ypos = (source[0] & 0x00ff) | (source[1] & 0x0002) << 7; ypos = (256 - ypos) & 0x1ff; - ypos -= 16 ; - flipx = (source[1] & 0x0010) >> 4; - flipy = (source[1] & 0x0008) >> 3; - chain = (source[1] & 0x00e0) >> 5; - chain += 1; - number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; - colourbank = (source[4] & 0x000f); - - if (flip_screen()) { - if (flipy) flipy=0; else flipy=1; - if (flipx) flipx=0; else flipx=1; - ypos=240-ypos-m_sprite_xoff; - xpos=304-xpos; + ypos -= 16; + + int flipx = (source[1] & 0x0010) >> 4; + int flipy = (source[1] & 0x0008) >> 3; + int chain = (source[1] & 0x00e0) >> 5; + int number = (source[2] & 0x00ff) | (source[3] & 0x00ff) << 8; + int colourbank = (source[4] & 0x000f); + + if (flip_screen()) + { + flipy = !flipy; + flipx = !flipx; + ypos = 240 - ypos - m_sprite_xoff; + xpos = 304 - xpos; } - for (count=0;counttranspen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos+(16*(chain-1))-(16*count),0); - } else { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos+16*count,0); - } - } else { - if (flipy) { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos-(16*(chain-1))+(16*count),0); - } else { - gfx->transpen(bitmap,cliprect,number+count,colourbank,flipx,flipy,xpos,ypos-16*count,0); - } + for (int count = 0; count <= chain; count++) + { + if (flip_screen()) + { + if (!flipy) + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos + (16 * chain) - (16 * count), 0); + else + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos + 16 * count, 0); + } + else + { + if (flipy) + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos - (16 * chain) + (16 * count), 0); + else + gfx->transpen(bitmap, cliprect, number + count, colourbank, flipx, flipy, xpos, ypos - 16 * count, 0); } } } - source+=8; + + source += 8; } } @@ -232,8 +219,6 @@ void ddragon3_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec /*****************************************************************************************************************************************************/ - - uint32_t ddragon3_state::screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); @@ -269,7 +254,7 @@ uint32_t ddragon3_state::screen_update_ctribe(screen_device &screen, bitmap_ind1 m_fg_tilemap->set_scrollx(0, m_fg_scrollx); m_fg_tilemap->set_scrolly(0, m_fg_scrolly); - if(m_vreg & 8) + if (m_vreg & 8) { m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); draw_sprites(bitmap, cliprect); @@ -287,39 +272,44 @@ uint32_t ddragon3_state::screen_update_ctribe(screen_device &screen, bitmap_ind1 uint32_t wwfwfest_state::screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - if (m_pri == 0x78) { - m_fg_tilemap->set_scrolly(0, m_fg_scrolly ); - m_fg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg0_dx); - m_bg_tilemap->set_scrolly(0, m_bg_scrolly ); - m_bg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg1_dx[0]); - } else { - m_bg_tilemap->set_scrolly(0, m_fg_scrolly ); - m_bg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg1_dx[1]); - m_fg_tilemap->set_scrolly(0, m_bg_scrolly ); - m_fg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg0_dx); + if (m_pri == 0x78) + { + m_fg_tilemap->set_scrolly(0, m_fg_scrolly); + m_fg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg0_dx); + m_bg_tilemap->set_scrolly(0, m_bg_scrolly); + m_bg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg1_dx[0]); + } + else + { + m_bg_tilemap->set_scrolly(0, m_fg_scrolly); + m_bg_tilemap->set_scrollx(0, m_fg_scrollx + m_bg1_dx[1]); + m_fg_tilemap->set_scrolly(0, m_bg_scrolly); + m_fg_tilemap->set_scrollx(0, m_bg_scrollx + m_bg0_dx); } - /* todo : which bits of pri are significant to the order */ - - if (m_pri == 0x7b) { - m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + // TODO: which bits of pri are significant to the order + if (m_pri == 0x7b) + { + m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); } - if (m_pri == 0x7c) { - m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - draw_sprites(bitmap,cliprect); - m_bg_tilemap->draw(screen, bitmap, cliprect, 0,0); + if (m_pri == 0x7c) + { + m_fg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + draw_sprites(bitmap, cliprect); + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); } - if (m_pri == 0x78) { - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); - m_fg_tilemap->draw(screen, bitmap, cliprect, 0,0); - draw_sprites(bitmap,cliprect); + if (m_pri == 0x78) + { + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); } - m_fg0_tilemap->draw(screen, bitmap, cliprect, 0,0); + m_fg0_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } From 0c82d6d445c33bc74532f374d7b7c67758794aef Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 20:16:17 +0100 Subject: [PATCH 018/272] cbajbl: mark game as bootleg --- src/mame/sony/zn.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/sony/zn.cpp b/src/mame/sony/zn.cpp index bba7059f630b8..383496bf05dbe 100644 --- a/src/mame/sony/zn.cpp +++ b/src/mame/sony/zn.cpp @@ -6088,7 +6088,7 @@ GAME( 1996, hvnsgate, coh1001l, coh1001l, zn2p, atlus_zn_state, empty_in // Video System ZN-1 (VS34) GAME( 1996, coh1002v, 0, coh1002v, zn, visco_zn_state, empty_init, ROT0, "Video System Co.", "Video System ZN-1", MACHINE_IS_BIOS_ROOT | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, aerofgts, coh1002v, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "McO'River, Inc.", "Aero Fighters Special (USA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, aerofgts, coh1002v, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "McO'River, Inc.", "Aero Fighters Special (USA)", MACHINE_SUPPORTS_SAVE ) // McO'River = Video System USA GAME( 1996, aerofgtst, aerofgts, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "Video System Co.", "Aero Fighters Special (Taiwan)", MACHINE_SUPPORTS_SAVE ) GAME( 1996, sncwgltd, aerofgts, coh1002v, aerofgts, visco_zn_state, empty_init, ROT270, "Video System Co.", "Sonic Wings Limited (Japan)", MACHINE_SUPPORTS_SAVE ) @@ -6151,7 +6151,7 @@ GAME( 1997, glpracr2l, glpracr2, coh1002ml, glpracr2, glpracr2l_state, empty_in GAME( 1998, doapp, coh1002m, coh1002m, zn2p, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Dead Or Alive ++ (Japan/USA/Export)", MACHINE_SUPPORTS_SAVE ) // region set under GAME OPTIONS, then NATION GAME( 1998, doappk, doapp, coh1002m, zn2p, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Dead Or Alive ++ (Korea)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, cbaj, coh1002m, cbaj, zn1p, cbaj_state, empty_init, ROT0, "UEP Systems", "Cool Boarders Arcade Jam (Export)", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, cbajbl, cbaj, cbaj, zn1p, cbaj_state, empty_init, ROT0, "UEP Systems", "Cool Boarders Arcade Jam Bootleg (Export)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, cbajbl, cbaj, cbaj, zn1p, cbaj_state, empty_init, ROT0, "bootleg", "Cool Boarders Arcade Jam (Export bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, shngmtkb, coh1002m, coh1002m, zn2p, tecmo_zn_state, empty_init, ROT0, "Sunsoft / Activision", "Shanghai Matekibuyuu (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1999, tondemo, coh1002m, coh1002m, zn1p, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Tondemo Crisis (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1999, glpracr3, coh1002m, coh1002m, glpracr2, tecmo_zn_state, empty_init, ROT0, "Tecmo", "Gallop Racer 3 (Export)", MACHINE_SUPPORTS_SAVE ) From 267beaa5a6caea00fc5e30222914db5b22331d39 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 20:31:12 +0100 Subject: [PATCH 019/272] cbajbl: remove odd spaces from romdefs --- src/mame/sony/zn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/sony/zn.cpp b/src/mame/sony/zn.cpp index 383496bf05dbe..0e18916dc2577 100644 --- a/src/mame/sony/zn.cpp +++ b/src/mame/sony/zn.cpp @@ -4710,7 +4710,7 @@ ROM_START( cbajbl ) ROM_LOAD( "uo220.bin", 0x1400000, 0x200000, BAD_DUMP CRC(19102f15) SHA1(b7964e0cb53b608b775d7a713b63f13307b1b532) ) // cb-04.220 [1/2] 2 bits different ROM_LOAD( "uo220h.bin", 0x1600000, 0x200000, BAD_DUMP CRC(e7b94df3) SHA1(07b5d85e1a337f10c25cebdb0f3f893e38a1db6c) ) // cb-04.220 [2/2] 5 bits different ROM_LOAD( "uo221.bin", 0x1800000, 0x200000, CRC(701d7c4e) SHA1(b06c2db7e06d453991f9872bcb62951eb62b5d56) ) // cb-05.221 [1/2] - ROM_LOAD( "uo221h.bin" , 0x1a00000, 0x200000, CRC(5e93c0d6) SHA1(2ec5afd53eee9e8e6e2ac91a269a5ec55cef4da1) ) // cb-05.221 [2/2] + ROM_LOAD( "uo221h.bin", 0x1a00000, 0x200000, CRC(5e93c0d6) SHA1(2ec5afd53eee9e8e6e2ac91a269a5ec55cef4da1) ) // cb-05.221 [2/2] ROM_LOAD( "uo222.bin", 0x1c00000, 0x200000, CRC(76ad7801) SHA1(9cb38aff86f3f8151145f2661bf1261adbd2ec1c) ) // cb-06.222 [1/2] ROM_LOAD( "uo222h.bin", 0x1e00000, 0x200000, CRC(34561670) SHA1(2131fcbbc8bc3da31cd4ef027ec6688af212b7c1) ) // cb-06.222 [2/2] ROM_LOAD( "uo223.bin", 0x2000000, 0x200000, CRC(d4a80392) SHA1(d8d69e8a15910471b718dc6531e4470fc35365cc) ) // cb-07.223 [1/2] From 67cd61386abb9294c2b0cfb0edea43585c6e22d1 Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 24 Feb 2025 22:17:55 +0100 Subject: [PATCH 020/272] pci/zr36057.cpp: hookup video frontend handlers --- src/devices/bus/pci/zr36057.cpp | 368 +++++++++++++++++++++++++++++--- src/devices/bus/pci/zr36057.h | 39 ++++ src/devices/video/zr36060.cpp | 1 - src/mame/capcom/cps1_v.cpp | 2 +- 4 files changed, 383 insertions(+), 27 deletions(-) diff --git a/src/devices/bus/pci/zr36057.cpp b/src/devices/bus/pci/zr36057.cpp index 5e9d0ddc27159..06e124ef42f7e 100644 --- a/src/devices/bus/pci/zr36057.cpp +++ b/src/devices/bus/pci/zr36057.cpp @@ -14,7 +14,8 @@ iterations. ZR36057 is known to have two HW quirks that are been fixed with ZR36067. TODO: -- Enough to pass board functions in dc10plus HW test, requires VSYNC signal from ZR36060 to continue; +- Enough to pass board functions in dc10plus HW test, requires GIRQ1 signal source to continue +(from SAA7110? On its own it doesn't touch any of the sync registers); - Hookup busmaster; - What are i2c 0x8e >> 1 address device checks for? \- Can't be adv7175 (0xd4 >> 1) nor adv7176 (0x54 >> 1) @@ -39,13 +40,17 @@ Known mix-ins: #define LOG_WARN (1U << 1) #define LOG_PO (1U << 2) // PostOffice interactions +#define LOG_VFE (1U << 3) // Log Video Front End +#define LOG_SYNC (1U << 4) // Log Sync signals and Active Area (as SyncMstr) -#define VERBOSE (LOG_GENERAL | LOG_WARN) +#define VERBOSE (LOG_GENERAL | LOG_WARN | LOG_VFE | LOG_SYNC) //#define LOG_OUTPUT_FUNC osd_printf_info #include "logmacro.h" #define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) #define LOGPO(...) LOGMASKED(LOG_PO, __VA_ARGS__) +#define LOGVFE(...) LOGMASKED(LOG_VFE, __VA_ARGS__) +#define LOGSYNC(...) LOGMASKED(LOG_SYNC, __VA_ARGS__) DEFINE_DEVICE_TYPE(ZR36057_PCI, zr36057_device, "zr36057", "Zoran ZR36057-based Enhanced Multimedia Controller") //DEFINE_DEVICE_TYPE(ZR36067_PCI, zr36067_device, "zr36067", "Zoran ZR36067-based AV Controller") @@ -127,6 +132,46 @@ void zr36057_device::software_reset() m_vfe.horizontal_config = (m_vfe.hspol << 30) | (m_vfe.hstart << 10) | (m_vfe.hend << 0); m_vfe.vertical_config = (m_vfe.vspol << 30) | (m_vfe.vstart << 10) | (m_vfe.vend << 0); + m_vfe.ext_fi = 0; + m_vfe.top_field = 1; + m_vfe.vclk_pol = 0; + m_vfe.hfilter = 0; + m_vfe.dup_fld = 0; + m_vfe.hor_dcm = 0; + m_vfe.ver_dcm = 0; + m_vfe.disp_mod = 0; + m_vfe.yuv2rgb = 2; + m_vfe.err_dif = 0; + m_vfe.pack24 = 0; + m_vfe.little_endian = 1; + m_vfe.format_config = (m_vfe.top_field << 25) | (m_vfe.yuv2rgb << 3) | (m_vfe.little_endian << 0); + m_vfe.vid_bottom_base = m_vfe.vid_top_base = m_vfe.mask_bottom_base = m_vfe.mask_top_base = 0xffff'fffc; + m_vfe.disp_stride = 0xfffc; + m_vfe.vid_ovf = m_vfe.snapshot = m_vfe.frame_grab = false; + m_vfe.vid_en = false; + m_vfe.min_pix = 0xf; + m_vfe.triton = false; + m_vfe.window_height = 0x0f0; + m_vfe.window_width = 0x3ff; + m_vfe.display_config = (m_vfe.vid_en << 31) | (m_vfe.min_pix << 24) | (m_vfe.window_height << 12) | (m_vfe.window_width); + + m_vfe.ovl_enable = false; + m_vfe.mask_stride = 0xff; + + m_sync_gen.vsync_size = 6; + m_sync_gen.vtotal = 525; + m_sync_gen.hsync_start = 640; + m_sync_gen.htotal = 780; + + m_active_area.nax = 0; + m_active_area.pax = 640; + m_active_area.nay = 10; + m_active_area.pay = 240; + m_active_area.odd = true; + + m_irq_status = m_irq_enable = 0; + m_inta_pin_enable = false; + m_pci_waitstate_control = 0; m_gpio_ddr = 0xff; // all inputs // GuestBus ID default @@ -157,40 +202,193 @@ void zr36057_device::asr_map(address_map &map) map(0x000, 0x003).lrw32( NAME([this] (offs_t offset) { // NOTE: wants to read-back here, throws "Bus Master ASIC error" otherwise (?) - LOG("Video Front End Horizontal Configuration R\n"); + LOGVFE("Video Front End: Horizontal Configuration R\n"); return m_vfe.horizontal_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_vfe.horizontal_config); - LOG("Video Front End Horizontal Configuration W %08x & %08x\n", data, mem_mask); + LOGVFE("Video Front End: Horizontal Configuration W %08x & %08x\n", data, mem_mask); m_vfe.hspol = BIT(m_vfe.horizontal_config, 30); m_vfe.hstart = (m_vfe.horizontal_config >> 10) & 0x3ff; m_vfe.hend = (m_vfe.horizontal_config >> 0) & 0x3ff; - LOG("\tVSPOL %d VSTART %d VEND %d\n", m_vfe.hspol, m_vfe.hstart, m_vfe.hend); + LOGVFE("\tHSPol %d, HStart %d, HEnd %d\n", m_vfe.hspol, m_vfe.hstart, m_vfe.hend); }) ); map(0x004, 0x007).lrw32( NAME([this] (offs_t offset) { - LOG("Video Front End Vertical Configuration R\n"); + LOGVFE("Video Front End: Vertical Configuration R\n"); return m_vfe.vertical_config; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { COMBINE_DATA(&m_vfe.vertical_config); - LOG("Video Front End Vertical Configuration %08x & %08\n", data, mem_mask); + LOGVFE("Video Front End: Vertical Configuration W %08x & %08x\n", data, mem_mask); m_vfe.vspol = BIT(m_vfe.vertical_config, 30); m_vfe.vstart = (m_vfe.vertical_config >> 10) & 0x3ff; m_vfe.vend = (m_vfe.vertical_config >> 0) & 0x3ff; - LOG("\tVSPOL %d VSTART %d VEND %d\n", m_vfe.vspol, m_vfe.vstart, m_vfe.vend); + LOGVFE("\tVSPol %d, VStart %d, VEnd %d\n", m_vfe.vspol, m_vfe.vstart, m_vfe.vend); + }) + ); + map(0x008, 0x00b).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Front End: Format Configuration R\n"); + return m_vfe.format_config; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.format_config); + LOGVFE("Video Front End: Format Configuration W %08x & %08x\n", data, mem_mask); + m_vfe.ext_fi = BIT(m_vfe.format_config, 26); + m_vfe.top_field = BIT(m_vfe.format_config, 25); + m_vfe.vclk_pol = BIT(m_vfe.format_config, 24); + LOGVFE("\tExtFI %d, TopField %d, VCLKPol %d\n" + , m_vfe.ext_fi, m_vfe.top_field, m_vfe.vclk_pol + ); + // Video Scaler + m_vfe.hfilter = (m_vfe.format_config >> 21) & 7; + m_vfe.dup_fld = BIT(m_vfe.format_config, 20); + m_vfe.hor_dcm = (m_vfe.format_config >> 14) & 0x3f; + m_vfe.ver_dcm = (m_vfe.format_config >> 8) & 0x3f; + LOGVFE("\tHFilter %d, DupFld %d, HorDcm %d, VerDcm %d\n" + , m_vfe.hfilter + , m_vfe.dup_fld + , m_vfe.hor_dcm + , m_vfe.ver_dcm + ); + // Pixel Formatter + m_vfe.disp_mod = BIT(m_vfe.format_config, 6); + m_vfe.yuv2rgb = (m_vfe.format_config >> 3) & 3; + m_vfe.err_dif = BIT(m_vfe.format_config, 2); + m_vfe.pack24 = BIT(m_vfe.format_config, 1); + m_vfe.little_endian = BIT(m_vfe.format_config, 0); + LOGVFE("\tDispMod %d, YUV2RGB %d, ErrDif %d, Pack24 %d, LittleEndian %d\n" + , m_vfe.disp_mod + , m_vfe.yuv2rgb + , m_vfe.err_dif + , m_vfe.pack24 + , m_vfe.little_endian + ); + }) + ); + map(0x00c, 0x00f).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Display Top R\n"); + return m_vfe.vid_top_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.vid_top_base); + m_vfe.vid_top_base &= 0xffff'fffc; + LOGVFE("Video Display Top W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x010, 0x013).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Display Top R\n"); + return m_vfe.vid_bottom_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.vid_bottom_base); + m_vfe.vid_bottom_base &= 0xffff'fffc; + LOGVFE("Video Display Bottom W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x014, 0x017).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Video Stride, Status and Frame Grab R\n"); + return (m_vfe.disp_stride << 16) | (m_vfe.vid_ovf << 8) | (m_vfe.snapshot << 1) | (m_vfe.frame_grab << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGVFE("Video Stride, Status and Frame Grab W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + COMBINE_DATA(&m_vfe.disp_stride); + m_vfe.disp_stride &= 0xfffc; + LOGVFE("\tDispStride %d\n", m_vfe.disp_stride); + } + + if (ACCESSING_BITS_8_15) + { + // bit 8 high clears the overflow flag + if (BIT(data, 8)) + { + m_vfe.vid_ovf = false; + LOGVFE("\tVidOvf clear\n"); + } + } + + if (ACCESSING_BITS_0_7) + { + m_vfe.snapshot = !!(BIT(data, 1)); + m_vfe.frame_grab = !!(BIT(data, 0)); + LOGVFE("\tSnapShot %d, FrameGrab %d\n", m_vfe.snapshot, m_vfe.frame_grab); + // Presumably this will stall the emulation (goes off after two fields) + if (m_vfe.frame_grab) + popmessage("zr36057: FrameGrab enabled"); + } + }) + ); + map(0x018, 0x01b).lrw32( + NAME([this] (offs_t offset) { + LOG("Video Display Configuration R\n"); + return m_vfe.display_config; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.display_config); + LOGVFE("Video Display Configuration W %08x & %08x\n", data, mem_mask); + m_vfe.vid_en = !!BIT(m_vfe.display_config, 31); + // Not a mistake: min_pix overlaps with the /Triton setting + m_vfe.min_pix = (m_vfe.display_config >> 24) & 0x7f; + m_vfe.triton = !!BIT(~m_vfe.display_config, 24); + LOGVFE("\tVidEn %d, MinPix %d, Triton %s Controller" + , m_vfe.vid_en + , m_vfe.min_pix + , m_vfe.triton ? "Intel 'Triton' Bridge" : "Other PCI Bridge" + ); + m_vfe.window_height = (m_vfe.display_config >> 12) & 0x3ff; + m_vfe.window_width = (m_vfe.display_config >> 0) & 0x3ff; + LOGVFE("\tVidWinHt %d, VidWinWid %d\n", m_vfe.window_height, m_vfe.window_width); + }) + ); + map(0x01c, 0x01f).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Masking Map Top R\n"); + return m_vfe.mask_top_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.mask_top_base); + m_vfe.mask_top_base &= 0xffff'fffc; + LOGVFE("Masking Map Top W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x020, 0x023).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Masking Map Bottom R\n"); + return m_vfe.mask_bottom_base; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + COMBINE_DATA(&m_vfe.mask_bottom_base); + m_vfe.mask_bottom_base &= 0xffff'fffc; + LOGVFE("Masking Map Bottom W %08x & %08x\n", data, mem_mask); + }) + ); + map(0x024, 0x027).lrw32( + NAME([this] (offs_t offset) { + LOGVFE("Overlay Control R\n"); + return (m_vfe.ovl_enable << 15) | (m_vfe.mask_stride << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGVFE("Overlay Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_8_15) + { + m_vfe.ovl_enable = !!(BIT(data, 15)); + LOGVFE("\tOvlEnable %d\n", m_vfe.ovl_enable); + } + + if (ACCESSING_BITS_0_7) + { + m_vfe.mask_stride = data & 0xff; + LOGVFE("\tMaskStride %d\n", m_vfe.mask_stride); + } }) ); -// map(0x008, 0x00b) VFE Config, Video Scaler and Pixel Format -// map(0x00c, 0x00f) Video Display Top -// map(0x010, 0x013) Video Display Bottom -// map(0x014, 0x017) Video Display Stride, Status and Frame Grab -// map(0x018, 0x01b) Video Display Configuration -// map(0x01c, 0x01f) Masking Map Top -// map(0x020, 0x023) Masking Map Bottom -// map(0x024, 0x027) Overlay Control map(0x028, 0x02b).lrw32( NAME([this] (offs_t offset) { return (m_softreset << 24) | (m_pci_waitstate_control << 16) | m_gpio_ddr; @@ -246,17 +444,48 @@ void zr36057_device::asr_map(address_map &map) // map(0x030, 0x033) MPEG Code Source Address // map(0x034, 0x037) MPEG Code Transfer Control // map(0x038, 0x03b) MPEG Code Memory Pointer -// map(0x03c, 0x03f) Interrupt Status -// map(0x040, 0x043) Interrupt Control + map(0x03c, 0x03f).lrw32( + NAME([this] (offs_t offset) { + return m_irq_status; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + if (ACCESSING_BITS_24_31) + { + m_irq_status &= ~data; + m_irq_status &= 0x7800'0000; + } + }) + ); + map(0x040, 0x043).lrw32( + NAME([this] (offs_t offset) { + return m_irq_enable | (m_inta_pin_enable << 24); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + if (ACCESSING_BITS_24_31) + { + LOG("IRQ Enable W %08x & %08x\n", data, mem_mask); + m_irq_enable = data; + m_irq_enable &= 0x7800'0000; + m_inta_pin_enable = BIT(data, 24); + LOG("\tINTA enable %d\n", m_inta_pin_enable); + LOG("\tGIRQ1 %d GIRQ0 %d CodRepIRQ %d JPEGRepIRQ\n" + , BIT(data, 30) + , BIT(data, 29) + , BIT(data, 28) + , BIT(data, 27) + ); + } + }) + ); map(0x044, 0x047).lrw32( NAME([this] (offs_t offset) { - LOG("I2C R\n"); + //LOG("I2C R\n"); // avoid win98 stall for now return m_decoder_sdao_state << 1 | 1; //return 3; }), NAME([this] (offs_t offset, u32 data, u32 mem_mask) { - //printf("I2C %02x %08x\n", data, mem_mask); + //LOG("I2C %02x %08x\n", data, mem_mask); if (ACCESSING_BITS_0_7) { m_decoder->sda_write(BIT(data, 1)); @@ -266,11 +495,100 @@ void zr36057_device::asr_map(address_map &map) ); // map(0x100, 0x103) JPEG Mode and Control // map(0x104, 0x107) JPEG Process Control -// map(0x108, 0x10b) Vertical Sync Parameters (as sync master) -// map(0x10c, 0x10f) Horizontal Sync Parameters (as sync master) -// map(0x110, 0x113) Field Horizontal Active Portion -// map(0x114, 0x117) Field Vertical Active Portion -// map(0x118, 0x11b) Field Process Parameters + map(0x108, 0x10b).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Vertical Sync Parameters R\n"); + return (m_sync_gen.vsync_size << 16) | (m_sync_gen.vtotal); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Vertical Sync Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_23) + { + m_sync_gen.vsync_size = (data >> 16) & 0xff; + LOGSYNC("\tVsyncSize %d\n", m_sync_gen.vsync_size); + } + + if (ACCESSING_BITS_0_15) + { + m_sync_gen.vtotal = data & 0xffff; + LOGSYNC("\tFrmTot %d\n", m_sync_gen.vtotal); + } + }) + ); + map(0x10c, 0x10f).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Horizontal Sync Parameters R\n"); + return (m_sync_gen.hsync_start << 16) | (m_sync_gen.htotal); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Horizontal Sync Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_sync_gen.hsync_start = (data >> 16) & 0xffff; + LOGSYNC("\tHsyncStart %d\n", m_sync_gen.hsync_start); + } + + if (ACCESSING_BITS_0_15) + { + m_sync_gen.htotal = data & 0xffff; + LOGSYNC("\tLineTot %d\n", m_sync_gen.htotal); + } + }) + ); + map(0x110, 0x113).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Horizontal Active Portion R\n"); + return (m_active_area.nax << 16) | (m_active_area.pax); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Horizontal Active Portion W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_active_area.nax = (data >> 16) & 0xffff; + LOGSYNC("\tNAX %d\n", m_active_area.nax); + } + + if (ACCESSING_BITS_0_15) + { + m_active_area.pax = data & 0xffff; + LOGSYNC("\tPAX %d\n", m_active_area.pax); + } + }) + ); + map(0x114, 0x117).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Vertical Active Portion R\n"); + return (m_active_area.nay << 16) | (m_active_area.pay); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Vertical Active Portion W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_16_31) + { + m_active_area.nay = (data >> 16) & 0xffff; + LOGSYNC("\tNAY %d\n", m_active_area.nay); + } + + if (ACCESSING_BITS_0_15) + { + m_active_area.pay = data & 0xffff; + LOGSYNC("\tPAY %d\n", m_active_area.pay); + } + }) + ); + map(0x118, 0x11b).lrw32( + NAME([this] (offs_t offset) { + LOGSYNC("Field Process Parameters R\n"); + return m_active_area.odd; + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOGSYNC("Field Process Parameters W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_0_7) + { + m_active_area.odd = !!BIT(data, 0); + LOGSYNC("\tOdd_Even: %s\n", m_active_area.odd ? "Odd" : "Even"); + } + }) + ); // map(0x11c, 0x11f) JPEG Code Base Address // map(0x120, 0x123) JPEG Code FIFO Threshold map(0x124, 0x124).lrw8( diff --git a/src/devices/bus/pci/zr36057.h b/src/devices/bus/pci/zr36057.h index 71ced398967b8..5c28730981aa2 100644 --- a/src/devices/bus/pci/zr36057.h +++ b/src/devices/bus/pci/zr36057.h @@ -41,8 +41,33 @@ class zr36057_device : public pci_card_device struct { u32 horizontal_config; u32 vertical_config; + u32 format_config; int hspol, vspol; u16 hstart, hend, vstart, vend; + + int ext_fi, top_field, vclk_pol; + u8 hfilter; + int dup_fld; + u8 hor_dcm, ver_dcm; + int disp_mod; + u8 yuv2rgb; + int err_dif, pack24, little_endian; + + u32 vid_top_base, vid_bottom_base; + + u16 disp_stride; + bool vid_ovf; + bool snapshot, frame_grab; + + u32 display_config; + bool vid_en; + u8 min_pix; + bool triton; + u16 window_height, window_width; + + u32 mask_top_base, mask_bottom_base; + bool ovl_enable; + u8 mask_stride; } m_vfe; u8 m_jpeg_guest_id, m_jpeg_guest_reg; @@ -50,6 +75,20 @@ class zr36057_device : public pci_card_device bool m_softreset; u8 m_gpio_ddr, m_pci_waitstate_control; + u32 m_irq_status, m_irq_enable; + bool m_inta_pin_enable; + + struct { + u8 vsync_size; + u16 hsync_start; + u16 vtotal, htotal; + } m_sync_gen; + + struct { + u16 nax, pax, nay, pay; + bool odd; + } m_active_area; + struct { u8 time[8]; } m_guestbus; diff --git a/src/devices/video/zr36060.cpp b/src/devices/video/zr36060.cpp index 8e40618273764..ff5adc52d8a4e 100644 --- a/src/devices/video/zr36060.cpp +++ b/src/devices/video/zr36060.cpp @@ -55,7 +55,6 @@ void zr36060_device::regs_map(address_map &map) map(0x00d, 0x010).rw(FUNC(zr36060_device::tcv_data_r), FUNC(zr36060_device::tcv_data_w)); map(0x011, 0x012).rw(FUNC(zr36060_device::sf_r), FUNC(zr36060_device::sf_w)); map(0x013, 0x015).rw(FUNC(zr36060_device::af_r), FUNC(zr36060_device::af_w)); - map(0x016, 0x019).rw(FUNC(zr36060_device::acv_r), FUNC(zr36060_device::acv_w)); map(0x01a, 0x01d).rw(FUNC(zr36060_device::act_r), FUNC(zr36060_device::act_w)); map(0x01e, 0x021).rw(FUNC(zr36060_device::acv_trun_r), FUNC(zr36060_device::acv_trun_w)); diff --git a/src/mame/capcom/cps1_v.cpp b/src/mame/capcom/cps1_v.cpp index 2f7f1a55e838c..d9be8c40d338f 100644 --- a/src/mame/capcom/cps1_v.cpp +++ b/src/mame/capcom/cps1_v.cpp @@ -411,7 +411,7 @@ maps for every game. Known Bug List ============== CPS2: -* CPS2 can do raster effects, certainly used by ssf2 (Cammy, DeeJay, T.Hawk levels), +* CPS2 can do raster effects, certainly used by ssf2 (Cammy, DeeJay, T.Hawk stages), msh (Blackheart lava stage) and maybe others (xmcotaj, vsavj). IRQ4 is some sort of scanline interrupt used for that purpose. From c2155411874230f424f3636e477a9cfeeebb23cb Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 24 Feb 2025 22:45:42 +0100 Subject: [PATCH 021/272] screen: fix possible race condition at reset_origin if vblank start == vblank end --- src/emu/screen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/emu/screen.cpp b/src/emu/screen.cpp index 8082b7ddad225..6720d3e85e86e 100644 --- a/src/emu/screen.cpp +++ b/src/emu/screen.cpp @@ -1042,19 +1042,19 @@ void screen_device::reset_origin(int beamy, int beamx) m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime); m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period); - // if we are resetting relative to (0,0) == VBLANK end, call the - // scanline 0 timer by hand now; otherwise, adjust it for the future - if (beamy == 0 && beamx == 0) - reset_partial_updates(); - else - m_scanline0_timer->adjust(time_until_pos(0)); - // if we are resetting relative to (visarea.bottom() + 1, 0) == VBLANK start, // call the VBLANK start timer now; otherwise, adjust it for the future if (beamy == ((m_visarea.bottom() + 1) % m_height) && beamx == 0) vblank_begin(0); else m_vblank_begin_timer->adjust(time_until_vblank_start()); + + // if we are resetting relative to (0,0) == VBLANK end, call the + // scanline 0 timer by hand now; otherwise, adjust it for the future + if (beamy == 0 && beamx == 0) + reset_partial_updates(); + else + m_scanline0_timer->adjust(time_until_pos(0)); } From e7ba53a4614416620962d8d7fc948d1ac7fc2967 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Feb 2025 01:09:29 +0100 Subject: [PATCH 022/272] leland: add debugger side effect check when reading vram, no need for m_last_scanline variable --- src/mame/cinematronics/leland.cpp | 2 +- src/mame/cinematronics/leland.h | 3 +-- src/mame/cinematronics/leland_a.cpp | 2 +- src/mame/cinematronics/leland_a.h | 4 +++- src/mame/cinematronics/leland_m.cpp | 18 +++++++++--------- src/mame/cinematronics/leland_v.cpp | 29 ++++++++++++++++------------- 6 files changed, 31 insertions(+), 27 deletions(-) diff --git a/src/mame/cinematronics/leland.cpp b/src/mame/cinematronics/leland.cpp index f0cacf938407b..9dcc1b8e6e042 100644 --- a/src/mame/cinematronics/leland.cpp +++ b/src/mame/cinematronics/leland.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles,Paul Leaman /*************************************************************************** - Cinematronics/Leland driver + Cinematronics / Leland Cinemat System driver driver by Aaron Giles and Paul Leaman Games supported: diff --git a/src/mame/cinematronics/leland.h b/src/mame/cinematronics/leland.h index 7ac22c79d1c8d..5a65a19f453bf 100644 --- a/src/mame/cinematronics/leland.h +++ b/src/mame/cinematronics/leland.h @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /************************************************************************* - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver *************************************************************************/ #ifndef MAME_CINEMATRONICS_LELAND_H @@ -164,7 +164,6 @@ class leland_state : public driver_device u8 m_sound_port_bank = 0U; u8 m_alternate_bank = 0U; u8 m_gfxbank = 0U; - u16 m_last_scanline = 0U; emu_timer *m_scanline_timer = nullptr; u8 cerberus_dial_1_r(); diff --git a/src/mame/cinematronics/leland_a.cpp b/src/mame/cinematronics/leland_a.cpp index 3fcbfab7302fc..e574747934eaf 100644 --- a/src/mame/cinematronics/leland_a.cpp +++ b/src/mame/cinematronics/leland_a.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles,Paul Leaman /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver Leland sound hardware driver by Aaron Giles and Paul Leaman diff --git a/src/mame/cinematronics/leland_a.h b/src/mame/cinematronics/leland_a.h index a1653536b0f20..86387886a72a0 100644 --- a/src/mame/cinematronics/leland_a.h +++ b/src/mame/cinematronics/leland_a.h @@ -2,7 +2,9 @@ // copyright-holders:Aaron Giles /************************************************************************* - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver + + Leland sound hardware *************************************************************************/ #ifndef MAME_CINEMATRONICS_LELAND_A_H diff --git a/src/mame/cinematronics/leland_m.cpp b/src/mame/cinematronics/leland_m.cpp index 89a130312906c..bd64cd6814f3c 100644 --- a/src/mame/cinematronics/leland_m.cpp +++ b/src/mame/cinematronics/leland_m.cpp @@ -2,9 +2,9 @@ // copyright-holders:Aaron Giles, Paul Leaman /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver - driver by Aaron Giles and Paul Leaman + Leland machine hardware ***************************************************************************/ @@ -413,7 +413,7 @@ void ataxx_state::machine_reset() TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) { - int scanline = param; + u8 scanline = param; /* interrupts generated on the VA10 line, which is every */ /* 16 scanlines starting with scanline #8 */ @@ -421,15 +421,13 @@ TIMER_CALLBACK_MEMBER(leland_state::leland_interrupt_callback) /* set a timer for the next one */ scanline += 16; - if (scanline > 248) - scanline = 8; m_master_int_timer->adjust(m_screen->time_until_pos(scanline), scanline); } TIMER_CALLBACK_MEMBER(leland_state::ataxx_interrupt_callback) { - int scanline = param; + u8 scanline = param; /* interrupts generated according to the interrupt control register */ m_master->set_input_line(0, HOLD_LINE); @@ -1206,8 +1204,11 @@ void ataxx_state::ataxx_master_output_w(offs_t offset, u8 data) break; case 0x08: /* */ - m_master_int_timer->adjust(m_screen->time_until_pos(data + 1), data + 1); + { + u8 scanline = data + 1; + m_master_int_timer->adjust(m_screen->time_until_pos(scanline), scanline); break; + } default: LOGMASKED(LOG_WARN, "Master I/O write offset %02X=%02X\n", offset, data); @@ -1408,9 +1409,8 @@ void leland_state::rotate_memory(const char *cpuname) int banks = (memregion(cpuname)->bytes() - startaddr) / 0x8000; u8 *ram = memregion(cpuname)->base(); u8 temp[0x2000]; - int i; - for (i = 0; i < banks; i++) + for (int i = 0; i < banks; i++) { memmove(temp, &ram[startaddr + 0x0000], 0x2000); memmove(&ram[startaddr + 0x0000], &ram[startaddr + 0x2000], 0x6000); diff --git a/src/mame/cinematronics/leland_v.cpp b/src/mame/cinematronics/leland_v.cpp index 13318af892d2b..f25870e864be1 100644 --- a/src/mame/cinematronics/leland_v.cpp +++ b/src/mame/cinematronics/leland_v.cpp @@ -2,7 +2,7 @@ // copyright-holders:Aaron Giles /*************************************************************************** - Cinemat/Leland driver + Cinematronics / Leland Cinemat System driver Leland video hardware @@ -33,18 +33,17 @@ static constexpr int QRAM_SIZE = 0x10000; TIMER_CALLBACK_MEMBER(leland_state::scanline_callback) { - int scanline = param; + u8 scanline = param; + u8 last_scanline = scanline - 1; /* update the DACs */ if (!(m_dac_control & 0x01)) - m_dac[0]->write(m_video_ram[(m_last_scanline) * 256 + 160]); + m_dac[0]->write(m_video_ram[last_scanline << 8 | 0xa0]); if (!(m_dac_control & 0x02)) - m_dac[1]->write(m_video_ram[(m_last_scanline) * 256 + 161]); + m_dac[1]->write(m_video_ram[last_scanline << 8 | 0xa1]); - m_last_scanline = scanline; - - scanline = (scanline+1) % 256; + scanline++; /* come back at the next appropriate scanline */ m_scanline_timer->adjust(m_screen->time_until_pos(scanline), scanline); @@ -114,7 +113,6 @@ void leland_state::video_start() save_item(NAME(m_xscroll)); save_item(NAME(m_yscroll)); save_item(NAME(m_gfxbank)); - save_item(NAME(m_last_scanline)); for (u8 i = 0; i < 2; i++) { save_item(NAME(m_vram_state[i].m_addr), i); @@ -242,15 +240,20 @@ int leland_state::vram_port_r(offs_t offset, int num) break; default: - LOGMASKED(LOG_WARN, "%s: Warning: Unknown video port %02x read (address=%04x)\n", - machine().describe_context(), offset, addr); + if (!machine().side_effects_disabled()) + LOGMASKED(LOG_WARN, "%s: Warning: Unknown video port %02x read (address=%04x)\n", + machine().describe_context(), offset, addr); ret = 0; break; } - state->m_addr = addr; - if (addr >= 0xf000) - LOGMASKED(LOG_COMM, "%s:%s comm read %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, ret); + if (!machine().side_effects_disabled()) + { + state->m_addr = addr; + + if (addr >= 0xf000) + LOGMASKED(LOG_COMM, "%s:%s comm read %04X = %02X\n", machine().describe_context(), num ? "slave" : "master", addr, ret); + } return ret; } From 857c566cb3a12b24c74e28e6efe6d9a84e740ddc Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Feb 2025 11:30:16 +0100 Subject: [PATCH 023/272] kinst: add eprom waitstates --- src/mame/rare/kinst.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/mame/rare/kinst.cpp b/src/mame/rare/kinst.cpp index 488a231448271..fae98c701261d 100644 --- a/src/mame/rare/kinst.cpp +++ b/src/mame/rare/kinst.cpp @@ -18,9 +18,8 @@ of the "Ultra 64" arcade games. - The SRAM test fails in diagnostics; this is due to the fact that the test relies on executing out of the cache while it tromps over (and eventually restores) the instructions it is executing; this will likely never be fixed. -- Bootup sequence (the blue color fill) is too fast, which in turn causes - attract mode music not to play. Maybe the main CPU is running at a lower - clockspeed at boot (50MHz/4 seems plausible), but then, what toggles it? +- Verify waitstates on memory access, currently it's only added for EPROMs + during the blue screen boot up sequence. **************************************************************************** @@ -244,6 +243,7 @@ class kinst_state : public driver_device uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t ide_extra_r(); void ide_extra_w(uint32_t data); + uint32_t rom_r(offs_t offset); void vram_control_w(offs_t offset, uint32_t data, uint32_t mem_mask); void sound_reset_w(offs_t offset, uint32_t data, uint32_t mem_mask); @@ -300,7 +300,6 @@ void kinst_state::machine_start() // configure fast RAM regions m_maincpu->add_fastram(0x08000000, 0x087fffff, false, m_rambase2); m_maincpu->add_fastram(0x00000000, 0x0007ffff, false, m_rambase); - m_maincpu->add_fastram(0x1fc00000, 0x1fc7ffff, true, m_rombase); // register for savestates save_item(NAME(m_vram_control)); @@ -502,6 +501,16 @@ void kinst_state::coin_control_w(offs_t offset, uint32_t data, uint32_t mem_mask } +uint32_t kinst_state::rom_r(offs_t offset) +{ + // add RdRdy clocks on EPROM access + // bootup sequence takes approx. 6 seconds, and it's not a CPU clock divider + m_maincpu->adjust_icount(-128); + + return m_rombase[offset]; +} + + /************************************* * @@ -524,7 +533,7 @@ void kinst_state::kinst_map(address_map &map) map(0x10000100, 0x1000013f).rw(FUNC(kinst_state::ide_r), FUNC(kinst_state::ide_w)); map(0x10000170, 0x10000173).rw(FUNC(kinst_state::ide_extra_r), FUNC(kinst_state::ide_extra_w)); - map(0x1fc00000, 0x1fc7ffff).rom().region("user1", 0); + map(0x1fc00000, 0x1fc7ffff).r(FUNC(kinst_state::rom_r)); } From 02994e479290bf24db39b5750be82b74504f3601 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 26 Feb 2025 01:37:11 +1100 Subject: [PATCH 024/272] Tidied up some minor things. --- src/mame/alesis/midiverb.cpp | 9 +++++---- src/mame/ibm/ibm3477.cpp | 4 ++-- src/mame/misc/ddz.cpp | 6 +++--- src/mame/paia/fatman.cpp | 4 +++- src/mame/paia/midi2cv8.cpp | 3 +-- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/mame/alesis/midiverb.cpp b/src/mame/alesis/midiverb.cpp index 9efb96887d1cf..00bf021c65177 100644 --- a/src/mame/alesis/midiverb.cpp +++ b/src/mame/alesis/midiverb.cpp @@ -141,10 +141,11 @@ void midiverb_dsp_device::device_start() save_item(NAME(m_ram)); } -#define LOG_DSP(...) do { \ - if (sample_i < DEBUG_SAMPLES) \ - LOGMASKED(LOG_DSP_EXECUTION, __VA_ARGS__); \ -} while(0) +#define LOG_DSP(...) \ + do { \ + if (sample_i < DEBUG_SAMPLES) \ + LOGMASKED(LOG_DSP_EXECUTION, __VA_ARGS__); \ + } while(0) void midiverb_dsp_device::sound_stream_update(sound_stream &stream, const std::vector &inputs, std::vector &outputs) { diff --git a/src/mame/ibm/ibm3477.cpp b/src/mame/ibm/ibm3477.cpp index f6b50ae0998f5..990df0cf4f5ce 100644 --- a/src/mame/ibm/ibm3477.cpp +++ b/src/mame/ibm/ibm3477.cpp @@ -49,7 +49,7 @@ class ibm3477_state : public driver_device ibm3477_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") - { } + { } void ibm3477(machine_config &config); @@ -109,5 +109,5 @@ ROM_END } // anonymous namespace -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS COMP( 1998, ibm3477, 0, 0, ibm3477, ibm3477, ibm3477_state, empty_init, "IBM", "InfoWindow 3477", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // Spanish ROMs? diff --git a/src/mame/misc/ddz.cpp b/src/mame/misc/ddz.cpp index 2af520209a701..bd3d25d093739 100644 --- a/src/mame/misc/ddz.cpp +++ b/src/mame/misc/ddz.cpp @@ -15,7 +15,7 @@ Haze's notes: -fwiw, it's probably same PCB as the non-working 'ddz' in MAME, but different game. +FWIW, it's probably same PCB as the non-working 'ddz' in MAME, but different game. there's some kind of encryption/scrambling going on, at the very least @@ -38,7 +38,7 @@ if you reverse the letters you get 'bug in vfprintf : bad base' so I suspect the data is in reverse order and maybe some blocks scrambled about. -trivia: TJF is an acronym for Tai Ji Feng +trivia: TJF stands for Tai Ji Feng ****************************************************************************/ #include "emu.h" @@ -227,7 +227,7 @@ void ddz_state::init_ddz() } // anonymous namespace -GAME( 200?, ddz, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "IGS?", "Dou Di Zhu", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, ddz, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "IGS?", "Dou Dizhu", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 200?, crzclass, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Zhaoji Fengdou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // 'Crazy Class' GAME( 200?, baibians, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Baibian Shuangkou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 200?, cjmx, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Chaoji Mingxing", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/paia/fatman.cpp b/src/mame/paia/fatman.cpp index c76ea2edbdf7a..91adaa1ef7846 100644 --- a/src/mame/paia/fatman.cpp +++ b/src/mame/paia/fatman.cpp @@ -51,13 +51,15 @@ until a restart or reset (F3). */ #include "emu.h" -#include "attotime.h" + #include "cpu/mcs51/mcs51.h" #include "bus/midi/midiinport.h" #include "bus/midi/midioutport.h" #include "machine/rescap.h" #include "video/pwm.h" +#include "attotime.h" + #include "paia_fatman.lh" #define LOG_EG (1U << 1) diff --git a/src/mame/paia/midi2cv8.cpp b/src/mame/paia/midi2cv8.cpp index 28d459ae698d6..4c049cab9e4fd 100644 --- a/src/mame/paia/midi2cv8.cpp +++ b/src/mame/paia/midi2cv8.cpp @@ -6,7 +6,7 @@ The PAiA midi2cv8 is an 8-channel MIDI-to-CV converter. It is a module for the PAiA 9700 Series modular system, but can be used as a standalone MIDI-to-CV converter. -Dipswitches control the MIDI channel to listen to, and the operating mode. +DIP switches control the MIDI channel to listen to, and the operating mode. Depending on that mode, each of the 8 outputs produces control voltage (CV), trigger, or gate signals in response to MIDI messages. @@ -393,4 +393,3 @@ ROM_END SYST(1997, midi2cv8, 0, 0, midi2cv8, midi2cv8, midi2cv8_state, empty_init, "PAiA Electronics", "midi2cv8", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE) SYST(1997, midi2cv8_vhz, 0, 0, midi2cv8_vhz, midi2cv8, midi2cv8_vhz_state, empty_init, "PAiA Electronics", "midi2cv8 V/Hz", MACHINE_NO_SOUND_HW | MACHINE_SUPPORTS_SAVE) - From 981f059c12b2a6c11e772d7213e174780ac10c59 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 25 Feb 2025 16:31:56 +0100 Subject: [PATCH 025/272] skyarmy: tweak clocks based on pcb video --- src/mame/misc/skyarmy.cpp | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/mame/misc/skyarmy.cpp b/src/mame/misc/skyarmy.cpp index 1be842bb29e80..823405d5e8614 100644 --- a/src/mame/misc/skyarmy.cpp +++ b/src/mame/misc/skyarmy.cpp @@ -25,9 +25,12 @@ */ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/74259.h" +#include "machine/timer.h" #include "sound/ay8910.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -80,7 +83,7 @@ class skyarmy_state : public driver_device uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - INTERRUPT_GEN_MEMBER(nmi_source); + TIMER_DEVICE_CALLBACK_MEMBER(scanline); void skyarmy_io_map(address_map &map) ATTR_COLD; void skyarmy_map(address_map &map) ATTR_COLD; }; @@ -180,10 +183,17 @@ uint32_t skyarmy_state::screen_update(screen_device &screen, bitmap_ind16 &bitma return 0; } -INTERRUPT_GEN_MEMBER(skyarmy_state::nmi_source) +TIMER_DEVICE_CALLBACK_MEMBER(skyarmy_state::scanline) { - if (m_nmi) + int scanline = param; + + // 16 NMIs per frame + if ((scanline & 0xf) == 0 && scanline <= 240 && m_nmi) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + + // vblank interrupt + if (scanline == 248) + m_maincpu->set_input_line(0, HOLD_LINE); } @@ -313,11 +323,11 @@ GFXDECODE_END void skyarmy_state::skyarmy(machine_config &config) { - Z80(config, m_maincpu, 4000000); + Z80(config, m_maincpu, 18.432_MHz_XTAL / 6); m_maincpu->set_addrmap(AS_PROGRAM, &skyarmy_state::skyarmy_map); m_maincpu->set_addrmap(AS_IO, &skyarmy_state::skyarmy_io_map); - m_maincpu->set_vblank_int("screen", FUNC(skyarmy_state::irq0_line_hold)); - m_maincpu->set_periodic_int(FUNC(skyarmy_state::nmi_source), attotime::from_hz(650)); + + TIMER(config, "scanline").configure_scanline(FUNC(skyarmy_state::scanline), "screen", 0, 1); ls259_device &latch(LS259(config, "latch")); // 11C latch.q_out_cb<0>().set(FUNC(skyarmy_state::coin_counter_w)); @@ -328,10 +338,7 @@ void skyarmy_state::skyarmy(machine_config &config) /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size(32*8,32*8); - screen.set_visarea(0*8,32*8-1,1*8,31*8-1); + screen.set_raw(18.432_MHz_XTAL / 3, 384, 0, 256, 264, 8, 248); screen.set_screen_update(FUNC(skyarmy_state::screen_update)); screen.set_palette(m_palette); @@ -340,8 +347,8 @@ void skyarmy_state::skyarmy(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - AY8910(config, "ay0", 2500000).add_route(ALL_OUTPUTS, "mono", 0.15); - AY8910(config, "ay1", 2500000).add_route(ALL_OUTPUTS, "mono", 0.15); + AY8910(config, "ay0", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); + AY8910(config, "ay1", 18.432_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); } From e12b0a4b9151f6e31e33b07cc58f506f702d8ef9 Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 26 Feb 2025 09:36:59 +0100 Subject: [PATCH 026/272] pci/zr36057.cpp: hookup interrupt routing --- src/devices/bus/pci/zr36057.cpp | 104 +++++++++++++++++++++++++++++--- src/devices/bus/pci/zr36057.h | 20 ++++-- src/devices/video/saa7110.cpp | 30 ++++++++- src/devices/video/saa7110.h | 8 +++ 4 files changed, 147 insertions(+), 15 deletions(-) diff --git a/src/devices/bus/pci/zr36057.cpp b/src/devices/bus/pci/zr36057.cpp index 06e124ef42f7e..f8a0ac98f85c7 100644 --- a/src/devices/bus/pci/zr36057.cpp +++ b/src/devices/bus/pci/zr36057.cpp @@ -19,6 +19,7 @@ ZR36057 is known to have two HW quirks that are been fixed with ZR36067. - Hookup busmaster; - What are i2c 0x8e >> 1 address device checks for? \- Can't be adv7175 (0xd4 >> 1) nor adv7176 (0x54 >> 1) +- Noisy on undocumented guest ID 7 once VidCap capturing is enabled; ... - Soft Reset & Write lock mechanisms (each register have separate macro-groups); - GuestBus slot mechanism (relevant when multiple devices are hooked); @@ -85,6 +86,7 @@ void zr36057_device::device_add_mconfig(machine_config &config) SAA7110A(config, m_decoder, XTAL(26'800'000)); m_decoder->sda_callback().set([this](int state) { m_decoder_sdao_state = state; }); + //m_decoder->vs_callback().set(FUNC(zr36057_device::girq1_w)); //ADV7176(config, m_encoder, XTAL(27'000'000)); @@ -158,6 +160,17 @@ void zr36057_device::software_reset() m_vfe.ovl_enable = false; m_vfe.mask_stride = 0xff; + // TODO: these also go in process_reset fn + // defaults in MPEG mode + m_jpeg.mode = false; + m_jpeg.sub_mode = 3; + m_jpeg.rtbsy_fb = m_jpeg.go_en = m_jpeg.sync_mstr = m_jpeg.fld_per_buff = false; + m_jpeg.vfifo_fb = m_jpeg.cfifo_fb = false; + m_jpeg.still_lendian = true; + m_jpeg.p_reset = true; + m_jpeg.cod_trns_en = false; + m_jpeg.active = false; + m_sync_gen.vsync_size = 6; m_sync_gen.vtotal = 525; m_sync_gen.hsync_start = 640; @@ -169,6 +182,9 @@ void zr36057_device::software_reset() m_active_area.pay = 240; m_active_area.odd = true; + m_jpeg.guest_id = 4; + m_jpeg.guest_reg = 0; + m_irq_status = m_irq_enable = 0; m_inta_pin_enable = false; @@ -179,9 +195,6 @@ void zr36057_device::software_reset() for (int i = 0; i < 4; i++) m_guestbus.time[i] = 0; - m_jpeg_guest_id = 4; - m_jpeg_guest_reg = 0; - m_po.pending = false; m_po.time_out = false; m_po.dir = true; @@ -337,7 +350,7 @@ void zr36057_device::asr_map(address_map &map) // Not a mistake: min_pix overlaps with the /Triton setting m_vfe.min_pix = (m_vfe.display_config >> 24) & 0x7f; m_vfe.triton = !!BIT(~m_vfe.display_config, 24); - LOGVFE("\tVidEn %d, MinPix %d, Triton %s Controller" + LOGVFE("\tVidEn %d, MinPix %d, Triton %s Controller\n" , m_vfe.vid_en , m_vfe.min_pix , m_vfe.triton ? "Intel 'Triton' Bridge" : "Other PCI Bridge" @@ -453,6 +466,7 @@ void zr36057_device::asr_map(address_map &map) { m_irq_status &= ~data; m_irq_status &= 0x7800'0000; + update_irq_status(); } }) ); @@ -474,6 +488,7 @@ void zr36057_device::asr_map(address_map &map) , BIT(data, 28) , BIT(data, 27) ); + update_irq_status(); } }) ); @@ -493,8 +508,71 @@ void zr36057_device::asr_map(address_map &map) } }) ); -// map(0x100, 0x103) JPEG Mode and Control -// map(0x104, 0x107) JPEG Process Control + map(0x100, 0x103).lrw32( + NAME([this] (offs_t offset) { + LOG("JPEG Mode and Control R\n"); + return (m_jpeg.mode << 31) | (m_jpeg.sub_mode << 29) + | (m_jpeg.rtbsy_fb << 6) | (m_jpeg.go_en << 5) | (m_jpeg.sync_mstr << 4) + | (m_jpeg.fld_per_buff << 3) | (m_jpeg.vfifo_fb << 2) + | (m_jpeg.cfifo_fb << 1) | (m_jpeg.still_lendian << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOG("JPEG Mode and Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_24_31) + { + m_jpeg.mode = !!BIT(data, 31); + // --x- (0) Still Image (1) Motion Video + // ---x (0) Decompression (1) Compression + m_jpeg.sub_mode = (data >> 29) & 3; + LOG("\tJPG %s Mode, JPGMode %d\n" + , m_jpeg.mode ? "JPEG" : "MPEG" + , m_jpeg.sub_mode + ); + } + + if (ACCESSING_BITS_0_7) + { + m_jpeg.rtbsy_fb = !!BIT(data, 6); + m_jpeg.go_en = !!BIT(data, 5); + m_jpeg.sync_mstr = !!BIT(data, 4); + m_jpeg.fld_per_buff = !!BIT(data, 3); + m_jpeg.vfifo_fb = !!BIT(data, 2); + m_jpeg.cfifo_fb = !!BIT(data, 1); + m_jpeg.still_lendian = !!BIT(data, 0); + LOG("\tRTBSY_FB %d, Go_en %d, SyncMstr %d, Fld_per_buff %s, VFIFO_FB %d, CFIFO_FB %d, Still_LitEndian %s\n" + , m_jpeg.rtbsy_fb + , m_jpeg.go_en + , m_jpeg.sync_mstr + , m_jpeg.fld_per_buff ? "1 (One code field)" : "0 (Two code fields, one code frame)" + , m_jpeg.vfifo_fb + , m_jpeg.cfifo_fb + , m_jpeg.still_lendian ? "Little" : "Gib" + ); + if (m_jpeg.go_en) + popmessage("zr36057.cpp: go_en enabled"); + } + }) + ); + map(0x104, 0x107).lrw32( + NAME([this] (offs_t offset) { + LOG("JPEG Process Control R\n"); + return (m_jpeg.p_reset << 7) | (m_jpeg.cod_trns_en << 5) | (m_jpeg.active << 0); + }), + NAME([this] (offs_t offset, u32 data, u32 mem_mask) { + LOG("JPEG Process Control W %08x & %08x\n", data, mem_mask); + if (ACCESSING_BITS_0_7) + { + m_jpeg.p_reset = !!BIT(data, 7); + m_jpeg.cod_trns_en = !!BIT(data, 5); + m_jpeg.active = !!BIT(data, 0); + LOG("\tP_reset %d, CodTrnsEn %d, Active %d\n" + , m_jpeg.p_reset + , m_jpeg.cod_trns_en + , m_jpeg.active + ); + } + }) + ); map(0x108, 0x10b).lrw32( NAME([this] (offs_t offset) { LOGSYNC("Vertical Sync Parameters R\n"); @@ -594,11 +672,11 @@ void zr36057_device::asr_map(address_map &map) map(0x124, 0x124).lrw8( NAME([this] (offs_t offset) { LOG("JPEG Codec Guest ID R\n"); - return (m_jpeg_guest_id << 4) | (m_jpeg_guest_reg << 0); + return (m_jpeg.guest_id << 4) | (m_jpeg.guest_reg << 0); }), NAME([this] (offs_t offset, u8 data) { - m_jpeg_guest_id = (data >> 4) & 7; - m_jpeg_guest_reg = (data >> 0) & 7; + m_jpeg.guest_id = (data >> 4) & 7; + m_jpeg.guest_reg = (data >> 0) & 7; LOG("JPEG Codec Guest ID W %02x\n", data); }) ); @@ -691,3 +769,11 @@ void zr36057_device::postoffice_w(offs_t offset, u32 data, u32 mem_mask) LOGWARN("Warning: PO access unmapped POGuestID write %d %02x\n", m_po.guest_id, m_po.guest_reg); } } + +void zr36057_device::update_irq_status() +{ + if (m_inta_pin_enable) + { + irq_pin_w(0, m_irq_status & m_irq_enable); + } +} diff --git a/src/devices/bus/pci/zr36057.h b/src/devices/bus/pci/zr36057.h index 5c28730981aa2..727f5bcff5323 100644 --- a/src/devices/bus/pci/zr36057.h +++ b/src/devices/bus/pci/zr36057.h @@ -70,13 +70,27 @@ class zr36057_device : public pci_card_device u8 mask_stride; } m_vfe; - u8 m_jpeg_guest_id, m_jpeg_guest_reg; - bool m_softreset; u8 m_gpio_ddr, m_pci_waitstate_control; + // NOTE: these are technically external/public pins. + void girq1_w(int state) { m_irq_status |= 1 << 30; update_irq_status(); } + void girq0_w(int state) { m_irq_status |= 1 << 29; update_irq_status(); } + void cod_rep_irq_w(int state) { m_irq_status |= 1 << 28; update_irq_status(); } + void jpeg_rep_irq_w(int state) { m_irq_status |= 1 << 27; update_irq_status(); } + + void update_irq_status(); u32 m_irq_status, m_irq_enable; bool m_inta_pin_enable; + int m_decoder_sdao_state; + + struct { + u8 guest_id, guest_reg; + bool mode; + u8 sub_mode; + bool rtbsy_fb, go_en, sync_mstr, fld_per_buff, vfifo_fb, cfifo_fb, still_lendian; + bool p_reset, cod_trns_en, active; + } m_jpeg; struct { u8 vsync_size; @@ -100,8 +114,6 @@ class zr36057_device : public pci_card_device u8 guest_id; u8 guest_reg; } m_po; /**< PostOffice */ - - int m_decoder_sdao_state; }; DECLARE_DEVICE_TYPE(ZR36057_PCI, zr36057_device) diff --git a/src/devices/video/saa7110.cpp b/src/devices/video/saa7110.cpp index e4e0e9425ddf0..f2fa5fed0e7cf 100644 --- a/src/devices/video/saa7110.cpp +++ b/src/devices/video/saa7110.cpp @@ -30,12 +30,14 @@ saa7110a_device::saa7110a_device(const machine_config &mconfig, const char *tag, : device_t(mconfig, SAA7110A, tag, owner, clock) , i2c_hle_interface(mconfig, *this, 0x9c >> 1) , device_memory_interface(mconfig, *this) + //, m_out_vs_cb(*this) { m_space_config = address_space_config("regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(saa7110a_device::regs_map), this)); } void saa7110a_device::device_start() { + //m_href_timer = timer_alloc(FUNC(saa7110a_device::href_cb), this); save_item(NAME(m_secs)); save_item(NAME(m_sstb)); save_item(NAME(m_hrmv)); @@ -46,6 +48,8 @@ void saa7110a_device::device_start() void saa7110a_device::device_reset() { m_secs = m_sstb = m_hrmv = m_rtse = m_vtrc = false; + //m_current_href = 0; + //m_href_timer->adjust(attotime::from_hz(15734), 0, attotime::from_hz(15734)); } device_memory_interface::space_config_vector saa7110a_device::memory_space_config() const @@ -140,8 +144,14 @@ void saa7110a_device::regs_map(address_map &map) map(0x2b, 0x2b).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2B: Gain control analog #3 %02x\n", data); })); map(0x2c, 0x2c).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2C: Mixer control #2 %02x\n", data); })); map(0x2d, 0x2d).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2D: Integration value gain %02x\n", data); })); - map(0x2e, 0x2e).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2E: Vertical blanking pulse set %02x\n", data); })); - map(0x2f, 0x2f).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU2F: Vertical blanking pulse reset %02x\n", data); })); + map(0x2e, 0x2e).lw8(NAME([this] (offs_t offset, u8 data) { + m_vbps = data; + LOG("SU2E: Vertical blanking pulse set %02x\n", data); + })); + map(0x2f, 0x2f).lw8(NAME([this] (offs_t offset, u8 data) { + m_vbpr = data; + LOG("SU2F: Vertical blanking pulse reset %02x\n", data); + })); map(0x30, 0x30).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU30: ADCs gain control %02x\n", data); })); map(0x31, 0x31).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU31: Mixer control #3 %02x\n", data); })); map(0x32, 0x32).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU32: Integration value white peak %02x\n", data); })); @@ -149,3 +159,19 @@ void saa7110a_device::regs_map(address_map &map) map(0x34, 0x34).lw8(NAME([this] (offs_t offset, u8 data) { LOG("SU34: Gain update level %02x\n", data); })); } +//TIMER_CALLBACK_MEMBER(saa7110a_device::href_cb) +//{ +// if (m_vbpr == m_vbps) +// return; +// m_current_href ++; +// if (m_current_href == m_vbps * 2) +// { +// m_out_vs_cb(1); +// } +// if (m_current_href == m_vbpr * 2) +// { +// m_out_vs_cb(0); +// } +// m_current_href %= 262; +//} +// diff --git a/src/devices/video/saa7110.h b/src/devices/video/saa7110.h index a4c5b741c9b3a..fff482744b56e 100644 --- a/src/devices/video/saa7110.h +++ b/src/devices/video/saa7110.h @@ -16,6 +16,8 @@ class saa7110a_device : public: saa7110a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + //auto vs_callback() { return m_out_vs_cb.bind(); } + protected: // saa7110a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override ATTR_COLD; @@ -28,8 +30,14 @@ class saa7110a_device : virtual void write_data(u16 offset, u8 data) override; address_space_config m_space_config; +// devcb_write_line m_out_vs_cb; bool m_secs, m_sstb, m_hrmv, m_rtse, m_vtrc; + u8 m_vbps, m_vbpr; +// int m_current_href; + +// TIMER_CALLBACK_MEMBER(href_cb); +// emu_timer *m_href_timer; }; DECLARE_DEVICE_TYPE(SAA7110A, saa7110a_device) From bcf55c7f587e855f6d9203b940589b5355cb0286 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 26 Feb 2025 21:01:34 +0900 Subject: [PATCH 027/272] zvt/pp01.cpp: Restrict drawing to clipping rectangle and cleaned up code. (#13417) * Restore memory mapping after loading a saved state. * Reduced literal tags and run-time tag lookups. * Use more appropriate types and made some variables const. --- src/mame/zvt/pp01.cpp | 42 ++++------- src/mame/zvt/pp01.h | 61 ++++++++-------- src/mame/zvt/pp01_m.cpp | 149 +++++++++++++++++++--------------------- src/mame/zvt/pp01_v.cpp | 20 +++--- 4 files changed, 125 insertions(+), 147 deletions(-) diff --git a/src/mame/zvt/pp01.cpp b/src/mame/zvt/pp01.cpp index 2e66f7c0fddb7..2cee5b54e167a 100644 --- a/src/mame/zvt/pp01.cpp +++ b/src/mame/zvt/pp01.cpp @@ -32,29 +32,15 @@ Z - ? /* Address maps */ void pp01_state::mem_map(address_map &map) { - map(0x0000, 0x0fff).bankrw("bank0"); - map(0x1000, 0x1fff).bankrw("bank1"); - map(0x2000, 0x2fff).bankrw("bank2"); - map(0x3000, 0x3fff).bankrw("bank3"); - map(0x4000, 0x4fff).bankrw("bank4"); - map(0x5000, 0x5fff).bankrw("bank5"); - map(0x6000, 0x6fff).bankrw("bank6"); - map(0x7000, 0x7fff).bankrw("bank7"); - map(0x8000, 0x8fff).bankrw("bank8"); - map(0x9000, 0x9fff).bankrw("bank9"); - map(0xa000, 0xafff).bankrw("bank10"); - map(0xb000, 0xbfff).bankrw("bank11"); - map(0xc000, 0xcfff).bankrw("bank12"); - map(0xd000, 0xdfff).bankrw("bank13"); - map(0xe000, 0xefff).bankrw("bank14"); - map(0xf000, 0xffff).bankrw("bank15"); + for (int i = 0; i < 16; i++) + map(i << 12, (i << 12) | 0xfff).bankrw(m_bank[i]); } void pp01_state::io_map(address_map &map) { - map(0xc0, 0xc3).rw("ppi1", FUNC(i8255_device::read), FUNC(i8255_device::write)); // system - map(0xc4, 0xc7).rw("ppi2", FUNC(i8255_device::read), FUNC(i8255_device::write)); // user - map(0xc8, 0xc9).mirror(2).rw("uart", FUNC(i8251_device::read), FUNC(i8251_device::write)); + map(0xc0, 0xc3).rw(m_ppi[0], FUNC(i8255_device::read), FUNC(i8255_device::write)); // system + map(0xc4, 0xc7).rw(m_ppi[1], FUNC(i8255_device::read), FUNC(i8255_device::write)); // user + map(0xc8, 0xc9).mirror(2).rw(m_uart, FUNC(i8251_device::read), FUNC(i8251_device::write)); map(0xcc, 0xcf).w(FUNC(pp01_state::video_write_mode_w)); map(0xd0, 0xd3).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); //map(0xd4, 0xd7). MH3214 interrupt controller @@ -195,7 +181,7 @@ void pp01_state::pp01(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(256, 256); screen.set_visarea(0, 256-1, 0, 256-1); - screen.set_screen_update(FUNC(pp01_state::screen_update_pp01)); + screen.set_screen_update(FUNC(pp01_state::screen_update)); screen.set_palette("palette"); PALETTE(config, "palette", FUNC(pp01_state::pp01_palette), 8); @@ -214,15 +200,15 @@ void pp01_state::pp01(machine_config &config) m_pit->set_clk<2>(2000000); m_pit->out_handler<2>().set(FUNC(pp01_state::z2_w)); - I8255A(config, m_ppi1); - m_ppi1->in_pa_callback().set(FUNC(pp01_state::ppi1_porta_r)); - m_ppi1->out_pa_callback().set(FUNC(pp01_state::ppi1_porta_w)); - m_ppi1->in_pb_callback().set(FUNC(pp01_state::ppi1_portb_r)); - m_ppi1->out_pb_callback().set(FUNC(pp01_state::ppi1_portb_w)); - m_ppi1->in_pc_callback().set(FUNC(pp01_state::ppi1_portc_r)); - m_ppi1->out_pc_callback().set(FUNC(pp01_state::ppi1_portc_w)); + I8255A(config, m_ppi[0]); + m_ppi[0]->in_pa_callback().set(FUNC(pp01_state::ppi1_porta_r)); + m_ppi[0]->out_pa_callback().set(FUNC(pp01_state::ppi1_porta_w)); + m_ppi[0]->in_pb_callback().set(FUNC(pp01_state::ppi1_portb_r)); + m_ppi[0]->out_pb_callback().set(FUNC(pp01_state::ppi1_portb_w)); + m_ppi[0]->in_pc_callback().set(FUNC(pp01_state::ppi1_portc_r)); + m_ppi[0]->out_pc_callback().set(FUNC(pp01_state::ppi1_portc_w)); - I8255A(config, m_ppi2); + I8255A(config, m_ppi[1]); /* internal ram */ RAM(config, RAM_TAG).set_default_size("64K").set_default_value(0x00); diff --git a/src/mame/zvt/pp01.h b/src/mame/zvt/pp01.h index e2738eb4bf207..c57e4514ea685 100644 --- a/src/mame/zvt/pp01.h +++ b/src/mame/zvt/pp01.h @@ -28,12 +28,12 @@ class pp01_state : public driver_device : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_pit(*this, "pit") - , m_ppi1(*this, "ppi1") - , m_ppi2(*this, "ppi2") + , m_ppi(*this, "ppi%u", 1U) , m_speaker(*this, "speaker") , m_ram(*this, RAM_TAG) , m_uart(*this, "uart") , m_cass(*this, "cassette") + , m_mainrom(*this, "maincpu") , m_bank(*this, "bank%d", 0U) , m_io_keyboard(*this, "LINE%d", 0U) { } @@ -41,50 +41,53 @@ class pp01_state : public driver_device void pp01(machine_config &config); protected: + virtual void device_post_load() override ATTR_COLD; virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - uint8_t m_video_scroll = 0; - uint8_t m_memory_block[16]{}; - uint8_t m_video_write_mode = 0; - uint8_t m_key_line = 0; - bool m_txe = false, m_txd = false, m_rts = false, m_casspol = false; - u8 m_cass_data[4]{}; - - void video_write_mode_w(uint8_t data); - void video_r_1_w(offs_t offset, uint8_t data); - void video_g_1_w(offs_t offset, uint8_t data); - void video_b_1_w(offs_t offset, uint8_t data); - void video_r_2_w(offs_t offset, uint8_t data); - void video_g_2_w(offs_t offset, uint8_t data); - void video_b_2_w(offs_t offset, uint8_t data); - void mem_block_w(offs_t offset, uint8_t data); - uint8_t mem_block_r(offs_t offset); + void video_write_mode_w(u8 data); + void video_r_1_w(offs_t offset, u8 data); + void video_g_1_w(offs_t offset, u8 data); + void video_b_1_w(offs_t offset, u8 data); + void video_r_2_w(offs_t offset, u8 data); + void video_g_2_w(offs_t offset, u8 data); + void video_b_2_w(offs_t offset, u8 data); + void mem_block_w(offs_t offset, u8 data); + u8 mem_block_r(offs_t offset); TIMER_DEVICE_CALLBACK_MEMBER(kansas_r); void pp01_palette(palette_device &palette) const; - uint32_t screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void z2_w(int state); - uint8_t ppi1_porta_r(); - void ppi1_porta_w(uint8_t data); - uint8_t ppi1_portb_r(); - void ppi1_portb_w(uint8_t data); - void ppi1_portc_w(uint8_t data); - uint8_t ppi1_portc_r(); - void video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part); - void set_memory(uint8_t block, uint8_t data); + u8 ppi1_porta_r(); + void ppi1_porta_w(u8 data); + u8 ppi1_portb_r(); + void ppi1_portb_w(u8 data); + void ppi1_portc_w(u8 data); + u8 ppi1_portc_r(); + void video_w(u8 block, uint16_t offset, u8 data, bool part); + void set_memory(u8 block, u8 data); void io_map(address_map &map) ATTR_COLD; void mem_map(address_map &map) ATTR_COLD; + u8 m_video_scroll = 0; + u8 m_memory_block[16]{}; + u8 m_video_write_mode = 0; + u8 m_key_line = 0; + bool m_txe = false, m_txd = false, m_rts = false, m_casspol = false; + u8 m_cass_data[4]{}; + required_device m_maincpu; required_device m_pit; - required_device m_ppi1; - required_device m_ppi2; + required_device_array m_ppi; required_device m_speaker; required_device m_ram; required_device m_uart; required_device m_cass; + + required_region_ptr m_mainrom; required_memory_bank_array<16> m_bank; + required_ioport_array<17> m_io_keyboard; }; diff --git a/src/mame/zvt/pp01_m.cpp b/src/mame/zvt/pp01_m.cpp index 7df4f3fdcea51..3b924bb2eead5 100644 --- a/src/mame/zvt/pp01_m.cpp +++ b/src/mame/zvt/pp01_m.cpp @@ -13,89 +13,74 @@ #include "pp01.h" -void pp01_state::video_write_mode_w(uint8_t data) +void pp01_state::video_write_mode_w(u8 data) { m_video_write_mode = data & 0x0f; } -void pp01_state::video_w(uint8_t block,uint16_t offset,uint8_t data,uint8_t part) +void pp01_state::video_w(u8 block, u16 offset, u8 data, bool part) { - uint16_t addroffset = part ? 0x1000 : 0x0000; - uint8_t *ram = m_ram->pointer(); + u16 const rgb_offset[3] = { 0x6000, 0xa000, 0xe000 }; + offset += part ? 0x1000 : 0x0000; + u8 *const ram = m_ram->pointer(); - if (BIT(m_video_write_mode,3)) + if (BIT(m_video_write_mode, 3)) { // Copy mode - if(BIT(m_video_write_mode,0)) - ram[0x6000+offset+addroffset] = data; - else - ram[0x6000+offset+addroffset] = 0; - - if(BIT(m_video_write_mode,1)) - ram[0xa000+offset+addroffset] = data; - else - ram[0xa000+offset+addroffset] = 0; - - if(BIT(m_video_write_mode,2)) - ram[0xe000+offset+addroffset] = data; - else - ram[0xe000+offset+addroffset] = 0; - + for (int i = 0; i < 3; i++) + { + if (BIT(m_video_write_mode, i)) + ram[rgb_offset[i] + offset] = data; + else + ram[rgb_offset[i] + offset] = 0; + } } else { - if (block==0) - ram[0x6000+offset+addroffset] = data; - else - if (block==1) - ram[0xa000+offset+addroffset] = data; - else - if (block==2) - ram[0xe000+offset+addroffset] = data; + ram[rgb_offset[block] + offset] = data; } } -void pp01_state::video_r_1_w(offs_t offset, uint8_t data) +void pp01_state::video_r_1_w(offs_t offset, u8 data) { - video_w(0,offset,data,0); + video_w(0, offset, data, false); } -void pp01_state::video_g_1_w(offs_t offset, uint8_t data) +void pp01_state::video_g_1_w(offs_t offset, u8 data) { - video_w(1,offset,data,0); + video_w(1, offset, data, false); } -void pp01_state::video_b_1_w(offs_t offset, uint8_t data) +void pp01_state::video_b_1_w(offs_t offset, u8 data) { - video_w(2,offset,data,0); + video_w(2, offset, data, false); } -void pp01_state::video_r_2_w(offs_t offset, uint8_t data) +void pp01_state::video_r_2_w(offs_t offset, u8 data) { - video_w(0,offset,data,1); + video_w(0, offset, data, true); } -void pp01_state::video_g_2_w(offs_t offset, uint8_t data) +void pp01_state::video_g_2_w(offs_t offset, u8 data) { - video_w(1,offset,data,1); + video_w(1, offset, data, true); } -void pp01_state::video_b_2_w(offs_t offset, uint8_t data) +void pp01_state::video_b_2_w(offs_t offset, u8 data) { - video_w(2,offset,data,1); + video_w(2, offset, data, true); } -void pp01_state::set_memory(uint8_t block, uint8_t data) +void pp01_state::set_memory(u8 block, u8 data) { - uint8_t *mem = memregion("maincpu")->base(); address_space &space = m_maincpu->space(AS_PROGRAM); - uint16_t startaddr = block*0x1000; - uint16_t endaddr = startaddr+0xfff; + u16 const startaddr = block * 0x1000; + u16 const endaddr = startaddr + 0xfff; - if (data>=0xE0 && data<=0xEF) + if (data >= 0xe0 && data <= 0xef) { // This is RAM - space.install_read_bank (startaddr, endaddr, m_bank[block]); - switch(data) + space.install_read_bank(startaddr, endaddr, m_bank[block]); + switch (data) { - case 0xe6 : + case 0xe6: space.install_write_handler(startaddr, endaddr, write8sm_delegate(*this, FUNC(pp01_state::video_r_1_w))); break; case 0xe7: @@ -117,46 +102,40 @@ void pp01_state::set_memory(uint8_t block, uint8_t data) space.install_write_bank(startaddr, endaddr, m_bank[block]); break; } - - m_bank[block]->set_base(m_ram->pointer() + (data & 0x0F)* 0x1000); + m_bank[block]->set_base(m_ram->pointer() + (data & 0x0f) * 0x1000); } - else - if (data>=0xFC) + else if (data >= 0xfc) { - space.install_read_bank (startaddr, endaddr, m_bank[block]); + space.install_read_bank(startaddr, endaddr, m_bank[block]); space.unmap_write(startaddr, endaddr); - m_bank[block]->set_base(mem + (data & 0x03)* 0x1000); + m_bank[block]->set_base(&m_mainrom[(data & 0x03) * 0x1000]); } else { - logerror("%02x %02x\n",block,data); - space.unmap_readwrite (startaddr, endaddr); - } -} - -void pp01_state::machine_reset() -{ - int i; - memset(m_memory_block,0xff,16); - for(i=0;i<16;i++) - { - m_memory_block[i] = 0xff; - set_memory(i, 0xff); + logerror("set_memory %02x = %02x\n", block, data); + space.unmap_readwrite(startaddr, endaddr); } - m_uart->write_cts(0); } -void pp01_state::mem_block_w(offs_t offset, uint8_t data) +void pp01_state::mem_block_w(offs_t offset, u8 data) { m_memory_block[offset] = data; set_memory(offset, data); } -uint8_t pp01_state::mem_block_r(offs_t offset) +u8 pp01_state::mem_block_r(offs_t offset) { return m_memory_block[offset]; } +void pp01_state::device_post_load() +{ + for (int i = 0; i < 16; i++) + { + set_memory(i, m_memory_block[i]); + } +} + void pp01_state::machine_start() { save_item(NAME(m_video_scroll)); @@ -170,7 +149,17 @@ void pp01_state::machine_start() save_item(NAME(m_cass_data)); } -TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) +void pp01_state::machine_reset() +{ + for (int i = 0; i < 16; i++) + { + m_memory_block[i] = 0xff; + set_memory(i, 0xff); + } + m_uart->write_cts(0); +} + +TIMER_DEVICE_CALLBACK_MEMBER(pp01_state::kansas_r) { if (m_rts) { @@ -182,7 +171,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) m_cass_data[1]++; m_cass_data[2]++; - uint8_t cass_ws = (m_cass->input() > +0.04) ? 1 : 0; + u8 const cass_ws = (m_cass->input() > +0.04) ? 1 : 0; if (cass_ws != m_cass_data[0]) { @@ -193,7 +182,7 @@ TIMER_DEVICE_CALLBACK_MEMBER( pp01_state::kansas_r ) m_cass_data[2] = 0; m_uart->write_rxd(m_casspol); } - if ((m_cass_data[2] & 7)==2) + if ((m_cass_data[2] & 7) == 2) { m_cass_data[3]++; m_uart->write_rxc(BIT(m_cass_data[3], 0)); @@ -208,26 +197,26 @@ void pp01_state::z2_w(int state) m_cass->output((m_txd ^ state) ? -1.0 : 1.0); } -uint8_t pp01_state::ppi1_porta_r() +u8 pp01_state::ppi1_porta_r() { return m_video_scroll; } -void pp01_state::ppi1_porta_w(uint8_t data) +void pp01_state::ppi1_porta_w(u8 data) { m_video_scroll = data; } -uint8_t pp01_state::ppi1_portb_r() +u8 pp01_state::ppi1_portb_r() { return m_io_keyboard[m_key_line]->read() | m_io_keyboard[16]->read(); } -void pp01_state::ppi1_portb_w(uint8_t data) +void pp01_state::ppi1_portb_w(u8 data) { - //logerror("pp01_8255_portb_w %02x\n",data); + //logerror("pp01_8255_portb_w %02x\n", data); } -void pp01_state::ppi1_portc_w(uint8_t data) +void pp01_state::ppi1_portc_w(u8 data) { if (BIT(data, 4)) m_key_line = data & 0x0f; @@ -235,7 +224,7 @@ void pp01_state::ppi1_portc_w(uint8_t data) m_speaker->level_w(BIT(data, 0)); } -uint8_t pp01_state::ppi1_portc_r() +u8 pp01_state::ppi1_portc_r() { return 0xff; } diff --git a/src/mame/zvt/pp01_v.cpp b/src/mame/zvt/pp01_v.cpp index 4055f67bac5f0..e57a825e5d3d6 100644 --- a/src/mame/zvt/pp01_v.cpp +++ b/src/mame/zvt/pp01_v.cpp @@ -12,22 +12,22 @@ #include "emu.h" #include "pp01.h" -uint32_t pp01_state::screen_update_pp01(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 pp01_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t const *const ram = m_ram->pointer(); + u8 const *const ram = m_ram->pointer(); - for (int y = 0; y < 256; y++) + for (int y = cliprect.top(); y <= cliprect.bottom(); y++) { - for (int x = 0; x < 32; x++) + for (int x = cliprect.left() & ~7; x <= cliprect.right(); x += 8) { - u16 t = ((y+m_video_scroll)&0xff)*32 + x; - uint8_t const code_r = ram[0x6000 + t]; - uint8_t const code_g = ram[0xa000 + t]; - uint8_t const code_b = ram[0xe000 + t]; + u16 const t = ((y + m_video_scroll) & 0xff) * 32 + (x >> 3); + u8 const code_r = ram[0x6000 + t]; + u8 const code_g = ram[0xa000 + t]; + u8 const code_b = ram[0xe000 + t]; for (int b = 0; b < 8; b++) { - uint8_t const col = (BIT(code_r, b) << 2) | (BIT(code_g, b) << 1) | (BIT(code_b, b) << 0); - bitmap.pix(y, x*8+(7-b)) = col; + u8 const col = (BIT(code_r, b) << 2) | (BIT(code_g, b) << 1) | (BIT(code_b, b) << 0); + bitmap.pix(y, x + (7 - b)) = col; } } } From e935a515ecb3702ff16b29344e4b3921d50c0207 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 26 Feb 2025 21:18:48 +0900 Subject: [PATCH 028/272] wing/pinkiri8.cpp: Fixed some issues and cleaned up code: (#13412) * Moved drawing functions into the VDP device class. * Marked Pinkiri 8 as lacking sound altogether. * Use tilemap helpers, use palette format helpers, and adjusted palette size to match the amount of palette RAM. * Suppress side effects for debugger reads, and improved save state support. * Fixed switch matrix reading behavior. * Reduced literal tag usage and run-time tag lookups. * Reduced duplication and improved member and ROM region names. --- src/mame/wing/pinkiri8.cpp | 547 ++++++++++++++++++------------------- 1 file changed, 262 insertions(+), 285 deletions(-) diff --git a/src/mame/wing/pinkiri8.cpp b/src/mame/wing/pinkiri8.cpp index 82980a10d1eae..986a9863848c9 100644 --- a/src/mame/wing/pinkiri8.cpp +++ b/src/mame/wing/pinkiri8.cpp @@ -39,11 +39,15 @@ Dumped by Chackn ***************************************************************************/ #include "emu.h" + #include "cpu/z180/hd647180x.h" + #include "sound/okim6295.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" #define LOG_VRAM (1U << 1) @@ -53,21 +57,54 @@ Dumped by Chackn /* VDP device to give us our own memory map */ -class janshi_vdp_device : public device_t, public device_memory_interface +class janshi_vdp_device : public device_t, public device_memory_interface, public device_gfx_interface { public: + // constructor/destructor janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void map(address_map &map) ATTR_COLD; + // configurations + void set_janshi_hack(bool janshi_hack) { m_janshi_hack = janshi_hack; } + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void write(offs_t offset, uint8_t data); protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_validity_check(validity_checker &valid) const override; virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; virtual space_config_vector memory_space_config() const override; private: - address_space_config m_space_config; + address_space_config m_space_config; + + required_device m_palette; + + required_shared_ptr m_back_vram; + required_shared_ptr m_vram1; + required_shared_ptr m_unk1; + required_shared_ptr m_widthflags; + required_shared_ptr m_unk2; + required_shared_ptr m_vram2; + required_shared_ptr m_crtc_regs; + + // internal states + tilemap_t *m_tilemap = nullptr; + uint32_t m_vram_addr; + int32_t m_prev_writes; + + // configurations + bool m_janshi_hack; + + void back_vram_w(offs_t offset, uint8_t data); + DECLARE_GFXDECODE_MEMBER(gfxinfo); + TILE_GET_INFO_MEMBER(get_tile_info); + + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void map(address_map &map) ATTR_COLD; }; class pinkiri8_state : public driver_device @@ -75,86 +112,59 @@ class pinkiri8_state : public driver_device public: pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_janshi_back_vram(*this, "janshivdp:back_vram"), - m_janshi_vram1(*this, "janshivdp:vram1"), - m_janshi_unk1(*this, "janshivdp:unk1"), - m_janshi_widthflags(*this, "janshivdp:widthflags"), - m_janshi_unk2(*this, "janshivdp:unk2"), - m_janshi_vram2(*this, "janshivdp:vram2"), - m_janshi_paletteram(*this, "janshivdp:paletteram"), - m_janshi_paletteram2(*this, "janshivdp:paletteram2"), - m_janshi_crtc_regs(*this, "janshivdp:crtc_regs"), m_maincpu(*this, "maincpu"), m_vdp(*this, "janshivdp"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") + m_io_pl{{*this, "PL1_%u", 1U}, {*this, "PL2_%u", 1U}} { } void pinkiri8(machine_config &config); void ronjan(machine_config &config); + void janshi(machine_config &config); protected: + virtual void machine_start() override ATTR_COLD; + +private: void output_regs_w(uint8_t data); - void pinkiri8_vram_w(offs_t offset, uint8_t data); - void mux_w(uint8_t data); - uint8_t mux_p2_r(); - uint8_t mux_p1_r(); + void io_matrix_w(uint8_t data); + template uint8_t io_matrix_r(); uint8_t ronjan_prot_r(); void ronjan_prot_w(uint8_t data); uint8_t ronjan_prot_status_r(); uint8_t ronjan_patched_prot_r(); - virtual void video_start() override ATTR_COLD; - uint32_t screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - void draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void pinkiri8_io(address_map &map) ATTR_COLD; - void pinkiri8_map(address_map &map) ATTR_COLD; + void prg_map(address_map &map) ATTR_COLD; void ronjan_io(address_map &map) ATTR_COLD; -private: - required_shared_ptr m_janshi_back_vram; - required_shared_ptr m_janshi_vram1; - required_shared_ptr m_janshi_unk1; - required_shared_ptr m_janshi_widthflags; - required_shared_ptr m_janshi_unk2; - required_shared_ptr m_janshi_vram2; - required_shared_ptr m_janshi_paletteram; - required_shared_ptr m_janshi_paletteram2; - required_shared_ptr m_janshi_crtc_regs; - uint32_t m_vram_addr = 0; - int m_prev_writes = 0; - uint8_t m_mux_data = 0; - uint8_t m_prot_read_index = 0; - uint8_t m_prot_char[5]{}; - uint8_t m_prot_index = 0; - required_device m_maincpu; required_device m_vdp; - required_device m_gfxdecode; - required_device m_palette; -}; + required_ioport_array<5> m_io_pl[2]; + uint8_t m_io_matrix = 0; + uint8_t m_prot_read_index = 0; + uint8_t m_prot_char[5]{}; + uint8_t m_prot_index = 0; +}; void janshi_vdp_device::map(address_map &map) { - map(0xfc0000, 0xfc1fff).ram().share("back_vram"); // bg tilemap? - map(0xfc2000, 0xfc2fff).ram().share("vram1"); // xpos, colour, tile number etc. + map(0xfc0000, 0xfc1fff).ram().w(FUNC(janshi_vdp_device::back_vram_w)).share(m_back_vram); // bg tilemap? + map(0xfc2000, 0xfc2fff).ram().share(m_vram1); // xpos, colour, tile number etc. - map(0xfc3700, 0xfc377f).ram().share("unk1"); // ?? height related? - map(0xfc3780, 0xfc37bf).ram().share("widthflags"); - map(0xfc37c0, 0xfc37ff).ram().share("unk2"); // 2x increasing tables 00 10 20 30 etc. + map(0xfc3700, 0xfc377f).ram().share(m_unk1); // ?? height related? + map(0xfc3780, 0xfc37bf).ram().share(m_widthflags); + map(0xfc37c0, 0xfc37ff).ram().share(m_unk2); // 2x increasing tables 00 10 20 30 etc. - map(0xfc3800, 0xfc3fff).ram().share("vram2"); // y pos + unknown + map(0xfc3800, 0xfc3fff).ram().share(m_vram2); // y pos + unknown - map(0xff0000, 0xff07ff).ram().share("paletteram"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w)); - map(0xff2000, 0xff27ff).ram().share("paletteram2"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w)); + map(0xff0000, 0xff07ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w)); + map(0xff2000, 0xff27ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); //ram().w(FUNC(janshi_vdp_device::paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w)); - map(0xff6000, 0xff601f).ram().share("crtc_regs"); + map(0xff6000, 0xff601f).ram().share(m_crtc_regs); } DEFINE_DEVICE_TYPE(JANSHIVDP, janshi_vdp_device, "janshi_vdp", "Janshi VDP") @@ -162,12 +172,52 @@ DEFINE_DEVICE_TYPE(JANSHIVDP, janshi_vdp_device, "janshi_vdp", "Janshi VDP") janshi_vdp_device::janshi_vdp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, JANSHIVDP, tag, owner, clock) , device_memory_interface(mconfig, *this) + , device_gfx_interface(mconfig, *this, gfxinfo, "palette") , m_space_config("janshi_vdp", ENDIANNESS_LITTLE, 8,24, 0, address_map_constructor(FUNC(janshi_vdp_device::map), this)) + , m_palette(*this, "palette") + , m_back_vram(*this, "back_vram") + , m_vram1(*this, "vram1") + , m_unk1(*this, "unk1") + , m_widthflags(*this, "widthflags") + , m_unk2(*this, "unk2") + , m_vram2(*this, "vram2") + , m_crtc_regs(*this, "crtc_regs") + , m_vram_addr(0) + , m_prev_writes(0) + , m_janshi_hack(false) { } +static const gfx_layout charlayout = +{ + 16,8, + RGN_FRAC(1,5), + 5, + { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) }, + { STEP8(0,1), STEP8(8*8,1) }, + { STEP8(0,8) }, + 8*16 +}; + +GFXDECODE_MEMBER(janshi_vdp_device::gfxinfo) + GFXDECODE_DEVICE(DEVICE_SELF, 0, charlayout, 0, 0x40 ) +GFXDECODE_END + +void janshi_vdp_device::device_add_mconfig(machine_config &config) +{ + PALETTE(config, m_palette).set_format(palette_device::xBGR_555, 0x800); +} + void janshi_vdp_device::device_validity_check(validity_checker &valid) const {} -void janshi_vdp_device::device_start() {} + +void janshi_vdp_device::device_start() +{ + m_tilemap = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(janshi_vdp_device::get_tile_info)), TILEMAP_SCAN_ROWS, 16, 8, 32, 64); + + save_item(NAME(m_vram_addr)); + save_item(NAME(m_prev_writes)); +} + void janshi_vdp_device::device_reset() {} device_memory_interface::space_config_vector janshi_vdp_device::memory_space_config() const @@ -177,91 +227,93 @@ device_memory_interface::space_config_vector janshi_vdp_device::memory_space_con }; } -void pinkiri8_state::video_start() {} - - -void pinkiri8_state::draw_background(bitmap_ind16 &bitmap, const rectangle &cliprect) +void janshi_vdp_device::back_vram_w(offs_t offset, uint8_t data) { - gfx_element *gfx = m_gfxdecode->gfx(0); + m_back_vram[offset] = data; + m_tilemap->mark_tile_dirty(offset >> 2); +} - /* FIXME: color is a bit of a mystery */ +void janshi_vdp_device::write(offs_t offset, uint8_t data) +{ + switch (offset) { - int x, y, col, tile, count, attr; + case 0: + m_vram_addr = (data << 0) | (m_vram_addr & 0xffff00); + LOGMASKED(LOG_VRAM, "\n prev writes was %04x\n\naddress set to %04x -\n", m_prev_writes, m_vram_addr); + m_prev_writes = 0; + break; - count = 0; + case 1: + m_vram_addr = (data << 8) | (m_vram_addr & 0xff00ff); + LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); + break; - for (y = 0; y < 64; y++) - { - for (x = 0; x < 32; x++) - { - tile = m_janshi_back_vram[count + 1] << 8 | m_janshi_back_vram[count + 0]; - attr = m_janshi_back_vram[count + 2] ^ 0xf0; - col = (attr >> 4) | 0x10; + case 2: + m_vram_addr = (data << 16) | (m_vram_addr & 0x00ffff); + LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); + break; - gfx->transpen(bitmap,cliprect, tile, col, 0, 0, x * 16, y * 8, 0); + case 3: + { + LOGMASKED(LOG_VRAM, "%02x ", data); + m_prev_writes++; + m_vram_addr++; - count += 4; - } + space(0).write_byte(m_vram_addr, data); + break; } } } -void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +TILE_GET_INFO_MEMBER(janshi_vdp_device::get_tile_info) { - int MACHINE_TYPE_hack = 0; - int col_bank; - gfx_element *gfx = m_gfxdecode->gfx(0); - - if (!strcmp(machine().system().name,"janshi")) MACHINE_TYPE_hack = 1; - - //popmessage("%02x",m_janshi_crtc_regs[0x0a]); - col_bank = (m_janshi_crtc_regs[0x0a] & 0x40) >> 6; - - - int x,y; //,unk2; - int col; - - int spr_offs,i; - - int width, height; + /* FIXME: color is a bit of a mystery */ + tile_index <<= 2; + int const tile = m_back_vram[tile_index + 1] << 8 | m_back_vram[tile_index + 0]; + int const attr = m_back_vram[tile_index + 2] ^ 0xf0; + int const col = (attr >> 4) | 0x10; + tileinfo.set(0, tile, col, 0); +} +void janshi_vdp_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + //popmessage("%02x", m_crtc_regs[0x0a]); + int const col_bank = BIT(m_crtc_regs[0x0a], 6); - for(i=(0x1000/4)-4;i>=0;i--) + for (int i = (0x1000 / 4) - 4; i >= 0; i--) { - /* "vram1" (video map 0xfc2000) - - tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx | + /* + "vram1" (video map 0xfc2000) - "vram2" (video map 0xfc3800) + tttt tttt | 00tt tttt | cccc c000 | xxxx xxxx | - yyyy yyyy | ???? ???? | + "vram2" (video map 0xfc3800) + yyyy yyyy | ???? ???? | - widths come from "widthflags" (0xfc3780) - "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery + widths come from "widthflags" (0xfc3780) + "unk1" (0xfc3700) and "unk2" (0xfc37c0) are a mystery */ - spr_offs = ((m_janshi_vram1[(i*4)+0] & 0xff) | (m_janshi_vram1[(i*4)+1]<<8)) & 0xffff; - col = (m_janshi_vram1[(i*4)+2] & 0xf8) >> 3; - x = m_janshi_vram1[(i*4)+3] * 2; - -// unk2 = m_janshi_vram2[(i*2)+1]; - y = (m_janshi_vram2[(i*2)+0]); + int spr_offs = (m_vram1[(i * 4) + 0] | (m_vram1[(i * 4) + 1] << 8)) & 0xffff; + int col = (m_vram1[(i * 4) + 2] & 0xf8) >> 3; + int x = m_vram1[(i * 4) + 3] * 2; - y = 0x100-y; + //int unk2 = m_vram2[(i * 2) + 1]; + int y = (m_vram2[(i * 2) + 0]); + y = 0x100 - y; - col|= col_bank<<5; + col |= col_bank << 5; - // width = 0; height = 0; - - width = 2; - height = 2; + //int width = 0, height = 0; + int width = 2; + int height = 2; // this bit determines the sprite width, one bit is used in each word, each bit is used for a range of sprites - int bit = m_janshi_widthflags[(i/0x20)*2 + 1]; + int const bit = m_widthflags[(i / 0x20) * 2 + 1]; if (bit) { @@ -275,41 +327,41 @@ void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } // hacks! - if (MACHINE_TYPE_hack==1) // janshi + if (m_janshi_hack) // janshi { - if (spr_offs<0x400) + if (spr_offs < 0x400) { height = 4; } - else if (spr_offs<0x580) + else if (spr_offs < 0x580) { // height = 2; } - else if (spr_offs<0x880) + else if (spr_offs < 0x880) { height = 4; } - else if (spr_offs<0x1000) + else if (spr_offs < 0x1000) { // height = 2; } - else if (spr_offs<0x1080) + else if (spr_offs < 0x1080) { // height = 2; } - else if (spr_offs<0x1700) + else if (spr_offs < 0x1700) { height = 4; } - else if (spr_offs<0x1730) + else if (spr_offs < 0x1730) { // height = 2; } - else if (spr_offs<0x1930) + else if (spr_offs < 0x1930) { height = 4; } - else if (spr_offs<0x19c0) + else if (spr_offs < 0x19c0) { height = 1; } @@ -317,69 +369,46 @@ void pinkiri8_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec { height = 4; } - - } - - - - - - if (height==1) - y+=16; - + if (height == 1) + y += 16; // hmm... - if (height==2) - y+=16; - + if (height == 2) + y += 16; + int count = 0; + for (int yy = 0; yy < height; yy++) { - int count = 0; - - - for (int yy=0;yytranspen(bitmap,cliprect,spr_offs+count,col,0,0,(x+xx*16) -7 ,(y+yy*8)-33,0); - count++; - } + gfx(0)->transpen(bitmap, cliprect, + spr_offs + count, col, + 0, 0, + (x + xx * 16) - 7, (y + yy * 8) - 33, + 0); + count++; } } } } -uint32_t pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t janshi_vdp_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - /* update palette */ - for (int pen = 0; pen < 0x800 ; pen++) - { - uint16_t val = (m_janshi_paletteram[pen]) | (m_janshi_paletteram2[pen]<<8); - int r = (val & 0x001f) >> 0; - int g = (val & 0x03e0) >> 5; - int b = (val & 0x7c00) >> 10; - m_palette->set_pen_color(pen, pal5bit(r), pal5bit(g), pal5bit(b)); - } - - - #if 0 - if ( machine().input().code_pressed_once(KEYCODE_W) ) + if (machine().input().code_pressed_once(KEYCODE_W)) { - int i; - int count2; printf("-------------------------------\n"); - count2=0; - for (i=0x00;i<0x40;i+=2) + int count2 = 0; + for (int i = 0x00; i < 0x40; i += 2) { - printf("%02x, ", m_janshi_widthflags[i+1]); + printf("%02x, ", m_widthflags[i+1]); count2++; - if (count2==0x10) + if (count2 == 0x10) { printf("\n"); count2 = 0; @@ -388,17 +417,16 @@ uint32_t pinkiri8_state::screen_update_pinkiri8(screen_device &screen, bitmap_in } #endif - bitmap.fill(m_palette->black_pen(), cliprect); - draw_background(bitmap, cliprect); + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); draw_sprites(bitmap, cliprect); return 0; } -void pinkiri8_state::pinkiri8_map(address_map &map) +void pinkiri8_state::prg_map(address_map &map) { map(0x00000, 0x0bfff).rom(); map(0x0c000, 0x0dfff).ram(); @@ -408,78 +436,27 @@ void pinkiri8_state::pinkiri8_map(address_map &map) void pinkiri8_state::output_regs_w(uint8_t data) { - if(data & 0x40) + if (BIT(data, 6)) m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); - //data & 0x80 is probably NMI mask + //BIT(data, 7) is probably NMI mask } - -void pinkiri8_state::pinkiri8_vram_w(offs_t offset, uint8_t data) +void pinkiri8_state::io_matrix_w(uint8_t data) { - switch(offset) - { - case 0: - m_vram_addr = (data << 0) | (m_vram_addr&0xffff00); - LOGMASKED(LOG_VRAM, "\n prev writes was %04x\n\naddress set to %04x -\n", m_prev_writes, m_vram_addr); - m_prev_writes = 0; - break; - - case 1: - m_vram_addr = (data << 8) | (m_vram_addr & 0xff00ff); - LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); - break; - - case 2: - m_vram_addr = (data << 16) | (m_vram_addr & 0x00ffff); - LOGMASKED(LOG_VRAM, "\naddress set to %04x\n", m_vram_addr); - break; - - case 3: - { - address_space &vdp_space = m_vdp->space(); - - LOGMASKED(LOG_VRAM, "%02x ", data); - m_prev_writes++; - m_vram_addr++; - - vdp_space.write_byte(m_vram_addr, data); - break; - } - } -} - - -void pinkiri8_state::mux_w(uint8_t data) -{ - m_mux_data = data; + m_io_matrix = data; } -uint8_t pinkiri8_state::mux_p2_r() +template +uint8_t pinkiri8_state::io_matrix_r() { - switch(m_mux_data) + uint8_t ret = 0xff; + for (int i = 0; i < 5; i++) { - case 0x01: return ioport("PL2_01")->read(); - case 0x02: return ioport("PL2_02")->read(); - case 0x04: return ioport("PL2_03")->read(); - case 0x08: return ioport("PL2_04")->read(); - case 0x10: return ioport("PL2_05")->read(); + if (BIT(m_io_matrix, i)) + ret &= m_io_pl[Player][i]->read(); } - return 0xff; -} - -uint8_t pinkiri8_state::mux_p1_r() -{ - switch(m_mux_data) - { - case 0x01: return ioport("PL1_01")->read(); - case 0x02: return ioport("PL1_02")->read(); - case 0x04: return ioport("PL1_03")->read(); - case 0x08: return ioport("PL1_04")->read(); - case 0x10: return ioport("PL1_05")->read(); - } - - return 0xff; + return ret; } void pinkiri8_state::pinkiri8_io(address_map &map) @@ -487,12 +464,12 @@ void pinkiri8_state::pinkiri8_io(address_map &map) map.global_mask(0xff); map(0x00, 0x3f).ram(); //Z180 internal I/O map(0x60, 0x60).nopw(); - map(0x80, 0x83).w(FUNC(pinkiri8_state::pinkiri8_vram_w)); + map(0x80, 0x83).w(m_vdp, FUNC(janshi_vdp_device::write)); map(0xa0, 0xa0).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); //correct? - map(0xb0, 0xb0).w(FUNC(pinkiri8_state::mux_w)); //mux - map(0xb0, 0xb0).r(FUNC(pinkiri8_state::mux_p2_r)); // mux inputs - map(0xb1, 0xb1).r(FUNC(pinkiri8_state::mux_p1_r)); // mux inputs + map(0xb0, 0xb0).w(FUNC(pinkiri8_state::io_matrix_w)); //mux + map(0xb0, 0xb0).r(FUNC(pinkiri8_state::io_matrix_r<1>)); // mux inputs + map(0xb1, 0xb1).r(FUNC(pinkiri8_state::io_matrix_r<0>)); // mux inputs map(0xb2, 0xb2).portr("SYSTEM"); map(0xf8, 0xf8).portr("DSW1"); map(0xf9, 0xf9).portr("DSW2"); @@ -536,7 +513,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_01") + PORT_START("PL1_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) @@ -544,7 +521,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_START("PL1_02") + PORT_START("PL1_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) @@ -552,7 +529,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_START("PL1_03") + PORT_START("PL1_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) @@ -560,7 +537,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_04") + PORT_START("PL1_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) @@ -568,7 +545,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL1_05") + PORT_START("PL1_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) @@ -576,7 +553,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_BIG ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_SMALL ) - PORT_START("PL2_01") + PORT_START("PL2_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) @@ -584,7 +561,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_START("PL2_02") + PORT_START("PL2_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) @@ -592,7 +569,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_START("PL2_03") + PORT_START("PL2_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) @@ -600,7 +577,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL2_04") + PORT_START("PL2_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) @@ -608,7 +585,7 @@ static INPUT_PORTS_START( base_inputs ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("PL2_05") + PORT_START("PL2_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MAHJONG_LAST_CHANCE ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_MAHJONG_SCORE ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) PORT_PLAYER(2) @@ -913,7 +890,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_INCLUDE( base_inputs ) /* standard mahjong panel converted to a hanafuda one */ - PORT_MODIFY("PL1_01") + PORT_MODIFY("PL1_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -921,7 +898,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) - PORT_MODIFY("PL1_02") + PORT_MODIFY("PL1_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -929,7 +906,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) - PORT_MODIFY("PL1_03") + PORT_MODIFY("PL1_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -937,7 +914,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL1_04") + PORT_MODIFY("PL1_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -945,7 +922,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL1_05") + PORT_MODIFY("PL1_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -953,7 +930,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_01") + PORT_MODIFY("PL2_1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_A ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_E ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -961,7 +938,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) - PORT_MODIFY("PL2_02") + PORT_MODIFY("PL2_2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_B ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_F ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -969,7 +946,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) PORT_PLAYER(2) - PORT_MODIFY("PL2_03") + PORT_MODIFY("PL2_3") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_C ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_G ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -977,7 +954,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_04") + PORT_MODIFY("PL2_4") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_HANAFUDA_D ) PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_HANAFUDA_H ) PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -985,7 +962,7 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_MODIFY("PL2_05") + PORT_MODIFY("PL2_5") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -1103,25 +1080,19 @@ static INPUT_PORTS_START( pinkiri8 ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "SW4:8" ) INPUT_PORTS_END -static const gfx_layout charlayout = +void pinkiri8_state::machine_start() { - 16,8, - RGN_FRAC(1,5), - 5, - { RGN_FRAC(4,5),RGN_FRAC(3,5),RGN_FRAC(2,5),RGN_FRAC(1,5),RGN_FRAC(0,5) }, - { 0, 1, 2, 3, 4, 5, 6, 7, 8*8+0, 8*8+1, 8*8+2, 8*8+3, 8*8+4, 8*8+5, 8*8+6, 8*8+7 }, - { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*16 -}; - -static GFXDECODE_START( gfx_pinkiri8 ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 0x100 ) -GFXDECODE_END + save_item(NAME(m_io_matrix)); + + save_item(NAME(m_prot_read_index)); + save_item(NAME(m_prot_char)); + save_item(NAME(m_prot_index)); +} void pinkiri8_state::pinkiri8(machine_config &config) { HD647180X(config, m_maincpu, XTAL(32'000'000)/2); - m_maincpu->set_addrmap(AS_PROGRAM, &pinkiri8_state::pinkiri8_map); + m_maincpu->set_addrmap(AS_PROGRAM, &pinkiri8_state::prg_map); m_maincpu->set_addrmap(AS_IO, &pinkiri8_state::pinkiri8_io); m_maincpu->set_vblank_int("screen", FUNC(pinkiri8_state::nmi_line_assert)); m_maincpu->out_pa_callback().set(FUNC(pinkiri8_state::output_regs_w)); @@ -1131,11 +1102,8 @@ void pinkiri8_state::pinkiri8(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(64*8, 64*8); screen.set_visarea(0*8, 62*8-1, 0*8, 32*8-1); - screen.set_screen_update(FUNC(pinkiri8_state::screen_update_pinkiri8)); - screen.set_palette(m_palette); - - GFXDECODE(config, m_gfxdecode, m_palette, gfx_pinkiri8); - PALETTE(config, m_palette).set_entries(0x2000); + screen.set_screen_update(m_vdp, FUNC(janshi_vdp_device::screen_update)); + screen.set_palette("janshivdp:palette"); JANSHIVDP(config, m_vdp, 0); @@ -1153,6 +1121,13 @@ void pinkiri8_state::ronjan(machine_config &config) m_maincpu->in_pg_callback().set(FUNC(pinkiri8_state::ronjan_prot_status_r)); } +void pinkiri8_state::janshi(machine_config &config) +{ + pinkiri8(config); + + m_vdp->set_janshi_hack(true); +} + /*************************************************************************** Game driver(s) @@ -1164,7 +1139,7 @@ ROM_START( pinkiri8 ) ROM_LOAD( "pinkiri8-ver.1.02.l1", 0x0000, 0x20000, CRC(f2df5b12) SHA1(e374e184a6a1e932550516011ec09a5accec9b03) ) ROM_LOAD( "bios.rom", 0x0000, 0x4000, CRC(399df1ee) SHA1(8251f3aa7da4c7899c8e739c10b61260f4471311) ) //overlapped internal ROM - ROM_REGION( 0x20000*5, "gfx1", 0 ) + ROM_REGION( 0x20000*5, "janshivdp", 0 ) ROM_LOAD( "pinkiri8-chr-01.a1", 0x00000, 0x20000, CRC(8ec73662) SHA1(9098348e519ce753dd7f38f0d855181bfc65aa42) ) ROM_LOAD( "pinkiri8-chr-02.bc1", 0x20000, 0x20000, CRC(8dc20a65) SHA1(4062510fe06e8844a732754b7915a3b67ba2a3c5) ) ROM_LOAD( "pinkiri8-chr-03.d1", 0x40000, 0x20000, CRC(bd5f269a) SHA1(7dfd039227551f0f0ed4afaafc76ca64a39a9b83) ) @@ -1180,7 +1155,7 @@ ROM_START( janshi ) ROM_LOAD( "11.1l", 0x00000, 0x20000, CRC(a7692ddf) SHA1(5e7f43d8337583977baf22a28bbcd9b2182c0cde) ) ROM_LOAD( "=3= 9009 1992.1 new jansh.bin", 0x0000, 0x4000, CRC(63cd3f12) SHA1(aebac739bffaf043e6acffa978e935f73ee1385f) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "1.1a", 0x000000, 0x40000, CRC(92b140a5) SHA1(f3b38563f74650604ed0faaf84460e0b04b386b7) ) ROM_LOAD( "2.1b", 0x040000, 0x40000, CRC(6de7e086) SHA1(e87426264f0181c17383ffe0f7ec7ff5fce3d809) ) ROM_LOAD( "3.1d", 0x080000, 0x40000, CRC(4e94d8f2) SHA1(a25f542943d74915fc82910baafb9ff9db1ffd70) ) @@ -1196,7 +1171,7 @@ ROM_START( ronjans ) ROM_LOAD( "ver201.bin", 0x00000, 0x20000, CRC(caa98c79) SHA1(e18f52fc910e3a77142ad2a3167805cfd664f0f4) ) ROM_LOAD( "9009 1996.08 ron jan.bin", 0x00000, 0x4000, CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle.1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle.2", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle.3", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1212,7 +1187,7 @@ ROM_START( ronjansa ) // the Z180 internal ROM wasn't extracted from this PCB. I ROM_LOAD( "eagle_18.i1", 0x00000, 0x20000, CRC(b5cc6d84) SHA1(e76ec529a7cd788a9ca0119d2f2dc00b29181289) ) ROM_LOAD( "9009 1992.04 ron jan.bin", 0x00000, 0x04000, NO_DUMP ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1228,7 +1203,7 @@ ROM_START( ronjansb ) // the Z180 internal ROM wasn't extracted from this PCB. I ROM_LOAD( "eagle_19.i1", 0x00000, 0x20000, CRC(348fa965) SHA1(082395c51478c1cc053425d30fc94871fdc244ea) ) ROM_LOAD( "9009 1992.09 ron jan.bin", 0x00000, 0x04000, NO_DUMP ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1244,7 +1219,7 @@ ROM_START( ronjan ) // the Z180 internal ROM wasn't extracted from this PCB. Usi ROM_LOAD( "9.l1", 0x00000, 0x20000, CRC(1bc4468e) SHA1(5b317c922d9a6f533958526e676f95af0ee6a19f) ) ROM_LOAD( "9009 1991.11 ron jan.bin", 0x00000, 0x4000, BAD_DUMP CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "1.a1", 0x000000, 0x20000, CRC(8242a791) SHA1(bb753e81293685499513e83b7a103396b3a32ad8) ) ROM_LOAD( "2.c1", 0x040000, 0x20000, CRC(4b25c09a) SHA1(edbe1907c300f12bf65c81b2d9e034d6f5545bd0) ) ROM_LOAD( "3.d1", 0x080000, 0x20000, CRC(7b956af6) SHA1(4a661d5cc5b06658804c8d377d5a266f5bd9ce85) ) @@ -1260,7 +1235,7 @@ ROM_START( ronjana ) // the Z180 internal ROM wasn't extracted from this PCB. Us ROM_LOAD( "eagle_16.i1", 0x00000, 0x20000, CRC(9b7bf916) SHA1(d8a732bb53926e8127bc3638c8719f3c43c7881d) ) ROM_LOAD( "9009 1991.11 ron jan.bin", 0x00000, 0x04000, BAD_DUMP CRC(4eb74322) SHA1(84f864c0da3fb69948f6eb7ffecf0e722a882efc) ) //overlapped internal ROM - ROM_REGION( 0x140000, "gfx1", 0 ) + ROM_REGION( 0x140000, "janshivdp", 0 ) ROM_LOAD( "eagle_1.a1", 0x000000, 0x40000, CRC(11cef2c4) SHA1(fcd46bfa123cd91053f8d49892778e02a275ffdd) ) ROM_LOAD( "eagle_2.b1", 0x040000, 0x40000, CRC(177c444c) SHA1(5af0f6040ba121c90b3480ce636885cce535d3ea) ) ROM_LOAD( "eagle_3.d1", 0x080000, 0x40000, CRC(5b15b99f) SHA1(b99e2fa4cde7c8661d1a81ce5045f5df4f1de9f2) ) @@ -1275,28 +1250,30 @@ uint8_t pinkiri8_state::ronjan_prot_r() { static const char wing_str[6] = { 'W', 'I', 'N', 'G', '8', '9' }; - m_prot_read_index++; + uint8_t prot_read_index = m_prot_read_index + 1; + if (!machine().side_effects_disabled()) + m_prot_read_index++; - if(m_prot_read_index & 1) + if (BIT(prot_read_index, 0)) return 0xff; //value is discarded - return wing_str[(m_prot_read_index >> 1)-1]; + return wing_str[(prot_read_index >> 1)-1]; } void pinkiri8_state::ronjan_prot_w(uint8_t data) { - if(data == 0) + if (data == 0) { m_prot_index = 0; } else { - if(m_prot_index == 5) + if (m_prot_index == 5) return; m_prot_char[m_prot_index++] = data; - if(m_prot_char[0] == 'E' && m_prot_char[1] == 'R' && m_prot_char[2] == 'R' && m_prot_char[3] == 'O' && m_prot_char[4] == 'R') + if (m_prot_char[0] == 'E' && m_prot_char[1] == 'R' && m_prot_char[2] == 'R' && m_prot_char[3] == 'O' && m_prot_char[4] == 'R') m_prot_read_index = 0; } } @@ -1311,10 +1288,10 @@ uint8_t pinkiri8_state::ronjan_patched_prot_r() return 0; //value is read then discarded } -GAME( 1992, janshi, 0, pinkiri8, janshi, pinkiri8_state, empty_init, ROT0, "Eagle", "Janshi", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) +GAME( 1992, janshi, 0, janshi, janshi, pinkiri8_state, empty_init, ROT0, "Eagle", "Janshi", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1991, ronjan, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1994, ronjana, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) GAME( 1994, ronjans, 0, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // 'SUPER' flashes in the middle of the screen GAME( 1994, ronjansa, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // possibly Super or not, needs internal ROM dump GAME( 1994, ronjansb, ronjans, ronjan, ronjan, pinkiri8_state, empty_init, ROT0, "Wing Co., Ltd", "Ron Jan Super (set 3)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // " -GAME( 1994, pinkiri8, 0, pinkiri8, pinkiri8, pinkiri8_state, empty_init, ROT0, "Alta", "Pinkiri 8", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) +GAME( 1994, pinkiri8, 0, pinkiri8, pinkiri8, pinkiri8_state, empty_init, ROT0, "Alta", "Pinkiri 8", MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) From 6db3734c28066661ecbcfa516628421eed845f51 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 26 Feb 2025 21:21:12 +0900 Subject: [PATCH 029/272] vsystem/pspikes.cpp: Use explicitly sized integers for members that need to be registered for save states. (#13403) Also improved member names. --- src/mame/vsystem/pspikes.cpp | 126 +++++++++++++++++------------------ 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/src/mame/vsystem/pspikes.cpp b/src/mame/vsystem/pspikes.cpp index b934c331d0ff5..b42f4302950b1 100644 --- a/src/mame/vsystem/pspikes.cpp +++ b/src/mame/vsystem/pspikes.cpp @@ -96,7 +96,7 @@ class pspikes_base_state : public driver_device , m_oki(*this, "oki") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") - , m_spr_old(*this, "vsystem_spr_old%u", 1) + , m_spr(*this, "spr%u", 1) , m_vram(*this, "vram.%u", 0) , m_rasterram(*this, "rasterram") , m_sprlookupram(*this, "sprlookupram%u", 1) @@ -111,7 +111,7 @@ class pspikes_base_state : public driver_device void aerfboo2(machine_config &config) ATTR_COLD; protected: - uint32_t pspikes_old_tile_callback(uint32_t code); + uint32_t pspikes_tile_callback(uint32_t code); // handlers template void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -135,7 +135,7 @@ class pspikes_base_state : public driver_device uint32_t screen_update_pspikesb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_aerfboot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_aerfboo2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void pspikes_register_state_globals(); + void register_state_globals(); void setbank(int layer, int num, int bank); void aerfboo2_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int chip, int chip_disabled_pri); void pspikesb_draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -152,7 +152,7 @@ class pspikes_base_state : public driver_device optional_device m_oki; required_device m_gfxdecode; required_device m_palette; - optional_device_array m_spr_old; + optional_device_array m_spr; // memory pointers optional_shared_ptr_array m_vram; @@ -169,9 +169,9 @@ class pspikes_base_state : public driver_device uint16_t m_scrollx[2]{}; uint16_t m_scrolly[2]{}; bool m_flip_screen = false; - int m_charpalettebank = 0; - int m_spritepalettebank = 0; - int m_sprite_gfx = 0; + uint32_t m_charpalettebank = 0; + uint32_t m_spritepalettebank = 0; + int m_sprite_gfx = 0; }; @@ -199,7 +199,7 @@ class pspikes_sound_cpu_state : public pspikes_base_state void karatblz_gfxbank_w(uint8_t data); void kickball_gfxbank_w(uint8_t data); - uint32_t pspikes_ol2_tile_callback(uint32_t code); + uint32_t pspikes_tile2_callback(uint32_t code); uint32_t screen_update_karatblz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -407,7 +407,7 @@ TILE_GET_INFO_MEMBER(pspikes_base_state::get_tile_info) ***************************************************************************/ -void pspikes_base_state::pspikes_register_state_globals() +void pspikes_base_state::register_state_globals() { save_item(NAME(m_gfxbank)); save_item(NAME(m_bank)); @@ -426,7 +426,7 @@ VIDEO_START_MEMBER(pspikes_base_state,pspikes) m_sprite_gfx = 1; m_charpalettebank = 0; - pspikes_register_state_globals(); + register_state_globals(); } void spikes91_state::video_start() @@ -447,7 +447,7 @@ VIDEO_START_MEMBER(pspikes_base_state,karatblz) m_spritepalettebank = 0; m_sprite_gfx = 2; - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_banked_sound_state,spinlbrk) @@ -462,7 +462,7 @@ VIDEO_START_MEMBER(pspikes_banked_sound_state,spinlbrk) // sprite maps are hardcoded in this game - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_base_state,turbofrc) @@ -475,7 +475,7 @@ VIDEO_START_MEMBER(pspikes_base_state,turbofrc) m_spritepalettebank = 0; m_sprite_gfx = 2; - pspikes_register_state_globals(); + register_state_globals(); } VIDEO_START_MEMBER(pspikes_base_state,aerofgtb) @@ -487,12 +487,12 @@ VIDEO_START_MEMBER(pspikes_base_state,aerofgtb) } -uint32_t pspikes_base_state::pspikes_old_tile_callback(uint32_t code) +uint32_t pspikes_base_state::pspikes_tile_callback(uint32_t code) { return m_sprlookupram[0][code % (m_sprlookupram[0].bytes()/2)]; } -uint32_t pspikes_sound_cpu_state::pspikes_ol2_tile_callback(uint32_t code) +uint32_t pspikes_sound_cpu_state::pspikes_tile2_callback(uint32_t code) { return m_sprlookupram[1][code % (m_sprlookupram[1].bytes()/2)]; } @@ -604,8 +604,8 @@ uint32_t pspikes_base_state::screen_update_pspikes(screen_device &screen, bitmap screen.priority().fill(0, cliprect); m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -623,11 +623,11 @@ uint32_t pspikes_sound_cpu_state::screen_update_karatblz(screen_device &screen, m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); // we use the priority buffer so sprites are drawn front to back - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -648,11 +648,11 @@ uint32_t pspikes_banked_sound_state::screen_update_spinlbrk(screen_device &scree m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); // we use the priority buffer so sprites are drawn front to back - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); return 0; } @@ -674,11 +674,11 @@ uint32_t pspikes_banked_sound_state::screen_update_turbofrc(screen_device &scree m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); // we use the priority buffer so sprites are drawn front to back - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //ship - m_spr_old[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //intro + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //ship + m_spr[1]->draw_sprites(m_spriteram+0x200,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //intro - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //enemy - m_spr_old[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //enemy + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); //enemy + m_spr[0]->draw_sprites(m_spriteram+0x000,m_spriteram.bytes()/2,m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); //enemy return 0; } @@ -700,7 +700,7 @@ void wbbc97_state::video_start() m_sprite_gfx = 1; - pspikes_register_state_globals(); + register_state_globals(); save_item(NAME(m_bitmap_enable)); } @@ -1083,8 +1083,8 @@ uint32_t wbbc97_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap m_tilemap[0]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); } - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); - m_spr_old[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 1, m_flip_screen); + m_spr[0]->draw_sprites(m_spriteram,m_spriteram.bytes(),m_spritepalettebank, bitmap, cliprect, screen.priority(), 0, m_flip_screen); return 0; } @@ -2301,8 +2301,8 @@ void pspikes_banked_sound_state::pspikes(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_pspikes); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified @@ -2420,8 +2420,8 @@ void pspikes_sound_cpu_state::kickball(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_pspikes); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 2048); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_kickball_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_sound_cpu_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_kickball_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_sound_cpu_state::pspikes_tile_callback)); //VSYSTEM_GGA(config, "gga", 0); // still accessed as if it exists, in clone hardware? @@ -2463,8 +2463,8 @@ void pspikes_base_state::pspikesc(machine_config &config) //VSYSTEM_GGA(config, "gga", 0); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_base_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_base_state::pspikes_tile_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_base_state,pspikes) @@ -2501,11 +2501,11 @@ void pspikes_banked_sound_state::karatblz(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,karatblz) @@ -2548,11 +2548,11 @@ void karatblzbl_state::karatblzbl(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_turbofrc); PALETTE(config, m_palette).set_format(palette_device::xRGB_555, 1024); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(karatblzbl_state::pspikes_tile2_callback)); //VSYSTEM_GGA(config, "gga", 0); @@ -2598,12 +2598,12 @@ void pspikes_banked_sound_state::spinlbrk(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_pritype(1); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_pritype(1); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::spinbrk_tile_callback)); // rom lookup - m_spr_old[1]->set_pritype(1); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::spinbrk_tile_callback)); // rom lookup + m_spr[1]->set_pritype(1); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,spinlbrk) @@ -2648,11 +2648,11 @@ void pspikes_banked_sound_state::turbofrc(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,turbofrc) @@ -2697,13 +2697,13 @@ void pspikes_banked_sound_state::aerofgtb(machine_config &config) VSYSTEM_GGA(config, "gga", XTAL(14'318'181) / 2); // divider not verified - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_turbofrc_spr1); - m_spr_old[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_old_tile_callback)); - m_spr_old[0]->set_offsets(3, -1); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_turbofrc_spr1); + m_spr[0]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile_callback)); + m_spr[0]->set_offsets(3, -1); - VSYSTEM_SPR2(config, m_spr_old[1], 0, m_palette, gfx_turbofrc_spr2); - m_spr_old[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_ol2_tile_callback)); - m_spr_old[1]->set_offsets(3, -1); + VSYSTEM_SPR2(config, m_spr[1], 0, m_palette, gfx_turbofrc_spr2); + m_spr[1]->set_tile_indirect_cb(FUNC(pspikes_banked_sound_state::pspikes_tile2_callback)); + m_spr[1]->set_offsets(3, -1); MCFG_VIDEO_START_OVERRIDE(pspikes_banked_sound_state,aerofgtb) @@ -2813,8 +2813,8 @@ void wbbc97_state::wbbc97(machine_config &config) //VSYSTEM_GGA(config, "gga", 0); - VSYSTEM_SPR2(config, m_spr_old[0], 0, m_palette, gfx_pspikes_spr); - m_spr_old[0]->set_tile_indirect_cb(FUNC(wbbc97_state::pspikes_old_tile_callback)); + VSYSTEM_SPR2(config, m_spr[0], 0, m_palette, gfx_pspikes_spr); + m_spr[0]->set_tile_indirect_cb(FUNC(wbbc97_state::pspikes_tile_callback)); // sound hardware SPEAKER(config, "mono").front_center(); From 7736580b1a0feca80353d38398f36b1ee00d4687 Mon Sep 17 00:00:00 2001 From: ArcadeShadow Date: Wed, 26 Feb 2025 12:24:12 +0000 Subject: [PATCH 030/272] spectrum_cass.xml: Added five working items and improved metadata. (#13398) Also made the two cassettes included in BMX Simulator 2 parts of a single item. New working software list items (spectrum_cass.xml) -------------------------------------------- African Trail Simulator [Spectrum Computing] Ajedrez [Spectrum Computing] Destronado [El Trastero del Spectrum] Mieyen [Inufuto] Run for Gold (System 4) [Spectrum Computing] --- hash/spectrum_cass.xml | 387 ++++++++++++++++++++++++----------------- 1 file changed, 226 insertions(+), 161 deletions(-) diff --git a/hash/spectrum_cass.xml b/hash/spectrum_cass.xml index f9adf62cb17d9..557137eb3d8ba 100644 --- a/hash/spectrum_cass.xml +++ b/hash/spectrum_cass.xml @@ -221,22 +221,6 @@ license:CC0-1.0 Titles beginning with 'A' ############################################################################################################################## --> - - Arkos - 1988 - Zigurat Software - - - - - - - - - - - - Advanced Pinball Simulator @@ -260,13 +244,26 @@ license:CC0-1.0 - - Arcade Flight Simulator - 1989 - Code Masters + + African Trail Simulator + 1990 + Positive + - - + + + + + + + + Ajedrez + 1986 + Indescomp + + + + @@ -350,6 +347,33 @@ license:CC0-1.0 + + Arcade Flight Simulator + 1989 + Code Masters + + + + + + + + + Arkos + 1988 + Zigurat Software + + + + + + + + + + + + Astor Gamão 1985 @@ -2691,24 +2715,18 @@ no loading screen, no custom loader - - BMX Simulator 2 - Dirt Biking + BMX Simulator 2 1989 Code Masters - + + - - - - - BMX Simulator 2 - Quarry Racing - 1989 - Code Masters - + + @@ -4222,8 +4240,8 @@ no loading screen, no custom loader Batman - The Movie (alt) - 19?? - <unknown> + 1989 + Ocean @@ -4445,8 +4463,8 @@ no loading screen, no custom loader Bobsleigh (set 2, Byte-Back) - 19?? - <unknown> + 1987 + Byte-Back @@ -4456,8 +4474,8 @@ no loading screen, no custom loader Bobsleigh (set 3) - 19?? - <unknown> + 1987 + Digital Integration @@ -8985,7 +9003,7 @@ no loading screen, no custom loader Daley Thompson's Decathlon (set 3, The Hit Squad) - 1984 + 1989 The Hit Squad @@ -13483,7 +13501,7 @@ Expects you to press a key after the title screen appears, or it will miss the n Head Over Heels (The Hit Squad) - 1987 + 1990 The Hit Squad @@ -24324,8 +24342,8 @@ Side B: Laser Shoot (original release) R-Type (The Hit Squad) - 1988 - Electric Dreams Software / The Hit Squad + 1990 + The Hit Squad @@ -24340,7 +24358,7 @@ Side B: Laser Shoot (original release) R-Type (MCM) - 1988 + 1989 MCM Software @@ -24868,8 +24886,8 @@ Side B: Laser Shoot (original release) Revolution (set 2) - 19?? - <unknown> + 1986 + U.S. Gold @@ -31928,7 +31946,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 1) + Yie Ar Kung-Fu (set 1) 1985 Imagine Software @@ -31939,8 +31957,8 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 2, The Hit Squad) - 1985 + Yie Ar Kung-Fu (set 2, The Hit Squad) + 1989 The Hit Squad @@ -31950,7 +31968,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 3, Erbe, medium case) + Yie Ar Kung-Fu (set 3, Erbe, medium case) 1985 Erbe Software @@ -31972,7 +31990,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 5, The Hit Squad) + Yie Ar Kung-Fu (set 5, The Hit Squad) 1985 The Hit Squad @@ -31983,7 +32001,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu (set 6) + Yie Ar Kung-Fu (set 6) 1985 Imagine Software @@ -31994,7 +32012,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu 2 (set 1) + Yie Ar Kung-Fu 2 (set 1) 1986 Imagine Software @@ -32005,7 +32023,7 @@ Side B: Laser Shoot (original release) - Yie Ar Kung Fu 2 (set 2) + Yie Ar Kung-Fu 2 (set 2) 1986 Imagine Software @@ -48597,17 +48615,6 @@ Side B: Once Upon a Lily Pad - - Astronomy (Skysoft) - 19?? - <unknown> - - - - - - - Astronomy 19?? @@ -48624,6 +48631,17 @@ Side B: Once Upon a Lily Pad + + Astronomy Compilation (Skysoft) + 1985 + Skysoft + + + + + + + Astronut 1984 @@ -50772,9 +50790,10 @@ Side B: Once Upon a Lily Pad - Base De Datos (set 2) (Gem 01) (ABC Soft) + Base de Datos (set 2) (Gem 01) (ABC Soft) 1982 ABC Soft + @@ -50782,10 +50801,11 @@ Side B: Once Upon a Lily Pad - - Base De Datos - 19?? - <unknown> + + Base de Datos + 1986 + Inverstronica + @@ -53402,20 +53422,20 @@ Side B: Once Upon a Lily Pad - Bog of Brit (Zenobi) + Bog of Brit 1990 - Zenobi Software + Stormbringer Software - - + + - Bog of Brit (set 2) - 19?? - <unknown> + Bog of Brit (alt) + 1990 + Stormbringer Software @@ -53424,12 +53444,12 @@ Side B: Once Upon a Lily Pad - Bog of Brit - 19?? - <unknown> + Bog of Brit (Zenobi) + 1990 + Zenobi Software - - + + @@ -53446,9 +53466,9 @@ Side B: Once Upon a Lily Pad - Boiler House - 19?? - <unknown> + Boilerhouse + 1984 + Andromeda Software @@ -67753,6 +67773,19 @@ Side B: Once Upon a Lily Pad + + Destronado + 1988 + Conrado Badenas Mengod + + + + + + + + + Destroyer (release 1) 1983 @@ -102365,7 +102398,6 @@ Lacks game introduction, bad dump or alternate version? - Mad Martha II (release 2) 1983 @@ -102377,7 +102409,6 @@ Lacks game introduction, bad dump or alternate version? - Mad Martha II (release 1) 1983 @@ -106844,10 +106875,11 @@ Nothing happens after loading the cassette - + Microchess (Investronica) 1984 Investronica + @@ -107195,6 +107227,18 @@ Nothing happens after loading the cassette + + Mieyen + 2025 + Inufuto + + + + + + + + Mig Busters 1990 @@ -125252,20 +125296,9 @@ Game 4 - Char-Wallah - Rigel's Revenge (Bulldog) - 1987 - Bulldog - - - - - - - - Rigel's Revenge - 19?? - <unknown> + 1987 + Bulldog Software @@ -125278,6 +125311,17 @@ Game 4 - Char-Wallah + + Rigel's Revenge (merged sides) + 1987 + Bulldog Software + + + + + + + Rik The Roadie 1988 @@ -125290,23 +125334,23 @@ Game 4 - Char-Wallah - Ring Quest (set 2) + Ring Quest 19?? - <unknown> + Uburrg Software - - + + - Ring Quest + Ring Quest (set 2) 19?? - <unknown> + Uburrg Software - - + + @@ -125514,23 +125558,23 @@ Game 4 - Char-Wallah - Road Frog (set 2) + Road Frog 1983 Spectrum Games - - + + - Road Frog - 19?? - <unknown> + Road Frog (alt) + 1983 + Spectrum Games - - + + @@ -127307,8 +127351,8 @@ Game 4 - Char-Wallah Run Baby Run (release 1) - 19?? - <unknown> + 1984 + Firebird Software @@ -127338,8 +127382,19 @@ Game 4 - Char-Wallah - - Run For Gold (Alternative) + + Run for Gold + 1985 + Hill MacGibbon + + + + + + + + + Run for Gold (Alternative) 1985 Alternative Software @@ -127349,13 +127404,13 @@ Game 4 - Char-Wallah - - Run For Gold - 19?? - <unknown> + + Run for Gold (System 4) + 1987 + System 4 - - + + @@ -128103,33 +128158,37 @@ Game 4 - Char-Wallah - S.T.U.N. Runner (The Hit Squad) + S.T.U.N. Runner 1990 - The Hit Squad + Domark - - + + + - - + + + - S.T.U.N. Runner - 19?? - <unknown> + S.T.U.N. Runner (The Hit Squad) + 1990 + The Hit Squad - - + + + - - + + + @@ -132392,7 +132451,7 @@ Game 4 - Char-Wallah Slap Fight (The Hit Squad) - 1987 + 1990 The Hit Squad @@ -159601,7 +159660,7 @@ Version without loading screen, maybe a pre-release - The Sports Pack (compilation) + The Sports Pack 1987 Gamestar @@ -162632,10 +162691,10 @@ Tape 1 - Side B - Game 3: Bullseye - + Balrog's Big Four 19?? - <unknown> + Zenobi Software @@ -162648,16 +162707,18 @@ Tape 1 - Side B - Game 3: Bullseye - + Balrog's Box of Delights - 19?? - <unknown> + 1996 + Zenobi Software + + @@ -165800,6 +165861,18 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) + Four Smash Hits + 1987 + Hewson Consultants + + + + + + + + + Four Smash Hits (set 2) 1987 Hewson Consultants @@ -165817,18 +165890,6 @@ Side B - Game 3: Strike Force Harrier (Mirrorsoft) - - Four Smash Hits - 1987 - Hewson Consultants - - - - - - - - Fourmost Adventures 1986 @@ -174523,26 +174584,30 @@ Tape 2 - Side A: Spy vs Spy III: Arctic Antics (Databyte) - - Stars On The 128 + + Stars on the 128K 1986 Ocean + + + + From 7632b9fdd277b477a4e615fc3bb690bb530e117c Mon Sep 17 00:00:00 2001 From: holub Date: Wed, 26 Feb 2025 07:26:44 -0500 Subject: [PATCH 031/272] sinclair/sprinter.cpp: Use an input merger to combine IRQ sources. (#13409) --- src/mame/sinclair/sprinter.cpp | 39 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/mame/sinclair/sprinter.cpp b/src/mame/sinclair/sprinter.cpp index 6170cbc7d5f71..ed05bde474aaa 100644 --- a/src/mame/sinclair/sprinter.cpp +++ b/src/mame/sinclair/sprinter.cpp @@ -49,6 +49,7 @@ Sprinter Sp2000 (Peters Plus Ltd) #include "bus/spectrum/zxbus.h" #include "cpu/z80/z84c015.h" #include "machine/ds128x.h" +#include "machine/input_merger.h" #include "sound/ay8910.h" #include "sound/dac.h" @@ -80,6 +81,7 @@ class sprinter_state : public spectrum_128_state : spectrum_128_state(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_isa(*this, "isa%u", 0U) + , m_irqs(*this, "irqs") , m_rtc(*this, "rtc") , m_ata(*this, "ata%u", 1U) , m_beta(*this, BETA_DISK_TAG) @@ -207,6 +209,7 @@ class sprinter_state : public spectrum_128_state u8 kbd_fe_r(offs_t offset); void on_kbd_data(int state); + required_device m_irqs; required_device m_rtc; required_device_array m_ata; required_device m_beta; @@ -295,7 +298,6 @@ class sprinter_state : public spectrum_128_state bool m_cbl_wae; emu_timer *m_cbl_timer = nullptr; emu_timer *m_acc_timer = nullptr; - bool m_hold_irq; }; void sprinter_state::update_memory() @@ -788,8 +790,7 @@ void sprinter_state::dcp_w(offs_t offset, u8 data) else { rate = attotime::never; - if (m_hold_irq) - m_irq_off_timer->adjust(attotime::zero); + m_irqs->in_clear<2>(); } m_cbl_timer->adjust(rate, 0, rate); break; @@ -1457,7 +1458,6 @@ void sprinter_state::machine_start() save_item(NAME(m_cbl_cnt)); save_item(NAME(m_cbl_wa)); save_item(NAME(m_cbl_wae)); - save_item(NAME(m_hold_irq)); m_beta->enable(); @@ -1517,7 +1517,6 @@ void sprinter_state::machine_reset() m_cbl_xx = 0; m_cbl_wa = 0; - m_hold_irq = 0; m_ata_selected = 0; @@ -1644,7 +1643,10 @@ void sprinter_state::on_kbd_data(int state) m_kbd_data_cnt++; m_kbd_data_cnt %= 11; if (!m_kbd_data_cnt) - irq_on(0); + { + m_irqs->in_set<1>(); + m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); + } } } @@ -1660,20 +1662,17 @@ void sprinter_state::do_mem_wait(u8 cpu_taken = 0) TIMER_CALLBACK_MEMBER(sprinter_state::irq_on) { - if (!m_hold_irq) - { - m_joy1_ctrl = m_joy2_ctrl = 0; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); - m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); - } + m_irqs->in_set<0>(); + m_irq_off_timer->adjust(attotime::from_ticks(32, m_maincpu->unscaled_clock())); + + m_joy1_ctrl = m_joy2_ctrl = 0; update_int(false); } TIMER_CALLBACK_MEMBER(sprinter_state::irq_off) { - m_irq_off_timer->reset(); // in case it's called from INT Ack, not by timer itself - m_hold_irq = 0; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); + m_irqs->in_clear<0>(); // screen + m_irqs->in_clear<1>(); // keyboard } TIMER_CALLBACK_MEMBER(sprinter_state::cbl_tick) @@ -1691,9 +1690,7 @@ TIMER_CALLBACK_MEMBER(sprinter_state::cbl_tick) if (cbl_int_ena() && !(m_cbl_cnt & 0x7f)) { m_cbl_wa = m_cbl_cnt ^ 0x80; - m_hold_irq = 1; - m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); - m_irq_off_timer->reset(); + m_irqs->in_set<2>(); } } @@ -1883,13 +1880,17 @@ void sprinter_state::sprinter(machine_config &config) m_ram->set_default_size("64M"); + INPUT_MERGER_ANY_HIGH(config, m_irqs).output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ0); + Z84C015(config.replace(), m_maincpu, X_SP / 12); // 3.5MHz default m_maincpu->set_m1_map(&sprinter_state::map_fetch); m_maincpu->set_memory_map(&sprinter_state::map_mem); m_maincpu->set_io_map(&sprinter_state::map_io); m_maincpu->nomreq_cb().set_nop(); m_maincpu->set_irq_acknowledge_callback(NAME([](device_t &, int){ return 0xff; })); - m_maincpu->irqack_cb().set(FUNC(sprinter_state::irq_off)); + m_maincpu->irqack_cb().set(m_irqs, FUNC(input_merger_any_high_device::in_clear<2>)); + m_maincpu->irqack_cb().append(m_irqs, FUNC(input_merger_any_high_device::in_clear<1>)); + m_maincpu->irqack_cb().append(m_irqs, FUNC(input_merger_any_high_device::in_clear<0>)); DS12885(config, m_rtc, XTAL(32'768)); // should be DS12887A ATA_INTERFACE(config, m_ata[0]).options(sprinter_ata_devices, "hdd", "hdd", false); From ce0229070325f6fd8378ef5982e69c747b368df4 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 26 Feb 2025 21:32:57 +0900 Subject: [PATCH 032/272] zpa/iq151.cpp: Cleaned up ROM mapping. (#13415) * Use a memory view to switch in the boot ROM, and reduced ROM region size to actual ROM size. * Reduced run-time tag lookups and added notes. --- src/mame/zpa/iq151.cpp | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/mame/zpa/iq151.cpp b/src/mame/zpa/iq151.cpp index 89b8b7d38fd24..e11fe53ed5c9b 100644 --- a/src/mame/zpa/iq151.cpp +++ b/src/mame/zpa/iq151.cpp @@ -81,7 +81,7 @@ class iq151_state : public driver_device , m_speaker(*this, "speaker") , m_cassette(*this, "cassette") , m_carts(*this, "slot%u", 1U) - , m_boot_bank(*this, "boot") + , m_boot_view(*this, "boot_view") , m_keyboard(*this, "X%X", 0U) { } @@ -113,8 +113,8 @@ class iq151_state : public driver_device required_device m_speaker; required_device m_cassette; required_device_array m_carts; - required_memory_bank m_boot_bank; - required_ioport_array<8> m_keyboard; + memory_view m_boot_view; + required_ioport_array<9> m_keyboard; uint8_t m_vblank_irq_state; uint8_t m_cassette_clk; @@ -159,7 +159,7 @@ uint8_t iq151_state::ppi_portc_r() else { // kb read - data = ioport("X8")->read(); + data = m_keyboard[8]->read(); } return (data & 0xf0) | (m_cassette_data & 0x0f); @@ -174,7 +174,10 @@ void iq151_state::ppi_portc_w(uint8_t data) void iq151_state::boot_bank_w(uint8_t data) { - m_boot_bank->set_entry(data & 1); + if (BIT(data, 0)) + m_boot_view.disable(); + else + m_boot_view.select(0); } @@ -219,9 +222,11 @@ void iq151_state::iq151_mem(address_map &map) map.unmap_value_high(); map(0x0000, 0xffff).rw(FUNC(iq151_state::cartslot_r), FUNC(iq151_state::cartslot_w)); - map(0x0000, 0x07ff).bankrw("boot"); - map(0x0800, 0x7fff).ram(); - map(0xf000, 0xffff).rom(); + map(0x0000, 0x7fff).ram(); + map(0x0000, 0x07ff).view(m_boot_view); + m_boot_view[0](0x0000, 0x07ff).rom().region("maincpu", 0x0800); + //m_boot_view[0](0x0000, 0x07ff).nopw(); // TODO: write ignored when boot ROM is selected? + map(0xf000, 0xffff).rom().region("maincpu", 0x0000); } void iq151_state::iq151_io(address_map &map) @@ -349,14 +354,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer) void iq151_state::machine_start() { - uint8_t *RAM = memregion("maincpu")->base(); - m_boot_bank->configure_entry(0, RAM + 0xf800); - m_boot_bank->configure_entry(1, RAM + 0x0000); } void iq151_state::machine_reset() { - m_boot_bank->set_entry(0); + m_boot_view.select(0); m_vblank_irq_state = 0; } @@ -472,16 +474,16 @@ void iq151_state::iq151(machine_config &config) /* ROM definition */ ROM_START( iq151 ) - ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE ) + ROM_REGION( 0x1000, "maincpu", ROMREGION_ERASE ) /* A number of bios versions here. The load address is shown for each */ ROM_SYSTEM_BIOS( 0, "orig", "Original" ) - ROMX_LOAD( "iq151_monitor_orig.rom", 0xf000, 0x1000, CRC(acd10268) SHA1(4d75c73f155ed4dc2ac51a9c22232f869cca95e2), ROM_BIOS(0)) + ROMX_LOAD( "iq151_monitor_orig.rom", 0x0000, 0x1000, CRC(acd10268) SHA1(4d75c73f155ed4dc2ac51a9c22232f869cca95e2), ROM_BIOS(0)) ROM_SYSTEM_BIOS( 1, "disasm", "Disassembler" ) - ROMX_LOAD( "iq151_monitor_disasm.rom", 0xf000, 0x1000, CRC(45c2174e) SHA1(703e3271a124c3ef9330ae399308afd903316ab9), ROM_BIOS(1)) + ROMX_LOAD( "iq151_monitor_disasm.rom", 0x0000, 0x1000, CRC(45c2174e) SHA1(703e3271a124c3ef9330ae399308afd903316ab9), ROM_BIOS(1)) ROM_SYSTEM_BIOS( 2, "cpm", "CPM" ) - ROMX_LOAD( "iq151_monitor_cpm.rom", 0xf000, 0x1000, CRC(26f57013) SHA1(4df396edc375dd2dd3c82c4d2affb4f5451066f1), ROM_BIOS(2)) + ROMX_LOAD( "iq151_monitor_cpm.rom", 0x0000, 0x1000, CRC(26f57013) SHA1(4df396edc375dd2dd3c82c4d2affb4f5451066f1), ROM_BIOS(2)) ROM_SYSTEM_BIOS( 3, "cpmold", "CPM (old)" ) - ROMX_LOAD( "iq151_monitor_cpm_old.rom", 0xf000, 0x1000, CRC(6743e1b7) SHA1(ae4f3b1ba2511a1f91c4e8afdfc0e5aeb0fb3a42), ROM_BIOS(3)) + ROMX_LOAD( "iq151_monitor_cpm_old.rom", 0x0000, 0x1000, CRC(6743e1b7) SHA1(ae4f3b1ba2511a1f91c4e8afdfc0e5aeb0fb3a42), ROM_BIOS(3)) ROM_END } // anonymous namespace From 098be490ce0e1a60286bcdf888b9970e0e88b08e Mon Sep 17 00:00:00 2001 From: JOTEGO Date: Wed, 26 Feb 2025 13:38:52 +0100 Subject: [PATCH 033/272] taito/flstory.cpp, taito/nycaptor.cpp: Corrected sound CPU interrupt frequency. (#13408) Interrupt is generated by dividing down the output of the 8 MHz crystal oscillator. --- src/mame/taito/flstory.cpp | 7 ++++--- src/mame/taito/nycaptor.cpp | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mame/taito/flstory.cpp b/src/mame/taito/flstory.cpp index d06ff813b57b8..1d56aae90df00 100644 --- a/src/mame/taito/flstory.cpp +++ b/src/mame/taito/flstory.cpp @@ -1140,10 +1140,11 @@ void flstory_state::common(machine_config &config) Z80(config, m_maincpu, XTAL(10'733'000)/2); // verified on PCB m_maincpu->set_vblank_int("screen", FUNC(flstory_state::irq0_line_hold)); - Z80(config, m_audiocpu, XTAL(8'000'000)/2); // verified on PCB + Z80(config, m_audiocpu, 8_MHz_XTAL/2); // verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &flstory_state::sound_map); - // IRQ generated by ???, NMI generated by the main CPU - m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), attotime::from_hz(2*60)); + // IRQ generated with discrete-logic counter + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); + m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), audio_irq_period); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs config.set_maximum_quantum(attotime::from_hz(6000)); diff --git a/src/mame/taito/nycaptor.cpp b/src/mame/taito/nycaptor.cpp index f721ca0bebb16..2c20325d9b6f1 100644 --- a/src/mame/taito/nycaptor.cpp +++ b/src/mame/taito/nycaptor.cpp @@ -742,9 +742,10 @@ void nycaptor_state::nycaptor(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &nycaptor_state::nycaptor_slave_map); m_subcpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); /* IRQ generated by ??? */ - Z80(config, m_audiocpu, 8000000/2); + Z80(config, m_audiocpu, 8_MHz_XTAL/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); /* IRQ generated by ??? */ + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); /* IRQ generated with discrete logic */ TAITO68705_MCU(config, m_bmcu, 2000000); From a3f31268d22e32a9ebcfe06147a3eca0cb280d72 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 26 Feb 2025 14:35:35 +0100 Subject: [PATCH 034/272] misc: small cleanup, nycaptor: add audiocpu irq change to other drivers too --- src/mame/novag/cnchess.cpp | 14 ++---- src/mame/taito/flstory.cpp | 79 ++++++++++++++++---------------- src/mame/taito/nycaptor.cpp | 91 +++++++++++++++++++------------------ src/mame/tecmo/tehkanwc.cpp | 16 +++---- 4 files changed, 98 insertions(+), 102 deletions(-) diff --git a/src/mame/novag/cnchess.cpp b/src/mame/novag/cnchess.cpp index d4b6ac00ff7e8..80f64c50b1cad 100644 --- a/src/mame/novag/cnchess.cpp +++ b/src/mame/novag/cnchess.cpp @@ -89,15 +89,11 @@ void cnchess_state::machine_start() void cnchess_state::init_board(u8 data) { // 1st row - m_board->write_piece(0, 0, 3); - m_board->write_piece(0, 8, 3); - m_board->write_piece(0, 1, 4); - m_board->write_piece(0, 7, 4); - m_board->write_piece(0, 2, 5); - m_board->write_piece(0, 6, 5); - m_board->write_piece(0, 3, 6); - m_board->write_piece(0, 5, 6); - m_board->write_piece(0, 4, 7); + for (int i = 0; i < 5; i++) + { + m_board->write_piece(0, i, 3 + i); + m_board->write_piece(0, 8 - i, 3 + i); + } // cannons m_board->write_piece(2, 1, 2); diff --git a/src/mame/taito/flstory.cpp b/src/mame/taito/flstory.cpp index 1d56aae90df00..aaf036d99b003 100644 --- a/src/mame/taito/flstory.cpp +++ b/src/mame/taito/flstory.cpp @@ -7,7 +7,8 @@ added Victorious Nine by BUT TODO: - - TA7630 emulation needs filter support (bass sounds from MSM5232 should be about 2 times louder) + - TA7630 emulation needs filter support (bass sounds from MSM5232 should + be about 2 times louder) ***************************************************************************/ @@ -132,8 +133,6 @@ class flstory_mcu_state : public flstory_state void onna34ro_mcu(machine_config &config) ATTR_COLD; private: - // memory pointers - // devices required_device m_bmcu; @@ -536,7 +535,7 @@ void flstory_mcu_state::rumba_map(address_map &map) void flstory_state::sound_control_0_w(uint8_t data) { m_snd_ctrl0 = data & 0xff; - // popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); + //popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); // this definitely controls main melody voice on 2'-1 and 4'-1 outputs for(int i=0;i<4;i++) @@ -550,14 +549,14 @@ void flstory_state::sound_control_0_w(uint8_t data) void flstory_state::sound_control_1_w(uint8_t data) { m_snd_ctrl1 = data & 0xff; - // popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); + //popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", m_snd_ctrl0, m_snd_ctrl1, m_snd_ctrl2, m_snd_ctrl3); for(int i=0;i<4;i++) m_ta7630->set_channel_volume(m_msm,i+4,m_snd_ctrl1 >> 4); -// m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ -// m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(4, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(5, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(6, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ + //m_msm->set_output_gain(7, m_vol_ctrl[(m_snd_ctrl1 >> 4) & 15] / 100.0); /* group2 from msm5232 */ } void flstory_state::sound_control_2_w(uint8_t data) @@ -593,8 +592,6 @@ void flstory_state::sound_map(address_map &map) } - - /* When "Debug Mode" DIP Switch is ON, keep IPT_SERVICE1 ('9') pressed to freeze the game. Once the game is frozen, you can press IPT_START1 ('5') to advance 1 frame, or IPT_START2 ('6') to advance 6 frames. @@ -1123,8 +1120,8 @@ void flstory_state::machine_reset() { // video m_gfxctrl = 0; -// onna34ro doesn't set this up when checking RAM/VRAM (available by keeping pressed service button at startup) -// so we invert the logic here + // onna34ro doesn't set this up when checking RAM/VRAM (available by keeping pressed service button at startup) + // so we invert the logic here m_char_bank = 1; m_palette_bank = 0; @@ -1137,13 +1134,14 @@ void flstory_state::machine_reset() void flstory_state::common(machine_config &config) { - Z80(config, m_maincpu, XTAL(10'733'000)/2); // verified on PCB + Z80(config, m_maincpu, 10.733_MHz_XTAL / 2); // verified on PCB m_maincpu->set_vblank_int("screen", FUNC(flstory_state::irq0_line_hold)); - Z80(config, m_audiocpu, 8_MHz_XTAL/2); // verified on PCB + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); // verified on PCB m_audiocpu->set_addrmap(AS_PROGRAM, &flstory_state::sound_map); + // IRQ generated with discrete-logic counter - const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); // ~122Hz m_audiocpu->set_periodic_int(FUNC(flstory_state::irq0_line_hold), audio_irq_period); // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs @@ -1151,8 +1149,7 @@ void flstory_state::common(machine_config &config) // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - // derived from ladyfrog.cpp, guess - screen.set_raw(XTAL(8'000'000), 510, 0, 256, 262, 2*8, 30*8); // pixel clock appears to run at 8 MHz + screen.set_raw(8_MHz_XTAL, 510, 0, 256, 262, 2*8, 30*8); // derived from ladyfrog.cpp, guess screen.set_screen_update(FUNC(flstory_state::screen_update_flstory)); screen.set_palette(m_palette); @@ -1170,21 +1167,21 @@ void flstory_state::common(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch2); TA7630(config, m_ta7630); - YM2149(config, m_ay, XTAL(8'000'000)/4); // verified on PCB + YM2149(config, m_ay, 8_MHz_XTAL / 4); // verified on PCB m_ay->port_a_write_callback().set(FUNC(flstory_state::sound_control_2_w)); m_ay->port_b_write_callback().set(FUNC(flstory_state::sound_control_3_w)); m_ay->add_route(ALL_OUTPUTS, "speaker", 0.1); - MSM5232(config, m_msm, XTAL(8'000'000)/4); // verified on PCB - m_msm->set_capacitors(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6); /* 1.0 uF capacitors (verified on real PCB) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + MSM5232(config, m_msm, 8_MHz_XTAL / 4); // verified on PCB + m_msm->set_capacitors(1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6, 1.0e-6); // 1.0 uF capacitors (verified on real PCB) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -1198,7 +1195,7 @@ void flstory_mcu_state::flstory(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::flstory_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // verified on PCB + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // verified on PCB MCFG_VIDEO_START_OVERRIDE(flstory_mcu_state,flstory) } @@ -1217,7 +1214,7 @@ void flstory_mcu_state::onna34ro_mcu(machine_config &config) onna34ro(config); m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::onna34ro_mcu_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // ? + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // ? } void flstory_mcu_state::victnine(machine_config &config) @@ -1225,10 +1222,10 @@ void flstory_mcu_state::victnine(machine_config &config) common(config); // basic machine hardware - m_maincpu->set_clock(XTAL(8'000'000)/2); // 4 MHz + m_maincpu->set_clock(8_MHz_XTAL / 2); // 4 MHz m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::victnine_map); - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // video hardware subdevice("screen")->set_screen_update(FUNC(flstory_mcu_state::screen_update_victnine)); @@ -1245,9 +1242,9 @@ void flstory_mcu_state::rumba(machine_config &config) // basic machine hardware m_maincpu->set_addrmap(AS_PROGRAM, &flstory_mcu_state::rumba_map); - m_maincpu->set_clock(XTAL(8'000'000) / 2); // verified on PCB + m_maincpu->set_clock(8_MHz_XTAL / 2); // verified on PCB - TAITO68705_MCU(config, m_bmcu, XTAL(18'432'000)/6); // ? + TAITO68705_MCU(config, m_bmcu, 18.432_MHz_XTAL / 6); // ? // video hardware subdevice("screen")->set_screen_update(FUNC(flstory_mcu_state::screen_update_rumba)); @@ -1548,9 +1545,9 @@ ROM_END } // anonymous namespace -GAME( 1985, flstory, 0, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, flstoryo, flstory, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story (earlier)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, onna34ro, 0, onna34ro_mcu, onna34ro, flstory_mcu_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1985, onna34roa, onna34ro, onna34ro, onna34ro, flstory_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, victnine, 0, victnine, victnine, flstory_mcu_state, empty_init, ROT0, "Taito", "Victorious Nine", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1984, rumba, 0, rumba, rumba, flstory_mcu_state, empty_init, ROT270, "Taito", "Rumba Lumber (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, flstory, 0, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, flstoryo, flstory, flstory, flstory, flstory_mcu_state, empty_init, ROT180, "Taito", "The FairyLand Story (earlier)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, onna34ro, 0, onna34ro_mcu, onna34ro, flstory_mcu_state, empty_init, ROT0, "Taito", "Onna Sanshirou - Typhoon Gal (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, onna34roa, onna34ro, onna34ro, onna34ro, flstory_state, empty_init, ROT0, "bootleg", "Onna Sanshirou - Typhoon Gal (bootleg)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, victnine, 0, victnine, victnine, flstory_mcu_state, empty_init, ROT0, "Taito", "Victorious Nine", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1984, rumba, 0, rumba, rumba, flstory_mcu_state, empty_init, ROT270, "Taito", "Rumba Lumber (rev 1)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/taito/nycaptor.cpp b/src/mame/taito/nycaptor.cpp index 2c20325d9b6f1..37277a4bd9c5e 100644 --- a/src/mame/taito/nycaptor.cpp +++ b/src/mame/taito/nycaptor.cpp @@ -705,7 +705,6 @@ GFXDECODE_END - void nycaptor_state::machine_start() { if (m_gametype == 0) @@ -722,8 +721,6 @@ void nycaptor_state::machine_start() void nycaptor_state::machine_reset() { -// MACHINE_RESET_CALL_MEMBER(ta7630); - m_generic_control_reg = 0; m_char_bank = 0; @@ -734,22 +731,24 @@ void nycaptor_state::machine_reset() void nycaptor_state::nycaptor(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 8000000/2); /* ??? */ + Z80(config, m_maincpu, 8000000/2); /* ??? */ m_maincpu->set_addrmap(AS_PROGRAM, &nycaptor_state::nycaptor_master_map); m_maincpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); Z80(config, m_subcpu, 8000000/2); m_subcpu->set_addrmap(AS_PROGRAM, &nycaptor_state::nycaptor_slave_map); - m_subcpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); /* IRQ generated by ??? */ + m_subcpu->set_vblank_int("screen", FUNC(nycaptor_state::irq0_line_hold)); /* IRQ generated by ??? */ - Z80(config, m_audiocpu, 8_MHz_XTAL/2); + Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - const attotime audio_irq_period = attotime::from_ticks(0x10000, 8_MHz_XTAL); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); /* IRQ generated with discrete logic */ + + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); TAITO68705_MCU(config, m_bmcu, 2000000); - config.set_maximum_quantum(attotime::from_hz(6000)); /* 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs */ + // 100 CPU slices per frame - a high value to ensure proper synchronization of the CPUs + config.set_maximum_quantum(attotime::from_hz(6000)); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -783,15 +782,15 @@ void nycaptor_state::nycaptor(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -812,13 +811,15 @@ void nycaptor_state::cyclshtg(machine_config &config) Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); + + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); #ifdef USE_MCU TAITO68705_MCU(config, m_bmcu, 2000000); #endif - config.set_maximum_quantum(attotime::from_hz(60)); + config.set_maximum_quantum(attotime::from_hz(6000)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); @@ -850,15 +851,15 @@ void nycaptor_state::cyclshtg(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -880,9 +881,11 @@ void nycaptor_state::bronx(machine_config &config) Z80(config, m_audiocpu, 8000000/2); m_audiocpu->set_addrmap(AS_PROGRAM, &nycaptor_state::sound_map); - m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), attotime::from_hz(2*60)); - config.set_maximum_quantum(attotime::from_hz(120)); + const attotime audio_irq_period = attotime::from_ticks(0x10000, 8000000); // ~122Hz + m_audiocpu->set_periodic_int(FUNC(nycaptor_state::irq0_line_hold), audio_irq_period); + + config.set_maximum_quantum(attotime::from_hz(6000)); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); @@ -914,15 +917,15 @@ void nycaptor_state::bronx(machine_config &config) ay2.add_route(ALL_OUTPUTS, "speaker", 0.15); MSM5232(config, m_msm, 2000000); - m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); /* 1 uF capacitors (match the sample, not verified, standard) */ - m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 - m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 - m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 - m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 - m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 - m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 - m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 - m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 + m_msm->set_capacitors(1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6, 1e-6); // 1 uF capacitors (match the sample, not verified, standard) + m_msm->add_route(0, "speaker", 1.0); // pin 28 2'-1 + m_msm->add_route(1, "speaker", 1.0); // pin 29 4'-1 + m_msm->add_route(2, "speaker", 1.0); // pin 30 8'-1 + m_msm->add_route(3, "speaker", 1.0); // pin 31 16'-1 + m_msm->add_route(4, "speaker", 1.0); // pin 36 2'-2 + m_msm->add_route(5, "speaker", 1.0); // pin 35 4'-2 + m_msm->add_route(6, "speaker", 1.0); // pin 34 8'-2 + m_msm->add_route(7, "speaker", 1.0); // pin 33 16'-2 // pin 1 SOLO 8' not mapped // pin 2 SOLO 16' not mapped // pin 22 Noise Output not mapped @@ -1293,8 +1296,8 @@ void nycaptor_state::init_colt() m_gametype = 2; } -GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor_state, init_nycaptor, ROT0, "Taito", "N.Y. Captor (rev 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, colt, nycaptor, bronx, colt, nycaptor_state, init_colt, ROT0, "bootleg", "Colt", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1985, nycaptor, 0, nycaptor, nycaptor, nycaptor_state, init_nycaptor, ROT0, "Taito", "N.Y. Captor (rev 2)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, colt, nycaptor, bronx, colt, nycaptor_state, init_colt, ROT0, "bootleg", "Colt (bootleg of N.Y. Captor)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, nycaptor_state, init_cyclshtg, ROT90, "Taito", "Cycle Shooting", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1986, bronx, cyclshtg, bronx, bronx, nycaptor_state, init_bronx, ROT90, "bootleg", "Bronx", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, cyclshtg, 0, cyclshtg, cyclshtg, nycaptor_state, init_cyclshtg, ROT90, "Taito", "Cycle Shooting", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) +GAME( 1986, bronx, cyclshtg, bronx, bronx, nycaptor_state, init_bronx, ROT90, "bootleg", "Bronx (bootleg of Cycle Shooting)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/tecmo/tehkanwc.cpp b/src/mame/tecmo/tehkanwc.cpp index 44b9ebe8a9adf..2b1d543a7d1b2 100644 --- a/src/mame/tecmo/tehkanwc.cpp +++ b/src/mame/tecmo/tehkanwc.cpp @@ -801,20 +801,20 @@ GFXDECODE_END void tehkanwc_state::tehkanwc(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 18432000/4); /* 18.432000 / 4 */ + Z80(config, m_maincpu, 18.432_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::main_mem); m_maincpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - Z80(config, m_subcpu, 18432000/4); + Z80(config, m_subcpu, 18.432_MHz_XTAL / 4); m_subcpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::sub_mem); m_subcpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - Z80(config, m_audiocpu, 18432000/4); + Z80(config, m_audiocpu, 18.432_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &tehkanwc_state::sound_mem); m_audiocpu->set_addrmap(AS_IO, &tehkanwc_state::sound_port); m_audiocpu->set_vblank_int("screen", FUNC(tehkanwc_state::irq0_line_hold)); - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - seems enough to keep the CPUs in sync */ + config.set_maximum_quantum(attotime::from_hz(600)); // 10 CPU slices per frame - seems enough to keep the CPUs in sync WATCHDOG_TIMER(config, "watchdog"); @@ -833,12 +833,12 @@ void tehkanwc_state::tehkanwc(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); GENERIC_LATCH_8(config, m_soundlatch2); - ym2149_device &ay1(YM2149(config, "ay1", 18432000/12)); + ym2149_device &ay1(YM2149(config, "ay1", 18.432_MHz_XTAL / 12)); ay1.port_a_write_callback().set(FUNC(tehkanwc_state::portA_w)); ay1.port_b_write_callback().set(FUNC(tehkanwc_state::portB_w)); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ym2149_device &ay2(YM2149(config, "ay2", 18432000/12)); + ym2149_device &ay2(YM2149(config, "ay2", 18.432_MHz_XTAL / 12)); ay2.port_a_read_callback().set(FUNC(tehkanwc_state::portA_r)); ay2.port_b_read_callback().set(FUNC(tehkanwc_state::portB_r)); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); @@ -852,12 +852,12 @@ void tehkanwc_state::tehkanwc(machine_config &config) void tehkanwc_state::tehkanwcb(machine_config &config) { tehkanwc(config); - ay8910_device &ay1(AY8910(config.replace(), "ay1", 18432000/12)); + ay8910_device &ay1(AY8910(config.replace(), "ay1", 18.432_MHz_XTAL / 12)); ay1.port_a_write_callback().set(FUNC(tehkanwc_state::portA_w)); ay1.port_b_write_callback().set(FUNC(tehkanwc_state::portB_w)); ay1.add_route(ALL_OUTPUTS, "mono", 0.25); - ay8910_device &ay2(AY8910(config.replace(), "ay2", 18432000/12)); + ay8910_device &ay2(AY8910(config.replace(), "ay2", 18.432_MHz_XTAL / 12)); ay2.port_a_read_callback().set(FUNC(tehkanwc_state::portA_r)); ay2.port_b_read_callback().set(FUNC(tehkanwc_state::portB_r)); ay2.add_route(ALL_OUTPUTS, "mono", 0.25); From e6989d494ad1242ec5731cdaa3ee17810e70dd64 Mon Sep 17 00:00:00 2001 From: goldnchild <48141308+goldnchild@users.noreply.github.com> Date: Wed, 26 Feb 2025 08:29:17 -0800 Subject: [PATCH 035/272] bus/sg1000_exp/sp400.cpp: Added a skeleton device for the SP-400 plotter (#13410) [Fabio Dalla Libera, Golden Child] --- scripts/src/bus.lua | 10 +- src/devices/bus/sg1000_exp/sk1100prn.cpp | 4 +- src/devices/bus/sg1000_exp/sp400.cpp | 233 +++++++++++++++++++++++ src/devices/bus/sg1000_exp/sp400.h | 13 ++ 4 files changed, 254 insertions(+), 6 deletions(-) create mode 100644 src/devices/bus/sg1000_exp/sp400.cpp create mode 100644 src/devices/bus/sg1000_exp/sp400.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 5c4273ea5932b..19bea08274076 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3928,16 +3928,18 @@ end if (BUSES["SG1000_EXP"]~=null) then files { - MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.cpp", - MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.h", MAME_DIR .. "src/devices/bus/sg1000_exp/fm_unit.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/fm_unit.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/sg1000exp.h", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100.h", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100prn.cpp", MAME_DIR .. "src/devices/bus/sg1000_exp/sk1100prn.h", - MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.cpp", - MAME_DIR .. "src/devices/bus/sg1000_exp/kblink.h", + MAME_DIR .. "src/devices/bus/sg1000_exp/sp400.cpp", + MAME_DIR .. "src/devices/bus/sg1000_exp/sp400.h", } end diff --git a/src/devices/bus/sg1000_exp/sk1100prn.cpp b/src/devices/bus/sg1000_exp/sk1100prn.cpp index 2b24864d75ba6..24d5808c229ba 100644 --- a/src/devices/bus/sg1000_exp/sk1100prn.cpp +++ b/src/devices/bus/sg1000_exp/sk1100prn.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "sk1100prn.h" // slot devices -//#include "sp400.h" +#include "sp400.h" #include "kblink.h" @@ -120,6 +120,6 @@ int sk1100_printer_port_device::busy_r() void sk1100_printer_port_devices(device_slot_interface &device) { - //device.option_add("sp400", SP400_PRINTER); /* serial printer */ + device.option_add("sp400", SP400_PRINTER); /* serial printer */ device.option_add("kblink", SK1100_LINK_CABLE); } diff --git a/src/devices/bus/sg1000_exp/sp400.cpp b/src/devices/bus/sg1000_exp/sp400.cpp new file mode 100644 index 0000000000000..fce22cf7d511b --- /dev/null +++ b/src/devices/bus/sg1000_exp/sp400.cpp @@ -0,0 +1,233 @@ +// license: BSD-3-Clause +// copyright-holders: Fabio Dalla Libera + +/* + Sega SP-400 Plotter + + 6805 dumped using https://github.com/charlesmacd/HD6805_Reader + + Plotter uses ALPS Micrographic Printer DPG 1302 mechanism. + + IC list: + + * M5L8035LP (Mitsubishi clone of I8035) + + P1 is the deserialized output data + P2.4 is the input serial data + P2.5 is busy (output to the computer) + P2.6 is the output strobe + P2.7 is busy (input from the 6805) + + * HD6805V (Hitachi chip, pin compatible with MC6805P2, with 4K of ROM) + + port A connected to the panel buttons + "By analyzing the disassembly I found out that three pins (PA5,6,7 of the 6805) are used to set + different configurations. The resolution can be changed, probably to support different mechanics. + The baud rate is 4800." + port B connected to the motors + port C connected to the pen and misc signals + port D connected to M5L8035LP parallel data +*/ + +// this is currently incomplete: missing paper output and pen sensor, everything else is working + +#include "emu.h" +#include "sp400.h" + +#include "cpu/m6805/m68705.h" +#include "cpu/mcs48/mcs48.h" + + +namespace { + +class sp400_printer_device : public device_t, public device_sk1100_printer_port_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::PRINTER; } + + sp400_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual void device_start() override ATTR_COLD; + + const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + + virtual void input_data(int state) override { m_data = state; } + virtual int output_busy() override { return m_busy; } + +private: + void dser_map(address_map &map); + void dser_p1_w(uint8_t data); + uint8_t dser_p2_r(); + void dser_p2_w(uint8_t data); + + uint8_t mot_pa_r(); + void mot_pb_w(uint8_t data); + uint8_t mot_pc_r(); + void mot_pc_w(uint8_t data); + uint8_t mot_pd_r(); + void update_pen_state(uint8_t data); + uint8_t pen_sensor() { return 0; } // not currently hooked up + + required_device m_dsercpu; // "deserializer CPU" + required_device m_motcpu; // "motor CPU" + + uint8_t m_data, m_busy; + uint8_t m_dserdataout, m_dserstrobe; + uint8_t m_motbusy, m_motpenup, m_motpendown; + uint8_t m_pendown; + + required_ioport m_buttons; +}; + +sp400_printer_device::sp400_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, SP400_PRINTER, tag, owner, clock), + device_sk1100_printer_port_interface(mconfig, *this), + m_dsercpu(*this, "dsercpu"), + m_motcpu(*this, "motcpu"), + m_data(0), + m_busy(1), + m_dserdataout(0xff), + m_dserstrobe(1), + m_motbusy(0), + m_motpenup(1), + m_motpendown(1), + m_pendown(0), + m_buttons(*this, "BUTTONS") +{ +} + +void sp400_printer_device::device_start() +{ + save_item(NAME(m_data)); + save_item(NAME(m_busy)); + save_item(NAME(m_dserdataout)); + save_item(NAME(m_dserstrobe)); + save_item(NAME(m_motbusy)); + save_item(NAME(m_motpenup)); + save_item(NAME(m_motpendown)); + save_item(NAME(m_pendown)); +} + +void sp400_printer_device::dser_map(address_map &map) +{ + map(0x0000, 0x0fff).rom(); +} + +void sp400_printer_device::dser_p1_w(uint8_t data) +{ + m_dserdataout = data; +} + +void sp400_printer_device::dser_p2_w(uint8_t data) +{ + m_busy = BIT(data, 5); + m_dserstrobe = BIT(data, 6); + m_motcpu->set_input_line(M6805_IRQ_LINE, m_dserstrobe); +} + +uint8_t sp400_printer_device::dser_p2_r() +{ + return + (m_motbusy << 7) | + (m_dserstrobe << 6) | + (m_busy << 5) | + (m_data << 4) | + (1 << 3) | + (1 << 2) | + (1 << 1) | + (1 << 0); +} + +uint8_t sp400_printer_device::mot_pa_r() +{ + return + (0 << 0) | + (0 << 1) | + (m_buttons->read() << 2) | // bits 2..4 + (0 << 5) | + (0 << 6) | + (1 << 7); +} + +void sp400_printer_device::mot_pb_w(uint8_t data) +{ + // cr stepper data in 0..3 + // pf stepper data in 4..7 +} + +uint8_t sp400_printer_device::mot_pc_r() +{ + return + (m_motpenup << 0) | + (m_motpendown << 1) | + (1 << 2) | + (pen_sensor() << 3) | + (m_motbusy << 4) | + (1 << 5) | (1 << 6) | (1 << 7); // unconfirmed +} + +void sp400_printer_device::mot_pc_w(uint8_t data) +{ + m_motpenup = BIT(data, 0); + m_motpendown = BIT(data, 1); + m_motbusy = BIT(data, 4); + update_pen_state(data); +} + +uint8_t sp400_printer_device::mot_pd_r() +{ + return sp400_printer_device::m_dserdataout; +} + +void sp400_printer_device::update_pen_state(uint8_t data) +{ + if (!BIT(data, 0)) m_pendown = 0; + if (!BIT(data, 1)) m_pendown = 1; +} + +void sp400_printer_device::device_add_mconfig(machine_config &config) +{ + I8035(config, m_dsercpu, 4_MHz_XTAL); + m_dsercpu->p1_out_cb().set(FUNC(sp400_printer_device::dser_p1_w)); + m_dsercpu->p2_in_cb().set(FUNC(sp400_printer_device::dser_p2_r)); + m_dsercpu->p2_out_cb().set(FUNC(sp400_printer_device::dser_p2_w)); + m_dsercpu->set_addrmap(AS_PROGRAM, &sp400_printer_device::dser_map); + + M6805U3(config, m_motcpu, 4_MHz_XTAL); + m_motcpu->porta_r().set(FUNC(sp400_printer_device::mot_pa_r)); + m_motcpu->portb_w().set(FUNC(sp400_printer_device::mot_pb_w)); + m_motcpu->portc_r().set(FUNC(sp400_printer_device::mot_pc_r)); + m_motcpu->portc_w().set(FUNC(sp400_printer_device::mot_pc_w)); + m_motcpu->portd_r().set(FUNC(sp400_printer_device::mot_pd_r)); +} + +ROM_START( sp400 ) + ROM_REGION( 0x1000, "dsercpu", 0 ) + ROM_LOAD( "sp400_8035.bin", 0x0000, 0x1000, CRC(0eb48272) SHA1(08a2727f1592f5d2ecb2e368126ad7bfc5d3c270) ) + + ROM_REGION(0x1000, "motcpu", 0 ) + ROM_LOAD( "sp400_hd6805v1.bin", 0x0000, 0x1000, CRC(aa073745) SHA1(65016f3b022af30cc6b084af1e43b29168721a60) ) +ROM_END + +const tiny_rom_entry *sp400_printer_device::device_rom_region() const +{ + return ROM_NAME( sp400 ); +} + +INPUT_PORTS_START( sp400 ) + PORT_START("BUTTONS") + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Color Select") PORT_CODE(KEYCODE_2_PAD) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_1_PAD) + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYPAD) PORT_NAME("Pen Change") PORT_CODE(KEYCODE_3_PAD) +INPUT_PORTS_END + +ioport_constructor sp400_printer_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(sp400); +} + +} // anonymous namespace + +DEFINE_DEVICE_TYPE_PRIVATE(SP400_PRINTER, device_sk1100_printer_port_interface, sp400_printer_device, "sega_sp400", "Sega SP-400 Plotter") diff --git a/src/devices/bus/sg1000_exp/sp400.h b/src/devices/bus/sg1000_exp/sp400.h new file mode 100644 index 0000000000000..fa1d87c087837 --- /dev/null +++ b/src/devices/bus/sg1000_exp/sp400.h @@ -0,0 +1,13 @@ +// license: BSD-3-Clause +// copyright-holders: Fabio Dalla Libera + +#ifndef MAME_BUS_SG1000_EXP_SP400_H +#define MAME_BUS_SG1000_EXP_SP400_H + +#pragma once + +#include "sk1100prn.h" + +DECLARE_DEVICE_TYPE(SP400_PRINTER, device_sk1100_printer_port_interface) + +#endif // MAME_BUS_SG1000_EXP_SP400_H From 65c263749e1fbc24fe97a1d0fb198b4fd04023c7 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 27 Feb 2025 03:59:14 +1100 Subject: [PATCH 036/272] util/chd.cpp: Hacked around GitHub #13029 (issues creating delta CHDs). The code depends on getting away with trying to read at least one hunk past the end of the parent CHD. Previously it just ignored any errors from reading the parent CHD, but adding error checking broke it. This hack just ignores that specific error. Also cleaned up some gross flow control and made more things const. The code should obviously be fixed properly, but that's non-trivial. This gets it to a state no worse than it was in 0.270. --- src/lib/util/chd.cpp | 76 ++++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 08dcd43f9f155..9395bb39c451c 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -3047,12 +3047,11 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do while (m_read_queue_offset < m_logicalbytes && osd_work_queue_items(m_read_queue) < 2) { // see if we have enough free work items to read the next half of a buffer - uint32_t startitem = m_read_queue_offset / hunk_bytes(); - uint32_t enditem = startitem + WORK_BUFFER_HUNKS / 2; - uint32_t curitem; - for (curitem = startitem; curitem < enditem; curitem++) - if (m_work_item[curitem % WORK_BUFFER_HUNKS].m_status != WS_READY) - break; + uint32_t const startitem = m_read_queue_offset / hunk_bytes(); + uint32_t const enditem = startitem + WORK_BUFFER_HUNKS / 2; + uint32_t curitem = startitem; + while ((curitem < enditem) && (m_work_item[curitem % WORK_BUFFER_HUNKS].m_status == WS_READY)) + ++curitem; // if it's not all clear, defer if (curitem != enditem) @@ -3076,20 +3075,24 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do work_item &item = m_work_item[m_write_hunk % WORK_BUFFER_HUNKS]; // free any OSD work item - if (item.m_osd != nullptr) + if (item.m_osd) + { osd_work_item_release(item.m_osd); - item.m_osd = nullptr; + item.m_osd = nullptr; + } if (m_walking_parent) { // for parent walking, just add to the hashmap - uint32_t uph = hunk_bytes() / unit_bytes(); + uint32_t const uph = hunk_bytes() / unit_bytes(); uint32_t units = uph; if (item.m_hunknum == hunk_count() - 1 || !compressed()) units = 1; for (uint32_t unit = 0; unit < units; unit++) + { if (m_parent_map.find(item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1) == hashmap::NOT_FOUND) m_parent_map.add(item.m_hunknum * uph + unit, item.m_hash[unit].m_crc16, item.m_hash[unit].m_sha1); + } } else if (!compressed()) { @@ -3105,7 +3108,7 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do if (!err && codec == CHD_CODEC_NONE) // TODO: report error? m_total_out += m_hunkbytes; } - else do + else { // for compressing, process the result @@ -3114,25 +3117,24 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do if (selfhunk != hashmap::NOT_FOUND) { hunk_copy_from_self(item.m_hunknum, selfhunk); - break; } - - // if not, see if it's in the parent map - if (m_parent) + else { - uint64_t parentunit = m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); + // if not, see if it's in the parent map + uint64_t const parentunit = m_parent ? m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1) : hashmap::NOT_FOUND; if (parentunit != hashmap::NOT_FOUND) { hunk_copy_from_parent(item.m_hunknum, parentunit); - break; + } + else + { + // otherwise, append it compressed and add to the self map + hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); + m_total_out += item.m_complen; + m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); } } - - // otherwise, append it compressed and add to the self map - hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); - m_total_out += item.m_complen; - m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - } while (false); + } // reset the item and advance item.m_status = WS_READY; @@ -3141,19 +3143,18 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do // if we hit the end, finalize if (m_write_hunk == m_hunkcount) { - // if this is just walking the parent, reset and get ready for compression if (m_walking_parent) { + // if this is just walking the parent, reset and get ready for compression m_walking_parent = false; m_read_queue_offset = m_read_done_offset = 0; m_write_hunk = 0; - for (auto & elem : m_work_item) + for (auto &elem : m_work_item) elem.m_status = WS_READY; } - - // wait for all reads to finish and if we're compressed, write the final SHA1 and map else { + // wait for all reads to finish and if we're compressed, write the final SHA1 and map osd_work_queue_wait(m_read_queue, 30 * osd_ticks_per_second()); if (!compressed()) return std::error_condition(); @@ -3306,29 +3307,34 @@ void chd_file_compressor::async_read() return; // determine parameters for the read - uint32_t work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); + uint32_t const work_buffer_bytes = WORK_BUFFER_HUNKS * hunk_bytes(); uint32_t numbytes = work_buffer_bytes / 2; - if (m_read_done_offset + numbytes > logical_bytes()) + if ((m_read_done_offset + numbytes) > logical_bytes()) numbytes = logical_bytes() - m_read_done_offset; + uint8_t *const dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); + assert((&m_work_buffer[0] == dest) || (&m_work_buffer[work_buffer_bytes / 2] == dest)); + assert(!(m_read_done_offset % hunk_bytes())); + uint64_t const end_offset = m_read_done_offset + numbytes; + // catch any exceptions coming out of here try { // do the read - uint8_t *dest = &m_work_buffer[0] + (m_read_done_offset % work_buffer_bytes); - assert(dest == &m_work_buffer[0] || dest == &m_work_buffer[work_buffer_bytes / 2]); - uint64_t end_offset = m_read_done_offset + numbytes; - if (m_walking_parent) { // if walking the parent, read in hunks from the parent CHD + uint64_t curoffs = m_read_done_offset; uint8_t *curdest = dest; - for (uint64_t curoffs = m_read_done_offset; curoffs < end_offset + 1; curoffs += hunk_bytes()) + uint32_t curhunk = m_read_done_offset / hunk_bytes(); + while (curoffs < end_offset + 1) { - std::error_condition err = m_parent->read_hunk(curoffs / hunk_bytes(), curdest); - if (err) + std::error_condition err = m_parent->read_hunk(curhunk, curdest); + if (err && (error::HUNK_OUT_OF_RANGE != err)) // FIXME: fix the code so it doesn't depend on trying to read past the end of the parent CHD throw err; + curoffs += hunk_bytes(); curdest += hunk_bytes(); + ++curhunk; } } else From 51e4b4130bea1d1a1f0126f61fb8784c6f3b6275 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 26 Feb 2025 21:52:09 +0100 Subject: [PATCH 037/272] New systems marked not working ------------------------------ Treasure Trail (JPM) [Hammy] --- src/mame/jpm/guab.cpp | 11 +++++++- src/mame/mame.lst | 1 + src/mame/misc/39in1.cpp | 59 ++++++++++++++++++++++++++++------------- src/mame/misc/ddz.cpp | 4 +-- 4 files changed, 53 insertions(+), 22 deletions(-) diff --git a/src/mame/jpm/guab.cpp b/src/mame/jpm/guab.cpp index b1e3fe5f739c1..d43894398862c 100644 --- a/src/mame/jpm/guab.cpp +++ b/src/mame/jpm/guab.cpp @@ -10,12 +10,12 @@ * Give us a Break [8 sets] * Criss Cross (Sweden) [non-working - need disk image] * Ten Up [2 sets] + * Treasure Trail [non-working - need disk image] Looking for: * Numbers Game * Pac Quiz * Suit Pursuit - * Treasure Trail? Known issues: * Coin data has to go through the datalogger to be counted @@ -559,6 +559,14 @@ ROM_START( tenup ) ROM_LOAD16_BYTE( "tu-14.bin", 0x10001, 0x8000, CRC(fd8a0c3c) SHA1(f87289ce6f0d2bc9b7d3a0b6deff38ba3aadf391) ) ROM_END +ROM_START( ttrail ) + ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "ic49.bin", 0x00000, 0x8000, CRC(01395ff1) SHA1(69e0f0d9893c2b4edf7f2c4547bf7674ddeb10ef) ) + ROM_LOAD16_BYTE( "ic48.bin", 0x00001, 0x8000, CRC(8dfd2165) SHA1(a239258b2b9e9773f97937506e04680422c6c396) ) + ROM_LOAD16_BYTE( "ic57.bin", 0x10000, 0x8000, CRC(82775064) SHA1(17437022f76bd8faebdbcc94be8ace482a145382) ) + ROM_LOAD16_BYTE( "ic56.bin", 0x10001, 0x8000, CRC(70264d8a) SHA1(107b9eb72fd587deb1ba9821645f3ab86e6040c8) ) +ROM_END + } // anonymous namespace @@ -570,3 +578,4 @@ ROM_END GAME( 1986, guab, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Give us a Break", 0 ) GAME( 1986, crisscrs, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Criss Cross (Sweden)", MACHINE_NOT_WORKING ) GAME( 1988, tenup, 0, guab, tenup, guab_state, empty_init, ROT0, "JPM", "Ten Up", 0 ) +GAME( 198?, ttrail, 0, guab, guab, guab_state, empty_init, ROT0, "JPM", "Treasure Trail (JPM)", MACHINE_NOT_WORKING ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 10b78aa755e44..a028637a4c527 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -22228,6 +22228,7 @@ vjslap crisscrs guab tenup +ttrail @source:jpm/jpmimpct.cpp buzzundr diff --git a/src/mame/misc/39in1.cpp b/src/mame/misc/39in1.cpp index 5cf3a675500bf..c4257741d27cf 100644 --- a/src/mame/misc/39in1.cpp +++ b/src/mame/misc/39in1.cpp @@ -29,6 +29,8 @@ * from the CPLD (probably) * - 19in1, 48in1, 48in1a, 48in1b, 48in1c, 60in1 have more conditional XORs, * encryption isn't completely beaten yet + * - fruitwld, fruitwlda, jumanjia show 'HW_002 ERROR', probably missing CPLD + * emulation * * * 39in1 notes: @@ -64,18 +66,19 @@ class _39in1_state : public driver_device , m_dsw(*this, "DSW") { } - void _39in1(machine_config &config); - void base(machine_config &config); + void _39in1(machine_config &config) ATTR_COLD; + void base(machine_config &config) ATTR_COLD; + void iam(machine_config &config) ATTR_COLD; - void init_4in1a(); - void init_4in1b(); - void init_19in1(); - void init_39in1(); - void init_48in1(); - void init_48in1a(); - void init_48in1c(); - void init_60in1(); - void init_rodent(); + void init_4in1a() ATTR_COLD; + void init_4in1b() ATTR_COLD; + void init_19in1() ATTR_COLD; + void init_39in1() ATTR_COLD; + void init_48in1() ATTR_COLD; + void init_48in1a() ATTR_COLD; + void init_48in1c() ATTR_COLD; + void init_60in1() ATTR_COLD; + void init_rodent() ATTR_COLD; // I.A.M. slots void init_fruitwld(); @@ -110,9 +113,10 @@ class _39in1_state : public driver_device void _39in1_map(address_map &map) ATTR_COLD; void base_map(address_map &map) ATTR_COLD; + void iam_map(address_map &map) ATTR_COLD; - void decrypt(u8 xor00, u8 xor02, u8 xor04, u8 xor08, u8 xor10, u8 xor20, u8 xor40, u8 xor80, u8 bit7, u8 bit6, u8 bit5, u8 bit4, u8 bit3, u8 bit2, u8 bit1, u8 bit0); - void further_decrypt(u8 xor400, u8 xor800, u8 xor1000, u8 xor2000, u8 xor4000, u8 xor8000); + void decrypt(u8 xor00, u8 xor02, u8 xor04, u8 xor08, u8 xor10, u8 xor20, u8 xor40, u8 xor80, u8 bit7, u8 bit6, u8 bit5, u8 bit4, u8 bit3, u8 bit2, u8 bit1, u8 bit0) ATTR_COLD; + void further_decrypt(u8 xor400, u8 xor800, u8 xor1000, u8 xor2000, u8 xor4000, u8 xor8000) ATTR_COLD; }; void _39in1_state::machine_reset() @@ -230,6 +234,15 @@ void _39in1_state::_39in1_map(address_map &map) map(0xa0151648, 0xa015164b).r(FUNC(_39in1_state::prot_cheater_r)); } +void _39in1_state::iam_map(address_map &map) +{ + base_map(map); + + map(0x04800000, 0x04ffffff).ram(); // CPLD here? + map(0xa0800000, 0xa3ffffff).ram(); // TODO: probably not really all RAM +} + + static INPUT_PORTS_START( 39in1 ) PORT_START("MCUIPT") PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_START1 ) @@ -379,6 +392,14 @@ void _39in1_state::_39in1(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &_39in1_state::_39in1_map); } +void _39in1_state::iam(machine_config &config) +{ + base(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &_39in1_state::iam_map); +} + + ROM_START( 39in1 ) // main program, encrypted ROM_REGION( 0x80000, "maincpu", 0 ) @@ -606,9 +627,9 @@ GAME(2004, 60in1, 39in1, base, 39in1, _39in1_state, init_60in1, ROT9 GAME(2005, rodent, 0, base, 39in1, _39in1_state, init_rodent, ROT0, "The Game Room", "Rodent Exterminator", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // I.A.M. slots. Versions are taken from program ROM stickers or ROM strings, where available -GAME(2008, fruitwld, 0, base, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V111)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V111.BIN 2008-04-30 15:59:21 -GAME(2007, fruitwlda, fruitwld, base, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V110)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V110.BIN 2007-07-26 13:46:30 -GAME(2007, jumanji, 0, base, 39in1, _39in1_state, init_jumanji, ROT0, "I.A.M.", "Jumanji (V502)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // CHZ_V502.BIN 2007-07-26 13:49:35 in clear text at the end of the main CPU ROM -GAME(2007, jumanjia, jumanji, base, 39in1, _39in1_state, init_jumanjia, ROT0, "I.A.M.", "Jumanji (V113)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // JUMANJI_V113.BIN 2007-07-25 10:54:33 -GAME(200?, plutus, 0, base, 39in1, _39in1_state, init_plutus, ROT0, "I.A.M.", "Plutus (V100)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string -GAME(200?, pokrwild, 0, base, 39in1, _39in1_state, init_pokrwild, ROT0, "I.A.M.", "Poker's Wild (V117)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string +GAME(2008, fruitwld, 0, iam, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V111)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V111.BIN 2008-04-30 15:59:21 +GAME(2007, fruitwlda, fruitwld, iam, 39in1, _39in1_state, init_fruitwld, ROT0, "I.A.M.", "Fruit World (V110)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // FRUIT_V110.BIN 2007-07-26 13:46:30 +GAME(2007, jumanji, 0, iam, 39in1, _39in1_state, init_jumanji, ROT0, "I.A.M.", "Jumanji (V502)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // CHZ_V502.BIN 2007-07-26 13:49:35 in clear text at the end of the main CPU ROM +GAME(2007, jumanjia, jumanji, iam, 39in1, _39in1_state, init_jumanjia, ROT0, "I.A.M.", "Jumanji (V113)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // JUMANJI_V113.BIN 2007-07-25 10:54:33 +GAME(200?, plutus, 0, iam, 39in1, _39in1_state, init_plutus, ROT0, "I.A.M.", "Plutus (V100)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string +GAME(200?, pokrwild, 0, iam, 39in1, _39in1_state, init_pokrwild, ROT0, "I.A.M.", "Poker's Wild (V117)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND) // no string diff --git a/src/mame/misc/ddz.cpp b/src/mame/misc/ddz.cpp index bd3d25d093739..603befcb829e9 100644 --- a/src/mame/misc/ddz.cpp +++ b/src/mame/misc/ddz.cpp @@ -181,7 +181,7 @@ ROM_START( crzclass ) // rom4 not populated ROM_END -ROM_START( baibians ) // same PCB as crzclass +ROM_START( baibians ) // 百变双扣, same PCB as crzclass ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) @@ -191,7 +191,7 @@ ROM_START( baibians ) // same PCB as crzclass // rom4 not populated ROM_END -ROM_START( cjmx ) // same PCB as crzclass, but this one has an Amazon LF instead of the VRenderZero +ROM_START( cjmx ) // 超级明星, same PCB as crzclass, but this one has an Amazon LF instead of the VRenderZero ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) From d3e9cded17be9fe58d93b789e638c6d7676964db Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Wed, 26 Feb 2025 22:03:02 +0100 Subject: [PATCH 038/272] tms52xx: Enable command buffering during speak operation. --- src/devices/sound/tms5220.cpp | 111 ++++++++++++++++++++++++++++------ src/devices/sound/tms5220.h | 8 ++- 2 files changed, 100 insertions(+), 19 deletions(-) diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index dd02cf8d71455..e63862b4f463a 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -397,8 +397,10 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled #define LOG_IO_READY (1U << 14) // debugs the tms5220_data_r and data_w access methods which actually respect rs and ws #define LOG_RS_WS (1U << 15) +// shows the byte being written by the CPU to the VSP +#define LOG_DATA_W (1U << 16) -//#define VERBOSE (LOG_GENERAL | LOG_DUMP_INPUT_DATA | LOG_FIFO | LOG_PARSE_FRAME_DUMP_HEX | LOG_FRAME_ERRORS | LOG_COMMAND_DUMP | LOG_COMMAND_VERBOSE | LOG_PIN_READS | LOG_GENERATION | LOG_GENERATION_VERBOSE | LOG_LATTICE | LOG_CLIP | LOG_IO_READY | LOG_RS_WS) +//#define VERBOSE (LOG_GENERAL | LOG_DUMP_INPUT_DATA | LOG_FIFO | LOG_PARSE_FRAME_DUMP_HEX | LOG_FRAME_ERRORS | LOG_COMMAND_DUMP | LOG_COMMAND_VERBOSE | LOG_PIN_READS | LOG_GENERATION | LOG_GENERATION_VERBOSE | LOG_LATTICE | LOG_CLIP | LOG_IO_READY | LOG_RS_WS | LOG_DATA_W) #include "logmacro.h" #define MAX_SAMPLE_CHUNK 512 @@ -438,6 +440,8 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled static const uint8_t reload_table[4] = { 0, 2, 4, 6 }; //sample count reload for 5220c and cd2501ecd only; 5200 and 5220 always reload with 0; keep in mind this is loaded on IP=0 PC=12 subcycle=1 so it immediately will increment after one sample, effectively being 1,3,5,7 as in the comments above. +#define NOCOMMAND 0xff + // Pull in the ROM tables #include "tms5110r.hxx" @@ -480,6 +484,9 @@ void tms5220_device::register_for_save_states() save_item(NAME(m_irq_pin)); save_item(NAME(m_ready_pin)); + save_item(NAME(m_command_register)); + save_item(NAME(m_data_latched)); + // current and previous frames save_item(NAME(m_OLDE)); save_item(NAME(m_OLDP)); @@ -663,12 +670,14 @@ void tms5220_device::data_write(int data) LOGMASKED(LOG_FIFO, "data_write: Ran out of room in the tms52xx FIFO! this should never happen!\n"); // at this point, /READY should remain HIGH/inactive until the FIFO has at least one byte open in it. } - - + m_data_latched = false; } else //(! m_DDIS) // R Nabet : we parse commands at once. It is necessary for such commands as read. process_command(data); + + if (!m_data_latched) + m_io_ready = true; } /********************************************************************************************** @@ -736,9 +745,30 @@ void tms5220_device::update_fifo_status_and_ints() // also, in this case, regardless if DDIS was set, unset it. if (m_previous_talk_status && !talk_status()) { - LOG("Talk status WAS 1, is now 0, unsetting DDIS and firing an interrupt!\n"); + LOG("Talk status 1 -> 0, unsetting DDIS and firing an interrupt.\n"); set_interrupt_state(1); m_DDIS = false; + + m_previous_talk_status = false; + + // Is there a command stuck in the command register due to speech output? + // Then resume it. + if (m_command_register != NOCOMMAND) + { + LOGMASKED(LOG_COMMAND_DUMP, "Resume command execution: %02X\n", m_command_register); + process_command(m_command_register); + + // Is there another data transfer pending? Resume it as well. + if (m_data_latched) + { + LOGMASKED(LOG_COMMAND_DUMP, "Pending byte write: %02X\n", m_write_latch); + m_timer_io_ready->adjust(clocks_to_attotime(16), 1); + } + else + m_io_ready = true; + + update_ready_state(); + } } m_previous_talk_status = talk_status(); @@ -1296,14 +1326,27 @@ int32_t tms5220_device::lattice_filter() /********************************************************************************************** - process_command -- extract a byte from the FIFO and interpret it as a command + process_command -- decode byte and run the command + + During SPEAK, the address counter is locked against modification by + LOAD_ADDRESS. In that time, a LOAD_ADDRESS command does not terminate but + remains in the command register. + When another command is fed into the speech processor, the READY line is + lowered until the command register is cleared, then the new command is + loaded into the command register. + + Note that the running SPEAK command does not block the command register; + it is a command that attempts to change the address during the SPEAK + process. [mz] ***********************************************************************************************/ -void tms5220_device::process_command(unsigned char cmd) +void tms5220_device::process_command(uint8_t cmd) { LOGMASKED(LOG_COMMAND_DUMP, "process_command called with parameter %02X\n", cmd); + m_command_register = cmd; + /* parse the command */ switch (cmd & 0x70) { @@ -1320,12 +1363,14 @@ void tms5220_device::process_command(unsigned char cmd) if (m_speechrom) m_read_byte_register = m_speechrom->read(8); /* read one byte from speech ROM... */ m_RDB_flag = true; + m_command_register = NOCOMMAND; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received during TALK state, ignoring!\n"); + LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received during TALK state, suspended.\n"); break; - case 0x00: case 0x20: /* set rate (tms5220c and cd2501ecd only), otherwise NOP */ + case 0x00: + case 0x20: /* set rate (tms5220c and cd2501ecd only), otherwise NOP */ if (TMS5220_HAS_RATE_CONTROL) { LOGMASKED(LOG_COMMAND_VERBOSE, "Set Rate (or NOP) command received\n"); @@ -1333,6 +1378,8 @@ void tms5220_device::process_command(unsigned char cmd) } else LOGMASKED(LOG_COMMAND_VERBOSE, "NOP command received\n"); + + m_command_register = NOCOMMAND; break; case 0x30 : /* read and branch */ @@ -1342,21 +1389,28 @@ void tms5220_device::process_command(unsigned char cmd) m_RDB_flag = false; if (m_speechrom) m_speechrom->read_and_branch(); + m_command_register = NOCOMMAND; } break; case 0x40 : /* load address */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received\n"); if (!talk_status()) /* TALKST must be clear for LA */ { + LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received\n"); /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work. This code does not care about this. */ if (m_speechrom) m_speechrom->load_address(cmd & 0x0f); m_schedule_dummy_read = true; + m_command_register = NOCOMMAND; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received during TALK state, ignoring!\n"); + { + // The Load Address command is not ignored during speech output, + // as tests show. In fact, it is normally executed when the speech + // terminates. + LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received during TALK state, suspended.\n"); + } break; case 0x50 : /* speak */ @@ -1389,6 +1443,8 @@ void tms5220_device::process_command(unsigned char cmd) m_new_frame_k_idx[i] = 0xF; for (int i = 7; i < m_coeff->num_k; i++) m_new_frame_k_idx[i] = 0x7; + + m_command_register = NOCOMMAND; break; case 0x60 : /* speak external */ @@ -1417,6 +1473,8 @@ void tms5220_device::process_command(unsigned char cmd) for (int i = 7; i < m_coeff->num_k; i++) m_new_frame_k_idx[i] = 0x7; m_RDB_flag = false; + + m_command_register = NOCOMMAND; break; case 0x70 : /* reset */ @@ -1428,6 +1486,7 @@ void tms5220_device::process_command(unsigned char cmd) m_speechrom->read(1); } reset(); + m_command_register = NOCOMMAND; break; } @@ -1666,6 +1725,9 @@ void tms5220_device::device_reset() update_ready_state(); m_buffer_empty = m_buffer_low = true; + m_command_register = NOCOMMAND; + m_data_latched = false; + m_RDB_flag = false; /* initialize the energy/pitch/k states */ @@ -1716,6 +1778,7 @@ TIMER_CALLBACK_MEMBER(tms5220_device::set_io_ready) { /* bring up to date first */ m_stream->update(); + LOGMASKED(LOG_IO_READY, "m_timer_io_ready timer fired, param = %02x, m_rs_ws = %02x\n", param, m_rs_ws); if (param) // low->high ready state { @@ -1732,24 +1795,34 @@ TIMER_CALLBACK_MEMBER(tms5220_device::set_io_ready) } else { - LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced write: %02x\n", m_write_latch); - data_write(m_write_latch); - m_io_ready = param; + if (m_command_register != NOCOMMAND) + { + // The command register is still busy; do not activate /READY + // and keep the data latch + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Command register not ready\n"); + } + else + { + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced write: %02X\n", m_write_latch); + m_data_latched = false; + data_write(m_write_latch); + } + break; } case 0x01: /* Read */ m_read_latch = status_read(true); - LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced read, returning %02x\n", m_read_latch); - m_io_ready = param; + LOGMASKED(LOG_IO_READY, "m_timer_io_ready: Serviced read, returning %02X\n", m_read_latch); + m_io_ready = true; break; case 0x03: /* High Impedance */ - m_io_ready = param; + m_io_ready = true; break; case 0x00: /* illegal */ - m_io_ready = param; + m_io_ready = true; break; } } @@ -1940,10 +2013,12 @@ void tms5220_device::combined_rsq_wsq_w(u8 data) void tms5220_device::data_w(uint8_t data) { - LOGMASKED(LOG_RS_WS, "tms5220_write_data: data %02x\n", data); + LOGMASKED(LOG_DATA_W, "tms5220_write_data: data %02X\n", data); /* bring up to date first */ m_stream->update(); m_write_latch = data; + m_data_latched = true; + if (!m_true_timing) // if we're in the default hacky mode where we don't bother with rsq_w and wsq_w... data_write(m_write_latch); // ...force the write through instantly. else diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 33747f5d56197..8b49852aebc25 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -97,7 +97,7 @@ class tms5220_device : public device_t, public device_sound_interface int16_t clip_analog(int16_t cliptemp) const; int32_t matrix_multiply(int32_t a, int32_t b) const; int32_t lattice_filter(); - void process_command(unsigned char cmd); + void process_command(uint8_t cmd); void parse_frame(); void set_interrupt_state(int state); void update_ready_state(); @@ -157,6 +157,12 @@ class tms5220_device : public device_t, public device_sound_interface bool m_irq_pin; /* state of the IRQ pin (output) */ bool m_ready_pin; /* state of the READY pin (output) */ + /* Currently processed command */ + uint8_t m_command_register; + + /* Indicates a value latched from the data lines and not yet processed */ + bool m_data_latched; + /* these contain data describing the current and previous voice frames */ bool m_OLDE; bool m_OLDP; From 92f265a3a9bdc547268a069695c3c883eef16d3c Mon Sep 17 00:00:00 2001 From: Nigel Barnes Date: Wed, 26 Feb 2025 22:51:58 +0000 Subject: [PATCH 039/272] acorn/electron.cpp: Merged electron_m.cpp and electron.h into electron.cpp. --- src/mame/acorn/electron.cpp | 402 +++++++++++++++++++++++++++++++++- src/mame/acorn/electron.h | 127 ----------- src/mame/acorn/electron_m.cpp | 293 ------------------------- 3 files changed, 398 insertions(+), 424 deletions(-) delete mode 100644 src/mame/acorn/electron.h delete mode 100644 src/mame/acorn/electron_m.cpp diff --git a/src/mame/acorn/electron.cpp b/src/mame/acorn/electron.cpp index d958b814411df..222d3c0ea5219 100644 --- a/src/mame/acorn/electron.cpp +++ b/src/mame/acorn/electron.cpp @@ -9,8 +9,8 @@ Basic specs are: 6502 CPU @ 2MHz or 1MHz 32k RAM and 32k ROM Text modes: 20x32, 40x25, 40x32, 80x25, 80x32 -Graphics modes: 160x256 (4 or 16 colors), 320x256 (2 or 4 colors), 640x256 (2 colors), 320x200 (2 colors), 640x200 (2 colors) -Colors: 8 colors (either solid or flashing) +Graphics modes: 160x256 (4 or 16 colours), 320x256 (2 or 4 colours), 640x256 (2 colours), 320x200 (2 colors), 640x200 (2 colors) +Colours: 8 colours (either solid or flashing) Sound: 1 channel, 7 octaves; built-in speaker Internal ports for cassette storage, RGB/CVBS monitors and TV output Various expansions can be added via the rear expansion port @@ -37,7 +37,7 @@ Notes: (all IC's shown. Only 16 ICs are used) ROM - Hitachi HN613256 32k x8-bit mask ROM containing OS & BASIC LM324 - Texas Instruments LM324 Operational Amplifier MOD - UHF TV modulator UM1233-E36 - CVBS - Composite color video output socket + CVBS - Composite colour video output socket RGB - RGB monitor video output socket CASS - Cassette port PWR - 3-pin power input from internal power supply @@ -79,18 +79,126 @@ Other internal boards to emulate: ******************************************************************************/ #include "emu.h" -#include "electron.h" +#include "electron_ula.h" +#include "bus/bbc/userport/userport.h" +#include "bus/electron/exp.h" +#include "bus/generic/slot.h" +#include "bus/generic/carts.h" #include "cpu/m6502/m6502.h" #include "formats/uef_cas.h" #include "formats/csw_cas.h" #include "imagedev/cassette.h" +#include "machine/6522via.h" +#include "machine/input_merger.h" +#include "machine/ram.h" #include "screen.h" #include "softlist_dev.h" #include "speaker.h" +namespace { + +class electron_state : public driver_device +{ +public: + electron_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_irqs(*this, "irqs") + , m_screen(*this, "screen") + , m_cassette(*this, "cassette") + , m_ula(*this, "ula") + , m_region_mos(*this, "mos") + , m_keybd(*this, "LINE.%u", 0) + , m_exp(*this, "exp") + , m_ram(*this, RAM_TAG) + , m_mrb(*this, "MRB") + , m_capslock_led(*this, "capslock_led") + { } + + void electron(machine_config &config); + void btm2105(machine_config &config); + + void electron64(machine_config &config); + + static void plus3_default(device_t* device); + + DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + uint8_t fetch_r(offs_t offset); + uint8_t ram_r(offs_t offset); + void ram_w(offs_t offset, uint8_t data); + virtual uint8_t rom_r(offs_t offset); + virtual void rom_w(offs_t offset, uint8_t data); + virtual uint8_t io_r(offs_t offset); + virtual void io_w(offs_t offset, uint8_t data); + uint8_t keyboard_r(offs_t offset); + + void mem_map(address_map &map) ATTR_COLD; + void opcodes_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; + required_device m_irqs; + required_device m_screen; + required_device m_cassette; + required_device m_ula; + required_memory_region m_region_mos; + required_ioport_array<14> m_keybd; + required_device m_exp; + required_device m_ram; + optional_ioport m_mrb; + output_finder<> m_capslock_led; + + bool m_mrb_mapped = false; + bool m_vdu_drivers = false; +}; + + +class electronsp_state : public electron_state +{ +public: + electronsp_state(const machine_config &mconfig, device_type type, const char *tag) + : electron_state(mconfig, type, tag) + , m_region_sp64(*this, "sp64") + , m_via(*this, "via6522") + , m_userport(*this, "userport") + , m_romi(*this, "romi%u", 1) + , m_rompages(*this, "ROMPAGES") + { } + + void electronsp(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + + virtual uint8_t rom_r(offs_t offset) override; + virtual void rom_w(offs_t offset, uint8_t data) override; + virtual uint8_t io_r(offs_t offset) override; + virtual void io_w(offs_t offset, uint8_t data) override; + +private: + required_memory_region m_region_sp64; + required_device m_via; + required_device m_userport; + required_device_array m_romi; + required_ioport m_rompages; + + uint8_t m_rompage = 0; + uint8_t m_sp64_bank = 0; + std::unique_ptr m_sp64_ram; + + std::pair load_rom(device_image_interface &image, generic_slot_device *slot); + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_romi[0]); } + DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_romi[1]); } +}; + + void electron_state::mem_map(address_map &map) { map(0x0000, 0x7fff).rw(FUNC(electron_state::ram_r), FUNC(electron_state::ram_w)); /* 32KB of RAM */ @@ -103,6 +211,290 @@ void electron_state::opcodes_map(address_map &map) map(0x0000, 0xffff).r(FUNC(electron_state::fetch_r)); } + +uint8_t electron_state::keyboard_r(offs_t offset) +{ + uint8_t data = 0; + + for (int i = 0; i < 14; i++) + { + if (!BIT(offset, i)) + data |= m_keybd[i]->read() & 0x0f; + } + + return data; +} + + +uint8_t electron_state::fetch_r(offs_t offset) +{ + m_vdu_drivers = (offset & 0xe000) == 0xc000 ? true : false; + + return m_maincpu->space(AS_PROGRAM).read_byte(offset); +} + + +uint8_t electron_state::ram_r(offs_t offset) +{ + uint8_t data = 0xff; + + data &= m_exp->expbus_r(offset); + + switch (m_mrb.read_safe(0)) + { + case 0x00: /* Normal */ + data &= m_ula->read(offset); + break; + + case 0x01: /* Turbo */ + if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; + data &= m_ram->read(offset); + break; + + case 0x02: /* Shadow */ + if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; + data &= m_ram->read(offset); + break; + } + + return data; +} + +void electron_state::ram_w(offs_t offset, uint8_t data) +{ + m_exp->expbus_w(offset, data); + + switch (m_mrb.read_safe(0)) + { + case 0x00: /* Normal */ + m_ula->write(offset, data); + break; + + case 0x01: /* Turbo */ + if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; + m_ram->write(offset, data); + break; + + case 0x02: /* Shadow */ + if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; + m_ram->write(offset, data); + break; + } +} + + +uint8_t electron_state::rom_r(offs_t offset) +{ + /* 0,1 Second external socket on the expansion module (SK2) */ + /* 2,3 First external socket on the expansion module (SK1) */ + /* 4 Disc */ + /* 5,6 USER applications */ + /* 7 Modem interface ROM */ + /* 8,9 Keyboard */ + /* 10,11 BASIC */ + /* 12 Expansion module operating system */ + /* 13 High priority slot in expansion module */ + /* 14 ECONET */ + /* 15 Reserved */ + + uint8_t data = 0xff; + + offset += 0x8000; + + data &= m_ula->read(offset); + data &= m_exp->expbus_r(offset); + + return data; +} + +void electron_state::rom_w(offs_t offset, uint8_t data) +{ + offset += 0x8000; + + m_ula->write(offset, data); + m_exp->expbus_w(offset, data); +} + +uint8_t electronsp_state::rom_r(offs_t offset) +{ + uint8_t data = electron_state::rom_r(offset); + + switch (offset & 0x4000) + { + case 0x0000: + if ((m_rompage & 0x0e) == m_rompages->read()) + { + data = m_romi[m_rompage & 0x01]->read_rom(offset); + } + else + { + switch (m_rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + data = m_sp64_ram[offset & 0x1fff]; + } + else + { + data = m_region_sp64->base()[(!BIT(m_sp64_bank, 0) << 14) | offset]; + } + break; + } + } + break; + } + + return data; +} + +void electronsp_state::rom_w(offs_t offset, uint8_t data) +{ + electron_state::rom_w(offset, data); + + switch (offset & 0x4000) + { + case 0x0000: + if ((m_rompage & 0x0e) == m_rompages->read()) + { + /* TODO: sockets are writeable if RAM */ + } + else + { + switch (m_rompage) + { + case 10: + /* SP64 ROM utilises the spare BASIC ROM page */ + if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) + { + m_sp64_ram[offset & 0x1fff] = data; + } + break; + } + } + break; + } +} + + +uint8_t electron_state::io_r(offs_t offset) +{ + uint8_t data = 0xff; + + offset += 0xfc00; + + data &= m_ula->read(offset); + data &= m_exp->expbus_r(offset); + + return data; +} + +void electron_state::io_w(offs_t offset, uint8_t data) +{ + m_ula->write(0xfc00 + offset, data); + + offset += 0xfc00; + + /* Master RAM Board */ + if (offset == 0xfc7f) + { + m_mrb_mapped = !BIT(data, 7); + } + + m_exp->expbus_w(offset, data); +} + + +uint8_t electronsp_state::io_r(offs_t offset) +{ + uint8_t data = electron_state::io_r(offset); + + offset += 0xfc00; + + if ((offset & 0xfff0) == 0xfcb0) + { + data = m_via->read(offset & 0x0f); + } + + return data; +} + +void electronsp_state::io_w(offs_t offset, uint8_t data) +{ + electron_state::io_w(offset, data); + + offset += 0xfc00; + + if ((offset & 0xfff0) == 0xfcb0) + { + m_via->write(offset & 0x0f, data); + } + else if (offset == 0xfcfa) + { + m_sp64_bank = data; + } + else if ((offset == 0xfe05) && !(data & 0xf0)) + { + m_rompage = data & 0x0f; + } +} + + +/************************************** + Machine Initialisation functions +***************************************/ + +void electron_state::machine_start() +{ + m_capslock_led.resolve(); + + /* set ULA RAM/ROM pointers */ + m_ula->set_ram(m_ram->pointer()); + m_ula->set_rom(m_region_mos->base()); + + /* register save states */ + save_item(NAME(m_mrb_mapped)); + save_item(NAME(m_vdu_drivers)); +} + +void electron_state::machine_reset() +{ + m_mrb_mapped = true; + m_vdu_drivers = false; +} + +void electronsp_state::machine_start() +{ + electron_state::machine_start(); + + m_sp64_ram = std::make_unique(0x2000); + + /* register save states */ + save_item(NAME(m_sp64_bank)); + save_pointer(NAME(m_sp64_ram), 0x2000); +} + + +std::pair electronsp_state::load_rom(device_image_interface &image, generic_slot_device *slot) +{ + uint32_t size = slot->common_get_size("rom"); + + // socket accepts 8K and 16K ROM only + if (size != 0x2000 && size != 0x4000) + return std::make_pair(image_error::INVALIDLENGTH, "Invalid size: Only 8K/16K is supported"); + + slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); + slot->common_load_rom(slot->get_rom_base(), size, "rom"); + + // mirror 8K ROMs + uint8_t *crt = slot->get_rom_base(); + if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000); + + return std::make_pair(std::error_condition(), std::string()); +} + + INPUT_CHANGED_MEMBER(electron_state::trigger_reset) { m_maincpu->set_input_line(INPUT_LINE_RESET, newval ? ASSERT_LINE : CLEAR_LINE); @@ -371,6 +763,8 @@ ROM_END #define rom_btm2105 rom_electron +} // anonymous namespace + /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ COMP ( 1983, electron, 0, 0, electron, electron, electron_state, empty_init, "Acorn Computers", "Acorn Electron", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/acorn/electron.h b/src/mame/acorn/electron.h deleted file mode 100644 index 26fe78cb86107..0000000000000 --- a/src/mame/acorn/electron.h +++ /dev/null @@ -1,127 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Wilbert Pol, Nigel Barnes -/***************************************************************************** - * - * Acorn Electron - * - * Driver by Wilbert Pol - * - ****************************************************************************/ -#ifndef MAME_ACORN_ELECTRON_H -#define MAME_ACORN_ELECTRON_H - -#pragma once - -#include "electron_ula.h" - -#include "bus/bbc/userport/userport.h" -#include "bus/electron/exp.h" -#include "bus/generic/slot.h" -#include "bus/generic/carts.h" -#include "imagedev/cassette.h" -#include "machine/6522via.h" -#include "machine/input_merger.h" -#include "machine/ram.h" - -#include "screen.h" - - -class electron_state : public driver_device -{ -public: - electron_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_irqs(*this, "irqs") - , m_screen(*this, "screen") - , m_cassette(*this, "cassette") - , m_ula(*this, "ula") - , m_region_mos(*this, "mos") - , m_keybd(*this, "LINE.%u", 0) - , m_exp(*this, "exp") - , m_ram(*this, RAM_TAG) - , m_mrb(*this, "MRB") - , m_capslock_led(*this, "capslock_led") - { } - - void electron(machine_config &config); - void btm2105(machine_config &config); - - void electron64(machine_config &config); - - static void plus3_default(device_t* device); - - DECLARE_INPUT_CHANGED_MEMBER( trigger_reset ); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - - uint8_t fetch_r(offs_t offset); - uint8_t ram_r(offs_t offset); - void ram_w(offs_t offset, uint8_t data); - virtual uint8_t rom_r(offs_t offset); - virtual void rom_w(offs_t offset, uint8_t data); - virtual uint8_t io_r(offs_t offset); - virtual void io_w(offs_t offset, uint8_t data); - uint8_t keyboard_r(offs_t offset); - - void mem_map(address_map &map) ATTR_COLD; - void opcodes_map(address_map &map) ATTR_COLD; - - required_device m_maincpu; - required_device m_irqs; - required_device m_screen; - required_device m_cassette; - required_device m_ula; - required_memory_region m_region_mos; - required_ioport_array<14> m_keybd; - required_device m_exp; - required_device m_ram; - optional_ioport m_mrb; - output_finder<> m_capslock_led; - - bool m_mrb_mapped = false; - bool m_vdu_drivers = false; -}; - - -class electronsp_state : public electron_state -{ -public: - electronsp_state(const machine_config &mconfig, device_type type, const char *tag) - : electron_state(mconfig, type, tag) - , m_region_sp64(*this, "sp64") - , m_via(*this, "via6522") - , m_userport(*this, "userport") - , m_romi(*this, "romi%u", 1) - , m_rompages(*this, "ROMPAGES") - { } - - void electronsp(machine_config &config); - -protected: - virtual void machine_start() override ATTR_COLD; - - virtual uint8_t rom_r(offs_t offset) override; - virtual void rom_w(offs_t offset, uint8_t data) override; - virtual uint8_t io_r(offs_t offset) override; - virtual void io_w(offs_t offset, uint8_t data) override; - -private: - required_memory_region m_region_sp64; - required_device m_via; - required_device m_userport; - required_device_array m_romi; - required_ioport m_rompages; - - uint8_t m_rompage = 0; - uint8_t m_sp64_bank = 0; - std::unique_ptr m_sp64_ram; - - std::pair load_rom(device_image_interface &image, generic_slot_device *slot); - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom1_load) { return load_rom(image, m_romi[0]); } - DECLARE_DEVICE_IMAGE_LOAD_MEMBER(rom2_load) { return load_rom(image, m_romi[1]); } -}; - -#endif // MAME_ACORN_ELECTRON_H diff --git a/src/mame/acorn/electron_m.cpp b/src/mame/acorn/electron_m.cpp deleted file mode 100644 index d98301a91e6ee..0000000000000 --- a/src/mame/acorn/electron_m.cpp +++ /dev/null @@ -1,293 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Wilbert Pol, Nigel Barnes -/****************************************************************************** - - Acorn Electron driver - -******************************************************************************/ - -#include "emu.h" -#include "electron.h" - - -uint8_t electron_state::keyboard_r(offs_t offset) -{ - uint8_t data = 0; - - for (int i = 0; i < 14; i++) - { - if (!BIT(offset, i)) - data |= m_keybd[i]->read() & 0x0f; - } - - return data; -} - - -uint8_t electron_state::fetch_r(offs_t offset) -{ - m_vdu_drivers = (offset & 0xe000) == 0xc000 ? true : false; - - return m_maincpu->space(AS_PROGRAM).read_byte(offset); -} - - -uint8_t electron_state::ram_r(offs_t offset) -{ - uint8_t data = 0xff; - - data &= m_exp->expbus_r(offset); - - switch (m_mrb.read_safe(0)) - { - case 0x00: /* Normal */ - data &= m_ula->read(offset); - break; - - case 0x01: /* Turbo */ - if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; - data &= m_ram->read(offset); - break; - - case 0x02: /* Shadow */ - if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; - data &= m_ram->read(offset); - break; - } - - return data; -} - -void electron_state::ram_w(offs_t offset, uint8_t data) -{ - m_exp->expbus_w(offset, data); - - switch (m_mrb.read_safe(0)) - { - case 0x00: /* Normal */ - m_ula->write(offset, data); - break; - - case 0x01: /* Turbo */ - if (m_mrb_mapped && offset < 0x3000) offset += 0x8000; - m_ram->write(offset, data); - break; - - case 0x02: /* Shadow */ - if (m_mrb_mapped && (offset < 0x3000 || !m_vdu_drivers)) offset += 0x8000; - m_ram->write(offset, data); - break; - } -} - - -uint8_t electron_state::rom_r(offs_t offset) -{ - /* 0,1 Second external socket on the expansion module (SK2) */ - /* 2,3 First external socket on the expansion module (SK1) */ - /* 4 Disc */ - /* 5,6 USER applications */ - /* 7 Modem interface ROM */ - /* 8,9 Keyboard */ - /* 10,11 BASIC */ - /* 12 Expansion module operating system */ - /* 13 High priority slot in expansion module */ - /* 14 ECONET */ - /* 15 Reserved */ - - uint8_t data = 0xff; - - offset += 0x8000; - - data &= m_ula->read(offset); - data &= m_exp->expbus_r(offset); - - return data; -} - -void electron_state::rom_w(offs_t offset, uint8_t data) -{ - offset += 0x8000; - - m_ula->write(offset, data); - m_exp->expbus_w(offset, data); -} - -uint8_t electronsp_state::rom_r(offs_t offset) -{ - uint8_t data = electron_state::rom_r(offset); - - switch (offset & 0x4000) - { - case 0x0000: - if ((m_rompage & 0x0e) == m_rompages->read()) - { - data = m_romi[m_rompage & 0x01]->read_rom(offset); - } - else - { - switch (m_rompage) - { - case 10: - /* SP64 ROM utilises the spare BASIC ROM page */ - if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) - { - data = m_sp64_ram[offset & 0x1fff]; - } - else - { - data = m_region_sp64->base()[(!BIT(m_sp64_bank, 0) << 14) | offset]; - } - break; - } - } - break; - } - - return data; -} - -void electronsp_state::rom_w(offs_t offset, uint8_t data) -{ - electron_state::rom_w(offset, data); - - switch (offset & 0x4000) - { - case 0x0000: - if ((m_rompage & 0x0e) == m_rompages->read()) - { - /* TODO: sockets are writeable if RAM */ - } - else - { - switch (m_rompage) - { - case 10: - /* SP64 ROM utilises the spare BASIC ROM page */ - if (BIT(m_sp64_bank, 7) && (offset & 0x2000)) - { - m_sp64_ram[offset & 0x1fff] = data; - } - break; - } - } - break; - } -} - - -uint8_t electron_state::io_r(offs_t offset) -{ - uint8_t data = 0xff; - - offset += 0xfc00; - - data &= m_ula->read(offset); - data &= m_exp->expbus_r(offset); - - return data; -} - -void electron_state::io_w(offs_t offset, uint8_t data) -{ - m_ula->write(0xfc00 + offset, data); - - offset += 0xfc00; - - /* Master RAM Board */ - if (offset == 0xfc7f) - { - m_mrb_mapped = !BIT(data, 7); - } - - m_exp->expbus_w(offset, data); -} - - -uint8_t electronsp_state::io_r(offs_t offset) -{ - uint8_t data = electron_state::io_r(offset); - - offset += 0xfc00; - - if ((offset & 0xfff0) == 0xfcb0) - { - data = m_via->read(offset & 0x0f); - } - - return data; -} - -void electronsp_state::io_w(offs_t offset, uint8_t data) -{ - electron_state::io_w(offset, data); - - offset += 0xfc00; - - if ((offset & 0xfff0) == 0xfcb0) - { - m_via->write(offset & 0x0f, data); - } - else if (offset == 0xfcfa) - { - m_sp64_bank = data; - } - else if ((offset == 0xfe05) && !(data & 0xf0)) - { - m_rompage = data & 0x0f; - } -} - - -/************************************** - Machine Initialisation functions -***************************************/ - -void electron_state::machine_start() -{ - m_capslock_led.resolve(); - - /* set ULA RAM/ROM pointers */ - m_ula->set_ram(m_ram->pointer()); - m_ula->set_rom(m_region_mos->base()); - - /* register save states */ - save_item(NAME(m_mrb_mapped)); - save_item(NAME(m_vdu_drivers)); -} - -void electron_state::machine_reset() -{ - m_mrb_mapped = true; - m_vdu_drivers = false; -} - -void electronsp_state::machine_start() -{ - electron_state::machine_start(); - - m_sp64_ram = std::make_unique(0x2000); - - /* register save states */ - save_item(NAME(m_sp64_bank)); - save_pointer(NAME(m_sp64_ram), 0x2000); -} - - -std::pair electronsp_state::load_rom(device_image_interface &image, generic_slot_device *slot) -{ - uint32_t size = slot->common_get_size("rom"); - - // socket accepts 8K and 16K ROM only - if (size != 0x2000 && size != 0x4000) - return std::make_pair(image_error::INVALIDLENGTH, "Invalid size: Only 8K/16K is supported"); - - slot->rom_alloc(0x4000, GENERIC_ROM8_WIDTH, ENDIANNESS_LITTLE); - slot->common_load_rom(slot->get_rom_base(), size, "rom"); - - // mirror 8K ROMs - uint8_t *crt = slot->get_rom_base(); - if (size <= 0x2000) memcpy(crt + 0x2000, crt, 0x2000); - - return std::make_pair(std::error_condition(), std::string()); -} From e0d1edaf5cfc25ffb63f9c4df5f982eadc47233d Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Thu, 27 Feb 2025 01:11:30 +0100 Subject: [PATCH 040/272] Draw 80 Poker driver improvements: [Roberto Fresca, Grull Osgo] - Fixed inputs polarity: No more credits triggered at reset. - Found the "Pair of Aces" DIP switch. - Fixed hopper DIP switch polarity. - Fixed hopper coin out signal. - Reverse-engineered the whole DIP switches bank. - Rewrote I/O handlers to simplify the if/then nested scheme toward switch statements. - Reworked coin inputs per game. - Promoted Draw 80 Poker (Minn) to working. - Promoted Wild 1 (Quick Change Kit) to working. Systems promoted to working --------------------------- Draw 80 Poker (Minn) [Roberto Fresca, Grull Osgo] Wild 1 (Quick Change Kit) [Roberto Fresca, Grull Osgo] --- src/mame/igt/drw80pkr.cpp | 309 +++++++++++++++++------------------ src/mame/layout/drw80pkr.lay | 22 ++- 2 files changed, 169 insertions(+), 162 deletions(-) diff --git a/src/mame/igt/drw80pkr.cpp b/src/mame/igt/drw80pkr.cpp index b9d984fc8e2f2..b1ce0f5e06658 100644 --- a/src/mame/igt/drw80pkr.cpp +++ b/src/mame/igt/drw80pkr.cpp @@ -27,7 +27,7 @@ company in 1981 and changed its name to IGT. - Coinage: + Coinage: DSW#3 OFF ON OFF ON DSW#4 OFF OFF ON ON @@ -95,22 +95,31 @@ - Added hopper device. - Added default init for video memory. - Fixed a bug in read NVRAM decode. - - Added AY-8910 callback for the DIP switch. + - Added AY-8910 callback for the DIP switch. - Added support for Wild 1 cocktail mode. - Added button-lamps clickable layout for both games. - System is playable with almost complete functionality. + Updates [2025-02-27] + + - Fixed inputs polarity: No more credits triggered at reset. + - Found the "Pair of Aces" DIP switch. + - Fixed hopper DIP switch polarity. + - Fixed hopper coin out signal. + - Reverse-engineered the whole DIP switches bank. + - Rewrote I/O handlers to simplify the if/then nested scheme toward switch statements. + - Reworked coin inputs per game. + - Promoted Draw 80 Poker (Minn) to working. + - Promoted Wild 1 (Quick Change Kit) to working. + TODO: - - Find the unknown remaining DIP switches. - - Fix the credits addition after each reset. - Support for the IGT ABC type coin acceptor. - - Reversed and find the unknown port access via P1 and P2. - - Rewrite I/O handlers to simplify the if/then nested scheme toward switch statements. + - Reverse and find the unknown port access via P1.5 and P1.2. - Find the coin lock line for documentation. - Find if there is a diverter or weight sensor line. - - Fix the coin in line for drw80pkr. + - Reverse the behaviour of the port line access called "attract mode". *******************************************************************************************************/ @@ -143,10 +152,10 @@ class drw80pkr_state : public driver_device m_mainbank(*this, "mainbank"), m_hopper(*this, "hopper"), m_lamps(*this, "lamp%u", 0U) - + { } - void init_drw80pkr(); + void init_drw80pkr(); void drw80pkr(machine_config &config); protected: @@ -235,7 +244,6 @@ void drw80pkr_state::prog_w(int state) if (m_prog == 0x01) { m_active_bank = m_active_bank ^ 0x01; - m_mainbank->set_entry(m_active_bank); } } @@ -248,81 +256,61 @@ void drw80pkr_state::bus_w(uint8_t data) void drw80pkr_state::io_w(offs_t offset, uint8_t data) { uint16_t n_offs; - - if (m_p2 == 0x3f || m_p2 == 0x7f) - { - n_offs = ((m_p1 & 0xc0) << 2 ) + offset; - if (m_p2 == 0x3f) + switch (m_p2) + { + case 0x3f: { + n_offs = ((m_p1 & 0xc0) << 2 ) + offset; m_video_ram[n_offs] = data; // low address + m_bg_tilemap->mark_tile_dirty(n_offs); + break; } - else + case 0x7f: { + n_offs = ((m_p1 & 0xc0) << 2 ) + offset; m_color_ram[n_offs] = data & 0x0f; // color palette m_video_ram[n_offs] += ((data & 0xf0) << 4 ); // high address - + m_bg_tilemap->mark_tile_dirty(n_offs); + break; } - - m_bg_tilemap->mark_tile_dirty(n_offs); - } - - if (m_p2 == 0xc7) - m_crtc->address_w(data); - - if (m_p2 == 0xd7) - m_crtc->register_w(data); - - if (m_p2 == 0xfb) - { - m_pkr_io_ram[offset] = data; - } - - if (m_p2 == 0xff) - { - if (m_p1 == 0xdb || m_p1 == 0xef || m_p1 == 0xf7 || m_p1 == 0xfb) - { - // unknown, most likely lamps, meters, hopper etc. - } - - // rewrite output decoder - if (m_p1 == 0xf7 || m_p1 == 0xef || m_p1 == 0xdf) + case 0xc7: m_crtc->address_w(data); break; + case 0xd7: m_crtc->register_w(data); break; + case 0xfb: m_pkr_io_ram[offset] = data; break; + case 0xff: { - // to rewrite with switch - if(m_p1 == 0xf7) // /P1.3 - { - machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin in counter - machine().bookkeeping().coin_counter_w(1, data & 0x02); // credits paid - machine().bookkeeping().coin_counter_w(2, data & 0x04); // credits bet - machine().bookkeeping().coin_counter_w(3, data & 0x08); // coin out counter - m_hopper->motor_w(BIT(data, 4) && BIT(data, 5)); - } - - if(m_p1 == 0xef) // /P1.4 + switch (m_p1) { - m_lamps[0] = BIT(data, 0); // bet lamp - m_lamps[1] = BIT(data, 1); // start (deal/draw) - m_lamps[2] = BIT(data, 2); // hold - m_lamps[3] = BIT(data, 3); // hold - m_lamps[4] = BIT(data, 4); // hold - m_lamps[5] = BIT(data, 5); // hold - m_lamps[6] = BIT(data, 6); // hold - m_lamps[7] = BIT(data, 7); // unknown - } - - if(m_p1 == 0xdf) // /P1.5 - { - m_attract_mode = data; // latch this for use in input reads (0x01 = attract mode, 0x00 = game in progress) - } + case 0xf7: + { + machine().bookkeeping().coin_counter_w(0, data & 0x01); // coin in counter + machine().bookkeeping().coin_counter_w(1, data & 0x02); // credits paid + machine().bookkeeping().coin_counter_w(2, data & 0x04); // credits bet + machine().bookkeeping().coin_counter_w(3, data & 0x08); // coin out counter + m_hopper->motor_w(BIT(data, 4) && BIT(data, 5)); + m_lamps[7] = BIT(data, 4) && BIT(data, 5); // for testing purpose + break; + } + case 0xef: + { + m_lamps[0] = BIT(data, 0); // bet lamp + m_lamps[1] = BIT(data, 1); // start (deal/draw) + m_lamps[2] = BIT(data, 2); // hold + m_lamps[3] = BIT(data, 3); // hold + m_lamps[4] = BIT(data, 4); // hold + m_lamps[5] = BIT(data, 5); // hold + m_lamps[6] = BIT(data, 6); // hold + break; + } + case 0xdf: m_attract_mode = data; break; // unknown port access via P1.5 + case 0xfc: m_aysnd->address_w(data); break; + case 0xfe: m_aysnd->data_w(data); break; + case 0xfb: break; // unknown port access via P1.2 + case 0xdb: break; // unknown port access via P1.5 and P1.2 + //default: logerror("%s - Unknown I8039 - IO_W with Port 1:%02x access - data:%02x\n", machine().describe_context(), m_p1, data); + } break; } - - // ay8910 control port - if (m_p1 == 0xfc) - m_aysnd->address_w(data); - - // ay8910_write_port_0_w - if (m_p1 == 0xfe) - m_aysnd->data_w(data); + //default: logerror("%s - Unknown I8039 - IO_W with Port 2:%02x access - data:%02x\n", machine().describe_context(), m_p2, data); } } @@ -358,70 +346,75 @@ uint8_t drw80pkr_state::bus_r() uint8_t drw80pkr_state::io_r(offs_t offset) { - uint8_t ret; - - ret = 0x00; - - if (m_p2 == 0x3b) - { - // unknown - } - - if (m_p2 == 0xf7) - { - // unknown - } - - if ((m_p2 == 0xfb) | (m_p2 == 0x7b)) // Some reads done with extra P2.7 low, but nvram access requires only P2.2 low.(some bug?) - // Writes don't have this behaviour. - { - ret = m_pkr_io_ram[offset]; - } + uint8_t ret = 0; - if (m_p2 == 0xff) + switch (m_p2) { - if (m_p1 == 0x5f || m_p1 == 0x9f || m_p1 == 0xdb) + case 0x3b: break; // dummy read done by "orl p2,#$FF" instruction. + case 0xf7: break; // dummy read done by "orl p2,#$FF" instruction. + case 0x7b: // some program bug, but ignored by real hardware. + case 0xfb: ret = m_pkr_io_ram[offset]; break; + case 0xff: { - // unknown - } - - if (m_p1 == 0xfe) - { - return m_aysnd->data_r(); - // DIP switches tied to sound chip - } - - if ((m_attract_mode == 0x01 && m_p1 == 0xef) || m_p1 == 0xf7) - { - if(m_p1 == 0xef) - return ioport("IN1")->read(); - - if(m_p1 == 0xf7) - { - switch (ioport("IN2")->read()) + switch (m_p1) + { + case 0xdb: + case 0x5f: + case 0x9f: break; // dummy reads done by "orl p1,#$FF" instruction. + case 0xfe: ret = m_aysnd->data_r(); break; + case 0xef: { - case 0x0000: ret = 0x80; break; - case 0x0001: ret = 0x81; break; // HOLD 4 P1 - case 0x0002: ret = 0x82; break; // HOLD 3 P1 - case 0x0004: ret = 0x83; break; // HOLD 2 P1 - case 0x0008: ret = 0x84; break; // HOLD 1 P1 - case 0x0010: ret = 0x85; break; // START P1 - case 0x0020: ret = 0x86; break; // BET P1 - case 0x0040: ret = 0x87; break; // HOLD 5 P1 - case 0x0080: ret = 0x88; break; // HOLD 4 P2 - case 0x0100: ret = 0x90; break; // HOLD 3 P2 - case 0x0200: ret = 0x98; break; // HOLD 2 P2 - case 0x0400: ret = 0xa0; break; // HOLD 1 P2 - case 0x0800: ret = 0xa8; break; // START P2 - case 0x1000: ret = 0xb0; break; // BET P2 - case 0x2000: ret = 0xb8; break; // HOLD P2 - case 0x4000: ret = 0x40; break; // Hopper coin out - case 0x8000: ret = 0x00; break; // Books/Door + switch (ioport("IN1")->read()) + { + // Encoded bits 0, 1, 2 + case 0x00: ret = 0xc0; break; // A Default port value 11-000-000 + case 0x01: ret = 0xc4; break; // Keyout 11-000-100 + case 0x02: ret = 0xc6; break; // A KeyIn A (Coinage x 1 ) No timeout 11-000-110 + // Direct bits 3, 4, 5 + case 0x04: ret = 0xc8; break; // 5 Coin (Timeout) (Coin_A Sequencer) 11-001-000 - Coin option only for drw80wld + case 0x08: ret = 0xd0; break; // 6 x (Coin_B Sequencer) 11-010-000 + case 0x10: ret = 0xe0; break; // 7 x (Coin_C Sequencer) 11-100-000 + // Direct Bits 6, 7 + case 0x20: ret = 0x80; break; // S Key In B (Coinage x 4) No Timeout 10-000-000 + case 0x40: ret = 0x40; break; // D Key In C (Coinage x 20) No Timeout 01-000-000 + } + break; + } + case 0xf7: + { + switch (ioport("IN2")->read()) + { + case 0x0000: ret = 0x80; break; + case 0x0001: ret = 0x81; break; // HOLD 4 P1 + case 0x0002: ret = 0x82; break; // HOLD 3 P1 + case 0x0004: ret = 0x83; break; // HOLD 2 P1 + case 0x0008: ret = 0x84; break; // HOLD 1 P1 + case 0x0010: ret = 0x85; break; // START P1 + case 0x0020: ret = 0x86; break; // BET P1 + case 0x0040: ret = 0x87; break; // HOLD 5 P1 + case 0x0080: ret = 0x88; break; // HOLD 4 P2 + case 0x0100: ret = 0x90; break; // HOLD 3 P2 + case 0x0200: ret = 0x98; break; // HOLD 2 P2 + case 0x0400: ret = 0xa0; break; // HOLD 1 P2 + case 0x0800: ret = 0xa8; break; // START P2 + case 0x1000: ret = 0xb0; break; // BET P2 + case 0x2000: ret = 0xb8; break; // HOLD P2 + case 0x4000: ret = 0xc0; break; // Hopper coin out + case 0x8000: ret = 0x00; break; // Books/Door + } break; + } + default: + { + //logerror("%s - Unknown I8039 - I/O with Port 1:%02x access\n", machine().describe_context(), m_p1); + ret = 0; } - return ret; } + } break; + default: + { + //logerror("%s - Unknown I8039 - I/O with Port 2:%02x access\n", machine().describe_context(), m_p2); + ret = 0; } - ret = 0x00; } return ret; } @@ -532,14 +525,13 @@ void drw80pkr_state::io_map(address_map &map) static INPUT_PORTS_START( drw80pkr ) PORT_START("IN1") //$EF - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_GAMBLE_PAYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer A - PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer B - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // coin sequencer C - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN4 ) PORT_IMPULSE(2) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_IMPULSE(2) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_NAME("KeyIn x01") // KeyIn A (Coinage x 1 ) No timeout + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_NAME("KeyIn x04") // Key In B (Coinage x 4) No Timeout + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_COIN3 ) PORT_NAME("KeyIn x20") // Key In C (Coinage x 20) No Timeout PORT_START("IN2") //$F7 PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_POKER_HOLD4 ) PORT_IMPULSE(2) @@ -557,7 +549,7 @@ static INPUT_PORTS_START( drw80pkr ) PORT_BIT( 0x0800, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode deal/draw PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode bet PORT_BIT( 0x2000, IP_ACTIVE_HIGH, IPT_UNUSED ) // unsupported cocktail mode hold 5 - PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) + PORT_BIT( 0x4000, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r)) PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) PORT_START("DSW1") @@ -567,15 +559,14 @@ static INPUT_PORTS_START( drw80pkr ) PORT_DIPNAME( 0x02, 0x02, "Joker Enable" ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x02, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x04, "Enabled" ) PORT_DIPSETTING( 0x00, "Disabled" ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Payout Type" ) PORT_DIPLOCATION("SW1:4") - PORT_DIPSETTING( 0x10, "Cash" ) - PORT_DIPSETTING( 0x00, "Credits" ) + PORT_DIPNAME( 0x18, 0x00, "Payout Type" ) PORT_DIPLOCATION("SW1:4,5") + PORT_DIPSETTING( 0x00, "Cash" ) + PORT_DIPSETTING( 0x08, "Credits" ) + PORT_DIPSETTING( 0x10, "Credits" ) + PORT_DIPSETTING( 0x18, "Credits" ) PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,2") PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x40, DEF_STR( 1C_3C ) ) @@ -583,7 +574,7 @@ static INPUT_PORTS_START( drw80pkr ) PORT_DIPSETTING( 0x00, "1 Coin/10 Credits" ) PORT_DIPNAME( 0x80, 0x00, "Coin Acceptor Type" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x80, "Type ABC" ) - PORT_DIPSETTING( 0x00, "Single Pulse" ) + PORT_DIPSETTING( 0x00, "Single Pulse" ) INPUT_PORTS_END @@ -591,13 +582,13 @@ static INPUT_PORTS_START( drw80wld ) PORT_INCLUDE( drw80pkr ) PORT_MODIFY("IN1") //$EF - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-1") PORT_CODE(KEYCODE_A) - PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-2") PORT_CODE(KEYCODE_S) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_IMPULSE(2) // coin sequencer A - PORT_BIT( 0x10, IP_ACTIVE_LOW , IPT_COIN2 ) // coin sequencer B - PORT_BIT( 0x20, IP_ACTIVE_LOW , IPT_COIN3 ) // coin sequencer C - PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-7") PORT_CODE(KEYCODE_G) - PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("0-8") PORT_CODE(KEYCODE_H) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x01") PORT_CODE(KEYCODE_A) // KeyIn A (Coinage x 1 ) No timeout + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_COIN1 ) // coin sequencer A Or Coin Switch (DSW_1 Selector) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_COIN2 ) // coin sequencer B + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN3 ) // coin sequencer C + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x04") PORT_CODE(KEYCODE_S) // Key In B (Coinage x 4) No Timeout + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("KeyIn x20") PORT_CODE(KEYCODE_D) // Key In C (Coinage x 20) No Timeout PORT_MODIFY("IN2") PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("Hold 4 (cocktail mode)") PORT_IMPULSE(2) // cocktail mode hold 4 @@ -653,7 +644,7 @@ void drw80pkr_state::drw80pkr(machine_config &config) AY8912(config, m_aysnd, 20000000/12).add_route(ALL_OUTPUTS, "mono", 0.75); m_aysnd->port_a_read_callback().set_ioport("DSW1"); - + HOPPER(config, m_hopper, attotime::from_msec(150)); } @@ -695,6 +686,6 @@ ROM_END * Game Drivers * *****************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAMEL( 1983, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker (Minn)", MACHINE_NOT_WORKING, layout_drw80pkr) -GAMEL( 1982, drw80wld, 0, drw80pkr, drw80wld, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Wild 1 (Quick Change Kit)", MACHINE_NOT_WORKING, layout_drw80pkr) +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 1983, drw80pkr, 0, drw80pkr, drw80pkr, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Draw 80 Poker (Minn)", 0, layout_drw80pkr) +GAMEL( 1982, drw80wld, 0, drw80pkr, drw80wld, drw80pkr_state, init_drw80pkr, ROT0, "IGT - International Game Technology", "Wild 1 (Quick Change Kit)", 0, layout_drw80pkr) diff --git a/src/mame/layout/drw80pkr.lay b/src/mame/layout/drw80pkr.lay index e08a407e452e0..abdca35a4192d 100644 --- a/src/mame/layout/drw80pkr.lay +++ b/src/mame/layout/drw80pkr.lay @@ -73,6 +73,16 @@ copyright-holders: Roberto Fresca, Grull Osgo. + + + + + + + + + + @@ -137,7 +147,7 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + @@ -145,7 +155,7 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + @@ -162,5 +172,11 @@ copyright-holders: Roberto Fresca, Grull Osgo. + + + + + + - + \ No newline at end of file From 8fdb48c2032623f21d3b950752ef45a1ee58a81e Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 27 Feb 2025 18:10:26 +0100 Subject: [PATCH 041/272] New working clones ------------------ Multi Champ (World, ver. 9.6 [Manuel Assoni] New clones marked not working ----------------------------- Mahjong Electron Base (parts 2 & 3, Japan bootleg) [little0] --- src/mame/dynax/dynax.cpp | 15 ++ src/mame/mame.lst | 2 + src/mame/misc/esd16.cpp | 467 ++++++++++++++++++++++++++++++++------ src/mame/misc/esd16.h | 111 --------- src/mame/misc/esd16_v.cpp | 197 ---------------- 5 files changed, 417 insertions(+), 375 deletions(-) delete mode 100644 src/mame/misc/esd16.h delete mode 100644 src/mame/misc/esd16_v.cpp diff --git a/src/mame/dynax/dynax.cpp b/src/mame/dynax/dynax.cpp index 598cb3278b1ce..47fdf2e69a8df 100644 --- a/src/mame/dynax/dynax.cpp +++ b/src/mame/dynax/dynax.cpp @@ -5937,6 +5937,20 @@ ROM_START( mjelctrb ) ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) ROM_END +ROM_START( mjelct3bl ) + ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "rom.u3", 0x00000, 0x20000, CRC(2cc0bbd8) SHA1(0653de340d470d209649b82b1844c3c3da5c545a) ) + ROM_CONTINUE( 0x00000, 0x20000 ) + ROM_RELOAD( 0x10000, 0x08000 ) + ROM_CONTINUE( 0x28000, 0x08000 ) + ROM_CONTINUE( 0x20000, 0x08000 ) + ROM_CONTINUE( 0x18000, 0x08000 ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data, not dumped for this set + ROM_LOAD( "eb-01.rom", 0x000000, 0x100000, BAD_DUMP CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, BAD_DUMP CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) +ROM_END + /*************************************************************************** Mahjong Electromagnetic Base (Dynax, 1989) @@ -7067,6 +7081,7 @@ GAME( 1989, mjembase, mjelctrn, mjembase, mjembase, dynax_adpcm_state, init_ GAME( 1990, mjelct3, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, Japan set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1990, mjelct3a, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3a, ROT180, "Dynax", "Mahjong Electron Base (parts 2 & 3, Japan set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, mjelctrb, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "bootleg", "Mahjong Electron Base (parts 2 & 4, Japan bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993, mjelct3bl, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_mjelct3, ROT180, "bootleg", "Mahjong Electron Base (parts 2 & 3, Japan bootleg)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 1990, majxtal7, 7jigen, neruton, majxtal7, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax", "Mahjong X-Tal 7 - Crystal Mahjong / Mahjong Diamond 7 (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // reuses a subset of 7jigen assets GAME( 1990, neruton, 0, neruton, neruton, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. B?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1990, nerutona, neruton, neruton, nerutona, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. A?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index a028637a4c527..d4afd18c6b903 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17636,6 +17636,7 @@ mjdialq2 mjdialq2a mjelct3 mjelct3a +mjelct3bl mjelctrb mjelctrn mjembase @@ -30277,6 +30278,7 @@ mchampdx mchampdxa mchampdxb multchmp +multchmp25 multchmpa multchmpk swatpolc diff --git a/src/mame/misc/esd16.cpp b/src/mame/misc/esd16.cpp index 8f00328e5e339..be6b197fe514f 100644 --- a/src/mame/misc/esd16.cpp +++ b/src/mame/misc/esd16.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood +// copyright-holders: Luca Elia, David Haywood + /*************************************************************************** -= ESD 16 Bit Games =- @@ -66,15 +67,298 @@ Fire Hawk (c) 2001 - see nmk16.cpp driver ***************************************************************************/ #include "emu.h" -#include "esd16.h" + +#include "decospr.h" #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" +#include "machine/eepromser.h" +#include "machine/gen_latch.h" #include "sound/okim6295.h" #include "sound/ymopl.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class esd16_state : public driver_device +{ +public: + esd16_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_vram(*this, "vram_%u", 0U), + m_scroll(*this, "scroll_%u", 0U), + m_spriteram(*this, "spriteram"), + m_layersize(*this, "head_layersize"), + m_platform_x(*this, "platform_x"), + m_platform_y(*this, "platform_y"), + m_audiobank(*this, "audiobank"), + m_io_eepromout(*this, "EEPROMOUT"), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_sprgen(*this, "spritegen"), + m_eeprom(*this, "eeprom"), + m_soundlatch(*this, "soundlatch") + { } + + void esd16_nosound(machine_config &config) ATTR_COLD; + void esd16(machine_config &config) ATTR_COLD; + void jumppop(machine_config &config) ATTR_COLD; + void tangtang(machine_config &config) ATTR_COLD; + void mchampdx(machine_config &config) ATTR_COLD; + void hedpanio(machine_config &config) ATTR_COLD; + void hedpanic(machine_config &config) ATTR_COLD; + void fantstry(machine_config &config) ATTR_COLD; + void fantstrya(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + required_shared_ptr_array m_vram; + required_shared_ptr_array m_scroll; + required_shared_ptr m_spriteram; + required_shared_ptr m_layersize; + required_shared_ptr m_platform_x; + required_shared_ptr m_platform_y; + + optional_memory_bank m_audiobank; + optional_ioport m_io_eepromout; + + tilemap_t *m_tilemap_16x16[2]{}; + tilemap_t *m_tilemap[2]{}; + u32 m_tilemap_color[2]{}; + + required_device m_maincpu; + optional_device m_audiocpu; + required_device m_gfxdecode; + optional_device m_sprgen; + optional_device m_eeprom; + optional_device m_soundlatch; + + void sound_command_w(u8 data); + void platform_w(u16 data); + u8 eeprom_r(); + void eeprom_w(u8 data); + void sound_rombank_w(u8 data); + template void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void tilemap0_color_w(u16 data); + void tilemap0_color_jumppop_w(u16 data); + template TILE_GET_INFO_MEMBER(get_tile_info); + template TILE_GET_INFO_MEMBER(get_tile_info_16x16); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECOSPR_PRIORITY_CB_MEMBER(pri_callback); + void fantstrya_map(address_map &map) ATTR_COLD; + void hedpanic_map(address_map &map) ATTR_COLD; + void jumppop_map(address_map &map) ATTR_COLD; + void mchampdx_map(address_map &map) ATTR_COLD; + void multchmp_map(address_map &map) ATTR_COLD; + void sound_io_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void tangtang_map(address_map &map) ATTR_COLD; + + void io_area_dsw(address_map &map, u32 base) ATTR_COLD; + void io_area_eeprom(address_map &map, u32 base) ATTR_COLD; + void palette_area(address_map &map, u32 base) ATTR_COLD; + void sprite_area(address_map &map, u32 base) ATTR_COLD; + void vid_attr_area(address_map &map, u32 base) ATTR_COLD; + void vram_area(address_map &map, u32 base) ATTR_COLD; +}; + + +/*************************************************************************** + +Note: if MAME_DEBUG is defined, pressing Z with: + + Q / W Shows Layer 0 / 1 + A Shows Sprites + + Keys can be used together! + + + [ 2 Scrolling Layers ] + + Tile Size: 8 x 8 x 8 + Color Codes: 1 per Layer (banked for Layer 0) + Layer Size (tiles) : 128 x 64 + Layer Size (pixels): 1024 x 512 + + [ 256 Sprites ] + + Sprites are made of 16 x 16 x 5 tiles. Size can vary from 1 to + 8 tiles vertically, while their width is always 1 tile. + + [ Priorities ] + + The game only uses this scheme: + + Back -> Front: Layer 0, Layer 1, Sprites + +***************************************************************************/ + + +/*************************************************************************** + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + + Color code: layer 0 (backmost) can bank at every 256 colors, + layer 1 uses the first 256. + +***************************************************************************/ + +template +TILE_GET_INFO_MEMBER(esd16_state::get_tile_info) +{ + const u16 code = m_vram[Layer][tile_index]; + tileinfo.set(0, + code, + m_tilemap_color[Layer], + 0); +} + +template +TILE_GET_INFO_MEMBER(esd16_state::get_tile_info_16x16) +{ + const u16 code = m_vram[Layer][tile_index]; + tileinfo.set(1, + code, + m_tilemap_color[Layer], + 0); +} + + +void esd16_state::tilemap0_color_w(u16 data) +{ + m_tilemap_color[0] = data & 0x03; + m_tilemap[0]->mark_all_dirty(); + m_tilemap_16x16[0]->mark_all_dirty(); + + bool const flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); +} + +void esd16_state::tilemap0_color_jumppop_w(u16 data) +{ + // TODO + m_tilemap_color[0] = 2; + m_tilemap_color[1] = 1; + + bool const flip = BIT(data, 7); + flip_screen_set(flip); + m_sprgen->set_flip_screen(flip); +} + + +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + + +void esd16_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); + + // swatpolc changes tilemap 0 to 16x16 at various times + m_tilemap_16x16[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<0>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); + + // hedpanic changes tilemap 1 to 16x16 at various times + m_tilemap_16x16[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<1>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); + + m_tilemap[0]->set_scrolldx(-0x60 + 2, -0x60); + m_tilemap[1]->set_scrolldx(-0x60, -0x60 + 2); + m_tilemap_16x16[0]->set_scrolldx(-0x60 + 2, -0x60); + m_tilemap_16x16[1]->set_scrolldx(-0x60, -0x60 + 2); + + m_tilemap[1]->set_transparent_pen(0x00); + m_tilemap_16x16[1]->set_transparent_pen(0x00); +} + + +/*************************************************************************** + + + Screen Drawing + + +***************************************************************************/ + +u32 esd16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = -1; + + screen.priority().fill(0, cliprect); + +#ifdef MAME_DEBUG +if (machine().input().code_pressed(KEYCODE_Z)) +{ + int msk = 0; + if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (machine().input().code_pressed(KEYCODE_A)) msk |= 4; + if (msk != 0) layers_ctrl &= msk; +} +#endif + + if (layers_ctrl & 1) + { + if (m_layersize[0] & 0x0001) + { + m_tilemap_16x16[0]->set_scrollx(0, m_scroll[0][0]); + m_tilemap_16x16[0]->set_scrolly(0, m_scroll[0][1]); + m_tilemap_16x16[0]->draw(screen, bitmap, cliprect, 0, 0); + } + else + { + m_tilemap[0]->set_scrollx(0, m_scroll[0][0]); + m_tilemap[0]->set_scrolly(0, m_scroll[0][1]); + m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); + } + } + else + { + bitmap.fill(0, cliprect); + } + + + if (layers_ctrl & 2) + { + if (m_layersize[0] & 0x0002) + { + m_tilemap_16x16[1]->set_scrollx(0, m_scroll[1][0]); + m_tilemap_16x16[1]->set_scrolly(0, m_scroll[1][1]); + m_tilemap_16x16[1]->draw(screen, bitmap, cliprect, 0, 1); + } + else + { + m_tilemap[1]->set_scrollx(0, m_scroll[1][0]); + m_tilemap[1]->set_scrolly(0, m_scroll[1][1]); + m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); + } + + } + + if (layers_ctrl & 4) m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); + +// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); + return 0; +} /*************************************************************************** @@ -687,8 +971,8 @@ void esd16_state::machine_start() { if (m_audiobank) { - u8* AUDIO = memregion("audiocpu")->base(); - m_audiobank->configure_entries(0, 16, &AUDIO[0x0000], 0x4000); + u8* audiorom = memregion("audiocpu")->base(); + m_audiobank->configure_entries(0, 16, &audiorom[0x0000], 0x4000); } save_item(NAME(m_tilemap_color)); @@ -730,7 +1014,7 @@ void esd16_state::esd16_nosound(machine_config &config) m_sprgen->set_flipallx(1); GFXDECODE(config, m_gfxdecode, "palette", gfx_esd16); - PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1000/2); + PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1000 / 2); } void esd16_state::fantstry(machine_config& config) @@ -759,19 +1043,19 @@ void esd16_state::esd16(machine_config& config) { esd16_nosound(config); - Z80(config, m_audiocpu, XTAL(16'000'000)/4); // 4MHz + Z80(config, m_audiocpu, XTAL(16'000'000) / 4); // 4MHz m_audiocpu->set_addrmap(AS_PROGRAM, &esd16_state::sound_map); m_audiocpu->set_addrmap(AS_IO, &esd16_state::sound_io_map); - m_audiocpu->set_periodic_int(FUNC(esd16_state::nmi_line_pulse), attotime::from_hz(32*60)); // IRQ By Main CPU + m_audiocpu->set_periodic_int(FUNC(esd16_state::nmi_line_pulse), attotime::from_hz(32 * 60)); // IRQ By Main CPU // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_audiocpu, 0); - YM3812(config, "ymsnd", XTAL(16'000'000)/4).add_route(ALL_OUTPUTS, "mono", 0.30); // 4MHz + YM3812(config, "ymsnd", XTAL(16'000'000) / 4).add_route(ALL_OUTPUTS, "mono", 0.30); // 4MHz - OKIM6295(config, "oki", XTAL(16'000'000)/16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // 1MHz + OKIM6295(config, "oki", XTAL(16'000'000) / 16, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.60); // 1MHz } void esd16_state::jumppop(machine_config &config) @@ -782,14 +1066,14 @@ void esd16_state::jumppop(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &esd16_state::jumppop_map); - m_audiocpu->set_clock(XTAL(14'000'000)/4); // 3.5MHz - Verified + m_audiocpu->set_clock(XTAL(14'000'000) / 4); // 3.5MHz - Verified m_sprgen->set_info(gfx_jumppop_spr); m_gfxdecode->set_info(gfx_jumppop); - subdevice("ymsnd")->set_clock(XTAL(14'000'000)/4); // 3.5MHz - Verified + subdevice("ymsnd")->set_clock(XTAL(14'000'000) / 4); // 3.5MHz - Verified - subdevice("oki")->set_clock(XTAL(14'000'000)/16); // 875kHz - Verified + subdevice("oki")->set_clock(XTAL(14'000'000) / 16); // 875kHz - Verified } // The ESD 05-28-99 PCB adds an EEPROM @@ -891,7 +1175,7 @@ MULTCHMP.U39 -/ MX27C2000 ***************************************************************************/ -ROM_START( multchmp ) +ROM_START( multchmp25 ) ROM_REGION( 0x080000, "maincpu", 0 ) // 68000 Code ROM_LOAD16_BYTE( "esd2.cu02", 0x000000, 0x040000, CRC(2d1b098a) SHA1(c2f3991f02c611c258219da2c61cad22c9a21f7d) ) ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(10974063) SHA1(854b38b4d4cb529e9928aae4212c86a220615e04) ) @@ -908,12 +1192,12 @@ ROM_START( multchmp ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, CRC(6652c04a) SHA1(178e1d42847506d869ef79db2f7e10df05e9ef76) ) - ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, CRC(a783a003) SHA1(1ff61a049485c5b599c458a8bf7f48027d14f8e0) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, CRC(299f32c2) SHA1(274752444f6ddba16eeefc02c3e78525c079b3d8) ) ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, CRC(d815974b) SHA1(3e528a5df79fa7dc0f38b0ee7f2f3a0ebc97a369) ) - ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, CRC(22861af2) SHA1(1e74e85517cb8fd5fb4bda6e9d9d54046e31f653) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, CRC(e2689bb2) SHA1(1da9b1f7335d5c2d1c2f8353fccf91c0109d2e9d) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples @@ -937,12 +1221,12 @@ ROM_START( multchmpk ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "multchmp.u31", 0x000000, 0x080000, CRC(b1e4e9e3) SHA1(1a7393e9073b028b4170393b3788ad8cb86c0c78) ) - ROM_LOAD32_BYTE( "multchmp.u33", 0x000002, 0x080000, CRC(e4c0ec96) SHA1(74152108e4d05f4aff9d38919f212fcb8c87cef3) ) ROM_LOAD32_BYTE( "multchmp.u29", 0x000001, 0x080000, CRC(01bd1399) SHA1(b717ccffe0af92a42a0879736d34d3ad71840233) ) + ROM_LOAD32_BYTE( "multchmp.u33", 0x000002, 0x080000, CRC(e4c0ec96) SHA1(74152108e4d05f4aff9d38919f212fcb8c87cef3) ) ROM_LOAD32_BYTE( "multchmp.u27", 0x000003, 0x080000, CRC(dc42704e) SHA1(58a04a47ffc6d6ae0e4d49e466b1c58b37ad741a) ) ROM_LOAD32_BYTE( "multchmp.u32", 0x200000, 0x080000, CRC(f05cb5b4) SHA1(1b33e60942238e39d61ae59e9317b99e83595ab1) ) - ROM_LOAD32_BYTE( "multchmp.u34", 0x200002, 0x080000, CRC(bffaaccc) SHA1(d9ab248e2c7c639666e3717cfc5d8c8468a1bde2) ) ROM_LOAD32_BYTE( "multchmp.u30", 0x200001, 0x080000, CRC(c6b4cc18) SHA1(d9097b85584272cfe4989a40d622ef1feeee6775) ) + ROM_LOAD32_BYTE( "multchmp.u34", 0x200002, 0x080000, CRC(bffaaccc) SHA1(d9ab248e2c7c639666e3717cfc5d8c8468a1bde2) ) ROM_LOAD32_BYTE( "multchmp.u28", 0x200003, 0x080000, CRC(449991fa) SHA1(fd93e420a04cb8bea5421aa9cbe079bd3e7d4924) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples @@ -966,19 +1250,62 @@ ROM_START( multchmpa ) // Also found on a ESD 10-10-98 PCB which looks identical ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, CRC(a3cfe895) SHA1(a8dc0d5d9e64d4c5112177b8f20b5bdb86ca73af) ) - ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(d3c1855e) SHA1(bb547d4a45a745e9ae4a6727087cdf325105de90) ) ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, CRC(042d59ff) SHA1(8e45a4757e07d8aaf50b151d8849c1a27424e64b) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, CRC(d3c1855e) SHA1(bb547d4a45a745e9ae4a6727087cdf325105de90) ) ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, CRC(ed5b4e58) SHA1(82c3ee9e2525c0b370a29d5560c21ec6380d1a43) ) ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, CRC(396d77b6) SHA1(f22449a7f9f50e172e36db4f399c14e527409884) ) - ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(a68848a8) SHA1(915239a961d76af6a1a567eb89b1569f158e714e) ) ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, CRC(fa8cd2d3) SHA1(ddc1b98867e6d2eee458bf35a933e7cdc59f4c7e) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, CRC(a68848a8) SHA1(915239a961d76af6a1a567eb89b1569f158e714e) ) ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, CRC(97fde7b1) SHA1(b3610f6fcc1367ff079dc01121c86bc1e1f4c7a2) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples ROM_LOAD( "esd4.su08", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) ) ROM_END +// this runs on a slightly newer PCB: ESD 05-17-99 +// there is a string about EEPROM write error but there isn't any on PCB +ROM_START( multchmp ) + ROM_REGION( 0x080000, "maincpu", 0 ) // 68000 Code + ROM_LOAD16_BYTE( "esd7.cu02", 0x000000, 0x040000, CRC(e25cbbfe) SHA1(fa142489a2171fb94b62d2635a1da5944ddde0cb) ) + ROM_LOAD16_BYTE( "esd6.cu03", 0x000001, 0x040000, CRC(e7f837f9) SHA1(f31bf6c99b4f9be7bf9bb7ba04cf354ff070ad7f) ) + + ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code + ROM_LOAD( "esd3.su06", 0x00000, 0x20000, CRC(7c178bd7) SHA1(8754d3c70d9b2bf369a5ce0cce4cc0696ed22750) ) + + ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 + ROM_LOAD16_BYTE( "esd17.ju06", 0x000000, 0x040000, CRC(a69d4399) SHA1(06ae6c07cc6b7313e2e2aa3b994f7532d6994e1b) ) + ROM_LOAD16_BYTE( "esd16.ju05", 0x000001, 0x040000, CRC(e670a6da) SHA1(47cbe45b6d5d0ca70d0c6787d589dde5d14fdba4) ) + ROM_LOAD16_BYTE( "esd15.ju04", 0x080000, 0x040000, CRC(88b7a97c) SHA1(0a57ec8f6a44c8e3aa3ef35499a415d6a2b7eb16) ) + ROM_LOAD16_BYTE( "esd14.ju03", 0x080001, 0x040000, CRC(a6122225) SHA1(cbcf2b31c4c011daba21f0ae5fd3be63c9a87c00) ) + ROM_LOAD16_BYTE( "esd13.ju07", 0x100000, 0x040000, CRC(22071594) SHA1(c79102b250780d1da8c290d065d61fbbfa193366) ) + + ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 + ROM_LOAD( "mx29f1610ml.fu27_fu32", 0x000000, 0x200000, NO_DUMP ) // These 2 ROMs are soldered and weren't dumped. Using the ones from the other sets for now. + ROM_LOAD( "mx29f1610ml.fu28_fu31", 0x000000, 0x200000, NO_DUMP ) + ROM_LOAD32_BYTE( "esd9.fu28", 0x000000, 0x080000, BAD_DUMP CRC(6652c04a) SHA1(178e1d42847506d869ef79db2f7e10df05e9ef76) ) + ROM_LOAD32_BYTE( "esd7.fu26", 0x000001, 0x080000, BAD_DUMP CRC(a783a003) SHA1(1ff61a049485c5b599c458a8bf7f48027d14f8e0) ) + ROM_LOAD32_BYTE( "esd11.fu29", 0x000002, 0x080000, BAD_DUMP CRC(9bafd8ee) SHA1(db18be05431d4b6d4207e19fa4ed8701621aaa19) ) + ROM_LOAD32_BYTE( "esd5.fu27", 0x000003, 0x080000, BAD_DUMP CRC(299f32c2) SHA1(274752444f6ddba16eeefc02c3e78525c079b3d8) ) + ROM_LOAD32_BYTE( "esd10.fu31", 0x200000, 0x080000, BAD_DUMP CRC(d815974b) SHA1(3e528a5df79fa7dc0f38b0ee7f2f3a0ebc97a369) ) + ROM_LOAD32_BYTE( "esd8.fu30", 0x200001, 0x080000, BAD_DUMP CRC(22861af2) SHA1(1e74e85517cb8fd5fb4bda6e9d9d54046e31f653) ) + ROM_LOAD32_BYTE( "esd12.fu33", 0x200002, 0x080000, BAD_DUMP CRC(c6b86001) SHA1(11a63b56df30ab7b85ce4568d2a24e96a125735a) ) + ROM_LOAD32_BYTE( "esd6.fu32", 0x200003, 0x080000, BAD_DUMP CRC(e2689bb2) SHA1(1da9b1f7335d5c2d1c2f8353fccf91c0109d2e9d) ) + + ROM_REGION( 0x40000, "oki", 0 ) // Samples + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(6e741fcd) SHA1(742e0952916c00f67dd9f8d01e721a9a538d2fc4) ) + ROM_REGION( 0x1800, "plds", ROMREGION_ERASE00 ) // all read-protected + ROM_LOAD( "palce22v10h-25pc-4.cu04", 0x0000, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.cu05", 0x0300, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.du05", 0x0600, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce22v10h-25pc-4.fu01", 0x0900, 0x02dd, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.du03", 0x0c00, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.ru27", 0x0e00, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.fu01", 0x1000, 0x0117, NO_DUMP ) + ROM_LOAD( "palce16v8h-25.su07", 0x1200, 0x0117, NO_DUMP ) + ROM_LOAD( "a40mx04-f-pl84.bu01", 0x1400, 0x0200, NO_DUMP ) // size wrong + ROM_LOAD( "a40mx04-f-pl84.du16", 0x1600, 0x0200, NO_DUMP ) // size wrong +ROM_END /* @@ -1040,10 +1367,10 @@ ROM_START( mchampdx ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) ) - // this has additional copyright sprites in the flash roms for the (c)2000 message.. + // this has additional copyright sprites in the flash ROMs for the (c)2000 message.. ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ver0106_ju01.bin", 0x200000, 0x200000, CRC(55841d90) SHA1(52ba3ee9393dcddf28e2d20a50151bc739faaaa4) ) - ROM_LOAD( "ver0106_ju02.bin", 0x000000, 0x200000, CRC(b27a4977) SHA1(b7f94bb04d0046538b3938335e6b0cce330ad79c) ) + ROM_LOAD( "ver0106_ju02.bin", 0x000000, 0x200000, CRC(b27a4977) SHA1(b7f94bb04d0046538b3938335e6b0cce330ad79c) ) + ROM_LOAD( "ver0106_ju01.bin", 0x200000, 0x200000, CRC(55841d90) SHA1(52ba3ee9393dcddf28e2d20a50151bc739faaaa4) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "ver0106_esd5.ju07", 0x400000, 0x040000, CRC(7a3ac887) SHA1(3c759f9bed396bbaf6bd7298a8bd2bd76df3aa6f) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1068,8 +1395,8 @@ ROM_START( mchampdxa ) ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(1b22568c) SHA1(5458e1a798357a6785f8ea1fe9da37768cd4761d) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "rom.ju01", 0x200000, 0x200000, CRC(1a749fc2) SHA1(feff4b26ee28244b4d092798a176e33e09d5df2c) ) - ROM_LOAD( "rom.ju02", 0x000000, 0x200000, CRC(7e87e332) SHA1(f90aa00a64a940846d99053c7aa023e3fd5d070b) ) + ROM_LOAD( "rom.ju02", 0x000000, 0x200000, CRC(7e87e332) SHA1(f90aa00a64a940846d99053c7aa023e3fd5d070b) ) + ROM_LOAD( "rom.ju01", 0x200000, 0x200000, CRC(1a749fc2) SHA1(feff4b26ee28244b4d092798a176e33e09d5df2c) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(6cc871cc) SHA1(710b9695c864e4234686993b88d24590d60e1cb9) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1094,8 +1421,8 @@ ROM_START( mchampdxb ) ROM_LOAD( "ver1114_esd3.su06", 0x00000, 0x40000, CRC(b87a1e85) SHA1(2fcdd7e8b301e3d20e6500a03dc293403b23b471) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ver1114_ju01", 0x200000, 0x200000, CRC(0048e687) SHA1(5cc0a35b5f5f8d69b2dc3728ad6d0d505d9e16c5) ) // SMT Flash MX chips - ROM_LOAD( "ver1114_ju02", 0x000000, 0x200000, CRC(2f9ccff8) SHA1(176240cd247cc5d3efd58fe0630726a8633be2a4) ) + ROM_LOAD( "ver1114_ju02", 0x000000, 0x200000, CRC(2f9ccff8) SHA1(176240cd247cc5d3efd58fe0630726a8633be2a4) ) + ROM_LOAD( "ver1114_ju01", 0x200000, 0x200000, CRC(0048e687) SHA1(5cc0a35b5f5f8d69b2dc3728ad6d0d505d9e16c5) ) // SMT Flash MX chips // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "ver1114_esd5.ju07", 0x400000, 0x040000, CRC(8175939f) SHA1(cd0132ae0d2e35dc656434989b1f0f255ad562ab) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1205,11 +1532,11 @@ ROM_START( hedpanic ) // Story line & game instructions in English ROM_LOAD16_BYTE( "esd1.cu02", 0x000001, 0x040000, CRC(42405e9d) SHA1(0fa088b8bd921e42cedcc4083dfe41bc9888dfd1) ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1219,7 +1546,7 @@ ROM_START( hedpanic ) // Story line & game instructions in English ROM_LOAD32_WORD( "esd9.fu34", 0x000002, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask rom + ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) ) @@ -1232,11 +1559,11 @@ ROM_START( hedpanicf ) // Story line in Japanese, game instructions in English ROM_LOAD16_BYTE( "esd1", 0x000001, 0x040000, CRC(d8574925) SHA1(bd4990778b90a49aa6b10f8cf6709ce2424f546a) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(055d525f) SHA1(85ad474691f96e47311a1904015d1c92d3b2d607) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(5858372c) SHA1(dc96112587df681d53cf7449bd39477919978325) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(bd785921) SHA1(c8bcb38d5aa6f5a27f0dedf7efd1d6737d59b4ca) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1246,7 +1573,7 @@ ROM_START( hedpanicf ) // Story line in Japanese, game instructions in English ROM_LOAD32_WORD( "esd9.fu34", 0x000002, 0x200000, CRC(76b46cd2) SHA1(679cbf50ae5935e8848868081ecef4ec66424f6c) ) ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask rom + ROM_LOAD( "esd4.su10", 0x000000, 0x020000, CRC(3c11c590) SHA1(cb33845c3dc0501fff8055c2d66f412881089df1) ) // AT27010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD( "hedpanic.nv", 0x0000, 0x0080, CRC(e91f4038) SHA1(f492de71170900f87912a272ab4f4a3a37ba31fe) ) @@ -1259,11 +1586,11 @@ ROM_START( hedpanica ) // Story line & game instructions in English, copyright y ROM_LOAD16_BYTE( "esd11.cu02", 0x000001, 0x040000, CRC(e1418f23) SHA1(39f14172d9b1a0d47edfe2456362fddc22f60066) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "ju04", 0x200000, 0x200000, CRC(4f3503d7) SHA1(4bed795c7328e0ebfa97688918eb8a908c29deb8) ) - ROM_LOAD( "ju06", 0x000000, 0x200000, CRC(9f6f6193) SHA1(c7c7ae6898ab7177eefb0e525d827666e2af9f7e) ) + ROM_LOAD( "ju06", 0x000000, 0x200000, CRC(9f6f6193) SHA1(c7c7ae6898ab7177eefb0e525d827666e2af9f7e) ) + ROM_LOAD( "ju04", 0x200000, 0x200000, CRC(4f3503d7) SHA1(4bed795c7328e0ebfa97688918eb8a908c29deb8) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.bin", 0x400000, 0x080000, CRC(6968265a) SHA1(84b4f2d8b3bf6ea4117fa8281c76b58df778261d) ) // JU07 ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1286,11 +1613,11 @@ ROM_START( hedpanico ) // Story line & game instructions in English, copyright y ROM_LOAD16_BYTE( "esd1.rom", 0x000001, 0x040000, CRC(4e0682c5) SHA1(f4117f31b6426d7bf126a6c62c489b9347885b42) ) // CU02 ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) // AT27C020 mask ROM ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "sm1.ju01", 0x000000, 0x200000, CRC(8083813f) SHA1(9492e7e844e45d59f0506f69d40c338b27bd3ce3) ) - ROM_LOAD( "sm2.ju02", 0x200000, 0x200000, CRC(7a9610e4) SHA1(21ae3ec3fbddfc66416c109b091bd885d5ba0558) ) + ROM_LOAD( "sm1.ju01", 0x000000, 0x200000, CRC(8083813f) SHA1(9492e7e844e45d59f0506f69d40c338b27bd3ce3) ) + ROM_LOAD( "sm2.ju02", 0x200000, 0x200000, CRC(7a9610e4) SHA1(21ae3ec3fbddfc66416c109b091bd885d5ba0558) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.rom", 0x400000, 0x080000, CRC(82c5727f) SHA1(017f1d0c94475c51d17f12e24895f47a273a2dbb) ) // JU07 ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1316,8 +1643,8 @@ ROM_START( hedpanic830 ) // Story line & game instructions in English ROM_LOAD( "esd3.su06", 0x00000, 0x40000, BAD_DUMP CRC(a88d4424) SHA1(eefb5ac79632931a36f360713c482cd079891f91) ) ROM_REGION( 0x600000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(ffa6eb26) SHA1(c2e3371925604db0f46991cbfd39d763518ed89c) ) - ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(5554ba0f) SHA1(6d02fa6d0712aa820231a24ee7a8396cc575e788) ) + ROM_LOAD( "esd7.ju02", 0x000000, 0x200000, CRC(5554ba0f) SHA1(6d02fa6d0712aa820231a24ee7a8396cc575e788) ) + ROM_LOAD( "esd6.ju01", 0x200000, 0x200000, CRC(ffa6eb26) SHA1(c2e3371925604db0f46991cbfd39d763518ed89c) ) // expand this to take up 0x200000 bytes too so we can decode it ROM_LOAD16_BYTE( "esd5.ju07", 0x400000, 0x080000, CRC(95269b3c) SHA1(df106d9e8d4c1484ff86170adcb1932d4d02f265) ) ROM_FILL( 0x500000, 0x100000, 0x00 ) @@ -1391,21 +1718,21 @@ ROM_START( deluxe5 ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(15d6644f) SHA1(cfb8168167389855f906658511d1dc7460e13100) ) // M27C2001 EPROM ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1417,21 +1744,21 @@ ROM_START( deluxe5a ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(24f4d7b9) SHA1(bb0eabdd72a475149d6df768d9d29b545f061e54) ) // sldh ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1443,21 +1770,21 @@ ROM_START( deluxe5b ) // Deluxe 5 ROM_LOAD16_BYTE( "esd1.cu03", 0x000001, 0x040000, CRC(7cc119c8) SHA1(4d2d37e815ab3211ff88c2e6584b4eaee1cd202d) ) // sldh ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(ae10242a) SHA1(f3d18c0cb7951b5f7ee47aa2856b7554088328ed) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(248b8c05) SHA1(fe7bcc05ae0dd0a27c6ba4beb4ac155a8f3d7f7e) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1470,21 +1797,21 @@ ROM_START( deluxe4u ) // Deluxe 4 U - Removes Blackjack game, but otherwise same ROM_LOAD16_BYTE( "1.cu03", 0x000001, 0x040000, CRC(fbf14d74) SHA1(5ff5bf4ff55609452d5b8a49d8658f878541ce60) ) ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask rom + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(31de379a) SHA1(a0c9a9cec7207cc4ba33abb68bef62d7eb8e75e9) ) // AM27C020 mask ROM ROM_REGION( 0x180000, "spr", 0 ) // Sprites, 16x16x5 - ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask roms with no label + ROM_LOAD16_BYTE( "am27c020.ju06", 0x000000, 0x040000, CRC(8b853bce) SHA1(fa6e654fc965d88bb426b76cdce3417f357b25f3) ) // AM27C020 mask ROMs with no label ROM_LOAD16_BYTE( "am27c020.ju05", 0x000001, 0x040000, CRC(bbe81779) SHA1(750387fb4aaa04b7f4f1d3985896f5e11219e3ea) ) ROM_LOAD16_BYTE( "am27c020.ju04", 0x080000, 0x040000, CRC(40fa2c2f) SHA1(b9d9bfdc9343f00bad9749c76472f064c509cfce) ) ROM_LOAD16_BYTE( "am27c020.ju03", 0x080001, 0x040000, CRC(aa130fd3) SHA1(46a55d8ca59a52e610600fdba76d9729528d2871) ) ROM_LOAD16_BYTE( "am27c020.ju07", 0x100000, 0x040000, CRC(d414c3af) SHA1(9299b07a8c7a3e30a1bb6028204a049a7cb510f7) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(6df14570) SHA1(fa4fc64c984d6a94fe61ec809ec515e840388704) ) // Specific to Deluxe 4 U - No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(93175d6d) SHA1(691832134f43e17bb767dff080b2736288961414) ) // Specific to Deluxe 4 U - No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(6df14570) SHA1(fa4fc64c984d6a94fe61ec809ec515e840388704) ) // Specific to Deluxe 4 U - No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(93175d6d) SHA1(691832134f43e17bb767dff080b2736288961414) ) // Specific to Deluxe 4 U - No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask rom + ROM_LOAD( "esd4.su10", 0x00000, 0x20000, CRC(23f2b7d9) SHA1(328c951d14674760df68486841c933bad0d59fe3) ) // AT27C010 mask ROM ROM_REGION16_BE( 0x80, "eeprom", ROMREGION_ERASE00 ) // factory default settings because game doesn't init them properly otherwise ROM_LOAD16_WORD_SWAP( "eeprom", 0x0000, 0x0080, CRC(4539a8a0) SHA1(b882110b489e61ac5421fbe3551d9ee323b5d86b) ) @@ -1626,7 +1953,7 @@ ROM_START( swatpolc ) // SWAT Police ROM_LOAD16_BYTE( "esd.cu03", 0x000001, 0x040000, CRC(1070208b) SHA1(1e058774c5aee1de15ffcd26d530b23592286db1) ) // ESD labels but not numbered ROM_REGION( 0x40000, "audiocpu", 0 ) // Z80 Code - ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(80e97dbe) SHA1(d6fae689cd3737777f36c980b9a7d9e42b06a467) ) // 2 roms on PCB with an ESD3 label + ROM_LOAD( "esd3.su06", 0x00000, 0x40000, CRC(80e97dbe) SHA1(d6fae689cd3737777f36c980b9a7d9e42b06a467) ) // 2 ROMs on PCB with an ESD3 label ROM_REGION( 0x300000, "spr", 0 ) // Sprites, 16x16x5 ROM_LOAD16_BYTE( "esd4.ju06", 0x000000, 0x080000, CRC(bde1b130) SHA1(e45a2257f8c4d107dfb7401b5ae1b79951052bc6) ) @@ -1636,11 +1963,11 @@ ROM_START( swatpolc ) // SWAT Police ROM_LOAD16_BYTE( "esd5.ju07", 0x200000, 0x080000, CRC(d2c27f03) SHA1(7cbdf7f7ff17df16ca81823f69e82ae1cf96b714) ) ROM_REGION( 0x400000, "bgs", 0 ) // Layers, 16x16x8 - ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(c55897c5) SHA1(f6e0ef1c2fcfe6a511fe787a3abeff4da16d1b54) ) // No labels on the flash roms - ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(7117a6a2) SHA1(17c0ab02698cffa0582ed2d2b7dbb7fed8cd9393) ) // No labels on the flash roms + ROM_LOAD32_WORD( "fu35", 0x000000, 0x200000, CRC(c55897c5) SHA1(f6e0ef1c2fcfe6a511fe787a3abeff4da16d1b54) ) // No labels on the flash ROMs + ROM_LOAD32_WORD( "fu34", 0x000002, 0x200000, CRC(7117a6a2) SHA1(17c0ab02698cffa0582ed2d2b7dbb7fed8cd9393) ) // No labels on the flash ROMs ROM_REGION( 0x40000, "oki", 0 ) // Samples - ROM_LOAD( "at27c020.su10", 0x00000, 0x40000, CRC(c43efec2) SHA1(4ef328d8703b81328de09ecc4328763aba06e883) ) // AT27C020 mask rom with no label + ROM_LOAD( "at27c020.su10", 0x00000, 0x40000, CRC(c43efec2) SHA1(4ef328d8703b81328de09ecc4328763aba06e883) ) // AT27C020 mask ROM with no label ROM_END @@ -1823,6 +2150,9 @@ ROM_START( fantstrya ) // PCB marked: PNXND-MULTI 2002 01 01 - Only EPROMs dumpe ROM_LOAD16_BYTE( "graphics_rom_1", 0x200000, 0x080000, CRC(c8caa752) SHA1(cecc7a18a0bb59554316ed24ed0dc01d58d6ae53) ) // 1bpp, 27c040 ROM_END +} // anonymous namespace + + /*************************************************************************** @@ -1832,13 +2162,16 @@ ROM_END ***************************************************************************/ // ESD 11-09-98 -GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, multchmp25, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 2.5)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, multchmpk, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (Korea, older)", MACHINE_SUPPORTS_SAVE ) GAME( 1998, multchmpa, multchmp, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, older)", MACHINE_SUPPORTS_SAVE ) GAME( 2001, jumppop, 0, jumppop, jumppop, esd16_state, empty_init, ROT0, "ESD", "Jumping Pop (set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 2001, jumppope, jumppop, jumppop, jumppop, esd16_state, empty_init, ROT0, "Emag Soft", "Jumping Pop (set 2)", MACHINE_SUPPORTS_SAVE ) +// ESD 05-17-99 +GAME( 1999, multchmp, 0, esd16, multchmp, esd16_state, empty_init, ROT0, "ESD", "Multi Champ (World, ver. 9.6)", MACHINE_SUPPORTS_SAVE ) + // ESD 05-28-99 GAME( 1999, hedpanico, hedpanic, hedpanio, hedpanic, esd16_state, empty_init, ROT0, "ESD", "Head Panic (ver. 0615, 15/06/1999)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/esd16.h b/src/mame/misc/esd16.h deleted file mode 100644 index b2062d3c1497a..0000000000000 --- a/src/mame/misc/esd16.h +++ /dev/null @@ -1,111 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -/*************************************************************************** - - ESD 16 Bit Games - -***************************************************************************/ -#ifndef MAME_MISC_ESD16_H -#define MAME_MISC_ESD16_H - -#pragma once - -#include "decospr.h" - -#include "machine/eepromser.h" -#include "machine/gen_latch.h" - -#include "tilemap.h" - - -class esd16_state : public driver_device -{ -public: - esd16_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_vram(*this, "vram_%u", 0U), - m_scroll(*this, "scroll_%u", 0U), - m_spriteram(*this, "spriteram"), - m_layersize(*this, "head_layersize"), - m_platform_x(*this, "platform_x"), - m_platform_y(*this, "platform_y"), - m_audiobank(*this, "audiobank"), - m_io_eepromout(*this, "EEPROMOUT"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode"), - m_sprgen(*this, "spritegen"), - m_eeprom(*this, "eeprom"), - m_soundlatch(*this, "soundlatch") - { } - - void jumppop(machine_config &config); - void esd16_nosound(machine_config &config); - void esd16(machine_config &config); - void tangtang(machine_config &config); - void mchampdx(machine_config &config); - void hedpanio(machine_config &config); - void hedpanic(machine_config &config); - void fantstry(machine_config &config); - void fantstrya(machine_config &config); - -protected: - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - virtual void video_start() override ATTR_COLD; - -private: - // memory pointers - required_shared_ptr_array m_vram; - required_shared_ptr_array m_scroll; - required_shared_ptr m_spriteram; - required_shared_ptr m_layersize; - required_shared_ptr m_platform_x; - required_shared_ptr m_platform_y; - - optional_memory_bank m_audiobank; - optional_ioport m_io_eepromout; - - // video-related - tilemap_t *m_tilemap_16x16[2]{}; - tilemap_t *m_tilemap[2]{}; - u32 m_tilemap_color[2]{}; - - // devices - required_device m_maincpu; - optional_device m_audiocpu; - required_device m_gfxdecode; - optional_device m_sprgen; - optional_device m_eeprom; - optional_device m_soundlatch; - - void sound_command_w(u8 data); - void platform_w(u16 data); - u8 eeprom_r(); - void eeprom_w(u8 data); - void sound_rombank_w(u8 data); - template void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - void tilemap0_color_w(u16 data); - void tilemap0_color_jumppop_w(u16 data); - template TILE_GET_INFO_MEMBER(get_tile_info); - template TILE_GET_INFO_MEMBER(get_tile_info_16x16); - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - void fantstrya_map(address_map &map) ATTR_COLD; - void hedpanic_map(address_map &map) ATTR_COLD; - void jumppop_map(address_map &map) ATTR_COLD; - void mchampdx_map(address_map &map) ATTR_COLD; - void multchmp_map(address_map &map) ATTR_COLD; - void sound_io_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void tangtang_map(address_map &map) ATTR_COLD; - - void io_area_dsw(address_map &map, u32 base) ATTR_COLD; - void io_area_eeprom(address_map &map, u32 base) ATTR_COLD; - void palette_area(address_map &map, u32 base) ATTR_COLD; - void sprite_area(address_map &map, u32 base) ATTR_COLD; - void vid_attr_area(address_map &map, u32 base) ATTR_COLD; - void vram_area(address_map &map, u32 base) ATTR_COLD; -}; - -#endif // MAME_MISC_ESD16_H diff --git a/src/mame/misc/esd16_v.cpp b/src/mame/misc/esd16_v.cpp deleted file mode 100644 index 910e1af686db0..0000000000000 --- a/src/mame/misc/esd16_v.cpp +++ /dev/null @@ -1,197 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia, David Haywood -/*************************************************************************** - - -= ESD 16 Bit Games =- - - driver by Luca Elia (l.elia@tin.it) - - -Note: if MAME_DEBUG is defined, pressing Z with: - - Q / W Shows Layer 0 / 1 - A Shows Sprites - - Keys can be used together! - - - [ 2 Scrolling Layers ] - - Tile Size: 8 x 8 x 8 - Color Codes: 1 per Layer (banked for Layer 0) - Layer Size (tiles) : 128 x 64 - Layer Size (pixels): 1024 x 512 - - [ 256 Sprites ] - - Sprites are made of 16 x 16 x 5 tiles. Size can vary from 1 to - 8 tiles vertically, while their width is always 1 tile. - - [ Priorities ] - - The game only uses this scheme: - - Back -> Front: Layer 0, Layer 1, Sprites - -***************************************************************************/ - -#include "emu.h" -#include "esd16.h" -#include "screen.h" - - -/*************************************************************************** - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - - Color code: layer 0 (backmost) can bank at every 256 colors, - layer 1 uses the first 256. - -***************************************************************************/ - -template -TILE_GET_INFO_MEMBER(esd16_state::get_tile_info) -{ - const u16 code = m_vram[Layer][tile_index]; - tileinfo.set(0, - code, - m_tilemap_color[Layer], - 0); -} - -template -TILE_GET_INFO_MEMBER(esd16_state::get_tile_info_16x16) -{ - const u16 code = m_vram[Layer][tile_index]; - tileinfo.set(1, - code, - m_tilemap_color[Layer], - 0); -} - - -void esd16_state::tilemap0_color_w(u16 data) -{ - m_tilemap_color[0] = data & 0x03; - m_tilemap[0]->mark_all_dirty(); - m_tilemap_16x16[0]->mark_all_dirty(); - - bool const flip = BIT(data, 7); - flip_screen_set(flip); - m_sprgen->set_flip_screen(flip); -} - -void esd16_state::tilemap0_color_jumppop_w(u16 data) -{ - // todo - m_tilemap_color[0] = 2; - m_tilemap_color[1] = 1; - - bool const flip = BIT(data, 7); - flip_screen_set(flip); - m_sprgen->set_flip_screen(flip); -} - - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - - -void esd16_state::video_start() -{ - m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); - m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 0x80, 0x40); - - // swatpolc changes tilemap 0 to 16x16 at various times - m_tilemap_16x16[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<0>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); - - // hedpanic changes tilemap 1 to 16x16 at various times - m_tilemap_16x16[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(esd16_state::get_tile_info_16x16<1>)), TILEMAP_SCAN_ROWS, 16,16, 0x40, 0x40); - - m_tilemap[0]->set_scrolldx(-0x60 + 2, -0x60); - m_tilemap[1]->set_scrolldx(-0x60, -0x60 + 2); - m_tilemap_16x16[0]->set_scrolldx(-0x60 + 2, -0x60); - m_tilemap_16x16[1]->set_scrolldx(-0x60, -0x60 + 2); - - m_tilemap[1]->set_transparent_pen(0x00); - m_tilemap_16x16[1]->set_transparent_pen(0x00); -} - - -/*************************************************************************** - - - Screen Drawing - - -***************************************************************************/ - -u32 esd16_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layers_ctrl = -1; - - screen.priority().fill(0, cliprect); - -#ifdef MAME_DEBUG -if (machine().input().code_pressed(KEYCODE_Z)) -{ - int msk = 0; - if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (machine().input().code_pressed(KEYCODE_A)) msk |= 4; - if (msk != 0) layers_ctrl &= msk; -} -#endif - - if (layers_ctrl & 1) - { - if (m_layersize[0] & 0x0001) - { - m_tilemap_16x16[0]->set_scrollx(0, m_scroll[0][0]); - m_tilemap_16x16[0]->set_scrolly(0, m_scroll[0][1]); - m_tilemap_16x16[0]->draw(screen, bitmap, cliprect, 0, 0); - } - else - { - m_tilemap[0]->set_scrollx(0, m_scroll[0][0]); - m_tilemap[0]->set_scrolly(0, m_scroll[0][1]); - m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 0); - } - } - else - { - bitmap.fill(0, cliprect); - } - - - if (layers_ctrl & 2) - { - if (m_layersize[0] & 0x0002) - { - m_tilemap_16x16[1]->set_scrollx(0, m_scroll[1][0]); - m_tilemap_16x16[1]->set_scrolly(0, m_scroll[1][1]); - m_tilemap_16x16[1]->draw(screen, bitmap, cliprect, 0, 1); - } - else - { - m_tilemap[1]->set_scrollx(0, m_scroll[1][0]); - m_tilemap[1]->set_scrolly(0, m_scroll[1][1]); - m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1); - } - - } - - if (layers_ctrl & 4) m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x400); - -// popmessage("%04x %04x %04x %04x %04x",head_unknown1[0],head_layersize[0],head_unknown3[0],head_unknown4[0],head_unknown5[0]); - return 0; -} From 16817fba268b338da7db24e6a6cb36e0e1af83b8 Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 27 Feb 2025 20:41:58 +0100 Subject: [PATCH 042/272] nec/pc88va.cpp: preliminary C-Bus slot hookup --- src/mame/nec/pc88va.cpp | 153 +++++++++++++++++++++++++--------------- src/mame/nec/pc88va.h | 16 +++++ 2 files changed, 113 insertions(+), 56 deletions(-) diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index 4513506a2b91e..927f337f4814d 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -3,57 +3,55 @@ // thanks-to: Fujix /************************************************************************************************** - PC-88VA (c) 1987 NEC - - Here be dragons, a mostly compatible PC-8801 with extra V3 Mode for superset. - - preliminary driver by Angelo Salese - Special thanks to Fujix for his documentation translation help - - TODO: - - pc88va (stock version) has two bogus opcodes. - One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). - Latter will make the program flow to jump to lalaland. - This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly - hooked up, is the first opcode actually a Z80 mode switch? - - pc88va is also known to have a slightly different banking scheme and - regular YM2203 as default sound board. - - video emulation is lacking many features, cfr. pc88va_v.cpp; - - keyboard runs on undumped MCU, we currently stick irqs together on - selected keys in order to have an easier QoL while testing this. - - Backport from PC-8801 main map, apply supersets where applicable; - \- IDP has EMUL for upd3301 - \- In emulation mode HW still relies to a i8214, so it bridges thru - main ICU in cascaded mode via IRQ7; - \- beeper or dac1bit (to be confirmed); - \- (other stuff ...) - - Convert FDC usage to pc88va2_fd_if_device, we also need PIO comms for sorcer anyway; - - irq dispatch needs to be revisited, too many instances of sound irq failing for example. - The current hook-ups aren't legal, V50 core bug? - - Very inconsistent SW boot behaviours, either down to: - \- the current hack in FDC PIO port returning RNG; - \- V50 timings; - \- FDC; - - Every PC Engine OS boot tries to write TVRAM ASCII data on every boot to - $exxxx ROM region, banking bug? - - all N88 BASIC entries tries to do stuff with EMM, more banking? - - Convert SASI from PC-9801 to a shared device, apparently it's same i/f; - - Implement bus slot, which should still be PC-8801 EXPansion bus. - - (old notes, to be reordered) - - fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly - hooked up by the current z80 core - - Fix floppy motor hook-up (floppy believes to be always in even if empty drive); - - Support for PC8801 compatible mode & PC80S31K (floppy interface); - - Notes: - - hold F8 at POST to bring software dip settings menu - - PC-88VA-91 is a ROM upgrade kit for a PC-88VA -> VA2/VA3. - Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. - - References: - - PC-88VAテクニカルマニュアル - - http://www.pc88.gr.jp/vafaq/view.php/articlelist/88va/vafaq +PC-88VA (c) 1987 NEC + +Here be dragons, a mostly compatible PC-8801 with extra V3 Mode for superset. + +TODO: +- pc88va (stock version) has two bogus opcodes. + One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). + Latter will make the program flow to jump to lalaland. + This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly + hooked up, is the first opcode actually a Z80 mode switch? +- pc88va is also known to have a slightly different banking scheme and + regular YM2203 as default sound board. +- video emulation is lacking many features, cfr. pc88va_v.cpp; +- keyboard runs on undumped MCU, we currently stick irqs together on + selected keys in order to have an easier QoL while testing this. +- Backport from PC-8801 main map, apply supersets where applicable; + \- IDP has EMUL for upd3301 + \- In emulation mode HW still relies to a i8214, so it bridges thru + main ICU in cascaded mode via IRQ7; + \- beeper or dac1bit (to be confirmed); + \- (other stuff ...) +- Convert FDC usage to pc88va2_fd_if_device, we also need PIO comms for sorcer anyway; +- irq dispatch needs to be revisited, too many instances of sound irq failing for example. + The current hook-ups aren't legal, V50 core bug? +- Very inconsistent SW boot behaviours, either down to: + \- the current hack in FDC PIO port returning RNG; + \- V50 timings; + \- FDC; +- Every PC Engine OS boot tries to write TVRAM ASCII data on every boot to + $exxxx ROM region, banking bug? +- all N88 BASIC entries tries to do stuff with EMM, more banking? +- Convert SASI from PC-9801 to a shared C-Bus device, apparently it's same i/f; +- Is C-Bus I/O space shifted by +$200, as per micromus MIDI access at $e2d2? + +(old notes, to be reordered) +- fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly + hooked up by the current z80 core +- Fix floppy motor hook-up (floppy believes to be always in even if empty drive); +- Support for PC8801 compatible mode & PC80S31K (floppy interface); + +Notes: +- hold F8 at POST to bring software dip settings menu +- PC-88VA-91 is a ROM upgrade kit for a PC-88VA -> VA2/VA3. + Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. + +References: +- PC-88VAテクニカルマニュアル +- http://www.pc88.gr.jp/vafaq/view.php/articlelist/88va/vafaq +- I/O magazine 1987 08 (schematics) =================================================================================================== @@ -62,15 +60,15 @@ ICU irq 0 - 08h - timer 1 irq 1 - 09h - keyboard irq irq 2 - 0Ah - VRTC -irq 3 - 0Bh - UINT0 (B24) +irq 3 - 0Bh - UINT0 (B24) C-Bus IR3 irq 4 - 0Ch - RS-232C -irq 5 - 0Dh - UINT1 (B25) -irq 6 - 0Eh - UINT2 (B26) +irq 5 - 0Dh - UINT1 (B25) C-Bus IR5 +irq 6 - 0Eh - UINT2 (B26) C-Bus IR6 irq 7 - N/A - Slave (either secondary i8259 or i8214) i8259 slave irq 8 - 10H - SGP -irq 9 - 11H - UINT3 (HDD, B27) -irq 10 - 12H - UINT4 (B28) +irq 9 - 11H - UINT3 (HDD, B27) C-Bus IR9 +irq 10 - 12H - UINT4 (B28) C-Bus IR10 irq 11 - 13H - FDC irq 12 - 14H - Sound irq 13 - 15H - General timer 3 (mouse) @@ -1120,6 +1118,47 @@ void pc88va_state::machine_reset() m_sound_irq_pending = false; } +// TODO: add just a subset for now, all needs to be verified if compatible with C-Bus. +static void pc88va_cbus_devices(device_slot_interface &device) +{ + device.option_add("pc9801_55u", PC9801_55U); + device.option_add("pc9801_55l", PC9801_55L); + device.option_add("mpu_pc98", MPU_PC98); +} + +// NOTE: PC-88VA implementation omits some C-Bus lines compared to PC-98. +// - doesn't have ir12 and ir13, i.e. covers INT0 to INT4 only +// - no /CPUKILL pin support +// cfr. schematics pg. 260, "external bus, videoboard connector" +void pc88va_state::pc88va_cbus(machine_config &config) +{ + PC9801CBUS_SLOT(config, m_cbus[0], pc88va_cbus_devices, nullptr); + m_cbus[0]->set_memspace(m_maincpu, AS_PROGRAM); + m_cbus[0]->set_iospace(m_maincpu, AS_IO); + m_cbus[0]->int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<3>().set("ir9", FUNC(input_merger_device::in_w<0>)); + m_cbus[0]->int_cb<4>().set("ir10", FUNC(input_merger_device::in_w<0>)); + + PC9801CBUS_SLOT(config, m_cbus[1], pc88va_cbus_devices, nullptr); + m_cbus[1]->set_memspace(m_maincpu, AS_PROGRAM); + m_cbus[1]->set_iospace(m_maincpu, AS_IO); + m_cbus[1]->int_cb<0>().set("ir3", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<1>().set("ir5", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<2>().set("ir6", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<3>().set("ir9", FUNC(input_merger_device::in_w<1>)); + m_cbus[1]->int_cb<4>().set("ir10", FUNC(input_merger_device::in_w<1>)); + + // TODO: check actual number of slots for each VA iteration + + INPUT_MERGER_ANY_HIGH(config, "ir3").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ3); + INPUT_MERGER_ANY_HIGH(config, "ir5").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ5); + INPUT_MERGER_ANY_HIGH(config, "ir6").output_handler().set_inputline(m_maincpu, INPUT_LINE_IRQ6); + INPUT_MERGER_ANY_HIGH(config, "ir9").output_handler().set("pic8259_slave", FUNC(pic8259_device::ir1_w)); + INPUT_MERGER_ANY_HIGH(config, "ir10").output_handler().set("pic8259_slave", FUNC(pic8259_device::ir2_w)); +} + void pc88va_state::pc88va(machine_config &config) { V50(config, m_maincpu, MASTER_CLOCK); // μPD9002, aka V50 + μPD70008AC (for PC8801 compatibility mode) in place of 8080 @@ -1138,6 +1177,8 @@ void pc88va_state::pc88va(machine_config &config) m_maincpu->in_memr_cb().set([this] (offs_t offset) { return m_maincpu->space(AS_PROGRAM).read_byte(offset); }); m_maincpu->out_memw_cb().set([this] (offs_t offset, u8 data) { m_maincpu->space(AS_PROGRAM).write_byte(offset, data); }); + pc88va_cbus(config); + // TODO: pc80s31k here SCREEN(config, m_screen, SCREEN_TYPE_RASTER); diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index a9214be388c9b..7d5e59eefc7f3 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -14,18 +14,29 @@ //#include "pc80s31k.h" #include "pc88va_sgp.h" +#include "bus/cbus/pc9801_cbus.h" #include "bus/msx/ctrl/ctrl.h" #include "cpu/nec/v5x.h" #include "cpu/z80/z80.h" #include "imagedev/floppy.h" #include "machine/bankdev.h" #include "machine/i8255.h" +#include "machine/input_merger.h" #include "machine/pic8259.h" #include "machine/timer.h" #include "machine/upd1990a.h" #include "machine/upd765.h" #include "sound/ymopn.h" +//#include "bus/cbus/amd98.h" +//#include "bus/cbus/pc9801_26.h" +#include "bus/cbus/pc9801_55.h" +//#include "bus/cbus/pc9801_86.h" +//#include "bus/cbus/pc9801_118.h" +#include "bus/cbus/mpu_pc98.h" +//#include "bus/cbus/sb16_ct2720.h" + + #include "emupal.h" #include "screen.h" #include "softlist.h" @@ -46,6 +57,7 @@ class pc88va_state : public driver_device , m_fdd(*this, "upd765:%u", 0U) , m_pic2(*this, "pic8259_slave") , m_rtc(*this, "rtc") + , m_cbus(*this, "cbus%d", 0) , m_mouse_port(*this, "mouseport") // labelled "マウス" (mouse) - can't use "mouse" because of core -mouse option , m_opna(*this, "opna") , m_lspeaker(*this, "lspeaker") @@ -97,6 +109,9 @@ class pc88va_state : public driver_device virtual void video_start() override ATTR_COLD; void palette_init(palette_device &palette) const; +protected: + void pc88va_cbus(machine_config &config); + private: required_device m_maincpu; @@ -107,6 +122,7 @@ class pc88va_state : public driver_device // required_device m_pic1; required_device m_pic2; required_device m_rtc; + required_device_array m_cbus; required_device m_mouse_port; required_device m_opna; required_device m_lspeaker; From d96222a3f03b0208a60ff641edb33c2e397e2378 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Thu, 27 Feb 2025 22:56:59 +0100 Subject: [PATCH 043/272] tms52xx: Remove legacy spchrom implementation. --- scripts/src/sound.lua | 2 - src/devices/bus/electron/m2105.cpp | 10 +- src/devices/bus/mpf1/ssb.cpp | 1 - src/devices/bus/ti99/internal/998board.h | 1 + src/devices/bus/ti99/peb/spchsyn.cpp | 20 +- src/devices/machine/spchrom.cpp | 139 ------------- src/devices/machine/spchrom.h | 43 ---- src/devices/sound/tms5220.cpp | 242 +++++++++++++---------- src/devices/sound/tms5220.h | 20 +- src/mame/acorn/bbc.cpp | 9 +- src/mame/acorn/bbc.h | 1 + src/mame/ti/exelv.cpp | 12 +- src/mame/ti/ti99_8.cpp | 13 +- 13 files changed, 183 insertions(+), 330 deletions(-) delete mode 100644 src/devices/machine/spchrom.cpp delete mode 100644 src/devices/machine/spchrom.h diff --git a/scripts/src/sound.lua b/scripts/src/sound.lua index 3746cc64bd6d3..fe2322a5bccb8 100644 --- a/scripts/src/sound.lua +++ b/scripts/src/sound.lua @@ -1123,8 +1123,6 @@ if (SOUNDS["TMS5220"]~=null) then MAME_DIR .. "src/devices/sound/tms5220.cpp", MAME_DIR .. "src/devices/sound/tms5220.h", MAME_DIR .. "src/devices/sound/tms5110r.hxx", - MAME_DIR .. "src/devices/machine/spchrom.cpp", - MAME_DIR .. "src/devices/machine/spchrom.h", } end diff --git a/src/devices/bus/electron/m2105.cpp b/src/devices/bus/electron/m2105.cpp index 25f9e60a73f16..d2aa5da9f55db 100644 --- a/src/devices/bus/electron/m2105.cpp +++ b/src/devices/bus/electron/m2105.cpp @@ -114,16 +114,20 @@ void electron_m2105_device::device_add_mconfig(machine_config &config) output_latch_device &latch(OUTPUT_LATCH(config, "cent_data_out")); centronics.set_output_latch(latch); - SPEECHROM(config, "vsm", 0).set_reverse_bit_order(true); - tms5220_device &tms(TMS5220(config, "vsp", 640000)); - tms.set_speechrom_tag("vsm"); tms.ready_cb().set(m_via[0], FUNC(via6522_device::write_ca1)); tms.ready_cb().append(m_via[0], FUNC(via6522_device::write_pb2)); tms.irq_cb().set(m_via[0], FUNC(via6522_device::write_ca2)); tms.irq_cb().append(m_via[0], FUNC(via6522_device::write_pb3)); tms.add_route(ALL_OUTPUTS, "mono", 0.5); + TMS6100(config, "vsm", 0); + tms.m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + tms.m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + tms.addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + tms.data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + tms.romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + SPEAKER(config, "mono").front_center(); } diff --git a/src/devices/bus/mpf1/ssb.cpp b/src/devices/bus/mpf1/ssb.cpp index 1c6a00dd3d711..ef3188e6f6428 100644 --- a/src/devices/bus/mpf1/ssb.cpp +++ b/src/devices/bus/mpf1/ssb.cpp @@ -14,7 +14,6 @@ #include "emu.h" #include "ssb.h" -#include "machine/spchrom.h" #include "sound/tms5220.h" #include "bus/generic/carts.h" #include "bus/generic/slot.h" diff --git a/src/devices/bus/ti99/internal/998board.h b/src/devices/bus/ti99/internal/998board.h index f1a1fa797bb77..cf80377fce79d 100644 --- a/src/devices/bus/ti99/internal/998board.h +++ b/src/devices/bus/ti99/internal/998board.h @@ -25,6 +25,7 @@ #include "machine/ram.h" #include "machine/tmc0430.h" #include "machine/tms9901.h" +#include "machine/tms6100.h" #include "sound/sn76496.h" #include "sound/tms5220.h" #include "video/tms9928a.h" diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp index 8639f4ffa43a9..f8ec3095ae720 100644 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ b/src/devices/bus/ti99/peb/spchsyn.cpp @@ -23,8 +23,6 @@ #include "emu.h" #include "spchsyn.h" - -#include "machine/spchrom.h" #include "speaker.h" #define LOG_WARN (1U << 1) // Warnings @@ -154,22 +152,18 @@ ROM_END void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) { - SPEECHROM(config, "vsm", 0).set_reverse_bit_order(true); SPEAKER(config, "speech_out").front_center(); CD2501E(config, m_vsp, 640000L); - m_vsp->set_speechrom_tag("vsm"); + m_vsp->ready_cb().set(FUNC(ti_speech_synthesizer_device::speech_ready)); m_vsp->add_route(ALL_OUTPUTS, "speech_out", 0.50); -/* - // FIXME: Make it work. Guess we need two VSM circuits @16K. - TMS6100(config, "vsm", 640_kHz_XTAL/4); - m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); - m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); - m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); - m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); - m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); -*/ + TMS6100(config, "vsm", 0); + m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); } INPUT_PORTS_START( ti99_speech ) diff --git a/src/devices/machine/spchrom.cpp b/src/devices/machine/spchrom.cpp deleted file mode 100644 index 3cd95b87c2ebb..0000000000000 --- a/src/devices/machine/spchrom.cpp +++ /dev/null @@ -1,139 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf -/* - spchroms.c - This is an emulator for "typical" speech ROMs from TI, as used by TI99/4(a). - - In order to support its speech processor, TI designed some ROMs with a 1-bit data bus - and 4-bit address bus (multiplexed 5 times to provide a 18-bit address). - A fairly complete description of such a ROM (tms6100) is found in the tms5220 datasheet. - - One notable thing is that the address is a byte address (*NOT* a bit address). - - This file is designed to be interfaced with the tms5220 core. - Interfacing it with the tms5110 would make sense, too. - - TODO: - Create separate devices for TMS6100 & TMS6125 - Implement the serial protocol -*/ - -#include "emu.h" -#include "spchrom.h" - -#define TMS5220_ADDRESS_MASK 0x3FFFFUL /* 18-bit mask for tms5220 address */ - -// device type definition -DEFINE_DEVICE_TYPE(SPEECHROM, speechrom_device, "speechrom", "TI Speech ROM") - -speechrom_device::speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, SPEECHROM, tag, owner, clock), m_speechrom_data(nullptr), m_speechROMlen(0), - m_speechROMaddr(0), - m_load_pointer(0), - m_ROM_bits_count(0), - m_reverse(false) -{ -} - -/* - Read 'count' bits serially from speech ROM - - Actually, the ROM is expected to have reversed bit order, but there are - many dumps with normal bit order. - - compatibility mode: 01234567 01234567 01234567 ... - correct mode: 76543210 76543210 76543210 ... -*/ -int speechrom_device::read(int count) -{ - int val; - int spchbyte; - int pos; - - if (m_load_pointer) - { /* first read after load address is ignored */ - m_load_pointer = 0; - count--; - } - - if (m_speechROMaddr < m_speechROMlen) - { - val = 0; - pos = 8 - m_ROM_bits_count; - - spchbyte = (m_reverse? (m_speechrom_data[m_speechROMaddr] >> pos) : (m_speechrom_data[m_speechROMaddr] << pos)) & 0xff; - - while (count > 0) - { - val = val << 1; - if ((spchbyte & (m_reverse? 0x01:0x80))!=0) val |= 1; - spchbyte = m_reverse? (spchbyte >> 1) : (spchbyte << 1); - count--; - if (pos == 7) - { - pos = 0; - m_speechROMaddr = (m_speechROMaddr + 1) & TMS5220_ADDRESS_MASK; - if (m_speechROMaddr >= m_speechROMlen) - count = 0; - else - spchbyte = m_speechrom_data[m_speechROMaddr]; - } - else pos++; - } - m_ROM_bits_count = 8 - pos; - } - else - { - val = 0; - } - - return val; -} - -/* - Write an address nibble to speech ROM -*/ -void speechrom_device::load_address(int data) -{ - /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work. - This code does not care about this. */ - m_speechROMaddr = ( (m_speechROMaddr & ~(0xf << m_load_pointer)) - | (((unsigned long) (data & 0xf)) << m_load_pointer) ) & TMS5220_ADDRESS_MASK; - m_load_pointer += 4; - m_ROM_bits_count = 8; -} - -/* - Perform a read and branch command -*/ -void speechrom_device::read_and_branch() -{ - /* tms5220 data sheet says that if more than one speech ROM (tms6100) is present, - there is a bus contention. This code does not care about this. */ - if (m_speechROMaddr < m_speechROMlen-1) - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL) - | (((((unsigned long) m_speechrom_data[m_speechROMaddr]) << 8) - | m_speechrom_data[m_speechROMaddr+1]) & 0x3fffUL); - else if (m_speechROMaddr == m_speechROMlen-1) - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL) - | ((((unsigned long) m_speechrom_data[m_speechROMaddr]) << 8) & 0x3fffUL); - else - m_speechROMaddr = (m_speechROMaddr & 0x3c000UL); - - m_ROM_bits_count = 8; -} - -void speechrom_device::device_start() -{ - memory_region *region = memregion(tag()); - if (region == nullptr) - { - throw emu_fatalerror("No region for device '%s'\n", tag()); - } - - m_speechrom_data = region->base(); - m_speechROMlen = region->bytes(); - - save_item(NAME(m_speechROMaddr)); - save_item(NAME(m_load_pointer)); - save_item(NAME(m_ROM_bits_count)); -} diff --git a/src/devices/machine/spchrom.h b/src/devices/machine/spchrom.h deleted file mode 100644 index c070fa31eac66..0000000000000 --- a/src/devices/machine/spchrom.h +++ /dev/null @@ -1,43 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Frank Palazzolo, Aaron Giles, Jonathan Gevaryahu, Raphael Nabet, Couriersud, Michael Zapf -/* - * Voice Synthesis Memory - * - */ - -#ifndef MAME_MACHINE_SPCHROM_H -#define MAME_MACHINE_SPCHROM_H - -#pragma once - - -class speechrom_device : public device_t -{ -public: - // construction/destruction - speechrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - - /// TODO: implement bus behaviour - int read(int count); - void load_address(int data); - void read_and_branch(); - void set_reverse_bit_order(bool reverse) { m_reverse = reverse; } - -protected: - // device-level overrides - virtual void device_start() override ATTR_COLD; - -private: - uint8_t *m_speechrom_data; /* pointer to speech ROM data */ - unsigned int m_speechROMlen; /* length of data pointed by speechrom_data, from 0 to 2^18 */ - unsigned int m_speechROMaddr; /* 18 bit pointer in ROM */ - int m_load_pointer; /* which 4-bit nibble will be affected by load address */ - int m_ROM_bits_count; /* current bit position in ROM */ - bool m_reverse; -}; - - -// device type definition -DECLARE_DEVICE_TYPE(SPEECHROM, speechrom_device) - -#endif // MAME_MACHINE_SPCHROM_H diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index e63862b4f463a..a762cc08cfd4a 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -366,41 +366,69 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled one B cycle per interpolation step) */ #define FORCE_SUBC_RELOAD 1 - /* *****debugging defines***** */ /* 5220 only; above dumps the data written to the tms52xx to the error log, useful for making logged data dumps for real hardware tests */ #define LOG_DUMP_INPUT_DATA (1U << 1) + // 5220 only; above debugs FIFO stuff: writes, reads and flag updates #define LOG_FIFO (1U << 2) + +// Show parsing events +#define LOG_PARSE (1U << 3) + // dumps each speech frame as binary -#define LOG_PARSE_FRAME_DUMP_BIN (1U << 3) +#define LOG_PARSE_FRAME_DUMP_BIN (1U << 4) + // dumps each speech frame as hex -#define LOG_PARSE_FRAME_DUMP_HEX (1U << 4) +#define LOG_PARSE_FRAME_DUMP_HEX (1U << 5) + // dumps info if a frame ran out of data #define LOG_FRAME_ERRORS (1U << 6) + // dumps all non-speech-data command writes -#define LOG_COMMAND_DUMP (1U << 7) -// dumps decoded info about command writes +#define LOG_COMMAND (1U << 7) + +// Additional information about command processing #define LOG_COMMAND_VERBOSE (1U << 8) + +// Show NOP command (tends to be noisy) +#define LOG_COMMAND_NOP (1U << 9) + // spams the error log with i/o ready messages whenever the ready or irq pin is read -#define LOG_PIN_READS (1U << 9) +#define LOG_PIN_READS (1U << 10) + // dumps debug information related to the sample generation loop, i.e. whether interpolation is inhibited or not, and what the current and target values for each frame are. -#define LOG_GENERATION (1U << 10) +#define LOG_GENERATION (1U << 11) + // dumps MUCH MORE debug information related to the sample generation loop, namely the excitation, energy, pitch, k*, and output values for EVERY SINGLE SAMPLE during a frame. -#define LOG_GENERATION_VERBOSE (1U << 11) +#define LOG_GENERATION_VERBOSE (1U << 12) + // dumps the lattice filter state data each sample. -#define LOG_LATTICE (1U << 12) +#define LOG_LATTICE (1U << 13) + +// Show errors in matrix multiplication +#define LOG_MULTIPLY (1U << 14) + // dumps info to the error log whenever the analog clip hardware is (or would be) clipping the signal. -#define LOG_CLIP (1U << 13) +#define LOG_CLIP (1U << 15) + // debugs the io ready callback timer -#define LOG_IO_READY (1U << 14) +#define LOG_IO_READY (1U << 16) + // debugs the tms5220_data_r and data_w access methods which actually respect rs and ws -#define LOG_RS_WS (1U << 15) -// shows the byte being written by the CPU to the VSP -#define LOG_DATA_W (1U << 16) +#define LOG_RS_WS (1U << 17) -//#define VERBOSE (LOG_GENERAL | LOG_DUMP_INPUT_DATA | LOG_FIFO | LOG_PARSE_FRAME_DUMP_HEX | LOG_FRAME_ERRORS | LOG_COMMAND_DUMP | LOG_COMMAND_VERBOSE | LOG_PIN_READS | LOG_GENERATION | LOG_GENERATION_VERBOSE | LOG_LATTICE | LOG_CLIP | LOG_IO_READY | LOG_RS_WS | LOG_DATA_W) +// Show the byte being written by the CPU to the VSP +#define LOG_DATA_W (1U << 18) + +// Show interactions with speech rom +#define LOG_VSM (1U << 19) + +// Show state changes +#define LOG_STATE (1U << 20) + +#define VERBOSE ( LOG_GENERAL ) #include "logmacro.h" #define MAX_SAMPLE_CHUNK 512 @@ -570,10 +598,10 @@ void tms5220_device::printbits(long data, int num) /********************************************************************************************** - tms5220_device::new_int_write -- wrap a write to the VSM + tms5220_device::vsm_write -- wrap a write sent to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) +void tms5220_device::vsm_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr) { m_m0_cb(m0); m_m1_cb(m1); @@ -587,32 +615,52 @@ void tms5220_device::new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t a /********************************************************************************************** - tms5220_device::new_int_write_addr -- wrap a 'load address' set of writes to the VSM + tms5220_device::vsm_write_addr -- wrap a 'load address' set of writes sent to the VSM ***********************************************************************************************/ -void tms5220_device::new_int_write_addr(uint8_t addr) +void tms5220_device::vsm_write_addr(uint8_t addr) { - new_int_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx - new_int_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx - new_int_write(1, 0, 0, addr); // romclk 1, m0 0, m1 0, addr bus nybble = xxxx - new_int_write(0, 0, 0, addr); // romclk 0, m0 0, m1 0, addr bus nybble = xxxx + vsm_write(1, 0, 1, addr); // romclk 1, m0 0, m1 1, addr bus nybble = xxxx + vsm_write(0, 0, 1, addr); // romclk 0, m0 0, m1 1, addr bus nybble = xxxx + vsm_write(1, 0, 0, addr); // romclk 1, m0 0, m1 0, addr bus nybble = xxxx + vsm_write(0, 0, 0, addr); // romclk 0, m0 0, m1 0, addr bus nybble = xxxx } /********************************************************************************************** - tms5220_device::new_int_write_addr -- wrap a 'read bit' set of writes to the VSM + tms5220_device::vsm_read -- wrap a 'read bit' set of writes sent to the VSM ***********************************************************************************************/ -uint8_t tms5220_device::new_int_read() +uint8_t tms5220_device::vsm_read() { - new_int_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus - new_int_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus - new_int_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus - new_int_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(1, 1, 0, 0); // romclk 1, m0 1, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 1, 0, 0); // romclk 0, m0 1, m1 0, addr bus nybble = 0/open bus + vsm_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus + + uint8_t val = 0; + if (!m_data_cb.isunset()) - return m_data_cb(); - LOG("WARNING: CALLBACK MISSING, RETURNING 0!\n"); - return 0; + val = m_data_cb(); + else + LOGMASKED(LOG_VSM, "Warning: No speech memory attached, returning 0.\n"); + + return val; +} + +/********************************************************************************************** + + tms5220_device::vsm_read_and_branch -- wrap a 'read-and-branch' set of writes sent to the VSM + +***********************************************************************************************/ +void tms5220_device::vsm_read_and_branch() +{ + vsm_write(0, 1, 1, 0); // see tms5110.cpp + vsm_write(1, 1, 1, 0); // romclk 1, m0 1, m1 1, addr bus nybble = 0/open bus + vsm_write(0, 1, 1, 0); // romclk 0, m0 1, m1 1, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // see tms5110.cpp + vsm_write(1, 0, 0, 0); // romclk 1, m0 0, m1 0, addr bus nybble = 0/open bus + vsm_write(0, 0, 0, 0); // romclk 0, m0 0, m1 0, addr bus nybble = 0/open bus } /********************************************************************************************** @@ -745,7 +793,7 @@ void tms5220_device::update_fifo_status_and_ints() // also, in this case, regardless if DDIS was set, unset it. if (m_previous_talk_status && !talk_status()) { - LOG("Talk status 1 -> 0, unsetting DDIS and firing an interrupt.\n"); + LOGMASKED(LOG_STATE, "Talk status 1 -> 0, unsetting DDIS and firing an interrupt.\n"); set_interrupt_state(1); m_DDIS = false; @@ -755,13 +803,13 @@ void tms5220_device::update_fifo_status_and_ints() // Then resume it. if (m_command_register != NOCOMMAND) { - LOGMASKED(LOG_COMMAND_DUMP, "Resume command execution: %02X\n", m_command_register); + LOGMASKED(LOG_STATE, "Resume command execution: %02X\n", m_command_register); process_command(m_command_register); // Is there another data transfer pending? Resume it as well. if (m_data_latched) { - LOGMASKED(LOG_COMMAND_DUMP, "Pending byte write: %02X\n", m_write_latch); + LOGMASKED(LOG_STATE, "Pending byte write: %02X\n", m_write_latch); m_timer_io_ready->adjust(clocks_to_attotime(16), 1); } else @@ -806,32 +854,33 @@ int tms5220_device::read_bits(int count) } else { -#ifndef USE_NEW_TMS6100_CODE -/** TODO: get rid of this old code */ - // extract from VSM (speech ROM) - if (m_speechrom) - val = m_speechrom->read(count); + if (!m_m0_cb.isunset()) + { + while (count--) + { + val = (val << 1) | vsm_read(); + LOGMASKED(LOG_VSM, "bit read: %d\n", val&1); + } + } else - val = (1<16383) { b-=32768; } while (b<-16384) { b+=32768; } result = ((a*b)>>9); /** TODO: this isn't technically right to the chip, which truncates the lowest result bit, but it causes glitches otherwise. **/ - if (result>16383) LOG("matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result); - if (result<-16384) LOG("matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result); + if (result>16383) LOGMASKED(LOG_MULTIPLY, "matrix multiplier overflowed! a: %x, b: %x, result: %x", a, b, result); + if (result<-16384) LOGMASKED(LOG_MULTIPLY, "matrix multiplier underflowed! a: %x, b: %x, result: %x", a, b, result); return result; } @@ -1343,25 +1392,22 @@ int32_t tms5220_device::lattice_filter() void tms5220_device::process_command(uint8_t cmd) { - LOGMASKED(LOG_COMMAND_DUMP, "process_command called with parameter %02X\n", cmd); - m_command_register = cmd; /* parse the command */ switch (cmd & 0x70) { case 0x10 : /* read byte */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Read Byte command received\n"); + LOGMASKED(LOG_COMMAND, "Read Byte command received (%02X)\n", cmd); if (!talk_status()) /* TALKST must be clear for RDBY */ { if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } - if (m_speechrom) - m_read_byte_register = m_speechrom->read(8); /* read one byte from speech ROM... */ + + m_read_byte_register = read_bits(8); m_RDB_flag = true; m_command_register = NOCOMMAND; } @@ -1373,11 +1419,11 @@ void tms5220_device::process_command(uint8_t cmd) case 0x20: /* set rate (tms5220c and cd2501ecd only), otherwise NOP */ if (TMS5220_HAS_RATE_CONTROL) { - LOGMASKED(LOG_COMMAND_VERBOSE, "Set Rate (or NOP) command received\n"); + LOGMASKED(LOG_COMMAND_NOP, "Set Rate (or NOP) command received (%02X)\n", cmd); m_c_variant_rate = cmd&0x0F; } else - LOGMASKED(LOG_COMMAND_VERBOSE, "NOP command received\n"); + LOGMASKED(LOG_COMMAND_NOP, "NOP command received (%02X)\n", cmd); m_command_register = NOCOMMAND; break; @@ -1385,10 +1431,20 @@ void tms5220_device::process_command(uint8_t cmd) case 0x30 : /* read and branch */ if (!talk_status()) /* TALKST must be clear for RB */ { - LOGMASKED(LOG_COMMAND_VERBOSE, "Read and Branch command received\n"); + LOGMASKED(LOG_COMMAND, "Read and Branch command received (%02X)\n", cmd); m_RDB_flag = false; - if (m_speechrom) - m_speechrom->read_and_branch(); + + if (m_schedule_dummy_read) + { + m_schedule_dummy_read = false; + perform_dummy_read(); + } + + if (!m_m0_cb.isunset()) + vsm_read_and_branch(); + else + LOGMASKED(LOG_VSM, "WARNING: Read-and-branch: No memory attached to VSP\n"); + m_command_register = NOCOMMAND; } break; @@ -1396,11 +1452,13 @@ void tms5220_device::process_command(uint8_t cmd) case 0x40 : /* load address */ if (!talk_status()) /* TALKST must be clear for LA */ { - LOGMASKED(LOG_COMMAND_VERBOSE, "Load Address command received\n"); - /* tms5220 data sheet says that if we load only one 4-bit nibble, it won't work. - This code does not care about this. */ - if (m_speechrom) - m_speechrom->load_address(cmd & 0x0f); + LOGMASKED(LOG_COMMAND, "Load Address command received (%02X)\n", cmd); + + // tms5220 data sheet says that if we load only one 4-bit nibble, + // it won't work. This code does not care about this. + if (!m_m0_cb.isunset()) + vsm_write_addr(cmd & 0x0f); + m_schedule_dummy_read = true; m_command_register = NOCOMMAND; } @@ -1414,13 +1472,13 @@ void tms5220_device::process_command(uint8_t cmd) break; case 0x50 : /* speak */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Speak (VSM) command received\n"); + LOGMASKED(LOG_COMMAND, "Speak (VSM) command received (%02X)\n", cmd); if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } + m_SPEN = 1; #ifdef FAST_START_HACK m_TALK = 1; @@ -1448,7 +1506,7 @@ void tms5220_device::process_command(uint8_t cmd) break; case 0x60 : /* speak external */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Speak External command received\n"); + LOGMASKED(LOG_COMMAND, "Speak External command received (%02X)\n", cmd); // SPKEXT going active asserts /SPKEE for 2 clocks, which clears the FIFO and its counters std::fill(std::begin(m_fifo), std::end(m_fifo), 0); @@ -1478,13 +1536,13 @@ void tms5220_device::process_command(uint8_t cmd) break; case 0x70 : /* reset */ - LOGMASKED(LOG_COMMAND_VERBOSE, "Reset command received\n"); + LOGMASKED(LOG_COMMAND, "Reset command received (%02X)\n", cmd); if (m_schedule_dummy_read) { m_schedule_dummy_read = false; - if (m_speechrom) - m_speechrom->read(1); + perform_dummy_read(); } + reset(); m_command_register = NOCOMMAND; break; @@ -1595,9 +1653,9 @@ void tms5220_device::parse_frame() LOGMASKED(LOG_PARSE_FRAME_DUMP_BIN | LOG_PARSE_FRAME_DUMP_HEX, "\n"); if (m_DDIS) - LOG("Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken)); + LOGMASKED(LOG_PARSE, "Parsed a frame successfully in FIFO - %d bits remaining\n", (m_fifo_count*8)-(m_fifo_bits_taken)); else - LOG("Parsed a frame successfully in ROM\n"); + LOGMASKED(LOG_PARSE, "Parsed a frame successfully in ROM\n"); return; ranout: @@ -1648,19 +1706,6 @@ void tms5220_device::update_ready_state() void tms5220_device::device_start() { - if (m_speechrom_tag) - { - m_speechrom = siblingdevice( m_speechrom_tag ); - if( !m_speechrom ) - { - throw new emu_fatalerror("Error: %s '%s' can't find speechrom '%s'\n", shortname(), tag(), m_speechrom_tag ); - } - } - else - { - m_speechrom = nullptr; - } - switch (m_variant) { case TMS5220_IS_TMC0281: @@ -1751,18 +1796,8 @@ void tms5220_device::device_reset() m_RNG = 0x1FFF; std::fill(std::begin(m_u), std::end(m_u), 0); std::fill(std::begin(m_x), std::end(m_x), 0); - m_schedule_dummy_read = false; - if (m_speechrom) - { - m_speechrom->load_address(0); - // MZ: Do the dummy read immediately. The previous line will cause a - // shift in the address pointer in the VSM. When the next command is a - // load_address, no dummy read will occur, hence the address will be - // incorrectly shifted. - m_speechrom->read(1); - m_schedule_dummy_read = false; - } + perform_dummy_read(); // 5110 specific stuff m_PDC = 0; @@ -2160,7 +2195,6 @@ tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, , m_variant(variant) , m_irq_handler(*this) , m_readyq_handler(*this) - , m_speechrom_tag(nullptr) , m_m0_cb(*this) , m_m1_cb(*this) , m_addr_cb(*this) diff --git a/src/devices/sound/tms5220.h b/src/devices/sound/tms5220.h index 8b49852aebc25..6aa0494164bd4 100644 --- a/src/devices/sound/tms5220.h +++ b/src/devices/sound/tms5220.h @@ -5,8 +5,6 @@ #pragma once -#include "machine/spchrom.h" - /* HACK: if defined, uses impossibly perfect 'straight line' interpolation */ #undef TMS5220_PERFECT_INTERPOLATION_HACK @@ -31,9 +29,6 @@ class tms5220_device : public device_t, public device_sound_interface // Ready callback function, active low, i.e. state=0 auto ready_cb() { return m_readyq_handler.bind(); } - // old VSM support, remove me! - void set_speechrom_tag(const char *_tag) { m_speechrom_tag = _tag; } - // new VSM support auto m0_cb() { return m_m0_cb.bind(); } auto m1_cb() { return m_m1_cb.bind(); } @@ -80,10 +75,11 @@ class tms5220_device : public device_t, public device_sound_interface private: static constexpr unsigned FIFO_SIZE = 16; - // 51xx and VSM related - void new_int_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); - void new_int_write_addr(uint8_t addr); - uint8_t new_int_read(); + void vsm_write(uint8_t rc, uint8_t m0, uint8_t m1, uint8_t addr); + void vsm_write_addr(uint8_t addr); + uint8_t vsm_read(); + void vsm_read_and_branch(); + void perform_dummy_read(); // 52xx or common void register_for_save_states(); @@ -237,10 +233,8 @@ class tms5220_device : public device_t, public device_sound_interface /* callbacks */ devcb_write_line m_irq_handler; devcb_write_line m_readyq_handler; - // next 2 lines are old speechrom handler, remove me! - const char *m_speechrom_tag; - speechrom_device *m_speechrom; - // next lines are new speechrom handler + + // Speech ROM handler devcb_write_line m_m0_cb; // the M0 line devcb_write_line m_m1_cb; // the M1 line devcb_write8 m_addr_cb; // Write to ADD1,2,4,8 - 4 address bits diff --git a/src/mame/acorn/bbc.cpp b/src/mame/acorn/bbc.cpp index 55e3dd153c288..d43648d43ab72 100644 --- a/src/mame/acorn/bbc.cpp +++ b/src/mame/acorn/bbc.cpp @@ -1201,11 +1201,16 @@ void bbc_state::bbcb(machine_config &config) m_ram->set_default_size("32K"); /* speech hardware */ - SPEECHROM(config, "vsm", 0); TMS5220(config, m_tms, 640000); - m_tms->set_speechrom_tag("vsm"); m_tms->add_route(ALL_OUTPUTS, "mono", 1.0); + TMS6100(config, "vsm", 0); + m_tms->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_tms->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_tms->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_tms->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_tms->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + /* user via */ MOS6522(config, m_via6522_1, 16_MHz_XTAL / 16); m_via6522_1->writepa_handler().set("cent_data_out", FUNC(output_latch_device::write)); diff --git a/src/mame/acorn/bbc.h b/src/mame/acorn/bbc.h index 95bf25373e49d..0f5b111d8d9f7 100644 --- a/src/mame/acorn/bbc.h +++ b/src/mame/acorn/bbc.h @@ -27,6 +27,7 @@ #include "machine/i2cmem.h" #include "machine/bankdev.h" #include "machine/input_merger.h" +#include "machine/tms6100.h" #include "video/mc6845.h" #include "video/saa5050.h" #include "sound/sn76496.h" diff --git a/src/mame/ti/exelv.cpp b/src/mame/ti/exelv.cpp index 87f87ab60edf7..62ce6c555638d 100644 --- a/src/mame/ti/exelv.cpp +++ b/src/mame/ti/exelv.cpp @@ -99,7 +99,7 @@ Using the cassette: #include "cpu/tms7000/tms7000.h" #include "imagedev/cassette.h" -#include "machine/spchrom.h" +#include "machine/tms6100.h" #include "machine/timer.h" #include "sound/tms5220.h" #include "sound/spkrdev.h" @@ -923,13 +923,17 @@ void exelv_state::exeltel(machine_config &config) PALETTE(config, "palette", palette_device::RGB_3BIT); - SPEECHROM(config, "vsm", 0); - /* sound */ SPEAKER(config, "mono").front_center(); TMS5220C(config, m_tms5220c, 9.8304_MHz_XTAL / 15); // unknown divider for "VSPCLK" (generated by TAHC06 gate array) - m_tms5220c->set_speechrom_tag("vsm"); m_tms5220c->add_route(ALL_OUTPUTS, "mono", 1.00); + + TMS6100(config, "vsm", 640_kHz_XTAL/4); + m_tms5220c->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_tms5220c->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_tms5220c->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_tms5220c->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_tms5220c->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); } diff --git a/src/mame/ti/ti99_8.cpp b/src/mame/ti/ti99_8.cpp index f9a17d59ca9c3..a17cf458308b8 100644 --- a/src/mame/ti/ti99_8.cpp +++ b/src/mame/ti/ti99_8.cpp @@ -652,10 +652,6 @@ void ti99_8_state::clock_out(int state) void ti99_8_state::driver_start() { - // Need to configure the speech ROM for inverse bit order -// speechrom_device* mem = subdevice(TI998_SPEECHROM_REG); -// mem->set_reverse_bit_order(true); - save_item(NAME(m_keyboard_column)); save_item(NAME(m_ready_old)); save_item(NAME(m_int1)); @@ -743,14 +739,19 @@ void ti99_8_state::ti99_8(machine_config& config) // Speech hardware // Note: SPEECHROM uses its tag for referencing the region - SPEECHROM(config, TI998_SPEECHROM_REG, 0).set_reverse_bit_order(true); SPEAKER(config, "speech_out").front_center(); cd2501ecd_device& vsp(CD2501ECD(config, TI998_SPEECHSYN_TAG, 640000L)); vsp.ready_cb().set(TI998_MAINBOARD_TAG, FUNC(mainboard8_device::speech_ready)); - vsp.set_speechrom_tag(TI998_SPEECHROM_REG); vsp.add_route(ALL_OUTPUTS, "speech_out", 0.50); + TMS6100(config, TI998_SPEECHROM_REG, 0); + vsp.m0_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::m0_w)); + vsp.m1_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::m1_w)); + vsp.addr_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::add_w)); + vsp.data_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::data_line_r)); + vsp.romclk_cb().set(TI998_SPEECHROM_REG, FUNC(tms6100_device::clk_w)); + // Cassette drive SPEAKER(config, "cass_out").front_center(); CASSETTE(config, "cassette", 0).add_route(ALL_OUTPUTS, "cass_out", 0.25); From 15f9fa724a94530b19516bf6a78109f7981192cc Mon Sep 17 00:00:00 2001 From: m1macrophage <168948267+m1macrophage@users.noreply.github.com> Date: Fri, 28 Feb 2025 00:08:20 -0800 Subject: [PATCH 044/272] Multiple synth layouts: updated to the latest slider script. (#13422) * Explicit configuration: Using add_* functions, instead of scanning through the layout for sliders. * Separated the copy-pasteable portion of the script. * A no-op for the DMX and LinnDrum layouts. * Fixes multitouch and slider "drift", and adds support for relative adjustments to the D70 sliders (they were using an older version of the script). --- src/mame/layout/linn_linndrum.lay | 239 +++++++++++++++------------- src/mame/layout/oberheim_dmx.lay | 249 ++++++++++++++++-------------- src/mame/layout/roland_d70.lay | 211 +++++++++++++++---------- 3 files changed, 397 insertions(+), 302 deletions(-) diff --git a/src/mame/layout/linn_linndrum.lay b/src/mame/layout/linn_linndrum.lay index 66530763c41ca..f755488d13ffc 100644 --- a/src/mame/layout/linn_linndrum.lay +++ b/src/mame/layout/linn_linndrum.lay @@ -594,121 +594,140 @@ copyright-holders:m1macrophage diff --git a/src/mame/layout/oberheim_dmx.lay b/src/mame/layout/oberheim_dmx.lay index f293000cc8daa..d4a8aaeb4d939 100644 --- a/src/mame/layout/oberheim_dmx.lay +++ b/src/mame/layout/oberheim_dmx.lay @@ -92,13 +92,13 @@ copyright-holders:m1macrophage - + - + @@ -117,13 +117,13 @@ copyright-holders:m1macrophage - + - + @@ -355,8 +355,8 @@ copyright-holders:m1macrophage - - + + @@ -541,121 +541,144 @@ copyright-holders:m1macrophage diff --git a/src/mame/layout/roland_d70.lay b/src/mame/layout/roland_d70.lay index 6f767e75eb4f8..7ec0d5404d832 100644 --- a/src/mame/layout/roland_d70.lay +++ b/src/mame/layout/roland_d70.lay @@ -248,7 +248,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -256,7 +256,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -264,7 +264,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -272,7 +272,7 @@ copyright-holders:Felipe Sanches, m1macrophage - + @@ -550,84 +550,137 @@ copyright-holders:Felipe Sanches, m1macrophage From de2430a6e1324cdb5f4176e6ba668fd31eb2e026 Mon Sep 17 00:00:00 2001 From: m1macrophage <168948267+m1macrophage@users.noreply.github.com> Date: Fri, 28 Feb 2025 00:09:48 -0800 Subject: [PATCH 045/272] oberheim/xpander: Added save state support. (#13426) --- src/mame/oberheim/xpander.cpp | 59 +++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 20 deletions(-) diff --git a/src/mame/oberheim/xpander.cpp b/src/mame/oberheim/xpander.cpp index f5b21a97967a0..988e7e8d81574 100644 --- a/src/mame/oberheim/xpander.cpp +++ b/src/mame/oberheim/xpander.cpp @@ -94,7 +94,6 @@ constexpr const char NVRAM_A_TAG[] = "nvram_a"; constexpr const char NVRAM_B_TAG[] = "nvram_b"; constexpr const char VOICERAM_TAG[] = "voiceram"; -constexpr const int NUM_ENCODERS = 6; constexpr const int NUM_ENCODER_POSITIONS = 30; class xpander_state : public driver_device @@ -129,18 +128,22 @@ class xpander_state : public driver_device , m_tri2(*this, "voice_%d_tri2", 1U) , m_vcofm(*this, "voice_%d_vcofm", 1U) , m_sync(*this, "voice_%d_sync", 1U) - , m_haltreq(4, false) - , m_encoder_dir(NUM_ENCODERS, false) - , m_encoder_changed(NUM_ENCODERS, false) - , m_vfd_anode_masks(3, 0) - , m_cv(NUM_VOICES, std::vector(NUM_CVS, -1)) - , m_fast(NUM_VOICES, std::vector(NUM_CVS - 1, false)) // `-1` because RES does not support fast updates. { for (int i = 0; i < m_vfd_devices.size(); ++i) { std::string format = "vfd_" + std::to_string(i + 1) + "_char_%d"; m_vfd_outputs.push_back(output_finder<40>(*this, std::move(format), 1U)); } + + for (int voice = 0; voice < NUM_VOICES; ++voice) + { + for (int cv = 0; cv < NUM_CVS; ++cv) + { + m_cv[voice][cv] = 0; + if (cv < m_fast[voice].size()) + m_fast[voice][cv] = false; + } + } } void xpander(machine_config &config) ATTR_COLD; @@ -240,10 +243,10 @@ class xpander_state : public driver_device u8 m_firq_timer_preset = 0xff; // Preset for 40103 timer. Pulled high. u8 m_selected_cv_in = 0x07; // MUX A-C inputs. Pulled high. bool m_inhibit_cv_in = true; // MUX INHibit input. Pulled high. - std::vector m_haltreq; // Halt request to the voice board (HALTREQ). - std::vector m_encoder_dir; - std::vector m_encoder_changed; - std::vector m_vfd_anode_masks; + std::array m_haltreq = { false, false, false, false }; // Halt request to the voice board (HALTREQ). + std::array m_encoder_dir = { false, false, false, false, false, false }; + std::array m_encoder_changed = { false, false, false, false, false, false }; + std::array m_vfd_anode_masks = { 0, 0, 0 }; // Voice computer state. bool m_haltdis = 0; // Halt disable (HALTDS). @@ -253,8 +256,8 @@ class xpander_state : public driver_device float m_dac_fine_v = 0; float m_dac_vref = 4.865F; // Sampled in C806 and buffered and scaled by U815. bool m_allow_fast = false; - std::vector> m_cv; - std::vector> m_fast; + std::array, NUM_VOICES> m_cv; + std::array, NUM_VOICES> m_fast; // `-1` because RES does not support fast updates. }; TIMER_DEVICE_CALLBACK_MEMBER(xpander_state::firq_timer_elapsed) @@ -344,11 +347,10 @@ u8 xpander_state::switch_r(offs_t offset) return data; } -static u8 byte_from_vector(const std::vector &v) +static u8 byte_from_array(const std::array &v) { - assert(v.size() <= 8); u8 data = 0; - for (int i = 0; i < v.size(); ++i) + for (int i = 0; i < 6; ++i) if (v[i]) data |= 1U << i; return data; @@ -361,14 +363,14 @@ u8 xpander_state::encoder_dir_r() for (int i = 0; i < m_encoder_changed.size(); ++i) m_encoder_changed[i] = false; - const u8 data = byte_from_vector(m_encoder_dir); + const u8 data = byte_from_array(m_encoder_dir); LOGMASKED(LOG_ENCODERS, "Encoder dir_r: %02x\n", data); return data; } u8 xpander_state::encoder_sw_r() { - const u8 data = byte_from_vector(m_encoder_changed); + const u8 data = byte_from_array(m_encoder_changed); if (data != 0) LOGMASKED(LOG_ENCODERS, "Encoder sw_r: %02x\n", data); return data; @@ -848,6 +850,23 @@ void xpander_state::machine_start() m_tri2.resolve(); m_vcofm.resolve(); m_sync.resolve(); + + save_item(NAME(m_firq_timer_preset)); + save_item(NAME(m_selected_cv_in)); + save_item(NAME(m_inhibit_cv_in)); + save_item(NAME(m_haltreq)); + save_item(NAME(m_encoder_dir)); + save_item(NAME(m_encoder_changed)); + save_item(NAME(m_vfd_anode_masks)); + save_item(NAME(m_haltdis)); + save_item(NAME(m_haltack)); + save_item(NAME(m_autodone)); + save_item(NAME(m_dac_data)); + save_item(NAME(m_dac_fine_v)); + save_item(NAME(m_dac_vref)); + save_item(NAME(m_allow_fast)); + save_item(NAME(m_cv)); + save_item(NAME(m_fast)); } void xpander_state::xpander(machine_config &config) @@ -951,7 +970,7 @@ DECLARE_INPUT_CHANGED_MEMBER(xpander_state::encoder_moved) m_encoder_dir[encoder] = ((newval > oldval) || overflowed) && !underflowed; LOGMASKED(LOG_ENCODERS, "Encoder %d changed from: %d to: %d (o: %d, u: %d), dir: %d\n", - encoder, oldval, newval, overflowed, underflowed, bool(m_encoder_dir[encoder])); + encoder, oldval, newval, overflowed, underflowed, m_encoder_dir[encoder]); } DECLARE_INPUT_CHANGED_MEMBER(xpander_state::memory_protect_changed) @@ -1144,4 +1163,4 @@ ROM_END } // anonymous namespace // In production from 1984 to 1988. -SYST(1984, xpander, 0, 0, xpander, xpander, xpander_state, empty_init, "Oberheim", "Xpander", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +SYST(1984, xpander, 0, 0, xpander, xpander, xpander_state, empty_init, "Oberheim", "Xpander", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_NO_SOUND) From de2026bcaaa403f7f1561e8edb284d675d588d8a Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Fri, 28 Feb 2025 14:20:20 +0100 Subject: [PATCH 046/272] pc/sis630.cpp: Add notes and ROM placeholder for GameCristal JAMMA interface PCB (#13376) --- src/mame/pc/sis630.cpp | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/mame/pc/sis630.cpp b/src/mame/pc/sis630.cpp index f1b75fe05249c..5977298e454de 100644 --- a/src/mame/pc/sis630.cpp +++ b/src/mame/pc/sis630.cpp @@ -151,6 +151,24 @@ Notes on possible shutms11 BIOS bugs: 80000000 00000000 00000000 B8BA1941 00038881 C0000000 00000000 00000000 B8BA1941 00038881 + + The JAMMA adaptor is a small external PCB from Azkoyen with an MCU (unknown type): + _______________ _______ + ____--__-- _______________| DB-25 |________| DB-9 |_____ + | |__||__| <-Jacks |______________| |______| | + | _________ ___ | + ||o o o o |<-Power ________________ | | | + | | MCU | | <-MAX232N + | |_______________| |__| | + | _________ Xtal | + | |DIPS x 8| 6 MHz | + | | + | Test sw->(o) _________ _________ _________ | + | Service sw->(o) SN74HC245N SN74HC245N SN74HC245N | + |_________ ___________| + |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_| + JAMMA + **************************************************************************************************/ #include "emu.h" @@ -400,9 +418,8 @@ ROM_START(zidav630e) // ROMX_LOAD( "V630e104.bin", 0x040000, 0x040000, CRC(?) SHA1(?), ROM_BIOS(1) ) ROM_END -/* - * Arcade based GameCristal - */ + +// GameCristal - PC-based multigame arcade (with an unknown emulator). ROM_START(gamecstl) ROM_REGION32_LE(0x80000, "flash", ROMREGION_ERASEFF ) @@ -412,6 +429,9 @@ ROM_START(gamecstl) DISK_REGION( "pci:00.1:ide1:0:hdd" ) DISK_IMAGE( "gamecstl", 0, SHA1(b431af3c42c48ba07972d77a3d24e60ee1e4359e) ) + + ROM_REGION( 0x2000, "mcu", 0 ) + ROM_LOAD( "gamecristal_datasat.bin", 0x0000, 0x2000, NO_DUMP ) // MCU on the JAMMA interface PCB, unknown type and ROM size ROM_END ROM_START(gamecst2) @@ -421,15 +441,18 @@ ROM_START(gamecst2) DISK_REGION( "pci:00.1:ide1:0:hdd" ) DISK_IMAGE( "gamecst2", 0, SHA1(14e1b311cb474801c7bdda3164a0c220fb102159) ) + + ROM_REGION( 0x2000, "mcu", 0 ) + ROM_LOAD( "gamecristal_datasat.bin", 0x0000, 0x2000, NO_DUMP ) // MCU on the JAMMA interface PCB, unknown type and ROM size ROM_END } // anonymous namespace -COMP( 2000, shutms11, 0, 0, sis630, sis630, sis630_state, empty_init, "Shuttle", "MS11 PC (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) -COMP( 2001, asuspolo, 0, 0, asuspolo, sis630, sis630_state, empty_init, "Asus", "Polo \"Genie\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // hangs at CMOS check first time, corrupts flash ROM on successive boots -COMP( 2001, asuscusc, 0, 0, asuscusc, sis630, sis630_state, empty_init, "Asus", "Terminator P-3 \"Cusc\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // fails CMOS test, does crc with I/O accesses at $c00 -COMP( 2001, zidav630e, 0, 0, zidav630e,sis630, sis630_state, empty_init, "Zida", "V630E Baby AT (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Flash ROM corrupts often, otherwise same-y as shutms11 +COMP( 2000, shutms11, 0, 0, sis630, sis630, sis630_state, empty_init, "Shuttle", "MS11 PC (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +COMP( 2001, asuspolo, 0, 0, asuspolo, sis630, sis630_state, empty_init, "Asus", "Polo \"Genie\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // hangs at CMOS check first time, corrupts flash ROM on successive boots +COMP( 2001, asuscusc, 0, 0, asuscusc, sis630, sis630_state, empty_init, "Asus", "Terminator P-3 \"Cusc\" (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // fails CMOS test, does crc with I/O accesses at $c00 +COMP( 2001, zidav630e, 0, 0, zidav630e,sis630, sis630_state, empty_init, "Zida", "V630E Baby AT (SiS630 chipset)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // Flash ROM corrupts often, otherwise same-y as shutms11 // Arcade based games From 0a861ff810f00554e6b16e329018918434009774 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 1 Mar 2025 00:21:01 +1100 Subject: [PATCH 047/272] Cleaned up some stuff: * oberheim/xpander.cpp: Use multi-dimensional output finders algorithms and range-based for loops. * util/chd.cpp: Use a C++17ism to reduce if nesting a bit. * sound/tms5220.cpp: Five an example VERBOSE value that will actually do something rather than LOG_GENERAL which isn't used in the file at all. --- src/devices/bus/ti99/peb/spchsyn.cpp | 1 + src/devices/sound/tms5220.cpp | 4 +- src/lib/util/chd.cpp | 32 ++++++--------- src/mame/acorn/bbc.cpp | 7 +++- src/mame/acorn/bbc.h | 1 - src/mame/misc/esd16.cpp | 2 +- src/mame/oberheim/xpander.cpp | 60 ++++++++++++---------------- 7 files changed, 47 insertions(+), 60 deletions(-) diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp index f8ec3095ae720..0cf577dad868a 100644 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ b/src/devices/bus/ti99/peb/spchsyn.cpp @@ -23,6 +23,7 @@ #include "emu.h" #include "spchsyn.h" + #include "speaker.h" #define LOG_WARN (1U << 1) // Warnings diff --git a/src/devices/sound/tms5220.cpp b/src/devices/sound/tms5220.cpp index a762cc08cfd4a..f472e9aa86efd 100644 --- a/src/devices/sound/tms5220.cpp +++ b/src/devices/sound/tms5220.cpp @@ -395,7 +395,7 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled // Show NOP command (tends to be noisy) #define LOG_COMMAND_NOP (1U << 9) -// spams the error log with i/o ready messages whenever the ready or irq pin is read +// spams the error log with I/O ready messages whenever the ready or IRQ pin is read #define LOG_PIN_READS (1U << 10) // dumps debug information related to the sample generation loop, i.e. whether interpolation is inhibited or not, and what the current and target values for each frame are. @@ -428,7 +428,7 @@ emulating the tms5220 in MCU code). Look for a 16-pin chip at U6 labeled // Show state changes #define LOG_STATE (1U << 20) -#define VERBOSE ( LOG_GENERAL ) +//#define VERBOSE (LOG_FIFO | LOG_PARSE | LOG_FRAME_ERRORS | LOG_COMMAND | LOG_GENERATION | LOG_DATA_W | LOG_STATE) #include "logmacro.h" #define MAX_SAMPLE_CHUNK 512 diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index 9395bb39c451c..c05977a84eb83 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -3108,31 +3108,25 @@ std::error_condition chd_file_compressor::compress_continue(double &progress, do if (!err && codec == CHD_CODEC_NONE) // TODO: report error? m_total_out += m_hunkbytes; } + else if (uint64_t const selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); selfhunk != hashmap::NOT_FOUND) + { + // the hunk is in the self map + hunk_copy_from_self(item.m_hunknum, selfhunk); + } else { - // for compressing, process the result - - // first see if the hunk is in the parent or self maps - uint64_t selfhunk = m_current_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - if (selfhunk != hashmap::NOT_FOUND) + // if not, see if it's in the parent map + uint64_t const parentunit = m_parent ? m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1) : hashmap::NOT_FOUND; + if (parentunit != hashmap::NOT_FOUND) { - hunk_copy_from_self(item.m_hunknum, selfhunk); + hunk_copy_from_parent(item.m_hunknum, parentunit); } else { - // if not, see if it's in the parent map - uint64_t const parentunit = m_parent ? m_parent_map.find(item.m_hash[0].m_crc16, item.m_hash[0].m_sha1) : hashmap::NOT_FOUND; - if (parentunit != hashmap::NOT_FOUND) - { - hunk_copy_from_parent(item.m_hunknum, parentunit); - } - else - { - // otherwise, append it compressed and add to the self map - hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); - m_total_out += item.m_complen; - m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); - } + // otherwise, append it compressed and add to the self map + hunk_write_compressed(item.m_hunknum, item.m_compression, item.m_compressed, item.m_complen, item.m_hash[0].m_crc16); + m_total_out += item.m_complen; + m_current_map.add(item.m_hunknum, item.m_hash[0].m_crc16, item.m_hash[0].m_sha1); } } diff --git a/src/mame/acorn/bbc.cpp b/src/mame/acorn/bbc.cpp index d43648d43ab72..75d53da3aec99 100644 --- a/src/mame/acorn/bbc.cpp +++ b/src/mame/acorn/bbc.cpp @@ -45,15 +45,18 @@ #include "emu.h" #include "bbc.h" + +#include "imagedev/cassette.h" +#include "machine/tms6100.h" + #include "softlist_dev.h" #include "speaker.h" #include "formats/acorn_dsk.h" +#include "formats/csw_cas.h" #include "formats/fsd_dsk.h" #include "formats/pc_dsk.h" -#include "imagedev/cassette.h" #include "formats/uef_cas.h" -#include "formats/csw_cas.h" #include "utf8.h" diff --git a/src/mame/acorn/bbc.h b/src/mame/acorn/bbc.h index 0f5b111d8d9f7..95bf25373e49d 100644 --- a/src/mame/acorn/bbc.h +++ b/src/mame/acorn/bbc.h @@ -27,7 +27,6 @@ #include "machine/i2cmem.h" #include "machine/bankdev.h" #include "machine/input_merger.h" -#include "machine/tms6100.h" #include "video/mc6845.h" #include "video/saa5050.h" #include "sound/sn76496.h" diff --git a/src/mame/misc/esd16.cpp b/src/mame/misc/esd16.cpp index be6b197fe514f..8d6a7086f39dc 100644 --- a/src/mame/misc/esd16.cpp +++ b/src/mame/misc/esd16.cpp @@ -971,7 +971,7 @@ void esd16_state::machine_start() { if (m_audiobank) { - u8* audiorom = memregion("audiocpu")->base(); + u8 *const audiorom = memregion("audiocpu")->base(); m_audiobank->configure_entries(0, 16, &audiorom[0x0000], 0x4000); } diff --git a/src/mame/oberheim/xpander.cpp b/src/mame/oberheim/xpander.cpp index 988e7e8d81574..97461e4272d98 100644 --- a/src/mame/oberheim/xpander.cpp +++ b/src/mame/oberheim/xpander.cpp @@ -57,6 +57,7 @@ intended as an educational tool. There is no attempt to emulate audio. */ #include "emu.h" + #include "bus/midi/midi.h" #include "cpu/m6809/m6809.h" #include "machine/6850acia.h" @@ -69,6 +70,9 @@ intended as an educational tool. There is no attempt to emulate audio. #include "machine/timer.h" #include "video/pwm.h" +#include +#include + #include "oberheim_xpander.lh" #define LOG_CV_IN (1U << 1) @@ -113,37 +117,26 @@ class xpander_state : public driver_device , m_cv_io(*this, "cv_in_%d", 1U) , m_pedal_io(*this, "pedal_%d", 1U) , m_vfd_devices(*this, "vfd_%d", 0U) - , m_vfd_outputs() + , m_vfd_outputs(*this, "vfd_%u_char_%u", 1U, 1U) , m_cassmute(*this, "cassmute") , m_voicecpu(*this, VOICECPU_TAG) , m_voicepit(*this, "voice_pit_8253") , m_voiceram(*this, VOICERAM_TAG) - , m_fm_mdac(*this, "voice_%d_fm_mdac", 1U) - , m_filter_mode(*this, "voice_%d_filter_mode", 1U) - , m_noise(*this, "voice_%d_noise", 1U) - , m_pan(*this, "voice_%d_pan", 1U) - , m_saw1(*this, "voice_%d_saw1", 1U) - , m_saw2(*this, "voice_%d_saw2", 1U) - , m_tri1(*this, "voice_%d_tri1", 1U) - , m_tri2(*this, "voice_%d_tri2", 1U) - , m_vcofm(*this, "voice_%d_vcofm", 1U) - , m_sync(*this, "voice_%d_sync", 1U) + , m_fm_mdac(*this, "voice_%u_fm_mdac", 1U) + , m_filter_mode(*this, "voice_%u_filter_mode", 1U) + , m_noise(*this, "voice_%u_noise", 1U) + , m_pan(*this, "voice_%u_pan", 1U) + , m_saw1(*this, "voice_%u_saw1", 1U) + , m_saw2(*this, "voice_%u_saw2", 1U) + , m_tri1(*this, "voice_%u_tri1", 1U) + , m_tri2(*this, "voice_%u_tri2", 1U) + , m_vcofm(*this, "voice_%u_vcofm", 1U) + , m_sync(*this, "voice_%u_sync", 1U) { - for (int i = 0; i < m_vfd_devices.size(); ++i) - { - std::string format = "vfd_" + std::to_string(i + 1) + "_char_%d"; - m_vfd_outputs.push_back(output_finder<40>(*this, std::move(format), 1U)); - } - - for (int voice = 0; voice < NUM_VOICES; ++voice) - { - for (int cv = 0; cv < NUM_CVS; ++cv) - { - m_cv[voice][cv] = 0; - if (cv < m_fast[voice].size()) - m_fast[voice][cv] = false; - } - } + for (auto &cv : m_cv) + std::fill(cv.begin(), cv.end(), 0.0F); + for (auto &fast : m_fast) + std::fill(fast.begin(), fast.end(), false); } void xpander(machine_config &config) ATTR_COLD; @@ -217,7 +210,7 @@ class xpander_state : public driver_device required_ioport_array<6> m_cv_io; required_ioport_array<2> m_pedal_io; required_device_array m_vfd_devices; - std::vector> m_vfd_outputs; + output_finder<3, 40> m_vfd_outputs; output_finder<> m_cassmute; // Voice computer. @@ -360,8 +353,7 @@ u8 xpander_state::encoder_dir_r() { // The DIR* signal also resets encoder change detection flip-flops when // active (low). - for (int i = 0; i < m_encoder_changed.size(); ++i) - m_encoder_changed[i] = false; + std::fill(m_encoder_changed.begin(), m_encoder_changed.end(), false); const u8 data = byte_from_array(m_encoder_dir); LOGMASKED(LOG_ENCODERS, "Encoder dir_r: %02x\n", data); @@ -626,7 +618,7 @@ void xpander_state::voice_dac_enable_w(offs_t offset, u8 data) // Generated by D805, R856, R857, R854, U815. static constexpr const float V_REF_U815 = 4; static constexpr const float DEFAULT_UNSCALED_VREF = - V_REF_U815 * RES_VOLTAGE_DIVIDER(RES_K(18.2), RES_K(10)); + V_REF_U815 * RES_VOLTAGE_DIVIDER(RES_K(18.2), RES_K(10)); static constexpr const float VREF_SCALER = 1 + RES_K(2.43) / RES_K(1); // U815, R851, R852. static constexpr const float DEFAULT_VREF = DEFAULT_UNSCALED_VREF * VREF_SCALER; static constexpr const float CEM3374_NOMINAL_TEMPCO_V = 2.5; @@ -725,7 +717,7 @@ void xpander_state::voice_dac_clear_w(u8 data) m_dac_data = ((data & LOW7_MASK) << 7) | (m_dac_data & LOW7_MASK); m_allow_fast = BIT(data, 7); LOGMASKED(LOG_DAC_VERBOSE, "DAC clear %02x: %04x - %d\n", - data, m_dac_data, m_allow_fast); + data, m_dac_data, m_allow_fast); } void xpander_state::voice_dac_w(offs_t offset, u8 data) @@ -837,9 +829,7 @@ void xpander_state::machine_start() firq_timer_elapsed(*m_firq_timer, m_firq_timer_preset); // Reset the timer. m_cassmute.resolve(); - for (output_finder<40> &vfd_char_output : m_vfd_outputs) - vfd_char_output.resolve(); - + m_vfd_outputs.resolve(); m_fm_mdac.resolve(); m_filter_mode.resolve(); m_noise.resolve(); @@ -900,7 +890,7 @@ void xpander_state::xpander(machine_config &config) { PWM_DISPLAY(config, m_vfd_devices[i]).set_size(40, 16); // 40 x 16-segment display. m_vfd_devices[i]->set_segmask(0xffffffffff, 0xffff); - m_vfd_devices[i]->output_digit().set([this, i](offs_t offset, u32 data) { display_output_w(i, offset, data); }); + m_vfd_devices[i]->output_digit().set([this, i] (offs_t offset, u32 data) { display_output_w(i, offset, data); }); } config.set_default_layout(layout_oberheim_xpander); From 31b187b51e3d72d2d382911d1012f12250f0ee46 Mon Sep 17 00:00:00 2001 From: cam900 Date: Fri, 28 Feb 2025 23:04:01 +0900 Subject: [PATCH 048/272] yachiyo/mole.cpp: Cleaned up code: (#13427) Use a memory share creator for tile RAM, improved member names and tags. --- src/mame/yachiyo/mole.cpp | 72 ++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/src/mame/yachiyo/mole.cpp b/src/mame/yachiyo/mole.cpp index c265466387b71..b332a5f2ab4cb 100644 --- a/src/mame/yachiyo/mole.cpp +++ b/src/mame/yachiyo/mole.cpp @@ -59,6 +59,8 @@ #include "speaker.h" #include "tilemap.h" +#include + namespace { @@ -68,10 +70,11 @@ class mole_state : public driver_device mole_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode") + m_gfxdecode(*this, "gfxdecode"), + m_tileram(*this, "tileram", 0x400*2, ENDIANNESS_LITTLE) { } - void mole(machine_config &config); + void mole(machine_config &config) ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -80,21 +83,21 @@ class mole_state : public driver_device required_device m_maincpu; required_device m_gfxdecode; + memory_share_creator m_tileram; + /* video-related */ tilemap_t *m_bg_tilemap = nullptr; uint8_t m_tile_bank = 0; - /* memory */ - uint16_t m_tileram[0x400]; - - void mole_tileram_w(offs_t offset, uint8_t data); - void mole_tilebank_w(uint8_t data); - void mole_irqack_w(uint8_t data); - void mole_flipscreen_w(uint8_t data); - uint8_t mole_protection_r(offs_t offset); + void tileram_w(offs_t offset, uint8_t data); + void tilebank_w(uint8_t data); + void irqack_w(uint8_t data); + void flipscreen_w(uint8_t data); + uint8_t protection_r(offs_t offset); TILE_GET_INFO_MEMBER(get_bg_tile_info); - uint32_t screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void mole_map(address_map &map) ATTR_COLD; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; }; @@ -106,42 +109,41 @@ class mole_state : public driver_device TILE_GET_INFO_MEMBER(mole_state::get_bg_tile_info) { - uint16_t code = m_tileram[tile_index]; + uint16_t const code = m_tileram[tile_index]; - tileinfo.set((code & 0x200) ? 1 : 0, code & 0x1ff, 0, 0); + tileinfo.set(BIT(code, 9), code & 0x1ff, 0, 0); } void mole_state::video_start() { - memset(m_tileram, 0, sizeof(m_tileram)); + std::fill_n(&m_tileram[0], m_tileram.length(), 0); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(mole_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 40, 25); - save_item(NAME(m_tileram)); save_item(NAME(m_tile_bank)); } -void mole_state::mole_tileram_w(offs_t offset, uint8_t data) +void mole_state::tileram_w(offs_t offset, uint8_t data) { m_tileram[offset] = data | (m_tile_bank << 8); m_bg_tilemap->mark_tile_dirty(offset); } -void mole_state::mole_tilebank_w(uint8_t data) +void mole_state::tilebank_w(uint8_t data) { m_tile_bank = data; } -void mole_state::mole_irqack_w(uint8_t data) +void mole_state::irqack_w(uint8_t data) { m_maincpu->set_input_line(0, CLEAR_LINE); } -void mole_state::mole_flipscreen_w(uint8_t data) +void mole_state::flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x01); + flip_screen_set(BIT(data, 0)); } -uint32_t mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t mole_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; @@ -154,7 +156,7 @@ uint32_t mole_state::screen_update_mole(screen_device &screen, bitmap_ind16 &bit * *************************************/ -uint8_t mole_state::mole_protection_r(offs_t offset) +uint8_t mole_state::protection_r(offs_t offset) { /* Following are all known examples of Mole Attack ** code reading from the protection circuitry: @@ -209,23 +211,23 @@ uint8_t mole_state::mole_protection_r(offs_t offset) * *************************************/ -void mole_state::mole_map(address_map &map) +void mole_state::main_map(address_map &map) { map(0x0000, 0x03ff).ram(); - map(0x0800, 0x08ff).r(FUNC(mole_state::mole_protection_r)); + map(0x0800, 0x08ff).r(FUNC(mole_state::protection_r)); map(0x0800, 0x0800).nopw(); // ??? map(0x0820, 0x0820).nopw(); // ??? map(0x5000, 0x7fff).mirror(0x8000).rom(); - map(0x8000, 0x83ff).w(FUNC(mole_state::mole_tileram_w)).nopr(); - map(0x8400, 0x8400).w(FUNC(mole_state::mole_tilebank_w)); + map(0x8000, 0x83ff).w(FUNC(mole_state::tileram_w)).nopr(); + map(0x8400, 0x8400).w(FUNC(mole_state::tilebank_w)); map(0x8c00, 0x8c01).w("aysnd", FUNC(ay8910_device::data_address_w)); map(0x8c40, 0x8c40).nopw(); // ??? map(0x8c80, 0x8c80).nopw(); // ??? map(0x8c81, 0x8c81).nopw(); // ??? - map(0x8d00, 0x8d00).portr("DSW").w(FUNC(mole_state::mole_irqack_w)); + map(0x8d00, 0x8d00).portr("DSW").w(FUNC(mole_state::irqack_w)); map(0x8d40, 0x8d40).portr("IN0"); map(0x8d80, 0x8d80).portr("IN1"); - map(0x8dc0, 0x8dc0).portr("IN2").w(FUNC(mole_state::mole_flipscreen_w)); + map(0x8dc0, 0x8dc0).portr("IN2").w(FUNC(mole_state::flipscreen_w)); } @@ -307,8 +309,8 @@ static const gfx_layout tile_layout = static GFXDECODE_START( gfx_mole ) - GFXDECODE_ENTRY( "gfx1", 0x0000, tile_layout, 0x00, 1 ) - GFXDECODE_ENTRY( "gfx1", 0x3000, tile_layout, 0x00, 1 ) + GFXDECODE_ENTRY( "gfx", 0x0000, tile_layout, 0x00, 1 ) + GFXDECODE_ENTRY( "gfx", 0x3000, tile_layout, 0x00, 1 ) GFXDECODE_END @@ -321,8 +323,8 @@ GFXDECODE_END void mole_state::mole(machine_config &config) { /* basic machine hardware */ - M6502(config, m_maincpu, 2000000); // ??? - m_maincpu->set_addrmap(AS_PROGRAM, &mole_state::mole_map); + M6502(config, m_maincpu, 2'000'000); // ??? + m_maincpu->set_addrmap(AS_PROGRAM, &mole_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(mole_state::irq0_line_assert)); /* video hardware */ @@ -331,7 +333,7 @@ void mole_state::mole(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); screen.set_size(40*8, 25*8); screen.set_visarea(0*8, 40*8-1, 0*8, 25*8-1); - screen.set_screen_update(FUNC(mole_state::screen_update_mole)); + screen.set_screen_update(FUNC(mole_state::screen_update)); screen.set_palette("palette"); GFXDECODE(config, m_gfxdecode, "palette", gfx_mole); @@ -356,7 +358,7 @@ ROM_START( mole ) // ALL ROMS ARE 2732 ROM_LOAD( "m2a.7h", 0x6000, 0x1000, CRC(f2a90642) SHA1(da6887725d70924fc4b9cca83172276976f5020c) ) ROM_LOAD( "m1a.8h", 0x7000, 0x1000, CRC(cff0119a) SHA1(48fc81b8c68e977680e7b8baf1193f0e7e0cd013) ) - ROM_REGION( 0x6000, "gfx1", 0 ) + ROM_REGION( 0x6000, "gfx", 0 ) ROM_LOAD( "mea.4a", 0x0000, 0x1000, CRC(49d89116) SHA1(aa4cde07e10624072e50ba5bd209acf93092cf78) ) ROM_LOAD( "mca.6a", 0x1000, 0x1000, CRC(04e90300) SHA1(c908a3a651e50428eedc2974160cdbf2ed946abc) ) ROM_LOAD( "maa.9a", 0x2000, 0x1000, CRC(6ce9442b) SHA1(c08bf0911f1dfd4a3f9452efcbb3fd3688c4bf8c) ) From f0741046d2d0d6170634758f2b3963a546a5ec39 Mon Sep 17 00:00:00 2001 From: Vincent-Halver Date: Fri, 28 Feb 2025 06:14:46 -0800 Subject: [PATCH 049/272] philips/mcd212.cpp: Renamed matte flag constants and refactored matte handling code. (#13304) Renamed "regions" to "mattes" to match Green Book convention. --- src/mame/philips/mcd212.cpp | 453 ++++++++++++++++-------------------- src/mame/philips/mcd212.h | 43 ++-- 2 files changed, 219 insertions(+), 277 deletions(-) diff --git a/src/mame/philips/mcd212.cpp b/src/mame/philips/mcd212.cpp index e5e69f862649b..dab10c44e6e08 100644 --- a/src/mame/philips/mcd212.cpp +++ b/src/mame/philips/mcd212.cpp @@ -42,175 +42,165 @@ // device type definition DEFINE_DEVICE_TYPE(MCD212, mcd212_device, "mcd212", "MCD212 VDSC") -inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_weight_factor(const uint32_t region_idx) +inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_weight_factor(const uint32_t matte_idx) { - return (uint8_t)((m_region_control[region_idx] & RC_WF) >> RC_WF_SHIFT); + return (uint8_t)((m_matte_control[matte_idx] & MC_WF) >> MC_WF_SHIFT); } -inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_region_op(const uint32_t region_idx) +inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_matte_op(const uint32_t matte_idx) { - return (m_region_control[region_idx] & RC_OP) >> RC_OP_SHIFT; + return (m_matte_control[matte_idx] & MC_OP) >> MC_OP_SHIFT; } -void mcd212_device::update_region_arrays() +void mcd212_device::update_matte_arrays() { - bool latched_rf[2]{ false, false }; + bool latched_mf[2]{ false, false }; uint8_t latched_wfa = m_weight_factor[0][0]; uint8_t latched_wfb = m_weight_factor[1][0]; const int width = get_screen_width(); - if (BIT(m_image_coding_method, ICM_NR_BIT)) + const int num_mattes = BIT(m_image_coding_method, ICM_NM_BIT) ? 2 : 1; + const bool matte_flag = BIT(m_matte_control[0], MC_MF_BIT); // MF bit must be the same. See 5.10.2 Matte Commands + + int x = 0; + int matte_idx = 0; + for (; x < width; x++) { - if (get_region_op(0) == 0 && get_region_op(4) == 0) + for (int f1 = 0; f1 < num_mattes; f1++) { - std::fill_n(m_weight_factor[0], std::size(m_weight_factor[0]), latched_wfa); - std::fill_n(m_weight_factor[1], std::size(m_weight_factor[1]), latched_wfb); - std::fill_n(m_region_flag[0], std::size(m_region_flag[0]), false); - std::fill_n(m_region_flag[1], std::size(m_region_flag[1]), false); - return; - } - - for (int x = 0; x < width; x++) - { - for (int flag = 0; flag < 2; flag++) + const int max_matte_id = (0x10 >> num_mattes) + (f1 << 2); + const int flag = (num_mattes == 2) ? f1 : matte_flag; + if (num_mattes == 2) { - for (int region = 0; region < 4; region++) + for (int matte = 0; matte < max_matte_id; matte++) { - const int region_idx = (flag << 2) + region; - const uint32_t region_ctrl = m_region_control[region_idx]; - const uint32_t region_op = get_region_op(region_idx); - if (region_op == 0) + const int matte_idx = (flag << 2) + matte; + const uint32_t matte_ctrl = m_matte_control[matte_idx]; + const uint32_t matte_op = get_matte_op(matte_idx); + if (matte_op == 0) { break; } - if (x == (region_ctrl & RC_X)) + if (x == (matte_ctrl & MC_X)) { - switch (region_op) + switch (matte_op) { - case 0: // End of region control for line - break; - case 1: - case 2: - case 3: // Not used - break; - case 4: // Change weight of plane A - latched_wfa = get_weight_factor(region_idx); - break; - case 5: // Not used - break; - case 6: // Change weight of plane B - latched_wfb = get_weight_factor(region_idx); - break; - case 7: // Not used - break; - case 8: // Reset region flag - latched_rf[flag] = false; - break; - case 9: // Set region flag - latched_rf[flag] = true; - break; - case 10: // Not used - case 11: // Not used - break; - case 12: // Reset region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 13: // Set region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; - case 14: // Reset region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = false; - break; - case 15: // Set region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = true; - break; + case 0: // End of matte control for line + break; + case 1: + case 2: + case 3: // Not used + break; + case 4: // Change weight of plane A + latched_wfa = get_weight_factor(matte_idx); + break; + case 5: // Not used + break; + case 6: // Change weight of plane B + latched_wfb = get_weight_factor(matte_idx); + break; + case 7: // Not used + break; + case 8: // Reset matte flag + latched_mf[flag] = false; + break; + case 9: // Set matte flag + latched_mf[flag] = true; + break; + case 10: // Not used + case 11: // Not used + break; + case 12: // Reset matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx); + latched_mf[flag] = false; + break; + case 13: // Set matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx); + latched_mf[flag] = true; + break; + case 14: // Reset matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx); + latched_mf[flag] = false; + break; + case 15: // Set matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx); + latched_mf[flag] = true; + break; } } } } - m_weight_factor[0][x] = latched_wfa; - m_weight_factor[1][x] = latched_wfb; - m_region_flag[0][x] = latched_rf[0]; - m_region_flag[1][x] = latched_rf[1]; - } - } - else - { - int region_idx = 0; - for (int x = 0; x < width; x++) - { - if (region_idx < 8) + else { - const int flag = BIT(m_region_control[region_idx], RC_RF_BIT); - const uint32_t region_ctrl = m_region_control[region_idx]; - const uint32_t region_op = get_region_op(region_idx); - if (region_op == 0) - { - std::fill_n(m_weight_factor[0] + x, std::size(m_weight_factor[0]) - x, latched_wfa); - std::fill_n(m_weight_factor[1] + x, std::size(m_weight_factor[1]) - x, latched_wfb); - std::fill_n(m_region_flag[0] + x, std::size(m_region_flag[0]) - x, latched_rf[0]); - std::fill_n(m_region_flag[1] + x, std::size(m_region_flag[1]) - x, latched_rf[1]); - return; - } - if (x == (region_ctrl & RC_X)) + if (matte_idx < max_matte_id) { - switch (region_op) + const uint32_t matte_ctrl = m_matte_control[matte_idx]; + const uint32_t matte_op = get_matte_op(matte_idx); + if (matte_op == 0) { - case 0: // End of region control for line + break; + } + if (x == (matte_ctrl & MC_X)) + { + switch (matte_op) + { + case 0: // End of matte control for line break; case 1: case 2: case 3: // Not used break; case 4: // Change weight of plane A - latched_wfa = get_weight_factor(region_idx); + latched_wfa = get_weight_factor(matte_idx); break; case 5: // Not used break; case 6: // Change weight of plane B - latched_wfb = get_weight_factor(region_idx); + latched_wfb = get_weight_factor(matte_idx); break; case 7: // Not used break; - case 8: // Reset region flag - latched_rf[flag] = false; + case 8: // Reset matte flag + latched_mf[flag] = false; break; - case 9: // Set region flag - latched_rf[flag] = true; + case 9: // Set matte flag + latched_mf[flag] = true; break; case 10: // Not used case 11: // Not used break; - case 12: // Reset region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = false; + case 12: // Reset matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx); + latched_mf[flag] = false; break; - case 13: // Set region flag and change weight of plane A - latched_wfa = get_weight_factor(region_idx); - latched_rf[flag] = true; + case 13: // Set matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx); + latched_mf[flag] = true; break; - case 14: // Reset region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = false; + case 14: // Reset matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx); + latched_mf[flag] = false; break; - case 15: // Set region flag and change weight of plane B - latched_wfb = get_weight_factor(region_idx); - latched_rf[flag] = true; + case 15: // Set matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx); + latched_mf[flag] = true; break; + } + matte_idx++; } - region_idx++; } } - m_weight_factor[0][x] = latched_wfa; - m_weight_factor[1][x] = latched_wfb; - m_region_flag[0][x] = latched_rf[0]; - m_region_flag[1][x] = latched_rf[1]; } + m_weight_factor[0][x] = latched_wfa; + m_weight_factor[1][x] = latched_wfb; + m_matte_flag[0][x] = latched_mf[0]; + m_matte_flag[1][x] = latched_mf[1]; } + // Fill the remainder. + std::fill_n(m_weight_factor[0] + x, std::size(m_weight_factor[0]) - x, latched_wfa); + std::fill_n(m_weight_factor[1] + x, std::size(m_weight_factor[1]) - x, latched_wfb); + std::fill_n(m_matte_flag[0] + x, std::size(m_matte_flag[0]) - x, latched_mf[0]); + std::fill_n(m_matte_flag[1] + x, std::size(m_matte_flag[1]) - x, latched_mf[1]); } template @@ -320,7 +310,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) m_cursor_pattern[(value >> 16) & 0x000f] = value & 0x0000ffff; } break; - case 0xd0: // Region Control 0-7 + case 0xd0: // matte Control 0-7 case 0xd1: case 0xd2: case 0xd3: @@ -328,9 +318,9 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) case 0xd5: case 0xd6: case 0xd7: - LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path %d: Region Control %d = %08x\n", machine().describe_context(), screen().vpos(), Path, reg & 7, value); - m_region_control[reg & 7] = value; - update_region_arrays(); + LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path %d: matte Control %d = %08x\n", machine().describe_context(), screen().vpos(), Path, reg & 7, value); + m_matte_control[reg & 7] = value; + update_matte_arrays(); break; case 0xd8: // Backdrop Color if (Path == 0) @@ -358,7 +348,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) { LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path 0: Weight Factor A = %08x\n", machine().describe_context(), screen().vpos(), value); m_weight_factor[0][0] = (uint8_t)value; - update_region_arrays(); + update_matte_arrays(); } break; case 0xdc: // Weight Factor B @@ -366,7 +356,7 @@ void mcd212_device::set_register(uint8_t reg, uint32_t value) { LOGMASKED(LOG_REGISTERS, "%s: Scanline %d, Path 1: Weight Factor B = %08x\n", machine().describe_context(), screen().vpos(), value); m_weight_factor[1][0] = (uint8_t)value; - update_region_arrays(); + update_matte_arrays(); } break; } @@ -569,14 +559,7 @@ static inline uint8_t BYTE_TO_CLUT(int icm, uint8_t byte) case 1: return byte; case 3: - if (Path == 1) - { - return 0x80 + (byte & 0x7f); - } - else - { - return byte & 0x7f; - } + return (Path ? 0x80 : 0) | (byte & 0x7f); case 4: if (Path == 0) { @@ -584,14 +567,7 @@ static inline uint8_t BYTE_TO_CLUT(int icm, uint8_t byte) } break; case 11: - if (Path == 1) - { - return 0x80 + (byte & 0x0f); - } - else - { - return byte & 0x0f; - } + return (Path ? 0x80 : 0) | (byte & 0x0f); default: break; } @@ -624,16 +600,6 @@ inline ATTR_FORCE_INLINE uint8_t mcd212_device::get_mosaic_factor() return 1 << (((m_ddr[Path] & DDR_MT) >> DDR_MT_SHIFT) + 1); } -template -int mcd212_device::get_plane_width() -{ - const int width = get_screen_width(); - const uint8_t icm = get_icm(); - if (icm == ICM_CLUT4) - return width; - return width >> 1; -} - template void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) { @@ -670,11 +636,11 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) const bool use_rgb_tp_bit = (tp_ctrl_type == TCR_RGB); const bool tp_check_parity = !BIT(tp_ctrl, 3); const bool tp_always = ((tp_ctrl_type == TCR_ALWAYS) && tp_check_parity); - const int region_flag_index = BIT(~tp_ctrl_type, 0); - const bool *const region_flags = m_region_flag[region_flag_index]; - const bool use_region_flag = (tp_ctrl_type >= TCR_RF0 && tp_ctrl_type <= TCR_RF1_KEY1); + const int matte_flag_index = BIT(~tp_ctrl_type, 0); + const bool *const matte_flags = m_matte_flag[matte_flag_index]; + const bool use_matte_flag = (tp_ctrl_type >= TCR_MF0 && tp_ctrl_type <= TCR_MF1_KEY1); const bool is_dyuv_rgb = (icm == ICM_DYUV) || ((icm == ICM_RGB555) && (Path == 1)); // DYUV and RGB do not have access to color key. - const bool use_color_key = !is_dyuv_rgb && ((tp_ctrl_type == TCR_KEY) || (tp_ctrl_type == TCR_RF0_KEY1) || (tp_ctrl_type == TCR_RF1_KEY1)); + const bool use_color_key = !is_dyuv_rgb && ((tp_ctrl_type == TCR_KEY) || (tp_ctrl_type == TCR_MF0_KEY1) || (tp_ctrl_type == TCR_MF1_KEY1)); LOGMASKED(LOG_VSR, "Scanline %d: VSR Path %d, ICM (%02x), VSR (%08x)\n", screen().vpos(), Path, icm, vsr); @@ -708,10 +674,10 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) pixels[x + 1] = color0; pixels[x + 2] = color1; pixels[x + 3] = color1; - transparent[x ] = tp_always || (use_region_flag && (region_flags[x ] == tp_check_parity)); - transparent[x + 1] = tp_always || (use_region_flag && (region_flags[x + 1] == tp_check_parity)); - transparent[x + 2] = tp_always || (use_region_flag && (region_flags[x + 2] == tp_check_parity)); - transparent[x + 3] = tp_always || (use_region_flag && (region_flags[x + 3] == tp_check_parity)); + transparent[x ] = tp_always || (use_matte_flag && (matte_flags[x ] == tp_check_parity)); + transparent[x + 1] = tp_always || (use_matte_flag && (matte_flags[x + 1] == tp_check_parity)); + transparent[x + 2] = tp_always || (use_matte_flag && (matte_flags[x + 2] == tp_check_parity)); + transparent[x + 3] = tp_always || (use_matte_flag && (matte_flags[x + 3] == tp_check_parity)); x += 4; } else @@ -750,8 +716,8 @@ void mcd212_device::process_vsr(uint32_t *pixels, bool *transparent) { pixels[rl_index ] = color0; pixels[rl_index + 1] = color1; - transparent[rl_index ] = tp_always || rgb_tp_bit || (use_color_key && color_match0) || (use_region_flag && (region_flags[rl_index ] == tp_check_parity)); - transparent[rl_index + 1] = tp_always || rgb_tp_bit || (use_color_key && color_match1) || (use_region_flag && (region_flags[rl_index + 1] == tp_check_parity)); + transparent[rl_index ] = tp_always || rgb_tp_bit || (use_color_key && color_match0) || (use_matte_flag && (matte_flags[rl_index ] == tp_check_parity)); + transparent[rl_index + 1] = tp_always || rgb_tp_bit || (use_color_key && color_match1) || (use_matte_flag && (matte_flags[rl_index + 1] == tp_check_parity)); } x = end; } @@ -778,98 +744,73 @@ void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t * uint8_t *weight_a = &m_weight_factor[0][0]; uint8_t *weight_b = &m_weight_factor[1][0]; - if (!(m_transparency_control & TCR_DISABLE_MX)) + for (int x = 0; x < width; x++) { - for (int x = 0; x < width; x++, weight_a++, transparent_a++, weight_b++, transparent_b++) + const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; + const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; + if (!(m_transparency_control & TCR_DISABLE_MX)) { - const uint8_t weight_a_cur = *weight_a; - const uint8_t weight_b_cur = *weight_b; - - const uint32_t plane_a_cur = plane_a[x]; - const uint32_t plane_b_cur = plane_b[x]; - - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const int32_t weighted_a_r = (plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_a_g = (plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_a_b = (plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0; - const int32_t weighted_b_r = ((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + weighted_a_r; - const int32_t weighted_b_g = ((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + weighted_a_g; - const int32_t weighted_b_b = ((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + weighted_a_b; + const int32_t plane_a_r = 0xff & (plane_a[x] >> 16); + const int32_t plane_b_r = 0xff & (plane_b[x] >> 16); + const int32_t plane_a_g = 0xff & (plane_a[x] >> 8); + const int32_t plane_b_g = 0xff & (plane_b[x] >> 8); + const int32_t plane_a_b = 0xff & plane_a[x]; + const int32_t plane_b_b = 0xff & plane_b[x]; + const int32_t weighted_a_r = (plane_a_r > 16) ? (((plane_a_r - 16) * weight_a[x]) >> 6) : 0; + const int32_t weighted_a_g = (plane_a_g > 16) ? (((plane_a_g - 16) * weight_a[x]) >> 6) : 0; + const int32_t weighted_a_b = (plane_a_b > 16) ? (((plane_a_b - 16) * weight_a[x]) >> 6) : 0; + const int32_t weighted_b_r = ((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b[x]) >> 6) : 0) + weighted_a_r; + const int32_t weighted_b_g = ((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b[x]) >> 6) : 0) + weighted_a_g; + const int32_t weighted_b_b = ((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b[x]) >> 6) : 0) + weighted_a_b; const uint8_t out_r = (weighted_b_r > 255) ? 255 : (uint8_t)weighted_b_r; const uint8_t out_g = (weighted_b_g > 255) ? 255 : (uint8_t)weighted_b_g; const uint8_t out_b = (weighted_b_b > 255) ? 255 : (uint8_t)weighted_b_b; - *out++ = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; + out[x] = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; } - } - else - { - for (int x = 0; x < width; x++, weight_a++, transparent_a++, weight_b++, transparent_b++) + else { + const int32_t plane_a_r = 0xff & (plane_a_cur >> 16); + const int32_t plane_a_g = 0xff & (plane_a_cur >> 8); + const int32_t plane_a_b = 0xff & plane_a_cur; + const int32_t plane_b_r = 0xff & (plane_b_cur >> 16); + const int32_t plane_b_g = 0xff & (plane_b_cur >> 8); + const int32_t plane_b_b = 0xff & plane_b_cur; + + const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); + const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); + const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); + const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); + const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); + const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); + if (OrderAB) { - if (!(*transparent_a)) + if (!transparent_a[x]) { - const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; - const uint8_t weight_a_cur = *weight_a; - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; + out[x] = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; } - else if (!(*transparent_b)) + else if (!transparent_b[x]) { - const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; - const uint8_t weight_b_cur = *weight_b; - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; + out[x] = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; } else { - *out++ = backdrop; + out[x] = backdrop; } } else { - if (!(*transparent_b)) + if (!transparent_b[x]) { - const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; - const uint8_t weight_b_cur = *weight_b; - const int32_t plane_b_r = (int32_t)(uint8_t)(plane_b_cur >> 16); - const int32_t plane_b_g = (int32_t)(uint8_t)(plane_b_cur >> 8); - const int32_t plane_b_b = (int32_t)(uint8_t)plane_b_cur; - const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; + out[x] = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; } - else if (!(*transparent_a)) + else if (!transparent_a[x]) { - const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; - const uint8_t weight_a_cur = *weight_a; - const int32_t plane_a_r = (int32_t)(uint8_t)(plane_a_cur >> 16); - const int32_t plane_a_g = (int32_t)(uint8_t)(plane_a_cur >> 8); - const int32_t plane_a_b = (int32_t)(uint8_t)plane_a_cur; - const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a_cur) >> 6) : 0) + 16, 0, 255); - *out++ = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; + out[x] = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; } else { - *out++ = backdrop; + out[x] = backdrop; } } } @@ -877,44 +818,46 @@ void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t * if (border_width) { - std::fill_n(out, border_width, 0xff101010); + std::fill_n(&out[width], border_width, s_4bpp_color[0]); } } void mcd212_device::draw_cursor(uint32_t *scanline) { - if (m_cursor_control & CURCNT_EN) + if (!(m_cursor_control & CURCNT_EN)) + { + return; + } + + uint16_t y = (uint16_t)screen().vpos(); + const uint16_t cursor_x = m_cursor_position & 0x3ff; + const uint16_t cursor_y = ((m_cursor_position >> 12) & 0x3ff) + m_ica_height; + if (y >= cursor_y && y < (cursor_y + 16)) { - uint16_t y = (uint16_t)screen().vpos(); - const uint16_t cursor_x = m_cursor_position & 0x3ff; - const uint16_t cursor_y = ((m_cursor_position >> 12) & 0x3ff) + m_ica_height; - if (y >= cursor_y && y < (cursor_y + 16)) + const int width = get_screen_width(); + uint32_t color = s_4bpp_color[m_cursor_control & CURCNT_COLOR]; + y -= cursor_y; + if (m_cursor_control & CURCNT_CUW) { - const int width = get_screen_width(); - uint32_t color = s_4bpp_color[m_cursor_control & CURCNT_COLOR]; - y -= cursor_y; - if (m_cursor_control & CURCNT_CUW) + for (int x = cursor_x; x < cursor_x + 64 && x < width; x++) { - for (int x = cursor_x; x < cursor_x + 64 && x < width; x++) + if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 2)))) { - if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 2)))) - { - scanline[x++] = color; - scanline[x++] = color; - scanline[x++] = color; - scanline[x] = color; - } + scanline[x++] = color; + scanline[x++] = color; + scanline[x++] = color; + scanline[x] = color; } } - else + } + else + { + for (int x = cursor_x; x < cursor_x + 32 && x < width; x++) { - for (int x = cursor_x; x < cursor_x + 32 && x < width; x++) + if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 1)))) { - if (m_cursor_pattern[y] & (1 << (15 - ((x - cursor_x) >> 1)))) - { - scanline[x++] = color; - scanline[x] = color; - } + scanline[x++] = color; + scanline[x] = color; } } } @@ -1253,13 +1196,13 @@ void mcd212_device::device_reset() m_cursor_position = 0; m_cursor_control = 0; std::fill_n(m_cursor_pattern, std::size(m_cursor_pattern), 0); - std::fill_n(m_region_control, 8, 0); + std::fill_n(m_matte_control, 8, 0); m_backdrop_color = 0; std::fill_n(m_mosaic_hold, 2, 0); std::fill_n(m_weight_factor[0], std::size(m_weight_factor[0]), 0); std::fill_n(m_weight_factor[1], std::size(m_weight_factor[1]), 0); - std::fill_n(m_region_flag[0], std::size(m_region_flag[0]), false); - std::fill_n(m_region_flag[1], std::size(m_region_flag[1]), false); + std::fill_n(m_matte_flag[0], std::size(m_matte_flag[0]), false); + std::fill_n(m_matte_flag[1], std::size(m_matte_flag[1]), false); m_ica_height = 32; m_total_height = 312; @@ -1311,8 +1254,8 @@ void mcd212_device::device_start() m_dyuv_v_to_r[sw] = (351 * (sw - 128)) / 256; } - save_item(NAME(m_region_flag[0])); - save_item(NAME(m_region_flag[1])); + save_item(NAME(m_matte_flag[0])); + save_item(NAME(m_matte_flag[1])); save_item(NAME(m_ica_height)); save_item(NAME(m_total_height)); save_item(NAME(m_csrr)); @@ -1333,7 +1276,7 @@ void mcd212_device::device_start() save_item(NAME(m_cursor_position)); save_item(NAME(m_cursor_control)); save_item(NAME(m_cursor_pattern)); - save_item(NAME(m_region_control)); + save_item(NAME(m_matte_control)); save_item(NAME(m_backdrop_color)); save_item(NAME(m_mosaic_hold)); save_item(NAME(m_weight_factor[0])); diff --git a/src/mame/philips/mcd212.h b/src/mame/philips/mcd212.h index 5106dc7f37249..5fc8e609c7894 100644 --- a/src/mame/philips/mcd212.h +++ b/src/mame/philips/mcd212.h @@ -100,8 +100,8 @@ class mcd212_device : public device_t, ICM_MODE2 = 0x000f00, // Plane 2 ICM_MODE2_SHIFT = 8, ICM_EV = 0x040000, // External video - ICM_NR = 0x080000, // Number of region flags - ICM_NR_BIT = 19, + ICM_NM = 0x080000, // Number of Matte flags + ICM_NM_BIT = 19, ICM_CS = 0x400000, // CLUT select TCR_TA = 0x00000f, // Plane A @@ -110,30 +110,30 @@ class mcd212_device : public device_t, TCR_ALWAYS = 0x0, // Transparent if: Always (Plane Disabled) TCR_KEY = 0x1, // Transparent if: Color Key = True TCR_RGB = 0x2, // Transparent if: Transparency Bit = 1 (RGB Only) - TCR_RF0 = 0x3, // Transparent if: Region Flag 0 = True - TCR_RF1 = 0x4, // Transparent if: Region Flag 1 = True - TCR_RF0_KEY1 = 0x5, // Transparent if: Region Flag 0 = True || Color Key = True - TCR_RF1_KEY1 = 0x6, // Transparent if: Region Flag 1 = True || Color Key = True + TCR_MF0 = 0x3, // Transparent if: Matte Flag 0 = True + TCR_MF1 = 0x4, // Transparent if: Matte Flag 1 = True + TCR_MF0_KEY1 = 0x5, // Transparent if: Matte Flag 0 = True || Color Key = True + TCR_MF1_KEY1 = 0x6, // Transparent if: Matte Flag 1 = True || Color Key = True TCR_COND_UNUSED0 = 0x7, // Unused TCR_NEVER = 0x8, // Transparent if: Never (No Transparent Area) TCR_NOT_KEY = 0x9, // Transparent if: Color Key = False TCR_NOT_RGB = 0xa, // Transparent if: Transparency Bit = 0 (RGB Only) - TCR_NOT_RF0 = 0xb, // Transparent if: Region Flag 0 = False - TCR_NOT_RF1 = 0xc, // Transparent if: Region Flag 1 = False - TCR_NOT_RF0_KEY = 0xd, // Transparent if: Region Flag 0 = False || Color Key = False - TCR_NOT_RF1_KEY = 0xe, // Transparent if: Region Flag 1 = False || Color Key = False + TCR_NOT_MF0 = 0xb, // Transparent if: Matte Flag 0 = False + TCR_NOT_MF1 = 0xc, // Transparent if: Matte Flag 1 = False + TCR_NOT_MF0_KEY = 0xd, // Transparent if: Matte Flag 0 = False || Color Key = False + TCR_NOT_MF1_KEY = 0xe, // Transparent if: Matte Flag 1 = False || Color Key = False TCR_COND_UNUSED1 = 0xf, // Unused TCR_DISABLE_MX = 0x800000, // Mix disable POR_AB = 0, // Plane A in front of Plane B POR_BA = 1, // Plane B in front of Plane A - RC_X = 0x0003ff, // X position - RC_WF = 0x00fc00, // Weight position - RC_WF_SHIFT = 10, - RC_RF_BIT = 16, // Region flag bit - RC_OP = 0xf00000, // Operation - RC_OP_SHIFT = 20, + MC_X = 0x0003ff, // X position + MC_WF = 0x00fc00, // Weight position + MC_WF_SHIFT = 10, + MC_MF_BIT = 16, // Matte flag bit + MC_OP = 0xf00000, // Operation + MC_OP_SHIFT = 20, CSR1R_PA = 0x20, // Parity CSR1R_DA = 0x80, // Display Active @@ -196,7 +196,7 @@ class mcd212_device : public device_t, uint32_t m_cursor_position = 0; uint32_t m_cursor_control = 0; uint32_t m_cursor_pattern[16]{}; - uint32_t m_region_control[8]{}; + uint32_t m_matte_control[8]{}; uint32_t m_backdrop_color = 0; uint32_t m_mosaic_hold[2]{}; uint8_t m_weight_factor[2][768]{}; @@ -229,7 +229,7 @@ class mcd212_device : public device_t, required_shared_ptr m_planeb; // internal state - bool m_region_flag[2][768]{}; + bool m_matte_flag[2][768]{}; int m_ica_height = 0; int m_total_height = 0; emu_timer *m_ica_timer = nullptr; @@ -237,13 +237,12 @@ class mcd212_device : public device_t, static const uint32_t s_4bpp_color[16]; - uint8_t get_weight_factor(const uint32_t region_idx); - uint8_t get_region_op(const uint32_t region_idx); - void update_region_arrays(); + uint8_t get_weight_factor(const uint32_t Matte_idx); + uint8_t get_matte_op(const uint32_t Matte_idx); + void update_matte_arrays(); int get_screen_width(); int get_border_width(); - template int get_plane_width(); template void set_vsr(uint32_t value); template uint32_t get_vsr(); From 0b3252d870afe1ef196c465bbb684dcb74f4645c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 28 Feb 2025 15:59:19 +0100 Subject: [PATCH 050/272] New working clones ------------------ Maque Long Xiong Hu Di (Taiwan?, D106T) [little0] --- src/mame/dynax/ddenlovr.cpp | 19 +++++++++++++++++++ src/mame/dynax/dynax.cpp | 13 +++++++------ src/mame/mame.lst | 1 + 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index 05b65166da919..093a33d1db59f 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -11769,6 +11769,24 @@ ROM_START( mjmyuniv ) ROM_LOAD( "1.1e", 0x00000, 0x20000, CRC(09b7a9b2) SHA1(64d9ccbb726bb6c5b362afc92bca2e3db87fd454) ) ROM_END +// 麻雀 龍兄虎弟 +// CS166P001 PCB (very similar to mjmyuniv's one). Dump was presented as a bootleg but the PCB has all Dynax / Nakanihon original customs. +ROM_START( mjmyunivbl ) + ROM_REGION( 0x90000 + 0x1000*8, "maincpu", 0 ) // Z80 Code + space for banked RAM + ROM_LOAD( "rom.u42", 0x00000, 0x40000, CRC(8000eec3) SHA1(e2a4a46ebb8e152956f469382bde73b983090c01) ) + ROM_RELOAD( 0x10000, 0x40000 ) + + ROM_REGION( 0xc00000, "blitter", ROMREGION_ERASE00 ) + // gap + ROM_LOAD( "rom.u59", 0x800000, 0x080000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) ) + ROM_LOAD( "rom.u60", 0x880000, 0x080000, CRC(33dc6d59) SHA1(68440591ff194b444336a6d6abe599eee56d91c7) ) + ROM_LOAD( "rom.u57", 0x900000, 0x080000, BAD_DUMP CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) ) // damaged ROM, using the one from mjmyuniv for now + ROM_LOAD( "rom.u58", 0x980000, 0x080000, CRC(9af9a939) SHA1(3ce67bb71b6dcf8535b6eba03622eaf53cdd3363) ) + + ROM_REGION( 0x40000, "oki", 0 ) // samples + ROM_LOAD( "rom.u30", 0x000000, 0x040000, CRC(30e496a6) SHA1(c7ea23079bd4acb6e06af954fafe8462d5576b0e) ) +ROM_END + /*************************************************************************** Panel & Variety Akamaru Q Joushou Dont-R @@ -12650,6 +12668,7 @@ GAME( 1994, mjmywrld, mjmyster, mjmywrld, mjmyster, ddenlovr_state, empty_ GAME( 1994, hginga, 0, hginga, hginga, ddenlovr_state, empty_init, ROT0, "Dynax", "Hanafuda Hana Ginga (Japan)", MACHINE_NO_COCKTAIL ) GAME( 1994, mjmyuniv, 0, mjmyuniv, mjmyster, ddenlovr_state, empty_init, ROT0, "Dynax", "Mahjong The Mysterious Universe (Japan, D85)", MACHINE_NO_COCKTAIL ) +GAME( 1995, mjmyunivbl, mjmyuniv, mjmyuniv, mjmyster, ddenlovr_state, empty_init, ROT0, "bootleg", "Maque Long Xiong Hu Di (Taiwan?, D106T)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL ) // One GFX ROM isn't dumped GAME( 1994, quiz365, 0, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon", "Quiz 365 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) GAME( 1994, quiz365t, quiz365, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon / Taito", "Quiz 365 (Hong Kong & Taiwan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/dynax/dynax.cpp b/src/mame/dynax/dynax.cpp index 47fdf2e69a8df..3defcb21f9805 100644 --- a/src/mame/dynax/dynax.cpp +++ b/src/mame/dynax/dynax.cpp @@ -5927,16 +5927,17 @@ Z84C015 - Toshiba TMPZ84C015BF-6 Z80 compatible CPU ROM_START( mjelctrb ) ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code ROM_LOAD( "prog.u27", 0x00000, 0x20000, CRC(688990ca) SHA1(34825cee8f76de93f12ccf2a1021f9c5369da46a) ) - ROM_RELOAD( 0x28000, 0x08000 ) - ROM_CONTINUE( 0x20000, 0x08000 ) - ROM_CONTINUE( 0x18000, 0x08000 ) - ROM_CONTINUE( 0x10000, 0x08000 ) + ROM_RELOAD( 0x28000, 0x08000 ) + ROM_CONTINUE( 0x20000, 0x08000 ) + ROM_CONTINUE( 0x18000, 0x08000 ) + ROM_CONTINUE( 0x10000, 0x08000 ) ROM_REGION( 0x200000, "blitter", 0 ) // blitter data ROM_LOAD( "eb-01.rom", 0x000000, 0x100000, CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) ROM_END +// bootleg PCB with TMPZ84C015 with flying wire to the program ROM, AL9106 custom, GM68B45S, YM2149F, CCX413-2, 4 banks of 8 DIP switches ROM_START( mjelct3bl ) ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code ROM_LOAD( "rom.u3", 0x00000, 0x20000, CRC(2cc0bbd8) SHA1(0653de340d470d209649b82b1844c3c3da5c545a) ) @@ -5947,8 +5948,8 @@ ROM_START( mjelct3bl ) ROM_CONTINUE( 0x18000, 0x08000 ) ROM_REGION( 0x200000, "blitter", 0 ) // blitter data, not dumped for this set - ROM_LOAD( "eb-01.rom", 0x000000, 0x100000, BAD_DUMP CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) - ROM_LOAD( "eb-02.rom", 0x100000, 0x080000, BAD_DUMP CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) + ROM_LOAD( "e1.u82", 0x000000, 0x100000, BAD_DUMP CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "e2.u83", 0x100000, 0x080000, BAD_DUMP CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) ROM_END /*************************************************************************** diff --git a/src/mame/mame.lst b/src/mame/mame.lst index d4afd18c6b903..5fe6f9d0d769b 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17587,6 +17587,7 @@ mjmyornt mjmyorntr mjmyster mjmyuniv +mjmyunivbl mjmywrld mjreach1 mjschuka From c1449b44d6d6f74aa110a2fad4936632c5a6d273 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 28 Feb 2025 23:01:57 -0500 Subject: [PATCH 051/272] tektronix/tek410x_kbd.cpp: Keyboard updates - Rebind |/~ key to BACKSLASH2 (as suggested by @Elektraglide); bind Esc and Tab and add arbitrary bindings for remaining keys - Add notes on different key labels for 4404 keyboard (this might be emulated separately in the future) --- src/mame/tektronix/tek410x_kbd.cpp | 46 +++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/mame/tektronix/tek410x_kbd.cpp b/src/mame/tektronix/tek410x_kbd.cpp index 74e5578ab2744..56ebb3b98ac90 100644 --- a/src/mame/tektronix/tek410x_kbd.cpp +++ b/src/mame/tektronix/tek410x_kbd.cpp @@ -25,7 +25,7 @@ 01 Left Shift 02 Right Shift 03 Ctrl - 04 DEras/SEras + 04 DEras/SEras [4404 keyboard: ←/↑] 05 Break 06 Back Space 07 Tab @@ -95,18 +95,18 @@ 47 7 (keypad) 48 8 (keypad) 49 9 (keypad) - 4A F1 - 4B F2 - 4C F3 - 4D F4 - 4E F5 - 4F F6 - 50 F7 - 51 F8 - 52 GEras/Dialog - 53 Cancel/Setup - 54 DCopy/SCopy - 55 Menu + 4A F1 [4404 keyboard: F5] + 4B F2 [4404 keyboard: F6] + 4C F3 [4404 keyboard: F7] + 4D F4 [4404 keyboard: F8] + 4E F5 [4404 keyboard: F9] + 4F F6 [4404 keyboard: F10] + 50 F7 [4404 keyboard: F11] + 51 F8 [4404 keyboard: F12] + 52 GEras/Dialog [4404 keyboard: F1] + 53 Cancel/Setup [4404 keyboard: F2] + 54 DCopy/SCopy [4404 keyboard: F3] + 55 Menu [4404 keyboard: F4] 56 Cursor Right (joystick) 57 Cursor Up (joystick) 58 Cursor Left (joystick) @@ -243,20 +243,20 @@ static INPUT_PORTS_START(tek410x_keyboard) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) PORT_CODE(KEYCODE_0_PAD) PORT_START("X2") - PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Break") PORT_CODE(KEYCODE_RALT) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CHAR(0x0a) PORT_CODE(KEYCODE_RCONTROL) // to right of Back Space PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Rub Out") PORT_CODE(KEYCODE_BACKSPACE) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_BACKSLASH) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR(']') PORT_CHAR('}') PORT_CODE(KEYCODE_BACKSLASH) // to right of =/+ PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) PORT_START("X3") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Right Shift") PORT_CODE(KEYCODE_RSHIFT) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('`') PORT_CODE(KEYCODE_OPENBRACE) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\\') PORT_CHAR('`') PORT_CODE(KEYCODE_OPENBRACE) // to right of P PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('\'') PORT_CHAR('"') PORT_CODE(KEYCODE_QUOTE) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(0x08) PORT_CODE(KEYCODE_CLOSEBRACE) + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Back Space") PORT_CHAR(0x08) PORT_CODE(KEYCODE_CLOSEBRACE) // to right of backslash PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('-') PORT_CHAR('_') PORT_CODE(KEYCODE_MINUS) PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CHAR(0x0d) PORT_CODE(KEYCODE_ENTER) PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('=') PORT_CHAR('+') PORT_CODE(KEYCODE_EQUALS) @@ -294,12 +294,12 @@ static INPUT_PORTS_START(tek410x_keyboard) PORT_START("X7") PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock") PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) PORT_CODE(KEYCODE_LCONTROL) - PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) //PORT_CODE(KEYCODE_XXX) - PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) //PORT_CODE(KEYCODE_XXX) - PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('|') PORT_CHAR('~') PORT_CODE(KEYCODE_TAB) - PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SEras DEras") //PORT_CODE(KEYCODE_XXX) + PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Esc") PORT_CHAR(0x1b) PORT_CODE(KEYCODE_ESC) // to left of |/~ + PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Tab") PORT_CHAR(0x09) PORT_CODE(KEYCODE_TAB) // to left of Ctrl + PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('|') PORT_CHAR('~') PORT_CODE(KEYCODE_BACKSLASH2) // to left of Q + PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SEras DEras") PORT_CODE(KEYCODE_LALT) // to left of [/{ PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CHAR(UCHAR_SHIFT_2) PORT_CODE(KEYCODE_CAPSLOCK) - PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_TILDE) + PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CHAR('[') PORT_CHAR('{') PORT_CODE(KEYCODE_TILDE) // to left of 1/! PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Left Shift") PORT_CHAR(UCHAR_SHIFT_1) PORT_CODE(KEYCODE_LSHIFT) PORT_START("X8") From bb7819bd8d565b8fffb2ae174bed0f07b214029f Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 28 Feb 2025 23:54:09 -0500 Subject: [PATCH 052/272] dataeast/simpl156.cpp: Consolidate driver in single file --- src/mame/dataeast/simpl156.cpp | 114 ++++++++++++++++++++++++++++++- src/mame/dataeast/simpl156.h | 90 ------------------------ src/mame/dataeast/simpl156_v.cpp | 37 ---------- 3 files changed, 111 insertions(+), 130 deletions(-) delete mode 100644 src/mame/dataeast/simpl156.h delete mode 100644 src/mame/dataeast/simpl156_v.cpp diff --git a/src/mame/dataeast/simpl156.cpp b/src/mame/dataeast/simpl156.cpp index 41e519ad7c9bd..b5e687a92a673 100644 --- a/src/mame/dataeast/simpl156.cpp +++ b/src/mame/dataeast/simpl156.cpp @@ -93,16 +93,99 @@ even be configurable. */ #include "emu.h" -#include "simpl156.h" -#include "decocrpt.h" #include "deco156_m.h" +#include "deco16ic.h" +#include "decocrpt.h" +#include "decospr.h" + #include "cpu/arm/arm.h" #include "machine/eepromser.h" #include "sound/okim6295.h" +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include + + +namespace { + +class simpl156_state : public driver_device +{ +public: + simpl156_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_deco_tilegen(*this, "tilegen"), + m_eeprom(*this, "eeprom"), + m_okimusic(*this, "okimusic"), + m_sprgen(*this, "spritegen"), + m_palette(*this, "palette"), + m_rowscroll(*this, "rowscroll_%u", 1U, 0x1000U, ENDIANNESS_LITTLE), + m_mainram(*this, "mainram", 0x4000U, ENDIANNESS_LITTLE), + m_systemram(*this, "systemram"), + m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE) + { } + + void joemacr(machine_config &config); + void magdrop(machine_config &config); + void chainrec(machine_config &config); + void mitchell156(machine_config &config); + void magdropp(machine_config &config); + + void init_simpl156(); + void init_joemacr(); + void init_charlien(); + void init_prtytime(); + void init_osman(); + void init_chainrec(); + +protected: + virtual void video_start() override ATTR_COLD; + +private: + DECO16IC_BANK_CB_MEMBER(bank_callback); + DECOSPR_PRIORITY_CB_MEMBER(pri_callback); + + void eeprom_w(u32 data); + u32 spriteram_r(offs_t offset); + void spriteram_w(offs_t offset, u32 data, u32 mem_mask); + u32 mainram_r(offs_t offset); + void mainram_w(offs_t offset, u32 data, u32 mem_mask); + template u32 rowscroll_r(offs_t offset); + template void rowscroll_w(offs_t offset, u32 data, u32 mem_mask); + u32 joemacr_speedup_r(); + u32 chainrec_speedup_r(); + u32 prtytime_speedup_r(); + u32 charlien_speedup_r(); + u32 osman_speedup_r(); + + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void vblank_interrupt(int state); + + void base_map(address_map &map) ATTR_COLD; + void chainrec_map(address_map &map) ATTR_COLD; + void joemacr_map(address_map &map) ATTR_COLD; + void magdrop_map(address_map &map) ATTR_COLD; + void magdropp_map(address_map &map) ATTR_COLD; + void mitchell156_map(address_map &map) ATTR_COLD; + + /* devices */ + required_device m_maincpu; + required_device m_deco_tilegen; + required_device m_eeprom; + required_device m_okimusic; + required_device m_sprgen; + required_device m_palette; + + /* memory pointers */ + memory_share_array_creator m_rowscroll; + memory_share_creator m_mainram; + required_shared_ptr m_systemram; + memory_share_creator m_spriteram; +}; + static INPUT_PORTS_START( simpl156 ) PORT_START("IN0") @@ -368,6 +451,30 @@ DECOSPR_PRIORITY_CB_MEMBER(simpl156_state::pri_callback) } +void simpl156_state::video_start() +{ + std::fill_n(&m_spriteram[0], m_spriteram.length(), 0xffff); +} + +u32 simpl156_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + screen.priority().fill(0); + + m_deco_tilegen->pf_update(m_rowscroll[0], m_rowscroll[1]); + + bitmap.fill(256, cliprect); + + m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); + m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); + + // sprites are flipped relative to tilemaps + m_sprgen->set_flip_screen(true); + + m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) + return 0; +} + + void simpl156_state::chainrec(machine_config &config) { /* basic machine hardware */ @@ -1110,9 +1217,10 @@ void simpl156_state::init_osman() { m_maincpu->space(AS_PROGRAM).install_read_handler(0x0201010, 0x0201013, 0, 0x2000, 0, emu::rw_delegate(*this, FUNC(simpl156_state::osman_speedup_r))); init_simpl156(); - } +} // anonymous namespace + /* Data East games running on the DE-0409-1 or DE-0491-1 PCB */ GAME( 1994, joemacr, 0, joemacr, simpl156, simpl156_state, init_joemacr, ROT0, "Data East Corporation", "Joe & Mac Returns (World, Version 1.1, 1994.05.27)", MACHINE_SUPPORTS_SAVE ) /* bootleg board with genuine DECO parts */ GAME( 1994, joemacra, joemacr, joemacr, simpl156, simpl156_state, init_joemacr, ROT0, "Data East Corporation", "Joe & Mac Returns (World, Version 1.0, 1994.05.19)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/simpl156.h b/src/mame/dataeast/simpl156.h deleted file mode 100644 index 8ac4e25dc46a7..0000000000000 --- a/src/mame/dataeast/simpl156.h +++ /dev/null @@ -1,90 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/************************************************************************* - - Simple 156 based board - -*************************************************************************/ - -#include "machine/eepromser.h" -#include "sound/okim6295.h" -#include "deco16ic.h" -#include "decospr.h" -#include "emupal.h" - -class simpl156_state : public driver_device -{ -public: - simpl156_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_deco_tilegen(*this, "tilegen"), - m_eeprom(*this, "eeprom"), - m_okimusic(*this, "okimusic"), - m_sprgen(*this, "spritegen"), - m_palette(*this, "palette"), - m_rowscroll(*this, "rowscroll_%u", 1U, 0x1000U, ENDIANNESS_LITTLE), - m_mainram(*this, "mainram", 0x4000U, ENDIANNESS_LITTLE), - m_systemram(*this, "systemram"), - m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE) - { } - - void joemacr(machine_config &config); - void magdrop(machine_config &config); - void chainrec(machine_config &config); - void mitchell156(machine_config &config); - void magdropp(machine_config &config); - - void init_simpl156(); - void init_joemacr(); - void init_charlien(); - void init_prtytime(); - void init_osman(); - void init_chainrec(); - -protected: - virtual void video_start() override ATTR_COLD; - -private: - DECO16IC_BANK_CB_MEMBER(bank_callback); - DECOSPR_PRIORITY_CB_MEMBER(pri_callback); - - void eeprom_w(u32 data); - u32 spriteram_r(offs_t offset); - void spriteram_w(offs_t offset, u32 data, u32 mem_mask); - u32 mainram_r(offs_t offset); - void mainram_w(offs_t offset, u32 data, u32 mem_mask); - template u32 rowscroll_r(offs_t offset); - template void rowscroll_w(offs_t offset, u32 data, u32 mem_mask); - u32 joemacr_speedup_r(); - u32 chainrec_speedup_r(); - u32 prtytime_speedup_r(); - u32 charlien_speedup_r(); - u32 osman_speedup_r(); - - u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void vblank_interrupt(int state); - - void base_map(address_map &map) ATTR_COLD; - void chainrec_map(address_map &map) ATTR_COLD; - void joemacr_map(address_map &map) ATTR_COLD; - void magdrop_map(address_map &map) ATTR_COLD; - void magdropp_map(address_map &map) ATTR_COLD; - void mitchell156_map(address_map &map) ATTR_COLD; - - /* devices */ - required_device m_maincpu; - required_device m_deco_tilegen; - required_device m_eeprom; - required_device m_okimusic; - required_device m_sprgen; - required_device m_palette; - - /* memory pointers */ - memory_share_array_creator m_rowscroll; - memory_share_creator m_mainram; - required_shared_ptr m_systemram; - memory_share_creator m_spriteram; - - size_t m_spriteram_size = 0; -}; diff --git a/src/mame/dataeast/simpl156_v.cpp b/src/mame/dataeast/simpl156_v.cpp deleted file mode 100644 index 41413524d8180..0000000000000 --- a/src/mame/dataeast/simpl156_v.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:David Haywood -/* Simple 156 based board - -*/ - -#include "emu.h" - -#include "simpl156.h" - -#include "screen.h" - -#include - - -void simpl156_state::video_start() -{ - std::fill_n(&m_spriteram[0], m_spriteram.length(), 0xffff); -} - -u32 simpl156_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - screen.priority().fill(0); - - m_deco_tilegen->pf_update(m_rowscroll[0], m_rowscroll[1]); - - bitmap.fill(256, cliprect); - - m_deco_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 2); - m_deco_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 4); - - // sprites are flipped relative to tilemaps - m_sprgen->set_flip_screen(true); - - m_sprgen->draw_sprites(bitmap, cliprect, m_spriteram, 0x1400/4); // 0x1400/4 seems right for charlien (doesn't initialize any more RAM, so will draw a garbage 0 with more) - return 0; -} From 7f60f33494c075ee7426925e65906c0828eb7e24 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 1 Mar 2025 13:42:44 +0100 Subject: [PATCH 053/272] gk2000: update notes --- src/mame/saitek/gk2000.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index f7ae7c041515e..b5a5842001e82 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -9,7 +9,6 @@ These chess computers all have the same I/O and fit in the same driver. The ches engine is by Frans Morsch. TODO: -- is the H8/3212 V04 ROM the same as V03, just a different package? - versions with the A20 ROM that don't officially support the extra options on the 2nd row, can still access them when turning the computer on by simultaneously pressing the Go/Stop button with the Option button. This doesn't work on MAME, @@ -42,6 +41,11 @@ Radio Shack Chess Master: - PCB label: same as Centurion / Cougar (see below) - rest is same as Barracuda +Mephisto Explorer: +- PCB label: 51CT09-01001L +- Hitachi H8/3212 MCU (QFP), 10MHz XTAL, same ROM contents as Barracuda +- LCD layout is slightly different, symbols are on the right side + H8/323 A13 MCU is used in: - Saitek GK 2000 (1992 version, 86071220X12) - Saitek Travel Champion 2080 (86071220X12) @@ -66,6 +70,8 @@ H8/3212 V04 MCU (QFP) is used in: - Saitek Mephisto Diplomat Advanced Travel Chess (suspected) - Saitek Mephisto Explorer +The V04 QFP MCU is confirmed to have the same ROM contents as the V03 DIP MCU. + ================================================================================ Saitek GK 2100 @@ -100,7 +106,7 @@ Centurion / Cougar: Mephisto Explorer Pro: - PCB label: 51CT12-01002, REV1.0 (smaller PCB) - same MCU as Cougar, 16MHz XTAL -- LCD layout is slightly different, symbols are on the right side +- LCD layout is slightly different (same as Mephisto Explorer) For test mode, hold Enter after cold boot during the LCD test. It will say "TST", press Enter again to see the diode configuration setting. From e27d69611cf866e1fb8fd650a814d38908e9f006 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 2 Mar 2025 02:11:16 +1100 Subject: [PATCH 054/272] debugger/win: Added option to disable window grouping. Option is in debugger console window Settings menu. Changes apply on hard reset or restarting MAME. Setting is saved to default.cfg. --- src/mame/dataeast/simpl156.cpp | 24 +++++++++---------- src/osd/modules/debugger/debugwin.cpp | 11 ++++++++- .../modules/debugger/win/consolewininfo.cpp | 5 ++++ src/osd/modules/debugger/win/debugwin.h | 3 +++ src/osd/modules/debugger/win/debugwininfo.cpp | 4 +++- src/osd/modules/debugger/win/debugwininfo.h | 1 + src/osd/modules/debugger/xmlconfig.cpp | 1 + src/osd/modules/debugger/xmlconfig.h | 1 + 8 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/mame/dataeast/simpl156.cpp b/src/mame/dataeast/simpl156.cpp index b5e687a92a673..6288a8d06c454 100644 --- a/src/mame/dataeast/simpl156.cpp +++ b/src/mame/dataeast/simpl156.cpp @@ -128,18 +128,18 @@ class simpl156_state : public driver_device m_spriteram(*this, "spriteram", 0x1000U, ENDIANNESS_LITTLE) { } - void joemacr(machine_config &config); - void magdrop(machine_config &config); - void chainrec(machine_config &config); - void mitchell156(machine_config &config); - void magdropp(machine_config &config); - - void init_simpl156(); - void init_joemacr(); - void init_charlien(); - void init_prtytime(); - void init_osman(); - void init_chainrec(); + void joemacr(machine_config &config) ATTR_COLD; + void magdrop(machine_config &config) ATTR_COLD; + void chainrec(machine_config &config) ATTR_COLD; + void mitchell156(machine_config &config) ATTR_COLD; + void magdropp(machine_config &config) ATTR_COLD; + + void init_simpl156() ATTR_COLD; + void init_joemacr() ATTR_COLD; + void init_charlien() ATTR_COLD; + void init_prtytime() ATTR_COLD; + void init_osman() ATTR_COLD; + void init_chainrec() ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp index 6498a95fcd3ac..b6d3f1e8664b8 100644 --- a/src/osd/modules/debugger/debugwin.cpp +++ b/src/osd/modules/debugger/debugwin.cpp @@ -56,7 +56,9 @@ class debugger_windows : m_main_console(nullptr), m_next_window_pos{ 0, 0 }, m_config(), - m_save_windows(true) + m_save_windows(true), + m_group_windows(true), + m_group_windows_setting(true) { } @@ -76,6 +78,9 @@ class debugger_windows : virtual void set_color_theme(int index) override; virtual bool get_save_window_arrangement() const override { return m_save_windows; } virtual void set_save_window_arrangement(bool save) override { m_save_windows = save; } + virtual bool get_group_windows() const override { return m_group_windows; } + virtual bool get_group_windows_setting() const { return m_group_windows_setting; } + virtual void set_group_windows_setting(bool group) { m_group_windows_setting = group; } virtual bool const &waiting_for_debugger() const override { return m_waiting_for_debugger; } virtual bool seq_pressed() const override; @@ -111,6 +116,8 @@ class debugger_windows : util::xml::file::ptr m_config; bool m_save_windows; + bool m_group_windows; + bool m_group_windows_setting; }; @@ -395,6 +402,7 @@ void debugger_windows::config_load(config_type cfgtype, config_level cfglevel, u if (config_type::DEFAULT == cfgtype) { m_save_windows = 0 != parentnode->get_attribute_int(debugger::ATTR_DEBUGGER_SAVE_WINDOWS, m_save_windows ? 1 : 0); + m_group_windows = m_group_windows_setting = 0 != parentnode->get_attribute_int(debugger::ATTR_DEBUGGER_GROUP_WINDOWS, m_group_windows ? 1 : 0); util::xml::data_node const *const colors = parentnode->get_child(debugger::NODE_COLORS); if (colors) m_metrics->set_color_theme(colors->get_attribute_int(debugger::ATTR_COLORS_THEME, m_metrics->get_color_theme())); @@ -421,6 +429,7 @@ void debugger_windows::config_save(config_type cfgtype, util::xml::data_node *pa if (config_type::DEFAULT == cfgtype) { parentnode->set_attribute_int(debugger::ATTR_DEBUGGER_SAVE_WINDOWS, m_save_windows ? 1 : 0); + parentnode->set_attribute_int(debugger::ATTR_DEBUGGER_GROUP_WINDOWS, m_group_windows_setting ? 1 : 0); util::xml::data_node *const colors = parentnode->add_child(debugger::NODE_COLORS, nullptr); if (colors) colors->set_attribute_int(debugger::ATTR_COLORS_THEME, m_metrics->get_color_theme()); diff --git a/src/osd/modules/debugger/win/consolewininfo.cpp b/src/osd/modules/debugger/win/consolewininfo.cpp index 3a4a52be2e236..a5dfd04cc5558 100644 --- a/src/osd/modules/debugger/win/consolewininfo.cpp +++ b/src/osd/modules/debugger/win/consolewininfo.cpp @@ -245,6 +245,7 @@ consolewin_info::consolewin_info(debugger_windows_interface &debugger) : // add the settings menu HMENU const settingsmenu = CreatePopupMenu(); AppendMenu(settingsmenu, MF_ENABLED, ID_SAVE_WINDOWS, TEXT("Save Window Arrangement")); + AppendMenu(settingsmenu, MF_ENABLED, ID_GROUP_WINDOWS, TEXT("Group Debugger Windows (requires restart)")); AppendMenu(settingsmenu, MF_DISABLED | MF_SEPARATOR, 0, TEXT("")); AppendMenu(settingsmenu, MF_ENABLED, ID_LIGHT_BACKGROUND, TEXT("Light Background")); AppendMenu(settingsmenu, MF_ENABLED, ID_DARK_BACKGROUND, TEXT("Dark Background")); @@ -449,6 +450,7 @@ void consolewin_info::update_menu() HMENU const menu = GetMenu(window()); CheckMenuItem(menu, ID_SAVE_WINDOWS, MF_BYCOMMAND | (debugger().get_save_window_arrangement() ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(menu, ID_GROUP_WINDOWS, MF_BYCOMMAND | (debugger().get_group_windows_setting() ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_LIGHT_BACKGROUND, MF_BYCOMMAND | ((ui_metrics::THEME_LIGHT_BACKGROUND == metrics().get_color_theme()) ? MF_CHECKED : MF_UNCHECKED)); CheckMenuItem(menu, ID_DARK_BACKGROUND, MF_BYCOMMAND | ((ui_metrics::THEME_DARK_BACKGROUND == metrics().get_color_theme()) ? MF_CHECKED : MF_UNCHECKED)); } @@ -518,6 +520,9 @@ bool consolewin_info::handle_command(WPARAM wparam, LPARAM lparam) case ID_SAVE_WINDOWS: debugger().set_save_window_arrangement(!debugger().get_save_window_arrangement()); return true; + case ID_GROUP_WINDOWS: + debugger().set_group_windows_setting(!debugger().get_group_windows_setting()); + return true; case ID_LIGHT_BACKGROUND: debugger().set_color_theme(ui_metrics::THEME_LIGHT_BACKGROUND); return true; diff --git a/src/osd/modules/debugger/win/debugwin.h b/src/osd/modules/debugger/win/debugwin.h index 52303eefc2c77..d8af29b795eb6 100644 --- a/src/osd/modules/debugger/win/debugwin.h +++ b/src/osd/modules/debugger/win/debugwin.h @@ -40,6 +40,9 @@ class debugger_windows_interface virtual void set_color_theme(int index) = 0; virtual bool get_save_window_arrangement() const = 0; virtual void set_save_window_arrangement(bool save) = 0; + virtual bool get_group_windows() const = 0; + virtual bool get_group_windows_setting() const = 0; + virtual void set_group_windows_setting(bool group) = 0; virtual bool const &waiting_for_debugger() const = 0; virtual bool seq_pressed() const = 0; diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index e48c012dba6d6..f27f7933f082f 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -47,7 +47,9 @@ debugwin_info::debugwin_info(debugger_windows_interface &debugger, bool is_main_ m_wnd = win_create_window_ex_utf8( DEBUG_WINDOW_STYLE_EX, "MAMEDebugWindow", title, DEBUG_WINDOW_STYLE, 0, 0, 100, 100, - dynamic_cast(*osd_common_t::window_list().front()).platform_window(), + debugger.get_group_windows() + ? dynamic_cast(*osd_common_t::window_list().front()).platform_window() + : nullptr, create_standard_menubar(), GetModuleHandleUni(), this); diff --git a/src/osd/modules/debugger/win/debugwininfo.h b/src/osd/modules/debugger/win/debugwininfo.h index f6f37c86955d9..e766ca69c12bc 100644 --- a/src/osd/modules/debugger/win/debugwininfo.h +++ b/src/osd/modules/debugger/win/debugwininfo.h @@ -114,6 +114,7 @@ class debugwin_info : protected debugbase_info ID_CLEAR_LOG, ID_SAVE_WINDOWS, + ID_GROUP_WINDOWS, ID_LIGHT_BACKGROUND, ID_DARK_BACKGROUND, diff --git a/src/osd/modules/debugger/xmlconfig.cpp b/src/osd/modules/debugger/xmlconfig.cpp index 7e702938bf839..977e7b55e700c 100644 --- a/src/osd/modules/debugger/xmlconfig.cpp +++ b/src/osd/modules/debugger/xmlconfig.cpp @@ -17,6 +17,7 @@ char const *const NODE_WINDOW_HISTORY = "history"; char const *const NODE_HISTORY_ITEM = "item"; char const *const ATTR_DEBUGGER_SAVE_WINDOWS = "savewindows"; +char const *const ATTR_DEBUGGER_GROUP_WINDOWS = "groupwindows"; char const *const ATTR_WINDOW_TYPE = "type"; char const *const ATTR_WINDOW_POSITION_X = "position_x"; diff --git a/src/osd/modules/debugger/xmlconfig.h b/src/osd/modules/debugger/xmlconfig.h index ae5cdf8393c3b..6ae476cdec74c 100644 --- a/src/osd/modules/debugger/xmlconfig.h +++ b/src/osd/modules/debugger/xmlconfig.h @@ -33,6 +33,7 @@ extern char const *const NODE_WINDOW_HISTORY; extern char const *const NODE_HISTORY_ITEM; extern char const *const ATTR_DEBUGGER_SAVE_WINDOWS; +extern char const *const ATTR_DEBUGGER_GROUP_WINDOWS; extern char const *const ATTR_WINDOW_TYPE; extern char const *const ATTR_WINDOW_POSITION_X; From a2be87ef9be6f9dfae54fe07eb96915524b16c6a Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 2 Mar 2025 02:46:07 +1100 Subject: [PATCH 055/272] debugger/debugwin.cpp: Fixed clang build. --- src/osd/modules/debugger/debugwin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osd/modules/debugger/debugwin.cpp b/src/osd/modules/debugger/debugwin.cpp index b6d3f1e8664b8..8ff26d40fb346 100644 --- a/src/osd/modules/debugger/debugwin.cpp +++ b/src/osd/modules/debugger/debugwin.cpp @@ -79,8 +79,8 @@ class debugger_windows : virtual bool get_save_window_arrangement() const override { return m_save_windows; } virtual void set_save_window_arrangement(bool save) override { m_save_windows = save; } virtual bool get_group_windows() const override { return m_group_windows; } - virtual bool get_group_windows_setting() const { return m_group_windows_setting; } - virtual void set_group_windows_setting(bool group) { m_group_windows_setting = group; } + virtual bool get_group_windows_setting() const override { return m_group_windows_setting; } + virtual void set_group_windows_setting(bool group) override { m_group_windows_setting = group; } virtual bool const &waiting_for_debugger() const override { return m_waiting_for_debugger; } virtual bool seq_pressed() const override; From c6cbbc92d7110dc158bb68e8d296eafaa2a59d5d Mon Sep 17 00:00:00 2001 From: arbee Date: Sat, 1 Mar 2025 11:48:07 -0500 Subject: [PATCH 056/272] apple/macpwrbkmsc.cpp: Map full SCSI DRQ range; some disk utilities don't use the OS's normal address. [R. Belmont] --- src/mame/apple/macpwrbkmsc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mame/apple/macpwrbkmsc.cpp b/src/mame/apple/macpwrbkmsc.cpp index dfc23ab452e73..6c0a4d104e93c 100644 --- a/src/mame/apple/macpwrbkmsc.cpp +++ b/src/mame/apple/macpwrbkmsc.cpp @@ -587,7 +587,7 @@ void macpbmsc_state::macpd2xx_base_map(address_map &map) map(0x50f04000, 0x50f05fff).rw(FUNC(macpbmsc_state::scc_r), FUNC(macpbmsc_state::scc_w)); map(0x50f06000, 0x50f07fff).rw(FUNC(macpbmsc_state::scsi_drq_r), FUNC(macpbmsc_state::scsi_drq_w)); map(0x50f10000, 0x50f11fff).rw(FUNC(macpbmsc_state::scsi_r), FUNC(macpbmsc_state::scsi_w)); - map(0x50f12060, 0x50f12063).r(FUNC(macpbmsc_state::scsi_drq_r)); + map(0x50f12000, 0x50f13fff).rw(FUNC(macpbmsc_state::scsi_drq_r), FUNC(macpbmsc_state::scsi_drq_w)); } void macpbmsc_state::macpd210_map(address_map &map) From be62159ab843f07daf385c00b7bf1d942c695172 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 1 Mar 2025 19:12:42 +0100 Subject: [PATCH 057/272] mystwarr: small cleanup --- src/mame/konami/mystwarr.cpp | 58 ++++++++----------- src/mame/konami/mystwarr_v.cpp | 102 +++++++++++++++++---------------- src/mame/saitek/gk2000.cpp | 1 + 3 files changed, 77 insertions(+), 84 deletions(-) diff --git a/src/mame/konami/mystwarr.cpp b/src/mame/konami/mystwarr.cpp index 604ed5dfd1f4a..2445cbca91fe2 100644 --- a/src/mame/konami/mystwarr.cpp +++ b/src/mame/konami/mystwarr.cpp @@ -143,6 +143,7 @@ we have no way of knowing which is the later/corrected version. #include "machine/eepromser.h" #include "sound/k054539.h" #include "sound/okim6295.h" + #include "speaker.h" @@ -154,7 +155,7 @@ uint16_t mystwarr_state::eeprom_r(offs_t offset, uint16_t mem_mask) return ioport("IN1")->read(); } -// logerror("msb access to eeprom port\n"); + //logerror("msb access to eeprom port\n"); return 0; } @@ -166,8 +167,7 @@ void mystwarr_state::mweeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) ioport("EEPROMOUT")->write(data, 0xffff); } -// logerror("unknown LSB write %x to eeprom\n", data); - + //logerror("unknown LSB write %x to eeprom\n", data); } uint16_t mystwarr_state::dddeeprom_r(offs_t offset, uint16_t mem_mask) @@ -198,14 +198,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mystwarr_interrupt) if (!(m_mw_irq_control & 0x01)) return; - if(scanline == 240) + if (scanline == 240) m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); - if(scanline == 0) + if (scanline == 0) m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); /* writes to LSB of 0x410000 port and clears a work RAM flag, almost likely not really necessary. */ -// m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); + //m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); } TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt) @@ -213,12 +213,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt) int scanline = param; /* irq 4 has an irq routine in metamrph, but it's not really called */ -// m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); + //m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); - if(scanline == 24) + if (scanline == 24) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); - if(scanline == 248) + if (scanline == 248) if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE); } @@ -228,12 +228,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt) if (!(m_mw_irq_control & 0x40)) return; - if(scanline == 247) + if (scanline == 247) { if (m_k055673->k053246_is_irq_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); } - if(scanline == 23) + if (scanline == 23) m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); } @@ -256,10 +256,9 @@ void mystwarr_state::irq_ack_w(offs_t offset, uint16_t data, uint16_t mem_mask) if (offset == 3 && ACCESSING_BITS_0_7) { - m_mw_irq_control = data&0xff; - -// if ((data &0xf0) != 0xd0) logerror("Unknown write to IRQ reg: %x\n", data); + m_mw_irq_control = data & 0xff; + //if ((data &0xf0) != 0xd0) logerror("Unknown write to IRQ reg: %x\n", data); } } @@ -280,7 +279,7 @@ void mystwarr_state::k053247_scattered_word_w(offs_t offset, uint16_t data, uint { if (offset & 0x0078) { -// osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); + //osd_printf_debug("spr write %x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); COMBINE_DATA(&m_spriteram[offset]); } else @@ -440,7 +439,6 @@ void mystwarr_state::k053247_martchmp_word_w(offs_t offset, uint16_t data, uint1 else { offset = (offset & 0x0007) | ((offset & 0x1fe0) >> 2); - m_k055673->k053247_word_w(offset,data,mem_mask); } } @@ -461,7 +459,7 @@ void mystwarr_state::mccontrol_w(offs_t offset, uint16_t data, uint16_t mem_mask m_k055673->k053246_set_objcha_line((data&0x04) ? ASSERT_LINE : CLEAR_LINE); } -// else logerror("write %x to LSB of mccontrol\n", data); + //else logerror("write %x to LSB of mccontrol\n", data); } void mystwarr_state::mceeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -478,7 +476,7 @@ void mystwarr_state::mceeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask) // bit 6 VINTEN ioport("EEPROMOUT")->write(data, 0xffff); } - // logerror("unknown LSB write %x to eeprom\n", data); + //logerror("unknown LSB write %x to eeprom\n", data); } /* Martial Champion */ @@ -886,25 +884,21 @@ MACHINE_START_MEMBER(mystwarr_state,mystwarr) MACHINE_RESET_MEMBER(mystwarr_state,mystwarr) { - int i; - // soften chorus(chip 0 channel 0-3), boost voice(chip 0 channel 4-7) - for (i=0; i<=3; i++) + for (int i = 0; i <= 3; i++) { m_k054539_1->set_gain(i, 0.8); m_k054539_1->set_gain(i+4, 2.0); } // soften percussions(chip 1 channel 0-7) - for (i=0; i<=7; i++) m_k054539_2->set_gain(i, 0.5); + for (int i = 0; i <= 7; i++) m_k054539_2->set_gain(i, 0.5); } MACHINE_RESET_MEMBER(mystwarr_state,dadandrn) { - int i; - // boost voice(chip 0 channel 4-7) - for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 2.0); + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); } MACHINE_START_MEMBER(mystwarr_state,viostormbl) @@ -922,15 +916,13 @@ MACHINE_START_MEMBER(mystwarr_state,viostormbl) MACHINE_RESET_MEMBER(mystwarr_state,viostorm) { if (m_k054539_1.found()) - for (int i=4; i<=7; i++) m_k054539_1->set_gain(i, 2.0); // boost voice(chip 0 channel 4-7) + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); // boost voice(chip 0 channel 4-7) } MACHINE_RESET_MEMBER(mystwarr_state,metamrph) { - int i; - // boost voice(chip 0 channel 4-7) and soften other channels - for (i=0; i<=3; i++) + for (int i = 0; i <= 3; i++) { m_k054539_1->set_gain(i, 0.8); m_k054539_1->set_gain(i+4, 1.8); @@ -941,18 +933,14 @@ MACHINE_RESET_MEMBER(mystwarr_state,metamrph) MACHINE_RESET_MEMBER(mystwarr_state,martchmp) { - int i; - // boost voice(chip 0 channel 4-7) - for (i=4; i<=7; i++) m_k054539_1->set_gain(i, 1.4); + for (int i = 4; i <= 7; i++) m_k054539_1->set_gain(i, 1.4); } MACHINE_RESET_MEMBER(mystwarr_state,gaiapols) { - int i; - // boost voice(chip 0 channel 5-7) - for (i=5; i<=7; i++) m_k054539_1->set_gain(i, 2.0); + for (int i = 5; i <= 7; i++) m_k054539_1->set_gain(i, 2.0); } diff --git a/src/mame/konami/mystwarr_v.cpp b/src/mame/konami/mystwarr_v.cpp index 8b8c8b9cae1df..9fc8b894f9372 100644 --- a/src/mame/konami/mystwarr_v.cpp +++ b/src/mame/konami/mystwarr_v.cpp @@ -18,7 +18,7 @@ void mystwarr_state::decode_tiles() { uint8_t *s = memregion("k056832")->base(); int len = memregion("k056832")->bytes(); - uint8_t *pFinish = s+len-3; + uint8_t *pFinish = s + len - 3; uint8_t *d; int gfxnum = m_k056832->get_gfx_num(); @@ -59,7 +59,15 @@ void mystwarr_state::decode_tiles() // Mystic Warriors requires tile based blending. K056832_CB_MEMBER(mystwarr_state::mystwarr_tile_callback) { - if (layer == 1) {if ((*code & 0xff00) + (*color) == 0x4101) m_cbparam++; else m_cbparam--;} //* water hack (TEMPORARY) + if (layer == 1) + { + //* water hack (TEMPORARY) + if ((*code & 0xff00) + (*color) == 0x4101) + m_cbparam++; + else + m_cbparam--; + } + *color = m_layer_colorbase[layer] | (*color >> 1 & 0x1e); } @@ -77,10 +85,10 @@ K056832_CB_MEMBER(mystwarr_state::game4bpp_tile_callback) K055673_CB_MEMBER(mystwarr_state::mystwarr_sprite_callback) { - *priority_mask = *color & 0x00e0; + *priority_mask = *color & 0xe0; - const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending - *color = m_sprite_colorbase | (*color & 0x001f) | effect_attributes; + const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending + *color = m_sprite_colorbase | (*color & 0x1f) | effect; } K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback) @@ -88,16 +96,14 @@ K055673_CB_MEMBER(mystwarr_state::metamrph_sprite_callback) *priority_mask = (*color & 0xe0) >> 2; const int shadow = (*color >> 10) & 0b11; - const int effect_attributes = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending - *color = (*color & 0x1f) | m_sprite_colorbase | effect_attributes | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0); + const int effect = ((*color >> 8) & 0b11) << K055555_MIXSHIFT; // used for blending + *color = m_sprite_colorbase | (*color & 0x1f) | effect | ((shadow == 0b11) ? K055555_SKIPSHADOW : 0); } K055673_CB_MEMBER(mystwarr_state::gaiapols_sprite_callback) { - int c = *color; - - *color = m_sprite_colorbase | (c>>4 & 0x20) | (c & 0x001f); - *priority_mask = c & 0x00e0; + *priority_mask = *color & 0xe0; + *color = m_sprite_colorbase | (*color >> 4 & 0x20) | (*color & 0x1f); } K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback) @@ -111,7 +117,7 @@ K055673_CB_MEMBER(mystwarr_state::martchmp_sprite_callback) *color = m_sprite_colorbase | (c & 0x1f); if (m_oinprion & 0xf0) - *priority_mask = m_cbparam; // use PCU2 internal priority + *priority_mask = m_cbparam; // use PCU2 internal priority else *priority_mask = c & 0xf0; // use color implied priority } @@ -124,12 +130,12 @@ TILE_GET_INFO_MEMBER(mystwarr_state::get_gai_936_tile_info) uint8_t *ROM = memregion("gfx4")->base(); uint8_t *dat1 = ROM, *dat2 = ROM + 0x20000, *dat3 = ROM + 0x60000; - tileno = dat3[tile_index] | ((dat2[tile_index]&0x3f)<<8); + tileno = dat3[tile_index] | ((dat2[tile_index] & 0x3f) << 8); if (tile_index & 1) - colour = (dat1[tile_index>>1]&0xf); + colour = (dat1[tile_index >> 1] & 0xf); else - colour = ((dat1[tile_index>>1]>>4)&0xf); + colour = ((dat1[tile_index >> 1] >> 4) & 0xf); if (dat2[tile_index] & 0x80) colour |= 0x10; @@ -160,15 +166,13 @@ VIDEO_START_MEMBER(mystwarr_state, gaiapols) TILE_GET_INFO_MEMBER(mystwarr_state::get_ult_936_tile_info) { - int tileno, colour; uint8_t *ROM = memregion("gfx4")->base(); uint8_t *dat1 = ROM, *dat2 = ROM + 0x40000; - tileno = dat2[tile_index] | ((dat1[tile_index]&0x1f)<<8); + int tileno = dat2[tile_index] | ((dat1[tile_index] & 0x1f) << 8); + int colour = m_sub1_colorbase; - colour = m_sub1_colorbase; - - tileinfo.set(0, tileno, colour, (dat1[tile_index]&0x40) ? TILE_FLIPX : 0); + tileinfo.set(0, tileno, colour, (dat1[tile_index] & 0x40) ? TILE_FLIPX : 0); } VIDEO_START_MEMBER(mystwarr_state, dadandrn) @@ -258,18 +262,22 @@ VIDEO_START_MEMBER(mystwarr_state, martchmp) uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old, blendmode=0; + int blendmode = 0; - if (m_cbparam<0) m_cbparam=0; else if (m_cbparam>=32) blendmode=(1<<16|GXMIX_BLEND_FORCE)<<2; //* water hack (TEMPORARY) + //* water hack (TEMPORARY) + if (m_cbparam < 0) + m_cbparam = 0; + else if (m_cbparam >= 32) + blendmode = (1 << 16 | GXMIX_BLEND_FORCE) << 2; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; - if( old != m_layer_colorbase[i] ) m_k056832->mark_plane_dirty(i); + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; + if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } - m_sprite_colorbase = m_k055555->K055555_get_palette_index(4)<<5; + m_sprite_colorbase = m_k055555->K055555_get_palette_index(4) << 5; konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, blendmode, nullptr, 0); return 0; @@ -277,16 +285,14 @@ uint32_t mystwarr_state::screen_update_mystwarr(screen_device &screen, bitmap_rg uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } - m_sprite_colorbase = m_k055555->K055555_get_palette_index(4)<<4; + m_sprite_colorbase = m_k055555->K055555_get_palette_index(4) << 4; konamigx_mixer(screen, bitmap, cliprect, nullptr, GXSUB_K053250 | GXSUB_4BPP, nullptr, 0, 0, nullptr, 0); return 0; @@ -294,12 +300,10 @@ uint32_t mystwarr_state::screen_update_metamrph(screen_device &screen, bitmap_rg uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - int i, old, blendmode; - - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { - old = m_layer_colorbase[i]; - m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i)<<4; + int old = m_layer_colorbase[i]; + m_layer_colorbase[i] = m_k055555->K055555_get_palette_index(i) << 4; if (old != m_layer_colorbase[i]) m_k056832->mark_plane_dirty(i); } @@ -309,7 +313,7 @@ uint32_t mystwarr_state::screen_update_martchmp(screen_device &screen, bitmap_rg m_oinprion = m_k055555->K055555_read_register(K55_OINPRI_ON); // not quite right - blendmode = (m_oinprion==0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1<<16|GXMIX_BLEND_FORCE)<<2) : 0; + int blendmode = (m_oinprion == 0xef && m_k054338->register_r(K338_REG_PBLEND)) ? ((1 << 16 | GXMIX_BLEND_FORCE) << 2) : 0; konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, blendmode, nullptr, 0); return 0; @@ -322,7 +326,7 @@ void mystwarr_state::ddd_053936_enable_w(offs_t offset, uint16_t data, uint16_t if (ACCESSING_BITS_8_15) { m_roz_enable = data & 0x0100; - m_roz_rombank = (data & 0xc000)>>14; + m_roz_rombank = (data & 0xc000) >> 14; } } @@ -377,7 +381,7 @@ uint16_t mystwarr_state::gai_053936_tilerom_0_r(offs_t offset) uint8_t *ROM2 = (uint8_t *)memregion("gfx4")->base(); ROM1 += 0x20000; - ROM2 += 0x20000+0x40000; + ROM2 += 0x20000 + 0x40000; return ((ROM1[offset]<<8) | ROM2[offset]); } @@ -407,7 +411,7 @@ uint16_t mystwarr_state::gai_053936_tilerom_2_r(offs_t offset) offset += (m_roz_rombank * 0x100000); - return ROM[offset/2]<<8; + return ROM[offset/2] << 8; } uint16_t mystwarr_state::ddd_053936_tilerom_2_r(offs_t offset) @@ -416,7 +420,7 @@ uint16_t mystwarr_state::ddd_053936_tilerom_2_r(offs_t offset) offset += (m_roz_rombank * 0x100000); - return ROM[offset]<<8; + return ROM[offset] << 8; } uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)/* and gaiapols */ @@ -425,20 +429,20 @@ uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rg if (m_gametype == 0) { - m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4)<<4)&0x7f; + m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4) << 4) & 0x7f; rozmode = GXSUB_4BPP; } else { - m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4)<<3)&0x7f; + m_sprite_colorbase = (m_k055555->K055555_get_palette_index(4) << 3) & 0x7f; rozmode = GXSUB_8BPP; } if (m_k056832->get_layer_association()) { - for (i=0; i<4; i++) + for (i = 0; i < 4; i++) { - newbase = m_k055555->K055555_get_palette_index(i)<<4; + newbase = m_k055555->K055555_get_palette_index(i) << 4; if (m_layer_colorbase[i] != newbase) { m_layer_colorbase[i] = newbase; @@ -448,9 +452,9 @@ uint32_t mystwarr_state::screen_update_dadandrn(screen_device &screen, bitmap_rg } else { - for (dirty=0, i=0; i<4; i++) + for (dirty = 0, i = 0; i < 4; i++) { - newbase = m_k055555->K055555_get_palette_index(i)<<4; + newbase = m_k055555->K055555_get_palette_index(i) << 4; if (m_layer_colorbase[i] != newbase) { m_layer_colorbase[i] = newbase; diff --git a/src/mame/saitek/gk2000.cpp b/src/mame/saitek/gk2000.cpp index b5a5842001e82..7a843baa73b5b 100644 --- a/src/mame/saitek/gk2000.cpp +++ b/src/mame/saitek/gk2000.cpp @@ -45,6 +45,7 @@ Mephisto Explorer: - PCB label: 51CT09-01001L - Hitachi H8/3212 MCU (QFP), 10MHz XTAL, same ROM contents as Barracuda - LCD layout is slightly different, symbols are on the right side +- no board edge LEDs, LCD backlight via P51 H8/323 A13 MCU is used in: - Saitek GK 2000 (1992 version, 86071220X12) From 5360641faf4ed5ff8b530091006aa41ac4755e61 Mon Sep 17 00:00:00 2001 From: Fredrik Sandkvist Date: Sat, 1 Mar 2025 19:19:33 +0100 Subject: [PATCH 058/272] konamigx_v.cpp, konamigx.h: implement brightness for layers (#13400) * konamigx_v.cpp, konamigx.h: implement brightness for layers * konamigx_m.cpp: initial implementation of operation 0x98 --- src/mame/konami/konamigx.h | 4 ++ src/mame/konami/konamigx_m.cpp | 67 +++++++++++++++++++++------------- src/mame/konami/konamigx_v.cpp | 24 ++++++++++++ 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/src/mame/konami/konamigx.h b/src/mame/konami/konamigx.h index 7336d7ba96320..e877cf2985bc8 100644 --- a/src/mame/konami/konamigx.h +++ b/src/mame/konami/konamigx.h @@ -144,6 +144,7 @@ class konamigx_state : public driver_device void konamigx_precache_registers(void); void wipezbuf(int noshadow); + void set_brightness(int layer); void dmastart_callback(int data); @@ -247,6 +248,9 @@ class konamigx_state : public driver_device uint16_t *m_gx_spriteram = nullptr; std::unique_ptr m_gx_spriteram_alloc; + u8 m_current_brightness = 0xff; + u8 m_brightness[3]{}; + // mirrored K054338 settings int *m_K054338_shdRGB = nullptr; diff --git a/src/mame/konami/konamigx_m.cpp b/src/mame/konami/konamigx_m.cpp index 26bf5f14ab928..0727f446efdb8 100644 --- a/src/mame/konami/konamigx_m.cpp +++ b/src/mame/konami/konamigx_m.cpp @@ -53,8 +53,8 @@ uint16_t konamigx_state::K055550_word_r(offs_t offset) void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_mask) { auto &mspace = m_maincpu->space(AS_PROGRAM); - uint32_t adr, bsize, count, i, lim; - int src, tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; + uint32_t adr, bsize, count, i, lim, src, dst; + int tgt, srcend, tgtend, skip, cx1, sx1, wx1, cy1, sy1, wy1, cz1, sz1, wz1, c2, s2, w2; int dx, dy, angle; COMBINE_DATA(m_prot_data+offset); @@ -71,10 +71,25 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m count = (m_prot_data[0] & 0xff) + 1; lim = adr+bsize*count; - for(i=adr; i> 2; + + for (int x = 0; x < count; ++x) + { + const u32 src_data = mspace.read_dword(src + x * 8); + mspace.write_dword(dst + x * 4, src_data); + } + break; + // WARNING: The following cases are speculation based with questionable accuracy!(AAT) case 0x87: // unknown memory write (Violent Storm at 0x00b6ea) @@ -101,7 +116,7 @@ void konamigx_state::K055550_word_w(offs_t offset, uint16_t data, uint16_t mem_m tgtend = srcend + bsize; // let's hope GCC will inline the mem24bew calls - for (src=adr; src=wx1+w2) continue; // X rejection + if (abs((cx1 + sx1) - (c2 + s2)) >= wx1 + w2) continue; // X rejection c2 = (short)mspace.read_word(tgt + 6); s2 = (short)mspace.read_word(tgt + 8); w2 = (short)mspace.read_word(tgt +10); - if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection + if (abs((cy1 + sy1) - (c2 + s2)) >= wy1 + w2) continue; // Y rejection c2 = (short)mspace.read_word(tgt +12); s2 = (short)mspace.read_word(tgt +14); w2 = (short)mspace.read_word(tgt +16); - if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection + if (abs((cz1 + sz1) - (c2 + s2)) >= wz1 + w2) continue; // Z rejection mspace.write_byte(i, 0x80); // collision confirmed } @@ -211,13 +226,13 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1 dst_skip += element_size; if (element_size == 1) - for (i=src_count; i; i--) + for (i = src_count; i; i--) { mspace.write_byte(dst_addr, mspace.read_byte(src_addr)); src_addr += src_skip; dst_addr += dst_skip; } - else for (i=src_count; i; i--) + else for (i = src_count; i; i--) { mspace.write_word(dst_addr, mspace.read_word(src_addr)); src_addr += src_skip; @@ -387,7 +402,7 @@ if((data1=obj[0])&0x80000000)\ case 0x11010010: i = 5; vmask = 0x1ff; break; case 0x01111018: i = 4; break; case 0x10010011: i = 3; - if ((srcbase[0x1c75]&0xff)==32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES,36); // (TEMPORARY) + if ((srcbase[0x1c75] & 0xff) == 32) m_k055555->K055555_write_reg(K55_BLEND_ENABLES,36); // (TEMPORARY) break; case 0x11010811: i = 2; break; case 0x10000010: i = 1; break; @@ -424,8 +439,8 @@ if((data1=obj[0])&0x80000000)\ // decode Lord British (the designer must be a Richard Garriot fan too:) if (srcbase[0x0848/4] & 0x0000ffff) { - hoffs = srcbase[0x08b0/4]>>16; - voffs = srcbase[0x08b4/4]>>16; + hoffs = srcbase[0x08b0/4] >> 16; + voffs = srcbase[0x08b4/4] >> 16; hoffs -= hcorr; voffs -= vcorr; obj = &srcbase[0x084c/4]; @@ -445,8 +460,8 @@ if((data1=obj[0])&0x80000000)\ i = src[7] & 0xf; if (!i) continue; // reject retired or zero-element groups i <<= 2; - hoffs = src[5]>>16; - voffs = src[6]>>16; + hoffs = src[5] >> 16; + voffs = src[6] >> 16; hoffs -= hcorr; voffs -= vcorr; obj = src + 8; @@ -456,9 +471,9 @@ if((data1=obj[0])&0x80000000)\ { EXTRACT_EVEN } - while ((obj+=4)space(AS_PROGRAM); COMBINE_DATA(m_fantjour_dma + offset); - if(!offset && ACCESSING_BITS_24_31) { + if (!offset && ACCESSING_BITS_24_31) { uint32_t sa = m_fantjour_dma[1]; // uint16_t ss = (m_fantjour_dma[2] & 0xffff0000) >> 16; // uint32_t sb = ((m_fantjour_dma[2] & 0xffff) << 16) | ((m_fantjour_dma[3] & 0xffff0000) >> 16); @@ -496,16 +511,18 @@ void konamigx_state::fantjour_dma_w(offs_t offset, uint32_t data, uint32_t mem_m uint32_t x = m_fantjour_dma[6]; uint32_t i1, i2; - if(mode == 0x93) - for(i1=0; i1 <= sz2; i1++) - for(i2=0; i2 < db; i2+=4) { + if (mode == 0x93) + for (i1 = 0; i1 <= sz2; i1++) + for (i2 = 0; i2 < db; i2 += 4) + { mspace.write_dword(da, mspace.read_dword(sa) ^ x); da += 4; sa += 4; } - else if(mode == 0x8f) - for(i1=0; i1 <= sz2; i1++) - for(i2=0; i2 < db; i2+=4) { + else if (mode == 0x8f) + for (i1 = 0; i1 <= sz2; i1++) + for (i2 = 0; i2 < db; i2 += 4) + { mspace.write_dword(da, x); da += 4; } diff --git a/src/mame/konami/konamigx_v.cpp b/src/mame/konami/konamigx_v.cpp index 2f1cf7a07c1de..cdde3894abf93 100644 --- a/src/mame/konami/konamigx_v.cpp +++ b/src/mame/konami/konamigx_v.cpp @@ -54,6 +54,10 @@ void konamigx_state::konamigx_precache_registers(void) m_vmixon = m_k055555->K055555_read_register(K55_VINMIX_ON); m_osinmix = m_k055555->K055555_read_register(K55_OSBLEND_ENABLES); m_osmixon = m_k055555->K055555_read_register(K55_OSBLEND_ON); + + m_brightness[0] = u8(m_k054338->register_r(K338_REG_BRI3)); + m_brightness[1] = u8(m_k054338->register_r(K338_REG_BRI3 + 1) >> 8); + m_brightness[2] = u8(m_k054338->register_r(K338_REG_BRI3 + 1)); } inline int konamigx_state::K053247GX_combine_c18(int attrib) // (see p.46) @@ -243,6 +247,22 @@ void konamigx_state::wipezbuf(int noshadow) } } +void konamigx_state::set_brightness(int layer) +{ + const u8 bri_mode = (m_k055555->K055555_read_register(K55_VBRI) >> layer * 2) & 0b11; + + const u8 new_brightness = bri_mode ? m_brightness[bri_mode - 1] : 0xff; + + if (m_current_brightness != new_brightness) + { + m_current_brightness = new_brightness; + for (int x = 0; x < m_palette->entries(); ++x) + { + m_palette->set_pen_contrast(x, m_current_brightness / 255.0); + } + } +} + /* * Sprite Format * ------------------ @@ -664,6 +684,8 @@ void konamigx_state::gx_draw_basic_tilemaps(screen_device &screen, bitmap_rgb32 int disp = m_k055555->K055555_read_register(K55_INPUT_ENABLES); if (disp & (1<>(i+16); temp3 = 3; } else @@ -1135,6 +1157,8 @@ void konamigx_state::common_init() save_item(NAME(m_vmixon)); save_item(NAME(m_osinmix)); save_item(NAME(m_osmixon)); + save_item(NAME(m_current_brightness)); + save_item(NAME(m_brightness)); m_gx_tilemode = 0; From e6c3d7856895a2fccf4266e30c0de4f3d6bfb104 Mon Sep 17 00:00:00 2001 From: m1macrophage <168948267+m1macrophage@users.noreply.github.com> Date: Sat, 1 Mar 2025 13:09:35 -0800 Subject: [PATCH 059/272] linn/linndrum.cpp: Made knobs controllable by pointing device. (#13433) --- src/mame/layout/linn_linndrum.lay | 129 ++++++++++++++++++------------ src/mame/linn/linndrum.cpp | 7 +- 2 files changed, 80 insertions(+), 56 deletions(-) diff --git a/src/mame/layout/linn_linndrum.lay b/src/mame/layout/linn_linndrum.lay index f755488d13ffc..71fe129471f18 100644 --- a/src/mame/layout/linn_linndrum.lay +++ b/src/mame/layout/linn_linndrum.lay @@ -224,7 +224,7 @@ copyright-holders:m1macrophage - + @@ -596,6 +596,15 @@ copyright-holders:m1macrophage function() local view = file.views["Default Layout"] install_slider_callbacks(view) + + local sweep_scale = 1.2 + add_simplecounter_knob(view, "knob_pot_tempo", "pot_tempo", sweep_scale) + add_simplecounter_knob(view, "knob_pot_volume", "pot_volume", sweep_scale) + for i = 1, 7 do + local knob_input = "pot_tuning_" .. i + add_simplecounter_knob(view, "knob_" .. knob_input, knob_input, sweep_scale) + end + for i = 1, 16 do local pan_input = "pot_pan_" .. i add_vertical_slider(view, "slider_" .. pan_input, "slider_knob_" .. pan_input, pan_input) @@ -605,47 +614,57 @@ copyright-holders:m1macrophage end) ----------------------------------------------------------------------- - -- Slider library starts. + -- Slider and knob library starts. -- Can be copied as-is to other layouts. ----------------------------------------------------------------------- - local sliders = {} -- Stores slider information. + local widgets = {} -- Stores slider and knob information. local pointers = {} -- Tracks pointer state. -- The knob's Y position must be animated using . -- The click area's vertical size must exactly span the range of the -- knob's movement. function add_vertical_slider(view, clickarea_id, knob_id, port_name) - local slider = {} + table.insert(widgets, { + clickarea = get_layout_item(view, clickarea_id), + slider_knob = get_layout_item(view, knob_id), + field = get_port_field(port_name), + is_knob = false }) + end - slider.clickarea = view.items[clickarea_id] - if slider.clickarea == nil then - emu.print_error("Slider element: '" .. clickarea_id .. "' not found.") - return - end + -- A sweep between 0 and 100 requires moving the pointer by + -- `scale * clickarea.height` pixes. + function add_simplecounter_knob(view, clickarea_id, port_name, scale) + table.insert(widgets, { + clickarea = get_layout_item(view, clickarea_id), + field = get_port_field(port_name), + is_knob = true, + scale = scale }) + end - slider.knob = view.items[knob_id] - if slider.knob == nil then - emu.print_error("Slider knob element: '" .. knob_id .. "' not found.") - return + function get_layout_item(view, item_id) + local item = view.items[item_id] + if item == nil then + emu.print_error("Layout element: '" .. item_id .. "' not found.") end + return item + end + function get_port_field(port_name) local port = file.device:ioport(port_name) if port == nil then emu.print_error("Port: '" .. port_name .. "' not found.") - return + return nil end - - slider.field = nil + local field = nil for k, val in pairs(port.fields) do - slider.field = val + field = val break end - if slider.field == nil then + if field == nil then emu.print_error("Port: '" .. port_name .."' does not seem to be an IPT_ADJUSTER.") - return + return nil end - - table.insert(sliders, slider) + return field end local function pointer_updated(type, id, dev, x, y, btn, dn, up, cnt) @@ -655,56 +674,64 @@ copyright-holders:m1macrophage return end - -- If a button was just pressed, find the affected slider, if any. + -- If a button was just pressed, find the affected widget, if any. if dn & 1 ~= 0 then - for i = 1, #sliders do - if sliders[i].knob.bounds:includes(x, y) then + for i = 1, #widgets do + local found, relative + if widgets[i].slider_knob and widgets[i].slider_knob.bounds:includes(x, y) then + found = true + relative = true + elseif widgets[i].clickarea.bounds:includes(x, y) then + found = true + relative = false + end + if found then pointers[id] = { - selected_slider = i, - relative = true, + selected_widget = i, + relative = relative, start_y = y, - start_value = sliders[i].field.user_value } - break - elseif sliders[i].clickarea.bounds:includes(x, y) then - pointers[id] = { - selected_slider = i, - relative = false } + start_value = widgets[i].field.user_value } break end end end - -- If there is no slider selected by the current pointer, we are done. + -- If there is no widget selected by the current pointer, we are done. if pointers[id] == nil then return end - -- A slider is selected. Update state and, indirectly, slider knob position, - -- based on the pointer's Y position. It is assumed the attached IO field is - -- an IPT_ADJUSTER with a range of 0-100 (the default). + -- A widget is selected. Update its state based on the pointer's Y + -- position. It is assumed the attached IO field is an + -- IPT_ADJUSTER with a range of 0-100 (the default). local pointer = pointers[id] - local slider = sliders[pointer.selected_slider] + local widget = widgets[pointer.selected_widget] - local knob_half_height = slider.knob.bounds.height / 2 - local min_y = slider.clickarea.bounds.y0 + knob_half_height - local max_y = slider.clickarea.bounds.y1 - knob_half_height - - local new_value = 0 - if pointer.relative then - -- User clicked on the knob. The new value will depend on how much the - -- knob was dragged. - new_value = pointer.start_value - 100 * (y - pointer.start_y) / (max_y - min_y) + local new_value + if widget.is_knob then + local step_y = 100.0 / (widget.scale * widget.clickarea.bounds.height) + new_value = pointer.start_value + (pointer.start_y - y) * step_y else - -- User clicked elsewhere on the slider. The new value will depend on - -- the absolute position of the click. - new_value = 100 - 100 * (y - min_y) / (max_y - min_y) + local knob_half_height = widget.slider_knob.bounds.height / 2 + local min_y = widget.clickarea.bounds.y0 + knob_half_height + local max_y = widget.clickarea.bounds.y1 - knob_half_height + + if pointer.relative then + -- User clicked on the knob. The new value will depend on how + -- much the knob was dragged. + new_value = pointer.start_value - 100 * (y - pointer.start_y) / (max_y - min_y) + else + -- User clicked elsewhere on the slider. The new value will depend on + -- the absolute position of the click. + new_value = 100 - 100 * (y - min_y) / (max_y - min_y) + end end new_value = math.floor(new_value + 0.5) if new_value < 0 then new_value = 0 end if new_value > 100 then new_value = 100 end - slider.field.user_value = new_value + widget.field.user_value = new_value end local function pointer_left(type, id, dev, x, y, up, cnt) @@ -726,7 +753,7 @@ copyright-holders:m1macrophage view:set_forget_pointers_callback(forget_pointers) end ----------------------------------------------------------------------- - -- Slider library ends. + -- Slider and knob library ends. ----------------------------------------------------------------------- ]]> diff --git a/src/mame/linn/linndrum.cpp b/src/mame/linn/linndrum.cpp index 608b3cd4a8869..50e066e1fe601 100644 --- a/src/mame/linn/linndrum.cpp +++ b/src/mame/linn/linndrum.cpp @@ -33,12 +33,9 @@ Most of the digital functionality is emulated. Audio is not yet emulated. Usage: -The driver includes a (mostly) interactive layout, including buttons, LEDs and -sliders. The only non-interactive widgets right now are the knobs (such as -tuning and volume). Those will display their current value, but they can only -be modified by the Slider Control menu. +The driver includes an interactive layout. -Since there is no audio, the driver logs triggers and other info. To see these +Since there is no audio, the driver logs triggers and other info. To see those, run the driver with `-log`: ./mame -window linndrum -log From a7e0a2fd50fbd8d7cf30d63a523043e1967adb8a Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sat, 1 Mar 2025 22:32:35 +0100 Subject: [PATCH 060/272] geneve: Enable 384K SRAM expansion. --- src/devices/bus/ti99/internal/genboard.cpp | 21 +++-- src/devices/bus/ti99/internal/genboard.h | 11 ++- src/mame/ti/geneve.cpp | 92 +++++++++++++++------- 3 files changed, 84 insertions(+), 40 deletions(-) diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp index f87120d825fe7..7e2ea7e363000 100644 --- a/src/devices/bus/ti99/internal/genboard.cpp +++ b/src/devices/bus/ti99/internal/genboard.cpp @@ -33,6 +33,9 @@ out: CSR*: v9938 read out: RAMENX*: SRAM expansion + out: RAMENU*: Ultimate SRAM expansion. This is actually done by a small + daughterboard, not directly in the Gate Array. + out: RAMEN*: SRAM out: ROMEN*: EPROM out: AB0, AB1, AB2: Mapped address bits (2^15, 2^14, 2^13) @@ -145,9 +148,9 @@ 1 0111 110. .... .... .... address block cxxx 1 0111 111. .... .... .... address block exxx - 1 1... .... .... .... .... on-board bus or external bus (unclear) - 1 10.. .... .... .... .... Future expansion - 1 1100 .... .... .... .... Future expansion + 1 1... .... .... .... .... on-board bus + 1 10.. .... .... .... .... Future expansion (Ultimate SRAM expansion) + 1 1100 .... .... .... .... Future expansion (Ultimate SRAM expansion) 1 1101 0... .... .... .... on-board sram (32K) - Optional 32 KiB expansion, 0 WS 1 1101 1... .... .... .... on-board sram (32K) - stock 32 KiB SRAM, 0 WS @@ -738,8 +741,8 @@ const geneve_gate_array_device::physentry_t geneve_gate_array_device::s_physmap[ { { 0x00, 0x3f, MPDRAM, "DRAM" }, { 0x40, 0x3f, MPEXP, "Future exp (on-board)" }, - { 0xc0, 0x1f, MPSRAMF, "Future SRAM exp" }, - { 0xe0, 0x07, MPSRAMF, "Future SRAM exp" }, + { 0xc0, 0x1f, MPSRAMU, "Ultimate SRAM exp" }, + { 0xe0, 0x07, MPSRAMU, "Ultimate SRAM exp" }, { 0xe8, 0x03, MPSRAMX, "SRAM exp" }, { 0xec, 0x03, MPSRAM, "SRAM" }, { 0xf0, 0x0f, MPEPROM, "Boot ROM/PFM" }, @@ -816,7 +819,7 @@ bool geneve_gate_array_device::accessing_dram_s(int function) bool geneve_gate_array_device::accessing_sram_s(int function) { - return (function == MPSRAM) || (function == MPSRAMX) || (function == MPSRAMF); + return (function == MPSRAM) || (function == MPSRAMX) || (function == MPSRAMU); } bool geneve_gate_array_device::accessing_devs_s(int function) @@ -953,6 +956,12 @@ int geneve_gate_array_device::ramenx_out() return (dec->function == MPSRAMX)? ASSERT_LINE : CLEAR_LINE; } +int geneve_gate_array_device::ramenu_out() +{ + decdata* dec = (m_debug)? &m_decdebug : &m_decoded; + return (dec->function == MPSRAMU)? ASSERT_LINE : CLEAR_LINE; +} + int geneve_gate_array_device::rtcen_out() { decdata* dec = (m_debug)? &m_decdebug : &m_decoded; diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h index 754887b09b203..bf9f3ef4c27bd 100644 --- a/src/devices/bus/ti99/internal/genboard.h +++ b/src/devices/bus/ti99/internal/genboard.h @@ -81,9 +81,12 @@ class geneve_gate_array_device : public device_t int csr_out(); int csw_out(); int rtcen_out(); - int romen_out(); - int ramen_out(); - int ramenx_out(); + + int romen_out(); // Boot EPROM access + int ramen_out(); // Stock SRAM access + int ramenx_out(); // 32K expanded SRAM access + int ramenu_out(); // Full 384K SRAM access + int snden_out(); int dben_out(); int gaready_out(); @@ -154,7 +157,7 @@ class geneve_gate_array_device : public device_t MPEPROM, MPSRAM, MPSRAMX, - MPSRAMF, + MPSRAMU, MBOX, CARTPROT diff --git a/src/mame/ti/geneve.cpp b/src/mame/ti/geneve.cpp index fa3f3f3d6e6b8..5fde031bb0dd7 100644 --- a/src/mame/ti/geneve.cpp +++ b/src/mame/ti/geneve.cpp @@ -210,6 +210,7 @@ namespace { #define GENEVE_SRAM_TAG "sram" #define GENEVE_SRAMX_TAG "sramexp" +#define GENEVE_SRAMU_TAG "sramult" #define GENEVE_DRAM_TAG "dram" #define GENEVE_CLOCK_TAG "mm58274c" #define GENEVE_SOUNDCHIP_TAG "soundchip" @@ -226,6 +227,13 @@ enum FULLGNM = 255 // AME,AMD,FULLGEN }; +enum +{ + SRAM32 = 0, + SRAM64 = 1, + SRAM384 = 2 +}; + void geneve_xt_keyboards(device_slot_interface &device) { device.option_add(STR_KBD_KEYTRONIC_PC3270, PC_KBD_KEYTRONIC_PC3270); @@ -246,6 +254,7 @@ class geneve_state : public driver_device m_dram(*this, GENEVE_DRAM_TAG), m_sram(*this, GENEVE_SRAM_TAG), m_sramx(*this, GENEVE_SRAMX_TAG), + m_sramu(*this, GENEVE_SRAMU_TAG), m_gatearray(*this, GENEVE_GATE_ARRAY_TAG), m_genmod_decoder(*this, GENMOD_DECODER_TAG), m_pal(*this, GENEVE_PAL_TAG), @@ -258,7 +267,7 @@ class geneve_state : public driver_device m_left_button(0), m_pfm_prefix(0), m_pfm_oe(true), - m_sram_exp(true), + m_sram_size(SRAM64), m_genmod(false) { } @@ -305,6 +314,7 @@ class geneve_state : public driver_device required_device m_dram; required_device m_sram; required_device m_sramx; + required_device m_sramu; required_device m_gatearray; optional_device m_genmod_decoder; @@ -362,7 +372,7 @@ class geneve_state : public driver_device // Settings int m_boot_rom = 0; // Kind of boot ROM (EPROM or PFM512 or PFM512A) - bool m_sram_exp; + int m_sram_size = SRAM64; // Genmod modifications bool m_genmod; @@ -415,9 +425,10 @@ static INPUT_PORTS_START(geneve) PORT_INCLUDE(geneve_common) PORT_START( "SRAM" ) - PORT_CONFNAME( 0x03, 0x01, "SRAM expansion 32K" ) - PORT_CONFSETTING( 0x00, "off" ) - PORT_CONFSETTING( 0x01, "on" ) + PORT_CONFNAME( 0x03, 0x01, "SRAM size" ) + PORT_CONFSETTING( SRAM32, "32 KiB" ) + PORT_CONFSETTING( SRAM64, "64 KiB" ) + PORT_CONFSETTING( SRAM384, "384 KiB" ) INPUT_PORTS_END @@ -596,19 +607,29 @@ uint8_t geneve_state::memread(offs_t offset) } // Expanded SRAM 32K (not in Genmod) - if (!m_genmod) + if (!m_genmod && m_gatearray->ramenx_out()==ASSERT_LINE) { - if (m_gatearray->ramenx_out()==ASSERT_LINE) + if (m_sram_size != SRAM32) { - if (m_sram_exp) - { - sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; - value = m_sramx->pointer()[sramadd]; - LOGMASKED(LOG_READ, "SRAMX %02x:%04x -> %02x\n", page, addr13, value); - } - else - LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + value = m_sramx->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAMX %02x:%04x -> %02x\n", page, addr13, value); } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + } + + // Ultimate SRAM expansion (not in Genmod) + if (!m_genmod && m_gatearray->ramenu_out()==ASSERT_LINE) + { + if (m_sram_size == SRAM384) + { + sramadd = m_gatearray->get_prefix(FULLGEN) | addr13; + value = m_sramu->pointer()[sramadd]; + LOGMASKED(LOG_READ, "SRAMU %02x:%04x -> %02x\n", page, addr13, value); + } + else + LOGMASKED(LOG_WARN, "Access to SRAMU page %02x, but no 384K SRAM expansion available\n", page); } // Peripheral box @@ -703,20 +724,30 @@ void geneve_state::memwrite(offs_t offset, uint8_t data) m_sram->pointer()[sramadd] = data; } - // Expanded SRAM - if (!m_genmod) + // Expanded SRAM (not in Genmod) + if (!m_genmod && m_gatearray->ramenx_out()==ASSERT_LINE) { - if (m_gatearray->ramenx_out()==ASSERT_LINE) + if (m_sram_size != SRAM32) { - if (m_sram_exp) - { - sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; - LOGMASKED(LOG_WRITE, "SRAMX %02x:%04x <- %02x\n", page, addr13, data); - m_sramx->pointer()[sramadd] = data; - } - else - LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + sramadd = m_gatearray->get_prefix(AB1 | AB2) | addr13; + LOGMASKED(LOG_WRITE, "SRAMX %02x:%04x <- %02x\n", page, addr13, data); + m_sramx->pointer()[sramadd] = data; } + else + LOGMASKED(LOG_WARN, "Access to SRAMX page %02x, but no SRAM expansion available\n", page); + } + + // Ultimate SRAM expansion (not in Genmod) + if (!m_genmod && m_gatearray->ramenu_out()==ASSERT_LINE) + { + if (m_sram_size == SRAM384) + { + sramadd = m_gatearray->get_prefix(FULLGEN) | addr13; + LOGMASKED(LOG_READ, "SRAMU %02x:%04x -> %02x\n", page, addr13, data); + m_sramu->pointer()[sramadd] = data; + } + else + LOGMASKED(LOG_WARN, "Access to SRAMU page %02x, but no 384K SRAM expansion available\n", page); } // Peripheral box @@ -1120,16 +1151,14 @@ void geneve_state::machine_reset() if (m_genmod) { - m_sram_exp = false; m_genmod_decoder->set_turbo((ioport("GENMODDIPS")->read() & GENEVE_GM_TURBO)!=0); m_genmod_decoder->set_timode((ioport("GENMODDIPS")->read() & GENEVE_GM_TIM)!=0); } else { // SRAM expansion - // Only separately handled for the standard Geneve; Genmod uses - // the Memex instead - m_sram_exp = (ioport("SRAM")->read()!=0); + // Only applies to the standard Geneve; Genmod uses the Memex instead + m_sram_size = (ioport("SRAM")->read()); } } @@ -1242,6 +1271,9 @@ void geneve_state::geneve_common(machine_config &config) // SRAM RAM(config, GENEVE_SRAM_TAG).set_default_size("32K").set_default_value(0); RAM(config, GENEVE_SRAMX_TAG).set_default_size("32K").set_default_value(0); + + // Ultimate SRAM expansion + RAM(config, GENEVE_SRAMU_TAG).set_default_size("384K").set_default_value(0); } /* From fa5c0fa3ee739d4146d1f87bba5772cfcc75b35b Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 2 Mar 2025 14:57:54 +0100 Subject: [PATCH 061/272] kinst: add debugger side effects check after prev commit --- src/mame/rare/kinst.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mame/rare/kinst.cpp b/src/mame/rare/kinst.cpp index fae98c701261d..a3d8f691bc446 100644 --- a/src/mame/rare/kinst.cpp +++ b/src/mame/rare/kinst.cpp @@ -505,7 +505,8 @@ uint32_t kinst_state::rom_r(offs_t offset) { // add RdRdy clocks on EPROM access // bootup sequence takes approx. 6 seconds, and it's not a CPU clock divider - m_maincpu->adjust_icount(-128); + if (!machine().side_effects_disabled()) + m_maincpu->adjust_icount(-128); return m_rombase[offset]; } From b812aa675237c42084c97e308e9df1b42aa2c4fc Mon Sep 17 00:00:00 2001 From: ArcadeShadow Date: Sun, 2 Mar 2025 16:11:25 +0000 Subject: [PATCH 062/272] megacd.xml: Metadata cleanups (#13436) - Added parent/clone relationship between "Blackhole Assault (Europe)" / "Black Hole Assault (Japan)" - Lowercase on descriptive words "Night Trap (USA, re-release)" - Replaced country abbreviation "Cadillacs and Dinosaurs - The Second Cataclysm (Brazil)" --- hash/megacd.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hash/megacd.xml b/hash/megacd.xml index 1fe13f5f075df..90d8941b65337 100644 --- a/hash/megacd.xml +++ b/hash/megacd.xml @@ -1736,7 +1736,7 @@ Black screen, requires sub CPU to be overclocked by 1.5x - + - Cadillacs and Dinosaurs - The Second Cataclysm (Bra) + Cadillacs and Dinosaurs - The Second Cataclysm (Brazil) 1994 Tec Toy @@ -10199,7 +10199,7 @@ Requires [disc swap] --> - Night Trap (USA, Re-Release) + Night Trap (USA, re-release) 1995 Sega --> - Silpheed Hibaihin (Japan) (fixed) + Silpheed Hibaihin (Japan, fixed) 1993 Game Arts From 4035ef4a599886c30759461dabd322f63cb38b7f Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sun, 2 Mar 2025 18:30:35 +0100 Subject: [PATCH 063/272] New systems marked not working ------------------------------ Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN) [dyq, little0, Guru] Xingyun Pao De Kuai (V106CN) [dyq, little0, Guru] --- src/mame/igs/igs_m027.cpp | 84 ++++++++++++++++++++++++++++ src/mame/igs/pgmcrypt.cpp | 48 ++++++++++++++++ src/mame/igs/pgmcrypt.h | 112 +++++++++++++++++++------------------- src/mame/mame.lst | 4 +- 4 files changed, 192 insertions(+), 56 deletions(-) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index fd60ca0cafe24..ffd350264e521 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -181,6 +181,8 @@ class igs_m027_state : public driver_device void init_tripslot() ATTR_COLD; void init_extradrw() ATTR_COLD; void init_chessc2() ATTR_COLD; + void init_tct2p() ATTR_COLD; + void init_xypdk() ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -3018,6 +3020,71 @@ ROM_START( mgcs3 ) ROM_LOAD( "sp.u5", 0x00000, 0x200000, CRC(eb27b166) SHA1(eb9641516245d9094861d6ba6e902eac62019968) ) ROM_END +/* +Tarzan Chuǎng Tiānguān 2 Jiāqiáng Bǎn +泰山闯天关 2 加强版 +IGS, 2003 + +PCB: IGS PCB-0489-07-FM-1 +IGS027 Sticker: T8 +ROM String: TARZAN_CHINA_V300CN + THU JUN 19 14:13:23 2003 + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( tct2p ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "t8_027a.bin", 0x0000, 0x4000, CRC(a5f0be90) SHA1(f2318cf324749831d8e1b766ae5646dcfdd955c6) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v-306cn.u17", 0x00000, 0x80000, CRC(c479e5ac) SHA1(4d8273f7425cdc3293c5b43219e021303c53cbad) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x00000, 0x80000, CRC(d0e20214) SHA1(90f9b2d7ab0f2c0f99277df7c9ff24ea54b65709) ) + + ROM_REGION( 0x480000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "a4202.u28", 0x000000, 0x400000, CRC(97a68f85) SHA1(177c8c23fd0d585b24a71359ede005ac9a2e4d4d) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + ROM_LOAD( "cg.u31", 0x400000, 0x080000, CRC(808b38d1) SHA1(60cc441d863d26c44c0353770367f2b2ef7c8de7) ) // FIXED BITS (xxxxxxxx0xxxxxxx) 1xxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u5", 0x000000, 0x200000, CRC(4b04e89e) SHA1(4c29381cd272daaa3a3fb627024d25609f8b5f8a) ) // BADADDR --xxxxxxxxxxxxxxxxxxx +ROM_END + +/* +Xìngyùn Pǎo de Kuài +幸运跑的快 +IGS, 2005 + +PCB: IGS PCB-0489-07-FM-1 +IGS027 Sticker: I8 +ROM String: FRI OCT 7 17:22:46 2005 + LUCKY_FASTER + +Oki Clock (from PAL): 2.000MHz [22/11] +Oki Pin 7: Low +*/ + +ROM_START( xypdk ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A type G ARM based MCU + ROM_LOAD( "i8_027a.bin", 0x0000, 0x4000, CRC(af7889a5) SHA1(cd38b79a3e47deb32be779d2d860216d37ee9916) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v-306cn.u17", 0x00000, 0x80000, CRC(f78d2a7c) SHA1(84fce4424edb2bd7ccc02f7c937686016ddce21b) ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x00000, 0x80000, CRC(b2b20a55) SHA1(1e5e883ee588805d68ad9d312f0884a428eff31c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u28", 0x000000, 0x400000, CRC(b0835036) SHA1(bae50688ea20572c0d71ff50066b79b6654d9b93) ) // FIXED BITS (xxxxxxx0xxxxxxxx) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u5", 0x000000, 0x200000, CRC(e5ba3abe) SHA1(e5d191bcfd8180dde4576523cee3f502b03013c2) ) +ROM_END + ROM_START( extradrw ) // IGS PCB 0326-05-DV-1 ROM_REGION( 0x04000, "maincpu", 0 ) // Internal rom of IGS027A ARM based MCU @@ -3236,6 +3303,21 @@ void igs_m027_state::init_chessc2() ROM2[(0x168/4)] ^= 0x10000000; } +void igs_m027_state::init_tct2p() +{ + tct2p_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0x400000, 0x400000); + // the sprite ROM at 0x400000 doesn't require decryption +} + +void igs_m027_state::init_xypdk() +{ + xypdk_decrypt(machine()); + m_igs017_igs031->sdwx_gfx_decrypt(); + m_igs017_igs031->tarzan_decrypt_sprites(0, 0); +} + } // anonymous namespace @@ -3259,6 +3341,7 @@ GAME( 2004, lhzb4dhb, 0, lhzb4, lhzb4, igs_m027_stat GAME( 1999, lthyp, 0, lthyp, lthyp, igs_m027_state, init_lthyp, ROT0, "IGS", "Long Teng Hu Yao Duizhan Jiaqiang Ban (S104CN)", MACHINE_NODEVICE_LAN ) GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D (V102C)", 0 ) GAMEL( 2001, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) // shows V212US in bookkeeping menu +GAMEL( 2003, tct2p, 0, jking02, jking02, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", MACHINE_NOT_WORKING, layout_jking02 ) // needs inputs GAME( 2003, mgzz, 0, mgzz, mgzz101cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 ) GAME( 2003, mgzz100cn, mgzz, mgzz, mgzz100cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 ) GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 ) @@ -3272,6 +3355,7 @@ GAME( 2004, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_stat GAME( 2004, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) // 2004 date in internal ROM GAME( 2005, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) // 2005 date in internal ROM GAME( 2005, cjtljp, 0, cjtljp, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM +GAME( 2005, xypdk, 0, cjddz, cjddz, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", MACHINE_NOT_WORKING ) // needs inputs GAMEL( 2007, tripslot, 0, tripslot, tripslot, igs_m027_state, init_tripslot, ROT0, "IGS", "Triple Slot (V200VE)", 0, layout_tripslot ) // 2007 date in internal ROM at least, could be later, default settings password is all 'start 1' // this has a 2nd 8255 GAME( 2001, extradrw, 0, extradrw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw (V100VE)", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/pgmcrypt.cpp b/src/mame/igs/pgmcrypt.cpp index 5d2d870f26529..055248cef5178 100644 --- a/src/mame/igs/pgmcrypt.cpp +++ b/src/mame/igs/pgmcrypt.cpp @@ -1572,6 +1572,54 @@ void jking02_decrypt(running_machine &machine) } } +// JUN 19 14:13:22 2003 TARZAN_CHINA_V300CN +void tct2p_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1 + IGS27_CRYPT2 + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5_ALT + IGS27_CRYPT6 + IGS27_CRYPT7 + IGS27_CRYPT8 + + src[i] ^= x; + } +} + +// FRI OCT 07 17:22:46 2005 LUCKY_FASTER +void xypdk_decrypt(running_machine &machine) +{ + memory_region *const region = machine.root_device().memregion("user1"); + auto const src = util::little_endian_cast(reinterpret_cast(region->base())); + auto const rom_size = region->bytes(); + + for (int i = 0; i < rom_size / 2; i++) + { + uint16_t x = 0; + + IGS27_CRYPT1_ALT + IGS27_CRYPT2_ALT + IGS27_CRYPT3 + IGS27_CRYPT4 + IGS27_CRYPT5_ALT + IGS27_CRYPT6_ALT + IGS27_CRYPT7_ALT + IGS27_CRYPT8 + + src[i] ^= x; + } +} + static const uint8_t luckycrs_tab[0x100] = { 0x4b, 0x99, 0xa3, 0xa6, 0x69, 0xad, 0xb2, 0x1e, 0x42, 0x9a, 0x02, 0x91, 0x04, 0x90, 0x64, 0xcf, 0x68, 0xe0, 0xa3, 0x8e, 0x1b, 0x53, 0x8d, 0xe6, 0x6f, 0xcd, 0x40, 0x09, 0x42, 0x23, 0xb7, 0x47, diff --git a/src/mame/igs/pgmcrypt.h b/src/mame/igs/pgmcrypt.h index a15f3b5ce18ad..ae070639f3272 100644 --- a/src/mame/igs/pgmcrypt.h +++ b/src/mame/igs/pgmcrypt.h @@ -7,60 +7,62 @@ #pragma once -void pgm_kov_decrypt(running_machine &machine); -void pgm_kovsh_decrypt(running_machine &machine); -void pgm_kov2_decrypt(running_machine &machine); -void pgm_kov2p_decrypt(running_machine &machine); -void pgm_mm_decrypt(running_machine &machine); -void pgm_photoy2k_decrypt(running_machine &machine); -void pgm_py2k2_decrypt(running_machine &machine); -void pgm_pstar_decrypt(running_machine &machine); -void pgm_puzzli2_decrypt(running_machine &machine); -void pgm_theglad_decrypt(running_machine &machine); -void pgm_ddp2_decrypt(running_machine &machine); -void pgm_dfront_decrypt(running_machine &machine); -void pgm_oldsplus_decrypt(running_machine &machine); -void pgm_kovshp_decrypt(running_machine &machine); -void pgm_killbldp_decrypt(running_machine &machine); -void pgm_svg_decrypt(running_machine &machine); -void pgm_svgpcb_decrypt(running_machine &machine); -void pgm_ket_decrypt(running_machine &machine); -void pgm_espgal_decrypt(running_machine &machine); -void pgm_happy6_decrypt(running_machine &machine); -void pgm_dwpc_decrypt(running_machine &machine); -void sdwx_decrypt(running_machine &machine); -void hauntedh_decrypt(running_machine &machine); -void chessc2_decrypt(running_machine &machine); -void klxyj_decrypt(running_machine &machine); -void zhongguo_decrypt(running_machine &machine); -void gonefsh2_decrypt(running_machine &machine); -void cjddz_decrypt(running_machine &machine); -void cjddzp_decrypt(running_machine &machine); -void lhzb4_decrypt(running_machine &machine); -void fearless_decrypt(running_machine &machine); -void superkds_decrypt(running_machine &machine); -void pgm_decrypt_pgm3in1(running_machine &machine); -void slqz3_decrypt(running_machine &machine); -void fruitpar_decrypt(running_machine &machine); -void oceanpar_decrypt(running_machine &machine); -void amazonia_decrypt(running_machine &machine); -void amazoni2_decrypt(running_machine &machine); -void mgzz_decrypt(running_machine &machine); -void mgcs3_decrypt(running_machine &machine); -void crzybugs_decrypt(running_machine &machine); -void crzybugsj_decrypt(running_machine &machine); -void qlgs_decrypt(running_machine &machine); -void jking02_decrypt(running_machine &machine); -void luckycrs_decrypt(running_machine &machine); -void olympic5_decrypt(running_machine &machine); -void icescape_decrypt(running_machine &machine); -void tripfev_decrypt(running_machine &machine); -void wldfruit_decrypt(running_machine &machine); -void lthyp_decrypt(running_machine &machine); -void tripslot_decrypt(running_machine &machine); -void extradrw_decrypt(running_machine &machine); -void cjddzlf_decrypt(running_machine &machine); -void cjtljp_decrypt(running_machine& machine); -void mxsqy_decrypt(running_machine& machine); +void pgm_kov_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kovsh_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kov2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kov2p_decrypt(running_machine &machine) ATTR_COLD; +void pgm_mm_decrypt(running_machine &machine) ATTR_COLD; +void pgm_photoy2k_decrypt(running_machine &machine) ATTR_COLD; +void pgm_py2k2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_pstar_decrypt(running_machine &machine) ATTR_COLD; +void pgm_puzzli2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_theglad_decrypt(running_machine &machine) ATTR_COLD; +void pgm_ddp2_decrypt(running_machine &machine) ATTR_COLD; +void pgm_dfront_decrypt(running_machine &machine) ATTR_COLD; +void pgm_oldsplus_decrypt(running_machine &machine) ATTR_COLD; +void pgm_kovshp_decrypt(running_machine &machine) ATTR_COLD; +void pgm_killbldp_decrypt(running_machine &machine) ATTR_COLD; +void pgm_svg_decrypt(running_machine &machine) ATTR_COLD; +void pgm_svgpcb_decrypt(running_machine &machine) ATTR_COLD; +void pgm_ket_decrypt(running_machine &machine) ATTR_COLD; +void pgm_espgal_decrypt(running_machine &machine) ATTR_COLD; +void pgm_happy6_decrypt(running_machine &machine) ATTR_COLD; +void pgm_dwpc_decrypt(running_machine &machine) ATTR_COLD; +void sdwx_decrypt(running_machine &machine) ATTR_COLD; +void hauntedh_decrypt(running_machine &machine) ATTR_COLD; +void chessc2_decrypt(running_machine &machine) ATTR_COLD; +void klxyj_decrypt(running_machine &machine) ATTR_COLD; +void zhongguo_decrypt(running_machine &machine) ATTR_COLD; +void gonefsh2_decrypt(running_machine &machine) ATTR_COLD; +void cjddz_decrypt(running_machine &machine) ATTR_COLD; +void cjddzp_decrypt(running_machine &machine) ATTR_COLD; +void lhzb4_decrypt(running_machine &machine) ATTR_COLD; +void fearless_decrypt(running_machine &machine) ATTR_COLD; +void superkds_decrypt(running_machine &machine) ATTR_COLD; +void pgm_decrypt_pgm3in1(running_machine &machine) ATTR_COLD; +void slqz3_decrypt(running_machine &machine) ATTR_COLD; +void fruitpar_decrypt(running_machine &machine) ATTR_COLD; +void oceanpar_decrypt(running_machine &machine) ATTR_COLD; +void amazonia_decrypt(running_machine &machine) ATTR_COLD; +void amazoni2_decrypt(running_machine &machine) ATTR_COLD; +void mgzz_decrypt(running_machine &machine) ATTR_COLD; +void mgcs3_decrypt(running_machine &machine) ATTR_COLD; +void crzybugs_decrypt(running_machine &machine) ATTR_COLD; +void crzybugsj_decrypt(running_machine &machine) ATTR_COLD; +void qlgs_decrypt(running_machine &machine) ATTR_COLD; +void jking02_decrypt(running_machine &machine) ATTR_COLD; +void tct2p_decrypt(running_machine &machine) ATTR_COLD; +void xypdk_decrypt(running_machine &machine) ATTR_COLD; +void luckycrs_decrypt(running_machine &machine) ATTR_COLD; +void olympic5_decrypt(running_machine &machine) ATTR_COLD; +void icescape_decrypt(running_machine &machine) ATTR_COLD; +void tripfev_decrypt(running_machine &machine) ATTR_COLD; +void wldfruit_decrypt(running_machine &machine) ATTR_COLD; +void lthyp_decrypt(running_machine &machine) ATTR_COLD; +void tripslot_decrypt(running_machine &machine) ATTR_COLD; +void extradrw_decrypt(running_machine &machine) ATTR_COLD; +void cjddzlf_decrypt(running_machine &machine) ATTR_COLD; +void cjtljp_decrypt(running_machine& machine) ATTR_COLD; +void mxsqy_decrypt(running_machine& machine) ATTR_COLD; #endif // MAME_IGS_PGMCRYPT_H diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 5fe6f9d0d769b..0b5d2bb54d2f0 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20519,10 +20519,12 @@ oceanpar oceanpar101us olympic5 olympic5107us -tripslot qlgs sdwx slqz3 +tct2p +tripslot +xypdk zhongguo @source:igs/igs_m027_023vid.cpp From f962ece5fda580686738c15ec25be2240f330e42 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sun, 2 Mar 2025 21:36:38 +0100 Subject: [PATCH 064/272] ti99: Added I/O port Splitter device. --- scripts/src/bus.lua | 2 + src/devices/bus/ti99/internal/ioport.cpp | 10 ++ src/devices/bus/ti99/internal/ioport.h | 1 + src/devices/bus/ti99/internal/splitter.cpp | 190 +++++++++++++++++++++ src/devices/bus/ti99/internal/splitter.h | 65 +++++++ src/devices/bus/ti99/peb/peribox.cpp | 137 +++++++-------- src/devices/bus/ti99/peb/peribox.h | 13 ++ 7 files changed, 346 insertions(+), 72 deletions(-) create mode 100644 src/devices/bus/ti99/internal/splitter.cpp create mode 100644 src/devices/bus/ti99/internal/splitter.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 19bea08274076..bd9c56f471839 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4120,6 +4120,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/internal/genkbd.h", MAME_DIR .. "src/devices/bus/ti99/internal/ioport.cpp", MAME_DIR .. "src/devices/bus/ti99/internal/ioport.h", + MAME_DIR .. "src/devices/bus/ti99/internal/splitter.cpp", + MAME_DIR .. "src/devices/bus/ti99/internal/splitter.h", MAME_DIR .. "src/devices/bus/ti99/colorbus/busmouse.cpp", MAME_DIR .. "src/devices/bus/ti99/colorbus/busmouse.h", MAME_DIR .. "src/devices/bus/ti99/colorbus/colorbus.cpp", diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index 25252569e6d32..3dccc08ed0eb3 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -78,6 +78,7 @@ #include "emu.h" #include "ioport.h" +#include "splitter.h" #include "bus/ti99/peb/peribox.h" DEFINE_DEVICE_TYPE(TI99_IOPORT, bus::ti99::internal::ioport_device, "ti99_ioport", "TI-99 I/O Port") @@ -174,9 +175,18 @@ void ioport_attached_device::set_ready(int state) void ti99_ioport_options_plain(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX); + device.option_add("splitter", TI99_IOSPLIT); } void ti99_ioport_options_evpc(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX_EV); + device.option_add("splitter", TI99_IOSPLIT); +} + +// Used for the splitter (to avoid getting multiple EVPCs in the system) +void ti99_ioport_options_evpc1(device_slot_interface &device) +{ + device.option_add("peb", TI99_PERIBOX_EV1); + device.option_add("splitter", TI99_IOSPLIT); } diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h index 39dcd95549236..867ff6dccf4a5 100644 --- a/src/devices/bus/ti99/internal/ioport.h +++ b/src/devices/bus/ti99/internal/ioport.h @@ -103,5 +103,6 @@ DECLARE_DEVICE_TYPE_NS(TI99_IOPORT, bus::ti99::internal, ioport_device) void ti99_ioport_options_plain(device_slot_interface &device); void ti99_ioport_options_evpc(device_slot_interface &device); +void ti99_ioport_options_evpc1(device_slot_interface &device); #endif /* __TI99IOPORT__ */ diff --git a/src/devices/bus/ti99/internal/splitter.cpp b/src/devices/bus/ti99/internal/splitter.cpp new file mode 100644 index 0000000000000..b839d9793e3b5 --- /dev/null +++ b/src/devices/bus/ti99/internal/splitter.cpp @@ -0,0 +1,190 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + I/O port splitter + + The I/O port splitter connects to the TI-99/4(A) console at its I/O port + and provides two I/O ports. That way, two Peripheral Expansion boxes or + one PEB and a sidecar chain may be connected. + + | Port 2 + v + +---+ + +----------------+ | | + | TI-99/4(A) |---+ +--+ + +------------+---+ Splitter | <-- Port 1 + | oooooooooo | |----------+ + | oooooooooo | | + +----------------- + + The splitter was designed 2015 by Jim Fetzner (as Tekumel Software) + + March 2025, Michael Zapf + +*****************************************************************************/ + +#include "emu.h" +#include "ioport.h" +#include "splitter.h" +#include "bus/ti99/peb/peribox.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) // Configuration +#define LOG_INT (1U << 3) +#define LOG_READY (1U << 4) + +#define VERBOSE (LOG_CONFIG | LOG_WARN) + +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_IOSPLIT, bus::ti99::internal::ioport_splitter_device, "ti99_iosplit", "TI-99 I/O Port Splitter") + +namespace bus::ti99::internal { + +#define PORT1 "port1" +#define PORT2 "port2" + +ioport_splitter_device::ioport_splitter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : ioport_attached_device(mconfig, type, tag, owner, clock), + m_port1(*this, PORT1), + m_port2(*this, PORT2) +{ +} + +ioport_splitter_device::ioport_splitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : ioport_splitter_device(mconfig, TI99_IOSPLIT, tag, owner, clock) +{ +} + +void ioport_splitter_device::readz(offs_t offset, uint8_t *value) +{ + // With a proper configuration, only one device on one of the branches + // will respond. + if (m_port1 != nullptr) + m_port1->readz(offset, value); + + if (m_port2 != nullptr) + m_port2->readz(offset, value); +} + +void ioport_splitter_device::write(offs_t offset, uint8_t data) +{ + if (m_port1 != nullptr) + m_port1->write(offset, data); + + if (m_port2 != nullptr) + m_port2->write(offset, data); +} + +void ioport_splitter_device::setaddress_dbin(offs_t offset, int state) +{ + if (m_port1 != nullptr) + m_port1->setaddress_dbin(offset, state); + + if (m_port2 != nullptr) + m_port2->setaddress_dbin(offset, state); +} + +void ioport_splitter_device::crureadz(offs_t offset, uint8_t *value) +{ + if (m_port1 != nullptr) + m_port1->crureadz(offset, value); + + if (m_port2 != nullptr) + m_port2->crureadz(offset, value); +} + +void ioport_splitter_device::cruwrite(offs_t offset, uint8_t data) +{ + if (m_port1 != nullptr) + m_port1->cruwrite(offset, data); + + if (m_port2 != nullptr) + m_port2->cruwrite(offset, data); +} + +void ioport_splitter_device::memen_in(int state) +{ + if (m_port1 != nullptr) + m_port1->memen_in(state); + + if (m_port2 != nullptr) + m_port2->memen_in(state); +} + +void ioport_splitter_device::msast_in(int state) +{ + if (m_port1 != nullptr) + m_port1->msast_in(state); + + if (m_port2 != nullptr) + m_port2->msast_in(state); +} + +void ioport_splitter_device::clock_in(int state) +{ + if (m_port1 != nullptr) + m_port1->clock_in(state); + + if (m_port2 != nullptr) + m_port2->clock_in(state); +} + +void ioport_splitter_device::reset_in(int state) +{ + if (m_port1 != nullptr) + m_port1->reset_in(state); + + if (m_port2 != nullptr) + m_port2->reset_in(state); +} + +template +void ioport_splitter_device::extint(int state) +{ + LOGMASKED(LOG_INT, "propagating INTA from port %d to console: %d\n", port, state); + if (state==ASSERT_LINE) + m_inta_flag |= port; // 1 or 2 + else + m_inta_flag &= ~port; // 1 or 2 + + set_extint((m_inta_flag != 0)? ASSERT_LINE : CLEAR_LINE); +} + +template +void ioport_splitter_device::ready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from port %d\n", state, port); + // We store the inverse state + if (state==CLEAR_LINE) + m_ready_flag |= port; // 1 or 2 + else + m_ready_flag &= ~port; // 1 or 2 + + set_ready((m_ready_flag != 0)? CLEAR_LINE : ASSERT_LINE); +} + +void ioport_splitter_device::device_start() +{ + LOG("Starting I/O Port Splitter\n"); +} + + +void ioport_splitter_device::device_config_complete() +{ + m_inta_flag = 0; + m_ready_flag = 0; +} + +void ioport_splitter_device::device_add_mconfig(machine_config &config) +{ + TI99_IOPORT(config, m_port1, 1, ti99_ioport_options_evpc1, nullptr); + TI99_IOPORT(config, m_port2, 2, ti99_ioport_options_evpc1, nullptr); + + m_port1->extint_cb().set(FUNC(ioport_splitter_device::extint<1>)); + m_port2->extint_cb().set(FUNC(ioport_splitter_device::extint<2>)); + m_port1->ready_cb().set(FUNC(ioport_splitter_device::ready<1>)); + m_port2->ready_cb().set(FUNC(ioport_splitter_device::ready<2>)); +} + +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/splitter.h b/src/devices/bus/ti99/internal/splitter.h new file mode 100644 index 0000000000000..350b4f2666d7d --- /dev/null +++ b/src/devices/bus/ti99/internal/splitter.h @@ -0,0 +1,65 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + I/O port splitter + + This plugs into the I/O port of the console as an + ioport_attached_device, and it offers two new I/O ports. + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_INTERNAL_SPLITTER_H +#define MAME_BUS_TI99_INTERNAL_SPLITTER_H + +#pragma once + +#include "ioport.h" + +namespace bus::ti99::internal { + +class ioport_splitter_device : public ioport_attached_device +{ + +public: + ioport_splitter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + // Next methods are called from the console + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + + void crureadz(offs_t offset, uint8_t *value) override; + void cruwrite(offs_t offset, uint8_t data) override; + + void memen_in(int state) override; + void msast_in(int state) override; + + void clock_in(int state) override; + void reset_in(int state) override; + +protected: + ioport_splitter_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override ATTR_COLD; + virtual void device_config_complete() override; + + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // Callbacks from the two ports + template void extint(int state); + template void ready(int state); + + int m_inta_flag; + int m_ready_flag; + +private: + required_device m_port1; + required_device m_port2; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_IOSPLIT, bus::ti99::internal, ioport_splitter_device) + +#endif /* __TI99SPLITTER__ */ diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index 4df80e153d528..d89293c3b6d50 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -216,7 +216,10 @@ CRUCLK* 51||52 DBIN DEFINE_DEVICE_TYPE(TI99_PERIBOX, bus::ti99::peb::peribox_device, "peribox", "Peripheral expansion box") // Peripheral box which has a EVPC card in slot 2 (for use with the ti99_4ev) -DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV, bus::ti99::peb::peribox_ev_device, "peribox_ev", "Peripheral expansion box with EVPC") +DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV, bus::ti99::peb::peribox_ev_device, "peribox_ev", "Peripheral expansion box with EVPC inserted") + +// Peripheral box with EVPC (for use with the ti99_4ev with the port splitter) +DEFINE_DEVICE_TYPE(TI99_PERIBOX_EV1, bus::ti99::peb::peribox_ev1_device, "peribox_ev1", "Peripheral expansion box with EVPC") // Peripheral box which hosts the SGCPU card in slot 1 DEFINE_DEVICE_TYPE(TI99_PERIBOX_SG, bus::ti99::peb::peribox_sg_device, "peribox_sg", "Peripheral expansion box SGCPU") @@ -476,31 +479,54 @@ void peribox_device::device_config_complete() m_ready_flag = 0; } -void ti99_peribox_slot_standard(device_slot_interface &device) +// Slot options that work with TI-99/4A (with and without EVPC), SGCPU, Geneve, +// and TI-99/8 (untested) +void peribox_common_slots(device_slot_interface &device) { - device.option_add("32kmem", TI99_32KMEM); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); device.option_add("tirs232", TI99_RS232); device.option_add("speech", TI99_SPEECH); device.option_add("horizon", TI99_HORIZON); - device.option_add("pgram", TI99_PGRAM); device.option_add("ide", TI99_IDE); device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); device.option_add("hfdc", TI99_HFDC); device.option_add("tifdc", TI99_FDC); device.option_add("ccdcc", TI99_CCDCC); device.option_add("ccfdc", TI99_CCFDC); device.option_add("ddcc1", TI99_DDCC1); device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); device.option_add("whtscsi", TI99_WHTSCSI); device.option_add("tipi", TI99_TIPI); } +// Slot options for TI-99/4A with or without EVPC and SGCPU +// The BwG controller will not run with the Geneve due to its wait state +// logic (see bwg.cpp) +// The SID master card may have trouble with the Geneve because of its CRU +// handling (see sidmaster.cpp) +void peribox_ti99_slots(device_slot_interface &device) +{ + device.option_add("myarcmem", TI99_MYARCMEM); + device.option_add("samsmem", TI99_SAMSMEM); + device.option_add("pcode", TI99_P_CODE); + device.option_add("hsgpl", TI99_HSGPL); + device.option_add("bwg", TI99_BWG); + device.option_add("sidmaster", TI99_SIDMASTER); + peribox_common_slots(device); +} + +// Geneve and SGCPU do not work with these memory expansions +void peribox_std_slots(device_slot_interface &device) +{ + device.option_add("32kmem", TI99_32KMEM); + device.option_add("pgram", TI99_PGRAM); + peribox_ti99_slots(device); +} + +void ti99_peribox_slot_standard(device_slot_interface &device) +{ + peribox_std_slots(device); +} + void peribox_device::device_add_mconfig(machine_config &config) { TI99_PERIBOX_SLOT(config, m_slot2, 2, ti99_peribox_slot_standard, nullptr); @@ -524,28 +550,8 @@ peribox_ev_device::peribox_ev_device(const machine_config &mconfig, const char * void ti99_peribox_slot_evpc(device_slot_interface &device) { - device.option_add("evpc", TI99_EVPC); - device.option_add("32kmem", TI99_32KMEM); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("pgram", TI99_PGRAM); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("evpc", TI99_EVPC); + peribox_std_slots(device); } void peribox_ev_device::device_add_mconfig(machine_config &config) @@ -559,6 +565,28 @@ void peribox_ev_device::device_add_mconfig(machine_config &config) TI99_PERIBOX_SLOT(config, m_slot8, 8, ti99_peribox_slot_evpc, nullptr); } +/**************************************************************************** + A variant of the box used for the TI-99/4A with EVPC, not inserted +*****************************************************************************/ + +peribox_ev1_device::peribox_ev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : peribox_device(mconfig, TI99_PERIBOX_EV1, tag, owner, clock) +{ + m_address_prefix = 0x70000; +} + +void peribox_ev1_device::device_add_mconfig(machine_config &config) +{ + TI99_PERIBOX_SLOT(config, m_slot2, 2, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot3, 3, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot4, 4, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot5, 5, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot6, 6, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot7, 7, ti99_peribox_slot_evpc, nullptr); + TI99_PERIBOX_SLOT(config, m_slot8, 8, ti99_peribox_slot_evpc, nullptr); +} + + /**************************************************************************** A variant of the box used for the Geneve. *****************************************************************************/ @@ -582,28 +610,11 @@ peribox_genmod_device::peribox_genmod_device(const machine_config &mconfig, cons { } -// The BwG controller will not run with the Geneve due to its wait state -// logic (see bwg.cpp) -// The SID master card may have trouble with the Geneve because of its CRU -// handling (see sidmaster.cpp) - +// All common slot options plus Memex. void ti99_peribox_slot_geneve(device_slot_interface &device) { - device.option_add("memex", TI99_MEMEX); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("memex", TI99_MEMEX); + peribox_common_slots(device); } void peribox_gen_device::device_add_mconfig(machine_config &config) @@ -642,26 +653,8 @@ peribox_sg_device::peribox_sg_device(const machine_config &mconfig, const char * void ti99_peribox_slot_sgcpu(device_slot_interface &device) { - device.option_add("evpc", TI99_EVPC); - device.option_add("myarcmem", TI99_MYARCMEM); - device.option_add("samsmem", TI99_SAMSMEM); - device.option_add("pcode", TI99_P_CODE); - device.option_add("hsgpl", TI99_HSGPL); - device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); - device.option_add("horizon", TI99_HORIZON); - device.option_add("ide", TI99_IDE); - device.option_add("usbsm", TI99_USBSM); - device.option_add("bwg", TI99_BWG); - device.option_add("hfdc", TI99_HFDC); - device.option_add("tifdc", TI99_FDC); - device.option_add("ccdcc", TI99_CCDCC); - device.option_add("ccfdc", TI99_CCFDC); - device.option_add("ddcc1", TI99_DDCC1); - device.option_add("forti", TI99_FORTI); - device.option_add("sidmaster", TI99_SIDMASTER); - device.option_add("whtscsi", TI99_WHTSCSI); - device.option_add("tipi", TI99_TIPI); + device.option_add("evpc", TI99_EVPC); + peribox_ti99_slots(device); } void peribox_sg_device::device_add_mconfig(machine_config &config) diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h index ef33b9e59453e..7d9c0b6f9e91e 100644 --- a/src/devices/bus/ti99/peb/peribox.h +++ b/src/devices/bus/ti99/peb/peribox.h @@ -140,6 +140,18 @@ class peribox_ev_device : public peribox_device virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; }; +/* + Variation for ti99_4ev without EVPC inserted +*/ +class peribox_ev1_device : public peribox_device +{ +public: + peribox_ev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; +}; + /* Variation for Geneve. @@ -266,6 +278,7 @@ class peribox_slot_device : public device_t, public device_single_card_slot_inte DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX, bus::ti99::peb, peribox_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_EV, bus::ti99::peb, peribox_ev_device) +DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_EV1, bus::ti99::peb, peribox_ev1_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_SLOT, bus::ti99::peb, peribox_slot_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_SG, bus::ti99::peb, peribox_sg_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_GEN, bus::ti99::peb, peribox_gen_device) From acf0aeaa4bb4c149faee749043d575875feb53a2 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Sun, 2 Mar 2025 22:28:51 +0100 Subject: [PATCH 065/272] ti99: Add sidecar cartridge Arcturus. --- scripts/src/bus.lua | 2 + src/devices/bus/ti99/internal/ioport.cpp | 4 + src/devices/bus/ti99/internal/splitter.cpp | 16 ++-- src/devices/bus/ti99/internal/splitter.h | 14 ++-- src/devices/bus/ti99/sidecar/arcturus.cpp | 93 ++++++++++++++++++++++ src/devices/bus/ti99/sidecar/arcturus.h | 49 ++++++++++++ 6 files changed, 163 insertions(+), 15 deletions(-) create mode 100644 src/devices/bus/ti99/sidecar/arcturus.cpp create mode 100644 src/devices/bus/ti99/sidecar/arcturus.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index bd9c56f471839..e70daaaef9a13 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4188,6 +4188,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/tn_ide.h", MAME_DIR .. "src/devices/bus/ti99/peb/tn_usbsm.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/tn_usbsm.h", + MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.cpp", + MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.h", } end diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index 3dccc08ed0eb3..5ca4f680e0a28 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -80,6 +80,7 @@ #include "ioport.h" #include "splitter.h" #include "bus/ti99/peb/peribox.h" +#include "bus/ti99/sidecar/arcturus.h" DEFINE_DEVICE_TYPE(TI99_IOPORT, bus::ti99::internal::ioport_device, "ti99_ioport", "TI-99 I/O Port") @@ -176,12 +177,14 @@ void ti99_ioport_options_plain(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX); device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); } void ti99_ioport_options_evpc(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX_EV); device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); } // Used for the splitter (to avoid getting multiple EVPCs in the system) @@ -189,4 +192,5 @@ void ti99_ioport_options_evpc1(device_slot_interface &device) { device.option_add("peb", TI99_PERIBOX_EV1); device.option_add("splitter", TI99_IOSPLIT); + device.option_add("arcturus", TI99_ARCTURUS); } diff --git a/src/devices/bus/ti99/internal/splitter.cpp b/src/devices/bus/ti99/internal/splitter.cpp index b839d9793e3b5..404bd04d0c6b5 100644 --- a/src/devices/bus/ti99/internal/splitter.cpp +++ b/src/devices/bus/ti99/internal/splitter.cpp @@ -6,7 +6,7 @@ The I/O port splitter connects to the TI-99/4(A) console at its I/O port and provides two I/O ports. That way, two Peripheral Expansion boxes or one PEB and a sidecar chain may be connected. - + | Port 2 v +---+ @@ -16,9 +16,9 @@ | oooooooooo | |----------+ | oooooooooo | | +----------------- - + The splitter was designed 2015 by Jim Fetzner (as Tekumel Software) - + March 2025, Michael Zapf *****************************************************************************/ @@ -33,7 +33,7 @@ #define LOG_INT (1U << 3) #define LOG_READY (1U << 4) -#define VERBOSE (LOG_CONFIG | LOG_WARN) +// #define VERBOSE (LOG_CONFIG | LOG_WARN) #include "logmacro.h" @@ -139,7 +139,7 @@ void ioport_splitter_device::reset_in(int state) m_port2->reset_in(state); } -template +template void ioport_splitter_device::extint(int state) { LOGMASKED(LOG_INT, "propagating INTA from port %d to console: %d\n", port, state); @@ -147,11 +147,11 @@ void ioport_splitter_device::extint(int state) m_inta_flag |= port; // 1 or 2 else m_inta_flag &= ~port; // 1 or 2 - + set_extint((m_inta_flag != 0)? ASSERT_LINE : CLEAR_LINE); } -template +template void ioport_splitter_device::ready(int state) { LOGMASKED(LOG_READY, "Incoming READY=%d from port %d\n", state, port); @@ -180,7 +180,7 @@ void ioport_splitter_device::device_add_mconfig(machine_config &config) { TI99_IOPORT(config, m_port1, 1, ti99_ioport_options_evpc1, nullptr); TI99_IOPORT(config, m_port2, 2, ti99_ioport_options_evpc1, nullptr); - + m_port1->extint_cb().set(FUNC(ioport_splitter_device::extint<1>)); m_port2->extint_cb().set(FUNC(ioport_splitter_device::extint<2>)); m_port1->ready_cb().set(FUNC(ioport_splitter_device::ready<1>)); diff --git a/src/devices/bus/ti99/internal/splitter.h b/src/devices/bus/ti99/internal/splitter.h index 350b4f2666d7d..c12fac3648fe2 100644 --- a/src/devices/bus/ti99/internal/splitter.h +++ b/src/devices/bus/ti99/internal/splitter.h @@ -1,9 +1,9 @@ // license:LGPL-2.1+ // copyright-holders:Michael Zapf /**************************************************************************** - - I/O port splitter - + + I/O port splitter + This plugs into the I/O port of the console as an ioport_attached_device, and it offers two new I/O ports. @@ -14,7 +14,7 @@ #pragma once -#include "ioport.h" +#include "ioport.h" namespace bus::ti99::internal { @@ -49,10 +49,10 @@ class ioport_splitter_device : public ioport_attached_device // Callbacks from the two ports template void extint(int state); template void ready(int state); - + int m_inta_flag; int m_ready_flag; - + private: required_device m_port1; required_device m_port2; @@ -62,4 +62,4 @@ class ioport_splitter_device : public ioport_attached_device DECLARE_DEVICE_TYPE_NS(TI99_IOSPLIT, bus::ti99::internal, ioport_splitter_device) -#endif /* __TI99SPLITTER__ */ +#endif /* MAME_BUS_TI99_INTERNAL_SPLITTER_H */ diff --git a/src/devices/bus/ti99/sidecar/arcturus.cpp b/src/devices/bus/ti99/sidecar/arcturus.cpp new file mode 100644 index 0000000000000..1afe6f3591e04 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/arcturus.cpp @@ -0,0 +1,93 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Arcturus sidecar cartridge + Michael Zapf + +*****************************************************************************/ + +#include "emu.h" +#include "arcturus.h" + +#define LOG_WARN (1U << 1) // Warnings + +// #define VERBOSE (LOG_GENERAL | LOG_WARN) + +#include "logmacro.h" + +#define TI99_CARTSC_4000 "mem4000" +#define TI99_CARTSC_A000 "mema000" +#define TI99_CARTSC_C000 "memc000" +#define TI99_CARTSC_RAM "ram" + +DEFINE_DEVICE_TYPE(TI99_ARCTURUS, bus::ti99::sidecar::arcturus_device, "arcturus", "Arcturus sidecar cartridge") + +namespace bus::ti99::sidecar { + +/* + Constructor called from subclasses. +*/ +arcturus_device::arcturus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bus::ti99::internal::ioport_attached_device(mconfig, TI99_ARCTURUS, tag, owner, clock), + m_ram(*this, TI99_CARTSC_RAM) +{ +} + +void arcturus_device::readz(offs_t offset, uint8_t *value) +{ + switch ((offset >> 13)&0x07) + { + case 0: + case 3: + case 4: + case 7: + break; + case 1: + *value = m_ram->pointer()[offset & 0x07ff]; + break; + case 2: + *value = m_rom4[offset & 0x1fff]; + break; + case 5: + *value = m_roma[offset & 0x1fff]; + break; + case 6: + *value = m_romc[offset & 0x1fff]; + break; + } +} + +void arcturus_device::write(offs_t offset, uint8_t data) +{ + if (((offset >> 13)&0x07)==1) + m_ram->pointer()[offset & 0x07ff] = data; +} + +void arcturus_device::device_start() +{ + m_rom4 = memregion(TI99_CARTSC_4000)->base(); + m_roma = memregion(TI99_CARTSC_A000)->base(); + m_romc = memregion(TI99_CARTSC_C000)->base(); +} + +ROM_START( ti99_arcturus ) + ROM_REGION(0x2000, TI99_CARTSC_4000, 0) + ROM_LOAD("arcturus.u1", 0x0000, 0x2000, CRC(28ba65ec) SHA1(63329930c71ef776e8598a8d4c580c41bd52a339)) + ROM_REGION(0x2000, TI99_CARTSC_A000, 0) + ROM_LOAD("arcturus.u2", 0x0000, 0x2000, CRC(91e6910a) SHA1(51c1f75d4e9d74af21c0b43188fc0ffc4a3ad4c0)) + ROM_REGION(0x2000, TI99_CARTSC_C000, 0) + ROM_LOAD("arcturus.u3", 0x0000, 0x2000, CRC(e9ce9f4e) SHA1(65850c57e9480a5d8bdd852692f18d0162ca1406)) +ROM_END + +void arcturus_device::device_add_mconfig(machine_config& config) +{ + RAM(config, TI99_CARTSC_RAM).set_default_size("2K").set_default_value(0); +} + +const tiny_rom_entry *arcturus_device::device_rom_region() const +{ + return ROM_NAME( ti99_arcturus ); +} + +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/sidecar/arcturus.h b/src/devices/bus/ti99/sidecar/arcturus.h new file mode 100644 index 0000000000000..45737f3513c86 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/arcturus.h @@ -0,0 +1,49 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Arcturus sidecar cartridge + Michael Zapf + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_SIDECAR_ARCTURUS_H +#define MAME_BUS_TI99_SIDECAR_ARCTURUS_H + +#pragma once + +#include "bus/ti99/internal/ioport.h" +#include "machine/ram.h" + +namespace bus::ti99::sidecar { + +/***************************************************************************** + Arcturus sidecar cartridge +******************************************************************************/ + +class arcturus_device : public bus::ti99::internal::ioport_attached_device +{ +public: + arcturus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + virtual void readz(offs_t offset, uint8_t *value) override; + virtual void write(offs_t offset, uint8_t data) override; + +protected: + virtual void device_start() override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + +private: + // ROMs + uint8_t* m_rom4; + uint8_t* m_roma; + uint8_t* m_romc; + + required_device m_ram; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_ARCTURUS, bus::ti99::sidecar, arcturus_device) + +#endif // MAME_BUS_TI99_SIDECAR_ARCTURUS_H From 7e62c257243f2fd1b1d29570271e51d6336ebfb9 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 2 Mar 2025 22:32:09 -0500 Subject: [PATCH 066/272] fsblk.cpp: Internal overhaul - Replace custom reference counting wrapper with std::shared_ptr - Rename fsblk_t::block_t::copy to write and use it in a few more places - Add fsblk_t::block_t::read - Rename fsblk_t::block_t::offset and rooffset due to name collisions and privatize these helper functions - Rename fsblk_t::fill to fill_all for clarity's sake --- src/lib/formats/fs_cbmdos.cpp | 88 +++++++-------- src/lib/formats/fs_coco_os9.cpp | 156 +++++++++++++-------------- src/lib/formats/fs_coco_rsdos.cpp | 53 +++++---- src/lib/formats/fs_fat.cpp | 82 +++++++------- src/lib/formats/fs_hp98x5.cpp | 24 ++--- src/lib/formats/fs_hplif.cpp | 40 +++---- src/lib/formats/fs_isis.cpp | 16 +-- src/lib/formats/fs_oric_jasmin.cpp | 140 ++++++++++++------------ src/lib/formats/fs_prodos.cpp | 136 +++++++++++------------ src/lib/formats/fs_vtech.cpp | 74 ++++++------- src/lib/formats/fsblk.cpp | 92 ++++++---------- src/lib/formats/fsblk.h | 168 ++++++----------------------- src/lib/formats/fsblk_vec.cpp | 12 +-- src/lib/formats/fsblk_vec.h | 11 +- 14 files changed, 474 insertions(+), 618 deletions(-) diff --git a/src/lib/formats/fs_cbmdos.cpp b/src/lib/formats/fs_cbmdos.cpp index 7a567b19f95db..44c810a04a615 100644 --- a/src/lib/formats/fs_cbmdos.cpp +++ b/src/lib/formats/fs_cbmdos.cpp @@ -73,7 +73,7 @@ class impl : public filesystem_t { private: const impl & m_fs; - fsblk_t::block_t m_block; + fsblk_t::block_t::ptr m_block; std::set> m_visited_set; u8 m_track; u8 m_sector; @@ -124,7 +124,7 @@ class impl : public filesystem_t { static const u8 s_data_track_order[MAX_TRACKS - 1]; u8 m_max_track; - fsblk_t::block_t read_sector(int track, int sector) const; + fsblk_t::block_t::ptr read_sector(int track, int sector) const; std::optional dirent_from_path(const std::vector &path) const; void iterate_directory_entries(const std::function &callback) const; void iterate_all_directory_entries(const std::function &callback) const; @@ -305,7 +305,7 @@ impl::impl(fsblk_t &blockdev) meta_data impl::volume_metadata() { auto bam_block = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - std::string_view disk_name = std::string_view((const char *) bam_block.rodata() + 0x90, 16); + std::string_view disk_name = bam_block->rstr(0x90, 16); meta_data results; results.set(meta_name::name, strtrimright_cbm(disk_name)); @@ -397,7 +397,7 @@ std::error_condition impl::file_create(const std::vector &path, con return err; auto new_block = read_sector(DIRECTORY_TRACK, new_sector); for (int i = 2; i < BLOCK_SIZE; i++) - new_block.w8(i, 0); + new_block->w8(i, 0); // Find last directory sector u8 last_sector = 0; block_iterator iter(*this, DIRECTORY_TRACK, FIRST_DIRECTORY_SECTOR); @@ -405,8 +405,8 @@ std::error_condition impl::file_create(const std::vector &path, con last_sector = iter.sector(); // Update chain on last directory sector auto last_dir_block = read_sector(DIRECTORY_TRACK, last_sector); - last_dir_block.w8(OFFSET_CHAIN_TRACK, DIRECTORY_TRACK); - last_dir_block.w8(OFFSET_CHAIN_SECTOR, new_sector); + last_dir_block->w8(OFFSET_CHAIN_TRACK, DIRECTORY_TRACK); + last_dir_block->w8(OFFSET_CHAIN_SECTOR, new_sector); track = DIRECTORY_TRACK; sector = new_sector; } @@ -419,11 +419,11 @@ std::error_condition impl::file_create(const std::vector &path, con auto dirblk = read_sector(track, sector); u32 offset = file_index * DIRECTORY_ENTRY_SIZE; for (int i = 0; i < DIRECTORY_ENTRY_SIZE; i++) - dirblk.w8(offset + i, (i >= 5 && i < 5 + 16) ? 0xa0 : 0x00); - dirblk.w8(offset + OFFSET_FILE_TYPE, FILE_TYPE_PRG); - dirblk.w8(offset + OFFSET_FILE_FIRST_TRACK, file_track); - dirblk.w8(offset + OFFSET_FILE_FIRST_SECTOR, file_sector); - dirblk.wstr(offset + OFFSET_FILE_NAME, filename); + dirblk->w8(offset + i, (i >= 5 && i < 5 + 16) ? 0xa0 : 0x00); + dirblk->w8(offset + OFFSET_FILE_TYPE, FILE_TYPE_PRG); + dirblk->w8(offset + OFFSET_FILE_FIRST_TRACK, file_track); + dirblk->w8(offset + OFFSET_FILE_FIRST_SECTOR, file_sector); + dirblk->wstr(offset + OFFSET_FILE_NAME, filename); // TODO set first side sector block track (rel file) // TODO set first side sector block sector (rel file) // TODO set rel file record length @@ -470,18 +470,18 @@ std::error_condition impl::file_write(const std::vector &path, cons { auto datablk = read_sector(data_track, data_sector); u8 bytes = (data_length - offset) > SECTOR_DATA_BYTES ? SECTOR_DATA_BYTES : data_length - offset; - memcpy(datablk.data() + 2, data.data() + offset, bytes); + datablk->write(2, data.data() + offset, bytes); offset += SECTOR_DATA_BYTES; sector_count++; - if (datablk.r8(OFFSET_CHAIN_TRACK) == CHAIN_END) + if (datablk->r8(OFFSET_CHAIN_TRACK) == CHAIN_END) { if (offset < data_length) { auto [err, next_track, next_sector] = claim_sector(); if (err) return err; - datablk.w8(OFFSET_CHAIN_TRACK, next_track); - datablk.w8(OFFSET_CHAIN_SECTOR, next_sector); + datablk->w8(OFFSET_CHAIN_TRACK, next_track); + datablk->w8(OFFSET_CHAIN_SECTOR, next_sector); data_track = next_track; data_sector = next_sector; } @@ -490,14 +490,14 @@ std::error_condition impl::file_write(const std::vector &path, cons { if (offset < data_length) { - data_track = datablk.r8(OFFSET_CHAIN_TRACK); - data_sector = datablk.r8(OFFSET_CHAIN_SECTOR); + data_track = datablk->r8(OFFSET_CHAIN_TRACK); + data_sector = datablk->r8(OFFSET_CHAIN_SECTOR); } else { // Free the rest of the chain - u8 track_to_free = datablk.r8(OFFSET_CHAIN_TRACK); - u8 sector_to_free = datablk.r8(OFFSET_CHAIN_SECTOR); + u8 track_to_free = datablk->r8(OFFSET_CHAIN_TRACK); + u8 sector_to_free = datablk->r8(OFFSET_CHAIN_SECTOR); while (track_to_free != CHAIN_END) { @@ -505,15 +505,15 @@ std::error_condition impl::file_write(const std::vector &path, cons if (err) return err; datablk = read_sector(track_to_free, sector_to_free); - track_to_free = datablk.r8(OFFSET_CHAIN_TRACK); - sector_to_free = datablk.r8(OFFSET_CHAIN_SECTOR); + track_to_free = datablk->r8(OFFSET_CHAIN_TRACK); + sector_to_free = datablk->r8(OFFSET_CHAIN_SECTOR); } } } if (offset >= data_length) { - datablk.w8(OFFSET_CHAIN_TRACK, CHAIN_END); - datablk.w8(OFFSET_CHAIN_SECTOR, bytes + 1); + datablk->w8(OFFSET_CHAIN_TRACK, CHAIN_END); + datablk->w8(OFFSET_CHAIN_SECTOR, bytes + 1); } } @@ -523,17 +523,17 @@ std::error_condition impl::file_write(const std::vector &path, cons if (file_type == FILE_TYPE_DEL) { // Free sector, update first file sector to 00 - u8 file_track = dirblk.r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK); - u8 file_sector = dirblk.r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR); + u8 file_track = dirblk->r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK); + u8 file_sector = dirblk->r8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR); std::error_condition err = free_sector(file_track, file_sector); if (err) return err; - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK, 0); - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR, 0); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_TRACK, 0); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_FIRST_SECTOR, 0); sector_count = 0; } - dirblk.w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_TYPE, file_type); - dirblk.w16l(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_SECTOR_COUNT, sector_count); + dirblk->w8(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_FILE_TYPE, file_type); + dirblk->w16l(DIRECTORY_ENTRY_SIZE * dir_file_index + OFFSET_SECTOR_COUNT, sector_count); return std::error_condition(); } @@ -568,8 +568,8 @@ std::pair impl::claim_track_sector(u8 track) const return std::make_pair(error::invalid_block, 0); auto bamblk = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - u8 free_count = bamblk.r8(4 * track); - u32 free_bitmap = bamblk.r24l(4 * track + 1); + u8 free_count = bamblk->r8(4 * track); + u32 free_bitmap = bamblk->r24l(4 * track + 1); for (int s = 0; s < MAX_SECTORS; s++) { @@ -578,12 +578,12 @@ std::pair impl::claim_track_sector(u8 track) const { free_bitmap &= ~(1 << sector); free_count--; - bamblk.w8(4 * track, free_count); - bamblk.w24l(4 * track + 1, free_bitmap); + bamblk->w8(4 * track, free_count); + bamblk->w24l(4 * track + 1, free_bitmap); // Write chain end marker in new sector auto claimedlk = read_sector(track, sector); - claimedlk.w8(OFFSET_CHAIN_TRACK, CHAIN_END); - claimedlk.w8(OFFSET_CHAIN_SECTOR, 0xff); + claimedlk->w8(OFFSET_CHAIN_TRACK, CHAIN_END); + claimedlk->w8(OFFSET_CHAIN_SECTOR, 0xff); return std::make_pair(std::error_condition(), sector); } } @@ -611,12 +611,12 @@ std::error_condition impl::free_sector(u8 track, u8 sector) const return error::invalid_block; auto bamblk = read_sector(DIRECTORY_TRACK, BAM_SECTOR); - u8 free_count = bamblk.r8(4 * track); - u32 free_bitmap = bamblk.r24l(4 * track + 1); + u8 free_count = bamblk->r8(4 * track); + u32 free_bitmap = bamblk->r24l(4 * track + 1); free_bitmap |= (1 << sector); free_count++; - bamblk.w8(4 * track, free_count); - bamblk.w24l(4 * track + 1, free_bitmap); + bamblk->w8(4 * track, free_count); + bamblk->w24l(4 * track + 1, free_bitmap); return std::error_condition(); } @@ -625,7 +625,7 @@ std::error_condition impl::free_sector(u8 track, u8 sector) const // impl::read_sector //------------------------------------------------- -fsblk_t::block_t impl::read_sector(int track, int sector) const +fsblk_t::block_t::ptr impl::read_sector(int track, int sector) const { // CBM thinks in terms of tracks/sectors, but we have a block device abstraction u32 block = 0; @@ -776,8 +776,8 @@ bool impl::block_iterator::next() // with that out of the way, proceed m_block = m_fs.read_sector(m_next_track, m_next_sector); - m_next_track = m_block.r8(OFFSET_CHAIN_TRACK); - m_next_sector = m_block.r8(OFFSET_CHAIN_SECTOR); + m_next_track = m_block->r8(OFFSET_CHAIN_TRACK); + m_next_sector = m_block->r8(OFFSET_CHAIN_SECTOR); result = true; } else @@ -795,7 +795,7 @@ bool impl::block_iterator::next() const void *impl::block_iterator::data() const { - return m_block.rodata() + 2; + return m_block->rodata() + 2; } @@ -805,7 +805,7 @@ const void *impl::block_iterator::data() const const std::array &impl::block_iterator::dirent_data() const { - return *reinterpret_cast *>(m_block.rodata()); + return *reinterpret_cast *>(m_block->rodata()); } diff --git a/src/lib/formats/fs_coco_os9.cpp b/src/lib/formats/fs_coco_os9.cpp index e261968f69a11..8e9d9e8c8d0e5 100644 --- a/src/lib/formats/fs_coco_os9.cpp +++ b/src/lib/formats/fs_coco_os9.cpp @@ -39,23 +39,23 @@ class coco_os9_impl : public filesystem_t class volume_header { public: - volume_header(fsblk_t::block_t &&block); + volume_header(fsblk_t::block_t::ptr &&block); volume_header(const volume_header &) = delete; volume_header(volume_header &&) = default; - u32 total_sectors() const { return m_block.r24b(0); } - u8 track_size_in_sectors() const { return m_block.r8(3); } - u16 allocation_bitmap_bytes() const { return m_block.r16b(4); } - u16 cluster_size() const { return m_block.r16b(6); } - u32 root_dir_lsn() const { return m_block.r24b(8); } - u16 owner_id() const { return m_block.r16b(11); } - u16 disk_id() const { return m_block.r16b(14); } - u8 format_flags() const { return m_block.r8(16); } - u16 sectors_per_track() const { return m_block.r16b(17); } - u32 bootstrap_lsn() const { return m_block.r24b(21); } - u16 bootstrap_size() const { return m_block.r16b(24); } - util::arbitrary_datetime creation_date() const { return from_os9_date(m_block.r24b(26), m_block.r16b(29)); } - u16 sector_size() const { u16 result = m_block.r16b(104); return result != 0 ? result : 256; } + u32 total_sectors() const { return m_block->r24b(0); } + u8 track_size_in_sectors() const { return m_block->r8(3); } + u16 allocation_bitmap_bytes() const { return m_block->r16b(4); } + u16 cluster_size() const { return m_block->r16b(6); } + u32 root_dir_lsn() const { return m_block->r24b(8); } + u16 owner_id() const { return m_block->r16b(11); } + u16 disk_id() const { return m_block->r16b(14); } + u8 format_flags() const { return m_block->r8(16); } + u16 sectors_per_track() const { return m_block->r16b(17); } + u32 bootstrap_lsn() const { return m_block->r24b(21); } + u16 bootstrap_size() const { return m_block->r16b(24); } + util::arbitrary_datetime creation_date() const { return from_os9_date(m_block->r24b(26), m_block->r16b(29)); } + u16 sector_size() const { u16 result = m_block->r16b(104); return result != 0 ? result : 256; } u8 sides() const { return (format_flags() & 0x01) ? 2 : 1; } bool double_density() const { return (format_flags() & 0x02) != 0; } bool double_track() const { return (format_flags() & 0x04) != 0; } @@ -65,7 +65,7 @@ class coco_os9_impl : public filesystem_t std::string name() const; private: - fsblk_t::block_t m_block; + fsblk_t::block_t::ptr m_block; }; @@ -74,17 +74,17 @@ class coco_os9_impl : public filesystem_t class file_header { public: - file_header(fsblk_t::block_t &&block, std::string &&filename); + file_header(fsblk_t::block_t::ptr &&block, std::string &&filename); file_header(const file_header &) = delete; file_header(file_header &&) = default; file_header &operator=(const file_header &) = delete; file_header &operator=(file_header &&) = default; - u8 attributes() const { return m_block.r8(0); } - u16 owner_id() const { return m_block.r16b(1); } - u8 link_count() const { return m_block.r8(8); } - u32 file_size() const { return m_block.r32b(9); } + u8 attributes() const { return m_block->r8(0); } + u16 owner_id() const { return m_block->r16b(1); } + u8 link_count() const { return m_block->r8(8); } + u32 file_size() const { return m_block->r32b(9); } util::arbitrary_datetime creation_date() const; bool is_directory() const { return (attributes() & 0x80) != 0; } bool is_non_sharable() const { return (attributes() & 0x40) != 0; } @@ -100,8 +100,8 @@ class coco_os9_impl : public filesystem_t void get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const; private: - fsblk_t::block_t m_block; - std::string m_filename; + fsblk_t::block_t::ptr m_block; + std::string m_filename; }; // ctor/dtor @@ -364,7 +364,7 @@ std::pair> coco_os9_impl::file_read(const std::error_condition coco_os9_impl::format(const meta_data &meta) { // for some reason, the OS-9 world favored filling with 0xE5 - m_blockdev.fill(0xe5); + m_blockdev.fill_all(0xe5); // identify geometry info u8 sectors = 18; // TODO - we need a definitive technique to get the floppy geometry @@ -390,33 +390,33 @@ std::error_condition coco_os9_impl::format(const meta_data &meta) // volume header auto volume_header = m_blockdev.get(0); - volume_header.fill(0x00); - volume_header.w24b(0, lsn_count); // DD.TOT - total secctors - volume_header.w8(3, sectors); // DD.TKS - track size in sectors - volume_header.w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes - volume_header.w16b(6, cluster_size); // DD.BIT - cluster size - volume_header.w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN - volume_header.w16b(11, owner_id); // DD.OWN - owner ID - volume_header.w8(13, attributes); // DD.ATT - Dattributes - volume_header.w16b(14, disk_id); // DD.DSK - disk ID - volume_header.w8(16, format_flags); // DD.FMT - format flags - volume_header.w16b(17, sectors); // DD.SPT - sectors per track - volume_header.w24b(26, creation_os9date); // DD.DAT - date of creation - volume_header.w16b(29, creation_os9time); // DD.DAT - time of creation - volume_header.wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title - volume_header.w16b(103, sector_bytes / 256); // sector bytes + volume_header->fill(0x00); + volume_header->w24b(0, lsn_count); // DD.TOT - total secctors + volume_header->w8(3, sectors); // DD.TKS - track size in sectors + volume_header->w16b(4, (allocation_bitmap_bits + 7) / 8); // DD.MAP - allocation bitmap in bytes + volume_header->w16b(6, cluster_size); // DD.BIT - cluster size + volume_header->w24b(8, 1 + allocation_bitmap_lsns); // DD.DIR - root directory LSN + volume_header->w16b(11, owner_id); // DD.OWN - owner ID + volume_header->w8(13, attributes); // DD.ATT - Dattributes + volume_header->w16b(14, disk_id); // DD.DSK - disk ID + volume_header->w8(16, format_flags); // DD.FMT - format flags + volume_header->w16b(17, sectors); // DD.SPT - sectors per track + volume_header->w24b(26, creation_os9date); // DD.DAT - date of creation + volume_header->w16b(29, creation_os9time); // DD.DAT - time of creation + volume_header->wstr(31, to_os9_string(volume_title, 32)); // DD.NAM - title + volume_header->w16b(103, sector_bytes / 256); // sector bytes // path descriptor options - volume_header.w8(0x3f + 0x00, 1); // device class - volume_header.w8(0x3f + 0x01, 1); // drive number - volume_header.w8(0x3f + 0x03, 0x20); // device type - volume_header.w8(0x3f + 0x04, 1); // density capability - volume_header.w16b(0x3f + 0x05, tracks); // number of tracks - volume_header.w8(0x3f + 0x07, heads); // number of sides - volume_header.w16b(0x3f + 0x09, sectors); // sectors per track - volume_header.w16b(0x3f + 0x0b, sectors); // sectors on track zero - volume_header.w8(0x3f + 0x0d, 3); // sector interleave factor - volume_header.w8(0x3f + 0x0e, 8); // default sectors per allocation + volume_header->w8(0x3f + 0x00, 1); // device class + volume_header->w8(0x3f + 0x01, 1); // drive number + volume_header->w8(0x3f + 0x03, 0x20); // device type + volume_header->w8(0x3f + 0x04, 1); // density capability + volume_header->w16b(0x3f + 0x05, tracks); // number of tracks + volume_header->w8(0x3f + 0x07, heads); // number of sides + volume_header->w16b(0x3f + 0x09, sectors); // sectors per track + volume_header->w16b(0x3f + 0x0b, sectors); // sectors on track zero + volume_header->w8(0x3f + 0x0d, 3); // sector interleave factor + volume_header->w8(0x3f + 0x0e, 8); // default sectors per allocation // allocation bitmap u32 total_allocated_sectors = 1 + allocation_bitmap_lsns + 1 + 8; @@ -436,34 +436,34 @@ std::error_condition coco_os9_impl::format(const meta_data &meta) } auto abblk = m_blockdev.get(1 + i); - abblk.copy(0, abblk_bytes.data(), sector_bytes); + abblk->write(0, abblk_bytes.data(), sector_bytes); } // root directory header auto roothdr_blk = m_blockdev.get(1 + allocation_bitmap_lsns); - roothdr_blk.fill(0x00); - roothdr_blk.w8(0x00, 0xbf); - roothdr_blk.w8(0x01, 0x00); - roothdr_blk.w8(0x02, 0x00); - roothdr_blk.w24b(0x03, creation_os9date); - roothdr_blk.w16b(0x06, creation_os9time); - roothdr_blk.w8(0x08, 0x01); - roothdr_blk.w8(0x09, 0x00); - roothdr_blk.w8(0x0a, 0x00); - roothdr_blk.w8(0x0b, 0x00); - roothdr_blk.w8(0x0c, 0x40); - roothdr_blk.w24b(0x0d, creation_os9date); - roothdr_blk.w24b(0x10, 1 + allocation_bitmap_lsns + 1); - roothdr_blk.w16b(0x13, 8); + roothdr_blk->fill(0x00); + roothdr_blk->w8(0x00, 0xbf); + roothdr_blk->w8(0x01, 0x00); + roothdr_blk->w8(0x02, 0x00); + roothdr_blk->w24b(0x03, creation_os9date); + roothdr_blk->w16b(0x06, creation_os9time); + roothdr_blk->w8(0x08, 0x01); + roothdr_blk->w8(0x09, 0x00); + roothdr_blk->w8(0x0a, 0x00); + roothdr_blk->w8(0x0b, 0x00); + roothdr_blk->w8(0x0c, 0x40); + roothdr_blk->w24b(0x0d, creation_os9date); + roothdr_blk->w24b(0x10, 1 + allocation_bitmap_lsns + 1); + roothdr_blk->w16b(0x13, 8); // root directory data auto rootdata_blk = m_blockdev.get(1 + allocation_bitmap_lsns + 1); - rootdata_blk.fill(0x00); - rootdata_blk.w8(0x00, 0x2e); - rootdata_blk.w8(0x01, 0xae); - rootdata_blk.w8(0x1f, 1 + allocation_bitmap_lsns); - rootdata_blk.w8(0x20, 0xae); - rootdata_blk.w8(0x3f, 1 + allocation_bitmap_lsns); + rootdata_blk->fill(0x00); + rootdata_blk->w8(0x00, 0x2e); + rootdata_blk->w8(0x01, 0xae); + rootdata_blk->w8(0x1f, 1 + allocation_bitmap_lsns); + rootdata_blk->w8(0x20, 0xae); + rootdata_blk->w8(0x3f, 1 + allocation_bitmap_lsns); return std::error_condition(); } @@ -554,9 +554,9 @@ std::vector coco_os9_impl::read_file_data(const file_header &header) const for (u32 lsn = start_lsn; lsn < start_lsn + count; lsn++) { auto block = m_blockdev.get(lsn); - size_t block_size = std::min(std::min(u32(m_volume_header.sector_size()), block.size()), header.file_size() - u32(data.size())); + size_t block_size = std::min(std::min(u32(m_volume_header.sector_size()), block->size()), header.file_size() - u32(data.size())); for (auto i = 0; i < block_size; i++) - data.push_back(block.rodata()[i]); + data.push_back(block->rodata()[i]); } } return data; @@ -664,7 +664,7 @@ bool coco_os9_impl::is_ignored_filename(std::string_view name) // volume_header ctor //------------------------------------------------- -coco_os9_impl::volume_header::volume_header(fsblk_t::block_t &&block) +coco_os9_impl::volume_header::volume_header(fsblk_t::block_t::ptr &&block) : m_block(std::move(block)) { } @@ -676,7 +676,7 @@ coco_os9_impl::volume_header::volume_header(fsblk_t::block_t &&block) std::string coco_os9_impl::volume_header::name() const { - std::string_view raw_name((const char *)&m_block.rodata()[31], 32); + std::string_view raw_name(m_block->rstr(31, 32)); return pick_os9_string(raw_name); } @@ -685,7 +685,7 @@ std::string coco_os9_impl::volume_header::name() const // file_header ctor //------------------------------------------------- -coco_os9_impl::file_header::file_header(fsblk_t::block_t &&block, std::string &&filename) +coco_os9_impl::file_header::file_header(fsblk_t::block_t::ptr &&block, std::string &&filename) : m_block(std::move(block)) , m_filename(std::move(filename)) { @@ -698,7 +698,7 @@ coco_os9_impl::file_header::file_header(fsblk_t::block_t &&block, std::string && util::arbitrary_datetime coco_os9_impl::file_header::creation_date() const { - return from_os9_date(m_block.r24b(13)); + return from_os9_date(m_block->r24b(13)); } @@ -735,7 +735,7 @@ meta_data coco_os9_impl::file_header::metadata() const int coco_os9_impl::file_header::get_sector_map_entry_count() const { - return (m_block.size() - 16) / 5; + return (m_block->size() - 16) / 5; } @@ -745,6 +745,6 @@ int coco_os9_impl::file_header::get_sector_map_entry_count() const void coco_os9_impl::file_header::get_sector_map_entry(int entry_number, u32 &start_lsn, u16 &count) const { - start_lsn = m_block.r24b(16 + (entry_number * 5) + 0); - count = m_block.r16b(16 + (entry_number * 5) + 3); + start_lsn = m_block->r24b(16 + (entry_number * 5) + 0); + count = m_block->r16b(16 + (entry_number * 5) + 3); } diff --git a/src/lib/formats/fs_coco_rsdos.cpp b/src/lib/formats/fs_coco_rsdos.cpp index c616c8babc6f5..0ce88cf01df60 100644 --- a/src/lib/formats/fs_coco_rsdos.cpp +++ b/src/lib/formats/fs_coco_rsdos.cpp @@ -62,11 +62,11 @@ class coco_rsdos_impl : public filesystem_t bool next(u8 &granule, u16 &byte_count); private: - fsblk_t::block_t m_granule_map; - std::optional m_current_granule; - u8 m_maximum_granules; - u16 m_last_sector_bytes; - std::bitset<256> m_visited_granules; + fsblk_t::block_t::ptr m_granule_map; + std::optional m_current_granule; + u8 m_maximum_granules; + u16 m_last_sector_bytes; + std::bitset<256> m_visited_granules; }; virtual std::pair metadata(const std::vector &path) override; @@ -96,8 +96,8 @@ class coco_rsdos_impl : public filesystem_t static constexpr u8 FILE_TYPE_TEXT_EDITOR = 0x03; static constexpr u8 FILE_LAST_GRANULE_INDICATOR = 0xc0; - fsblk_t::block_t read_sector(int track, int sector) const; - fsblk_t::block_t read_granule_sector(u8 granule, u8 sector) const; + fsblk_t::block_t::ptr read_sector(int track, int sector) const; + fsblk_t::block_t::ptr read_granule_sector(u8 granule, u8 sector) const; u8 maximum_granules() const; std::optional dirent_from_path(const std::vector &path); template @@ -297,11 +297,10 @@ std::pair> coco_rsdos_impl::file_read(cons { // read this sector auto block = read_sector(track, sector); - const u8 *data = block.rodata(); u16 data_length = std::min(byte_count, u16(SECTOR_SIZE)); // and append it to the results - memcpy(result.data() + current_size, data, data_length); + block->read(0, result.data() + current_size, data_length); // and advance current_size += data_length; @@ -320,7 +319,7 @@ std::pair> coco_rsdos_impl::file_read(cons std::error_condition coco_rsdos_impl::format(const meta_data &meta) { // formatting RS-DOS is easy - just fill everything with 0xFF - m_blockdev.fill(0xFF); + m_blockdev.fill_all(0xFF); return std::error_condition(); } @@ -367,20 +366,20 @@ std::error_condition coco_rsdos_impl::file_create(const std::vector for (file_index = 0; !found_entry && file_index < SECTOR_DIRECTORY_ENTRY_COUNT; file_index++) { - const u8 first_byte = dir_block.r8(file_index * DIRECTORY_ENTRY_SIZE); + const u8 first_byte = dir_block->r8(file_index * DIRECTORY_ENTRY_SIZE); // 0xff marks the end of the directory, 0x00 marks a deleted file found_entry = (first_byte == 0xff || first_byte == 0x00); if (found_entry) { for (int i = 0; i < DIRECTORY_ENTRY_SIZE; i++) - dir_block.w8(file_index * DIRECTORY_ENTRY_SIZE + i, 0); + dir_block->w8(file_index * DIRECTORY_ENTRY_SIZE + i, 0); auto [cerr, granule] = claim_granule(); if (cerr != std::error_condition()) return cerr; - dir_block.wstr(file_index * DIRECTORY_ENTRY_SIZE + 0, fname); - dir_block.w8(file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FIRST_GRANULE, granule); + dir_block->wstr(file_index * DIRECTORY_ENTRY_SIZE + 0, fname); + dir_block->w8(file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FIRST_GRANULE, granule); // The file type, ASCII flag, and number of bytes in last sector of file will be set during writing. } } @@ -429,7 +428,7 @@ std::error_condition coco_rsdos_impl::file_write(const std::vector { auto data_block = read_granule_sector(granule, granule_sector); bytes_in_last_sector = (data_length - offset) > SECTOR_SIZE ? SECTOR_SIZE : data_length - offset; - memcpy(data_block.data(), data.data() + offset, bytes_in_last_sector); + data_block->write(0, data.data() + offset, bytes_in_last_sector); offset += SECTOR_SIZE; write_granule_map(granule, FILE_LAST_GRANULE_INDICATOR + granule_sector); if (offset < data_length) @@ -466,9 +465,9 @@ std::error_condition coco_rsdos_impl::file_write(const std::vector // Update directory entry auto dir_block = read_sector(DIRECTORY_TRACK, dir_sector); - dir_block.w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FILE_TYPE, determine_file_type(data)); - dir_block.w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_ASCII_FLAG, is_ascii(data) ? 0xff : 0x00); - dir_block.w16b(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_LAST_SECTOR_BYTES, bytes_in_last_sector); + dir_block->w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_FILE_TYPE, determine_file_type(data)); + dir_block->w8(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_ASCII_FLAG, is_ascii(data) ? 0xff : 0x00); + dir_block->w16b(dir_file_index * DIRECTORY_ENTRY_SIZE + OFFSET_LAST_SECTOR_BYTES, bytes_in_last_sector); return std::error_condition(); } @@ -516,9 +515,9 @@ std::pair coco_rsdos_impl::claim_granule() auto granule_block = read_sector(DIRECTORY_TRACK, 2); for (int g = 0; g < maximum_granules(); g++) { - if (granule_block.r8(g) == 0xff) + if (granule_block->r8(g) == 0xff) { - granule_block.w8(g, FILE_LAST_GRANULE_INDICATOR); + granule_block->w8(g, FILE_LAST_GRANULE_INDICATOR); return std::make_pair(std::error_condition(), g); } } @@ -529,22 +528,22 @@ std::pair coco_rsdos_impl::claim_granule() void coco_rsdos_impl::write_granule_map(u8 granule, u8 map_data) { auto granule_block = read_sector(DIRECTORY_TRACK, 2); - granule_block.w8(granule, map_data); + granule_block->w8(granule, map_data); } u8 coco_rsdos_impl::read_granule_map(u8 granule) const { auto granule_block = read_sector(DIRECTORY_TRACK, 2); - return granule_block.r8(granule); + return granule_block->r8(granule); } //------------------------------------------------- -// fsblk_t::block_t coco_rsdos_impl::read_sector +// coco_rsdos_impl::read_sector //------------------------------------------------- -fsblk_t::block_t coco_rsdos_impl::read_sector(int track, int sector) const +fsblk_t::block_t::ptr coco_rsdos_impl::read_sector(int track, int sector) const { // the CoCo RS-DOS world thinks in terms of tracks/sectors, but we have a block device // abstraction @@ -552,7 +551,7 @@ fsblk_t::block_t coco_rsdos_impl::read_sector(int track, int sector) const } -fsblk_t::block_t coco_rsdos_impl::read_granule_sector(u8 granule, u8 sector) const +fsblk_t::block_t::ptr coco_rsdos_impl::read_granule_sector(u8 granule, u8 sector) const { // Track 17 does not hold granules if (granule < (DIRECTORY_TRACK * TRACK_GRANULE_COUNT)) @@ -609,7 +608,7 @@ void coco_rsdos_impl::iterate_directory_entries(T &&callback) { // read this directory sector auto dir_block = read_sector(DIRECTORY_TRACK, dir_sector); - const rsdos_dirent_sector §or = *reinterpret_cast(dir_block.rodata()); + const rsdos_dirent_sector §or = *reinterpret_cast(dir_block->rodata()); // and loop through all entries for (int file_index = 0; file_index < 8; file_index++) @@ -709,7 +708,7 @@ bool coco_rsdos_impl::granule_iterator::next(u8 &granule, u16 &byte_count) if (m_current_granule) { std::optional next_granule; - const u8 *granule_map_data = m_granule_map.rodata(); + const u8 *granule_map_data = m_granule_map->rodata(); if (granule_map_data[*m_current_granule] < m_maximum_granules) { // this entry points to the next granule diff --git a/src/lib/formats/fs_fat.cpp b/src/lib/formats/fs_fat.cpp index 3b2911710353a..8e47bbc5abecc 100644 --- a/src/lib/formats/fs_fat.cpp +++ b/src/lib/formats/fs_fat.cpp @@ -185,19 +185,19 @@ class directory_entry static constexpr u8 ATTR_DIRECTORY = 0x10; static constexpr u8 ATTR_ARCHIVE = 0x20; - directory_entry(const fsblk_t::block_t &block, u32 offset) + directory_entry(fsblk_t::block_t::ptr block, u32 offset) : m_block(block) , m_offset(offset) { } - std::string_view raw_stem() const { return std::string_view((const char *) &m_block.rodata()[m_offset + OFFSET_FNAME], 8); } - std::string_view raw_ext() const { return std::string_view((const char *) &m_block.rodata()[m_offset + OFFSET_FNAME + 8], 3); } - u8 attributes() const { return m_block.r8(m_offset + OFFSET_ATTRIBUTES); } - u32 raw_create_datetime() const { return m_block.r32l(m_offset + OFFSET_CREATE_DATETIME); } - u32 raw_modified_datetime() const { return m_block.r32l(m_offset + OFFSET_MODIFIED_DATETIME); } - u32 start_cluster() const { return ((u32)m_block.r16l(m_offset + OFFSET_START_CLUSTER_HI)) << 16 | m_block.r16l(m_offset + OFFSET_START_CLUSTER); } - u32 file_size() const { return m_block.r32l(m_offset + OFFSET_FILE_SIZE); } + std::string_view raw_stem() const { return m_block->rstr(m_offset + OFFSET_FNAME, 8); } + std::string_view raw_ext() const { return m_block->rstr(m_offset + OFFSET_FNAME + 8, 3); } + u8 attributes() const { return m_block->r8(m_offset + OFFSET_ATTRIBUTES); } + u32 raw_create_datetime() const { return m_block->r32l(m_offset + OFFSET_CREATE_DATETIME); } + u32 raw_modified_datetime() const { return m_block->r32l(m_offset + OFFSET_MODIFIED_DATETIME); } + u32 start_cluster() const { return ((u32)m_block->r16l(m_offset + OFFSET_START_CLUSTER_HI)) << 16 | m_block->r16l(m_offset + OFFSET_START_CLUSTER); } + u32 file_size() const { return m_block->r32l(m_offset + OFFSET_FILE_SIZE); } bool is_read_only() const { return (attributes() & 0x01) != 0x00; } bool is_hidden() const { return (attributes() & 0x02) != 0x00; } @@ -206,18 +206,18 @@ class directory_entry bool is_long_file_name() const { return attributes() == 0x0f; } bool is_subdirectory() const { return (attributes() & 0x10) != 0x00; } bool is_archive() const { return (attributes() & 0x20) != 0x00; } - bool is_deleted() const { return m_block.r8(m_offset) == DELETED_FILE_MARKER; } + bool is_deleted() const { return m_block->r8(m_offset) == DELETED_FILE_MARKER; } std::string name() const; meta_data metadata() const; - void set_file_size(u32 file_size) { m_block.w32l(m_offset + OFFSET_FILE_SIZE, file_size); } - void set_raw_modified_datetime(u32 datetime) { m_block.w32l(m_offset + OFFSET_MODIFIED_DATETIME, datetime); } - void mark_deleted() { m_block.w8(m_offset + OFFSET_FNAME, DELETED_FILE_MARKER); } + void set_file_size(u32 file_size) { m_block->w32l(m_offset + OFFSET_FILE_SIZE, file_size); } + void set_raw_modified_datetime(u32 datetime) { m_block->w32l(m_offset + OFFSET_MODIFIED_DATETIME, datetime); } + void mark_deleted() { m_block->w8(m_offset + OFFSET_FNAME, DELETED_FILE_MARKER); } private: - fsblk_t::block_t m_block; - u32 m_offset; + fsblk_t::block_t::ptr m_block; + u32 m_offset; }; // ======================> directory_span @@ -240,7 +240,7 @@ class impl : public filesystem_t { public: // ctor/dtor - impl(fsblk_t &blockdev, fsblk_t::block_t &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry); + impl(fsblk_t &blockdev, fsblk_t::block_t::ptr &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry); virtual ~impl() = default; // accessors @@ -271,7 +271,7 @@ class impl : public filesystem_t private: static constexpr u32 FIRST_VALID_CLUSTER = 2; - fsblk_t::block_t m_boot_sector_block; + fsblk_t::block_t::ptr m_boot_sector_block; std::vector m_file_allocation_table; u32 m_starting_sector; u32 m_sector_count; @@ -494,19 +494,19 @@ std::vector fs::fat_image::directory_meta_description() const std::unique_ptr fs::fat_image::mount_partition(fsblk_t &blockdev, u32 starting_sector, u32 sector_count, u8 bits_per_fat_entry) { // load the boot sector block and get some basic info - fsblk_t::block_t boot_sector_block = blockdev.get(starting_sector); - u16 reserved_sector_count = boot_sector_block.r16l(impl::OFFSET_RESERVED_SECTOR_COUNT); + fsblk_t::block_t::ptr boot_sector_block = blockdev.get(starting_sector); + u16 reserved_sector_count = boot_sector_block->r16l(impl::OFFSET_RESERVED_SECTOR_COUNT); // load all file allocation table sectors - u32 fat_count = boot_sector_block.r8(impl::OFFSET_FAT_COUNT); - u32 sectors_per_fat = boot_sector_block.r16l(impl::OFFSET_FAT_SECTOR_COUNT); - u16 bytes_per_sector = boot_sector_block.r16l(impl::OFFSET_BYTES_PER_SECTOR); + u32 fat_count = boot_sector_block->r8(impl::OFFSET_FAT_COUNT); + u32 sectors_per_fat = boot_sector_block->r16l(impl::OFFSET_FAT_SECTOR_COUNT); + u16 bytes_per_sector = boot_sector_block->r16l(impl::OFFSET_BYTES_PER_SECTOR); std::vector file_allocation_table; file_allocation_table.reserve(fat_count * sectors_per_fat * bytes_per_sector); for (auto i = 0; i < fat_count * sectors_per_fat; i++) { - fsblk_t::block_t fatblk = blockdev.get(starting_sector + reserved_sector_count + i); - file_allocation_table.insert(file_allocation_table.end(), fatblk.rodata(), fatblk.rodata() + bytes_per_sector); + fsblk_t::block_t::ptr fatblk = blockdev.get(starting_sector + reserved_sector_count + i); + file_allocation_table.insert(file_allocation_table.end(), fatblk->rodata(), fatblk->rodata() + bytes_per_sector); } // and return the implementation @@ -548,18 +548,18 @@ meta_data directory_entry::metadata() const // impl ctor //------------------------------------------------- -impl::impl(fsblk_t &blockdev, fsblk_t::block_t &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry) +impl::impl(fsblk_t &blockdev, fsblk_t::block_t::ptr &&boot_sector_block, std::vector &&file_allocation_table, u32 starting_sector, u32 sector_count, u16 reserved_sector_count, u8 bits_per_fat_entry) : filesystem_t(blockdev, 512) , m_boot_sector_block(std::move(boot_sector_block)) , m_file_allocation_table(std::move(file_allocation_table)) , m_starting_sector(starting_sector) , m_sector_count(sector_count) , m_reserved_sector_count(reserved_sector_count) - , m_bytes_per_sector(m_boot_sector_block.r16l(OFFSET_BYTES_PER_SECTOR)) - , m_root_directory_size(m_boot_sector_block.r16l(OFFSET_DIRECTORY_ENTRY_COUNT)) - , m_sectors_per_cluster(m_boot_sector_block.r8(OFFSET_CLUSTER_SECTOR_COUNT)) - , m_fat_count(m_boot_sector_block.r8(OFFSET_FAT_COUNT)) - , m_fat_sector_count(m_boot_sector_block.r16l(OFFSET_FAT_SECTOR_COUNT)) + , m_bytes_per_sector(m_boot_sector_block->r16l(OFFSET_BYTES_PER_SECTOR)) + , m_root_directory_size(m_boot_sector_block->r16l(OFFSET_DIRECTORY_ENTRY_COUNT)) + , m_sectors_per_cluster(m_boot_sector_block->r8(OFFSET_CLUSTER_SECTOR_COUNT)) + , m_fat_count(m_boot_sector_block->r8(OFFSET_FAT_COUNT)) + , m_fat_sector_count(m_boot_sector_block->r16l(OFFSET_FAT_SECTOR_COUNT)) , m_bits_per_fat_entry(bits_per_fat_entry) , m_last_cluster_indicator(((u64)1 << bits_per_fat_entry) - 1) , m_last_valid_cluster(m_last_cluster_indicator - 0x10) @@ -594,7 +594,7 @@ meta_data impl::volume_metadata() if (!results.has(meta_name::name)) results.set(meta_name::name, "UNTITLED"); - results.set(meta_name::oem_name, m_boot_sector_block.rstr(3, 8)); + results.set(meta_name::oem_name, m_boot_sector_block->rstr(3, 8)); return results; } @@ -661,9 +661,9 @@ std::pair> impl::file_read(const std::vect // and add data from all sectors for (u32 sector : sectors) { - fsblk_t::block_t block = m_blockdev.get(sector); - const u8 *data = block.rodata(); - size_t length = std::min((size_t)dirent->file_size() - result.size(), (size_t)block.size()); + fsblk_t::block_t::ptr block = m_blockdev.get(sector); + const u8 *data = block->rodata(); + size_t length = std::min((size_t)dirent->file_size() - result.size(), (size_t)block->size()); result.insert(result.end(), data, data + length); } return std::make_pair(std::error_condition(), std::move(result)); @@ -782,12 +782,12 @@ std::error_condition impl::initialize_directory(u32 directory_cluster, u32 paren std::string dir_fname; dir_fname.resize(directory_entry::FNAME_LENGTH, ' '); dir_fname[0] = '.'; - std::error_condition err = initialize_directory_entry(dirblk, 0, dir_fname, directory_entry::ATTR_DIRECTORY, directory_cluster); + std::error_condition err = initialize_directory_entry(*dirblk, 0, dir_fname, directory_entry::ATTR_DIRECTORY, directory_cluster); if (err) return err; dir_fname[1] = '.'; - err = initialize_directory_entry(dirblk, directory_entry::SIZE, dir_fname, directory_entry::ATTR_DIRECTORY, parent_cluster); + err = initialize_directory_entry(*dirblk, directory_entry::SIZE, dir_fname, directory_entry::ATTR_DIRECTORY, parent_cluster); if (err) return err; @@ -875,7 +875,7 @@ void impl::clear_cluster_sectors(u32 cluster, u8 fill_byte) { auto dirblk = m_blockdev.get(sector + i); for (int offset = 0; offset < m_bytes_per_sector; offset++) - dirblk.w8(offset, fill_byte); + dirblk->w8(offset, fill_byte); } } @@ -886,7 +886,7 @@ std::error_condition impl::file_create_sector(u32 sector, std::string &fname, u8 auto dirblk = m_blockdev.get(sector); for (u32 blkoffset = 0; blkoffset < m_bytes_per_sector; blkoffset += directory_entry::SIZE) { - u8 first_byte = dirblk.r8(blkoffset); + u8 first_byte = dirblk->r8(blkoffset); if (first_byte == 0x00 || first_byte == directory_entry::DELETED_FILE_MARKER) { u32 start_cluster = find_free_cluster(); @@ -894,7 +894,7 @@ std::error_condition impl::file_create_sector(u32 sector, std::string &fname, u8 return error::no_space; set_next_cluster(start_cluster, m_last_cluster_indicator); - std::error_condition err = initialize_directory_entry(dirblk, blkoffset, fname, attributes, start_cluster); + std::error_condition err = initialize_directory_entry(*dirblk, blkoffset, fname, attributes, start_cluster); if (err) return err; @@ -963,7 +963,7 @@ std::error_condition impl::file_write(const std::vector &path, cons { auto datablk = m_blockdev.get(sector); u32 bytes = (data_length - offset > m_bytes_per_sector) ? m_bytes_per_sector : data_length - offset; - memcpy(datablk.data(), data.data() + offset, bytes); + datablk->write(0, data.data() + offset, bytes); offset += m_bytes_per_sector; } } @@ -1110,7 +1110,7 @@ void impl::set_next_cluster(u32 cluster, u32 next_cluster) { u32 fat_sector = m_fat_start_sector + (i * m_fat_sector_count) + (byte_pos / m_bytes_per_sector); auto fatblk = m_blockdev.get(fat_sector); - fatblk.w8(byte_pos % m_bytes_per_sector, m_file_allocation_table[byte_pos]); + fatblk->w8(byte_pos % m_bytes_per_sector, m_file_allocation_table[byte_pos]); } } } @@ -1227,7 +1227,7 @@ void impl::iterate_directory_entries(const directory_span &dir, T &&callback) co for (u32 sector : sectors) { bool done = false; - fsblk_t::block_t block = m_blockdev.get(sector); + fsblk_t::block_t::ptr block = m_blockdev.get(sector); for (u32 index = 0; !done && (index < dirents_per_sector()); index++) { directory_entry dirent(block, index * 32); diff --git a/src/lib/formats/fs_hp98x5.cpp b/src/lib/formats/fs_hp98x5.cpp index 1b47fbbb459e4..f070d01b30fcc 100644 --- a/src/lib/formats/fs_hp98x5.cpp +++ b/src/lib/formats/fs_hp98x5.cpp @@ -544,11 +544,11 @@ std::error_condition hp98x5_impl::format(const meta_data &meta) // Interleave factor w16b(out_ins, m_fmt_interleave[ m_fs_type ]); - m_blockdev.get(0).copy(0, sys_rec.data(), sys_rec.size()); + m_blockdev.get(0)->write(0, sys_rec.data(), sys_rec.size()); // 9825 & 9831 have a backup copy of system record in spare track but 9845 hasn't, go figure if (m_fs_type != FS_TYPE_9845) { - m_blockdev.get(m_spare_start).copy(0, sys_rec.data(), sys_rec.size()); + m_blockdev.get(m_spare_start)->write(0, sys_rec.data(), sys_rec.size()); } m_dir.clear(); @@ -663,14 +663,14 @@ void hp98x5_impl::ensure_dir_loaded() // 8 Count of data tracks // 9 Interleave factor // 10..127 N/U - u16 sects_per_track = sys_rec.r16b(2); - u16 tot_tracks = sys_rec.r16b(4); - u16 spare_track = sys_rec.r16b(6); - u16 dir_start = sys_rec.r16b(8); - u16 av_start = sys_rec.r16b(10); - u16 av_end = sys_rec.r16b(12); - u16 sys_tracks = sys_rec.r16b(14); - u16 data_tracks = sys_rec.r16b(16); + u16 sects_per_track = sys_rec->r16b(2); + u16 tot_tracks = sys_rec->r16b(4); + u16 spare_track = sys_rec->r16b(6); + u16 dir_start = sys_rec->r16b(8); + u16 av_start = sys_rec->r16b(10); + u16 av_end = sys_rec->r16b(12); + u16 sys_tracks = sys_rec->r16b(14); + u16 data_tracks = sys_rec->r16b(16); m_img_tracks = m_blockdev.block_count() / SECTORS; @@ -1159,7 +1159,7 @@ std::vector hp98x5_impl::get_sector_range(lba_t first, unsigned size) const for (lba_t idx = first; idx < first + size; idx++) { auto data_sect = m_blockdev.get(u32(idx)); - memcpy(ptr, data_sect.rodata(), SECTOR_SIZE); + data_sect->read(0, ptr, SECTOR_SIZE); ptr += SECTOR_SIZE; } return res; @@ -1173,7 +1173,7 @@ void hp98x5_impl::store_sector_range(lba_t first, const std::vector& data) for (lba_t idx = first; idx < first + sects; idx++) { u32 count = std::min(to_go, SECTOR_SIZE); auto blk = m_blockdev.get(u32(idx)); - blk.copy(0, ptr, count); + blk->write(0, ptr, count); ptr += count; to_go -= count; } diff --git a/src/lib/formats/fs_hplif.cpp b/src/lib/formats/fs_hplif.cpp index e910ca3cb364d..8a3d2c52da4df 100644 --- a/src/lib/formats/fs_hplif.cpp +++ b/src/lib/formats/fs_hplif.cpp @@ -64,10 +64,10 @@ class impl : public filesystem_t { u8 size() const; private: - const impl & m_fs; - fsblk_t::block_t m_block; - u8 m_sector; - u32 m_sector_count; + const impl & m_fs; + fsblk_t::block_t::ptr m_block; + u8 m_sector; + u32 m_sector_count; }; impl(fsblk_t &blockdev); @@ -79,7 +79,7 @@ class impl : public filesystem_t { virtual std::pair> file_read(const std::vector &path) override; private: - fsblk_t::block_t read_sector(u32 starting_sector) const; + fsblk_t::block_t::ptr read_sector(u32 starting_sector) const; std::optional dirent_from_path(const std::vector &path) const; void iterate_directory_entries(const std::function &callback) const; util::arbitrary_datetime decode_datetime(const hplif_time *time) const; @@ -252,11 +252,11 @@ impl::impl(fsblk_t &blockdev) meta_data impl::volume_metadata() { auto block = read_sector(0); - std::string_view disk_name = std::string_view((const char *) block.rodata() + 2, 6); + std::string_view disk_name = block->rstr(2, 6); meta_data results; results.set(meta_name::name, strtrimright_hplif(disk_name)); - results.set(meta_name::creation_date, decode_datetime(reinterpret_cast(block.rodata() + 36))); + results.set(meta_name::creation_date, decode_datetime(reinterpret_cast(block->rodata() + 36))); return results; } @@ -324,7 +324,7 @@ std::pair> impl::file_read(const std::vect // impl::read_sector //------------------------------------------------- -fsblk_t::block_t impl::read_sector(u32 sector) const +fsblk_t::block_t::ptr impl::read_sector(u32 sector) const { return m_blockdev.get(sector); } @@ -359,10 +359,10 @@ std::optional impl::dirent_from_path(const std::vector &callback) const { - fsblk_t::block_t block = m_blockdev.get(0); - block_iterator iter(*this, block.r32b(8), block.r32b(16)); + fsblk_t::block_t::ptr block = m_blockdev.get(0); + block_iterator iter(*this, block->r32b(8), block->r32b(16)); - if (block.r16b(0) != 0x8000) + if (block->r16b(0) != 0x8000) { return; } @@ -461,7 +461,7 @@ bool impl::block_iterator::next() const void *impl::block_iterator::data() const { - return m_block.rodata(); + return m_block->rodata(); } //------------------------------------------------- @@ -471,19 +471,19 @@ const void *impl::block_iterator::data() const std::error_condition impl::format(const meta_data &meta) { std::string volume_name = meta.get_string(meta_name::name, "B9826 "); - fsblk_t::block_t block = m_blockdev.get(0); + fsblk_t::block_t::ptr block = m_blockdev.get(0); if (volume_name.size() < 6) volume_name.insert(volume_name.end(), 6 - volume_name.size(), ' '); if (volume_name.size() > 6) volume_name.resize(6); - block.w16b(0, 0x8000); // LIF magic - block.wstr(2, volume_name); - block.w32b(8, 2); // directory start - block.w16b(12, 0x1000); // LIF identifier - block.w32b(16, 14); // directory size - block.w16b(20, 1); // LIF version + block->w16b(0, 0x8000); // LIF magic + block->wstr(2, volume_name); + block->w32b(8, 2); // directory start + block->w16b(12, 0x1000); // LIF identifier + block->w32b(16, 14); // directory size + block->w16b(20, 1); // LIF version return std::error_condition(); } @@ -493,7 +493,7 @@ std::error_condition impl::format(const meta_data &meta) const std::array &impl::block_iterator::dirent_data() const { - return *reinterpret_cast *>(m_block.rodata()); + return *reinterpret_cast *>(m_block->rodata()); } } // anonymous namespace diff --git a/src/lib/formats/fs_isis.cpp b/src/lib/formats/fs_isis.cpp index e26ab9a529be9..fb79314a36085 100644 --- a/src/lib/formats/fs_isis.cpp +++ b/src/lib/formats/fs_isis.cpp @@ -786,14 +786,14 @@ isis_impl::lba_list isis_impl::get_file_allocation(lba_t first_link, unsigned si res.push_back(curr_map); // Get a linkage block auto map_sect = m_blockdev.get(curr_map); - auto prev_ptr = lba_from_2b(map_sect , 0); - auto next_ptr = lba_from_2b(map_sect , 2); + auto prev_ptr = lba_from_2b(*map_sect , 0); + auto next_ptr = lba_from_2b(*map_sect , 2); if (prev_lba != prev_ptr) { throw std::runtime_error(util::string_format("Incorrect backward linking in sector %d", curr_map)); } // Scan all pointers in linkage block for (u32 i = 4; i < SECTOR_SIZE; i += 2) { - auto ptr = lba_from_2b(map_sect , i); + auto ptr = lba_from_2b(*map_sect , i); if (size > 0) { if (ptr < 0) { throw std::runtime_error(util::string_format("Unexpected end of pointer list in sector %d", curr_map)); @@ -839,7 +839,7 @@ std::vector isis_impl::get_file_content(const lba_list& sects, unsigned size if ((idx % (PTRS_PER_BLOCK + 1)) != 0) { unsigned to_copy = std::min(size, SECTOR_SIZE); auto data_sect = m_blockdev.get(sects[ idx ]); - memcpy(res.data() + pos, data_sect.rodata(), to_copy); + data_sect->read(0, res.data() + pos, to_copy); size -= to_copy; pos += to_copy; } @@ -856,7 +856,7 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& lba_t link_lba = sects[ idx ]; auto blk = m_blockdev.get(link_lba); // Pointer to previous block - lba_to_2b(prev_ptr, blk, 0); + lba_to_2b(prev_ptr, *blk, 0); prev_ptr = link_lba; lba_t next_ptr; if (sects.size() - idx > (PTRS_PER_BLOCK + 1)) { @@ -867,10 +867,10 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& next_ptr = -1; } // Pointer to next block - lba_to_2b(next_ptr, blk, 2); + lba_to_2b(next_ptr, *blk, 2); // Pointers to data blocks for (unsigned j = 0; j < PTRS_PER_BLOCK; j++) { - lba_to_2b((j + idx + 1 < sects.size()) ? sects[ j + idx + 1 ] : -1, blk, 4 + 2 * j); + lba_to_2b((j + idx + 1 < sects.size()) ? sects[ j + idx + 1 ] : -1, *blk, 4 + 2 * j); } } // Write data blocks @@ -883,7 +883,7 @@ void isis_impl::store_file_content(const lba_list& sects, const std::vector& } u32 count = std::min(to_go, SECTOR_SIZE); auto blk = m_blockdev.get(sects[ idx ]); - blk.copy(0, ptr, count); + blk->write(0, ptr, count); ptr += count; to_go -= count; } diff --git a/src/lib/formats/fs_oric_jasmin.cpp b/src/lib/formats/fs_oric_jasmin.cpp index 2e25d5e00708d..db24a4a93f828 100644 --- a/src/lib/formats/fs_oric_jasmin.cpp +++ b/src/lib/formats/fs_oric_jasmin.cpp @@ -88,7 +88,7 @@ class oric_jasmin_impl : public filesystem_t { static std::string file_name_prepare(std::string name); static bool file_is_system(const u8 *entry); meta_data file_metadata(const u8 *entry); - std::tuple file_find(std::string name); + std::tuple file_find(std::string name); }; } @@ -201,33 +201,33 @@ std::error_condition oric_jasmin_impl::format(const meta_data &meta) std::string volume_name = meta.get_string(meta_name::name, "UNTITLED"); u32 blocks = m_blockdev.block_count(); - m_blockdev.fill(0x6c); + m_blockdev.fill_all(0x6c); u32 bblk = 20*17; auto fmap = m_blockdev.get(bblk); u32 off = 0; for(u32 blk = 0; blk != blocks; blk += 17) { if(blk == bblk) - fmap.w24l(off, 0x07fff); + fmap->w24l(off, 0x07fff); else - fmap.w24l(off, 0x1ffff); + fmap->w24l(off, 0x1ffff); off += 3; } for(u32 blk = blocks; blk != 17*42*2; blk += 17) { - fmap.w24l(off, 0x800000); + fmap->w24l(off, 0x800000); off += 3; } - fmap.w8(0xf6, 0x80); - fmap.w8(0xf7, 0x80); + fmap->w8(0xf6, 0x80); + fmap->w8(0xf7, 0x80); volume_name.resize(8, ' '); - fmap.wstr(0xf8, volume_name); + fmap->wstr(0xf8, volume_name); auto bdir = m_blockdev.get(20*17+1); - bdir.fill(0xff); - bdir.w16l(0, 0x0000); - bdir.w16l(2, 0x0000); + bdir->fill(0xff); + bdir->w16l(0, 0x0000); + bdir->w16l(2, 0x0000); return std::error_condition(); } @@ -237,10 +237,10 @@ meta_data oric_jasmin_impl::volume_metadata() meta_data res; auto bdir = m_blockdev.get(20*17); int len = 8; - while(len > 0 && bdir.rodata()[0xf8 + len - 1] == ' ') + while(len > 0 && bdir->rodata()[0xf8 + len - 1] == ' ') len--; - res.set(meta_name::name, bdir.rstr(0xf8, len)); + res.set(meta_name::name, bdir->rstr(0xf8, len)); return res; } @@ -249,7 +249,7 @@ std::error_condition oric_jasmin_impl::volume_metadata_change(const meta_data &m if(meta.has(meta_name::name)) { std::string volume_name = meta.get_string(meta_name::name); volume_name.resize(8, ' '); - m_blockdev.get(20*17).wstr(0xf8, volume_name); + m_blockdev.get(20*17)->wstr(0xf8, volume_name); } return std::error_condition(); } @@ -315,28 +315,28 @@ meta_data oric_jasmin_impl::file_metadata(const u8 *entry) else { u16 ref = get_u16be(entry); auto dblk = m_blockdev.get(cs_to_block(ref)); - res.set(meta_name::loading_address, dblk.r16l(2)); - res.set(meta_name::length, dblk.r16l(4)); + res.set(meta_name::loading_address, dblk->r16l(2)); + res.set(meta_name::length, dblk->r16l(4)); } return res; } -std::tuple oric_jasmin_impl::file_find(std::string name) +std::tuple oric_jasmin_impl::file_find(std::string name) { name = file_name_prepare(name); auto bdir = m_blockdev.get(20*17+1); for(;;) { for(u32 i = 0; i != 14; i ++) { u32 off = 4 + i*18; - u16 fref = bdir.r16b(off); - if(ref_valid(fref) || file_is_system(bdir.rodata()+off)) { - if(memcmp(bdir.rodata() + off + 3, name.data(), 12)) { - bool sys = file_is_system(bdir.rodata() + off); + u16 fref = bdir->r16b(off); + if(ref_valid(fref) || file_is_system(bdir->rodata()+off)) { + if(memcmp(bdir->rodata() + off + 3, name.data(), 12)) { + bool sys = file_is_system(bdir->rodata() + off); return std::make_tuple(bdir, off, sys); } } } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) return std::make_tuple(bdir, 0U, false); @@ -354,7 +354,7 @@ std::pair oric_jasmin_impl::metadata(const std: if(!off) return std::make_pair(error::not_found, meta_data()); - return std::make_pair(std::error_condition(), file_metadata(bdir.rodata() + off)); + return std::make_pair(std::error_condition(), file_metadata(bdir->rodata() + off)); } std::error_condition oric_jasmin_impl::metadata_change(const std::vector &path, const meta_data &meta) @@ -366,7 +366,7 @@ std::error_condition oric_jasmin_impl::metadata_change(const std::vectordata() + off; if(meta.has(meta_name::locked)) entry[0x02] = meta.get_flag(meta_name::locked) ? 'L' : 'U'; if(meta.has(meta_name::name)) @@ -374,7 +374,7 @@ std::error_condition oric_jasmin_impl::metadata_change(const std::vectorw16l(2, meta.get_number(meta_name::loading_address)); return std::error_condition(); } @@ -394,13 +394,13 @@ std::pair> oric_jasmin_impl::direct for(;;) { for(u32 i = 0; i != 14; i ++) { u32 off = 4 + i*18; - u16 fref = bdir.r16b(off); - if(ref_valid(fref) || file_is_system(bdir.rodata()+off)) { - meta_data meta = file_metadata(bdir.rodata()+off); + u16 fref = bdir->r16b(off); + if(ref_valid(fref) || file_is_system(bdir->rodata()+off)) { + meta_data meta = file_metadata(bdir->rodata()+off); res.second.emplace_back(dir_entry(dir_entry_type::file, meta)); } } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) break; bdir = m_blockdev.get(cs_to_block(ref)); @@ -418,7 +418,7 @@ std::error_condition oric_jasmin_impl::rename(const std::vector &op if(!off) return error::not_found; - wstr(bdir.data() + off + 0x03, file_name_prepare(npath[0])); + wstr(bdir->data() + off + 0x03, file_name_prepare(npath[0])); return std::error_condition(); } @@ -442,12 +442,12 @@ std::error_condition oric_jasmin_impl::file_create(const std::vectorr16b(off); if(!ref_valid(ref)) goto found; id++; } - u16 ref = bdir.r16b(2); + u16 ref = bdir->r16b(2); if(!ref || !ref_valid(ref)) { nb ++; break; @@ -460,25 +460,25 @@ std::error_condition oric_jasmin_impl::file_create(const std::vectorw16b(0, 0xff00); // Next sector + sblk->w16l(2, meta.get_number(meta_name::loading_address, 0x500)); + sblk->w16l(4, 0); // Length + sblk->w16b(6, block[1]); // Data block if(nb == 3) { - bdir.w16l(0, block[2]); // Link to the next directory sector + bdir->w16l(0, block[2]); // Link to the next directory sector bdir = m_blockdev.get(cs_to_block(block[2])); - bdir.fill(0xff); - bdir.w16l(0, block[2]); // Reference to itself - bdir.w16l(2, 0xff00); // No next directory sector + bdir->fill(0xff); + bdir->w16l(0, block[2]); // Reference to itself + bdir->w16l(2, 0xff00); // No next directory sector } u32 off = 4 + (id % 14) * 18; - bdir.w16b(off+0x00, block[0]); // First (and only) sector in the sector list - bdir.w8 (off+0x02, meta.get_flag(meta_name::locked, false) ? 'L' : 'U'); - bdir.wstr(off+0x03, file_name_prepare(meta.get_string(meta_name::name, ""))); - bdir.w8 (off+0x0f, meta.get_flag(meta_name::sequential, true) ? 'S' : 'D'); - bdir.w16l(off+0x10, 2); // 2 sectors for an empty file + bdir->w16b(off+0x00, block[0]); // First (and only) sector in the sector list + bdir->w8 (off+0x02, meta.get_flag(meta_name::locked, false) ? 'L' : 'U'); + bdir->wstr(off+0x03, file_name_prepare(meta.get_string(meta_name::name, ""))); + bdir->w8 (off+0x0f, meta.get_flag(meta_name::sequential, true) ? 'S' : 'D'); + bdir->w16l(off+0x10, 2); // 2 sectors for an empty file return std::error_condition(); } @@ -498,27 +498,27 @@ std::pair> oric_jasmin_impl::file_read(con data.resize(0x3e00); for(u32 i = 0; i != 62; i++) { auto dblk = m_blockdev.get(i); - memcpy(data.data() + 256 * i, dblk.rodata(), 256); + dblk->read(0, data.data() + 256 * i, 256); } } else { - const u8 *entry = bdir.rodata() + off; + const u8 *entry = bdir->rodata() + off; u16 ref = get_u16be(entry); auto iblk = m_blockdev.get(cs_to_block(ref)); - u32 length = iblk.r16l(4); + u32 length = iblk->r16l(4); while(ref_valid(ref)) { for(u32 pos = 6; pos != 256 && data.size() < length; pos += 2) { - u16 dref = iblk.r16b(pos); + u16 dref = iblk->r16b(pos); if(!ref_valid(dref)) goto done; auto dblk = m_blockdev.get(cs_to_block(dref)); u32 dpos = data.size(); data.resize(dpos + 256); - memcpy(data.data() + dpos, dblk.rodata(), 256); + dblk->read(0, data.data() + dpos, 256); if(data.size() >= length) goto done; } - ref = iblk.r16b(2); + ref = iblk->r16b(2); if(!ref_valid(ref)) break; iblk = m_blockdev.get(cs_to_block(ref)); @@ -544,10 +544,10 @@ std::error_condition oric_jasmin_impl::file_write(const std::vector return error::incorrect_size; for(u32 i=0; i != 0x3e; i++) - m_blockdev.get(i).copy(0, data.data() + i * 256, 256); + m_blockdev.get(i)->write(0, data.data() + i * 256, 256); } else { - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; u32 cur_ns = get_u16le(entry + 0x10); // Data sectors first u32 need_ns = (data.size() + 255) / 256; @@ -566,37 +566,37 @@ std::error_condition oric_jasmin_impl::file_write(const std::vector for(u32 i=0; i < cur_ns; i += 125+1) { auto iblk = m_blockdev.get(cs_to_block(iref)); if(!i) - load_address = iblk.r16l(2); + load_address = iblk->r16l(2); tofree.push_back(iref); for(u32 j=0; j != 125 && i+j+1 != cur_ns; j++) - tofree.push_back(iblk.r16b(6+2*j)); - iref = iblk.r16b(2); + tofree.push_back(iblk->r16b(6+2*j)); + iref = iblk->r16b(2); } free_blocks(tofree); std::vector blocks = allocate_blocks(need_ns); for(u32 i=0; i < need_ns; i += 125+1) { auto iblk = m_blockdev.get(cs_to_block(blocks[i])); - iblk.fill(0xff); + iblk->fill(0xff); if(!i) { - iblk.w16l(2, load_address); - iblk.w16l(4, data.size()); + iblk->w16l(2, load_address); + iblk->w16l(4, data.size()); } if(i + 126 < need_ns) - iblk.w16b(0, blocks[i+126]); + iblk->w16b(0, blocks[i+126]); else - iblk.w16b(0, 0xff00); + iblk->w16b(0, 0xff00); for(u32 j=0; j != 125 && i+j+1 != need_ns; j++) { u32 dpos = 256 * (j + i/126*125); u32 size = data.size() - dpos; - iblk.w16b(6+j*2, blocks[i+j+1]); + iblk->w16b(6+j*2, blocks[i+j+1]); auto dblk = m_blockdev.get(cs_to_block(blocks[i+j+1])); if(size >= 256) - dblk.copy(0, data.data() + dpos, 256); + dblk->write(0, data.data() + dpos, 256); else { - dblk.copy(0, data.data() + dpos, size); - dblk.fill(size, 0x55, 256-size); + dblk->write(0, data.data() + dpos, size); + dblk->fill(size, 0x55, 256-size); } } } @@ -615,7 +615,7 @@ std::vector oric_jasmin_impl::allocate_blocks(u32 count) auto fmap = m_blockdev.get(20*17); u32 nf = 0; for(u32 track = 0; track != 2*41 && nf != count; track++) { - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map != 0x800000) { for(u32 sect = 1; sect <= 17 && nf != count; sect++) if(map & (0x20000 >> sect)) { @@ -625,7 +625,7 @@ std::vector oric_jasmin_impl::allocate_blocks(u32 count) } if(!map) map = 0x800000; - fmap.w24l(track*3, map); + fmap->w24l(track*3, map); } } return blocks; @@ -637,11 +637,11 @@ void oric_jasmin_impl::free_blocks(const std::vector &blocks) for(u16 ref : blocks) { u32 track = ref >> 8; u32 sect = ref & 0xff; - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map == 0x800000) map = 0; map |= 0x20000 >> sect; - fmap.w24l(track*3, map); + fmap->w24l(track*3, map); } } @@ -650,7 +650,7 @@ u32 oric_jasmin_impl::free_block_count() auto fmap = m_blockdev.get(20*17); u32 nf = 0; for(u32 track = 0; track != 2*41; track++) { - u32 map = fmap.r24l(track*3); + u32 map = fmap->r24l(track*3); if(map != 0x800000) { for(u32 sect = 1; sect <= 17; sect++) if(map & (0x20000 >> sect)) diff --git a/src/lib/formats/fs_prodos.cpp b/src/lib/formats/fs_prodos.cpp index 9b7a91f16154e..f7c77d47ff823 100644 --- a/src/lib/formats/fs_prodos.cpp +++ b/src/lib/formats/fs_prodos.cpp @@ -39,8 +39,8 @@ class prodos_impl : public filesystem_t { static const u8 boot[512]; static util::arbitrary_datetime prodos_to_dt(u32 date); - std::tuple path_find_step(const std::string &name, u16 block); - std::tuple path_find(const std::vector &path); + std::tuple path_find_step(const std::string &name, u16 block); + std::tuple path_find(const std::vector &path); std::pair> any_read(u8 type, u16 block, u32 length); }; } @@ -219,36 +219,36 @@ std::error_condition prodos_impl::format(const meta_data &meta) if(blocks >= 0x10000) blocks = 0xffff; - m_blockdev.get(0).copy(0x000, boot, 0x200); // Standard ProDOS boot sector as written by a 2gs - m_blockdev.get(1).fill(0x00); // No SOS boot sector + m_blockdev.get(0)->write(0x000, boot, 0x200); // Standard ProDOS boot sector as written by a 2gs + m_blockdev.get(1)->fill(0x00); // No SOS boot sector auto kblk1 = m_blockdev.get(2); // key block first block auto kblk2 = m_blockdev.get(3); // key block second block auto kblk3 = m_blockdev.get(4); // key block third block auto kblk4 = m_blockdev.get(5); // key block fourth block - kblk1.w16l(0x00, 0x0000); // Backwards key block pointer (null) - kblk1.w16l(0x02, 0x0003); // Forwards key block pointer - kblk1.w8 (0x04, 0xf0 | volume_name.size()); // Block type (f, key block) and name size - kblk1.wstr(0x05, volume_name); // Volume name, up to 15 characters - kblk1.w32b(0x16, 0x642a250d); // ??? date & time - kblk1.w16b(0x1a, 0x80ff); // ??? - kblk1.w32b(0x1c, 0x642a250d); // Creation date & time - kblk1.w8 (0x20, 0x05); // ProDOS version (2gs) - kblk1.w8 (0x21, 0x00); // ProDOS minimum version - kblk1.w8 (0x22, 0xc3); // Allowed access (destroy, rename, !backup, 3x0, write read) - kblk1.w8 (0x23, 0x27); // Directory entry length (fixed) - kblk1.w8 (0x24, 0x0d); // Entries per block (fixed) - kblk1.w16l(0x25, 0x0000); // Number of file entries in the directory - kblk1.w16l(0x27, 0x0006); // Bitmap block pointer - kblk1.w16l(0x29, blocks); // Number of blocks - - kblk2.w16l(0x00, 0x0002); // Backwards block pointer of the second volume block - kblk2.w16l(0x02, 0x0004); // Forwards block pointer of the second volume block - kblk3.w16l(0x00, 0x0003); // Backwards block pointer of the third volume block - kblk3.w16l(0x02, 0x0005); // Forwards block pointer of the third volume block - kblk4.w16l(0x00, 0x0004); // Backwards block pointer of the fourth volume block - kblk4.w16l(0x02, 0x0000); // Forwards block pointer of the fourth volume block (null) + kblk1->w16l(0x00, 0x0000); // Backwards key block pointer (null) + kblk1->w16l(0x02, 0x0003); // Forwards key block pointer + kblk1->w8 (0x04, 0xf0 | volume_name.size()); // Block type (f, key block) and name size + kblk1->wstr(0x05, volume_name); // Volume name, up to 15 characters + kblk1->w32b(0x16, 0x642a250d); // ??? date & time + kblk1->w16b(0x1a, 0x80ff); // ??? + kblk1->w32b(0x1c, 0x642a250d); // Creation date & time + kblk1->w8 (0x20, 0x05); // ProDOS version (2gs) + kblk1->w8 (0x21, 0x00); // ProDOS minimum version + kblk1->w8 (0x22, 0xc3); // Allowed access (destroy, rename, !backup, 3x0, write read) + kblk1->w8 (0x23, 0x27); // Directory entry length (fixed) + kblk1->w8 (0x24, 0x0d); // Entries per block (fixed) + kblk1->w16l(0x25, 0x0000); // Number of file entries in the directory + kblk1->w16l(0x27, 0x0006); // Bitmap block pointer + kblk1->w16l(0x29, blocks); // Number of blocks + + kblk2->w16l(0x00, 0x0002); // Backwards block pointer of the second volume block + kblk2->w16l(0x02, 0x0004); // Forwards block pointer of the second volume block + kblk3->w16l(0x00, 0x0003); // Backwards block pointer of the third volume block + kblk3->w16l(0x02, 0x0005); // Forwards block pointer of the third volume block + kblk4->w16l(0x00, 0x0004); // Backwards block pointer of the fourth volume block + kblk4->w16l(0x02, 0x0000); // Forwards block pointer of the fourth volume block (null) u32 fmap_block_count = (blocks + 4095) / 4096; u32 first_free_block = 6 + fmap_block_count; @@ -256,7 +256,7 @@ std::error_condition prodos_impl::format(const meta_data &meta) // Mark blocks from first_free_block to blocks-1 (the last one) as free for(u32 i = 0; i != fmap_block_count; i++) { auto fmap = m_blockdev.get(6 + i); - u8 *fdata = fmap.data(); + u8 *fdata = fmap->data(); u32 start = i ? 0 : first_free_block; u32 end = i != fmap_block_count - 1 ? 4095 : (blocks - 1) & 4095; end += 1; @@ -300,12 +300,12 @@ meta_data prodos_impl::volume_metadata() { meta_data res; auto bdir = m_blockdev.get(2); - int len = bdir.r8(0x04) & 0xf; - res.set(meta_name::name, bdir.rstr(0x05, len)); - res.set(meta_name::os_version, bdir.r8(0x20)); - res.set(meta_name::os_minimum_version, bdir.r8(0x21)); - res.set(meta_name::creation_date, prodos_to_dt(bdir.r32l(0x1c))); - res.set(meta_name::modification_date, prodos_to_dt(bdir.r32l(0x16))); + int len = bdir->r8(0x04) & 0xf; + res.set(meta_name::name, bdir->rstr(0x05, len)); + res.set(meta_name::os_version, bdir->r8(0x20)); + res.set(meta_name::os_minimum_version, bdir->r8(0x21)); + res.set(meta_name::creation_date, prodos_to_dt(bdir->r32l(0x1c))); + res.set(meta_name::modification_date, prodos_to_dt(bdir->r32l(0x16))); return res; } @@ -319,7 +319,7 @@ std::pair> prodos_impl::directory_c auto [blk, off, dir] = path_find(path); if(!off || !dir) return std::make_pair(error::not_found, std::vector()); - block = blk.r16l(off+0x11); + block = blk->r16l(off+0x11); } std::vector res; @@ -327,57 +327,57 @@ std::pair> prodos_impl::directory_c do { auto blk = m_blockdev.get(block); for(u32 off = 4; off < 511; off += 39) { - u8 type = blk.r8(off); + u8 type = blk->r8(off); // skip inactive entries and subroutine/volume headers if(type != 0 && type < 0xe0) { meta_data meta; - meta.set(meta_name::name, blk.rstr(off+1, type & 0xf)); + meta.set(meta_name::name, blk->rstr(off+1, type & 0xf)); type >>= 4; if(type == 5) { - auto rootblk = m_blockdev.get(blk.r16l(off+0x11)); - meta.set(meta_name::length, rootblk.r24l(0x005)); - meta.set(meta_name::rsrc_length, rootblk.r24l(0x105)); + auto rootblk = m_blockdev.get(blk->r16l(off+0x11)); + meta.set(meta_name::length, rootblk->r24l(0x005)); + meta.set(meta_name::rsrc_length, rootblk->r24l(0x105)); } else if(type >= 1 && type <= 3) { - meta.set(meta_name::length, blk.r24l(off + 0x15)); - meta.set(meta_name::file_type, file_type_to_string(blk.r8(off + 0x10))); + meta.set(meta_name::length, blk->r24l(off + 0x15)); + meta.set(meta_name::file_type, file_type_to_string(blk->r8(off + 0x10))); } - meta.set(meta_name::os_version, blk.r8(off + 0x1c)); - meta.set(meta_name::os_minimum_version, blk.r8(off + 0x1d)); - meta.set(meta_name::creation_date, prodos_to_dt(blk.r32l(off + 0x18))); - meta.set(meta_name::modification_date, prodos_to_dt(blk.r32l(off + 0x21))); + meta.set(meta_name::os_version, blk->r8(off + 0x1c)); + meta.set(meta_name::os_minimum_version, blk->r8(off + 0x1d)); + meta.set(meta_name::creation_date, prodos_to_dt(blk->r32l(off + 0x18))); + meta.set(meta_name::modification_date, prodos_to_dt(blk->r32l(off + 0x21))); res.emplace_back(dir_entry(type == 0xd ? dir_entry_type::dir : dir_entry_type::file, meta)); } } - block = blk.r16l(2); + block = blk->r16l(2); if(block >= m_blockdev.block_count()) break; } while(block); return std::make_pair(std::error_condition(), res); } -std::tuple prodos_impl::path_find_step(const std::string &name, u16 block) +std::tuple prodos_impl::path_find_step(const std::string &name, u16 block) { for(;;) { auto blk = m_blockdev.get(block); for(u32 off = 4; off < 511; off += 39) { - u8 type = blk.r8(off); - if(type != 0 && type < 0xe0 && name == blk.rstr(off+1, type & 0xf)) + u8 type = blk->r8(off); + if(type != 0 && type < 0xe0 && name == blk->rstr(off+1, type & 0xf)) return std::make_tuple(blk, off); } - block = blk.r16l(2); + block = blk->r16l(2); if(!block || block >= m_blockdev.block_count()) return std::make_tuple(blk, 0U); } } -std::tuple prodos_impl::path_find(const std::vector &path) +std::tuple prodos_impl::path_find(const std::vector &path) { if(path.size() == 0) - return std::tuple(fsblk_t::block_t(), 0, false); + return std::tuple(fsblk_t::block_t::ptr(), 0, false); u16 block = 2; for(u32 pathc = 0;; pathc++) { @@ -386,12 +386,12 @@ std::tuple prodos_impl::path_find(const std::vector return std::make_tuple(blk, off, false); if(pathc + 1 == path.size()) - return std::make_tuple(blk, off, (blk.r8(off) & 0xf0) == 0xd0); + return std::make_tuple(blk, off, (blk->r8(off) & 0xf0) == 0xd0); - if((blk.r8(off) & 0xf0) != 0xd0) + if((blk->r8(off) & 0xf0) != 0xd0) return std::make_tuple(blk, 0U, false); - block = blk.r16l(off + 0x11); + block = blk->r16l(off + 0x11); } } @@ -406,7 +406,7 @@ std::pair prodos_impl::metadata(const std::vect if(!off) return std::make_pair(error::not_found, meta_data()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; meta_data res; if(dir) { @@ -420,8 +420,8 @@ std::pair prodos_impl::metadata(const std::vect res.set(meta_name::name, name); if(type == 5) { auto rootblk = m_blockdev.get(get_u16le(entry+0x11)); - res.set(meta_name::length, rootblk.r24l(0x005)); - res.set(meta_name::rsrc_length, rootblk.r24l(0x105)); + res.set(meta_name::length, rootblk->r24l(0x005)); + res.set(meta_name::rsrc_length, rootblk->r24l(0x105)); } else if(type >= 1 && type <= 3) res.set(meta_name::length, get_u24le(entry + 0x15)); @@ -446,15 +446,15 @@ std::pair> prodos_impl::any_read(u8 type, u8 *end = dst + data.second.size(); switch(type) { case 1: - memcpy(dst, m_blockdev.get(block).rodata(), 512); + m_blockdev.get(block)->read(0, dst, 512); dst += 512; break; case 2: { auto iblk = m_blockdev.get(block); for(u32 i=0; i != 256 && dst != end; i++) { - u16 blk = iblk.r8(i) | (iblk.r8(i | 0x100) << 8); - memcpy(dst, m_blockdev.get(blk).rodata(), 512); + u16 blk = iblk->r8(i) | (iblk->r8(i | 0x100) << 8); + m_blockdev.get(blk)->read(0, dst, 512); dst += 512; } break; @@ -464,10 +464,10 @@ std::pair> prodos_impl::any_read(u8 type, auto mblk = m_blockdev.get(block); for(u32 j=0; dst != end; j += 256) { u32 idx = j/256; - auto iblk = m_blockdev.get(mblk.r8(idx) | (mblk.r8(idx | 0x100) << 8)); + auto iblk = m_blockdev.get(mblk->r8(idx) | (mblk->r8(idx | 0x100) << 8)); for(u32 i=0; i != 256 && dst != end; i++) { - u16 blk = iblk.r8(i) | (iblk.r8(i | 0x100) << 8); - memcpy(dst, m_blockdev.get(blk).rodata(), 512); + u16 blk = iblk->r8(i) | (iblk->r8(i | 0x100) << 8); + m_blockdev.get(blk)->read(0, dst, 512); dst += 512; } } @@ -490,7 +490,7 @@ std::pair> prodos_impl::file_read(const st if(!off || dir) return std::make_pair(error::not_found, std::vector()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; u8 type = entry[0] >> 4; if(type >= 1 && type <= 3) @@ -498,7 +498,7 @@ std::pair> prodos_impl::file_read(const st else if(type == 5) { auto kblk = m_blockdev.get(get_u16le(entry+0x11)); - return any_read(kblk.r8(0x000), kblk.r16l(0x001), kblk.r24l(0x005)); + return any_read(kblk->r8(0x000), kblk->r16l(0x001), kblk->r24l(0x005)); } else return std::make_pair(error::unsupported, std::vector()); @@ -510,12 +510,12 @@ std::pair> prodos_impl::file_rsrc_read(con if(!off || dir) return std::make_pair(error::not_found, std::vector()); - const u8 *entry = blk.rodata() + off; + const u8 *entry = blk->rodata() + off; u8 type = entry[0] >> 4; if(type == 5) { auto kblk = m_blockdev.get(get_u16le(entry+0x11)); - return any_read(kblk.r8(0x100), kblk.r16l(0x101), kblk.r24l(0x105)); + return any_read(kblk->r8(0x100), kblk->r16l(0x101), kblk->r24l(0x105)); } else return std::make_pair(error::unsupported, std::vector()); diff --git a/src/lib/formats/fs_vtech.cpp b/src/lib/formats/fs_vtech.cpp index 39e116a7ed852..163b2ae6d5351 100644 --- a/src/lib/formats/fs_vtech.cpp +++ b/src/lib/formats/fs_vtech.cpp @@ -55,7 +55,7 @@ class vtech_impl : public filesystem_t { private: meta_data file_metadata(const u8 *entry); - std::tuple file_find(std::string_view name); + std::tuple file_find(std::string_view name); std::vector> allocate_blocks(u32 count); void free_blocks(const std::vector> &blocks); u32 free_block_count(); @@ -126,7 +126,7 @@ vtech_impl::vtech_impl(fsblk_t &blockdev) : filesystem_t(blockdev, 128) std::error_condition vtech_impl::format(const meta_data &meta) { - m_blockdev.fill(0); + m_blockdev.fill_all(0); return std::error_condition(); } @@ -152,23 +152,23 @@ meta_data vtech_impl::file_metadata(const u8 *entry) return res; } -std::tuple vtech_impl::file_find(std::string_view name) +std::tuple vtech_impl::file_find(std::string_view name) { for(int sect = 0; sect != 14; sect++) { auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 8; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type < 'A' || type > 'Z') continue; - if(bdir.r8(off+1) != ':') + if(bdir->r8(off+1) != ':') continue; - if(trim_end_spaces(bdir.rstr(off+2, 8)) == name) { + if(trim_end_spaces(bdir->rstr(off+2, 8)) == name) { return std::make_tuple(bdir, off); } } } - return std::make_tuple(fsblk_t::block_t(), 0xffffffff); + return std::make_tuple(fsblk_t::block_t::ptr(), 0xffffffff); } std::pair vtech_impl::metadata(const std::vector &path) @@ -180,7 +180,7 @@ std::pair vtech_impl::metadata(const std::vecto if(off == 0xffffffff) return std::make_pair(error::not_found, meta_data()); - return std::make_pair(std::error_condition(), file_metadata(bdir.rodata() + off)); + return std::make_pair(std::error_condition(), file_metadata(bdir->rodata() + off)); } std::error_condition vtech_impl::metadata_change(const std::vector &path, const meta_data &meta) @@ -192,7 +192,7 @@ std::error_condition vtech_impl::metadata_change(const std::vector if(off == 0xffffffff) return error::not_found; - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; if(meta.has(meta_name::file_type)) entry[0x0] = meta.get_string(meta_name::file_type)[0]; if(meta.has(meta_name::name)) { @@ -225,12 +225,12 @@ std::pair> vtech_impl::directory_co auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 8; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type < 'A' || type > 'Z') continue; - if(bdir.r8(off+1) != ':') + if(bdir->r8(off+1) != ':') continue; - meta_data meta = file_metadata(bdir.rodata()+off); + meta_data meta = file_metadata(bdir->rodata()+off); res.second.emplace_back(dir_entry(dir_entry_type::file, meta)); } } @@ -248,7 +248,7 @@ std::error_condition vtech_impl::rename(const std::vector &opath, c std::string name = npath[0]; name.resize(8, ' '); - wstr(bdir.data() + off + 2, name); + wstr(bdir->data() + off + 2, name); return std::error_condition(); } @@ -269,18 +269,18 @@ std::error_condition vtech_impl::file_create(const std::vector &pat auto bdir = m_blockdev.get(sect); for(u32 i = 0; i != 16; i ++) { u32 off = i*16; - u8 type = bdir.r8(off); + u8 type = bdir->r8(off); if(type != 'T' && type != 'B') { std::string fname = meta.get_string(meta_name::name, ""); fname.resize(8, ' '); - bdir.w8 (off+0x0, meta.get_string(meta_name::file_type, "T")[0]); - bdir.w8 (off+0x1, ':'); - bdir.wstr(off+0x2, fname); - bdir.w8 (off+0xa, 0x00); - bdir.w8 (off+0xb, 0x00); - bdir.w16l(off+0xc, meta.get_number(meta_name::loading_address, 0x7ae9)); - bdir.w16l(off+0xe, bdir.r16l(off+0xc)); // Size 0 initially + bdir->w8 (off+0x0, meta.get_string(meta_name::file_type, "T")[0]); + bdir->w8 (off+0x1, ':'); + bdir->wstr(off+0x2, fname); + bdir->w8 (off+0xa, 0x00); + bdir->w8 (off+0xb, 0x00); + bdir->w16l(off+0xc, meta.get_number(meta_name::loading_address, 0x7ae9)); + bdir->w16l(off+0xe, bdir->r16l(off+0xc)); // Size 0 initially return std::error_condition(); } } @@ -299,7 +299,7 @@ std::pair> vtech_impl::file_read(const std if(off == 0xffffffff) return std::make_pair(error::not_found, data); - const u8 *entry = bdir.rodata() + off; + const u8 *entry = bdir->rodata() + off; u8 track = entry[0xa]; u8 sector = entry[0xb]; @@ -314,10 +314,10 @@ std::pair> vtech_impl::file_read(const std int size = len - pos; if(size > 126) size = 126; - memcpy(data.data() + pos, dblk.data(), size); + dblk->read(0, data.data() + pos, size); pos += size; - track = dblk.r8(126); - sector = dblk.r8(127); + track = dblk->r8(126); + sector = dblk->r8(127); } return std::make_pair(std::error_condition(), data); } @@ -331,7 +331,7 @@ std::error_condition vtech_impl::file_write(const std::vector &path if(off == 0xffffffff) return error::not_found; - u8 *entry = bdir.data() + off; + u8 *entry = bdir->data() + off; u32 cur_len = (get_u16le(entry + 0xe) - get_u16le(entry + 0xc)) & 0xffff; u32 new_len = data.size(); @@ -350,8 +350,8 @@ std::error_condition vtech_impl::file_write(const std::vector &path for(u32 i = 0; i != cur_ns; i++) { tofree.emplace_back(std::make_pair(track, sector)); auto dblk = m_blockdev.get(track*16 + sector); - track = dblk.r8(126); - sector = dblk.r8(127); + track = dblk->r8(126); + sector = dblk->r8(127); } free_blocks(tofree); @@ -363,13 +363,13 @@ std::error_condition vtech_impl::file_write(const std::vector &path if(len > 126) len = 126; else if(len < 126) - dblk.fill(0x00); - memcpy(dblk.data(), data.data() + 126*i, len); + dblk->fill(0x00); + dblk->write(0, data.data() + 126*i, len); if(i < need_ns) { - dblk.w8(126, blocks[i+1].first); - dblk.w8(127, blocks[i+1].second); + dblk->w8(126, blocks[i+1].first); + dblk->w8(127, blocks[i+1].second); } else - dblk.w16l(126, 0); + dblk->w16l(126, 0); } u16 end_address = (get_u16le(entry + 0xc) + data.size()) & 0xffff; @@ -394,8 +394,8 @@ std::vector> vtech_impl::allocate_blocks(u32 count) for(u8 sector = 0; sector != 16; sector++) { u32 off = (track-1)*2 + (sector / 8); u32 bit = 1 << (sector & 7); - if(!(fmap.r8(off) & bit)) { - fmap.w8(off, fmap.r8(off) | bit); + if(!(fmap->r8(off) & bit)) { + fmap->w8(off, fmap->r8(off) | bit); blocks.emplace_back(std::make_pair(track, sector)); if(blocks.size() == count) return blocks; @@ -412,7 +412,7 @@ void vtech_impl::free_blocks(const std::vector> &blocks) u8 sector = ref.second; u32 off = (track-1)*2 + (sector / 8); u32 bit = 1 << (sector & 7); - fmap.w8(off, fmap.r8(off) & ~bit); + fmap->w8(off, fmap->r8(off) & ~bit); } } @@ -421,7 +421,7 @@ u32 vtech_impl::free_block_count() auto fmap = m_blockdev.get(15); u32 nf = 0; for(u32 off = 0; off != (40-1)*2; off++) { - u8 m = fmap.r8(off); + u8 m = fmap->r8(off); // Count 1 bits; m = ((m & 0xaa) >> 1) | (m & 0x55); m = ((m & 0xcc) >> 2) | (m & 0x33); diff --git a/src/lib/formats/fsblk.cpp b/src/lib/formats/fsblk.cpp index 8dfedcc4941bf..5e8198d0ce84b 100644 --- a/src/lib/formats/fsblk.cpp +++ b/src/lib/formats/fsblk.cpp @@ -13,154 +13,124 @@ namespace fs { -void refcounted_inner::ref() -{ - m_ref ++; -} - -void refcounted_inner::ref_weak() -{ - m_weak_ref ++; -} - -bool refcounted_inner::unref() -{ - m_ref --; - if(m_ref == 0) { - if(m_weak_ref) - drop_weak_references(); - else - delete this; - return true; - } - return false; -} - -bool refcounted_inner::unref_weak() -{ - m_weak_ref --; - if(m_weak_ref == 0 && m_ref == 0) { - delete this; - return true; - } - return false; -} - - - void fsblk_t::set_block_size(u32 block_size) { m_block_size = block_size; } -u8 *fsblk_t::iblock_t::offset(const char *function, u32 off, u32 size) +const u8 *fsblk_t::block_t::roffs(const char *function, u32 off, u32 size) const { if(off + size > m_size) - throw std::out_of_range(util::string_format("block_t::%s out-of-block access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); - return data() + off; + throw std::out_of_range(util::string_format("block_t::%s out-of-block read access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); + return rodata() + off; } -const u8 *fsblk_t::iblock_t::rooffset(const char *function, u32 off, u32 size) +u8 *fsblk_t::block_t::woffs(const char *function, u32 off, u32 size) { if(off + size > m_size) - throw std::out_of_range(util::string_format("block_t::%s out-of-block read access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); - return rodata() + off; + throw std::out_of_range(util::string_format("block_t::%s out-of-block access, offset=%d, size=%d, block size=%d", function, off, size, m_size)); + return data() + off; } -void fsblk_t::block_t::copy(u32 offset, const u8 *src, u32 size) +void fsblk_t::block_t::write(u32 offset, const u8 *src, u32 size) { - memcpy(m_object->offset("copy", offset, size), src, size); + memcpy(woffs("write", offset, size), src, size); } void fsblk_t::block_t::fill(u32 offset, u8 data, u32 size) { - memset(m_object->offset("fill", offset, size), data, size); + memset(woffs("fill", offset, size), data, size); } void fsblk_t::block_t::fill(u8 data) { - memset(m_object->data(), data, m_object->size()); + memset(this->data(), data, size()); } void fsblk_t::block_t::wstr(u32 offset, std::string_view str) { - memcpy(m_object->offset("wstr", offset, str.size()), str.data(), str.size()); + memcpy(woffs("wstr", offset, str.size()), str.data(), str.size()); } void fsblk_t::block_t::w8(u32 offset, u8 data) { - m_object->offset("w8", offset, 1)[0] = data; + woffs("w8", offset, 1)[0] = data; } void fsblk_t::block_t::w16b(u32 offset, u16 data) { - put_u16be(m_object->offset("w16b", offset, 2), data); + put_u16be(woffs("w16b", offset, 2), data); } void fsblk_t::block_t::w24b(u32 offset, u32 data) { - put_u24be(m_object->offset("w24b", offset, 3), data); + put_u24be(woffs("w24b", offset, 3), data); } void fsblk_t::block_t::w32b(u32 offset, u32 data) { - put_u32be(m_object->offset("w32b", offset, 4), data); + put_u32be(woffs("w32b", offset, 4), data); } void fsblk_t::block_t::w16l(u32 offset, u16 data) { - put_u16le(m_object->offset("w16l", offset, 2), data); + put_u16le(woffs("w16l", offset, 2), data); } void fsblk_t::block_t::w24l(u32 offset, u32 data) { - put_u24le(m_object->offset("w24l", offset, 3), data); + put_u24le(woffs("w24l", offset, 3), data); } void fsblk_t::block_t::w32l(u32 offset, u32 data) { - put_u32le(m_object->offset("w32l", offset, 4), data); + put_u32le(woffs("w32l", offset, 4), data); +} + +void fsblk_t::block_t::read(u32 offset, u8 *dst, u32 size) const +{ + memcpy(dst, roffs("read", offset, size), size); } std::string_view fsblk_t::block_t::rstr(u32 offset, u32 size) const { - const u8 *d = m_object->rooffset("rstr", offset, size); + const u8 *d = roffs("rstr", offset, size); return std::string_view(reinterpret_cast(d), size); } u8 fsblk_t::block_t::r8(u32 offset) const { - return m_object->offset("r8", offset, 1)[0]; + return roffs("r8", offset, 1)[0]; } u16 fsblk_t::block_t::r16b(u32 offset) const { - return get_u16be(m_object->offset("r16b", offset, 2)); + return get_u16be(roffs("r16b", offset, 2)); } u32 fsblk_t::block_t::r24b(u32 offset) const { - return get_u24be(m_object->offset("r24b", offset, 3)); + return get_u24be(roffs("r24b", offset, 3)); } u32 fsblk_t::block_t::r32b(u32 offset) const { - return get_u32be(m_object->offset("r32b", offset, 4)); + return get_u32be(roffs("r32b", offset, 4)); } u16 fsblk_t::block_t::r16l(u32 offset) const { - return get_u16le(m_object->offset("r16l", offset, 2)); + return get_u16le(roffs("r16l", offset, 2)); } u32 fsblk_t::block_t::r24l(u32 offset) const { - return get_u24le(m_object->offset("r24l", offset, 3)); + return get_u24le(roffs("r24l", offset, 3)); } u32 fsblk_t::block_t::r32l(u32 offset) const { - return get_u32le(m_object->offset("r32l", offset, 4)); + return get_u32le(roffs("r32l", offset, 4)); } diff --git a/src/lib/formats/fsblk.h b/src/lib/formats/fsblk.h index 619ff832a953a..7f368a7307ce5 100644 --- a/src/lib/formats/fsblk.h +++ b/src/lib/formats/fsblk.h @@ -10,6 +10,7 @@ #include "fsmeta.h" +#include #include #include #include @@ -33,103 +34,6 @@ enum class error : int { already_exists, }; -template class refcounted_outer { -public: - refcounted_outer(bool weak) : m_object(nullptr), m_is_weak_ref(weak) {} - refcounted_outer(T *object, bool weak) : m_object(object), m_is_weak_ref(weak) { - ref(); - } - - refcounted_outer(const refcounted_outer &cref) { - m_object = cref.m_object; - m_is_weak_ref = cref.m_is_weak_ref; - ref(); - } - - refcounted_outer(refcounted_outer &&cref) { - m_object = cref.m_object; - m_is_weak_ref = cref.m_is_weak_ref; - cref.m_object = nullptr; - } - - ~refcounted_outer() { - unref(); - } - - refcounted_outer &operator =(T *dir) { - if(m_object != dir) { - unref(); - m_object = dir; - ref(); - } - return *this; - } - - refcounted_outer &operator =(const refcounted_outer &cref) { - if(m_object != cref.m_object) { - unref(); - m_object = cref.m_object; - ref(); - } - return *this; - } - - refcounted_outer &operator =(refcounted_outer &&cref) { - if(m_object != cref.m_object) { - unref(); - m_object = cref.m_object; - ref(); - } else if(m_is_weak_ref != cref.m_is_weak_ref) { - ref(); - cref.unref(); - m_object = cref.m_object; // In case the object got deleted (when going from strong ref to weak on the last strong) - } - cref.m_object = nullptr; - return *this; - } - - operator bool() const { return m_object != nullptr; } - -protected: - T *m_object; - bool m_is_weak_ref; - -private: - void ref() { - if(m_object) { - if(m_is_weak_ref) - m_object->ref_weak(); - else - m_object->ref(); - } - } - - void unref() { - if(m_object) { - bool del = m_is_weak_ref ? m_object->unref_weak() : m_object->unref(); - if(del) - m_object = nullptr; - } - } -}; - - -class refcounted_inner { -public: - refcounted_inner() : m_ref(0), m_weak_ref(0) {} - virtual ~refcounted_inner() = default; - - void ref(); - void ref_weak(); - bool unref(); - bool unref_weak(); - - virtual void drop_weak_references() = 0; - -public: - u32 m_ref, m_weak_ref; -}; - enum class dir_entry_type { dir, file, @@ -144,51 +48,32 @@ struct dir_entry { }; class fsblk_t { -protected: - class iblock_t : public refcounted_inner { - public: - iblock_t(u32 size) : refcounted_inner(), m_size(size) {} - virtual ~iblock_t() = default; - - u32 size() const { return m_size; } - - virtual const u8 *rodata() = 0; - virtual u8 *data() = 0; - u8 *offset(const char *function, u32 off, u32 size); - const u8 *rooffset(const char *function, u32 off, u32 size); - - protected: - u32 m_size; - }; - - public: - class block_t : public refcounted_outer { + class block_t { public: - block_t(bool weak = false) : refcounted_outer(weak) {} - block_t(iblock_t *block, bool weak = true) : refcounted_outer(block, weak) {} - virtual ~block_t() = default; - - block_t strong() { return block_t(m_object, false); } - block_t weak() { return block_t(m_object, true); } + using ptr = std::shared_ptr; - u32 size() const { return m_object->size(); } + block_t(u32 size) : m_size(size) {} + virtual ~block_t() = default; - const u8 *rodata() const { return m_object->rodata(); } - u8 *data() { return m_object->data(); } + u32 size() const { return m_size; } - void copy(u32 offset, const u8 *src, u32 size); - void fill( u8 data); - void fill(u32 offset, u8 data, u32 size); - void wstr(u32 offset, std::string_view str); - void w8( u32 offset, u8 data); - void w16b(u32 offset, u16 data); - void w24b(u32 offset, u32 data); - void w32b(u32 offset, u32 data); - void w16l(u32 offset, u16 data); - void w24l(u32 offset, u32 data); - void w32l(u32 offset, u32 data); + virtual const u8 *rodata() const = 0; + virtual u8 *data() = 0; + void write(u32 offset, const u8 *src, u32 size); + void fill( u8 data); + void fill( u32 offset, u8 data, u32 size); + void wstr( u32 offset, std::string_view str); + void w8( u32 offset, u8 data); + void w16b( u32 offset, u16 data); + void w24b( u32 offset, u32 data); + void w32b( u32 offset, u32 data); + void w16l( u32 offset, u16 data); + void w24l( u32 offset, u32 data); + void w32l( u32 offset, u32 data); + + void read(u32 offset, u8 *dst, u32 size) const; std::string_view rstr(u32 offset, u32 size) const; u8 r8( u32 offset) const; u16 r16b(u32 offset) const; @@ -197,6 +82,13 @@ class fsblk_t { u16 r16l(u32 offset) const; u32 r24l(u32 offset) const; u32 r32l(u32 offset) const; + + protected: + u32 m_size; + + private: + const u8 *roffs(const char *function, u32 off, u32 size) const; + u8 *woffs(const char *function, u32 off, u32 size); }; fsblk_t() : m_block_size(0) {} @@ -204,8 +96,8 @@ class fsblk_t { virtual void set_block_size(u32 block_size); virtual u32 block_count() const = 0; - virtual block_t get(u32 id) = 0; - virtual void fill(u8 data) = 0; + virtual block_t::ptr get(u32 id) = 0; + virtual void fill_all(u8 data) = 0; protected: u32 m_block_size; diff --git a/src/lib/formats/fsblk_vec.cpp b/src/lib/formats/fsblk_vec.cpp index e80cad8c51cc5..a04d60c263c4e 100644 --- a/src/lib/formats/fsblk_vec.cpp +++ b/src/lib/formats/fsblk_vec.cpp @@ -12,7 +12,7 @@ namespace fs { -const u8 *fsblk_vec_t::blk_t::rodata() +const u8 *fsblk_vec_t::blk_t::rodata() const { return m_data; } @@ -22,23 +22,19 @@ u8 *fsblk_vec_t::blk_t::data() return m_data; } -void fsblk_vec_t::blk_t::drop_weak_references() -{ -} - u32 fsblk_vec_t::block_count() const { return m_data.size() / m_block_size; } -fsblk_t::block_t fsblk_vec_t::get(u32 id) +fsblk_vec_t::block_t::ptr fsblk_vec_t::get(u32 id) { if(id >= block_count()) throw std::out_of_range(util::string_format("Block number overflow: requiring block %d on device of size %d (%d bytes, block size %d)", id, block_count(), m_data.size(), m_block_size)); - return block_t(new blk_t(m_data.data() + m_block_size*id, m_block_size)); + return std::make_shared(m_data.data() + m_block_size*id, m_block_size); } -void fsblk_vec_t::fill(u8 data) +void fsblk_vec_t::fill_all(u8 data) { std::fill(m_data.begin(), m_data.end(), data); } diff --git a/src/lib/formats/fsblk_vec.h b/src/lib/formats/fsblk_vec.h index 49f7ed3013e0d..b029bc55c5ec6 100644 --- a/src/lib/formats/fsblk_vec.h +++ b/src/lib/formats/fsblk_vec.h @@ -9,14 +9,13 @@ namespace fs { class fsblk_vec_t : public fsblk_t { private: - class blk_t : public iblock_t { + class blk_t : public block_t { public: - blk_t(u8 *data, u32 size) : iblock_t(size), m_data(data) {} + blk_t(u8 *data, u32 size) : block_t(size), m_data(data) {} virtual ~blk_t() = default; - virtual const u8 *rodata() override; + virtual const u8 *rodata() const override; virtual u8 *data() override; - virtual void drop_weak_references() override; private: u8 *m_data; @@ -27,8 +26,8 @@ class fsblk_vec_t : public fsblk_t { virtual ~fsblk_vec_t() = default; virtual u32 block_count() const override; - virtual block_t get(u32 id) override; - virtual void fill(u8 data) override; + virtual block_t::ptr get(u32 id) override; + virtual void fill_all(u8 data) override; private: std::vector &m_data; From 72b18e6333f1259140c70edbcd5b93e2d9cce9ec Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 3 Mar 2025 12:51:17 +0100 Subject: [PATCH 067/272] skeleton/pv9234.cpp: update notes, minor cleanups --- src/mame/skeleton/pv9234.cpp | 70 ++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 30 deletions(-) diff --git a/src/mame/skeleton/pv9234.cpp b/src/mame/skeleton/pv9234.cpp index 38f5d978aca17..328fee5a296f8 100644 --- a/src/mame/skeleton/pv9234.cpp +++ b/src/mame/skeleton/pv9234.cpp @@ -1,24 +1,37 @@ // license:BSD-3-Clause // copyright-holders:Angelo Salese -/*************************************************************************** +/************************************************************************************************** PowerVu D9234 STB (c) 1997 Scientific Atlanta 20-mar-2010 skeleton driver -http://www.vetrun.net/forums/showthread.php?t=395 -http://colibri.net63.net/powervu.htm -http://www.growl.de/d9234/ +References: +- http://www.vetrun.net/forums/showthread.php?t=395 +- http://colibri.net63.net/powervu.htm +- http://www.growl.de/d9234/ -Google 'powervu 9234' for plenty more info. +TODO: +- everything, including PCB pictures and user manual; +- Probably shared with other PowerVu DVB-S STB models; + +Front Panel: +- On/standby / Signal on left +- arrow keys with select in the middle, next to DVB logo + +Back Panel: +- CH3 / CH4 dip; +- Ant In and Tv Out UHF connectors, near composite audio/video jacks +- Satellite LNB PWR +13/+19V 250mA +- LNB PWR ON / OFF dip; +- AC IN, 100V-240V, 50/60Hz + +=================================================================================================== Meant for payTV providers to decrypt signals from the satellite and pump them out on a local cable network. The powervu encryption is very secure. -There is a menu system, and with the right equipment, many secrets can -be found! - -****************************************************************************/ +**************************************************************************************************/ #include "emu.h" #include "cpu/arm7/arm7.h" @@ -45,9 +58,9 @@ class pv9234_state : public driver_device void debug1_w(uint32_t data); void debug2_w(uint32_t data); - uint32_t screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void pv9234_map(address_map &map) ATTR_COLD; + void main_map(address_map &map) ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -56,6 +69,15 @@ class pv9234_state : public driver_device required_device m_maincpu; }; +void pv9234_state::video_start() +{ +} + +uint32_t pv9234_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + return 0; +} + /* This is the serial output to a terminal, used for debugging. @@ -83,7 +105,7 @@ void pv9234_state::debug_w(uint32_t data) { if (data) { - printf("%02x %c\n",data,data); // this prints 'Start' to the console. + //printf("%02x %c\n",data,data); // this prints 'Start' to the console. logerror("debug=%02x %c\n",data,data); } } @@ -110,7 +132,7 @@ void pv9234_state::debug2_w(uint32_t data) logerror("debug2=%02x\n",data); // ignore the huge amount of zeroes here } -void pv9234_state::pv9234_map(address_map &map) +void pv9234_state::main_map(address_map &map) { map(0x00000000, 0x0007ffff).rom().region("maincpu", 0); //FLASH ROM! // map(0x00000000, 0x00000033).w(FUNC(pv9234_state::)); something @@ -142,28 +164,19 @@ void pv9234_state::machine_reset() m_p_ram[i] = 0; } -void pv9234_state::video_start() -{ -} - -uint32_t pv9234_state::screen_update_pv9234(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - return 0; -} - void pv9234_state::pv9234(machine_config &config) { /* basic machine hardware */ - ARM7(config, m_maincpu, 4915000); //probably a more powerful clone. - m_maincpu->set_addrmap(AS_PROGRAM, &pv9234_state::pv9234_map); + ARM7(config, m_maincpu, 4915000); // TODO: unknown type + m_maincpu->set_addrmap(AS_PROGRAM, &pv9234_state::main_map); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(50); + screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ screen.set_size(640, 480); screen.set_visarea(0, 640-1, 0, 480-1); - screen.set_screen_update(FUNC(pv9234_state::screen_update_pv9234)); + screen.set_screen_update(FUNC(pv9234_state::screen_update)); screen.set_palette("palette"); PALETTE(config, "palette", palette_device::MONOCHROME); @@ -181,7 +194,4 @@ ROM_END } // anonymous namespace -/* Driver */ - -// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS -SYST( 1997, pv9234, 0, 0, pv9234, pv9234, pv9234_state, empty_init, "Scientific Atlanta", "PowerVu D9234", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) +SYST( 1997, pv9234, 0, 0, pv9234, pv9234, pv9234_state, empty_init, "Scientific Atlanta", "PowerVu D9234 Business Satellite Receiver", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) From 7698c899013fda6050d34f0181e7568a5943ee30 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 3 Mar 2025 18:08:11 +0100 Subject: [PATCH 068/272] opwolf: improve sound routing --- src/mame/atari/hitparade.cpp | 4 +- src/mame/taito/opwolf.cpp | 168 ++++++++++------------------------- 2 files changed, 50 insertions(+), 122 deletions(-) diff --git a/src/mame/atari/hitparade.cpp b/src/mame/atari/hitparade.cpp index 5aca3be7c758a..e06823ee139b9 100644 --- a/src/mame/atari/hitparade.cpp +++ b/src/mame/atari/hitparade.cpp @@ -7,8 +7,8 @@ Atari Europe Hit Parade series jukeboxes Atari Europe is unrelated to the modern Atari Europe, or Infogrames. It was a French jukebox company that was partially owned by Atari for a while -in the mid-1970s. It gets a bit confusing, for more information, Google for -Socodimex, Electro-Kicker, Europe Electronique. +in the mid-1970s. It gets a bit confusing, for more information, search online +for Socodimex, Electro-Kicker, Europe Electronique. There are probably more jukeboxes on similar hardware. diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 1faea4ebcf464..716f796c8329a 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -260,19 +260,11 @@ There are a few unmapped writes for the sound Z80 in the log. Unknown writes to the MSM5205 control addresses (RUN/RES implementation is wrong) -Sound volume filtering is imperfect. Notably the coin insert sound: -MSM1 rings it at volume 0xa8, MSM2 echos it at volume 0x84 but should be more muffled. - Raine source has standard Asuka/Mofflot sprite/tile priority: 0x2000 in sprite_ctrl puts all sprites under top bg layer. But Raine simply kludges in this value, failing to read it from a register. So what is controlling priority. -Sound routing is wrong: according to schematics, msm0 goes to tc0060dca0 input 0, -msm1 goes to tc0060dca0 input 1. ym2151 (mono) and tc0060dca0 outputs go to -tc0060dca1 inputs. The 2nd tc0060dca is for total volume (opwolf_adpcm_d_w and -opwolf_adpcm_e_w), outputs go to left/right speakers. - ***************************************************************************/ #include "emu.h" @@ -287,6 +279,7 @@ opwolf_adpcm_e_w), outputs go to left/right speakers. #include "cpu/m68000/m68000.h" #include "cpu/z80/z80.h" #include "machine/timer.h" +#include "sound/mixer.h" #include "sound/msm5205.h" #include "sound/ymopm.h" @@ -297,11 +290,6 @@ opwolf_adpcm_e_w), outputs go to left/right speakers. namespace { -/* Define clocks based on actual OSC on the PCB */ - -#define CPU_CLOCK (XTAL(16'000'000) / 2) /* clock for 68000 */ -#define SOUND_CPU_CLOCK (XTAL(8'000'000) / 2) /* clock for Z80 sound CPU */ - //************************************************************************** // TYPE DEFINITIONS //************************************************************************** @@ -320,8 +308,6 @@ class opwolf_state : public driver_device m_pc090oj(*this, "pc090oj"), m_msm(*this, "msm%u", 0), m_tc0060dca(*this, "tc0060dca%u", 0), - m_lspeaker(*this, "lspeaker"), - m_rspeaker(*this, "rspeaker"), m_z80bank(*this, "z80bank"), m_recoil(*this, "Player%u_Recoil_Piston", 1U) { } @@ -369,18 +355,18 @@ class opwolf_state : public driver_device optional_shared_ptr m_cchip_ram; /* video-related */ - uint16_t m_sprite_ctrl; - uint16_t m_sprites_flipscreen; + uint16_t m_sprite_ctrl = 0; + uint16_t m_sprites_flipscreen = 0; /* misc */ - uint8_t m_adpcm_b[0x08]; - uint8_t m_adpcm_c[0x08]; - uint32_t m_adpcm_pos[2]; - uint32_t m_adpcm_end[2]; - int m_adpcm_data[2]; + uint8_t m_adpcm_b[0x08] = { }; + uint8_t m_adpcm_c[0x08] = { }; + uint32_t m_adpcm_pos[2] = { }; + uint32_t m_adpcm_end[2] = { }; + int m_adpcm_data[2] = { }; - int m_opwolf_gun_xoffs; - int m_opwolf_gun_yoffs; + int m_opwolf_gun_xoffs = 0; + int m_opwolf_gun_yoffs = 0; /* devices */ required_device m_maincpu; @@ -391,8 +377,6 @@ class opwolf_state : public driver_device required_device m_pc090oj; required_device_array m_msm; required_device_array m_tc0060dca; - required_device m_lspeaker; - required_device m_rspeaker; required_memory_bank m_z80bank; output_finder<1> m_recoil; }; @@ -619,7 +603,7 @@ static INPUT_PORTS_START( opwolfb ) PORT_INCLUDE( opwolf ) PORT_MODIFY( "DSWB" ) - PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) /* see notes */ + PORT_DIPUNUSED( 0x80, IP_ACTIVE_LOW ) /* see notes */ INPUT_PORTS_END @@ -695,8 +679,8 @@ uint32_t opwolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap m_pc090oj->draw_sprites(screen, bitmap, cliprect); -// if (ioport("P1X")->read()) -// popmessage("%d %d", machine(), "P1X"), ioport("P1Y")->read()); + //if (ioport("P1X")->read()) + //popmessage("%d %d", machine(), "P1X"), ioport("P1Y")->read()); return 0; } @@ -762,11 +746,11 @@ void opwolf_state::opwolf_adpcm_b_w(offs_t offset, uint8_t data) m_adpcm_pos[0] = start; m_adpcm_end[0] = end; m_msm[0]->reset_w(0); - m_tc0060dca[0]->level_w(3, m_adpcm_b[5]); + m_tc0060dca[0]->level_w(1, m_adpcm_b[5]); //logerror("TRIGGER MSM1\n"); } -// logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); + //logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); } void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) @@ -785,25 +769,23 @@ void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) m_adpcm_pos[1] = start; m_adpcm_end[1] = end; m_msm[1]->reset_w(0); - m_tc0060dca[1]->level_w(3, m_adpcm_c[5]); + m_tc0060dca[0]->level_w(2, m_adpcm_c[5]); //logerror("TRIGGER MSM2\n"); } -// logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); + //logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); } void opwolf_state::opwolf_adpcm_d_w(uint8_t data) { // total volume (speaker 1) - for (int i = 0; i <= 2; i++) - m_lspeaker->set_input_gain(i, data / 255.0); + m_tc0060dca[1]->level_w(1, data); } void opwolf_state::opwolf_adpcm_e_w(uint8_t data) { // total volume (speaker 2) - for (int i = 0; i <= 2; i++) - m_rspeaker->set_input_gain(i, data / 255.0); + m_tc0060dca[1]->level_w(2, data); } @@ -870,12 +852,13 @@ uint16_t opwolf_state::cchip_r(offs_t offset) void opwolf_state::cchip_w(offs_t offset, uint16_t data) { - m_cchip_ram[offset] = data &0xff; + m_cchip_ram[offset] = data & 0xff; } INTERRUPT_GEN_MEMBER(opwolf_state::interrupt) { m_maincpu->set_input_line(5, HOLD_LINE); + if (m_cchip) m_cchip->ext_interrupt(ASSERT_LINE); if (m_cchip_irq_clear) @@ -895,11 +878,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(opwolf_state::cchip_irq_clear_cb) void opwolf_state::opwolf(machine_config &config) { /* basic machine hardware */ - M68000(config, m_maincpu, CPU_CLOCK); /* 8 MHz */ + M68000(config, m_maincpu, 16_MHz_XTAL / 2); /* 8 MHz */ m_maincpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_map); m_maincpu->set_vblank_int("screen", FUNC(opwolf_state::interrupt)); - Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 4 MHz */ + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); /* 4 MHz */ m_audiocpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_sound_z80_map); TAITO_CCHIP(config, m_cchip, 12_MHz_XTAL); /* 12MHz measured on pin 20 */ @@ -909,7 +892,11 @@ void opwolf_state::opwolf(machine_config &config) TIMER(config, "cchip_irq_clear").configure_generic(FUNC(opwolf_state::cchip_irq_clear_cb)); - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ + config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ + + pc060ha_device &ciu(PC060HA(config, "ciu", 0)); + ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -932,35 +919,31 @@ void opwolf_state::opwolf(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_CPU_CLOCK)); /* 4 MHz */ + mixer_device &mixer = MIXER(config, "mixer"); + mixer.add_route(0, m_tc0060dca[1], 1.0); + mixer.add_route(0, m_tc0060dca[1], 1.0); + + ym2151_device &ymsnd(YM2151(config, "ymsnd", 8_MHz_XTAL / 2)); /* 4 MHz */ ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.port_write_handler().set_membank(m_z80bank).mask(0x03); - ymsnd.add_route(0, "lspeaker", 1.0); - ymsnd.add_route(1, "rspeaker", 1.0); - - TC0060DCA(config, m_tc0060dca[0]); - m_tc0060dca[0]->add_route(0, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(1, "rspeaker", 1.0); + ymsnd.add_route(ALL_OUTPUTS, "mixer", 0.35); - MSM5205(config, m_msm[0], 384000); + MSM5205(config, m_msm[0], 384_kHz_XTAL); m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); - m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); + m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ + m_msm[0]->add_route(0, m_tc0060dca[0], 1.0, 0); + + MSM5205(config, m_msm[1], 384_kHz_XTAL); + m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); + m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ + m_msm[1]->add_route(0, m_tc0060dca[0], 1.0, 1); + + TC0060DCA(config, m_tc0060dca[0]); + m_tc0060dca[0]->add_route(ALL_OUTPUTS, "mixer", 1.0); TC0060DCA(config, m_tc0060dca[1]); m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); - - MSM5205(config, m_msm[1], 384000); - m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); - m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - - pc060ha_device &ciu(PC060HA(config, "ciu", 0)); - ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); } void opwolf_state::opwolfp(machine_config &config) @@ -976,70 +959,15 @@ void opwolf_state::opwolfp(machine_config &config) void opwolf_state::opwolfb(machine_config &config) /* OSC clocks unknown for the bootleg, but changed to match original sets */ { + opwolfp(config); + /* basic machine hardware */ - M68000(config, m_maincpu, CPU_CLOCK); /* 8 MHz ??? */ m_maincpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolfb_map); m_maincpu->set_vblank_int("screen", FUNC(opwolf_state::irq5_line_hold)); - Z80(config, m_audiocpu, SOUND_CPU_CLOCK); /* 4 MHz ??? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &opwolf_state::opwolf_sound_z80_map); - - z80_device &sub(Z80(config, "sub", SOUND_CPU_CLOCK)); /* 4 MHz ??? */ + z80_device &sub(Z80(config, "sub", 8_MHz_XTAL / 2)); /* 4 MHz ??? */ sub.set_addrmap(AS_PROGRAM, &opwolf_state::opwolfb_sub_z80_map); sub.set_vblank_int("screen", FUNC(opwolf_state::irq0_line_hold)); - - config.set_maximum_quantum(attotime::from_hz(600)); /* 10 CPU slices per frame - enough for the sound CPU to read all commands */ - - /* video hardware */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size(40*8, 32*8); - screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); - screen.set_screen_update(FUNC(opwolf_state::screen_update)); - screen.set_palette("palette"); - - PALETTE(config, "palette").set_format(palette_device::xRGBRRRRGGGGBBBB_bit0, 2048); - - PC080SN(config, m_pc080sn, 0, "palette", gfx_opwolf); - - PC090OJ(config, m_pc090oj, 0); - m_pc090oj->set_palette("palette"); - m_pc090oj->set_colpri_callback(FUNC(opwolf_state::opwolf_colpri_cb)); - - /* sound hardware */ - SPEAKER(config, "lspeaker").front_left(); - SPEAKER(config, "rspeaker").front_right(); - - ym2151_device &ymsnd(YM2151(config, "ymsnd", SOUND_CPU_CLOCK)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 0); - ymsnd.port_write_handler().set_membank(m_z80bank).mask(0x03); - ymsnd.add_route(0, "lspeaker", 1.0); - ymsnd.add_route(1, "rspeaker", 1.0); - - TC0060DCA(config, m_tc0060dca[0]); - m_tc0060dca[0]->add_route(0, "lspeaker", 1.0); - m_tc0060dca[0]->add_route(1, "rspeaker", 1.0); - - MSM5205(config, m_msm[0], 384000); - m_msm[0]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<0>)); - m_msm[0]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - m_msm[0]->add_route(ALL_OUTPUTS, m_tc0060dca[0], 1.0); - - TC0060DCA(config, m_tc0060dca[1]); - m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); - m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); - - MSM5205(config, m_msm[1], 384000); - m_msm[1]->vck_legacy_callback().set(FUNC(opwolf_state::msm5205_vck_w<1>)); - m_msm[1]->set_prescaler_selector(msm5205_device::S48_4B); /* 8 kHz */ - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - m_msm[1]->add_route(ALL_OUTPUTS, m_tc0060dca[1], 1.0); - - pc060ha_device &ciu(PC060HA(config, "ciu", 0)); - ciu.nmi_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ciu.reset_callback().set_inputline(m_audiocpu, INPUT_LINE_RESET); } From a113ce35e09d789b0c94b0a6fdb2d67f90f86edc Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 3 Mar 2025 18:45:42 +0100 Subject: [PATCH 069/272] tc0060dca: use 2 handlers for writing volume --- src/mame/taito/opwolf.cpp | 34 ++++++++++------------------------ src/mame/taito/tc0060dca.cpp | 13 +++++++------ src/mame/taito/tc0060dca.h | 3 ++- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 716f796c8329a..5fcbd3271998f 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -330,8 +330,6 @@ class opwolf_state : public driver_device private: uint16_t cchip_r(offs_t offset); void cchip_w(offs_t offset, uint16_t data); - void opwolf_adpcm_d_w(uint8_t data); - void opwolf_adpcm_e_w(uint8_t data); void opwolf_spritectrl_w(offs_t offset, uint16_t data); void opwolf_adpcm_b_w(offs_t offset, uint8_t data); void opwolf_adpcm_c_w(offs_t offset, uint8_t data); @@ -466,8 +464,8 @@ void opwolf_state::opwolf_sound_z80_map(address_map &map) map(0xa001, 0xa001).rw("ciu", FUNC(pc060ha_device::slave_comm_r), FUNC(pc060ha_device::slave_comm_w)); map(0xb000, 0xb006).w(FUNC(opwolf_state::opwolf_adpcm_b_w)); map(0xc000, 0xc006).w(FUNC(opwolf_state::opwolf_adpcm_c_w)); - map(0xd000, 0xd000).w(FUNC(opwolf_state::opwolf_adpcm_d_w)); - map(0xe000, 0xe000).w(FUNC(opwolf_state::opwolf_adpcm_e_w)); + map(0xd000, 0xd000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume1_w)); + map(0xe000, 0xe000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume2_w)); } // this extra z80 substitutes for the c-chip in the bootleg @@ -737,16 +735,16 @@ void opwolf_state::opwolf_adpcm_b_w(offs_t offset, uint8_t data) m_adpcm_b[offset] = data; - if (offset == 0x04) //trigger ? + if (offset == 0x04) // trigger? { start = m_adpcm_b[0] + m_adpcm_b[1] * 256; - end = m_adpcm_b[2] + m_adpcm_b[3] * 256; + end = m_adpcm_b[2] + m_adpcm_b[3] * 256; start *= 16; - end *= 16; + end *= 16; m_adpcm_pos[0] = start; m_adpcm_end[0] = end; m_msm[0]->reset_w(0); - m_tc0060dca[0]->level_w(1, m_adpcm_b[5]); + m_tc0060dca[0]->volume1_w(m_adpcm_b[5]); //logerror("TRIGGER MSM1\n"); } @@ -760,34 +758,22 @@ void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) m_adpcm_c[offset] = data; - if (offset == 0x04) //trigger ? + if (offset == 0x04) // trigger? { start = m_adpcm_c[0] + m_adpcm_c[1] * 256; - end = m_adpcm_c[2] + m_adpcm_c[3] * 256; + end = m_adpcm_c[2] + m_adpcm_c[3] * 256; start *= 16; - end *= 16; + end *= 16; m_adpcm_pos[1] = start; m_adpcm_end[1] = end; m_msm[1]->reset_w(0); - m_tc0060dca[0]->level_w(2, m_adpcm_c[5]); + m_tc0060dca[0]->volume2_w(m_adpcm_c[5]); //logerror("TRIGGER MSM2\n"); } //logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); } -void opwolf_state::opwolf_adpcm_d_w(uint8_t data) -{ - // total volume (speaker 1) - m_tc0060dca[1]->level_w(1, data); -} - -void opwolf_state::opwolf_adpcm_e_w(uint8_t data) -{ - // total volume (speaker 2) - m_tc0060dca[1]->level_w(2, data); -} - //************************************************************************** // MACHINE EMULATION diff --git a/src/mame/taito/tc0060dca.cpp b/src/mame/taito/tc0060dca.cpp index c931c1717ffdb..c5496ac09030c 100755 --- a/src/mame/taito/tc0060dca.cpp +++ b/src/mame/taito/tc0060dca.cpp @@ -21,15 +21,16 @@ tc0060dca_device::tc0060dca_device(const machine_config &mconfig, const char *ta { } -void tc0060dca_device::level_w(offs_t offset, u8 data) +void tc0060dca_device::volume1_w(u8 data) { m_stream->update(); + m_gain[0] = m_atten_table[data]; +} - for (int i = 0; i < 2; i++) - { - if (BIT(offset, i)) - m_gain[i] = m_atten_table[data]; - } +void tc0060dca_device::volume2_w(u8 data) +{ + m_stream->update(); + m_gain[1] = m_atten_table[data]; } void tc0060dca_device::device_start() diff --git a/src/mame/taito/tc0060dca.h b/src/mame/taito/tc0060dca.h index 96e20fd799f22..d2c00fa9732d3 100755 --- a/src/mame/taito/tc0060dca.h +++ b/src/mame/taito/tc0060dca.h @@ -10,7 +10,8 @@ class tc0060dca_device : public device_t, public device_sound_interface public: tc0060dca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); - void level_w(offs_t offset, u8 data); + void volume1_w(u8 data); + void volume2_w(u8 data); protected: // device_t override From 26c10a1bd197d935c13ebf31fedbc46c6f8397b9 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 3 Mar 2025 19:05:21 +0100 Subject: [PATCH 070/272] opwolf: reduce duplicated adpcm source code --- src/mame/taito/opwolf.cpp | 146 ++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 86 deletions(-) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index 5fcbd3271998f..cfbe6fbc4a343 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -320,8 +320,8 @@ class opwolf_state : public driver_device void init_opwolfb(); void init_opwolfp(); - ioport_value opwolf_gun_x_r(); - ioport_value opwolf_gun_y_r(); + ioport_value gun_x_r(); + ioport_value gun_y_r(); protected: virtual void machine_start() override ATTR_COLD; @@ -330,17 +330,16 @@ class opwolf_state : public driver_device private: uint16_t cchip_r(offs_t offset); void cchip_w(offs_t offset, uint16_t data); - void opwolf_spritectrl_w(offs_t offset, uint16_t data); - void opwolf_adpcm_b_w(offs_t offset, uint8_t data); - void opwolf_adpcm_c_w(offs_t offset, uint8_t data); + void spritectrl_w(offs_t offset, uint16_t data); + template void adpcm_w(offs_t offset, uint8_t data); void counters_w(uint8_t data); INTERRUPT_GEN_MEMBER(interrupt); TIMER_DEVICE_CALLBACK_MEMBER(cchip_irq_clear_cb); - void opwolf_colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl); + void colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void opwolf_msm5205_vck(msm5205_device *device, int chip); + void msm5205_vck(msm5205_device *device, int chip); template void msm5205_vck_w(int state); void opwolf_map(address_map &map) ATTR_COLD; @@ -357,14 +356,13 @@ class opwolf_state : public driver_device uint16_t m_sprites_flipscreen = 0; /* misc */ - uint8_t m_adpcm_b[0x08] = { }; - uint8_t m_adpcm_c[0x08] = { }; + uint8_t m_adpcm_regs[2][8] = { }; uint32_t m_adpcm_pos[2] = { }; uint32_t m_adpcm_end[2] = { }; int m_adpcm_data[2] = { }; - int m_opwolf_gun_xoffs = 0; - int m_opwolf_gun_yoffs = 0; + int m_gun_xoffs = 0; + int m_gun_yoffs = 0; /* devices */ required_device m_maincpu; @@ -393,7 +391,7 @@ void opwolf_state::opwolf_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -416,7 +414,7 @@ void opwolf_state::opwolfb_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -438,7 +436,7 @@ void opwolf_state::opwolfp_map(address_map &map) map(0x200000, 0x200fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x380000, 0x380001).portr("DSWA"); map(0x380002, 0x380003).portr("DSWB"); - map(0x380000, 0x380003).w(FUNC(opwolf_state::opwolf_spritectrl_w)); // usually 0x4, changes when you fire + map(0x380000, 0x380003).w(FUNC(opwolf_state::spritectrl_w)); // usually 0x4, changes when you fire map(0x3a0000, 0x3a0001).portr("IN2"); /* lightgun, read at $11e0/6 (AND INPUTS) */ map(0x3a0002, 0x3a0003).portr("IN3"); map(0x3c0000, 0x3c0001).nopw(); /* watchdog ?? */ @@ -462,8 +460,8 @@ void opwolf_state::opwolf_sound_z80_map(address_map &map) map(0x9002, 0x9100).nopr(); map(0xa000, 0xa000).w("ciu", FUNC(pc060ha_device::slave_port_w)); map(0xa001, 0xa001).rw("ciu", FUNC(pc060ha_device::slave_comm_r), FUNC(pc060ha_device::slave_comm_w)); - map(0xb000, 0xb006).w(FUNC(opwolf_state::opwolf_adpcm_b_w)); - map(0xc000, 0xc006).w(FUNC(opwolf_state::opwolf_adpcm_c_w)); + map(0xb000, 0xb006).w(FUNC(opwolf_state::adpcm_w<0>)); + map(0xc000, 0xc006).w(FUNC(opwolf_state::adpcm_w<1>)); map(0xd000, 0xd000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume1_w)); map(0xe000, 0xe000).w(m_tc0060dca[1], FUNC(tc0060dca_device::volume2_w)); } @@ -538,11 +536,11 @@ static INPUT_PORTS_START( opwolf ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN2") - PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::opwolf_gun_x_r)) + PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::gun_x_r)) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN3") - PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::opwolf_gun_y_r)) + PORT_BIT( 0x01ff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(opwolf_state::gun_y_r)) PORT_BIT( 0xfe00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START(P1X_PORT_TAG) /* P1X (span allows you to shoot enemies behind status bar) */ @@ -617,16 +615,16 @@ void opwolf_state::counters_w(uint8_t data) machine().bookkeeping().coin_counter_w(0, ~data & 0x10); } -ioport_value opwolf_state::opwolf_gun_x_r() +ioport_value opwolf_state::gun_x_r() { /* P1X - Have to remap 8 bit input value, into 0-319 visible range */ int scaled = (ioport(P1X_PORT_TAG)->read() * 320 ) / 256; - return (scaled + 0x15 + m_opwolf_gun_xoffs); + return (scaled + 0x15 + m_gun_xoffs); } -ioport_value opwolf_state::opwolf_gun_y_r() +ioport_value opwolf_state::gun_y_r() { - return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_opwolf_gun_yoffs); + return (ioport(P1Y_PORT_TAG)->read() - 0x24 + m_gun_yoffs); } @@ -634,9 +632,9 @@ ioport_value opwolf_state::opwolf_gun_y_r() // VIDEO //************************************************************************** -void opwolf_state::opwolf_spritectrl_w(offs_t offset, uint16_t data) +void opwolf_state::spritectrl_w(offs_t offset, uint16_t data) { - // popmessage("opwolf_spritectrl_w ctrl = %4x", data); + // popmessage("spritectrl_w ctrl = %4x", data); if (offset == 0) { // bit 0 -> MOTOR1 transistor @@ -653,7 +651,7 @@ void opwolf_state::opwolf_spritectrl_w(offs_t offset, uint16_t data) } } -void opwolf_state::opwolf_colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl) +void opwolf_state::colpri_cb(u32 &sprite_colbank, u32 &pri_mask, u16 sprite_ctrl) { sprite_colbank = (sprite_ctrl & 0xe0) >> 1; pri_mask = 0xfc; // sprites under top bg layer @@ -689,7 +687,7 @@ uint32_t opwolf_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap //************************************************************************** static GFXDECODE_START( gfx_opwolf ) - GFXDECODE_ENTRY( "pc080sn", 0, gfx_8x8x4_packed_msb, 0, 128 ) /* scr tiles */ + GFXDECODE_ENTRY( "pc080sn", 0, gfx_8x8x4_packed_msb, 0, 128 ) /* scr tiles */ GFXDECODE_END @@ -707,6 +705,30 @@ GFXDECODE_END //6 - RES //7 - N/C +template +void opwolf_state::adpcm_w(offs_t offset, uint8_t data) +{ + m_adpcm_regs[N][offset] = data; + + if (offset == 0x04) // trigger? + { + uint16_t start = m_adpcm_regs[N][1] << 8 | m_adpcm_regs[N][0]; + uint16_t end = m_adpcm_regs[N][3] << 8 | m_adpcm_regs[N][2]; + m_adpcm_pos[N] = start << 4; + m_adpcm_end[N] = end << 4; + m_msm[N]->reset_w(0); + + if (N) + m_tc0060dca[0]->volume2_w(m_adpcm_regs[N][5]); + else + m_tc0060dca[0]->volume1_w(m_adpcm_regs[N][5]); + + //logerror("TRIGGER MSM%d\n", N + 1); + } + + //logerror("CPU #1 %c00%i-data=%2x pc=%4x\n", 'b' + N, offset, data, m_audiocpu->pc()); +} + template void opwolf_state::msm5205_vck_w(int state) { @@ -728,52 +750,6 @@ void opwolf_state::msm5205_vck_w(int state) } } -void opwolf_state::opwolf_adpcm_b_w(offs_t offset, uint8_t data) -{ - int start; - int end; - - m_adpcm_b[offset] = data; - - if (offset == 0x04) // trigger? - { - start = m_adpcm_b[0] + m_adpcm_b[1] * 256; - end = m_adpcm_b[2] + m_adpcm_b[3] * 256; - start *= 16; - end *= 16; - m_adpcm_pos[0] = start; - m_adpcm_end[0] = end; - m_msm[0]->reset_w(0); - m_tc0060dca[0]->volume1_w(m_adpcm_b[5]); - //logerror("TRIGGER MSM1\n"); - } - - //logerror("CPU #1 b00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); -} - -void opwolf_state::opwolf_adpcm_c_w(offs_t offset, uint8_t data) -{ - int start; - int end; - - m_adpcm_c[offset] = data; - - if (offset == 0x04) // trigger? - { - start = m_adpcm_c[0] + m_adpcm_c[1] * 256; - end = m_adpcm_c[2] + m_adpcm_c[3] * 256; - start *= 16; - end *= 16; - m_adpcm_pos[1] = start; - m_adpcm_end[1] = end; - m_msm[1]->reset_w(0); - m_tc0060dca[0]->volume2_w(m_adpcm_c[5]); - //logerror("TRIGGER MSM2\n"); - } - - //logerror("CPU #1 c00%i-data=%2x pc=%4x\n",offset,data,m_audiocpu->pc() ); -} - //************************************************************************** // MACHINE EMULATION @@ -784,21 +760,21 @@ void opwolf_state::init_opwolf() uint16_t* rom = (uint16_t*)memregion("maincpu")->base(); // World & US version have different gun offsets, presumably slightly different gun hardware - m_opwolf_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff); - m_opwolf_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff); + m_gun_xoffs = 0xec - (rom[0x03ffb0 / 2] & 0xff); + m_gun_yoffs = 0x1c - (rom[0x03ffae / 2] & 0xff); } void opwolf_state::init_opwolfb() { /* bootleg needs different range of raw gun coords */ - m_opwolf_gun_xoffs = -2; - m_opwolf_gun_yoffs = 17; + m_gun_xoffs = -2; + m_gun_yoffs = 17; } void opwolf_state::init_opwolfp() { - m_opwolf_gun_xoffs = 5; - m_opwolf_gun_yoffs = 30; + m_gun_xoffs = 5; + m_gun_yoffs = 30; } void opwolf_state::machine_start() @@ -807,19 +783,17 @@ void opwolf_state::machine_start() m_z80bank->configure_entries(0, 4, memregion("audiocpu")->base(), 0x4000); - save_item(NAME(m_sprite_ctrl)); - save_item(NAME(m_sprites_flipscreen)); - - save_item(NAME(m_adpcm_b)); - save_item(NAME(m_adpcm_c)); + save_item(NAME(m_adpcm_regs)); save_item(NAME(m_adpcm_pos)); save_item(NAME(m_adpcm_end)); + save_item(NAME(m_adpcm_data)); + + save_item(NAME(m_sprite_ctrl)); + save_item(NAME(m_sprites_flipscreen)); } void opwolf_state::machine_reset() { - m_adpcm_b[0] = m_adpcm_b[1] = 0; - m_adpcm_c[0] = m_adpcm_c[1] = 0; m_adpcm_pos[0] = m_adpcm_pos[1] = 0; m_adpcm_end[0] = m_adpcm_end[1] = 0; m_adpcm_data[0] = m_adpcm_data[1] = -1; @@ -899,7 +873,7 @@ void opwolf_state::opwolf(machine_config &config) PC090OJ(config, m_pc090oj, 0); m_pc090oj->set_palette("palette"); - m_pc090oj->set_colpri_callback(FUNC(opwolf_state::opwolf_colpri_cb)); + m_pc090oj->set_colpri_callback(FUNC(opwolf_state::colpri_cb)); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); From 37531b620dccee6bb958087156ff24a0890381c5 Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 3 Mar 2025 13:25:49 -0500 Subject: [PATCH 071/272] imagedev/floppy.cpp: Return INVALIDIMAGE from floppy_image_device::identify if no format scores --- src/devices/imagedev/floppy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/devices/imagedev/floppy.cpp b/src/devices/imagedev/floppy.cpp index 82e323cd15a9f..8dd70d5fd62a1 100644 --- a/src/devices/imagedev/floppy.cpp +++ b/src/devices/imagedev/floppy.cpp @@ -610,7 +610,10 @@ std::pair floppy_image_devi } } - return{ std::error_condition(), best_format }; + if(best_format) + return{ std::error_condition(), best_format }; + else + return{ image_error::INVALIDIMAGE, nullptr }; } void floppy_image_device::init_floppy_load(bool write_supported) From c3da58a25426f3fe7661d5d54f57e58ca102295d Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 3 Mar 2025 20:07:22 +0100 Subject: [PATCH 072/272] New working systems ------------------- Lian Huan Pao - ATT II [dyq, little0, Guru] Lian Huan Pao - ATT III [dyq, little0, Guru] Xingyun Dou Dizhu [dyq, little0, Guru] New clones marked not working ----------------------------- Chaoji Dou Dizhu (V213CN) [dyq, little0, Guru] Heart of Antony (0252526, US) [Dam0, Heihachi_73] Mr Woo (30215311, NSW/ACT) [Dam0, Heihachi_73] - bmc/popobear.cpp: redumped one GFX ROM for qiwang [dyq, little0, Guru] --- src/mame/aristocrat/aristmk6.cpp | 62 ++- src/mame/bmc/bmcpokr.cpp | 213 +++++++- src/mame/bmc/popobear.cpp | 92 ++-- src/mame/bordun/att.cpp | 666 ++++++++++++++++++++++++++ src/mame/{misc => bordun}/skylncr.cpp | 0 src/mame/igs/igs_m027.cpp | 46 +- src/mame/mame.lst | 59 ++- src/mame/misc/ddz.cpp | 8 +- 8 files changed, 1066 insertions(+), 80 deletions(-) create mode 100644 src/mame/bordun/att.cpp rename src/mame/{misc => bordun}/skylncr.cpp (100%) diff --git a/src/mame/aristocrat/aristmk6.cpp b/src/mame/aristocrat/aristmk6.cpp index c3333ef88a077..f2bdf13b6f2ff 100644 --- a/src/mame/aristocrat/aristmk6.cpp +++ b/src/mame/aristocrat/aristmk6.cpp @@ -588,10 +588,10 @@ typically at around 0x3100-0x3200, 0x3600-0x3700 for Left/Right BIOS dumps (2 fi ROM_LOAD32_WORD_BIOS( 1, "21012901_right.u83", 0x0000000, 0x0200000, CRC(757618f2) SHA1(43f9a3e7d544979f8c6974945914d9e099b02abd) ) /* From lucky88 & redbara6 */ \ ROM_LOAD32_WORD_BIOS( 1, "21012901_left.u70", 0x0000002, 0x0200000, CRC(0d271470) SHA1(5cd4b604bfe2fd7e9a8d08e1c7c97f17ae068479) ) \ ROM_SYSTEM_BIOS( 2, "au-nsw3", "Aristocrat MK6 Base (19012801, NSW/ACT)" ) \ - ROM_LOAD32_WORD_BIOS( 2, "19012801_right.u83", 0x0000000, 0x0200000, CRC(5b20a96c) SHA1(5fd916b7cc2cdd51bf7dd212c1114f94dc9c7926) ) /* From cactusco & cmtonig & heartveg & moonwalt */ \ + ROM_LOAD32_WORD_BIOS( 2, "19012801_right.u83", 0x0000000, 0x0200000, CRC(5b20a96c) SHA1(5fd916b7cc2cdd51bf7dd212c1114f94dc9c7926) ) /* From cactusco, cmtonig, heartveg & moonwalt */ \ ROM_LOAD32_WORD_BIOS( 2, "19012801_left.u70", 0x0000002, 0x0200000, CRC(b03bd17c) SHA1(f281e80f6dda5b727ed71d2deebe3b0ff548773f) ) \ ROM_SYSTEM_BIOS( 3, "au-nsw4", "Aristocrat MK6 Base (13012001, NSW/ACT)" ) \ - ROM_LOAD32_WORD_BIOS( 3, "13012001_right.u83", 0x0000000, 0x0200000, CRC(e627dbfa) SHA1(4fedbe0975ceb7dc0ebebf18a7708d78984db9b7) ) /* From grizzly & qnilea6 */ \ + ROM_LOAD32_WORD_BIOS( 3, "13012001_right.u83", 0x0000000, 0x0200000, CRC(e627dbfa) SHA1(4fedbe0975ceb7dc0ebebf18a7708d78984db9b7) ) /* From grizzly, mrwoo & qnilea6 */ \ ROM_LOAD32_WORD_BIOS( 3, "13012001_left.u70", 0x0000002, 0x0200000, CRC(38e8f659) SHA1(88c6acba99b0aca023c6f4d27c061c231490e9e0) ) \ ROM_SYSTEM_BIOS( 4, "au-nsw5", "Aristocrat MK6 Base (11011901, NSW/ACT)" ) \ ROM_LOAD32_WORD_BIOS( 4, "11011901_right.u83", 0x0000000, 0x0200000, CRC(73dcb11c) SHA1(69ae4f32a0c9141b2a82ff3935b0cd20333d2964) ) \ @@ -674,7 +674,7 @@ typically at around 0x3100-0x3200, 0x3600-0x3700 for Left/Right BIOS dumps (2 fi ROM_LOAD32_WORD_BIOS( 27, "01.04.11_right.u83", 0x0000000, 0x0200000, CRC(2dae8ca0) SHA1(7a0fb38b4c1ac7195d15bdab6f0cfb16c78430f0) ) /* From centrion */ \ ROM_LOAD32_WORD_BIOS( 27, "01.04.11_left.u70", 0x0000002, 0x0200000, CRC(787f2b07) SHA1(2548289e44f4b935346b759afb5383bdbac04c3e) ) \ ROM_SYSTEM_BIOS( 28, "us2", "Aristocrat MK6 Base (01.04.10, US)" ) \ - ROM_LOAD32_WORD_BIOS( 28, "01.04.10_right.u83", 0x0000000, 0x0200000, CRC(82ce2fcc) SHA1(4c8fb3db084a67e99d1420b3f895a06ce9ef5ec2) ) \ + ROM_LOAD32_WORD_BIOS( 28, "01.04.10_right.u83", 0x0000000, 0x0200000, CRC(82ce2fcc) SHA1(4c8fb3db084a67e99d1420b3f895a06ce9ef5ec2) ) /* From hrtantny */ \ ROM_LOAD32_WORD_BIOS( 28, "01.04.10_left.u70", 0x0000002, 0x0200000, CRC(9d9d52c1) SHA1(b957220cdbedd516c219d1bfc28807ce466df93f) ) \ ROM_SYSTEM_BIOS( 29, "us3", "Aristocrat MK6 Base (01.04.08, US)" ) \ ROM_LOAD32_WORD_BIOS( 29, "01.04.08_right.u83", 0x0000000, 0x0200000, CRC(95333304) SHA1(7afe49d6c5e4d6820f349778557daa88c5366a51) ) /* From bobdolly, also u10 on EPROM expansion board */ \ @@ -2998,6 +2998,30 @@ ROM_START( grizzly ) ROM_END +// 0252526 / MV4237 +// Heart Of Antony / Local / C - 05/23/05 +// Variations (% and NO): +// 87.920% 99 +// 90.128% 01 +// 91.921% 02 +// 94.916% 03 +// 97.058% 04 +ROM_START( hrtantny ) + ARISTMK6_BIOS + ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) + /* + 0252526-U86 Series:01 M27V322 Mk6USA Heart of Antony A79H1P14 1F62-BCA6 / 1EDB1DAE / 989A156E Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U73 Series:01 M27V322 Mk6USA Heart of Antony B26H6UAC D1B6-27A4 / 1EBB0279 / 8A72A1A7 Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U85 Series:01 M27V322 Mk6USA Heart of Antony 0PF54346 7A98-D033 / 067E3EC3 / 2F2F160F Copyright © 2004-2005 Aristocrat Technologies, Inc. + 0252526-U72 Series:01 M27V322 Mk6USA Heart of Antony D5AC1C2H 36D3-50DD / 064B641C / 210FC3DA Copyright © 2004-2005 Aristocrat Technologies, Inc. + */ + ROM_LOAD32_WORD("0252526.u86", 0x0000000, 0x0400000, CRC(88cfa3fc) SHA1(852a9db95246f9e39c29c231894d27c4f8bbc9ab) ) + ROM_LOAD32_WORD("0252526.u73", 0x0000002, 0x0400000, CRC(24e233af) SHA1(63e9886478e9d5790e7babe868a31071f81ef17f) ) + ROM_LOAD32_WORD("0252526.u85", 0x0800000, 0x0400000, CRC(3deb3b1c) SHA1(f5b80193bda500edb1049b1decacfaa43a391862) ) + ROM_LOAD32_WORD("0252526.u72", 0x0800002, 0x0400000, CRC(78c92f0e) SHA1(93690fcb6983876022a180ea633b7bea4519da1d) ) +ROM_END + + // 20169511 / 717/2 // Heart of Gold / Local / A - 15/09/03 // Variations (% and NO): @@ -3892,11 +3916,37 @@ ROM_START( mchilliq ) ROM_END +// 30215311 / 810 +// MR WOO / Local / K - 12/07/06 +// Variations (% and NO): +// 87.83% 99 +// 85.08% 01 +// 89.38% 02 +ROM_START( mrwoo ) + ARISTMK6_BIOS + ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) + /* + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U86 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U73 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U85 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U72 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U84 + 30215311 NSW MR WOO 810 4MB 6 eproms Aristocrat © 2006 P U71 + */ + ROM_LOAD32_WORD("30215311.u86", 0x0000000, 0x0400000, CRC(674a187d) SHA1(d4c38fff6c3ba43284b51ec13f98c2b1badc7b98) ) + ROM_LOAD32_WORD("30215311.u73", 0x0000002, 0x0400000, CRC(be90b4d1) SHA1(b49002389abbcc5db625d8eaffd2b4616cd4cdc2) ) + ROM_LOAD32_WORD("30215311.u85", 0x0800000, 0x0400000, CRC(7e9ed3eb) SHA1(b74aff123187c61c59195770b4cd70d9d691d666) ) + ROM_LOAD32_WORD("30215311.u72", 0x0800002, 0x0400000, CRC(20097531) SHA1(af733cbd85a0da8fccd7d1063f4be53086a4aa4a) ) + ROM_LOAD32_WORD("30215311.u84", 0x1000000, 0x0400000, CRC(6d306fc4) SHA1(06688a14c4094f0638543c29683f5c51f877d310) ) + ROM_LOAD32_WORD("30215311.u71", 0x1000002, 0x0400000, CRC(21373aeb) SHA1(34eec46f8912ace47cce7f856b07d7a7900aa125) ) +ROM_END + + // 0252599 / MV4276 // MR WOO / Local / N/A // Variations (% and NO): // 80.314% 99 -ROM_START( mrwoo ) +ROM_START( mrwoou ) ARISTMK6_BIOS ROM_REGION64_LE( 0x4000000, "game_rom", ROMREGION_ERASEFF) /* @@ -6713,6 +6763,7 @@ GAME( 2002, goldpym, qnilese, aristmk6, aristmk6, aristmk6_state, empty_init GAME( 2007, goldsam, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Golden Samurai (10247811, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 832, A - 31/07/07 GAME( 2002, gbmoney, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "The Good, The Bad & The Money (0351016, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // US023, B - 09/11/02 GAME( 2006, grizzly, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Grizzly (10214711, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 780, C - 12/04/06 +GAME( 2005, hrtantny, antcleo, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Antony (0252526, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4237, C - 05/23/05 GAME( 2003, heartgld, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Gold (20169511, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/2, A - 15/09/03 GAME( 2004, heartglda, heartgld, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Gold (10184211, ASP)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/2, B - 10/03/04 GAME( 2006, heartveg, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Heart of Vegas (10232911, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 717/4, C - 27/06/06 @@ -6763,7 +6814,8 @@ GAME( 2000, mnytree, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init GAME( 2001, mnytreea, mnytree, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Money Tree (10122211, ASP)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 657, F - 14/03/01 GAME( 2004, moonfire, indream, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Moon Fire - Jackpot Carnival (30164211, Queensland)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 628/3, E - 27/01/04 GAME( 2007, moonwalt, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Moonlight Waltz (10227611, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 814/1, B - 11/01/07 -GAME( 200?, mrwoo, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (0252599, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4276, (no data) +GAME( 2006, mrwoo, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (30215311, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 810, K - 12/07/06 +GAME( 200?, mrwoou, mrwoo, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mr Woo (0252599, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // MV4276, (no data) GAME( 2005, mskitty, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Miss Kitty (10216611, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 778, C - 18/04/05 GAME( 2002, mystarr, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mystic Arrow (0151009, US)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // US005, A - 01/07/02 GAME( 2001, mysteycm, aristmk6, aristmk6, aristmk6, aristmk6_state, empty_init, ROT0, "Aristocrat", "Mystic Eyes - Mr. Cashman (10008111, NSW/ACT)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) // 675, A- 09/05/01 diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 511d059b7548e..84dd63d70226a 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -17,6 +17,7 @@ Other: BMC B816140 (CPLD) * Hopper hookup doesn't work properly. MAME counts far more "tickets dispensed" than the number of coins/tickets the games are supposed to pay out. + * xyddzhh: Hook up mahjong-style inputs and improve DSW definitions ***************************************************************************/ @@ -60,13 +61,14 @@ class bmcpokr_state : public driver_device int hopper_r(); - void bmcpokr(machine_config &config); - void fengyunh(machine_config &config); - void mjmaglmp(machine_config &config); - void shendeng(machine_config &config); + void bmcpokr(machine_config &config) ATTR_COLD; + void fengyunh(machine_config &config) ATTR_COLD; + void mjmaglmp(machine_config &config) ATTR_COLD; + void shendeng(machine_config &config) ATTR_COLD; + void xyddzhh(machine_config &config) ATTR_COLD; protected: - virtual void device_post_load() override; + virtual void device_post_load() override ATTR_COLD; virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; @@ -88,6 +90,7 @@ class bmcpokr_state : public driver_device uint16_t bmcpokr_prot_r(); uint16_t fengyunh_prot_r(); uint16_t shendeng_prot_r(); + uint16_t xyddzhh_prot_r(); void prot_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint16_t unk_r(); @@ -100,6 +103,7 @@ class bmcpokr_state : public driver_device uint16_t dsw_r(); uint16_t mjmaglmp_dsw_r(); uint16_t mjmaglmp_key_r(); + uint16_t xyddzhh_dsw_r(); // Interrupts uint8_t m_irq_enable = 0; @@ -126,6 +130,7 @@ class bmcpokr_state : public driver_device void mjmaglmp_map(address_map &map) ATTR_COLD; void ramdac_map(address_map &map) ATTR_COLD; void shendeng_map(address_map &map) ATTR_COLD; + void xyddzhh_map(address_map &map) ATTR_COLD; }; /*************************************************************************** @@ -352,6 +357,17 @@ uint16_t bmcpokr_state::shendeng_prot_r() return 0x00 << 8; } +uint16_t bmcpokr_state::xyddzhh_prot_r() +{ + switch (m_prot_val >> 8) + { + case 0x00: return 0x56 << 8; + // TODO: other cases, if they exist + } + logerror("unk prot r %x %x\n", m_prot_val, m_maincpu->pcbase()); + return 0x00 << 8; +} + void bmcpokr_state::prot_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_prot_val); @@ -446,6 +462,27 @@ void bmcpokr_state::bmcpokr_mem(address_map &map) map(0x3b0000, 0x3b0001).portr("INPUTS2"); } +uint16_t bmcpokr_state::xyddzhh_dsw_r() +{ + switch ((m_mux >> 4) & 3) + { + case 0x00: return m_dsw[3]->read() << 8; + case 0x01: return m_dsw[2]->read() << 8; + case 0x02: return m_dsw[1]->read() << 8; + case 0x03: return m_dsw[0]->read() << 8; + } + return 0xff << 8; +} + +void bmcpokr_state::xyddzhh_map(address_map &map) +{ + bmcpokr_mem(map); + + map(0x330000, 0x330001).r(FUNC(bmcpokr_state::xyddzhh_prot_r)); + map(0x340009, 0x340009).lr8(NAME([] () -> uint8_t { return 0xff; })); // andi.b #$7f, so returning 0x00 stops it from working + map(0x360000, 0x360001).r(FUNC(bmcpokr_state::xyddzhh_dsw_r)); +} + uint16_t bmcpokr_state::mjmaglmp_dsw_r() { @@ -1090,6 +1127,136 @@ static INPUT_PORTS_START( shendeng ) // Coin Cash Out | Cash Out Coin INPUT_PORTS_END +static INPUT_PORTS_START( xyddzhh ) + PORT_START("INPUTS") + // Entertainment controls: + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // choose + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Pay Out") PORT_CODE(KEYCODE_O) // PAY // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bmcpokr_state::hopper_r)) // TODO: verify? + PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_SERVICE1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // no effect in test mode + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON2 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) // pass + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) // PORT_CONDITION("DSW2",0x01,EQUALS,0x00) PORT_IMPULSE(5) + + // TODO: Mahjong controls: + + PORT_START("INPUTS2") + PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNUSED ) + + // Maximum Bet is fixed to 40 according to test mode (no DIP determines it) + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP1:1") + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPSETTING( 0x01, DEF_STR( No ) ) + PORT_DIPNAME( 0x02, 0x02, "Key Out Table as" ) PORT_DIPLOCATION("DIP1:2") + PORT_DIPSETTING( 0x00, "Coin" ) + PORT_DIPSETTING( 0x02, "Key In" ) + PORT_DIPNAME( 0x04, 0x04, "Coin Out" ) PORT_DIPLOCATION("DIP1:3") + PORT_DIPSETTING( 0x04, DEF_STR( No ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x08, 0x08, "Alarm Sound Effect" ) PORT_DIPLOCATION("DIP1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x08, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, "Automatic Pass" ) PORT_DIPLOCATION("DIP1:5") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, "Performance Breaking Table" ) PORT_DIPLOCATION("DIP1:6,7,8") + PORT_DIPSETTING( 0xc0, "5000" ) + PORT_DIPSETTING( 0xe0, "10000" ) + PORT_DIPSETTING( 0xa0, "15000" ) + PORT_DIPSETTING( 0x80, "20000" ) + PORT_DIPSETTING( 0x60, "25000" ) + PORT_DIPSETTING( 0x40, "30000" ) + PORT_DIPSETTING( 0x20, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x00, "Controls" ) PORT_DIPLOCATION("DIP2:1") + PORT_DIPSETTING( 0x01, "Mahjong" ) + PORT_DIPSETTING( 0x00, "Entertainment" ) + PORT_DIPNAME( 0x06, 0x06, "Play Expiration" ) PORT_DIPLOCATION("DIP2:2,3") + PORT_DIPSETTING( 0x06, "3000" ) + PORT_DIPSETTING( 0x04, "4000" ) + PORT_DIPSETTING( 0x02, "5000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPNAME( 0x08, 0x08, "Accumulated Bonus" ) PORT_DIPLOCATION("DIP2:4") + PORT_DIPSETTING( 0x08, "300" ) + PORT_DIPSETTING( 0x00, "400" ) + PORT_DIPNAME( 0x70, 0x70, "Continuing Play Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") + PORT_DIPSETTING( 0x60, "92" ) + PORT_DIPSETTING( 0x50, "93" ) + PORT_DIPSETTING( 0x40, "94" ) + PORT_DIPSETTING( 0x70, "95" ) + PORT_DIPSETTING( 0x30, "96" ) + PORT_DIPSETTING( 0x20, "97" ) + PORT_DIPSETTING( 0x10, "98" ) + PORT_DIPSETTING( 0x00, "99" ) + PORT_DIPNAME( 0x80, 0x80, "Continue Play" ) PORT_DIPLOCATION("DIP2:8") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage) ) PORT_DIPLOCATION("DIP3:1,2,3") + PORT_DIPSETTING( 0x06, "1" ) + PORT_DIPSETTING( 0x05, "2" ) + PORT_DIPSETTING( 0x04, "5" ) + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "15" ) + PORT_DIPSETTING( 0x01, "50" ) + PORT_DIPSETTING( 0x07, "100" ) + PORT_DIPSETTING( 0x00, "200" ) + PORT_DIPNAME( 0x38, 0x38, "Key In" ) PORT_DIPLOCATION("DIP3:4,5,6") + PORT_DIPSETTING( 0x30, "40" ) + PORT_DIPSETTING( 0x28, "50" ) + PORT_DIPSETTING( 0x38, "100" ) + PORT_DIPSETTING( 0x20, "200" ) + PORT_DIPSETTING( 0x18, "300" ) + PORT_DIPSETTING( 0x10, "500" ) + PORT_DIPSETTING( 0x08, "1000" ) + PORT_DIPSETTING( 0x00, "2000" ) + PORT_DIPNAME( 0x40, 0x40, "Points Limit" ) PORT_DIPLOCATION("DIP3:7") + PORT_DIPSETTING( 0x00, "10000" ) + PORT_DIPSETTING( 0x40, "99000" ) + PORT_DIPNAME( 0x80, 0x80, "Card Type" ) PORT_DIPLOCATION("DIP3:8") + PORT_DIPSETTING( 0x80, DEF_STR ( Normal ) ) + PORT_DIPSETTING( 0x00, "Graphics" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x07, 0x07, "Min Bet" ) PORT_DIPLOCATION("DIP4:1,2,3") + PORT_DIPSETTING( 0x06, "1" ) + PORT_DIPSETTING( 0x05, "2" ) + PORT_DIPSETTING( 0x04, "3" ) + PORT_DIPSETTING( 0x07, "5" ) + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "15" ) + PORT_DIPSETTING( 0x01, "20" ) + PORT_DIPSETTING( 0x00, "40" ) + PORT_DIPNAME( 0x38, 0x38, "Game Odds" ) PORT_DIPLOCATION("DIP4:4,5,6") + PORT_DIPSETTING( 0x30, "90" ) + PORT_DIPSETTING( 0x28, "91" ) + PORT_DIPSETTING( 0x20, "92" ) + PORT_DIPSETTING( 0x18, "93" ) + PORT_DIPSETTING( 0x38, "94" ) + PORT_DIPSETTING( 0x10, "95" ) + PORT_DIPSETTING( 0x08, "96" ) + PORT_DIPSETTING( 0x00, "97" ) + PORT_DIPNAME( 0x40, 0x40, "Market Setting" ) PORT_DIPLOCATION("DIP4:7") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x40, DEF_STR( On ) ) + PORT_DIPNAME( 0x80, 0x80, "System Breakdown" ) PORT_DIPLOCATION("DIP4:8") + PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPSETTING( 0x80, "100000" ) +INPUT_PORTS_END + /*************************************************************************** Graphics Layout @@ -1189,6 +1356,12 @@ void bmcpokr_state::shendeng(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &bmcpokr_state::shendeng_map); } +void bmcpokr_state::xyddzhh(machine_config &config) +{ + bmcpokr(config); + m_maincpu->set_addrmap(AS_PROGRAM, &bmcpokr_state::xyddzhh_map); +} + /*************************************************************************** ROMs Loading ***************************************************************************/ @@ -1386,6 +1559,27 @@ ROM_START( bmcpokr ) ROM_LOAD( "ch-m-701.u10", 0x00000, 0x40000, CRC(e01be644) SHA1(b68682786d5b40cb5672cfd7f717adcfb8fac7d3) ) ROM_END +/* +幸运斗地主 (Xìngyùn Dòu Dìzhǔ - Lucky Dou Dizhu), Herb Home, 2006 +PCB Number: BMC-A81210 +PCB is identical to BMC-A81212 (documented) +*/ + +ROM_START( xyddzhh ) + ROM_REGION( 0x40000, "maincpu", 0 ) // 68000 Code + ROM_LOAD16_BYTE( "c1-a-601.u13", 0x000000, 0x20000, CRC(7f06ba9f) SHA1(747110ebc674867f858348d41f3e5b8b8167a816) ) + ROM_LOAD16_BYTE( "c1-a-501.u12", 0x000001, 0x20000, CRC(1522fe48) SHA1(7636c00f8735ec031b0218a2ed348c7d4fa3f66d) ) + + ROM_REGION( 0x200000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "c4-a-101.u39", 0x000000, 0x80000, CRC(28e945b6) SHA1(cee74fa35234d7b2d19ca4354b17a4223f28a153) ) + ROM_LOAD16_BYTE( "c4-a-201.u40", 0x000001, 0x80000, CRC(b2730f93) SHA1(f002cf6e632ce46ce3a5a2293748dfc2f5b47563) ) + ROM_LOAD16_BYTE( "c4-a-301.u45", 0x100000, 0x80000, CRC(02dd38d5) SHA1(bc563b6f556c790667efef6e6af09fb76cae50e6) ) + ROM_LOAD16_BYTE( "c4-a-401.u29", 0x100001, 0x80000, CRC(24c2f883) SHA1(275fb3d47447d524994ca5ee26be8c8a2b69608c) ) + + ROM_REGION( 0x80000, "oki", 0 ) // Samples + ROM_LOAD( "c4-a-701.u10", 0x00000, 0x80000, CRC(f22dacfe) SHA1(0a085419b04a6eba0d30064fae4678e1523e4e15) ) +ROM_END + /*************************************************************************** Mahou no Lamp (BMC, 2000) @@ -1442,7 +1636,8 @@ ROM_END } // anonymous namespace -GAME( 1998, fengyunh, 0, fengyunh, fengyunh, bmcpokr_state, empty_init, ROT0, "BMC", "Fengyun Hui", MACHINE_SUPPORTS_SAVE ) -GAME( 1998, shendeng, mjmaglmp, shendeng, shendeng, bmcpokr_state, empty_init, ROT0, "BMC", "Pili Shen Deng", MACHINE_SUPPORTS_SAVE ) -GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, bmcpokr_state, empty_init, ROT0, "BMC", "Dongfang Shenlong", MACHINE_SUPPORTS_SAVE ) -GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, bmcpokr_state, empty_init, ROT0, "BMC", "Mahou no Lamp (v. JAA02)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, fengyunh, 0, fengyunh, fengyunh, bmcpokr_state, empty_init, ROT0, "BMC", "Fengyun Hui", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, shendeng, mjmaglmp, shendeng, shendeng, bmcpokr_state, empty_init, ROT0, "BMC", "Pili Shen Deng", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, bmcpokr_state, empty_init, ROT0, "BMC", "Dongfang Shenlong", MACHINE_SUPPORTS_SAVE ) +GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, bmcpokr_state, empty_init, ROT0, "BMC", "Mahou no Lamp (v. JAA02)", MACHINE_SUPPORTS_SAVE ) +GAME( 2006, xyddzhh, 0, xyddzhh, xyddzhh, bmcpokr_state, empty_init, ROT0, "Herb Home", "Xingyun Dou Dizhu", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/bmc/popobear.cpp b/src/mame/bmc/popobear.cpp index 1d29d2fdc2c2d..b69cee41ac181 100644 --- a/src/mame/bmc/popobear.cpp +++ b/src/mame/bmc/popobear.cpp @@ -17,31 +17,55 @@ Popo Bear (c) 2000 BMC =================================================================================================== -Popo Bear - BMC-A00211 -(c) 2000 - Bao Ma Technology Co., LTD - -|-----------------------------------------| -| DIP2 DIP4 UM3567(YM2413) |J -| DIP1 DIP3 |A -| TA-A-901 |M -| EN-A-701 EN-A-801 U6295(OKI) |M -| EN-A-501 EN-A-601 |A -| EN-A-301 EN-A-401 | -| |C -| AIA90610 |O -| BMC-68pin AIA90423 |N -| plcc (68k) BMC-160pin |N -| |E -| OSC |C -| 42.000 |T -|-----------------------------------------| - -1 - BMC AIA90423 - 160-Pin ASIC, FPGA, Video? -1 - BMC AIA90610 - 68 Pin CPU (Likely 16 MHz, 68-lead plastic LCC 68000) -1 - UM3567 (YM2413) Sound -1 - U6295 (OKI6295) Sound -1 - 42.000MHz XTAL -4 - 8 Position DIP switches +Qi Wang (2010, Herb Home). English title is 'Chess King' +Popo Bear (2000, Bao Ma Technology Co., LTD) +Hardware Info by Guru +--------------------- + +BMC-A00211 +|---------------------------------------------| +| 42MHz TR5116258 241024 241024 T518 556 SC | +| TR5116258 241024 241024 SW | +| U10 | +| |--------| |-------| 6264 6264 | +| | BMC | | BMC | | +| |AIA90423| |AIA90610 | +|J | | | | 2 1 | +|A | | |-------| | +|M |--------| MJ-04.U4 A-3.U3 | +|M PLCC44 | +|A MJ-68.U6 MJ-57.U5 | +| | +| 8 7 | +| ULN2003 | +| MJ-09.U9 DIP3 DIP1| +| 7805 6295 | +| TDA2003 VOL LM324 UM3567 DIP4 DIP2| +|---------------------------------------------| +Notes: + AIA90610 - Rebadged 68000 CPU. Clock 10.500MHz [42/4] + AIA90423 - BMC Custom Graphics Chip + UM3567 - Yamaha YM2413-compatible Sound Chip. Clock 3.500MHz [42/12] + 6295 - Oki M6295 ADPCM Sample Player. Clock 1.000MHz [42/42]. Pin 7 HIGH. + TR5116258 - 256kB x16-bit DRAM, equivalent to HM514260 \ + 241024 - Winbond W241024 128kB x8-bit SRAM / connected to graphics chip + 6264 - 8kB x8-bit SRAM (68000 RAM). Both RAMs are tied to the Super Cap. + PLCC44 - 44 pin CPLD (surface scratched) + 1,2,7,8 - Empty Sockets + T518 - Mitsumi PST518A Master Reset IC + 556 - NE556 Dual Timer + SC - 5.5V 0.1F Super Capacitor + SW - Reset Switch / NVRAM Memory Clear + U10 - Unpopulated position for a 32Mbit/64Mbit TSOP48 Flash ROM (jumper-selectable) + ROMs - U5/U6 are 27C801 EPROM, other ROMs are 27C010. + ROM U5 is unique to this set (only ROM fill change), other ROMs match existing qiwang dump. + DIP1-4 - 8-position DIP Switch + TDA2003 - ST TDA2003 10W Audio Amplifier + LM324 - LM324 Quad Op-Amp + 7805 - LM7805 5V Linear Regulator + ULN2003 - 7-Channel Darlington Transistor Array + V-Sync 59.6377Hz + H-Sync 15.6248kHz JAMMA CONNECTOR Component Side A B Solder Side @@ -594,12 +618,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(popobear_state::scanline_cb) void popobear_state::popobear(machine_config &config) { - M68000(config, m_maincpu, XTAL(42'000'000) / 4); // divisor guessed + M68000(config, m_maincpu, 42_MHz_XTAL / 4); m_maincpu->set_addrmap(AS_PROGRAM, &popobear_state::main_map); TIMER(config, "scantimer").configure_scanline(FUNC(popobear_state::scanline_cb), "screen", 0, 1); SCREEN(config, m_screen, SCREEN_TYPE_RASTER); - m_screen->set_refresh_hz(60); + m_screen->set_refresh_hz(59.64); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate m_screen->set_screen_update(FUNC(popobear_state::screen_update)); m_screen->set_palette(m_palette); @@ -612,9 +636,9 @@ void popobear_state::popobear(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_popobear); - YM2413(config, "ymsnd", XTAL(42'000'000) / 16).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + YM2413(config, "ymsnd", 42_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 1.0); - OKIM6295(config, "oki", XTAL(42'000'000) / 32, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); // divisor guessed + OKIM6295(config, "oki", 42_MHz_XTAL / 42, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); } void popobear_state::qiwang(machine_config &config) @@ -626,14 +650,14 @@ void popobear_state::qiwang(machine_config &config) ROM_START( popobear ) ROM_REGION( 0x040000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "popobear_en-a-301_1.6.u3", 0x000001, 0x020000, CRC(b934adf6) SHA1(93431c7a19af812b549aad35cc1176a81805ffab) ) ROM_LOAD16_BYTE( "popobear_en-a-401_1.6.u4", 0x000000, 0x020000, CRC(0568af9c) SHA1(920531dbc4bbde2d1db062bd5c48b97dd50b7185) ) + ROM_LOAD16_BYTE( "popobear_en-a-301_1.6.u3", 0x000001, 0x020000, CRC(b934adf6) SHA1(93431c7a19af812b549aad35cc1176a81805ffab) ) ROM_REGION16_BE( 0x400000, "gfx_data", 0 ) - ROM_LOAD16_BYTE( "popobear_en-a-501.u5", 0x000001, 0x100000, CRC(185901a9) SHA1(7ff82b5751645df53435eaa66edce589684cc5c7) ) ROM_LOAD16_BYTE( "popobear_en-a-601.u6", 0x000000, 0x100000, CRC(84fa9f3f) SHA1(34dd7873f88b0dae5fb81fe84e82d2b6b49f7332) ) - ROM_LOAD16_BYTE( "popobear_en-a-701.u7", 0x200001, 0x100000, CRC(45eba6d0) SHA1(0278602ed57ac45040619d590e6cc85e2cfeed31) ) + ROM_LOAD16_BYTE( "popobear_en-a-501.u5", 0x000001, 0x100000, CRC(185901a9) SHA1(7ff82b5751645df53435eaa66edce589684cc5c7) ) ROM_LOAD16_BYTE( "popobear_en-a-801.u8", 0x200000, 0x100000, CRC(2760f2e6) SHA1(58af59f486c9df930f7c124f89154f8f389a5bd7) ) + ROM_LOAD16_BYTE( "popobear_en-a-701.u7", 0x200001, 0x100000, CRC(45eba6d0) SHA1(0278602ed57ac45040619d590e6cc85e2cfeed31) ) ROM_REGION( 0x040000, "oki", 0 ) ROM_LOAD( "popobear_ta-a-901.u9", 0x00000, 0x40000, CRC(f1e94926) SHA1(f4d6f5b5811d90d0069f6efbb44d725ff0d07e1c) ) @@ -643,13 +667,13 @@ ROM_END // All labels have 棋王 prepended to what's below, with the exception of mj-57 which has a sticker 'BMC 棋王' on the upper part of the label ROM_START( qiwang ) ROM_REGION( 0x040000, "maincpu", 0 ) - ROM_LOAD16_BYTE( "mj-03.u3", 0x000001, 0x020000, CRC(3cf3ff12) SHA1(dd4347b44a45822e7bfddffb0afadd65d398bea6) ) ROM_LOAD16_BYTE( "mj-04.u4", 0x000000, 0x020000, CRC(03a0d290) SHA1(d8fb1e6780d31ebf8cdc6ae14301d1f8c25380c6) ) + ROM_LOAD16_BYTE( "mj-03.u3", 0x000001, 0x020000, CRC(3cf3ff12) SHA1(dd4347b44a45822e7bfddffb0afadd65d398bea6) ) // u1 and u2 not populated ROM_REGION16_BE( 0x400000, "gfx_data", ROMREGION_ERASE00 ) - ROM_LOAD16_BYTE( "mj-57.u5", 0x000001, 0x100000, CRC(50871b0c) SHA1(01279d844cae699eb76a90b8c4b3915ae538c12e) ) ROM_LOAD16_BYTE( "mj-68.u6", 0x000000, 0x100000, CRC(9692bb92) SHA1(6282054a41eda1b1fc1de5096bc2440a386d9f99) ) + ROM_LOAD16_BYTE( "mj-57.u5", 0x000001, 0x100000, CRC(d442e579) SHA1(86d840ce9cd2623f13658f75336847f5df306531) ) // u7 and u8 not populated ROM_REGION( 0x040000, "oki", 0 ) diff --git a/src/mame/bordun/att.cpp b/src/mame/bordun/att.cpp new file mode 100644 index 0000000000000..1b4f01d96381f --- /dev/null +++ b/src/mame/bordun/att.cpp @@ -0,0 +1,666 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Bordun poker games on ATT / ATT III PCBs + + +TODO: +* this is basically misc/skylncr.cpp without reels and PPIs and with more advanced sound. Merge? +* outputs +* lianhp3: title screen says 2003TM but PCB is from 2010? Was this really released in 2003? +* NVRAM at 0x8000-0x8777 +*/ + + +#include "emu.h" + +#include "cpu/z80/z80.h" +#include "machine/gen_latch.h" +#include "machine/nvram.h" +#include "sound/okim6295.h" +#include "sound/ymopl.h" +#include "video/ramdac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class att_state : public driver_device +{ +public: + att_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram") + { } + + void att(machine_config &config) ATTR_COLD; + void att3(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + required_device m_maincpu; + required_device m_gfxdecode; + + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + + tilemap_t *m_tilemap = nullptr; + + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map) ATTR_COLD; + void att_io_map(address_map &map) ATTR_COLD; + void att3_io_map(address_map &map) ATTR_COLD; + void att_audio_program_map(address_map &map) ATTR_COLD; + void att_audio_io_map(address_map &map) ATTR_COLD; + void ramdac_map(address_map &map) ATTR_COLD; +}; + + +void att_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + +void att_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_tilemap->mark_tile_dirty(offset); +} + + +TILE_GET_INFO_MEMBER(att_state::get_tile_info) +{ + uint16_t const code = m_videoram[tile_index] + (m_colorram[tile_index] << 8); + int const pal = (code & 0x8000) >> 15; + tileinfo.set(0, code, pal ^ 1, TILE_FLIPYX( 0 )); +} + +uint32_t att_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(rgb_t::black(), cliprect); + + m_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + +void att_state::video_start() +{ + m_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(att_state::get_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + + +void att_state::program_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0x8000, 0x87ff).ram().share("nvram"); + map(0x8800, 0x8fff).ram().w(FUNC(att_state::videoram_w)).share(m_videoram); + map(0x9000, 0x97ff).ram().w(FUNC(att_state::colorram_w)).share(m_colorram); +} + +void att_state::att_io_map(address_map &map) +{ + map.global_mask(0xff); + map.unmap_value_high(); + + map(0x00, 0x00).portr("IN0"); + map(0x01, 0x01).portr("IN1"); + map(0x02, 0x02).portr("DSW3"); + map(0x03, 0x03).portr("DSW2"); + map(0x10, 0x10).portr("DSW4"); + map(0x11, 0x11).portr("IN2"); + map(0x12, 0x12).portr("DSW1"); + // map(0x20, 0x20) // TODO: coin counter / outputs? + map(0x40, 0x40).w("ramdac", FUNC(ramdac_device::index_w)); + map(0x41, 0x41).w("ramdac", FUNC(ramdac_device::pal_w)); + map(0x42, 0x42).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x70, 0x70).nopw(); // TODO: NMI clear? NOPed for now as it spams the log + map(0xd0, 0xd0).w("soundlatch", FUNC(generic_latch_8_device::write)); +} + +void att_state::att3_io_map(address_map &map) +{ + map.global_mask(0xff); + map.unmap_value_high(); + + map(0x00, 0x00).portr("IN0"); + map(0x01, 0x01).portr("IN1"); + map(0x02, 0x02).portr("DSW3"); + map(0x03, 0x03).portr("DSW2"); + map(0x10, 0x10).portr("DSW4"); + map(0x11, 0x11).portr("IN2"); + map(0x12, 0x12).portr("DSW1"); + // map(0x20, 0x20) // TODO: coin counter / outputs? + map(0x40, 0x40).w("ramdac", FUNC(ramdac_device::index_w)); + map(0x41, 0x41).w("ramdac", FUNC(ramdac_device::pal_w)); + map(0x42, 0x42).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x70, 0x70).nopw(); // TODO: NMI clear? NOPed for now as it spams the log + // map(0xf6, 0xf6).w // TODO: Oki bank select? + map(0xf7, 0xf7).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); +} + +void att_state::att_audio_program_map(address_map &map) +{ + map(0x0000, 0x3fff).rom(); + map(0x4000, 0x41ff).ram(); + map(0xf800, 0xffff).ram(); +} + +void att_state::att_audio_io_map(address_map &map) +{ + // TODO: lots of reads / writes + map.global_mask(0xff); + + map(0x84, 0x84).r("soundlatch", FUNC(generic_latch_8_device::read)); + map(0x90, 0x91).w("ym2413", FUNC(ym2413_device::write)); +} + + +void att_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + + +static INPUT_PORTS_START( lianhp2 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // active high or it stops after RAM check + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + + PORT_START("IN1") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + + // SW1 on PCB is the reset button and SW2-5 are the DIP switches + // test mode shows SW1-4 for the DIPs + // thus to avoid user confusion let's follow the test mode + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW1:8,7") // hard-coded to 100? + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "100 (duplicate)" ) + PORT_DIPSETTING( 0x01, "100 (duplicate)" ) + PORT_DIPSETTING( 0x00, "100 (duplicate)" ) + PORT_DIPNAME( 0x04, 0x04, "Clear Point As" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Create Point" ) + PORT_DIPSETTING( 0x00, "Coin" ) + PORT_DIPNAME( 0x08, 0x08, "Bonus Rate" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, "32" ) + PORT_DIPSETTING( 0x08, "48" ) + PORT_DIPNAME( 0x10, 0x10, "Straight Double Up" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Double Up" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Card Type" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x40, "Poker" ) + PORT_DIPSETTING( 0x00, "Animals" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") // not shown in test mode + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Begin Bonus" ) PORT_DIPLOCATION("SW2:8,7") + PORT_DIPSETTING( 0x03, "2000" ) + PORT_DIPSETTING( 0x02, "4000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPSETTING( 0x00, "8000" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // not shown in test mode + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // not shown in test mode + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // not shown in test mode + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") + PORT_DIPSETTING( 0xe0, "1" ) + PORT_DIPSETTING( 0xc0, "5" ) + PORT_DIPSETTING( 0xa0, "10" ) + PORT_DIPSETTING( 0x80, "25" ) + PORT_DIPSETTING( 0x60, "50" ) + PORT_DIPSETTING( 0x40, "100" ) + PORT_DIPSETTING( 0x20, "250" ) + PORT_DIPSETTING( 0x00, "500" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) PORT_DIPLOCATION("SW3:8,7") + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPSETTING( 0x02, "2" ) + PORT_DIPSETTING( 0x01, "4" ) + PORT_DIPSETTING( 0x00, "10" ) + PORT_DIPNAME( 0x1c, 0x1c, "Double Up Rate" ) PORT_DIPLOCATION("SW3:6,5,4") + PORT_DIPSETTING( 0x00, "86" ) + PORT_DIPSETTING( 0x04, "87" ) + PORT_DIPSETTING( 0x08, "88" ) + PORT_DIPSETTING( 0x0c, "89" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "91" ) + PORT_DIPSETTING( 0x18, "92" ) + PORT_DIPSETTING( 0x1c, "93" ) + PORT_DIPNAME( 0xe0, 0xe0, "Play Rate" ) PORT_DIPLOCATION("SW3:3,2,1") // hard-coded to 100? + PORT_DIPSETTING( 0xe0, "100" ) + PORT_DIPSETTING( 0xc0, "100 (duplicate)" ) + PORT_DIPSETTING( 0xa0, "100 (duplicate)" ) + PORT_DIPSETTING( 0x80, "100 (duplicate)" ) + PORT_DIPSETTING( 0x60, "100 (duplicate)" ) + PORT_DIPSETTING( 0x40, "100 (duplicate)" ) + PORT_DIPSETTING( 0x20, "100 (duplicate)" ) + PORT_DIPSETTING( 0x00, "100 (duplicate)" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x03, 0x03, "4 K Rate" ) PORT_DIPLOCATION("SW4:8,7") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x01, "70" ) + PORT_DIPSETTING( 0x02, "80" ) + PORT_DIPSETTING( 0x03, "90" ) + PORT_DIPNAME( 0x0c, 0x0c, "S F Rate" ) PORT_DIPLOCATION("SW4:6,5") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x04, "70" ) + PORT_DIPSETTING( 0x08, "80" ) + PORT_DIPSETTING( 0x0c, "90" ) + PORT_DIPNAME( 0x30, 0x30, "R S Rate" ) PORT_DIPLOCATION("SW4:4,3") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "80" ) + PORT_DIPSETTING( 0x30, "90" ) + PORT_DIPNAME( 0xc0, 0xc0, "5 K Rate" ) PORT_DIPLOCATION("SW4:2,1") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x80, "80" ) + PORT_DIPSETTING( 0xc0, "90" ) +INPUT_PORTS_END + +static INPUT_PORTS_START( lianhp3 ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + + PORT_START("IN1") + PORT_SERVICE_NO_TOGGLE( 0x01, IP_ACTIVE_LOW ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + + // SW1 on PCB is the reset button and SW2-5 are the DIP switches + // test mode shows SW1-4 for the DIPs + // thus to avoid user confusion let's follow the test mode + + PORT_START("DSW1") + PORT_DIPNAME( 0x03, 0x03, "Max Bet" ) PORT_DIPLOCATION("SW1:8,7") + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "500" ) + PORT_DIPSETTING( 0x01, "1000" ) + PORT_DIPSETTING( 0x00, "1500" ) + PORT_DIPNAME( 0x04, 0x04, "Clear Point As" ) PORT_DIPLOCATION("SW1:6") + PORT_DIPSETTING( 0x04, "Coin" ) + PORT_DIPSETTING( 0x00, "Create Point" ) + PORT_DIPNAME( 0x08, 0x08, "Bonus Rate" ) PORT_DIPLOCATION("SW1:5") + PORT_DIPSETTING( 0x00, "32" ) + PORT_DIPSETTING( 0x08, "48" ) + PORT_DIPNAME( 0x10, 0x10, "Straight Double Up" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x10, DEF_STR( On ) ) + PORT_DIPNAME( 0x20, 0x20, "Double Up" ) PORT_DIPLOCATION("SW1:3") + PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x20, DEF_STR( On ) ) + PORT_DIPNAME( 0x40, 0x40, "Card Type" ) PORT_DIPLOCATION("SW1:2") + PORT_DIPSETTING( 0x40, "Poker" ) + PORT_DIPSETTING( 0x00, "Animals" ) + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:1") // not shown in test mode + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Begin Bonus" ) PORT_DIPLOCATION("SW2:8,7") + PORT_DIPSETTING( 0x03, "2000" ) + PORT_DIPSETTING( 0x02, "4000" ) + PORT_DIPSETTING( 0x01, "6000" ) + PORT_DIPSETTING( 0x00, "8000" ) + PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") // not shown in test mode + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") // not shown in test mode + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") // not shown in test mode + PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xe0, 0xe0, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW2:3,2,1") + PORT_DIPSETTING( 0xe0, "10" ) + PORT_DIPSETTING( 0xc0, "50" ) + PORT_DIPSETTING( 0xa0, "100" ) + PORT_DIPSETTING( 0x80, "250" ) + PORT_DIPSETTING( 0x60, "500" ) + PORT_DIPSETTING( 0x40, "1000" ) + PORT_DIPSETTING( 0x20, "2500" ) + PORT_DIPSETTING( 0x00, "5000" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Min Bet" ) PORT_DIPLOCATION("SW3:8,7") + PORT_DIPSETTING( 0x03, "10" ) + PORT_DIPSETTING( 0x02, "20" ) + PORT_DIPSETTING( 0x01, "40" ) + PORT_DIPSETTING( 0x00, "50" ) + PORT_DIPNAME( 0x1c, 0x1c, "Double Up Rate" ) PORT_DIPLOCATION("SW3:6,5,4") + PORT_DIPSETTING( 0x00, "86" ) + PORT_DIPSETTING( 0x04, "87" ) + PORT_DIPSETTING( 0x08, "88" ) + PORT_DIPSETTING( 0x0c, "89" ) + PORT_DIPSETTING( 0x10, "90" ) + PORT_DIPSETTING( 0x14, "91" ) + PORT_DIPSETTING( 0x18, "92" ) + PORT_DIPSETTING( 0x1c, "93" ) + PORT_DIPNAME( 0xe0, 0xe0, "Play Rate" ) PORT_DIPLOCATION("SW3:3,2,1") + PORT_DIPSETTING( 0xe0, "0" ) + PORT_DIPSETTING( 0xc0, "1" ) + PORT_DIPSETTING( 0xa0, "10" ) + PORT_DIPSETTING( 0x80, "11" ) + PORT_DIPSETTING( 0x60, "100" ) + PORT_DIPSETTING( 0x40, "101" ) + PORT_DIPSETTING( 0x20, "110" ) + PORT_DIPSETTING( 0x00, "111" ) + + PORT_START("DSW4") + PORT_DIPNAME( 0x03, 0x03, "4 K Rate" ) PORT_DIPLOCATION("SW4:8,7") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x01, "70" ) + PORT_DIPSETTING( 0x02, "80" ) + PORT_DIPSETTING( 0x03, "90" ) + PORT_DIPNAME( 0x0c, 0x0c, "S F Rate" ) PORT_DIPLOCATION("SW4:6,5") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x04, "70" ) + PORT_DIPSETTING( 0x08, "80" ) + PORT_DIPSETTING( 0x0c, "90" ) + PORT_DIPNAME( 0x30, 0x30, "R S Rate" ) PORT_DIPLOCATION("SW4:4,3") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x10, "70" ) + PORT_DIPSETTING( 0x20, "80" ) + PORT_DIPSETTING( 0x30, "90" ) + PORT_DIPNAME( 0xc0, 0xc0, "5 K Rate" ) PORT_DIPLOCATION("SW4:2,1") + PORT_DIPSETTING( 0x00, "70 (duplicate)" ) + PORT_DIPSETTING( 0x40, "70" ) + PORT_DIPSETTING( 0x80, "80" ) + PORT_DIPSETTING( 0xc0, "90" ) +INPUT_PORTS_END + + +static const gfx_layout layout8x8x8 = +{ + 8,8, + RGN_FRAC(1,2), + 8, + { STEP8(0,1) }, + { + 8*0,8*1, + RGN_FRAC(1,2)+8*0,RGN_FRAC(1,2)+8*1, + 8*2,8*3, + RGN_FRAC(1,2)+8*2,RGN_FRAC(1,2)+8*3 + }, + { STEP8(0,8*4) }, + 8*8*4 +}; + + +static GFXDECODE_START( gfx_att ) + GFXDECODE_ENTRY( "tiles", 0, layout8x8x8, 0, 1 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_att3 ) + GFXDECODE_ENTRY( "tiles", 0, gfx_8x8x8_raw, 0, 1 ) +GFXDECODE_END + + +void att_state::att(machine_config &config) +{ + Z80(config, m_maincpu, 12_MHz_XTAL / 4); + m_maincpu->set_addrmap(AS_PROGRAM, &att_state::program_map); + m_maincpu->set_addrmap(AS_IO, &att_state::att_io_map); + m_maincpu->set_vblank_int("screen", FUNC(att_state::nmi_line_pulse)); + + z80_device &audiocpu(Z80(config, "audiocpu", 12_MHz_XTAL / 4)); + audiocpu.set_addrmap(AS_PROGRAM, &att_state::att_audio_program_map); + audiocpu.set_addrmap(AS_IO, &att_state::att_audio_io_map); + audiocpu.set_periodic_int(FUNC(att_state::irq0_line_hold), attotime::from_hz(4 * 60)); // TODO: find IRQ source + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 256); + screen.set_visarea(0, 512-1, 0, 256-1); + screen.set_screen_update(FUNC(att_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_att); + + PALETTE(config, "palette").set_entries(0x100); + + ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette")); + ramdac.set_addrmap(0, &att_state::ramdac_map); + + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline("audiocpu", INPUT_LINE_NMI); + + SPEAKER(config, "mono").front_center(); + + YM2413(config, "ym2413", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); +} + +void att_state::att3(machine_config &config) +{ + Z80(config, m_maincpu, 12_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &att_state::program_map); + m_maincpu->set_addrmap(AS_IO, &att_state::att3_io_map); + m_maincpu->set_vblank_int("screen", FUNC(att_state::nmi_line_pulse)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(512, 256); + screen.set_visarea(0, 512-1, 0, 256-1); + screen.set_screen_update(FUNC(att_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx_att3); + + PALETTE(config, "palette").set_entries(0x100); + + ramdac_device &ramdac(RAMDAC(config, "ramdac", 0, "palette")); + ramdac.set_addrmap(0, &att_state::ramdac_map); + + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +/* +Lian Huan Pao, ATT III, 2010 +Hardware Info By Guru +--------------------- + +ATT + |--------------------------------| +|-| LM386 VOL 61256 Z80A| +|1 78L05 | +|0 GAL GAL | +|W SW4 D32-06 | +|A SW3 UM70C171-08 +|Y SW2 3.579545MHz | +|-| SW1 | + | YM2413 D32-05 | + | ULN2003S | + | D32-04 | +|-| | +|2 D32-03 | +|2 | +|W D32-02 | +|A T518B | +|Y 61256| +| 12MHz EPM7128 | +|-| D32-01 61256| + | BATT | + |BUTTON 6116 Z80B| + |--------------------------------| +Notes: + Z80A - Sharp LH0080A Z80A CPU. Clock Input 3.000MHz [12/4] + Z80B - Sharp LH0080B Z80B CPU. Clock Input 3.000MHz [12/4] + YM2413 - Yamaha YM2413 OPLL FM Sound Chip. Clock Input 3.579545MHz + LM386 - LM386 0.5W Audio Power Amplifier + 61256 - 32kB x8-bit SRAM + 6116 - 6116 2kB x8-bit SRAM (Battery-Backed) + 78L05 - 5V Linear Regulator (TO92) + T518B - Mitsumi T518B Reset Chip + BUTTON - Push Button Reset and Clear NVRAM + D32* - ROMs + ULN2003S - 7-Channel Darlington Transistor Array (SOIC16) + UM70C171 - UMC UM70C171-80 Color Palette With Triple 6-Bit DAC + SW1-4 - 8-Position DIP Switch + EPM7128 - Altera MAX EPM7128 CPLD + BATT - CR2032 Coin Cell +*/ + +ROM_START( lianhp2 ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "d32-01-.u32", 0x0000, 0x8000, CRC(7f6f1b84) SHA1(daee04a8f77580e8aad99498bbbed14d7b0cde22) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "d32-06-.u12", 0x0000, 0x8000, CRC(988515b1) SHA1(e833077885784c420c96903e46217a4292c9e783) ) // 1xxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD16_BYTE( "d32-02-.u4", 0x00000, 0x20000, CRC(867258ad) SHA1(f4047d3c921263d0df34d4357203b3e15c8c8de2) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-03-.u5", 0x00001, 0x20000, CRC(93574235) SHA1(0e82b52f4169e146d1b4386a68a1a023d31da6fd) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-04-.u6", 0x40000, 0x20000, CRC(72915ae7) SHA1(8dedcb4f7c57896bf27743f96afbdcc298e06a47) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) + ROM_LOAD16_BYTE( "d32-05-.u7", 0x40001, 0x20000, CRC(aab2bd04) SHA1(18dcb9a2d7338bb98b5399c30cfd6ad8ed750cce) ) // 1xxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x20000 ) +ROM_END + +/* +Lian Huan Pao 3, Bordun, 2003? +Hardware Info By Guru +--------------------- + +TAIWAN ATT III +2010.12.18 +030514 + |--------------------------------| +|-| UPC1241H VOL ATT_III_1| +|1 C1815 78L05 | +|0 6295 | +|W 86171 | +|A ATT_III_2| +|Y A1117_3.3 | +|-| | + | | + | | + | 12MHz |---------| | +|-| | | | +|2 | ACTEL | | +|2 ULN2003 |A54SX16A | | +|W JC817 |-F QFP208| | +|A JC817 |---------| | +|Y JC817 SW2 | +| JC817 SW3 | +|-|JC817 Z80 24257 SW4 | + | SW1 6116 SW5 | + | BATT ATT_III_3 T518B | + |--------------------------------| +Notes: + Z80 - Toshiba TMPZ84C000AP-6 Z80B CPU. Clock Input 6.000MHz [12/2] + 6295 - Oki M6295 ADPCM Sample Player. Clock Input 1.000MHz [12/12]. Pin 7 HIGH + UPC1241H - NEC uPC1241H 7W Audio Power Amplifier + 24257 - Winbond W24257ak-15 32kB x8-bit SRAM + 6116 - 6116 2kB x8-bit SRAM (Battery-Backed) + 78L05 - 5V Linear Regulator (TO92) + T518B - Mitsumi T518B Reset Chip + ATT_III* - ROMs; 3=Z80 Program, 2=Graphics, 1=Oki Samples + ULN2003 - 7-Channel Darlington Transistor Array + 86171 - HMC HM86171-80 Color Palette With Triple 6-Bit DAC + SW1 - Push Button Reset and Clear NVRAM + SW2-5 - 8-Position DIP Switch + ACTEL - Actel A54SX16A-F QFP208 FPGA + BATT - 3.6V Nicad Barrel Battery + C1815 - 2SC1815 General-Purpose NPN Transistor + A1117_3.3 - 3.3V Linear Regulator for powering FPGA + JC817 - Kento JC817 Photo-Coupler (equivalent to Sharp PC817X) +*/ + +ROM_START( lianhp3 ) + ROM_REGION( 0x8000, "maincpu", 0 ) + ROM_LOAD( "att-iii_3.bin", 0x0000, 0x8000, CRC(9041bfa9) SHA1(047046f8c533ed00a06e2d3cb6328a517ba1e6c2) ) + + ROM_REGION( 0x80000, "tiles", 0 ) + ROM_LOAD( "att-iii_2.bin", 0x00000, 0x80000, CRC(53baa37b) SHA1(548a9d6e01d31d65bd2c35be16778cbc5a315b54) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "att-iii_1.bin", 0x00000, 0x80000, CRC(05b3974c) SHA1(70feb9c9fc8d7619838319696e10d65ef55dadfc) ) +ROM_END + +} // anonymous namespace + + +GAME( 200?, lianhp2, 0, att, lianhp2, att_state, empty_init, ROT0, "Bordun", "Lian Huan Pao - ATT II", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // audio IRQ timing +GAME( 2003, lianhp3, 0, att3, lianhp3, att_state, empty_init, ROT0, "Bordun", "Lian Huan Pao - ATT III", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/misc/skylncr.cpp b/src/mame/bordun/skylncr.cpp similarity index 100% rename from src/mame/misc/skylncr.cpp rename to src/mame/bordun/skylncr.cpp diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index ffd350264e521..57e93d7f0cdff 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -2830,7 +2830,7 @@ ROM_START( cjddz ) // PCB-0489-05-FM-1 ROM_LOAD16_WORD_SWAP( "m3.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "m4.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "m4.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2850,7 +2850,7 @@ ROM_START( cjddz217cn ) // PCB-0489-05-FM-1 ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "igs_w05005w32m_f9ce_1d10.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "igs_w05005w32m_f9ce_1d10.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2870,7 +2870,7 @@ ROM_START( cjddz215cn ) ROM_LOAD16_WORD_SWAP( "ddz_text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) - ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3)) + ROM_LOAD( "ddz_ani.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) // OKI, sample tables are every 0x20000 starting at 0x40000 // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks @@ -2878,6 +2878,45 @@ ROM_START( cjddz215cn ) ROM_LOAD( "ddz_sp.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END +/* +Chaoji Dou Dizhu (V213CN) +IGS, 2004 + +PCB: IGS PCB-0489-07-FM-1 + +Main program ROM is missing. +SP-1 same as cjddz215cn and several others +TEXT same as cjddz215cn and several others +CG unique to this set +Main program ROM from cjddz215cn was put onto this board and works fine. + +IGS027 Sticker: Q1 +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ +ROM_START( cjddz213cn ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "q1_igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x80000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "213cn.u17", 0x000000, 0x80000, NO_DUMP ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "cg.u28", 0x000000, 0x400000, CRC(168720a0) SHA1(edcd727e25386469c32d6fd117dd76eeb48ce0a6) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + // 超级斗地主 加强版 (Chāojí Dòu Dìzhǔ Jiāqiáng Bǎn) ROM_START( cjddzp ) ROM_REGION( 0x04000, "maincpu", 0 ) @@ -3352,6 +3391,7 @@ GAMEL( 1999, fruitpar206us, fruitpar, oceanpar, fruitpar206us, igs_m027_stat GAME( 2004, cjddz, 0, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN)", 0 ) // 2004 date in internal ROM GAME( 2004, cjddz217cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V217CN)", 0 ) // 2004 date in internal ROM GAME( 2004, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V215CN)", 0 ) // 2004 date in internal ROM +GAME( 2004, cjddz213cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V213CN)", MACHINE_NOT_WORKING ) // missing external program ROM. 2004 date in internal ROM GAME( 2004, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) // 2004 date in internal ROM GAME( 2005, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) // 2005 date in internal ROM GAME( 2005, cjtljp, 0, cjtljp, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 0b5d2bb54d2f0..99a76a877c91d 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -1251,6 +1251,7 @@ holdrma6 holdrma6a househrt househrta +hrtantny incachf indream indreama @@ -1292,6 +1293,7 @@ mnytreea moonfire moonwalt mrwoo +mrwoou mskitty mystarr mysteycm @@ -15143,6 +15145,7 @@ bmcpokr fengyunh mjmaglmp shendeng +xyddzhh @source:bmc/koftball.cpp jxzh @@ -15165,6 +15168,36 @@ bw2 @source:booth/apexc.cpp apexc +@source:bordun/att.cpp +lianhp2 +lianhp3 + +@source:bordun/skylncr.cpp +bdream97 +blshark +butrfly +butrflybl +gallag50 +leader +leadera +madzoo +mbutrfly +miaction +neraidou +olymp +rolla +score5 +seadevil +skylncr +sonikfig +spcliner +speedway +speedwaya +sstar97 +superb2k +tigerslt + + @source:brother/ax145.cpp ax145 @@ -20491,6 +20524,7 @@ amazonia amazonkp chessc2 cjddz +cjddz213cn cjddz215cn cjddz217cn cjddzlf @@ -32387,31 +32421,6 @@ skimaxx @source:misc/skyarmy.cpp skyarmy -@source:misc/skylncr.cpp -bdream97 -blshark -butrfly -butrflybl -gallag50 -leader -leadera -madzoo -mbutrfly -miaction -neraidou -olymp -rolla -score5 -seadevil -skylncr -sonikfig -spcliner -speedway -speedwaya -sstar97 -superb2k -tigerslt - @source:misc/sliver.cpp sliver slivera diff --git a/src/mame/misc/ddz.cpp b/src/mame/misc/ddz.cpp index 603befcb829e9..d736879d1dfd8 100644 --- a/src/mame/misc/ddz.cpp +++ b/src/mame/misc/ddz.cpp @@ -3,7 +3,7 @@ /**************************************************************************** - 招级疯斗 - "Zhaoji Fengdou" - "Crazy Class" HW + 招级疯斗 - "Chaoji Fengdou" - "Crazy Class" HW driver by Angelo Salese, based off original ddz.cpp by ElSemi @@ -144,7 +144,7 @@ ROM_START( ddz ) ROM_LOAD("ddz.003.rom", 0x800000, 0x400000, CRC(61c9b5c9) SHA1(0438417398403456a1c49408881797a94aa86f49) ) ROM_END -/* "Zhaoji Fengdou" PCB +/* "Chaoji Fengdou" PCB ______________________________________________________________ | _________ ____________________ | __| HD74HC245P |ROM1 H28F320BDJ-TTL80 | @@ -171,7 +171,7 @@ ROM_END | _____ ___ JAMMA _____ Switch | |______| |_|_| | |_|_|_|_|_|_|_|_|_|_|_|_| |_________| */ -ROM_START( crzclass ) +ROM_START( crzclass ) // 超级疯斗 ROM_REGION32_LE( 0x1000000, "ipl", ROMREGION_ERASEFF ) ROM_REGION( 0x1000000, "enc_data", ROMREGION_ERASEFF ) @@ -228,7 +228,7 @@ void ddz_state::init_ddz() GAME( 200?, ddz, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "IGS?", "Dou Dizhu", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 200?, crzclass, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Zhaoji Fengdou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // 'Crazy Class' +GAME( 200?, crzclass, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Chaoji Fengdou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // 'Crazy Class' GAME( 200?, baibians, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Baibian Shuangkou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 200?, cjmx, 0, ddz, ddz, ddz_state, init_ddz, ROT0, "TJF", "Chaoji Mingxing", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 2005, btlfront, 0, ddz, ddz, ddz_state, empty_init, ROT0, "TJF", "BattleFront", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // encrypted, V133F? From 3fff2a61d557f41c8639cb09477a058ce161f16b Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 3 Mar 2025 20:53:56 +0100 Subject: [PATCH 073/272] bayroute1: add sound roms --- src/mame/mame.lst | 4 ++-- src/mame/sega/segas16b.cpp | 31 ++++++++++++++++--------------- src/mame/taito/opwolf.cpp | 8 ++++---- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 99a76a877c91d..428f5d4469570 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -16253,8 +16253,8 @@ sk10 sx1010 @source:casio/wk1800.cpp -wk1600 // 2000 Casio -wk1800 // 2000 Casio +wk1600 +wk1800 @source:casio/zoomer.cpp zoomer diff --git a/src/mame/sega/segas16b.cpp b/src/mame/sega/segas16b.cpp index b64d5146404f2..c84a358b24d37 100644 --- a/src/mame/sega/segas16b.cpp +++ b/src/mame/sega/segas16b.cpp @@ -5711,11 +5711,12 @@ ROM_START( bayroute1 ) ROM_LOAD16_BYTE( "br.b8", 0x60000, 0x10000, CRC(d8de78ff) SHA1(110661ab8008543b47629722b98d0470f73a48c5) ) ROM_REGION( 0x50000, "soundcpu", 0 ) // sound CPU - ROM_LOAD( "sound.a7", 0x00000, 0x08000, NO_DUMP ) - ROM_LOAD( "sound.a8", 0x10000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a9", 0x20000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a10", 0x30000, 0x10000, NO_DUMP ) - ROM_LOAD( "sound.a11", 0x40000, 0x10000, NO_DUMP ) + ROM_LOAD( "sound.a7", 0x00000, 0x10000, CRC(e91e55cb) SHA1(857242ab355736d7d77877bcf1d093c15c69992b) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "sound.a8", 0x10000, 0x10000, CRC(077e9981) SHA1(877c2ce9757410938e42b9bf512089bd2045d04e) ) // 1ST AND 2ND HALF IDENTICAL + ROM_LOAD( "sound.a9", 0x20000, 0x10000, CRC(3c3f5f41) SHA1(f1b2e01586e65c542514c0a846ffc79767ff2166) ) + // it expects different data from the parent set (copying that to here results in better sound overall, but some cut voices) + ROM_LOAD( "sound.a10", 0x30000, 0x10000, BAD_DUMP CRC(7c251347) SHA1(2b66365b2480e2852f930ddbed23d2ed80f2afaa) ) + ROM_LOAD( "sound.a11", 0x40000, 0x10000, BAD_DUMP CRC(a602ea2d) SHA1(37a4d05c416e8d65c4a2d73096edcfd456a0b70e) ) ROM_END @@ -10114,7 +10115,7 @@ GAME( 1990, aurailj, aurail, system16b_fd1089a, aurail, segas16b_stat GAME( 1989, bayroute, 0, system16b_fd1094, bayroute, segas16b_state, init_generic_5704, ROT0, "Sunsoft / Sega", "Bay Route (set 3, World) (FD1094 317-0116)", 0 ) GAME( 1989, bayroutej, bayroute, system16b_fd1094, bayroute, segas16b_state, init_generic_5704, ROT0, "Sunsoft / Sega", "Bay Route (set 2, Japan) (FD1094 317-0115)", 0 ) -GAME( 1989, bayroute1, bayroute, system16b, bayroute, segas16b_state, init_generic_5358, ROT0, "Sunsoft / Sega", "Bay Route (set 1, US) (unprotected)", MACHINE_NO_SOUND ) +GAME( 1989, bayroute1, bayroute, system16b, bayroute, segas16b_state, init_generic_5358, ROT0, "Sunsoft / Sega", "Bay Route (set 1, US) (unprotected)", MACHINE_IMPERFECT_SOUND ) GAME( 1987, bullet, 0, system16b_fd1094, bullet, segas16b_state, init_generic_5358_small, ROT0, "Sega", "Bullet (FD1094 317-0041)", 0 ) @@ -10221,7 +10222,7 @@ GAME( 1990, atomicp, 0, atomicp, atomicp, segas16b_stat GAME( 1990, snapper, 0, atomicp, snapper, segas16b_state, init_snapper, ROT0, "Philko", "Snapper (Korea)", 0) // korean clone board.. // board marked 'System 4' and has Philko custom chip - various hw changes (4bpp tiles for example) GAME( 1991, lockonph, 0, lockonph, lockonph, segas16b_state, init_lockonph, ROT0, "Philko", "Lock On (Philko)", MACHINE_IMPERFECT_SOUND ) // Copyright not shown in game, but has 'PHILKO' in the startup warning and tiles / PCB. 1991 is the name entry for the lowest high score. Clipping issues on left edge in attract look like original game bugs. -GAME( 1991, dfjail, 0, dfjail, dfjail, dfjail_state, init_generic_korean, ROT0, "Philko", "The Destroyer From Jail (Korea)", MACHINE_NO_COCKTAIL ) // Regulatory approval document dated "1991. 3.28" based on submission of manual and photos +GAME( 1991, dfjail, 0, dfjail, dfjail, dfjail_state, init_generic_korean, ROT0, "Philko", "The Destroyer From Jail (Korea)", MACHINE_NO_COCKTAIL ) // Regulatory approval document dated "1991. 3.28" based on submission of manual and photos // decrypted bootleg / 'suicide repair' sets @@ -10288,13 +10289,13 @@ GAME( 1989, wrestwar2d, wrestwar, system16b, wrestwar, segas16b_stat GAME( 1989, wrestwar1d, wrestwar, system16b, wrestwar, segas16b_state, init_generic_5704, ROT270, "bootleg", "Wrestle War (set 1, Japan) (bootleg of FD1094 317-0090 set)", 0 ) // bootlegs with split code/data, no memory mapper -GAME( 1987, sdibl2, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 1)", 0 ) // 0x5230 -GAME( 1987, sdibl3, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 2)", 0 ) // ^ -GAME( 1987, sdibl4, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 3)", 0 ) // ^ -GAME( 1987, sdibl5, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 4)", 0 ) -GAME( 1987, sdibl6, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 5)", 0 ) +GAME( 1987, sdibl2, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 1)", 0 ) // 0x5230 +GAME( 1987, sdibl3, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 2)", 0 ) // ^ +GAME( 1987, sdibl4, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 3)", 0 ) // ^ +GAME( 1987, sdibl5, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 4)", 0 ) +GAME( 1987, sdibl6, sdi, system16b_split, sdi, segas16b_state, init_sdi_5358_small, ROT0, "bootleg", "SDI - Strategic Defense Initiative (bootleg, set 5)", 0 ) // bootlegs with modified hardware -GAME( 1989, fpointbl, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (World, bootleg)", 0 ) -GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg set 1)", 0 ) -GAME( 1989, fpointbla, fpoint, fpointbla, fpointbl, segas16b_state, init_fpointbla, ROT0, "bootleg", "Flash Point (Japan, bootleg set 2)", MACHINE_NOT_WORKING ) +GAME( 1989, fpointbl, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (World, bootleg)", 0 ) +GAME( 1989, fpointbj, fpoint, fpointbl, fpointbl, segas16b_state, init_generic_bootleg, ROT0, "bootleg (Datsu)", "Flash Point (Japan, bootleg set 1)", 0 ) +GAME( 1989, fpointbla, fpoint, fpointbla, fpointbl, segas16b_state, init_fpointbla, ROT0, "bootleg", "Flash Point (Japan, bootleg set 2)", MACHINE_NOT_WORKING ) diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index cfbe6fbc4a343..dee8b7d961056 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -879,10 +879,6 @@ void opwolf_state::opwolf(machine_config &config) SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - mixer_device &mixer = MIXER(config, "mixer"); - mixer.add_route(0, m_tc0060dca[1], 1.0); - mixer.add_route(0, m_tc0060dca[1], 1.0); - ym2151_device &ymsnd(YM2151(config, "ymsnd", 8_MHz_XTAL / 2)); /* 4 MHz */ ymsnd.irq_handler().set_inputline(m_audiocpu, 0); ymsnd.port_write_handler().set_membank(m_z80bank).mask(0x03); @@ -901,6 +897,10 @@ void opwolf_state::opwolf(machine_config &config) TC0060DCA(config, m_tc0060dca[0]); m_tc0060dca[0]->add_route(ALL_OUTPUTS, "mixer", 1.0); + mixer_device &mixer = MIXER(config, "mixer"); + mixer.add_route(0, m_tc0060dca[1], 1.0); + mixer.add_route(0, m_tc0060dca[1], 1.0); + TC0060DCA(config, m_tc0060dca[1]); m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); m_tc0060dca[1]->add_route(1, "rspeaker", 1.0); From afbcc8e96f066cc36000646cc7a9869af89fd19f Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 3 Mar 2025 21:13:57 +0100 Subject: [PATCH 074/272] driveyes: correct pcm rom dsw default state --- src/mame/namco/namcos21_de.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/mame/namco/namcos21_de.cpp b/src/mame/namco/namcos21_de.cpp index 6012310ab866d..8bb7565ea8cc6 100644 --- a/src/mame/namco/namcos21_de.cpp +++ b/src/mame/namco/namcos21_de.cpp @@ -540,7 +540,7 @@ static INPUT_PORTS_START( driveyes ) PORT_DIPNAME( 0x10, 0x10, "DSW5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "PCM ROM") + PORT_DIPNAME( 0x20, 0x20, "PCM ROM") PORT_DIPSETTING( 0x20, "2M" ) PORT_DIPSETTING( 0x00, "4M" ) PORT_DIPNAME( 0x40, 0x40, "DSW7") @@ -645,7 +645,7 @@ static INPUT_PORTS_START( driveyes ) PORT_DIPNAME( 0x10, 0x10, "DSW5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "PCM ROM") + PORT_DIPNAME( 0x20, 0x20, "PCM ROM") PORT_DIPSETTING( 0x20, "2M" ) PORT_DIPSETTING( 0x00, "4M" ) PORT_DIPNAME( 0x40, 0x40, "DSW7") @@ -824,7 +824,6 @@ ROM_START( driveyes ) ROM_LOAD16_BYTE( "de1-pt2-u.5n", 0x80000, 0x20000, CRC(10e83d81) SHA1(446fedc3b1e258a39fb9467e5327c9f9a9f1ac3f) ) ROM_LOAD16_BYTE( "de1-pt2-l.7n", 0x80001, 0x20000, CRC(3339a976) SHA1(c9eb9c04f7b3f2a85e5ab64ffb2fe4fcfb6c494b) ) - ROM_REGION( 0x2000, "pcb_2:nvram", 0 ) /* default settings, including calibration */ ROM_LOAD( "nvram", 0x0000, 0x2000, CRC(fa6623e9) SHA1(8c313f136724eb6c829261b223a2ac1fc08d00c2) ) ROM_END From a5aaa3ef80f6415740caf319f7697e74ed6db653 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 3 Mar 2025 22:14:34 +0100 Subject: [PATCH 075/272] New systems marked not working ------------------------------ Crown Poker (ver. 1.20) [Brian Troha, Hammy, The Dumping Union] --- src/mame/mame.lst | 1 + src/mame/seta/simple_st0016.cpp | 64 +++++++++++++++++++++++++++------ 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 428f5d4469570..ab4e755064bfb 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -41976,6 +41976,7 @@ wschampa wschampb @source:seta/simple_st0016.cpp +crownpkr dcrown dcrowna gostop diff --git a/src/mame/seta/simple_st0016.cpp b/src/mame/seta/simple_st0016.cpp index 602900071612e..42f9e73e004d1 100644 --- a/src/mame/seta/simple_st0016.cpp +++ b/src/mame/seta/simple_st0016.cpp @@ -19,11 +19,14 @@ Dips verified for Neratte Chu (nratechu) from manual */ #include "emu.h" + +#include "st0016.h" + #include "cpu/v810/v810.h" #include "cpu/z80/z80.h" -#include "st0016.h" #include "machine/timer.h" #include "sound/st0016.h" + #include "screen.h" #include "speaker.h" @@ -411,6 +414,36 @@ static INPUT_PORTS_START( nratechu ) PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SW2:8" ) INPUT_PORTS_END +static INPUT_PORTS_START( crownpkr ) + PORT_INCLUDE( st0016 ) + + PORT_MODIFY("P1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME( "Hold 3 / Low" ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_OTHER ) // TODO: hopper + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) // TODO: hopper full + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) + + PORT_MODIFY("P2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME( "Hold 2 / High" ) // also Meter Key in test mode + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) // also Reset Key in test mode + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Last Game Key in test mode + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + + PORT_MODIFY("SYSTEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(5) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(10) // TODO: simulate coin drop sensor + PORT_SERVICE( 0x08, IP_ACTIVE_LOW ) // only works if pressed during boot +INPUT_PORTS_END + static INPUT_PORTS_START( mayjisn2 ) PORT_INCLUDE( st0016 ) @@ -613,7 +646,7 @@ ROM_START( renju ) // PCB E51-00001-A ROM_END // ねらってチュー (Neratte Chū) / NERATTE CHU -ROM_START( nratechu ) // PCB E56-00002 (almost identical to above) +ROM_START( nratechu ) // PCB E56-00002 (almost identical to above). "1.10 1996/05/25 21:05 Programming by ITEC" string ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD( "sx012-01.u31", 0x000000, 0x080000, CRC(6ca01d57) SHA1(065848f19ecf2dc1f7bbc7ddd87bca502e4b8b16) ) ROM_LOAD( "sx012-02.u32", 0x100000, 0x100000, CRC(40a4e354) SHA1(8120ce8deee6805050a5b083a334c3743c09566b) ) @@ -621,6 +654,14 @@ ROM_START( nratechu ) // PCB E56-00002 (almost identical to above) // U34 not populated ROM_END +ROM_START( crownpkr ) // PCB E56-00002. "1.20 1997/05/30 19:00 Programming by K&S string" + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD( "cpu120.u31", 0x000000, 0x080000, CRC(9c47920b) SHA1(bdc3f16cc7bf84102a24e6f58a1fb329bf90920b) ) // hand written label NEC D27C4000D / AMD 27C400 + // U32 not populated + // U33 not populated + // U34 not populated +ROM_END + ROM_START( dcrown ) // PCB E51-00001 (almost identical to above) ROM_REGION( 0x200000, "maincpu", 0 ) ROM_LOAD( "dc1.u31", 0x000000, 0x80000, CRC(e55200b8) SHA1(20a968dc895bb636b064c29b4b53c6ffa49fea36) ) @@ -788,7 +829,7 @@ void st0016_state::init_mayjisn2() m_maincpu->set_game_flag(4); } -} // Anonymous namespace +} // anonymous namespace /************************************* @@ -797,13 +838,14 @@ void st0016_state::init_mayjisn2() * *************************************/ -GAME( 1994, renju, 0, renju, renju, st0016_state, init_renju, ROT0, "Visco", "Renju Kizoku - Kira Kira Gomoku Narabe", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, nratechu, 0, st0016, nratechu, st0016_state, init_nratechu, ROT0, "Seta", "Neratte Chu", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, mayjisn2, 0, mayjinsn, mayjisn2, st0016_state, init_mayjisn2, ROT0, "Seta", "Mayjinsen 2", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1995, koikois, 0, st0016, koikois, st0016_state, init_renju, ROT0, "Visco", "Koi Koi Shimasho - Super Real Hanafuda", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 2001, gostop, 0, st0016, gostop, st0016_state, init_renju, ROT0, "Visco", "Kankoku Hanafuda Go-Stop", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, renju, 0, renju, renju, st0016_state, init_renju, ROT0, "Visco", "Renju Kizoku - Kira Kira Gomoku Narabe (ver. 1.0)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, nratechu, 0, st0016, nratechu, st0016_state, init_nratechu, ROT0, "Seta", "Neratte Chu (ver. 1.10)", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mayjisn2, 0, mayjinsn, mayjisn2, st0016_state, init_mayjisn2, ROT0, "Seta", "Mayjinsen 2", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1995, koikois, 0, st0016, koikois, st0016_state, init_renju, ROT0, "Visco", "Koi Koi Shimasho - Super Real Hanafuda", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 2001, gostop, 0, st0016, gostop, st0016_state, init_renju, ROT0, "Visco", "Kankoku Hanafuda Go-Stop", MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // Not working -GAME( 1994, mayjinsn, 0, mayjinsn, st0016, st0016_state, init_mayjinsn, ROT0, "Seta", "Mayjinsen", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, dcrown, 0, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text -GAME( 1994, dcrowna, dcrown, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded +GAME( 1994, mayjinsn, 0, mayjinsn, st0016, st0016_state, init_mayjinsn, ROT0, "Seta", "Mayjinsen", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) +GAME( 1997, crownpkr, 0, st0016, crownpkr, st0016_state, init_nratechu, ROT0, "Unknown", "Crown Poker (ver. 1.20)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // coining in doesn't work +GAME( 1994, dcrown, 0, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text +GAME( 1994, dcrowna, dcrown, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded From 141da30bbd2658db13b0f7416021358de3c45d76 Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Tue, 4 Mar 2025 03:21:24 +0100 Subject: [PATCH 076/272] Major improvements to misc/vpoker.cpp driver: [Roberto Fresca, Grull Osgo] - Change vpoker description to Challenger Draw Poker. - Inputs from the scratch. - Split machine drivers for each game. - Hook clocks to the 6840 PTM. - Reworked interrupts handling. - Lamps support for both sets. - Adjusted screen visible area per game. - Clickable button-lamps layout for vpoker. - Clickable button-lamps layout for 5acespkr. - Mech counters support. - NVRAM support. - Added sigma-delta DAC sound support. - Promoted vpoker to working. - Promoted 5acespkr to working. - Added technical notes. Systems promoted to working --------------------------- Challenger Draw Poker [Roberto Fresca, Grull Osgo] 5-Aces Poker [Roberto Fresca, Grull Osgo] --- src/mame/layout/5acespkr.lay | 175 +++++++++ src/mame/layout/vpoker.lay | 192 ++++++++++ src/mame/misc/vpoker.cpp | 714 +++++++++++++---------------------- 3 files changed, 637 insertions(+), 444 deletions(-) create mode 100644 src/mame/layout/5acespkr.lay create mode 100644 src/mame/layout/vpoker.lay diff --git a/src/mame/layout/5acespkr.lay b/src/mame/layout/5acespkr.lay new file mode 100644 index 0000000000000..c656ed5ec1087 --- /dev/null +++ b/src/mame/layout/5acespkr.lay @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mame/layout/vpoker.lay b/src/mame/layout/vpoker.lay new file mode 100644 index 0000000000000..285d6fa97e137 --- /dev/null +++ b/src/mame/layout/vpoker.lay @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mame/misc/vpoker.cpp b/src/mame/misc/vpoker.cpp index 45a26931e14c2..ba60e0034f969 100644 --- a/src/mame/misc/vpoker.cpp +++ b/src/mame/misc/vpoker.cpp @@ -2,13 +2,13 @@ // copyright-holders:Angelo Salese, Roberto Fresca /************************************************************************************************************** - Videotronics Poker (c) 198? Videotronics - Preliminary driver by Angelo Salese & Roberto Fresca. + Challenger Draw Poker (c) 198? Videotronics. + Driver by Angelo Salese & Roberto Fresca. + Notes: - - Looks like the 2nd generation of Noraut Poker / Draw Poker Hi-Lo HW. - - I found two companies that sold the same game with different name... + I found two companies that sold the same game with different name: 1) "Challenger Draw Poker", from Bend Electronics Co. Inc. 2) "VHI Draw Poker", from Video Horizons, Inc. @@ -24,11 +24,6 @@ http://www.plainsite.org/dockets/201rtodjb/nevada-district-court/videotronics-inc-v-bend-electronics/ - TODO: - - Understand how the 6840PTM hooks up, needed to let it work properly; - - I/Os; - - sound; - =============================================================================================================== Bought as "old poker game by videotronics early 80's" @@ -63,12 +58,14 @@ ROM data showed cards - 6809 CPU + MC6809 CPU 4.000 Mhz crystal MC6840P - mm74c920J/mmc6551j-9 x2 + mm74c920J x2 + mmc6551j-9 x2 -************************************************************************************************************** + +=============================================================================================================== - Added 5-Aces Poker (Roberto Fresca) @@ -86,7 +83,7 @@ .7 2764 handwritten sticker 688C 4 MHz crystal - 6809 + HD68A09P MC6840P nmc6514-9 x2 nm23114 x2 @@ -95,16 +92,81 @@ SA2889-0697 stamped ETC + +=============================================================================================================== + + Driver notes: + + meters offsets: + + Aces: 16a-16b + 2 Pair: 16c-16d + 3 of a Kind: 16e-16f + Straight: 170-171 + Flush: 172-173 + Full House: 173-174 + 4 of a Kind: 175-176 + Straight Flush: 177-178 + + Coins In: 188-189-18a-18b + Credits Played: 18c-18d-18e-18f + Credits Won: 190-191-192-193 + Cleared: 180-181-182-183 + Games Played: 194-195-196-197 + Games Won: 184-185-186-187 + + + registers: + + Credits: da-db + Coins in: dd + + +=============================================================================================================== + + Updates [2025-03-04]: + + - Change vpoker description to Challenger Draw Poker. + - Inputs from the scratch. + - Split machine drivers for each game. + - Hook clocks to the 6840 PTM. + - Reworked interrupts handling. + - Lamps support for both sets. + - Adjusted screen visible area per game. + - Clickable button-lamps layout for vpoker. + - Clickable button-lamps layout for 5acespkr. + - Mech counters support. + - NVRAM support. + - Added sigma-delta DAC sound support. + - Promoted vpoker to working. + - Promoted 5acespkr to working. + - Added technical notes. + + + TODO: + + - Check NVRAM issues. + - Find why vectors are changed in 5acespkr. + - Investigate about what seems to be a custom processor + due to the weird routines related to interrupts, and the + complete lack of SWI triggers. + + **************************************************************************************************************/ #include "emu.h" #include "cpu/m6809/m6809.h" #include "machine/6840ptm.h" +#include "machine/nvram.h" +#include "sound/dac.h" #include "emupal.h" #include "screen.h" #include "speaker.h" +#include "vpoker.lh" +#include "5acespkr.lh" + namespace { @@ -116,12 +178,19 @@ class vpoker_state : public driver_device m_maincpu(*this, "maincpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), - m_in0(*this, "IN0") + m_dac(*this, "dac"), + m_in0(*this, "IN0"), + m_in1(*this, "IN1"), + m_lamps(*this, "lamp%u", 0U) + { } void vpoker(machine_config &config); + void fiveaces(machine_config &config); + void init_5aces(); protected: + virtual void machine_start() override ATTR_COLD; virtual void video_start() override ATTR_COLD; private: @@ -130,15 +199,23 @@ class vpoker_state : public driver_device uint8_t blitter_r(offs_t offset); void blitter_w(offs_t offset, uint8_t data); void ptm_irq(int state); + void swi_int(int state); uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; + required_device m_dac; required_ioport m_in0; + required_ioport m_in1; + output_finder<9> m_lamps; void main_map(address_map &map) ATTR_COLD; }; +/*********************************** +* Video Hardware * +***********************************/ + void vpoker_state::video_start() { m_videoram = std::make_unique(0x200); @@ -151,13 +228,13 @@ uint32_t vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 gfx_element *gfx = m_gfxdecode->gfx(0); int count = 0x0000; - for (int y=0;y<0x10;y++) + for (int y = 0; y < 0x10; y++) { - for (int x=0;x<0x20;x++) + for (int x = 0; x < 0x20; x++) { int tile = videoram[count]; - //int colour = tile>>12; - gfx->opaque(bitmap,cliprect,tile,0,0,0,x*16,y*16); + //int colour = tile >> 12; + gfx->opaque(bitmap, cliprect, tile, 0, 0, 0, x*16, y*16); count++; } @@ -171,6 +248,9 @@ uint8_t vpoker_state::blitter_r(offs_t offset) if(offset == 6) return m_in0->read(); + if(offset == 7) + return m_in1->read(); + return 0; } @@ -179,446 +259,116 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) uint8_t *videoram = m_videoram.get(); m_blit_ram[offset] = data; + + if(offset == 1) + { + machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin_in + machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out + m_lamps[7] = BIT(data, 7); // bet lamp + } if(offset == 2) { int blit_offs; - blit_offs = (m_blit_ram[1] & 0x01)<<8|(m_blit_ram[2] & 0xff); - + blit_offs = (m_blit_ram[1] & 0x01) << 8 | (m_blit_ram[2] & 0xff); videoram[blit_offs] = m_blit_ram[0]; -// printf("%02x %02x %02x %02x %02x %02x %02x %02x\n",m_blit_ram[0],m_blit_ram[1],m_blit_ram[2],m_blit_ram[3],m_blit_ram[4],m_blit_ram[5],m_blit_ram[6],m_blit_ram[7]); } + if(offset == 3) + { + m_lamps[0] = BIT(data, 0); // hold 1 lamp + m_lamps[1] = BIT(data, 1); // hold 2 lamp + m_lamps[2] = BIT(data, 2); // hold 3 lamp + m_lamps[3] = BIT(data, 3); // hold 4 lamp + m_lamps[4] = BIT(data, 4); // hold 5 lamp + m_lamps[5] = BIT(data, 5); // deal lamp + m_lamps[6] = BIT(data, 6); // draw lamp + } + else + { + // logerror("blitter_w: offs:%02x - data:%02x\n", offset, data); + } +} + + +/*********************************** +* Machine Start * +***********************************/ + +void vpoker_state::machine_start() +{ + m_lamps.resolve(); } + +/***************************************** +* Memory Map Information * +*****************************************/ + void vpoker_state::main_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x01ff).ram(); /* vpoker has 0x100, 5acespkr has 0x200 */ + map(0x0000, 0x01ff).ram().share("nvram"); // vpoker has 0x100, 5acespkr has 0x200 map(0x0400, 0x0407).rw("6840ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); map(0x0800, 0x0807).r(FUNC(vpoker_state::blitter_r)).w(FUNC(vpoker_state::blitter_w)); map(0x2000, 0x3fff).rom(); } +/***************************************** +* Input Ports * +*****************************************/ + static INPUT_PORTS_START( vpoker ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(3) PORT_NAME("Coin In") - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Service" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") PORT_IMPULSE(3) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) // PORT_TOGGLE + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("IN0-10") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("IN0-20") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN0-40") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN0-80") PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, "IN1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x01, "IN2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN3") - PORT_DIPNAME( 0x01, 0x01, "IN3" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN4") - PORT_DIPNAME( 0x01, 0x01, "IN4" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN5") - PORT_DIPNAME( 0x01, 0x01, "IN5" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN6") - PORT_DIPNAME( 0x01, 0x01, "IN6" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN7") - PORT_DIPNAME( 0x01, 0x01, "IN7" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) INPUT_PORTS_END static INPUT_PORTS_START( 5acespkr ) PORT_START("IN0") - PORT_DIPNAME( 0x01, 0x01, "IN0" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x00, "Service" ) - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") PORT_IMPULSE(2) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // setu change value (up/off) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // PORT_TOGGLE + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("IN0-10") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Settings") // setup + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN0-40") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN0-80") PORT_START("IN1") - PORT_DIPNAME( 0x01, 0x01, "IN1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN2") - PORT_DIPNAME( 0x01, 0x01, "IN2" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN3") - PORT_DIPNAME( 0x01, 0x01, "IN3" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN4") - PORT_DIPNAME( 0x01, 0x01, "IN4" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN5") - PORT_DIPNAME( 0x01, 0x01, "IN5" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN6") - PORT_DIPNAME( 0x01, 0x01, "IN6" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - - PORT_START("IN7") - PORT_DIPNAME( 0x01, 0x01, "IN7" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") // setup change value (down/up-1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) // setup netx item INPUT_PORTS_END +/***************************************** +* Graphics Layouts * +*****************************************/ + static const gfx_layout charlayout = { 16,16, @@ -630,29 +380,51 @@ static const gfx_layout charlayout = 16*16 }; + +/***************************************** +* Graphics Decode Information * +*****************************************/ + static GFXDECODE_START( gfx_vpoker ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) + GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 1 ) GFXDECODE_END + +/***************************************** +* PTM 6840 interrupts handling * +*****************************************/ + void vpoker_state::ptm_irq(int state) { m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } +void vpoker_state::swi_int(int state) +{ + if(m_in0->read() == 0xfe) + m_maincpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); +} + + + +/***************************************** +* Machine Driver * +*****************************************/ + void vpoker_state::vpoker(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware MC6809(config, m_maincpu, XTAL(4'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); - m_maincpu->set_vblank_int("screen", FUNC(vpoker_state::irq0_line_hold)); + m_maincpu->set_vblank_int("screen", FUNC(vpoker_state::irq0_line_assert)); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(512, 256); - screen.set_visarea(0*8, 480-1, 0*8, 240-1); -// screen.set_visarea(0*8, 512-1, 0*8, 256-1); + screen.set_visarea(0, 464-1, 0, 240-1); // 512x256 total screen.set_screen_update(FUNC(vpoker_state::screen_update_vpoker)); screen.set_palette(m_palette); @@ -660,21 +432,54 @@ void vpoker_state::vpoker(machine_config &config) PALETTE(config, m_palette, palette_device::GBR_3BIT); - /* 6840 PTM */ + // 6840 PTM ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); - ptm.set_external_clocks(0, 0, 0); + ptm.set_external_clocks(500, 0000, 3000); ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); + ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); - /* sound hardware */ - SPEAKER(config, "mono").front_center(); -// AY8910(config, "aysnd", 8000000/4 /* guess */).add_route(ALL_OUTPUTS, "mono", 0.30); + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); } -/*************************************************************************** - Game driver(s) +void vpoker_state::fiveaces(machine_config &config) +{ + // basic machine hardware + MC6809(config, m_maincpu, XTAL(4'000'000)); + m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); -***************************************************************************/ + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(30); + screen.screen_vblank().set(FUNC(vpoker_state::swi_int)); + screen.set_size(512, 256); + screen.set_visarea(48, 448-1, 0, 240-1); // 512x256 total + screen.set_screen_update(FUNC(vpoker_state::screen_update_vpoker)); + screen.set_palette(m_palette); + + GFXDECODE(config, m_gfxdecode, m_palette, gfx_vpoker); + + PALETTE(config, m_palette, palette_device::GBR_3BIT); + + // 6840 PTM + ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); + ptm.set_external_clocks(500, 0, 1000000); + ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); + ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); + + // sound hardware + SPEAKER(config, "speaker").front_center(); + DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); +} + + +/***************************************** +* Rom Load * +*****************************************/ ROM_START( vpoker ) ROM_REGION( 0x10000, "maincpu", 0 ) @@ -712,9 +517,30 @@ ROM_START( 5acespkr ) ROM_LOAD16_BYTE( "bjok1.bin", 0x2001, 0x1000, CRC(20cdda67) SHA1(6c631b09e3da5f6660aa1c018fc0ff3004f7fe85) ) ROM_END + +/***************************************** +* Driver Init * +*****************************************/ + +void vpoker_state::init_5aces() +{ +// Changing the vector temporarily for testing purposes, +// otherwise the coin in routine will be tied to the +// SW2 interrupt, and there is no code to trigger it. + + uint8_t *ROM = memregion("maincpu")->base(); + + ROM[0x3ffa] = 0x79; +} + + } // Anonymous namespace -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Videotronics Draw Poker", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) -GAME( 198?, 5acespkr, 0, vpoker, 5acespkr, vpoker_state, empty_init, ROT0, "", "5-Aces Poker", MACHINE_NOT_WORKING | MACHINE_NO_SOUND ) +/***************************************** +* Game Drivers * +*****************************************/ + +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Challenger Draw Poker", 0, layout_vpoker ) +GAMEL( 198?, 5acespkr, 0, fiveaces, 5acespkr, vpoker_state, init_5aces, ROT0, "", "5-Aces Poker", MACHINE_UNEMULATED_PROTECTION, layout_5acespkr ) From 7547fa699153cb06872a87ceb56de4b37cadef14 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Tue, 4 Mar 2025 15:22:02 +0100 Subject: [PATCH 077/272] ti99: Change Arcturus device short name. --- src/devices/bus/ti99/sidecar/arcturus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/bus/ti99/sidecar/arcturus.cpp b/src/devices/bus/ti99/sidecar/arcturus.cpp index 1afe6f3591e04..26f32f395afe7 100644 --- a/src/devices/bus/ti99/sidecar/arcturus.cpp +++ b/src/devices/bus/ti99/sidecar/arcturus.cpp @@ -21,7 +21,7 @@ #define TI99_CARTSC_C000 "memc000" #define TI99_CARTSC_RAM "ram" -DEFINE_DEVICE_TYPE(TI99_ARCTURUS, bus::ti99::sidecar::arcturus_device, "arcturus", "Arcturus sidecar cartridge") +DEFINE_DEVICE_TYPE(TI99_ARCTURUS, bus::ti99::sidecar::arcturus_device, "ti99_arcturus", "Arcturus sidecar cartridge") namespace bus::ti99::sidecar { From 240f8b8c7ebc30e6d6d9650fc844900ba3f298ab Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 4 Mar 2025 16:16:06 +0100 Subject: [PATCH 078/272] New systems marked not working ------------------------------ Chaoji Da Lianzhuang (Version 1.1) [dyq, little0, Guru] Huang Guan Le Yuan (990726 CRG1.1) [dyq, little0, Guru] --- src/mame/bmc/bmcpokr.cpp | 13 +- src/mame/bordun/att.cpp | 21 +- src/mame/mame.lst | 2 + src/mame/misc/gms.cpp | 507 +++++++++++++++++++++++++++++++- src/mame/seta/simple_st0016.cpp | 34 ++- src/mame/seta/st0016.cpp | 7 +- 6 files changed, 549 insertions(+), 35 deletions(-) diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 84dd63d70226a..2569bac16db89 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -464,14 +464,7 @@ void bmcpokr_state::bmcpokr_mem(address_map &map) uint16_t bmcpokr_state::xyddzhh_dsw_r() { - switch ((m_mux >> 4) & 3) - { - case 0x00: return m_dsw[3]->read() << 8; - case 0x01: return m_dsw[2]->read() << 8; - case 0x02: return m_dsw[1]->read() << 8; - case 0x03: return m_dsw[0]->read() << 8; - } - return 0xff << 8; + return m_dsw[(~m_mux >> 4) & 3]->read() << 8; } void bmcpokr_state::xyddzhh_map(address_map &map) @@ -1191,7 +1184,7 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPNAME( 0x08, 0x08, "Accumulated Bonus" ) PORT_DIPLOCATION("DIP2:4") PORT_DIPSETTING( 0x08, "300" ) PORT_DIPSETTING( 0x00, "400" ) - PORT_DIPNAME( 0x70, 0x70, "Continuing Play Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") + PORT_DIPNAME( 0x70, 0x70, "Double_up Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") PORT_DIPSETTING( 0x60, "92" ) PORT_DIPSETTING( 0x50, "93" ) PORT_DIPSETTING( 0x40, "94" ) @@ -1200,7 +1193,7 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPSETTING( 0x20, "97" ) PORT_DIPSETTING( 0x10, "98" ) PORT_DIPSETTING( 0x00, "99" ) - PORT_DIPNAME( 0x80, 0x80, "Continue Play" ) PORT_DIPLOCATION("DIP2:8") + PORT_DIPNAME( 0x80, 0x80, "Double-Up" ) PORT_DIPLOCATION("DIP2:8") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x80, DEF_STR( On ) ) diff --git a/src/mame/bordun/att.cpp b/src/mame/bordun/att.cpp index 1b4f01d96381f..a9ef393b3de6c 100644 --- a/src/mame/bordun/att.cpp +++ b/src/mame/bordun/att.cpp @@ -9,7 +9,10 @@ Bordun poker games on ATT / ATT III PCBs * this is basically misc/skylncr.cpp without reels and PPIs and with more advanced sound. Merge? * outputs * lianhp3: title screen says 2003TM but PCB is from 2010? Was this really released in 2003? -* NVRAM at 0x8000-0x8777 + +BTANB: +* sound test for lianhp3 doesn't work. It's still coded to send sound commands to 0xd0, but this games + doesn't have an audio CPU. */ @@ -150,7 +153,7 @@ void att_state::att3_io_map(address_map &map) map(0x41, 0x41).w("ramdac", FUNC(ramdac_device::pal_w)); map(0x42, 0x42).w("ramdac", FUNC(ramdac_device::mask_w)); map(0x70, 0x70).nopw(); // TODO: NMI clear? NOPed for now as it spams the log - // map(0xf6, 0xf6).w // TODO: Oki bank select? + map(0xf6, 0xf6).lw8(NAME([this] (uint8_t data) { if (data != 0x00) logerror("Oki bank: %02x\n", data); })); // TODO: Oki bank select? map(0xf7, 0xf7).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } @@ -193,20 +196,20 @@ static INPUT_PORTS_START( lianhp2 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_START("IN2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect // SW1 on PCB is the reset button and SW2-5 are the DIP switches // test mode shows SW1-4 for the DIPs diff --git a/src/mame/mame.lst b/src/mame/mame.lst index ab4e755064bfb..2140497fa49d3 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -30767,7 +30767,9 @@ gluck2 @source:misc/gms.cpp baile ballch +cjdlz cots +hgly jinpaish magslot rbmk diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index 4a99032366d71..ae30896122fc6 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -79,6 +79,7 @@ Hold service credit (9) and reset (F3) to enter service mode. knows how to play) - game logic in baile seems broken (you always win), maybe due to the patches? - broken title GFX in yyhm (transparent pen problem?) +- broken title GFX in cjdlz. How should the extra ROM be loaded? - the newer games seem to use range 0x9e1000-0x9e1fff during gameplay Video references: @@ -141,7 +142,9 @@ class gms_2layers_state : public driver_device void super555(machine_config &config) ATTR_COLD; void init_ballch() ATTR_COLD; + void init_cjldz() ATTR_COLD; void init_cots() ATTR_COLD; + void init_hgly() ATTR_COLD; void init_rbspm() ATTR_COLD; void init_sball2k1() ATTR_COLD; void init_ssanguoj() ATTR_COLD; @@ -1717,6 +1720,384 @@ static INPUT_PORTS_START( sball2k1 ) // default password for accessing game sett PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "SW3:8" ) INPUT_PORTS_END +static INPUT_PORTS_START( cjdlz ) // TODO + PORT_START("IN1") // 16bit + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_SERVICE1 ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_DOUBLE_UP ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_MAHJONG_BET ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN2") // 16bit + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) PORT_TOGGLE + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) + + // Only 4 DIP banks are actually populated on PCBs, but test mode reads all 6. + // TODO: dips + PORT_START("DSW1") // 16bit, in test mode first 8 are recognized as dsw1, second 8 as dsw4. + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "Controls" ) PORT_DIPLOCATION("DSW1:8") // should default to keyboard, but set on joystick since the former isn't emulated yet + PORT_DIPSETTING( 0x0080, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Keyboard" ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + + PORT_START("DSW2") // 16bit, in test mode first 8 are recognized as dsw2, second 8 as dsw5 + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW3") // 16bit, in test mode first 8 are recognized as dsw3, second 8 as dsw6 + PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:1") + PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0002, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:2") + PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0004, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:3") + PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0008, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:5") + PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + +static INPUT_PORTS_START( hgly ) + PORT_START("IN1") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_SERVICE_NO_TOGGLE(0x02, IP_ACTIVE_LOW) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) // start in test mode + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Paytable" ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Start Slot" ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + + PORT_START("IN2") + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + //PORT_BIT( 0x8000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read)) // TODO: verify + + // Only 4 DIP banks are actually populated on PCBs but test mode reads all 6. + // TODO: DIPs + PORT_START("DSW1") // 16bit, in test mode first 8 are recognized as dsw1, second 8 as dsw4. + PORT_DIPNAME( 0x0007, 0x0000, "Card Play Rate" ) PORT_DIPLOCATION("DSW1:1,2,3") + PORT_DIPSETTING( 0x0001, "91" ) + PORT_DIPSETTING( 0x0002, "92" ) + PORT_DIPSETTING( 0x0003, "93" ) + PORT_DIPSETTING( 0x0004, "94" ) + PORT_DIPSETTING( 0x0005, "95" ) + PORT_DIPSETTING( 0x0000, "96" ) + PORT_DIPSETTING( 0x0006, "97" ) + PORT_DIPSETTING( 0x0007, "98" ) + PORT_DIPNAME( 0x0008, 0x0000, "Hold Card" ) PORT_DIPLOCATION("DSW1:4") + PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0010, 0x0000, "Direct Double Up" ) PORT_DIPLOCATION("DSW1:5") + PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0010, DEF_STR( On ) ) + PORT_DIPNAME( 0x0020, 0x0000, "Double Up Option" ) PORT_DIPLOCATION("DSW1:6") + PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x00c0, 0x0000, "Double Up Probability" ) PORT_DIPLOCATION("DSW1:7,8") + PORT_DIPSETTING( 0x0040, DEF_STR( Easy ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) + PORT_DIPSETTING( 0x0080, DEF_STR( Difficult ) ) + PORT_DIPSETTING( 0x00c0, DEF_STR( Very_Difficult ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSW4:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0e00, 0x0000, "Break Taiwan Restrictions" ) PORT_DIPLOCATION("DSW4:2,3,4") // TODO: fishy machine translations + PORT_DIPSETTING( 0x0600, "5000" ) + PORT_DIPSETTING( 0x0800, "10000" ) + PORT_DIPSETTING( 0x0a00, "20000" ) + PORT_DIPSETTING( 0x0000, "30000" ) + PORT_DIPSETTING( 0x0c00, "50000" ) + PORT_DIPSETTING( 0x0e00, "90000" ) + PORT_DIPSETTING( 0x0200, "200000" ) + PORT_DIPSETTING( 0x0400, "500000" ) + PORT_DIPNAME( 0x3000, 0x0000, "Score Limit" ) PORT_DIPLOCATION("DSW4:5,6") + PORT_DIPSETTING( 0x0000, "5000" ) + PORT_DIPSETTING( 0x1000, "10000" ) + PORT_DIPSETTING( 0x2000, "30000" ) + PORT_DIPSETTING( 0x3000, "50000" ) + PORT_DIPNAME( 0x4000, 0x0000, "Double Explosive Machine" ) PORT_DIPLOCATION("DSW4:7") // TODO: fishy machine translations + PORT_DIPSETTING( 0x4000, "10000" ) + PORT_DIPSETTING( 0x0000, "Unlimited" ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") // not definition in test mode + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + + PORT_START("DSW2") // 16bit, in test mode first 8 are recognized as dsw2, second 8 as dsw5 + PORT_DIPNAME( 0x0007, 0x0000, "Coin Ratio" ) PORT_DIPLOCATION("DSW2:1,2,3") + PORT_DIPSETTING( 0x0001, "1" ) + PORT_DIPSETTING( 0x0002, "2" ) + PORT_DIPSETTING( 0x0003, "5" ) + PORT_DIPSETTING( 0x0000, "10" ) + PORT_DIPSETTING( 0x0004, "20" ) + PORT_DIPSETTING( 0x0005, "50" ) + PORT_DIPSETTING( 0x0006, "100" ) + PORT_DIPSETTING( 0x0007, "300" ) + PORT_DIPNAME( 0x0018, 0x0000, "Coin x Score Multiplier" ) PORT_DIPLOCATION("DSW2:4,5") + PORT_DIPSETTING( 0x0008, "2" ) + PORT_DIPSETTING( 0x0010, "5" ) + PORT_DIPSETTING( 0x0000, "10" ) + PORT_DIPSETTING( 0x0018, "20" ) + PORT_DIPNAME( 0x0020, 0x0000, "Bonus Minimum Bet" ) PORT_DIPLOCATION("DSW2:6") + PORT_DIPSETTING( 0x0000, "32" ) + PORT_DIPSETTING( 0x0020, "64" ) + PORT_DIPNAME( 0x0040, 0x0000, "Payout Model" ) PORT_DIPLOCATION("DSW2:7") + PORT_DIPSETTING( 0x0040, "Key Out" ) + PORT_DIPSETTING( 0x0000, "Coin" ) + PORT_DIPNAME( 0x0080, 0x0000, "Pool Initial Score" ) PORT_DIPLOCATION("DSW2:8") + PORT_DIPSETTING( 0x0080, "500" ) + PORT_DIPSETTING( 0x0000, "1000" ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + + PORT_START("DSW3") // 16bit, in test mode first 8 are recognized as dsw3, second 8 as dsw6 + PORT_DIPNAME( 0x0003, 0x0000, "Minimum Bet" ) PORT_DIPLOCATION("DSW3:1,2") // hard-coded + PORT_DIPSETTING( 0x0000, "32" ) + PORT_DIPSETTING( 0x0001, "32 (duplicate)" ) + PORT_DIPSETTING( 0x0002, "32 (duplicate)" ) + PORT_DIPSETTING( 0x0003, "32 (duplicate)" ) + PORT_DIPNAME( 0x000c, 0x0000, "Minimum Bet" ) PORT_DIPLOCATION("DSW3:3,4") // semi hard-coded + PORT_DIPSETTING( 0x0000, "200" ) + PORT_DIPSETTING( 0x0004, "200 (duplicate)" ) + PORT_DIPSETTING( 0x0008, "200 (duplicate)" ) + PORT_DIPSETTING( 0x000c, "360" ) + PORT_DIPNAME( 0x0010, 0x0000, "Bet Every Time" ) PORT_DIPLOCATION("DSW3:5") // hard-coded + PORT_DIPSETTING( 0x0010, "4" ) + PORT_DIPSETTING( 0x0000, "4 (duplicate)" ) + PORT_DIPNAME( 0x0020, 0x0000, "Scoring" ) PORT_DIPLOCATION("DSW3:6") // TODO: fishy machine translations + PORT_DIPSETTING( 0x0020, "Numbers" ) + PORT_DIPSETTING( 0x0000, "Tubes" ) + PORT_DIPNAME( 0x0040, 0x0040, "Controls" ) PORT_DIPLOCATION("DSW3:7") // should default to keyboard, but set on joystick since the former isn't emulated yet + PORT_DIPSETTING( 0x0040, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Keyboard" ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") // not definition in test mode + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") + PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0200, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:2") + PORT_DIPSETTING( 0x0200, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0400, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:3") + PORT_DIPSETTING( 0x0400, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0800, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:4") + PORT_DIPSETTING( 0x0800, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x1000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:5") + PORT_DIPSETTING( 0x1000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x2000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:6") + PORT_DIPSETTING( 0x2000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:7") + PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:8") + PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) +INPUT_PORTS_END + static const gfx_layout rbmk32_layout = { @@ -2334,6 +2715,105 @@ ROM_START( ballch ) ROM_LOAD( "b.challenge_t1_f4cb.u39", 0x00000, 0x80000, CRC(a401072a) SHA1(f80ed4ef873393c36bb0446445bfb3a45e3efb97) ) ROM_END +/* +皇冠樂園 Huáng Guàn Lè Yuán (Crown Amusement Park), GMS, 1999 +超级大连庄 Chāojí Dà Liánzhuāng, GMS, 1999 +Hardware info by Guru +--------------------- + +GMS PCB 98-9-1 for Huang Guan Le Yuan (this layout below) +GMS PCB 98-8-2 for Chao Ji Da Lian Zhuang. 99.9% same board with minor part shuffling. + |---------| |-------------------| +|--| 10WAY |--------| 18WAY |--------------| +|UPC1241H VOL 14.31818MHz| +| S2.U72 |-----| A2.U22 | +| PAL S1.U83 | GMS | A1.U41 | +| M6295 | M06 | | +| |-----| | +| ULN2003 6116 | +|J ULN2003 T518B 6116 | +|A SW1 6116 | +|M 6116 | +|M SW2 6116 | +|A PAL | +| SW3 |-------| | +| |GMS-A69| | +| SW4 |QFP100 | | +| 6116 | | T2.U29 | +| 6116 |-------| | +| T1.U39 | +| 24L257 |-------| | +| 24L257 | GMS | | +| 68000 22MHz |99A-A1 | 93C46 7805 | +| BATT P1.U64 | A66 | | +|-------------------------------|-------|----------------| +Notes: + 68000 - Motorola MC68000FN-10 CPU. Clock 11.0MHz [22/2] + 6116 - 2kB x8-bit SRAM + 24L257 - Winbond W24L257 Low Voltage 32kB x8-bit SRAM (both chips are battery-backed) + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock input 1.100MHz [22/20]. Pin 7 HIGH + GMSM06 - 89C51 microcontroller (or some variant of it) rebadged 'GMS M06'. + Clock input 14.31818MHz on pins 20 and 21 (clock pins match 89C51/89C52/8751/8051) + Note game is fully playable without this chip so maybe it's being used for payout or similar functions? + 93C46 - 93C46 EEPROM. The DI / DO pins are connected to custom chip GMS-99A-A1 A66 + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + T518B - Mitsumi PST518B Master Reset IC (TO92) + SW1-4 - 8-position DIP Switch + uPC1241H - NEC uPC1241H Audio Power Amp + 7805 - LM7805 5V Linear Regulator + BATT - 3.6V Ni-Cad Battery. Maintains power to both 24L257 RAMs when main power supply is off. + Note there is a position for a memory reset switch but it's not populated. + P1 - 27C4096 (Main PRG) + A1/A2/T1/T2 - 27C020/27C040 or 2M/4M mask ROM (GFX) + S1 - 27C040 or 4M mask ROM (OKI samples) + S2 - Not populated + A2 - Not populated on Chao Ji Da Lian Zhuang + T2 - Not populated on Huang Guan Le Yuan + GMS-A69 - Custom graphics chip (QFP100) + On Huang Guan Le Yuan this is GMS-A68 (PLCC84) + GMS-99A - PLCC44 custom chip. Seems to be different for each GMS game that uses this chip and is likely + to be a microcontroller with internal ROM. When identically marked chips are swapped between + these two games the POST reports an error with this chip. When the chip is swapped back to + the correct board it works fine. The same chip was also swapped from San Se Caishen and also + shows this chip with a POST error. +*/ + +ROM_START( hgly ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD( "p1.u64", 0x00000, 0x80000, CRC(047c59f8) SHA1(f0dd39add2d28e80628e621c8c7053bde312ccd5) ) // 1xxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x080000, "oki", 0 ) + ROM_LOAD( "s1.u83", 0x00000, 0x80000, CRC(980ef3a3) SHA1(bf75e693ed25aa3ff704409491be7a399f7a9e08) ) + + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD( "a1.u41", 0x00000, 0x80000, CRC(179e85d6) SHA1(5224aced4769f1c7e43512650e5b67cc26210abe) ) + ROM_LOAD( "a2.u22", 0x80000, 0x80000, CRC(34f4449b) SHA1(797233bb9e8dcda7c07401414a3ed7f8a564e985) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD( "t1.u39", 0x00000, 0x80000, CRC(272945c8) SHA1(89db8e23c58b185c1b4e44f74bcfef9b8c0baa04) ) + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(7372eba5) SHA1(2ccaa4e4ffb8f3ff38f75f286e0ff8dc595a1541) ) +ROM_END + +ROM_START( cjdlz ) + ROM_REGION( 0x80000, "maincpu", 0 ) // 68000 code + ROM_LOAD( "p1.u64", 0x00000, 0x80000, CRC(e3379fff) SHA1(913bdb0f8bc2545bcd94a5738ec9190d55485961) ) + + ROM_REGION( 0x080000, "oki", 0 ) + ROM_LOAD( "mj-s1-s03.u83", 0x00000, 0x80000, CRC(27cf4e44) SHA1(ee7f3fbc0c9cc777cc4f5ef730c30b952ad61fbf) ) + + ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_LOAD( "mj-a1-a07.u41", 0x00000, 0x80000, CRC(8f16d01b) SHA1(7dc0bb4ee230e1f1d61d055574e6790284369b8c) ) + + ROM_REGION( 0xc0000, "gfx2", 0) + ROM_LOAD( "rmj-t1-t05.u39", 0x00000, 0x80000, CRC(30638e20) SHA1(8082b7616ef759823be4265e902b503d15916197) ) + ROM_LOAD( "t2.u29", 0x80000, 0x40000, CRC(a7417ce3) SHA1(fb2a789169149f22af62d0c73cd2d652c7005f3e) ) // TODO: actually overlayed? + + ROM_REGION16_BE( 0x80, "eeprom", 0 ) + ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(28d0db8c) SHA1(fb214d10f1c3a1f2e38cb22c620dcc314896ee54) ) +ROM_END + // the following inits patch out protection (?) checks to allow for testing // unfortunately the various U errors shown don't always correspond to correct PCB locations @@ -2487,6 +2967,29 @@ void gms_2layers_state::init_sscs() rom[0x19c1a / 2] = 0x6000; // U85 ERROR } +void gms_2layers_state::init_cjldz() +{ + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + + + rom[0x00518 / 2] = 0x4e71; // 0xD REPAIR + rom[0x0c628 / 2] = 0x6000; // 0x99 REPAIR + rom[0x0c8e6 / 2] = 0x4e71; // loop + rom[0x0ca00 / 2] = 0x6000; // 0xA REPAIR + rom[0x0ca24 / 2] = 0x4e71; // 0xE REPAIR + rom[0x38664 / 2] = 0x6000; // 0xD REPAIR + rom[0x38980 / 2] = 0x6000; // 0xD REPAIR +} + +void gms_2layers_state::init_hgly() +{ + uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); + + rom[0x0feda / 2] = 0x6004; // U35 ERROR + rom[0x10128 / 2] = 0x6004; // U36 ERROR + rom[0x1393e / 2] = 0x6000; // U64 ERROR +} + } // anonymous namespace @@ -2494,6 +2997,7 @@ void gms_2layers_state::init_sscs() GAME( 1998, rbmk, 0, rbmk, rbmk, gms_2layers_state, empty_init, ROT0, "GMS", "Shizhan Majiang Wang (Version 8.8)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // misses YM2151 hookup GAME( 1998, rbspm, 0, rbspm, rbspm, gms_2layers_state, init_rbspm, ROT0, "GMS", "Shizhan Ding Huang Maque (Version 4.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Misses YM2151 hookup GAME( 1998, ssanguoj, 0, ssanguoj, ssanguoj, gms_2layers_state, init_ssanguoj, ROT0, "GMS", "Shizhan Sanguo Ji Jiaqiang Ban (Version 8.9 980413)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. YM3812 isn't hooked up (goes through undumped MCU). +GAME( 1999, cjdlz, 0, super555, cjdlz, gms_2layers_state, init_cjldz, ROT0, "GMS", "Chaoji Da Lianzhuang (Version 1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2005, yyhm, 0, magslot, yyhm, gms_3layers_state, init_yyhm, ROT0, "GMS", "Yuanyang Hudie Meng (Version 8.8A 2005-09-25)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. // card games @@ -2504,9 +3008,10 @@ GAME( 2001, sc2in1, 0, magslot, sc2in1, gms_3layers_state, init_sc2in1, R GAME( 2004, jinpaish, 0, magslot, jinpaish, gms_3layers_state, init_jinpaish, ROT0, "GMS", "Jinpai Suoha - Show Hand (Chinese version 2004-09-22)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. Also needs correct controls. GAME( 2005, baile, 0, magslot, baile, gms_3layers_state, init_baile, ROT0, "GMS", "Baile 2005 (V3.2 2005-01-12)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. -// slot, on slightly different PCB +// slots GAME( 2003, magslot, 0, magslot, magslot, gms_3layers_state, empty_init, ROT0, "GMS", "Magic Slot (normal 1.0C)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING ) // reel / tilemaps priorities are wrong, inputs to be verified. Also needs EEPROM support. // train games +GAME( 1999, hgly, 0, super555, hgly, gms_2layers_state, init_hgly, ROT0, "GMS", "Huang Guan Le Yuan (990726 CRG1.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2002, ballch, 0, super555, ballch, gms_2layers_state, init_ballch, ROT0, "TVE", "Ball Challenge (20020607 1.0 OVERSEA)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2005, cots, 0, super555, cots, gms_2layers_state, init_cots, ROT0, "ECM", "Creatures of the Sea (20050328 USA 6.3)", MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. diff --git a/src/mame/seta/simple_st0016.cpp b/src/mame/seta/simple_st0016.cpp index 42f9e73e004d1..d0a1d8e5d6f21 100644 --- a/src/mame/seta/simple_st0016.cpp +++ b/src/mame/seta/simple_st0016.cpp @@ -46,14 +46,15 @@ class st0016_state : public driver_device m_dsw(*this, "DSW%u", 1U) { } - void st0016(machine_config &config); - void renju(machine_config &config); - void mayjinsn(machine_config &config); + void st0016(machine_config &config) ATTR_COLD; + void renju(machine_config &config) ATTR_COLD; + void mayjinsn(machine_config &config) ATTR_COLD; - void init_nratechu(); - void init_mayjinsn(); - void init_mayjisn2(); - void init_renju(); + void init_crownpkr() ATTR_COLD; + void init_nratechu() ATTR_COLD; + void init_mayjinsn() ATTR_COLD; + void init_mayjisn2() ATTR_COLD; + void init_renju() ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -419,7 +420,7 @@ static INPUT_PORTS_START( crownpkr ) PORT_MODIFY("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_NAME( "Hold 3 / Low" ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) @@ -433,9 +434,9 @@ static INPUT_PORTS_START( crownpkr ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_NAME( "Hold 2 / High" ) // also Meter Key in test mode PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) // also Reset Key in test mode PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // Last Game Key in test mode - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no effect in test mode PORT_MODIFY("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(5) @@ -819,6 +820,11 @@ void st0016_state::init_nratechu() m_maincpu->set_game_flag(1); } +void st0016_state::init_crownpkr() +{ + m_maincpu->set_game_flag(2); +} + void st0016_state::init_mayjinsn() { m_maincpu->set_game_flag(4 /*| 0x80*/); @@ -846,6 +852,6 @@ GAME( 2001, gostop, 0, st0016, gostop, st0016_state, init_renju, // Not working GAME( 1994, mayjinsn, 0, mayjinsn, st0016, st0016_state, init_mayjinsn, ROT0, "Seta", "Mayjinsen", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) -GAME( 1997, crownpkr, 0, st0016, crownpkr, st0016_state, init_nratechu, ROT0, "Unknown", "Crown Poker (ver. 1.20)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // coining in doesn't work -GAME( 1994, dcrown, 0, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text -GAME( 1994, dcrowna, dcrown, st0016, renju, st0016_state, init_renju, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded +GAME( 1997, crownpkr, 0, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "", "Crown Poker (ver. 1.20)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // coining in doesn't work +GAME( 1994, dcrown, 0, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "Nippon Data Kiki", "Dream Crown (set 1)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // (c) 1994 Nippon Data Kiki is uploaded near the Japanese Insert coin text +GAME( 1994, dcrowna, dcrown, st0016, crownpkr, st0016_state, init_crownpkr, ROT0, "Nippon Data Kiki", "Dream Crown (set 2)", MACHINE_NOT_WORKING | MACHINE_NO_COCKTAIL | MACHINE_SUPPORTS_SAVE ) // the Insert Coin text has been translated to English and no (c) is uploaded diff --git a/src/mame/seta/st0016.cpp b/src/mame/seta/st0016.cpp index fc9bb9d7d6e61..c50e5940e47a0 100644 --- a/src/mame/seta/st0016.cpp +++ b/src/mame/seta/st0016.cpp @@ -122,6 +122,11 @@ void st0016_cpu_device::device_reset() m_spr_dy = 8; break; + case 2: // Crown Poker + screen().set_visible_area(8,42*8-1,0,30*8-1); + m_spr_dx = 4; + break; + case 4: // mayjinsen 1&2 screen().set_visible_area(0,32*8-1,0,28*8-1); break; @@ -319,7 +324,7 @@ void st0016_cpu_device::vregs_w(offs_t offset, u8 data) $74 x--- ---- global flip screen -xx- ---- individual flip screen x/y i.e. Mayjinsen sets 0x80, other ST0016 games 0x60. - TODO: Might also be paired with $70 & $75 (setted up by Mayjinsen). + TODO: Might also be paired with $70 & $75 (set up by Mayjinsen). $a0 \ $a1 - source address >> 1 From d304c339155f89b34b352ee1ccad81d4ec8fa9d7 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 4 Mar 2025 16:46:50 +0100 Subject: [PATCH 079/272] New clones marked not working ----------------------------- Super Star 97 / Ming Xing 97 (version V168A) [dyq, little0, Guru] --- src/mame/bmc/bmcpokr.cpp | 2 +- src/mame/bordun/skylncr.cpp | 117 ++++++++++++++++++++++++++++++------ src/mame/mame.lst | 1 + 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 2569bac16db89..b091adf9f42b8 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -1184,7 +1184,7 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPNAME( 0x08, 0x08, "Accumulated Bonus" ) PORT_DIPLOCATION("DIP2:4") PORT_DIPSETTING( 0x08, "300" ) PORT_DIPSETTING( 0x00, "400" ) - PORT_DIPNAME( 0x70, 0x70, "Double_up Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") + PORT_DIPNAME( 0x70, 0x70, "Double-Up Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") PORT_DIPSETTING( 0x60, "92" ) PORT_DIPSETTING( 0x50, "93" ) PORT_DIPSETTING( 0x40, "94" ) diff --git a/src/mame/bordun/skylncr.cpp b/src/mame/bordun/skylncr.cpp index 2a044cd44c8db..3498bc73c19f6 100644 --- a/src/mame/bordun/skylncr.cpp +++ b/src/mame/bordun/skylncr.cpp @@ -152,23 +152,24 @@ class skylncr_state : public driver_device m_decrypted_opcodes(*this, "decrypted_opcodes") { } - void neraidou(machine_config &config); - void sstar97(machine_config &config); - void bdream97(machine_config &config); - void skylncr(machine_config &config); - void mbutrfly(machine_config &config); - void olymp(machine_config &config); - - void init_blshark(); - void init_butrfly(); - void init_leadera(); - void init_mbutrfly() { save_item(NAME(m_mbutrfly_prot)); } - void init_miaction(); - void init_olymp(); - void init_sonikfig(); - void init_speedway(); - void init_speedwaya(); - void init_superb2k(); + void neraidou(machine_config &config) ATTR_COLD; + void sstar97(machine_config &config) ATTR_COLD; + void bdream97(machine_config &config) ATTR_COLD; + void skylncr(machine_config &config) ATTR_COLD; + void mbutrfly(machine_config &config) ATTR_COLD; + void olymp(machine_config &config) ATTR_COLD; + + void init_blshark() ATTR_COLD; + void init_butrfly() ATTR_COLD; + void init_leadera() ATTR_COLD; + void init_mbutrfly() ATTR_COLD { save_item(NAME(m_mbutrfly_prot)); } + void init_miaction() ATTR_COLD; + void init_olymp() ATTR_COLD; + void init_sonikfig() ATTR_COLD; + void init_speedway() ATTR_COLD; + void init_speedwaya() ATTR_COLD; + void init_sstar97a() ATTR_COLD; + void init_superb2k() ATTR_COLD; int mbutrfly_prot_r(); @@ -2053,9 +2054,9 @@ ROM_END */ ROM_START( sstar97 ) - ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD( "27256.u15", 0x0000, 0x8000, CRC(a5da4f92) SHA1(82ac70bd379649f130db017aa226d0247db0f3cd) ) - ROM_LOAD( "unknown.u48", 0x8000, 0x8000, BAD_DUMP CRC(9f4c02e3) SHA1(05975184130ea7dd3bb5d32eff77b585bd53e6b5) ) // palette borrowed from other game + ROM_LOAD( "unknown.u48", 0xc000, 0x4000, CRC(39df04c6) SHA1(1056b1ecb60f69fa1d4bcf1629913d21f5ce6f50) ) ROM_REGION( 0x80000, "gfx1", 0 ) // All ROMs are 28-pins mask ROMs dumped as Fujitsu MB831000 or TC531000 (mask ROM). ROM_LOAD16_BYTE( "bor_dun_4.u23", 0x00000, 0x20000, CRC(d0d0ead1) SHA1(00bfe691cb9020c5d7e21d80a1e059ea2155aad8) ) @@ -2070,6 +2071,72 @@ ROM_START( sstar97 ) ROM_LOAD16_BYTE( "bor_dun_5.u22", 0x40001, 0x20000, CRC(ca17a632) SHA1(d491310ccdbe9b59a1e607f9254646f20700d79d) ) ROM_END +/* +明星 97 (Ming Xing 97) /Super Star 97, Bordun, 1997 +Hardware Info by Guru +--------------------- + +PCB#: BORDUN SUPER STAR 97 + |--------------------------------------------| + | 6116 101.U26 | +|-|TA8201 VOL | +|1 6116 102.U25 | +|0 | +|W KC89C72 6116 103.U24 | +|A | +|Y 6116 104.U23 | +|-| SW4 6116 | + | |------| 105.U22 | +|-| SW3 |XILINX| | +|M |XC2064| 106.U21 | +|A SW2 | | | +|H M5M82C255 |------| 107.U20 | +|J SW1 PAL16V8H | +|O 108.U19 | +|N 110.U48 6116 | +|G T518B GAL20V8B KDA0476 12MHz| +|-| BATT KDA0476 | + |SW5 Z80 109.U15* | + |--------------------------------------------| +Notes: + Z80 - NEC D780C-2 Z80B CPU. Clock 3.0000MHz [12/4] + KC89C72 - Clone of AY-3-8910. Clock 1.500MHz [12/8] + M5M82C255 - Mitsubishi M5M82C255 CMOS Programmable Peripheral Interface. Equivalent to 2x 82C55. + XC2064 - Xilinx XC2064 FPGA + 6116 - 2kB x8-bit SRAM. Note 6116 near U48 is battery-backed. + KDA0476 - Samsung KDA0476BCN-66 Color Palette With Triple 6-Bit DAC (same as HMC HM86171-80) + Note there are 2 chips on this PCB. + TA8201 - Toshiba TA8201 17W BTL Audio Power Amplifier + T518B - Mitsumi T518B Reset Chip (TO92) + BATT - 3.6V Nicad Barrel Battery. Provides power to 6116 near U48. + SW1-4 - 8-Position DIP Switch + SW5 - Push button for Reset and NVRAM Clear + 101-108 - Macronix MX28F1000 128kB x8-bit EEPROM (Graphics) + 109 - 27C512 on plug-in daughterboard with two PALs (Main Program) + 110 - 27C128 16kB x8-bit EPROM (Palette) +*/ + +ROM_START( sstar97a ) + ROM_REGION( 0x14000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "109.u15", 0x04000, 0x04000, CRC(ed3a645a) SHA1(daffc12574491ee6aacc144e633792d9eab6eb6e) ) // TODO: decrambling not correct, seems two contain two programs + ROM_CONTINUE( 0x00000, 0x04000 ) + ROM_CONTINUE( 0x0c000, 0x04000 ) + ROM_CONTINUE( 0x08000, 0x04000 ) + ROM_LOAD( "110.u48", 0x10000, 0x04000, CRC(39df04c6) SHA1(1056b1ecb60f69fa1d4bcf1629913d21f5ce6f50) ) // TODO: load this correctly once descrambling of the first ROM is figured out + + ROM_REGION( 0x80000, "gfx1", 0 ) + ROM_LOAD16_BYTE( "104.u23", 0x00000, 0x20000, CRC(d0d0ead1) SHA1(00bfe691cb9020c5d7e21d80a1e059ea2155aad8) ) + ROM_LOAD16_BYTE( "102.u25", 0x00001, 0x20000, CRC(2b0f07b5) SHA1(9bcde623e53697c4b68d2f083f6254596aee64eb) ) + ROM_LOAD16_BYTE( "103.u24", 0x40000, 0x20000, CRC(3c7da3f1) SHA1(8098b33a779fb697984b97f2d7edb9874e6e19d9) ) + ROM_LOAD16_BYTE( "101.u26", 0x40001, 0x20000, CRC(36efdca6) SHA1(e614fbba77e5c7a1e7a1d2970b4f945ee0468196) ) + + ROM_REGION( 0x80000, "gfx2", 0 ) + ROM_LOAD16_BYTE( "108.u19", 0x00000, 0x20000, CRC(adf0b7ce) SHA1(41d9fb16eb20e1fd2960117b7e4ea23a97b88961) ) + ROM_LOAD16_BYTE( "106.u21", 0x00001, 0x20000, CRC(37be2cbe) SHA1(78acda58aab605cb992c3b9fbaf18d38f768ed1a) ) + ROM_LOAD16_BYTE( "107.u20", 0x40000, 0x20000, CRC(43908665) SHA1(41b9cee0723d9da6934ab7934012fb1625a8f080) ) + ROM_LOAD16_BYTE( "105.u22", 0x40001, 0x20000, CRC(ca17a632) SHA1(d491310ccdbe9b59a1e607f9254646f20700d79d) ) +ROM_END + /* 蝴蝶梦 97 (Húdié Mèng 97) Game is encrypted and needs better decoded graphics. @@ -2319,6 +2386,17 @@ void skylncr_state::init_sonikfig() } } +void skylncr_state::init_sstar97a() +{ + uint8_t *const ROM = memregion("maincpu")->base(); + for (unsigned x = 0; x < 0x10000; x += 4) + { + std::swap(ROM[x + 0], ROM[x + 2]); + std::swap(ROM[x + 1], ROM[x + 3]); + } +} + + void skylncr_state::init_miaction() /* Encryption: @@ -2508,6 +2586,7 @@ GAME( 199?, neraidou, 0, neraidou, neraidou, skylncr_state, empty_init, GAME( 199?, miaction, 0, skylncr, skylncr, skylncr_state, init_miaction, ROT0, "Vegas", "Missing In Action", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 199?, tigerslt, 0, skylncr, skylncr, skylncr_state, init_miaction, ROT0, "bootleg", "Tiger (slot)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 199?, sstar97, 0, sstar97, sstar97, skylncr_state, empty_init, ROT0, "Bordun International", "Super Star 97 / Ming Xing 97 (version V153B)", MACHINE_SUPPORTS_SAVE ) +GAME( 199?, sstar97a, sstar97, sstar97, sstar97, skylncr_state, init_sstar97a, ROT0, "Bordun International", "Super Star 97 / Ming Xing 97 (version V168A)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 1995, bdream97, 0, bdream97, skylncr, skylncr_state, empty_init, ROT0, "bootleg (KKK)", "Hudie Meng 97", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) GAME( 2000?,olymp, 0, olymp, skylncr, skylncr_state, init_olymp, ROT0, "Z Games", "Olympus (Z Games, version 10)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // Still has Bordun International 1992 strings GAME( 2000, sonikfig, 0, skylncr, sonikfig, skylncr_state, init_sonikfig, ROT0, "Z Games", "Sonik Fighter (version 02, encrypted)", MACHINE_WRONG_COLORS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 2140497fa49d3..4fd27afc06272 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -15194,6 +15194,7 @@ spcliner speedway speedwaya sstar97 +sstar97a superb2k tigerslt From c36ff69f336c4972ffa0aad4a79c8b9917e0de25 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 5 Mar 2025 02:51:36 +1100 Subject: [PATCH 080/272] bmc/bmcpokr.cpp: Improved DIP switch settings for xyddzhh. --- src/mame/bmc/bmcpokr.cpp | 128 ++++++++++++++--------------- src/osd/modules/file/posixfile.cpp | 10 +-- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index b091adf9f42b8..80f8ec6169488 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -464,7 +464,7 @@ void bmcpokr_state::bmcpokr_mem(address_map &map) uint16_t bmcpokr_state::xyddzhh_dsw_r() { - return m_dsw[(~m_mux >> 4) & 3]->read() << 8; + return m_dsw[(~m_mux >> 4) & 0x03]->read() << 8; } void bmcpokr_state::xyddzhh_map(address_map &map) @@ -1147,36 +1147,36 @@ static INPUT_PORTS_START( xyddzhh ) // Maximum Bet is fixed to 40 according to test mode (no DIP determines it) PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP1:1") - PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPSETTING( 0x01, DEF_STR( No ) ) - PORT_DIPNAME( 0x02, 0x02, "Key Out Table as" ) PORT_DIPLOCATION("DIP1:2") - PORT_DIPSETTING( 0x00, "Coin" ) - PORT_DIPSETTING( 0x02, "Key In" ) - PORT_DIPNAME( 0x04, 0x04, "Coin Out" ) PORT_DIPLOCATION("DIP1:3") - PORT_DIPSETTING( 0x04, DEF_STR( No ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x08, 0x08, "Alarm Sound Effect" ) PORT_DIPLOCATION("DIP1:4") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_DIPNAME( 0x10, 0x10, "Automatic Pass" ) PORT_DIPLOCATION("DIP1:5") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0xe0, 0xe0, "Performance Breaking Table" ) PORT_DIPLOCATION("DIP1:6,7,8") - PORT_DIPSETTING( 0xc0, "5000" ) - PORT_DIPSETTING( 0xe0, "10000" ) - PORT_DIPSETTING( 0xa0, "15000" ) - PORT_DIPSETTING( 0x80, "20000" ) - PORT_DIPSETTING( 0x60, "25000" ) - PORT_DIPSETTING( 0x40, "30000" ) - PORT_DIPSETTING( 0x20, "40000" ) - PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPNAME( 0x01, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("DIP1:1") + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) + PORT_DIPNAME( 0x02, 0x02, "Key-Out Rate" ) PORT_DIPLOCATION("DIP1:2") + PORT_DIPSETTING( 0x02, "Key-In Rate" ) + PORT_DIPSETTING( 0x00, DEF_STR(Coinage) ) + PORT_DIPNAME( 0x04, 0x04, "Return Coins" ) PORT_DIPLOCATION("DIP1:3") + PORT_DIPSETTING( 0x04, DEF_STR(No) ) + PORT_DIPSETTING( 0x00, DEF_STR(Yes) ) + PORT_DIPNAME( 0x08, 0x08, "Siren Sound" ) PORT_DIPLOCATION("DIP1:4") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x08, DEF_STR(On) ) + PORT_DIPNAME( 0x10, 0x10, "Auto Pass" ) PORT_DIPLOCATION("DIP1:5") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x10, DEF_STR(On) ) + PORT_DIPNAME( 0xe0, 0xe0, "Double-Up Game Jackpot" ) PORT_DIPLOCATION("DIP1:6,7,8") + PORT_DIPSETTING( 0xc0, "5,000" ) + PORT_DIPSETTING( 0xe0, "10,000" ) + PORT_DIPSETTING( 0xa0, "15,000" ) + PORT_DIPSETTING( 0x80, "20,000" ) + PORT_DIPSETTING( 0x60, "25,000" ) + PORT_DIPSETTING( 0x40, "30,000" ) + PORT_DIPSETTING( 0x20, "40,000" ) + PORT_DIPSETTING( 0x00, "50,000" ) PORT_START("DSW2") PORT_DIPNAME( 0x01, 0x00, "Controls" ) PORT_DIPLOCATION("DIP2:1") PORT_DIPSETTING( 0x01, "Mahjong" ) PORT_DIPSETTING( 0x00, "Entertainment" ) - PORT_DIPNAME( 0x06, 0x06, "Play Expiration" ) PORT_DIPLOCATION("DIP2:2,3") + PORT_DIPNAME( 0x06, 0x06, "Double-Up Game Threshold" ) PORT_DIPLOCATION("DIP2:2,3") PORT_DIPSETTING( 0x06, "3000" ) PORT_DIPSETTING( 0x04, "4000" ) PORT_DIPSETTING( 0x02, "5000" ) @@ -1184,30 +1184,30 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPNAME( 0x08, 0x08, "Accumulated Bonus" ) PORT_DIPLOCATION("DIP2:4") PORT_DIPSETTING( 0x08, "300" ) PORT_DIPSETTING( 0x00, "400" ) - PORT_DIPNAME( 0x70, 0x70, "Double-Up Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") - PORT_DIPSETTING( 0x60, "92" ) - PORT_DIPSETTING( 0x50, "93" ) - PORT_DIPSETTING( 0x40, "94" ) - PORT_DIPSETTING( 0x70, "95" ) - PORT_DIPSETTING( 0x30, "96" ) - PORT_DIPSETTING( 0x20, "97" ) - PORT_DIPSETTING( 0x10, "98" ) - PORT_DIPSETTING( 0x00, "99" ) - PORT_DIPNAME( 0x80, 0x80, "Double-Up" ) PORT_DIPLOCATION("DIP2:8") - PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x80, DEF_STR( On ) ) + PORT_DIPNAME( 0x70, 0x70, "Double-Up Game Payout Rate" ) PORT_DIPLOCATION("DIP2:5,6,7") + PORT_DIPSETTING( 0x60, "92%" ) + PORT_DIPSETTING( 0x50, "93%" ) + PORT_DIPSETTING( 0x40, "94%" ) + PORT_DIPSETTING( 0x70, "95%" ) + PORT_DIPSETTING( 0x30, "96%" ) + PORT_DIPSETTING( 0x20, "97%" ) + PORT_DIPSETTING( 0x10, "98%" ) + PORT_DIPSETTING( 0x00, "99%" ) + PORT_DIPNAME( 0x80, 0x80, "Double-Up Game" ) PORT_DIPLOCATION("DIP2:8") + PORT_DIPSETTING( 0x00, DEF_STR(Off) ) + PORT_DIPSETTING( 0x80, DEF_STR(On) ) PORT_START("DSW3") - PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coinage) ) PORT_DIPLOCATION("DIP3:1,2,3") - PORT_DIPSETTING( 0x06, "1" ) - PORT_DIPSETTING( 0x05, "2" ) - PORT_DIPSETTING( 0x04, "5" ) - PORT_DIPSETTING( 0x03, "10" ) - PORT_DIPSETTING( 0x02, "15" ) - PORT_DIPSETTING( 0x01, "50" ) - PORT_DIPSETTING( 0x07, "100" ) - PORT_DIPSETTING( 0x00, "200" ) - PORT_DIPNAME( 0x38, 0x38, "Key In" ) PORT_DIPLOCATION("DIP3:4,5,6") + PORT_DIPNAME( 0x07, 0x07, DEF_STR(Coinage) ) PORT_DIPLOCATION("DIP3:1,2,3") + PORT_DIPSETTING( 0x06, DEF_STR(1C_1C) ) + PORT_DIPSETTING( 0x05, DEF_STR(1C_2C) ) + PORT_DIPSETTING( 0x04, DEF_STR(1C_5C) ) + PORT_DIPSETTING( 0x03, "1 Coin/10 Credits" ) + PORT_DIPSETTING( 0x02, "1 Coin/20 Credits" ) + PORT_DIPSETTING( 0x01, "1 Coin/50 Credits" ) + PORT_DIPSETTING( 0x07, "1 Coin/100 Credits" ) + PORT_DIPSETTING( 0x00, "1 Coin/200 Credits" ) + PORT_DIPNAME( 0x38, 0x38, "Key-In Rate" ) PORT_DIPLOCATION("DIP3:4,5,6") PORT_DIPSETTING( 0x30, "40" ) PORT_DIPSETTING( 0x28, "50" ) PORT_DIPSETTING( 0x38, "100" ) @@ -1216,15 +1216,15 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPSETTING( 0x10, "500" ) PORT_DIPSETTING( 0x08, "1000" ) PORT_DIPSETTING( 0x00, "2000" ) - PORT_DIPNAME( 0x40, 0x40, "Points Limit" ) PORT_DIPLOCATION("DIP3:7") - PORT_DIPSETTING( 0x00, "10000" ) - PORT_DIPSETTING( 0x40, "99000" ) + PORT_DIPNAME( 0x40, 0x40, "Credit Limit" ) PORT_DIPLOCATION("DIP3:7") + PORT_DIPSETTING( 0x00, "10,000" ) + PORT_DIPSETTING( 0x40, "99,000" ) PORT_DIPNAME( 0x80, 0x80, "Card Type" ) PORT_DIPLOCATION("DIP3:8") PORT_DIPSETTING( 0x80, DEF_STR ( Normal ) ) PORT_DIPSETTING( 0x00, "Graphics" ) PORT_START("DSW4") - PORT_DIPNAME( 0x07, 0x07, "Min Bet" ) PORT_DIPLOCATION("DIP4:1,2,3") + PORT_DIPNAME( 0x07, 0x07, "Minimum Bet" ) PORT_DIPLOCATION("DIP4:1,2,3") PORT_DIPSETTING( 0x06, "1" ) PORT_DIPSETTING( 0x05, "2" ) PORT_DIPSETTING( 0x04, "3" ) @@ -1233,21 +1233,21 @@ static INPUT_PORTS_START( xyddzhh ) PORT_DIPSETTING( 0x02, "15" ) PORT_DIPSETTING( 0x01, "20" ) PORT_DIPSETTING( 0x00, "40" ) - PORT_DIPNAME( 0x38, 0x38, "Game Odds" ) PORT_DIPLOCATION("DIP4:4,5,6") - PORT_DIPSETTING( 0x30, "90" ) - PORT_DIPSETTING( 0x28, "91" ) - PORT_DIPSETTING( 0x20, "92" ) - PORT_DIPSETTING( 0x18, "93" ) - PORT_DIPSETTING( 0x38, "94" ) - PORT_DIPSETTING( 0x10, "95" ) - PORT_DIPSETTING( 0x08, "96" ) - PORT_DIPSETTING( 0x00, "97" ) + PORT_DIPNAME( 0x38, 0x38, "Payout Rate" ) PORT_DIPLOCATION("DIP4:4,5,6") + PORT_DIPSETTING( 0x30, "90%" ) + PORT_DIPSETTING( 0x28, "91%" ) + PORT_DIPSETTING( 0x20, "92%" ) + PORT_DIPSETTING( 0x18, "93%" ) + PORT_DIPSETTING( 0x38, "94%" ) + PORT_DIPSETTING( 0x10, "95%" ) + PORT_DIPSETTING( 0x08, "96%" ) + PORT_DIPSETTING( 0x00, "97%" ) PORT_DIPNAME( 0x40, 0x40, "Market Setting" ) PORT_DIPLOCATION("DIP4:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, "System Breakdown" ) PORT_DIPLOCATION("DIP4:8") - PORT_DIPSETTING( 0x00, "50000" ) - PORT_DIPSETTING( 0x80, "100000" ) + PORT_DIPNAME( 0x80, 0x80, "Jackpot" ) PORT_DIPLOCATION("DIP4:8") + PORT_DIPSETTING( 0x00, "50,000" ) + PORT_DIPSETTING( 0x80, "100,000" ) INPUT_PORTS_END diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index c5ce8bf7b4e45..b6f9f65921b36 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -380,13 +380,13 @@ std::unique_ptr osd_stat(const std::string &path) // create an osd_directory_entry; be sure to make sure that the caller can // free all resources by just freeing the resulting osd_directory_entry - osd::directory::entry *result; - try { result = reinterpret_cast(::operator new(sizeof(*result) + path.length() + 1)); } - catch (...) { return nullptr; } + auto const result = reinterpret_cast(::operator new(sizeof(osd::directory::entry) + path.length() + 1), std::nothrow); + if (!result) return nullptr; new (result) osd::directory::entry; - std::strcpy(reinterpret_cast(result) + sizeof(*result), path.c_str()); - result->name = reinterpret_cast(result) + sizeof(*result); + auto const resultname = reinterpret_cast(result) + sizeof(*result); + std::strcpy(resultname, path.c_str()); + result->name = resultname; result->type = S_ISDIR(st.st_mode) ? osd::directory::entry::entry_type::DIR : osd::directory::entry::entry_type::FILE; result->size = std::uint64_t(std::make_unsigned_t(st.st_size)); result->last_modified = std::chrono::system_clock::from_time_t(st.st_mtime); From 493348cd5805cb11ac94582e0a843d29b8492382 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 5 Mar 2025 03:14:46 +1100 Subject: [PATCH 081/272] posixfile.cpp: nothrow is passed to operator new, not to reinterpret_cast. --- src/osd/modules/file/posixfile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index b6f9f65921b36..db3bc55dd039f 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -380,7 +380,7 @@ std::unique_ptr osd_stat(const std::string &path) // create an osd_directory_entry; be sure to make sure that the caller can // free all resources by just freeing the resulting osd_directory_entry - auto const result = reinterpret_cast(::operator new(sizeof(osd::directory::entry) + path.length() + 1), std::nothrow); + auto const result = reinterpret_cast(::operator new(sizeof(osd::directory::entry) + path.length() + 1, std::nothrow)); if (!result) return nullptr; new (result) osd::directory::entry; From 3c1d14f76e78bf6b7567f229522480b9c4e37721 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 5 Mar 2025 03:20:30 +1100 Subject: [PATCH 082/272] posixfile.cpp: Pass in explcit alignment to operator new just in case. --- src/osd/modules/file/posixfile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index db3bc55dd039f..8aebde2adc2d3 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -380,7 +380,11 @@ std::unique_ptr osd_stat(const std::string &path) // create an osd_directory_entry; be sure to make sure that the caller can // free all resources by just freeing the resulting osd_directory_entry - auto const result = reinterpret_cast(::operator new(sizeof(osd::directory::entry) + path.length() + 1, std::nothrow)); + auto const result = reinterpret_cast( + ::operator new( + sizeof(osd::directory::entry) + path.length() + 1, + std::align_val_t(alignof(osd::directory::entry)), + std::nothrow)); if (!result) return nullptr; new (result) osd::directory::entry; From c6897b843d681d731af9bb6110c0fd38df22985b Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 4 Mar 2025 19:45:19 +0100 Subject: [PATCH 083/272] skeleton/pv9234.cpp: hookup stub NS16550, more notes --- src/mame/skeleton/pv9234.cpp | 129 +++++++++++++++++++---------------- 1 file changed, 71 insertions(+), 58 deletions(-) diff --git a/src/mame/skeleton/pv9234.cpp b/src/mame/skeleton/pv9234.cpp index 328fee5a296f8..3b2ccbaf1b462 100644 --- a/src/mame/skeleton/pv9234.cpp +++ b/src/mame/skeleton/pv9234.cpp @@ -8,33 +8,60 @@ PowerVu D9234 STB (c) 1997 Scientific Atlanta References: - http://www.vetrun.net/forums/showthread.php?t=395 -- http://colibri.net63.net/powervu.htm -- http://www.growl.de/d9234/ +- https://web.archive.org/web/20080203175218/http://www.growl.de/d9234/ TODO: - everything, including PCB pictures and user manual; - Probably shared with other PowerVu DVB-S STB models; +- Flash ROM is (2x? 4x?) AT29C256 according to an evasive pic; +- $3f000 area should be bootstrap code, inits UART from there? Front Panel: -- On/standby / Signal on left -- arrow keys with select in the middle, next to DVB logo +- On/Standby | Signal/Menu on the left; +- arrow keys with select in the middle, next to DVB logo; +- PowerVu Conditional Access slot, on the right; Back Panel: -- CH3 / CH4 dip; -- Ant In and Tv Out UHF connectors, near composite audio/video jacks -- Satellite LNB PWR +13/+19V 250mA +- CH3 / CH4 dip, HF modulator (US standard); +- Ant In and Tv Out VHF/UHF connectors, near composite audio/video jacks; +- Satellite LNB PWR +13/+19V 250mA; - LNB PWR ON / OFF dip; -- AC IN, 100V-240V, 50/60Hz +- AC IN, 100V-240V, 50/60Hz; +According to the Quick Setup Guide, can have following optional slots: +- S-Video Out; +- DE-9 Wideband Data and/or DA-25 Expansion Port; =================================================================================================== -Meant for payTV providers to decrypt signals from the satellite and pump -them out on a local cable network. The powervu encryption is very secure. +This is the serial output to a terminal, used for debugging. +The boot process goes something like this: + +Start + +Config: 0x00001080 (Max Config: 00003C80) +MV 00000004.00000003 +DL Avail +IOP Com. O.K. 00000004 +Check CRC ... +CRC O.K. +Launch App +************** +* Ver 2.05 * +************** +Compiled by: FURLANO +Date & time: Nov 3 1997, 15:34:29 +All printing enabled. Press space bar to toggle on/off. +Time stamping enabled. Press 't' to turn on/off. +Press 'o' to toggle printing of MPEG Xport error messages. **************************************************************************************************/ #include "emu.h" + +#include "bus/rs232/rs232.h" #include "cpu/arm7/arm7.h" +#include "machine/ins8250.h" + #include "emupal.h" #include "screen.h" @@ -54,9 +81,7 @@ class pv9234_state : public driver_device void pv9234(machine_config &config); private: - void debug_w(uint32_t data); void debug1_w(uint32_t data); - void debug2_w(uint32_t data); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -79,37 +104,6 @@ uint32_t pv9234_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap } -/* -This is the serial output to a terminal, used for debugging. -The boot process goes something like this: - -Start - -Config: 0x00001080 (Max Config: 00003C80) -MV 00000004.00000003 -DL Avail -IOP Com. O.K. 00000004 -Check CRC ... -CRC O.K. -Launch App -************** -* Ver 2.05 * -************** -Compiled by: FURLANO -Date & time: Nov 3 1997, 15:34:29 -All printing enabled. Press space bar to toggle on/off. -Time stamping enabled. Press 't' to turn on/off. -Press 'o' to toggle printing of MPEG Xport error messages. -*/ -void pv9234_state::debug_w(uint32_t data) -{ - if (data) - { - //printf("%02x %c\n",data,data); // this prints 'Start' to the console. - logerror("debug=%02x %c\n",data,data); - } -} - void pv9234_state::debug1_w(uint32_t data) { uint8_t i,j; @@ -126,25 +120,30 @@ void pv9234_state::debug1_w(uint32_t data) } } -void pv9234_state::debug2_w(uint32_t data) -{ - if (data) - logerror("debug2=%02x\n",data); // ignore the huge amount of zeroes here -} - void pv9234_state::main_map(address_map &map) { - map(0x00000000, 0x0007ffff).rom().region("maincpu", 0); //FLASH ROM! + //map.unmap_value_high(); + // TODO: flash ROM + map(0x00000000, 0x0007ffff).rom().region("maincpu", 0); // map(0x00000000, 0x00000033).w(FUNC(pv9234_state::)); something // map(0x00000044, 0x00000047).w(FUNC(pv9234_state::)); // map(0x00000060, 0x0000006b).w(FUNC(pv9234_state::)); // map(0x00007000, 0x00007003).w(FUNC(pv9234_state::)); // map(0x00008000, 0x00008003).w(FUNC(pv9234_state::)); + map(0x00008000, 0x000080ff).unmaprw(); map(0x00008014, 0x00008017).w(FUNC(pv9234_state::debug1_w)); // map(0x00008020, 0x00008027).w(FUNC(pv9234_state::)); - map(0x000080c0, 0x000080c3).w(FUNC(pv9234_state::debug2_w)); - map(0x000080cc, 0x000080cf).w(FUNC(pv9234_state::debug_w)); - // map(0x000080d0, 0x000080d3).w(FUNC(pv9234_state::)); + map(0x000080c0, 0x000080df).rw("uart", FUNC(ns16550_device::ins8250_r), FUNC(ns16550_device::ins8250_w)).umask32(0x000000ff); + map(0x000080cc, 0x000080cc).lw8( + NAME([this] (offs_t offset, u8 data) { + if (data) + { + //printf("%02x %c\n",data,data); // this prints 'Start' to the console. + logerror("debug=%02x %c\n",data,data); + } + }) + ); + map(0x0003e000, 0x0003efff).ram().share("p_ram"); map(0x00080000, 0x00087fff).mirror(0x78000).ram().share("share1");//mirror is a guess, writes a prg at 0xc0200 then it jumps at b0200 (!) map(0xe0000000, 0xe0007fff).mirror(0x0fff8000).ram().share("share1"); @@ -166,11 +165,9 @@ void pv9234_state::machine_reset() void pv9234_state::pv9234(machine_config &config) { - /* basic machine hardware */ - ARM7(config, m_maincpu, 4915000); // TODO: unknown type + ARM7(config, m_maincpu, 4915000); // TODO: unknown type, VLSI branded? m_maincpu->set_addrmap(AS_PROGRAM, &pv9234_state::main_map); - /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */ @@ -179,10 +176,25 @@ void pv9234_state::pv9234(machine_config &config) screen.set_screen_update(FUNC(pv9234_state::screen_update)); screen.set_palette("palette"); + // TODO: wideband DE-9 port + + // TODO: actually NS16550A, uses DA-25 port for a non-standard 8P1 125k baud rate + NS16550(config, "uart", 8_MHz_XTAL); +// uart.out_tx_callback().set("serial", FUNC(rs232_port_device::write_txd)); +// uart.out_dtr_callback().set("serial", FUNC(rs232_port_device::write_dtr)); +// uart.out_rts_callback().set("serial", FUNC(rs232_port_device::write_rts)); +// +// rs232_port_device &serial(RS232_PORT(config, "serial", default_rs232_devices, "terminal")); +// serial.rxd_handler().set("uart", FUNC(ns16550_device::rx_w)); +// serial.dcd_handler().set("uart", FUNC(ns16550_device::dcd_w)); +// serial.dsr_handler().set("uart", FUNC(ns16550_device::dsr_w)); +// serial.cts_handler().set("uart", FUNC(ns16550_device::cts_w)); + + // TODO: has a Philips SAA-branded chip on the evasive PCB picture + PALETTE(config, "palette", palette_device::MONOCHROME); } -/* ROM definition */ ROM_START( pv9234 ) ROM_REGION32_LE( 0x80000, "maincpu", ROMREGION_ERASE00 ) ROM_LOAD16_BYTE( "u19.bin", 0x00000, 0x20000, CRC(1e06b0c8) SHA1(f8047f7127919e73675375578bb9fcc0eed2178e)) @@ -193,5 +205,6 @@ ROM_END } // anonymous namespace - +// PowerVu D9223 Commercial Satellite Receiver +// PowerVu D9225 Headend Satellite Receiver SYST( 1997, pv9234, 0, 0, pv9234, pv9234, pv9234_state, empty_init, "Scientific Atlanta", "PowerVu D9234 Business Satellite Receiver", MACHINE_NOT_WORKING | MACHINE_NO_SOUND) From c4092afdfaa0bce603ac040635823d8543b075a6 Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 4 Mar 2025 21:12:55 +0100 Subject: [PATCH 084/272] nec/pc88va.cpp: implement GVRAM single/multiplane ROP registers --- hash/pc88va.xml | 26 +++-- src/mame/nec/pc88va.cpp | 226 +++++++++++++++++++++++++++++++------- src/mame/nec/pc88va.h | 60 +++++++--- src/mame/nec/pc88va_v.cpp | 201 ++++++++++++++++++++++++++++----- 4 files changed, 424 insertions(+), 89 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 1b99f9a208cea..38e49308aa658 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -82,7 +82,7 @@ Operating Systems --> - + @@ -140,6 +140,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + + Anime Framer (v1.0) @@ -204,6 +206,8 @@ Has unsupported MIF-201 [MIDI] interface cfr. http://www.pc88.gr.jp/vafaq/view.p + + PC-Engine (VA2 Tenpu-ban) 1988 @@ -239,7 +243,7 @@ Untested directory NEC_SAMP (cannot type [keyboard] underscore char) - + Family Stadium @@ -345,7 +349,7 @@ Winning newspaper screen has [OFX/OFY] bug 198? スタークラフト (Starcraft) @@ -520,6 +524,7 @@ Needs graphic [OFX/OFY] scroll 198? スタークラフト (Starcraft) @@ -876,18 +881,21 @@ Optionally wants kana lock enabled for entering a name for new game [keyboard] i + + + @@ -899,7 +907,7 @@ Optionally wants kana lock enabled for entering a name for new game [keyboard] i 1991 マイクロキャビン (Micro Cabin) + + + + @@ -1229,7 +1241,7 @@ All disks fail initial bootstrap [FDC] - + Balloon Breaker @@ -1334,7 +1346,7 @@ Gameplay don't mask bullets on right side, [cliprect] [SGP] and [ROP] issues on gameplay ]]> - + @@ -1342,7 +1354,7 @@ Gameplay don't mask bullets on right side, [cliprect] - + Pac-Man (auto-bootable) 19?? diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index 927f337f4814d..e1c5212dfe849 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -9,44 +9,44 @@ Here be dragons, a mostly compatible PC-8801 with extra V3 Mode for superset. TODO: - pc88va (stock version) has two bogus opcodes. - One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). - Latter will make the program flow to jump to lalaland. - This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly - hooked up, is the first opcode actually a Z80 mode switch? + One is at 0xf0b15 (0x0f 0xfe), another at 0xf0b31 (br 1000h:0c003h). + Latter will make the program flow to jump to lalaland. + This also happens if you load a regular V1/V2 game assuming you have FDC PIO properly + hooked up, is the first opcode actually a Z80 mode switch? - pc88va is also known to have a slightly different banking scheme and - regular YM2203 as default sound board. + regular YM2203 as default sound board. - video emulation is lacking many features, cfr. pc88va_v.cpp; - keyboard runs on undumped MCU, we currently stick irqs together on - selected keys in order to have an easier QoL while testing this. + selected keys in order to have an easier QoL while testing this. - Backport from PC-8801 main map, apply supersets where applicable; - \- IDP has EMUL for upd3301 - \- In emulation mode HW still relies to a i8214, so it bridges thru - main ICU in cascaded mode via IRQ7; - \- beeper or dac1bit (to be confirmed); - \- (other stuff ...) + \- IDP has EMUL for upd3301 + \- In emulation mode HW still relies to a i8214, so it bridges thru + main ICU in cascaded mode via IRQ7; + \- beeper or dac1bit (to be confirmed); + \- (other stuff ...) - Convert FDC usage to pc88va2_fd_if_device, we also need PIO comms for sorcer anyway; - irq dispatch needs to be revisited, too many instances of sound irq failing for example. - The current hook-ups aren't legal, V50 core bug? + The current hook-ups aren't legal, V50 core bug? - Very inconsistent SW boot behaviours, either down to: - \- the current hack in FDC PIO port returning RNG; - \- V50 timings; - \- FDC; + \- the current hack in FDC PIO port returning RNG; + \- V50 timings; + \- FDC; - Every PC Engine OS boot tries to write TVRAM ASCII data on every boot to - $exxxx ROM region, banking bug? + $exxxx ROM region, banking bug? - all N88 BASIC entries tries to do stuff with EMM, more banking? - Convert SASI from PC-9801 to a shared C-Bus device, apparently it's same i/f; - Is C-Bus I/O space shifted by +$200, as per micromus MIDI access at $e2d2? (old notes, to be reordered) - fdc "intelligent mode" has 0x7f as irq vector ... 0x7f is ld a,a and it IS NOT correctly - hooked up by the current z80 core + hooked up by the current z80 core - Fix floppy motor hook-up (floppy believes to be always in even if empty drive); - Support for PC8801 compatible mode & PC80S31K (floppy interface); Notes: - hold F8 at POST to bring software dip settings menu - PC-88VA-91 is a ROM upgrade kit for a PC-88VA -> VA2/VA3. - Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. + Has four roms, marked by VAEG as VUROM00.ROM, VUROM08.ROM, VUROM1.ROM, VUDIC.ROM. References: - PC-88VAテクニカルマニュアル @@ -89,16 +89,18 @@ brk 8Ch AH=02h read calendar clock -> CH = hour, CL = minutes, DH = seconds, DL #include #include "utf8.h" -#define LOG_FDC (1U << 2) // $1b0-$1b2 accesses -#define LOG_FDC2 (1U << 3) // $1b4-$1b6 accesses (verbose) +#define LOG_FDC (1U << 2) // $1b0-$1b2 accesses +#define LOG_FDC2 (1U << 3) // $1b4-$1b6 accesses (verbose) +#define LOG_GFXCTRL (1U << 4) // $5xx accesses -#define VERBOSE (LOG_GENERAL | LOG_FDC) +#define VERBOSE (LOG_GENERAL | LOG_FDC | LOG_GFXCTRL) //#define LOG_OUTPUT_STREAM std::cout #include "logmacro.h" #define LOGFDC(...) LOGMASKED(LOG_FDC, __VA_ARGS__) #define LOGFDC2(...) LOGMASKED(LOG_FDC2, __VA_ARGS__) +#define LOGGFXCTRL(...) LOGMASKED(LOG_GFXCTRL, __VA_ARGS__) // TODO: verify clocks #define MASTER_CLOCK XTAL(8'000'000) // may be XTAL(31'948'800) / 4? (based on PC-8801 and PC-9801) @@ -108,13 +110,13 @@ brk 8Ch AH=02h read calendar clock -> CH = hour, CL = minutes, DH = seconds, DL uint8_t pc88va_state::kanji_ram_r(offs_t offset) { - return m_kanjiram[offset]; + return m_kanji_ram[offset]; } // TODO: settings area should be write protected depending on the m_backupram_wp bit, separate from this void pc88va_state::kanji_ram_w(offs_t offset, uint8_t data) { - m_kanjiram[offset] = data; + m_kanji_ram[offset] = data; m_gfxdecode->gfx(2)->mark_dirty(offset / 8); m_gfxdecode->gfx(3)->mark_dirty(offset / 32); } @@ -185,6 +187,7 @@ void pc88va_state::rtc_w(offs_t offset, u8 data) void pc88va_state::bios_bank_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_bank_reg); + m_gmsp_view.select(BIT(m_bank_reg, 12)); /* SMBC */ m_sysbank->set_bank((m_bank_reg & 0xf00) >> 8); @@ -510,9 +513,9 @@ TIMER_CALLBACK_MEMBER(pc88va_state::t3_mouse_callback) uint8_t pc88va_state::backupram_dsw_r(offs_t offset) { if(offset == 0) - return m_kanjiram[0x1fc2 / 2] & 0xff; + return m_kanji_ram[0x1fc2 / 2] & 0xff; - return m_kanjiram[0x1fc6 / 2] & 0xff; + return m_kanji_ram[0x1fc6 / 2] & 0xff; } // TODO: pc8801_state::port31_w @@ -552,13 +555,15 @@ void pc88va_state::main_map(address_map &map) void pc88va_state::sysbank_map(address_map &map) { - // 0 select bus slot + // 0 select C-bus slot // 1 tvram map(0x040000, 0x04ffff).ram().share("tvram"); // FIXME: BASIC and pacmana expects to r/w to 0x60000-0x7ffff on loading, assume mirror if not a core bug. map(0x050000, 0x07ffff).ram(); // 4 gvram - map(0x100000, 0x13ffff).ram().share("gvram"); + map(0x100000, 0x13ffff).view(m_gmsp_view); + m_gmsp_view[0](0x100000, 0x13ffff).rw(FUNC(pc88va_state::gvram_multiplane_r), FUNC(pc88va_state::gvram_multiplane_w)); + m_gmsp_view[1](0x100000, 0x13ffff).rw(FUNC(pc88va_state::gvram_singleplane_r), FUNC(pc88va_state::gvram_singleplane_w)); // 8-9 kanji // Kanji ROM map(0x200000, 0x23ffff).rom().region("kanji", 0x00000); @@ -580,7 +585,11 @@ void pc88va_state::sgp_map(address_map &map) map(0x140000, 0x14ffff).rom().region("kanji", 0x40000); map(0x150000, 0x153fff).rw(FUNC(pc88va_state::kanji_ram_r),FUNC(pc88va_state::kanji_ram_w)); map(0x180000, 0x18ffff).ram().share("tvram"); - map(0x200000, 0x23ffff).ram().share("gvram"); + // Assume just raw writes to GVRAM + map(0x200000, 0x23ffff).lrw8( + NAME([this] (offs_t offset) { return m_gvram[offset]; }), + NAME([this] (offs_t offset, u8 data) { m_gvram[offset] = data; }) + ); } // TODO: I/O 0x00xx is almost same as pc8801 @@ -661,22 +670,155 @@ void pc88va_state::io_map(address_map &map) map(0x0500, 0x0507).m(m_sgp, FUNC(pc88va_sgp_device::sgp_io)); // GVRAM multiplane access regs (ROP section) -// map(0x0510, 0x0510) AACC extend access mode -// map(0x0512, 0x0512) GMAP block switch -// map(0x0514, 0x0514) XRPMn plane readback select -// map(0x0516, 0x0516) XWPMn plane write select -// map(0x0518, 0x0518) multiplane enable -// map(0x0520, 0x0527).umask16(0x00ff) extended access bit comparison + // TODO: register are locked with GMSP = 1 + map(0x0510, 0x0510).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("AACC extend access mode R\n"); + return m_multiplane.aacc; + }), + NAME([this] (offs_t offset, u8 data) { + m_multiplane.aacc = !!BIT(data, 0); + LOGGFXCTRL("AACC extend access mode W %02x\n", data); + }) + ); + map(0x0512, 0x0512).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("GMAP block switch R\n"); + return m_multiplane.gmap; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("GMAP block switch W %02x\n", data); + m_multiplane.gmap = !!BIT(data, 0); + }) + ); + map(0x0514, 0x0514).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("XRPMn plane readback select R\n"); + return m_multiplane.xrpm | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("XRPMn plane readback select W %02x\n", data); + m_multiplane.xrpm = data & 0xf; + }) + ); + map(0x0516, 0x0516).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("XWPMn plane write select R\n"); + return m_multiplane.xwpm | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("XWPMn plane write select W %02x\n", data); + m_multiplane.xwpm = data & 0xf; + }) + ); + map(0x0518, 0x0518).lrw8( + NAME([this] (offs_t offset) { + // TODO: rbusy reads (bit 7) + return (m_multiplane.cmpen << 5) | (m_multiplane.wss << 3) | (m_multiplane.pmod << 0); + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane Mode W %02x\n", data); + // PMOD bit 2 1 -> 0 transitions resets pattern pointers + if (BIT(m_multiplane.pmod, 2) && !BIT(data, 2)) + { + m_multiplane.prrp = 0; + m_multiplane.prwp = 0; + } + + m_multiplane.cmpen = !!BIT(data, 5); + m_multiplane.wss = (data >> 3) & 3; + m_multiplane.pmod = (data >> 0) & 7; + }) + ); + map(0x0520, 0x0527).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("CMPR extended access bit comparison R\n"); + return m_multiplane.cmpr[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("CMPR extended access bit comparison W %02x\n", data); + m_multiplane.cmpr[offset] = data; + }) + ); // map(0x0528, 0x0528) extended access plane comparison -// map(0x0530, 0x0537).umask16(0x00ff) extended access pattern low byte -// map(0x0540, 0x0547).umask16(0x00ff) extended access pattern high byte -// map(0x0550, 0x0550) PRRPn plane pattern usage start byte on read -// map(0x0552, 0x0552) PRWPn plane pattern usage start byte on write -// map(0x0560, 0x0567).umask16(0x00ff) ROP plane code + map(0x0530, 0x0537).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("Multiplane PATRL%d R\n", offset); + return m_multiplane.patr[offset][0]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane PATRL%d W %02x\n", offset, data); + m_multiplane.patr[offset][0] = data; + }) + ); + map(0x0540, 0x0547).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("PATRH%d R\n", offset); + return m_multiplane.patr[offset][1]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("PATRH%d W %02x\n", offset, data); + m_multiplane.patr[offset][1] = data; + }) + ); + map(0x0550, 0x0550).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.prrp | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("PRRPn plane pattern usage start byte on read %02x\n", data); + m_multiplane.prrp = data & 0xf; + }) + ); + map(0x0552, 0x0552).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.prwp | 0xf0; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("PRWPn plane pattern usage start byte on write %02x\n", data); + m_multiplane.prwp = data & 0xf; + }) + ); + map(0x0560, 0x0567).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_multiplane.rop[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Multiplane ROP %d W %02x\n", offset, data); + m_multiplane.rop[offset] = data; + }) + ); // GVRAM single plane access regs -// map(0x0580, 0x0580) single plane enable -// map(0x0590, 0x0593) GVRAM pattern register settings -// map(0x05a0, 0x05a3) ROP plane code + // TODO: register are locked with GMSP = 0 + map(0x0580, 0x0580).lrw8( + NAME([this] (offs_t offset) { + // TODO: rbusy reads (bit 7) + return (m_singleplane.wss << 3); + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane Mode W %02x\n", data); + m_singleplane.wss = (data >> 3) & 3; + }) + ); + map(0x0590, 0x0593).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + LOGGFXCTRL("Singleplane PATRL%d R\n", offset); + return m_singleplane.patr[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane PATRL%d W %02x\n", offset, data); + m_singleplane.patr[offset] = data; + }) + ); + map(0x05a0, 0x05a3).umask16(0x00ff).lrw8( + NAME([this] (offs_t offset) { + return m_singleplane.rop[offset]; + }), + NAME([this] (offs_t offset, u8 data) { + LOGGFXCTRL("Singleplane ROP %d W %02x\n", offset, data); + m_singleplane.rop[offset] = data; + }) + ); // map(0x1000, 0xfeff) PC-88VA expansion boards // map(0xe2d2, 0xe2d2) MIDI status in micromus diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index 7d5e59eefc7f3..9271a5e1baa0f 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -66,10 +66,10 @@ class pc88va_state : public driver_device , m_sysbank(*this, "sysbank") , m_workram(*this, "workram") , m_tvram(*this, "tvram") - , m_gvram(*this, "gvram") , m_fb_regs(*this, "fb_regs") - , m_kanji_rom(*this, "kanji") , m_sgp(*this, "sgp") + , m_gmsp_view(*this, "gmsp_view") + , m_kanji_rom(*this, "kanji") , m_gfxdecode(*this, "gfxdecode") , m_palette(*this, "palette") { } @@ -107,6 +107,7 @@ class pc88va_state : public driver_device virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; + virtual void video_reset() override ATTR_COLD; void palette_init(palette_device &palette) const; protected: @@ -131,11 +132,12 @@ class pc88va_state : public driver_device required_device m_sysbank; required_shared_ptr m_workram; required_shared_ptr m_tvram; - required_shared_ptr m_gvram; + std::unique_ptr m_gvram; required_shared_ptr m_fb_regs; - required_region_ptr m_kanji_rom; required_device m_sgp; - std::unique_ptr m_kanjiram; + memory_view m_gmsp_view; + required_region_ptr m_kanji_rom; + std::unique_ptr m_kanji_ram; uint16_t m_bank_reg = 0; uint8_t m_timer3_io_reg = 0; @@ -191,20 +193,48 @@ class pc88va_state : public driver_device void r232_ctrl_portc_w(uint8_t data); uint8_t get_slave_ack(offs_t offset); - uint16_t m_video_pri_reg[2]{}; + uint16_t m_video_pri_reg[2]; - u16 m_screen_ctrl_reg = 0; - bool m_dm = false; - bool m_ymmd = false; - u16 m_gfx_ctrl_reg = 0; + u16 m_screen_ctrl_reg; + bool m_dm; + bool m_ymmd; + u16 m_gfx_ctrl_reg; - u16 m_color_mode = 0; - u8 m_pltm, m_pltp = 0; + u16 m_color_mode; + u8 m_pltm, m_pltp; - u16 m_text_transpen = 0; - bool m_td = false; + u16 m_text_transpen; + bool m_td; bitmap_rgb32 m_graphic_bitmap[2]; + struct { + bool aacc; + u8 gmap; + u8 xrpm, xwpm; + //bool rbusy; + bool cmpen; + u8 wss; + u8 pmod; + u8 rop[4]; + + u8 cmpr[4]; + u8 patr[4][2]; + u8 prrp, prwp; + } m_multiplane; + + struct { + //bool rbusy; + u8 wss; + u8 patr[2]; + u8 rop[2]; + } m_singleplane; + + u8 rop_execute(u8 plane_rop, u8 src, u8 dst, u8 pat); + u8 gvram_singleplane_r(offs_t offset); + void gvram_singleplane_w(offs_t offset, u8 data); + u8 gvram_multiplane_r(offs_t offset); + void gvram_multiplane_w(offs_t offset, u8 data); + u16 screen_ctrl_r(); void screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask = ~0); u16 gfx_ctrl_r(); @@ -272,11 +302,11 @@ class pc88va_state : public driver_device void sgp_map(address_map &map) ATTR_COLD; +// TODO: stuff backported from PC8801 as QoL that should really be common protected: required_device m_gfxdecode; required_device m_palette; -// TODO: stuff backported from PC8801 as QoL that should really be common private: uint8_t misc_ctrl_r(); void misc_ctrl_w(uint8_t data); diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index d9d66b5cd9dbc..ab05295f4ca50 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -28,10 +28,14 @@ void pc88va_state::video_start() { + const u32 gvram_size = 0x40000; + m_gvram = std::make_unique(gvram_size); + std::fill_n(m_gvram.get(), gvram_size, 0); + const u32 kanjiram_size = 0x4000; - m_kanjiram = std::make_unique(kanjiram_size); - m_gfxdecode->gfx(2)->set_source(m_kanjiram.get()); - m_gfxdecode->gfx(3)->set_source(m_kanjiram.get()); + m_kanji_ram = std::make_unique(kanjiram_size); + m_gfxdecode->gfx(2)->set_source(m_kanji_ram.get()); + m_gfxdecode->gfx(3)->set_source(m_kanji_ram.get()); m_vrtc_irq_line = 432; for (int i = 0; i < 2; i++) @@ -45,11 +49,17 @@ void pc88va_state::video_start() save_item(NAME(m_text_transpen)); save_pointer(NAME(m_video_pri_reg), 2); - save_pointer(NAME(m_kanjiram), kanjiram_size); + save_pointer(NAME(m_gvram), gvram_size); + save_pointer(NAME(m_kanji_ram), kanjiram_size); save_item(NAME(m_vrtc_irq_line)); } +void pc88va_state::video_reset() +{ + m_text_transpen = 0; +} + void pc88va_state::palette_init(palette_device &palette) const { // default palette @@ -69,7 +79,6 @@ void pc88va_state::palette_init(palette_device &palette) const } } - uint32_t pc88va_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { uint8_t pri, cur_pri_lv; @@ -607,7 +616,7 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) if(!split_cliprect.contains(res_x, res_y)) continue; - int pen = m_kanjiram[(( yi * 2 ) + lr_half_gfx) + tile_num] >> (7 - xi) & 1; + int pen = m_kanji_ram[(( yi * 2 ) + lr_half_gfx) + tile_num] >> (7 - xi) & 1; if(reverse) pen = pen & 1 ? bg_col : fg_col; @@ -795,8 +804,6 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { const u32 line_offset = (((y * 640) / 8) + fb_start_offset) & 0x3ffff; @@ -808,7 +815,7 @@ void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle & for (int xi = 0; xi < 8; xi ++) { - uint32_t color = (gvram[bitmap_offset] >> (7 - xi)) & 1; + uint32_t color = (m_gvram[bitmap_offset] >> (7 - xi)) & 1; int res_x = x + xi; if(color && cliprect.contains(res_x, y)) @@ -820,8 +827,6 @@ void pc88va_state::draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle & void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -838,7 +843,7 @@ void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle & for (int xi = 0; xi < 2; xi ++) { - u8 color = (gvram[bitmap_offset] >> (xi ? 0 : 4)) & 0xf; + u8 color = (m_gvram[bitmap_offset] >> (xi ? 0 : 4)) & 0xf; if(color && cliprect.contains(x + xi, y)) bitmap.pix(y, x + xi) = m_palette->pen(color + pal_base); @@ -849,8 +854,6 @@ void pc88va_state::draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle & void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -864,7 +867,7 @@ void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &c { u32 bitmap_offset = line_offset + x; - u8 color = gvram[bitmap_offset] & 0x1f; + u8 color = m_gvram[bitmap_offset] & 0x1f; if(color && cliprect.contains(x, y)) bitmap.pix(y, x) = m_palette->pen(color); @@ -874,8 +877,6 @@ void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &c void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -887,7 +888,7 @@ void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &c { u32 bitmap_offset = line_offset + x; - uint32_t color = (gvram[bitmap_offset] & 0xff); + uint32_t color = (m_gvram[bitmap_offset] & 0xff); // boomer suggests that transparency is calculated over just color = 0, may be settable? // TODO: may not be clamped to palNbit @@ -904,8 +905,6 @@ void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &c void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -917,7 +916,7 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle { u32 bitmap_offset = (line_offset + x) << 1; - uint16_t color = (gvram[bitmap_offset] & 0xff) | (gvram[bitmap_offset + 1] << 8); + uint16_t color = (m_gvram[bitmap_offset] & 0xff) | (m_gvram[bitmap_offset + 1] << 8); if(cliprect.contains(x, y)) { @@ -932,8 +931,6 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) { - uint8_t *gvram = (uint8_t *)m_gvram.target(); - // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -950,7 +947,7 @@ void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &c { u8 color = 0; for (int bank_num = 0; bank_num < 4; bank_num ++) - color |= ((gvram[bitmap_offset + bank_num * 0x10000] >> (7 - xi)) & 1) << bank_num; + color |= ((m_gvram[bitmap_offset + bank_num * 0x10000] >> (7 - xi)) & 1) << bank_num; if(color && cliprect.contains(x + xi, y)) bitmap.pix(y, x + xi) = m_palette->pen(color + pal_base); @@ -1615,7 +1612,7 @@ u8 pc88va_state::kanji_cg_r() // jis2 = 0x21 / 0x22 "PC" on hovered top status bar for animefrm // NB: software reverts the two chars once it gets upped to bitmap layer. const u32 pcg_addr = ((m_kanji_cg_jis[1] & 0x1f) + ((m_kanji_cg_jis[1] & 0x60) << 1)) * 0x20; - return m_kanjiram[pcg_addr + (m_kanji_cg_line << 1) + (m_kanji_cg_lr ^ 1)]; + return m_kanji_ram[pcg_addr + (m_kanji_cg_line << 1) + (m_kanji_cg_lr ^ 1)]; } const u32 kanji_address = calc_kanji_rom_addr(m_kanji_cg_jis[0] + 0x20, m_kanji_cg_jis[1], 0, 0); @@ -1652,3 +1649,157 @@ void pc88va_state::text_control_1_w(u8 data) if ((data & 0x7d) != 1) LOG("I/O $148 write %02x\n", data); } + + +/**************************************** + * GVRAM + ***************************************/ + +u8 pc88va_state::rop_execute(u8 plane_rop, u8 src, u8 dst, u8 pat) +{ + u8 res = 0; + + for (int i = 0; i < 8; i++) + { + if (BIT(plane_rop, i)) + { + u8 src_data = BIT(i, 0) ? src : ~src; + u8 dst_data = BIT(i, 1) ? dst : ~dst; + u8 pat_data = BIT(i, 2) ? pat : ~pat; + res |= src_data & dst_data & pat_data; + } + } + return res; +} + +u8 pc88va_state::gvram_multiplane_r(offs_t offset) +{ + if (m_multiplane.aacc) + { + u32 address = (offset & 0x7fff) | (m_multiplane.gmap << 15); + u8 res = 0xff; + for (int plane = 0; plane < 4; plane++) + { + if (!BIT(m_multiplane.xrpm, plane)) + { + const u8 src = m_gvram[address | plane * 0x10000]; + // Comparison enable + if (m_multiplane.cmpen) + res &= ~(src ^ m_multiplane.cmpr[plane]); + else + res &= src; + + // update on reads + if (BIT(m_multiplane.pmod, 0) && !machine().side_effects_disabled()) + { + m_multiplane.patr[plane][BIT(m_multiplane.prwp, plane)] = src; + } + } + } + + // flip register indices on 16-bit mode + if ((m_multiplane.pmod & 5) == 5 && !machine().side_effects_disabled()) + { + m_multiplane.prwp ^= 0xf; + } + + return res; + } + + return gvram_singleplane_r(offset); +} + +void pc88va_state::gvram_multiplane_w(offs_t offset, u8 data) +{ + if (m_multiplane.aacc) + { + u32 address = (offset & 0x7fff) | (m_multiplane.gmap << 15); + for (int plane = 0; plane < 4; plane++) + { + if (!BIT(m_multiplane.xwpm, plane)) + { + switch(m_multiplane.wss & 3) + { + // ROP + case 0: + { + const u8 src = m_gvram[address | plane * 0x10000]; + m_gvram[address | plane * 0x10000] = rop_execute( + m_multiplane.rop[plane], + src, + data, + m_multiplane.patr[plane][BIT(m_multiplane.prrp, plane)] + ); + + // update pattern on writes + if (BIT(m_multiplane.pmod, 1)) + { + m_multiplane.patr[plane][BIT(m_multiplane.prwp, plane)] = src; + } + break; + } + // Pattern + case 1: + m_gvram[address | plane * 0x10000] = m_multiplane.patr[plane][BIT(m_multiplane.prrp, plane)]; + break; + // Normal writes + case 2: + m_gvram[address | plane * 0x10000] = data; + break; + // NOP + case 3: + break; + } + } + } + + // flip register indices on 16-bit mode + if (BIT(m_multiplane.pmod, 2)) + { + m_multiplane.prrp ^= 0xf; + if (BIT(m_multiplane.pmod, 1)) + m_multiplane.prwp ^= 0xf; + } + return; + } + + gvram_singleplane_w(offset, data); +} + +u8 pc88va_state::gvram_singleplane_r(offs_t offset) +{ + // apparently no side effects on reads + return m_gvram[offset]; +} + +void pc88va_state::gvram_singleplane_w(offs_t offset, u8 data) +{ + const u8 page_bank = BIT(offset, 17); + switch(m_singleplane.wss & 3) + { + // ROP + case 0: + { + const u8 src = m_gvram[offset]; + m_gvram[offset] = rop_execute( + m_singleplane.rop[page_bank], + src, + data, + m_singleplane.patr[page_bank] + ); + break; + } + // Pattern + case 1: + m_gvram[offset] = m_singleplane.patr[page_bank]; + break; + // Normal writes + case 2: + m_gvram[offset] = data; + break; + // NOP + case 3: + break; + } +} + From c9177b18a694f2d6a49d05669d40a53c0c27c4ea Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 4 Mar 2025 21:23:13 +0100 Subject: [PATCH 085/272] nec/pc88va_v.cpp: multiplane mode don't fallback in singleplane if AACC disabled --- src/mame/nec/pc88va_v.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index ab05295f4ca50..68674fc1c10a5 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -1697,7 +1697,7 @@ u8 pc88va_state::gvram_multiplane_r(offs_t offset) } } - // flip register indices on 16-bit mode + // flip register write index on 16-bit mode if ((m_multiplane.pmod & 5) == 5 && !machine().side_effects_disabled()) { m_multiplane.prwp ^= 0xf; @@ -1706,7 +1706,7 @@ u8 pc88va_state::gvram_multiplane_r(offs_t offset) return res; } - return gvram_singleplane_r(offset); + return m_gvram[offset]; } void pc88va_state::gvram_multiplane_w(offs_t offset, u8 data) @@ -1763,7 +1763,7 @@ void pc88va_state::gvram_multiplane_w(offs_t offset, u8 data) return; } - gvram_singleplane_w(offset, data); + m_gvram[offset] = data; } u8 pc88va_state::gvram_singleplane_r(offs_t offset) From 3665d6da671068eb059f7f0d7e5188fdb79c3840 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 4 Mar 2025 21:43:13 +0100 Subject: [PATCH 086/272] misc/gms.cpp: redumped one GFX ROM for cjdlz [Guru] --- src/mame/misc/gms.cpp | 52 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index ae30896122fc6..7e536eeb1ea36 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -142,7 +142,7 @@ class gms_2layers_state : public driver_device void super555(machine_config &config) ATTR_COLD; void init_ballch() ATTR_COLD; - void init_cjldz() ATTR_COLD; + void init_cjdlz() ATTR_COLD; void init_cots() ATTR_COLD; void init_hgly() ATTR_COLD; void init_rbspm() ATTR_COLD; @@ -1781,9 +1781,9 @@ static INPUT_PORTS_START( cjdlz ) // TODO PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:7") PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0080, "Controls" ) PORT_DIPLOCATION("DSW1:8") // should default to keyboard, but set on joystick since the former isn't emulated yet - PORT_DIPSETTING( 0x0080, DEF_STR( Joystick ) ) - PORT_DIPSETTING( 0x0000, "Keyboard" ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW1:8") + PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:1") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -1832,9 +1832,9 @@ static INPUT_PORTS_START( cjdlz ) // TODO PORT_DIPNAME( 0x0040, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:7") PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW2:8") - PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) + PORT_DIPNAME( 0x0080, 0x0080, "Controls" ) PORT_DIPLOCATION("DSW2:8") // should default to keyboard, but set on joystick since the former isn't emulated yet + PORT_DIPSETTING( 0x0080, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0000, "Keyboard" ) PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW5:1") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -1921,14 +1921,14 @@ static INPUT_PORTS_START( hgly ) PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME( "Paytable" ) PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) - PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Start Slot" ) - PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(4) - PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(4) - PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(4) - PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(4) - PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_PLAYER(4) - PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON7 ) PORT_PLAYER(4) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // no evident effect PORT_START("IN2") PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) @@ -1992,10 +1992,10 @@ static INPUT_PORTS_START( hgly ) PORT_DIPSETTING( 0x1000, "10000" ) PORT_DIPSETTING( 0x2000, "30000" ) PORT_DIPSETTING( 0x3000, "50000" ) - PORT_DIPNAME( 0x4000, 0x0000, "Double Explosive Machine" ) PORT_DIPLOCATION("DSW4:7") // TODO: fishy machine translations + PORT_DIPNAME( 0x4000, 0x0000, "Double-Up Game Jackpot" ) PORT_DIPLOCATION("DSW4:7") PORT_DIPSETTING( 0x4000, "10000" ) PORT_DIPSETTING( 0x0000, "Unlimited" ) - PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") // not definition in test mode + PORT_DIPNAME( 0x8000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW4:8") // not defined in test mode PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -2063,13 +2063,13 @@ static INPUT_PORTS_START( hgly ) PORT_DIPNAME( 0x0010, 0x0000, "Bet Every Time" ) PORT_DIPLOCATION("DSW3:5") // hard-coded PORT_DIPSETTING( 0x0010, "4" ) PORT_DIPSETTING( 0x0000, "4 (duplicate)" ) - PORT_DIPNAME( 0x0020, 0x0000, "Scoring" ) PORT_DIPLOCATION("DSW3:6") // TODO: fishy machine translations + PORT_DIPNAME( 0x0020, 0x0000, "Scoring" ) PORT_DIPLOCATION("DSW3:6") PORT_DIPSETTING( 0x0020, "Numbers" ) - PORT_DIPSETTING( 0x0000, "Tubes" ) - PORT_DIPNAME( 0x0040, 0x0040, "Controls" ) PORT_DIPLOCATION("DSW3:7") // should default to keyboard, but set on joystick since the former isn't emulated yet - PORT_DIPSETTING( 0x0040, DEF_STR( Joystick ) ) - PORT_DIPSETTING( 0x0000, "Keyboard" ) - PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") // not definition in test mode + PORT_DIPSETTING( 0x0000, "Circle Tiles" ) + PORT_DIPNAME( 0x0040, 0x0000, "Controls" ) PORT_DIPLOCATION("DSW3:7") + PORT_DIPSETTING( 0x0000, DEF_STR( Joystick ) ) + PORT_DIPSETTING( 0x0040, "Keyboard" ) + PORT_DIPNAME( 0x0080, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW3:8") // not defined in test mode PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW6:1") @@ -2803,8 +2803,8 @@ ROM_START( cjdlz ) ROM_REGION( 0x080000, "oki", 0 ) ROM_LOAD( "mj-s1-s03.u83", 0x00000, 0x80000, CRC(27cf4e44) SHA1(ee7f3fbc0c9cc777cc4f5ef730c30b952ad61fbf) ) - ROM_REGION( 0x80000, "gfx1", 0 ) - ROM_LOAD( "mj-a1-a07.u41", 0x00000, 0x80000, CRC(8f16d01b) SHA1(7dc0bb4ee230e1f1d61d055574e6790284369b8c) ) + ROM_REGION( 0x100000, "gfx1", 0 ) + ROM_LOAD( "mj-a1-a07.u41", 0x000000, 0x100000, CRC(868a9599) SHA1(53fc6d0169ee83e7f911f64b447e4fe7c9fe1f9d) ) ROM_REGION( 0xc0000, "gfx2", 0) ROM_LOAD( "rmj-t1-t05.u39", 0x00000, 0x80000, CRC(30638e20) SHA1(8082b7616ef759823be4265e902b503d15916197) ) @@ -2967,7 +2967,7 @@ void gms_2layers_state::init_sscs() rom[0x19c1a / 2] = 0x6000; // U85 ERROR } -void gms_2layers_state::init_cjldz() +void gms_2layers_state::init_cjdlz() { uint16_t *rom = (uint16_t *)memregion("maincpu")->base(); @@ -2997,7 +2997,7 @@ void gms_2layers_state::init_hgly() GAME( 1998, rbmk, 0, rbmk, rbmk, gms_2layers_state, empty_init, ROT0, "GMS", "Shizhan Majiang Wang (Version 8.8)", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // misses YM2151 hookup GAME( 1998, rbspm, 0, rbspm, rbspm, gms_2layers_state, init_rbspm, ROT0, "GMS", "Shizhan Ding Huang Maque (Version 4.1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Misses YM2151 hookup GAME( 1998, ssanguoj, 0, ssanguoj, ssanguoj, gms_2layers_state, init_ssanguoj, ROT0, "GMS", "Shizhan Sanguo Ji Jiaqiang Ban (Version 8.9 980413)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. YM3812 isn't hooked up (goes through undumped MCU). -GAME( 1999, cjdlz, 0, super555, cjdlz, gms_2layers_state, init_cjldz, ROT0, "GMS", "Chaoji Da Lianzhuang (Version 1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. +GAME( 1999, cjdlz, 0, super555, cjdlz, gms_2layers_state, init_cjdlz, ROT0, "GMS", "Chaoji Da Lianzhuang (Version 1.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. GAME( 2005, yyhm, 0, magslot, yyhm, gms_3layers_state, init_yyhm, ROT0, "GMS", "Yuanyang Hudie Meng (Version 8.8A 2005-09-25)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) // stops during boot, patched for now. Also needs EEPROM support. // card games From b4af482f19712b1088498657dd9670b669a8c8d5 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 4 Mar 2025 23:05:57 +0100 Subject: [PATCH 087/272] misc/gms.cpp: fixed GFX for cjldp --- src/mame/misc/gms.cpp | 79 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index 7e536eeb1ea36..8ed4822cfb96d 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -75,11 +75,10 @@ Hold service credit (9) and reset (F3) to enter service mode. - hookup lamps and do layouts - keyboard inputs for mahjong games - use real values for reel tilemaps offsets instead of hardcoded ones (would fix magslot) -- complete inputs for baile, yyhm, jinpaish (needs someone who understands Chinese and - knows how to play) +- complete inputs for baile, yyhm, jinpaish, ssanguoj, cjdlz (needs someone who understands + Chinese and knows how to play) - game logic in baile seems broken (you always win), maybe due to the patches? - broken title GFX in yyhm (transparent pen problem?) -- broken title GFX in cjdlz. How should the extra ROM be loaded? - the newer games seem to use range 0x9e1000-0x9e1fff during gameplay Video references: @@ -256,8 +255,7 @@ void gms_2layers_state::tilebank_w(uint16_t data) // x // unknown (set during most screens in the mahjong games and in sc2in1' title screen) // x // priority between 1st and 2nd tilemaps // x // bank 1st tilemap - // x // 1st tilemap enable (probably) - // xx // bank 2nd tilemap + // xxx // bank 2nd tilemap // x // 2nd tilemap enable (probably) if (m_tilebank & 0xf1c0) @@ -2177,7 +2175,7 @@ TILE_GET_INFO_MEMBER(gms_2layers_state::get_reel_tile_info) TILE_GET_INFO_MEMBER(gms_2layers_state::get_tile0_info) { const int tile = m_vidram[0][tile_index]; - tileinfo.set(1, (tile & 0x0fff) + ((m_tilebank >> 1) & 3) * 0x1000, tile >> 12, 0); + tileinfo.set(1, (tile & 0x0fff) + ((m_tilebank >> 1) & 7) * 0x1000, tile >> 12, 0); } TILE_GET_INFO_MEMBER(gms_3layers_state::get_tile1_info) @@ -2201,7 +2199,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b for (int j = 0; j < 64; j++) m_reel_tilemap[i]->set_scrolly(j, m_scrolly[i][j]); - if (BIT(m_tilebank, 3) && BIT(m_tilebank, 5)) + if (BIT(m_tilebank, 5)) { for (int i = 3; i >= 0; i--) m_reel_tilemap[i]->set_transparent_pen(0xff); @@ -2214,7 +2212,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b if (BIT(m_tilebank, 0)) m_tilemap[0]->draw(screen, bitmap, cliprect); - if (BIT(m_tilebank, 3) && !BIT(m_tilebank, 5)) + if (!BIT(m_tilebank, 5)) { for (int i = 3; i >= 0; i--) m_reel_tilemap[i]->set_transparent_pen(0x00); @@ -2233,7 +2231,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b for (int j = 0; j < 64; j++) m_reel_tilemap[3]->set_scrolly(j, m_scrolly[3][j]); - if (BIT(m_tilebank, 3) && BIT(m_tilebank, 5)) + if (BIT(m_tilebank, 5)) { m_reel_tilemap[3]->draw(screen, bitmap, cliprect); m_reel_tilemap[3]->set_transparent_pen(0xff); @@ -2242,7 +2240,7 @@ uint32_t gms_2layers_state::screen_update(screen_device &screen, bitmap_ind16 &b if (BIT(m_tilebank, 0)) m_tilemap[0]->draw(screen, bitmap, cliprect); - if (BIT(m_tilebank, 3) && !BIT(m_tilebank, 5)) + if (!BIT(m_tilebank, 5)) { m_reel_tilemap[3]->draw(screen, bitmap, cliprect); m_reel_tilemap[3]->set_transparent_pen(0x00); @@ -2351,8 +2349,8 @@ ROM_START( rbmk ) ROM_REGION( 0x100000, "gfx1", 0 ) // 8x32 tiles, lots of girls etc. ROM_LOAD( "a1.u41", 0x00000, 0x100000, CRC(1924de6b) SHA1(1a72ee2fd0abca51893f0985a591573bfd429389) ) - ROM_REGION( 0x80000, "gfx2", 0 ) // 8x8 tiles? cards etc - ROM_LOAD( "t1.u39", 0x00000, 0x80000, CRC(adf67429) SHA1(ab03c7f68403545f9e86a069581dc3fc3fa6b9c4) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) // 8x8 tiles? cards etc + ROM_LOAD( "t1.u39", 0x80000, 0x80000, CRC(adf67429) SHA1(ab03c7f68403545f9e86a069581dc3fc3fa6b9c4) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, CRC(4ca6ff01) SHA1(66c456eac5b0d1176ef9130baf2e746efdf30152) ) @@ -2385,8 +2383,8 @@ ROM_START( rbspm ) // PCB NO.6899-B ROM_REGION( 0x80000, "gfx1", 0 ) // 8x32 tiles, lots of girls etc. ROM_LOAD( "mj-dfmj-4.2-a1.bin", 0x00000, 0x80000, CRC(b0a3a866) SHA1(cc950532160a066fc6ce427f6df9d58ee4589821) ) - ROM_REGION( 0x80000, "gfx2", 0 ) // 8x8 tiles? cards etc - ROM_LOAD( "mj-dfmj-4.8-t1.bin", 0x00000, 0x80000, CRC(2b8b689d) SHA1(65ab643fac1e734af8b3a86caa06b532baafa0fe) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) // 8x8 tiles? cards etc + ROM_LOAD( "mj-dfmj-4.8-t1.bin", 0x80000, 0x80000, CRC(2b8b689d) SHA1(65ab643fac1e734af8b3a86caa06b532baafa0fe) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, NO_DUMP ) @@ -2409,8 +2407,8 @@ ROM_START( ssanguoj ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "99a-a02_m5042j-a1.u41", 0x000000, 0x100000, CRC(4b0823f4) SHA1(69e5448a9fe06430625c7c407ff4a7fd5b58d445) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "sgc-t1.u39", 0x00000, 0x80000, CRC(50776a8f) SHA1(141bd23fc237a0e8d31ae0504ea2b9cf39859319) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "sgc-t1.u39", 0x80000, 0x80000, CRC(50776a8f) SHA1(141bd23fc237a0e8d31ae0504ea2b9cf39859319) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u51", 0x00, 0x080, NO_DUMP ) @@ -2427,8 +2425,8 @@ ROM_START( super555 ) // GMS branded chips: A66, A68, M06 ROM_REGION( 0x80000, "gfx1", 0 ) ROM_LOAD( "pk-a1-a09.u41", 0x00000, 0x80000, CRC(f48e74bd) SHA1(68e2a0384964e04c526e4002ffae5fa4f2835d66) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "super555-t1-e67d.u39", 0x00000, 0x80000, CRC(ee092a9c) SHA1(4123d45d21ca60b0d38f36f59353c56d4fdfcddf) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "super555-t1-e67d.u39", 0x80000, 0x80000, CRC(ee092a9c) SHA1(4123d45d21ca60b0d38f36f59353c56d4fdfcddf) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u138", 0x00, 0x080, CRC(60407223) SHA1(10f766b5431709ab11b16bf5ad7adbfdced0e7ac) ) @@ -2445,8 +2443,8 @@ ROM_START( sball2k1 ) // GMS branded chips: A66, A68, no stickers on ROMs ROM_REGION( 0x80000, "gfx1", ROMREGION_ERASE00 ) // not populated - ROM_REGION( 0x20000, "gfx2", 0 ) - ROM_LOAD( "a1.u41", 0x00000, 0x20000, CRC(8567a2f7) SHA1(18f187fb533a23fbb554b941361c9d3b03d1c0ce) ) // D27010 + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "a1.u41", 0x80000, 0x20000, CRC(8567a2f7) SHA1(18f187fb533a23fbb554b941361c9d3b03d1c0ce) ) // D27010 ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u138", 0x00, 0x080, NO_DUMP ) @@ -2517,8 +2515,7 @@ ROM_START( sscs ) ROM_LOAD( "a1_bj-a1-a06.u41", 0x000000, 0x100000, CRC(f758d95e) SHA1(d1da16f3ef618a8c1118784bdc39dd93acf86aff) ) ROM_REGION( 0x100000, "gfx2", 0 ) - ROM_LOAD( "t1_a11u-t07d.u39", 0x080000, 0x080000, CRC(f0ecbc72) SHA1(536288d21a5720111cb3392c974ee5ccdc4a2c6b) ) - ROM_CONTINUE( 0x000000, 0x080000 ) // TODO: shouldn't be needed but the game doesn't seem to enable tile bank? + ROM_LOAD( "t1_a11u-t07d.u39", 0x000000, 0x100000, CRC(f0ecbc72) SHA1(536288d21a5720111cb3392c974ee5ccdc4a2c6b) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(9ad1b39c) SHA1(2fed7e0918119b2354a9f1944d501dc817ffd5dc) ) @@ -2537,8 +2534,8 @@ ROM_START( sc2in1 ) ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "u178", 0x000000, 0x200000, CRC(eaceb446) SHA1(db312f555e060eea6450f506cbbdca8874a05d58) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "u41", 0x00000, 0x40000, CRC(9ea462f7) SHA1(8cec497691f0121693a482b452ddf7a7dcedaf87) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "u41", 0x80000, 0x40000, CRC(9ea462f7) SHA1(8cec497691f0121693a482b452ddf7a7dcedaf87) ) ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "u169", 0x00000, 0x80000, CRC(f442fa70) SHA1(d06a84080e0196e1917b6f942adc29f97314be58) ) @@ -2557,8 +2554,8 @@ ROM_START( jinpaish ) // some of the labels were partly unreadable, all labels h ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "a1.u178", 0x000000, 0x200000, CRC(eaceb446) SHA1(db312f555e060eea6450f506cbbdca8874a05d58) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "t1_9269.u39", 0x00000, 0x80000, CRC(b87f62c0) SHA1(108c32271fb4802aec0606ff70d10be4fb0846bd) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1_9269.u39", 0x80000, 0x80000, CRC(b87f62c0) SHA1(108c32271fb4802aec0606ff70d10be4fb0846bd) ) ROM_REGION( 0x80000, "gfx3", 0 ) ROM_LOAD( "u1_2b6_.u169", 0x00000, 0x80000, CRC(31cdca7c) SHA1(eb60bc85408ecfc40dabac2b11f3d9bfc5467d3e) ) @@ -2574,8 +2571,8 @@ ROM_START( baile ) // all labels have 百乐 before what's reported below ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "2005_a1_1a5e.u178", 0x000000, 0x200000, CRC(0e338aeb) SHA1(8c645b0658bbbbd53bab7d769723abe08eee7acd) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "2005_t1_20cb.u39", 0x00000, 0x80000, CRC(bdb9a0d3) SHA1(0e8f675d244e7fe2eada90d02e836afc0e2840ca) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "2005_t1_20cb.u39", 0x80000, 0x80000, CRC(bdb9a0d3) SHA1(0e8f675d244e7fe2eada90d02e836afc0e2840ca) ) ROM_REGION( 0x20000, "gfx3", 0 ) ROM_LOAD( "2005_u1_7fe2.u169", 0x00000, 0x20000, CRC(d6216c9d) SHA1(693c6cd44e5d74f372ee3c8e5a0b1bd59f42bf22) ) @@ -2591,8 +2588,8 @@ ROM_START( yyhm ) // some of the labels were partly unreadable, all have 鸳鸯 ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "a1_c___.u178", 0x000000, 0x200000, CRC(a8e8aad5) SHA1(7576549fc23d5863d0affc27717492199bda2a6f) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "t1_aabe.u39", 0x00000, 0x80000, CRC(767bc6c3) SHA1(c1ccd6940e00c82278030a2c0875c411f1a0c1af) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1_aabe.u39", 0x80000, 0x80000, CRC(767bc6c3) SHA1(c1ccd6940e00c82278030a2c0875c411f1a0c1af) ) ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "u1_333a.u169", 0x00000, 0x40000, CRC(4ceec182) SHA1(6c43db0ccf8f6c9c4350b072ebe7101cfbb1763f) ) // 1xxxxxxxxxxxxxxxxx = 0xFF @@ -2611,8 +2608,8 @@ ROM_START( magslot ) // All labels have SLOT canceled with a black pen. No sum m ROM_REGION( 0x200000, "gfx1", 0 ) ROM_LOAD( "magic a1.0c _ _ _ _.u178", 0x000000, 0x200000, CRC(11028627) SHA1(80b38acab1cd12462d8fc36a9cdce5e5e76f6403) ) // no sum on label, 1xxxxxxxxxxxxxxxxxx = 0x00 - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "magic t1.0c ec43.u41", 0x00000, 0x80000, CRC(18df608d) SHA1(753b8090e8fd89e50131a22259ef3280d7e6b282) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "magic t1.0c ec43.u41", 0x80000, 0x80000, CRC(18df608d) SHA1(753b8090e8fd89e50131a22259ef3280d7e6b282) ) ROM_REGION( 0x40000, "gfx3", 0 ) ROM_LOAD( "magic u1.0c f7f6.u169", 0x00000, 0x40000, CRC(582631d3) SHA1(92d1b767bc7ef15eed6dad599392c17620210678) ) @@ -2656,8 +2653,8 @@ ROM_START( cots ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "1_a1_.u41", 0x000000, 0x100000, CRC(0ca98ccd) SHA1(45f4c8a93d387f2790fee46c05597628ff238c2d) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "2_t1_.u39", 0x00000, 0x80000, CRC(8c85dbc7) SHA1(c860949e5a61a4426b1409cefde9651c1d3a2765) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "2_t1_.u39", 0x80000, 0x80000, CRC(8c85dbc7) SHA1(c860949e5a61a4426b1409cefde9651c1d3a2765) ) ROM_END /* @@ -2711,8 +2708,8 @@ ROM_START( ballch ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "b.challenge_a1_0179.u41", 0x000000, 0x100000, CRC(b3c49a74) SHA1(a828fd007443ee08ece0c4cad80bd4f84471bb49) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "b.challenge_t1_f4cb.u39", 0x00000, 0x80000, CRC(a401072a) SHA1(f80ed4ef873393c36bb0446445bfb3a45e3efb97) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "b.challenge_t1_f4cb.u39", 0x80000, 0x80000, CRC(a401072a) SHA1(f80ed4ef873393c36bb0446445bfb3a45e3efb97) ) ROM_END /* @@ -2789,8 +2786,8 @@ ROM_START( hgly ) ROM_LOAD( "a1.u41", 0x00000, 0x80000, CRC(179e85d6) SHA1(5224aced4769f1c7e43512650e5b67cc26210abe) ) ROM_LOAD( "a2.u22", 0x80000, 0x80000, CRC(34f4449b) SHA1(797233bb9e8dcda7c07401414a3ed7f8a564e985) ) - ROM_REGION( 0x80000, "gfx2", 0 ) - ROM_LOAD( "t1.u39", 0x00000, 0x80000, CRC(272945c8) SHA1(89db8e23c58b185c1b4e44f74bcfef9b8c0baa04) ) + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00 ) + ROM_LOAD( "t1.u39", 0x80000, 0x80000, CRC(272945c8) SHA1(89db8e23c58b185c1b4e44f74bcfef9b8c0baa04) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(7372eba5) SHA1(2ccaa4e4ffb8f3ff38f75f286e0ff8dc595a1541) ) @@ -2806,9 +2803,9 @@ ROM_START( cjdlz ) ROM_REGION( 0x100000, "gfx1", 0 ) ROM_LOAD( "mj-a1-a07.u41", 0x000000, 0x100000, CRC(868a9599) SHA1(53fc6d0169ee83e7f911f64b447e4fe7c9fe1f9d) ) - ROM_REGION( 0xc0000, "gfx2", 0) - ROM_LOAD( "rmj-t1-t05.u39", 0x00000, 0x80000, CRC(30638e20) SHA1(8082b7616ef759823be4265e902b503d15916197) ) - ROM_LOAD( "t2.u29", 0x80000, 0x40000, CRC(a7417ce3) SHA1(fb2a789169149f22af62d0c73cd2d652c7005f3e) ) // TODO: actually overlayed? + ROM_REGION( 0x100000, "gfx2", ROMREGION_ERASE00) + ROM_LOAD( "t2.u29", 0x00000, 0x40000, CRC(a7417ce3) SHA1(fb2a789169149f22af62d0c73cd2d652c7005f3e) ) + ROM_LOAD( "rmj-t1-t05.u39", 0x80000, 0x80000, CRC(30638e20) SHA1(8082b7616ef759823be4265e902b503d15916197) ) ROM_REGION16_BE( 0x80, "eeprom", 0 ) ROM_LOAD16_WORD_SWAP( "93c46.u136", 0x00, 0x080, CRC(28d0db8c) SHA1(fb214d10f1c3a1f2e38cb22c620dcc314896ee54) ) From 30d05e20cf6aaf3e5c07c8c0fd9f10f82dd12926 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 5 Mar 2025 17:07:01 +0900 Subject: [PATCH 088/272] snk/munchmo.cpp: Cleaned up graphics decoding layouts and other improvements: (#13442) * Cleanup graphics decoding layouts, use scale factors rather than duplicating pixels. * Split graphics ROM and look-up table ROM regions. * Improved save state support and cleaned up code. --- src/mame/snk/munchmo.cpp | 110 +++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/src/mame/snk/munchmo.cpp b/src/mame/snk/munchmo.cpp index 8bf632614f52a..01c828b677568 100644 --- a/src/mame/snk/munchmo.cpp +++ b/src/mame/snk/munchmo.cpp @@ -51,7 +51,7 @@ class munchmo_state : public driver_device , m_videoram(*this, "videoram") , m_status_vram(*this, "status_vram") , m_vreg(*this, "vreg") - , m_tiles_rom(*this, "tiles") + , m_tiles_rom(*this, "tilelut") , m_maincpu(*this, "maincpu") , m_audiocpu(*this, "audiocpu") , m_mainlatch(*this, "mainlatch") @@ -82,7 +82,7 @@ class munchmo_state : public driver_device void palette(palette_device &palette) const; void vblank_irq(int state); - IRQ_CALLBACK_MEMBER(generic_irq_ack); + IRQ_CALLBACK_MEMBER(irq_ack); uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_status(bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -102,12 +102,12 @@ class munchmo_state : public driver_device required_region_ptr m_tiles_rom; // video-related - std::unique_ptr m_tmpbitmap; + bitmap_ind16 m_tmpbitmap; u8 m_palette_bank = 0U; - u8 m_flipscreen = 0U; + bool m_flipscreen = false; // misc - u8 m_nmi_enable = 0U; + bool m_nmi_enable = false; // devices required_device m_maincpu; @@ -173,7 +173,11 @@ void munchmo_state::flipscreen_w(int state) void munchmo_state::video_start() { - m_tmpbitmap = std::make_unique(512, 512); + m_tmpbitmap.allocate(512, 512); + + save_item(NAME(m_tmpbitmap)); + save_item(NAME(m_palette_bank)); + save_item(NAME(m_flipscreen)); } void munchmo_state::draw_status(bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -208,15 +212,15 @@ void munchmo_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipr for (int offs = 0; offs < 0x100; offs++) { - int const sy = (offs % 16) * 32; - int const sx = (offs / 16) * 32; + int const sy = (offs & 0xf) * 32; + int const sx = (offs >> 4) * 32; int const tile_number = m_videoram[offs]; for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { - gfx->opaque(*m_tmpbitmap, m_tmpbitmap->cliprect(), + gfx->opaque(m_tmpbitmap, m_tmpbitmap.cliprect(), m_tiles_rom[col + tile_number * 4 + row * 0x400], m_palette_bank, 0, 0, // flip @@ -228,15 +232,15 @@ void munchmo_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipr int const scrollx = -(m_vreg[2] *2 + (m_vreg[3] >> 7)) - 64 - 128 - 16; int const scrolly = 0; - copyscrollbitmap(bitmap, *m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); + copyscrollbitmap(bitmap, m_tmpbitmap, 1, &scrollx, 1, &scrolly, cliprect); } void munchmo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { int const scroll = m_vreg[2]; int const flags = m_vreg[3]; // XB?????? - int const xadjust = - 128 - 16 - ((flags & 0x80) ? 1 : 0); - int const bank = (flags & 0x40) ? 1 : 0; + int const xadjust = - 128 - 16 - BIT(flags, 7); + int const bank = BIT(flags, 6); gfx_element *const gfx = m_gfxdecode->gfx(2 + bank); int const color_base = m_palette_bank * 4 + 3; int const firstsprite = m_vreg[0] & 0x3f; @@ -252,7 +256,7 @@ void munchmo_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect int sy = (offs >> 6) << 5; // Y YY------ sy += (attributes >> 2) & 0x1f; - if (attributes & 0x80) + if (BIT(attributes, 7)) { sx = (sx >> 1) | (tile_number & 0x80); sx = 2 * ((-32 - scroll - sx) & 0xff) + xadjust; @@ -300,7 +304,7 @@ void munchmo_state::vblank_irq(int state) } } -IRQ_CALLBACK_MEMBER(munchmo_state::generic_irq_ack) +IRQ_CALLBACK_MEMBER(munchmo_state::irq_ack) { device.execute().set_input_line(0, CLEAR_LINE); return 0xff; @@ -473,70 +477,52 @@ INPUT_PORTS_END static const gfx_layout char_layout = { 8,8, - 256, + RGN_FRAC(1,2), 4, - { 0, 8, 256*128,256*128+8 }, - { 7,6,5,4,3,2,1,0 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, + { 0, 8, RGN_FRAC(1,2), RGN_FRAC(1,2)+8 }, + { STEP8(7,-1) }, + { STEP8(0,8*2) }, 128 }; static const gfx_layout tile_layout = { - 8,8, - 0x100, + 4,8, + RGN_FRAC(1,1), 4, - { 8,12,0,4 }, - { 0,0,1,1,2,2,3,3 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 }, + { STEP4(0,4) }, + { STEP4(0,1) }, + { STEP8(0,4*4) }, 128 }; static const gfx_layout sprite_layout1 = { - 32,32, + 16,32, 128, 3, - { 0x4000*8,0x2000*8,0 }, - { - 7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0, - 0x8000+7,0x8000+7,0x8000+6,0x8000+6,0x8000+5,0x8000+5,0x8000+4,0x8000+4, - 0x8000+3,0x8000+3,0x8000+2,0x8000+2,0x8000+1,0x8000+1,0x8000+0,0x8000+0 - }, - { - 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8,11*8,12*8,13*8,14*8,15*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8, - 24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 - }, + { 0x4000*8, 0x2000*8, 0 }, + { STEP8(7,-1),STEP8(0x8000+7,-1) }, + { STEP32(0,8) }, 256 }; static const gfx_layout sprite_layout2 = { - 32,32, + 16,32, 128, 3, - { 0,0,0 }, - { - 7,7,6,6,5,5,4,4,3,3,2,2,1,1,0,0, - 0x8000+7,0x8000+7,0x8000+6,0x8000+6,0x8000+5,0x8000+5,0x8000+4,0x8000+4, - 0x8000+3,0x8000+3,0x8000+2,0x8000+2,0x8000+1,0x8000+1,0x8000+0,0x8000+0 - }, - { - 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, - 8*8, 9*8, 10*8,11*8,12*8,13*8,14*8,15*8, - 16*8,17*8,18*8,19*8,20*8,21*8,22*8,23*8, - 24*8,25*8,26*8,27*8,28*8,29*8,30*8,31*8 - }, + { 0, 0, 0 }, + { STEP8(7,-1),STEP8(0x8000+7,-1) }, + { STEP32(0,8) }, 256 }; static GFXDECODE_START( gfx_mnchmobl ) GFXDECODE_ENTRY( "chars", 0, char_layout, 0, 4 ) // colors 0- 63 - GFXDECODE_ENTRY( "tiles", 0x1000, tile_layout, 64, 4 ) // colors 64-127 - GFXDECODE_ENTRY( "sprites", 0, sprite_layout1, 128, 16 ) // colors 128-255 - GFXDECODE_ENTRY( "monochrome_sprites", 0, sprite_layout2, 128, 16 ) // colors 128-255 + GFXDECODE_SCALE( "tiles", 0, tile_layout, 64, 4, 2, 1 ) // colors 64-127 + GFXDECODE_SCALE( "sprites", 0, sprite_layout1, 128, 16, 2, 1 ) // colors 128-255 + GFXDECODE_SCALE( "monochrome_sprites", 0, sprite_layout2, 128, 16, 2, 1 ) // colors 128-255 GFXDECODE_END @@ -548,8 +534,6 @@ GFXDECODE_END void munchmo_state::machine_start() { - save_item(NAME(m_palette_bank)); - save_item(NAME(m_flipscreen)); save_item(NAME(m_nmi_enable)); } @@ -558,11 +542,11 @@ void munchmo_state::mnchmobl(machine_config &config) // basic machine hardware Z80(config, m_maincpu, XTAL(15'000'000) / 4); // from pin 13 of XTAL-driven 163 m_maincpu->set_addrmap(AS_PROGRAM, &munchmo_state::main_map); - m_maincpu->set_irq_acknowledge_callback(FUNC(munchmo_state::generic_irq_ack)); // IORQ clears flip-flop at 1-2C + m_maincpu->set_irq_acknowledge_callback(FUNC(munchmo_state::irq_ack)); // IORQ clears flip-flop at 1-2C Z80(config, m_audiocpu, XTAL(15'000'000) / 8); // from pin 12 of XTAL-driven 163 m_audiocpu->set_addrmap(AS_PROGRAM, &munchmo_state::sound_map); - m_audiocpu->set_irq_acknowledge_callback(FUNC(munchmo_state::generic_irq_ack)); // IORQ clears flip-flop at 1-7H + m_audiocpu->set_irq_acknowledge_callback(FUNC(munchmo_state::irq_ack)); // IORQ clears flip-flop at 1-7H LS259(config, m_mainlatch, 0); // 12E m_mainlatch->q_out_cb<0>().set(FUNC(munchmo_state::palette_bank_0_w)); // BCL0 2-11E @@ -578,7 +562,7 @@ void munchmo_state::mnchmobl(machine_config &config) screen.set_refresh_hz(57); screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); // not accurate screen.set_size(256+32+32, 256); - screen.set_visarea(0, 255+32+32,0, 255-16); + screen.set_visarea(0, 255+32+32, 0, 255-16); screen.set_screen_update(FUNC(munchmo_state::screen_update)); screen.screen_vblank().set(FUNC(munchmo_state::vblank_irq)); screen.set_palette(m_palette); @@ -620,9 +604,11 @@ ROM_START( joyfulr ) ROM_LOAD( "s1.10a", 0x0000, 0x1000, CRC(c0bcc301) SHA1(b8961e7bbced4dfe9c72f839ea9b89d3f2e629b2) ) ROM_LOAD( "s2.10b", 0x1000, 0x1000, CRC(96aa11ca) SHA1(84438d6b27d520e95b8706c91c5c20de1785604c) ) - ROM_REGION( 0x2000, "tiles", 0 ) // 4x8 + ROM_REGION( 0x1000, "tilelut", 0 ) ROM_LOAD( "b1.2c", 0x0000, 0x1000, CRC(8ce3a403) SHA1(eec5813076c31bb8534f7d1f83f2a397e552ed69) ) - ROM_LOAD( "b2.2b", 0x1000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) + + ROM_REGION( 0x1000, "tiles", 0 ) // 4x8 + ROM_LOAD16_WORD_SWAP( "b2.2b", 0x0000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) ROM_REGION( 0x6000, "sprites", 0 ) ROM_LOAD( "f1j.1g", 0x0000, 0x2000, CRC(93c3c17e) SHA1(902f458c4efe74187a58a3c1ecd146e343657977) ) @@ -648,9 +634,11 @@ ROM_START( mnchmobl ) ROM_LOAD( "s1.10a", 0x0000, 0x1000, CRC(c0bcc301) SHA1(b8961e7bbced4dfe9c72f839ea9b89d3f2e629b2) ) ROM_LOAD( "s2.10b", 0x1000, 0x1000, CRC(96aa11ca) SHA1(84438d6b27d520e95b8706c91c5c20de1785604c) ) - ROM_REGION( 0x2000, "tiles", 0 ) // 4x8 + ROM_REGION( 0x1000, "tilelut", 0 ) ROM_LOAD( "b1.2c", 0x0000, 0x1000, CRC(8ce3a403) SHA1(eec5813076c31bb8534f7d1f83f2a397e552ed69) ) - ROM_LOAD( "b2.2b", 0x1000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) + + ROM_REGION( 0x1000, "tiles", 0 ) // 4x8 + ROM_LOAD16_WORD_SWAP( "b2.2b", 0x0000, 0x1000, CRC(0df28913) SHA1(485700d3b7f2bfcb970e8f9edb7d18ed9a708bd2) ) ROM_REGION( 0x6000, "sprites", 0 ) ROM_LOAD( "f1.1g", 0x0000, 0x2000, CRC(b75411d4) SHA1(d058a6c219676f8ba4e498215f5716c630bb1d20) ) From 8a250aded0d9fb13c492b3425cdd3d84ae7d2a2e Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 5 Mar 2025 11:28:36 +0100 Subject: [PATCH 089/272] pc/przone.cpp: notes --- src/mame/pc/przone.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mame/pc/przone.cpp b/src/mame/pc/przone.cpp index dd3ac214fd881..0faed06ed985f 100644 --- a/src/mame/pc/przone.cpp +++ b/src/mame/pc/przone.cpp @@ -1,11 +1,12 @@ // license:BSD-3-Clause // copyright-holders: Angelo Salese +// thanks-to: vidpro1 /************************************************************************************************** Prize Zone (c) 199? Lazer-Tron TODO: -- identify proper motherboard/BIOS; +- hookup proper motherboard type, MSI MS-5169 with ALADDiN V ATX chipset (ALi M1541 / M1543C); - hookup vibra16 ISA card in place of sblaster_16; - Printer error B0 keeps popping in attract/game select (disable in service mode as workaround); - Trackball in place of PS/2 mouse (doesn't seem to use serial); @@ -247,7 +248,7 @@ void przone_state::smc_superio_config(device_t *device) void przone_state::przone(machine_config &config) { - // unknown CPU, lowered to PCI clock for ViRGE being really the bottleneck here. + // Socket 7 CPU, lowered to PCI clock for ViRGE being really the bottleneck here. pentium_device &maincpu(PENTIUM(config, "maincpu", 33'333'333)); maincpu.set_addrmap(AS_PROGRAM, &przone_state::main_map); maincpu.set_addrmap(AS_IO, &przone_state::main_io); @@ -255,7 +256,7 @@ void przone_state::przone(machine_config &config) maincpu.smiact().set("pci:00.0", FUNC(i82439hx_host_device::smi_act_w)); PCI_ROOT(config, "pci", 0); - // TODO: confirm size + // 256MB on vidpro1's board, may ship with less RAM I82439HX(config, "pci:00.0", 0, "maincpu", 256*1024*1024); i82371sb_isa_device &isa(I82371SB_ISA(config, "pci:07.0", 0, "maincpu")); @@ -272,6 +273,7 @@ void przone_state::przone(machine_config &config) PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr); PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr); PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr); + // TODO: virgevx PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "virge"); ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", smc_superio_config); From b0613ccfabac5fb2af9ad8fca272a8a919170adc Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 5 Mar 2025 11:32:20 +0100 Subject: [PATCH 090/272] bus/cbus: add MIF-201 MIDI interface stub --- scripts/src/bus.lua | 2 + src/devices/bus/cbus/mif201.cpp | 70 ++++++++++++++++++++++++++++ src/devices/bus/cbus/mif201.h | 46 ++++++++++++++++++ src/devices/bus/cbus/pc9801_cbus.cpp | 32 +++++++------ src/mame/nec/pc88va.cpp | 9 ++-- src/mame/nec/pc88va.h | 3 +- 6 files changed, 143 insertions(+), 19 deletions(-) create mode 100644 src/devices/bus/cbus/mif201.cpp create mode 100644 src/devices/bus/cbus/mif201.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index e70daaaef9a13..55ae9fb2424d1 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -5288,6 +5288,8 @@ if (BUSES["CBUS"]~=null) then files { MAME_DIR .. "src/devices/bus/cbus/amd98.cpp", MAME_DIR .. "src/devices/bus/cbus/amd98.h", + MAME_DIR .. "src/devices/bus/cbus/mif201.cpp", + MAME_DIR .. "src/devices/bus/cbus/mif201.h", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.cpp", MAME_DIR .. "src/devices/bus/cbus/mpu_pc98.h", MAME_DIR .. "src/devices/bus/cbus/pc9801_26.cpp", diff --git a/src/devices/bus/cbus/mif201.cpp b/src/devices/bus/cbus/mif201.cpp new file mode 100644 index 0000000000000..4aa0ca7b94a34 --- /dev/null +++ b/src/devices/bus/cbus/mif201.cpp @@ -0,0 +1,70 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +/************************************************************************************************** + +MIF-201 MIDI interface + +Bundled with Micro Musician VA + +References: +- https://mamedev.emulab.it/kale/fast/files/micromusician_va.jpg + +TODO: +- evasive, needs manual, dip-switch sheet and PCB pictures; + +**************************************************************************************************/ + +#include "emu.h" +#include "mif201.h" + +DEFINE_DEVICE_TYPE(MIF201, mif201_device, "mif201", "Micro Musician VA MIF-201 MIDI Interface") + +mif201_device::mif201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : device_t(mconfig, MIF201, tag, owner, clock) + , m_bus(*this, DEVICE_SELF_OWNER) + , m_uart(*this, "uart%u", 1U) + , m_pit(*this, "pit") +{ +} + +//void mif201_device::irq_out(int state) +//{ +// m_bus->int_w<2>(state); +//} + + +void mif201_device::device_add_mconfig(machine_config &config) +{ + // TODO: unknown clocks + I8251(config, m_uart[0], 1021800); + + I8251(config, m_uart[1], 1021800); + + PIT8253(config, m_pit, 1021800); +} + +void mif201_device::device_start() +{ + // sheet claims i8251-1 having swapped ports compared to i8251-2 but micromus just uses + // $e2d2 for control, assume typo. + m_bus->install_io(0xe2d0, 0xe2d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_uart[0]->read(offset); }, "uart1_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_uart[0]->write(offset, data); }, "uart1_w") + ); + m_bus->install_io(0xe4d0, 0xe4d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_uart[1]->read(offset); }, "uart2_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_uart[1]->write(offset, data); }, "uart2_w") + ); + m_bus->install_io(0xe6d0, 0xe6d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_pit->read(offset); }, "pit_low_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_pit->write(offset, data); }, "pit_low_w") + ); + m_bus->install_io(0xe7d0, 0xe7d3, + read8sm_delegate(*this, [this](offs_t offset) { return m_pit->read(offset | 2); }, "pit_high_r"), + write8sm_delegate(*this, [this](offs_t offset, u8 data) { m_pit->write(offset | 2, data); }, "pit_high_w") + ); +} + +void mif201_device::device_reset() +{ +} diff --git a/src/devices/bus/cbus/mif201.h b/src/devices/bus/cbus/mif201.h new file mode 100644 index 0000000000000..7270c146e4fa2 --- /dev/null +++ b/src/devices/bus/cbus/mif201.h @@ -0,0 +1,46 @@ +// license:BSD-3-Clause +// copyright-holders: Angelo Salese +#ifndef MAME_BUS_CBUS_MIF201_H +#define MAME_BUS_CBUS_MIF201_H + +#pragma once + +#include "bus/cbus/pc9801_cbus.h" +#include "machine/i8251.h" +#include "machine/pit8253.h" + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> mpu_pc98_device + +class mif201_device : public device_t +{ +public: + // construction/destruction + mif201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + static constexpr feature_type unemulated_features() { return feature::SOUND; } + +protected: + // device-level overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // optional information overrides + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + +private: + required_device m_bus; + required_device_array m_uart; + required_device m_pit; + +// void map(address_map &map); +}; + + +// device type definition +DECLARE_DEVICE_TYPE(MIF201, mif201_device) + +#endif // MAME_BUS_CBUS_MIF201_H diff --git a/src/devices/bus/cbus/pc9801_cbus.cpp b/src/devices/bus/cbus/pc9801_cbus.cpp index 0471674aa6811..33e1833d7e80b 100644 --- a/src/devices/bus/cbus/pc9801_cbus.cpp +++ b/src/devices/bus/cbus/pc9801_cbus.cpp @@ -2,20 +2,24 @@ // copyright-holders:Angelo Salese /************************************************************************************************** - C-bus slot interface for PC-98xx family - - a.k.a. NEC version of the ISA bus. - C-bus -> Card Bus - - TODO: - - stub interface, checkout what actually belongs here. - Speculation is that C-bus has ROM / RAM slots always in the 0xc0000-0xdffff region, - and some opacity can be added if true. - - move pc9801_cbus_devices declaration from pc9801 driver in here; - - 8-bit I/O smearing should be handled here; - - INT# should be handled here too; - - Best way to inform user when it tries to install incompatible boards? - - Support for PCI bridging on later machines (cfr. pc9801cx3); +C-bus slot interface for PC-98xx family + +a.k.a. NEC version of the ISA bus. +C-bus -> Compatible Bus + +References: +- https://98epjunk.shakunage.net/sw/ext_card/ext_card.html +- https://ja.wikipedia.org/wiki/C%E3%83%90%E3%82%B9 +- https://www.pc-9800.net/db2/db2_ga_index.htm +- http://ookumaneko.s1005.xrea.com/pcibios.htm (PCI era mapping) + +TODO: +- stub interface, checkout what actually belongs here +- move pc9801_cbus_devices declaration from pc9801 driver in here; +- 8-bit I/O smearing should be handled here; +- INT# should be handled here too; +- Best way to inform user when it tries to install incompatible boards? +- Support for PCI bridging on later machines (cfr. pc9821cx3); **************************************************************************************************/ diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index e1c5212dfe849..0c702a53a99ba 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -753,11 +753,11 @@ void pc88va_state::io_map(address_map &map) ); map(0x0540, 0x0547).umask16(0x00ff).lrw8( NAME([this] (offs_t offset) { - LOGGFXCTRL("PATRH%d R\n", offset); + LOGGFXCTRL("Multiplane PATRH%d R\n", offset); return m_multiplane.patr[offset][1]; }), NAME([this] (offs_t offset, u8 data) { - LOGGFXCTRL("PATRH%d W %02x\n", offset, data); + LOGGFXCTRL("Multiplane PATRH%d W %02x\n", offset, data); m_multiplane.patr[offset][1] = data; }) ); @@ -802,11 +802,11 @@ void pc88va_state::io_map(address_map &map) ); map(0x0590, 0x0593).umask16(0x00ff).lrw8( NAME([this] (offs_t offset) { - LOGGFXCTRL("Singleplane PATRL%d R\n", offset); + LOGGFXCTRL("Singleplane PATR%d R\n", offset); return m_singleplane.patr[offset]; }), NAME([this] (offs_t offset, u8 data) { - LOGGFXCTRL("Singleplane PATRL%d W %02x\n", offset, data); + LOGGFXCTRL("Singleplane PATR%d W %02x\n", offset, data); m_singleplane.patr[offset] = data; }) ); @@ -1265,6 +1265,7 @@ static void pc88va_cbus_devices(device_slot_interface &device) { device.option_add("pc9801_55u", PC9801_55U); device.option_add("pc9801_55l", PC9801_55L); + device.option_add("mif_201", MIF201); device.option_add("mpu_pc98", MPU_PC98); } diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index 9271a5e1baa0f..c70fd076af396 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -29,11 +29,12 @@ #include "sound/ymopn.h" //#include "bus/cbus/amd98.h" +#include "bus/cbus/mif201.h" +#include "bus/cbus/mpu_pc98.h" //#include "bus/cbus/pc9801_26.h" #include "bus/cbus/pc9801_55.h" //#include "bus/cbus/pc9801_86.h" //#include "bus/cbus/pc9801_118.h" -#include "bus/cbus/mpu_pc98.h" //#include "bus/cbus/sb16_ct2720.h" From 215fc74bcfd5abd002175fd38202e57cf66483bd Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 6 Mar 2025 00:06:54 +1100 Subject: [PATCH 091/272] igs/igs_m027.cpp: Promoted xypdk and tct2p to working: * Fixed inputs and sound for xypdk. * Fixed inputs, and hooked up hopper, counter and lamp for tct2p. Systems promoted to working --------------------------- Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN) Xingyun Pao De Kuai (V106CN) --- src/mame/igs/igs_m027.cpp | 123 +++++++++++++++++++++++++++++++++++--- 1 file changed, 116 insertions(+), 7 deletions(-) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 57e93d7f0cdff..243def19386fd 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -142,13 +142,14 @@ class igs_m027_state : public driver_device template void m027_2ppis(machine_config &config) ATTR_COLD; void slqz3(machine_config &config) ATTR_COLD; void jking02(machine_config &config) ATTR_COLD; + void tct2p(machine_config &config) ATTR_COLD; void qlgs(machine_config &config) ATTR_COLD; void lhdmg(machine_config &config) ATTR_COLD; void lhzb3106c5m(machine_config &config) ATTR_COLD; void lhzb3sjb(machine_config &config) ATTR_COLD; void cjddz(machine_config &config) ATTR_COLD; void lhzb4(machine_config &config) ATTR_COLD; - void cjtljp(machine_config &config) ATTR_COLD; + void xypdk(machine_config &config) ATTR_COLD; void lthyp(machine_config &config) ATTR_COLD; void zhongguo(machine_config &config) ATTR_COLD; void mgzz(machine_config &config) ATTR_COLD; @@ -747,6 +748,99 @@ INPUT_PORTS_START( jking02 ) PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) INPUT_PORTS_END +INPUT_PORTS_START( tct2p ) + IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00) + + PORT_START("PORTB") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x03, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_SERVICE_NO_TOGGLE( 0x04, IP_ACTIVE_LOW ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP3 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PORTC") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SLOT_STOP_ALL ) PORT_NAME("Show Odds") PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SLOT_STOP4 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PLAYER") + PORT_BIT( 0x000ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x00100, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x1fe00, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) + PORT_BIT( 0x0003f, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_CUSTOM_MEMBER(FUNC(igs_m027_state::kbd_ioport_r)) + PORT_BIT( 0x00040, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::line_r)) + PORT_BIT( 0x00f80, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x01000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x02000, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x1c000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0x20000, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + PORT_BIT( 0xc0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) + + PORT_START("PPIB") + PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x00) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_MEMBER(FUNC(igs_m027_state::counter_w<0>)) // payout/keyout + + PORT_START("PPIC") + PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OUTPUT ) PORT_CONDITION("DSW2", 0x01, EQUALS, 0x01) PORT_WRITE_LINE_DEVICE_MEMBER("hopper", FUNC(hopper_device::motor_w)) + + PORT_START("CLEARMEM") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_MEMORY_RESET ) PORT_TOGGLE + + PORT_START("DSW1") + PORT_DIPNAME( 0x1f, 0x1f, "Satellite Machine No.") PORT_DIPLOCATION("SW1:1,2,3,4,5") // 副机編号 + SATELLITE_NO_SETTINGS + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW1:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW1:7" ) + PORT_DIPNAME( 0x80, 0x80, "Link Mode" ) PORT_DIPLOCATION("SW1:8") // 连线模式 + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Controls) ) PORT_DIPLOCATION("SW2:1") // 操作界面 + PORT_DIPSETTING( 0x01, DEF_STR(Joystick) ) // 揺杆 + PORT_DIPSETTING( 0x00, "Mahjong" ) // 麻雀键盘 + PORT_DIPNAME( 0x02, 0x02, "Number Type" ) PORT_DIPLOCATION("SW2:2") // 数字型态 + PORT_DIPSETTING( 0x02, "Numbers" ) // 数字 + PORT_DIPSETTING( 0x00, "Circle Tiles" ) // 筒子 + PORT_DIPNAME( 0x04, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("SW2:3") // 示范音乐 + PORT_DIPSETTING( 0x04, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x08, 0x08, "Background Color Mode" ) PORT_DIPLOCATION("SW2:4") // 底色模式 + PORT_DIPSETTING( 0x08, "Monochrome" ) // 黑白 + PORT_DIPSETTING( 0x00, "Color" ) // 彩色 + PORT_DIPNAME( 0x10, 0x10, "Bet Limit" ) PORT_DIPLOCATION("SW2:5") // 限制押分 + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) // 无 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW2:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW2:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW2:8" ) + + PORT_START("DSW3") + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "SW3:1" ) + PORT_DIPUNKNOWN_DIPLOC( 0x02, 0x02, "SW3:2" ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SW3:3" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SW3:4" ) + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW3:5" ) + PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "SW3:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "SW3:7" ) + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW3:8" ) +INPUT_PORTS_END + INPUT_PORTS_START( slqz3 ) PORT_INCLUDE(mahjong_test) PORT_INCLUDE(slqz3_dip_switches) @@ -1825,12 +1919,13 @@ void igs_m027_state::lhzb4(machine_config &config) m_oki->set_clock(2'000'000); } -void igs_m027_state::cjtljp(machine_config &config) +void igs_m027_state::xypdk(machine_config &config) { cjddz(config); - // Found on a board with 2 MHz clock frequency (22 MHz/11, divided using a - // PAL) and pin 7 high. This makes the voices too high-pitched. + // xypdk was found on a board with this configuration. + // cjtljp was found on a board with 2 MHz clock frequency (22 MHz/11, divided + // using a PAL) and pin 7 high. This makes the voices too high-pitched. // Possibly supposed to be 2 MHz with pin 7 low, or 1.375 MHz (22 MHz/16) // with pin 7 high. m_oki->set_clock(2'000'000); @@ -1868,6 +1963,20 @@ void igs_m027_state::jking02(machine_config &config) m_ppi[0]->out_pc_callback().set(FUNC(igs_m027_state::lamps_w<0>)); } +void igs_m027_state::tct2p(machine_config &config) +{ + m027_1ppi(config); + + m_maincpu->in_port().set_ioport("PLAYER"); + m_maincpu->out_port().append([this] (int state) { m_out_lamps[0] = state; }).bit(3); // seems to be an "insert coin" lamp - high when no credits + + m_ppi[0]->out_pb_callback().set_ioport("PPIB"); + m_ppi[0]->out_pc_callback().set_ioport("PPIC"); + m_ppi[0]->out_pc_callback().append(FUNC(igs_m027_state::io_select_w<0>)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); +} + void igs_m027_state::mgzz(machine_config &config) { m027_1ppi(config); @@ -3380,7 +3489,7 @@ GAME( 2004, lhzb4dhb, 0, lhzb4, lhzb4, igs_m027_stat GAME( 1999, lthyp, 0, lthyp, lthyp, igs_m027_state, init_lthyp, ROT0, "IGS", "Long Teng Hu Yao Duizhan Jiaqiang Ban (S104CN)", MACHINE_NODEVICE_LAN ) GAME( 2000, zhongguo, 0, zhongguo, zhongguo, igs_m027_state, init_zhongguo, ROT0, "IGS", "Zhongguo Chu Da D (V102C)", 0 ) GAMEL( 2001, jking02, 0, jking02, jking02, igs_m027_state, init_jking02, ROT0, "IGS", "Jungle King 2002 (V209US)", MACHINE_NODEVICE_LAN, layout_jking02 ) // shows V212US in bookkeeping menu -GAMEL( 2003, tct2p, 0, jking02, jking02, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", MACHINE_NOT_WORKING, layout_jking02 ) // needs inputs +GAME( 2003, tct2p, 0, tct2p, tct2p, igs_m027_state, init_tct2p, ROT0, "IGS", "Tarzan Chuang Tianguan 2 Jiaqiang Ban (V306CN)", 0 ) GAME( 2003, mgzz, 0, mgzz, mgzz101cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V101CN)", 0 ) GAME( 2003, mgzz100cn, mgzz, mgzz, mgzz100cn, igs_m027_state, init_mgzz, ROT0, "IGS", "Manguan Zhizun (V100CN)", 0 ) GAME( 2007, mgcs3, 0, lhzb4, mgcs3, igs_m027_state, init_mgcs3, ROT0, "IGS", "Manguan Caishen 3 (V101CN)", 0 ) @@ -3394,8 +3503,8 @@ GAME( 2004, cjddz215cn, cjddz, cjddz, cjddz, igs_m027_stat GAME( 2004, cjddz213cn, cjddz, cjddz, cjddz, igs_m027_state, init_cjddz, ROT0, "IGS", "Chaoji Dou Dizhu (V213CN)", MACHINE_NOT_WORKING ) // missing external program ROM. 2004 date in internal ROM GAME( 2004, cjddzp, 0, cjddz, cjddzp, igs_m027_state, init_cjddzp, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN)", MACHINE_NODEVICE_LAN ) // 2004 date in internal ROM GAME( 2005, cjddzlf, 0, cjddz, cjddz, igs_m027_state, init_cjddzlf, ROT0, "IGS", "Chaoji Dou Dizhu Liang Fu Pai (V109CN)", 0 ) // 2005 date in internal ROM -GAME( 2005, cjtljp, 0, cjtljp, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM -GAME( 2005, xypdk, 0, cjddz, cjddz, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", MACHINE_NOT_WORKING ) // needs inputs +GAME( 2005, cjtljp, 0, xypdk, lhzb4, igs_m027_state, init_cjtljp, ROT0, "IGS", "Chaoji Tuolaji Jiaqiang Ban (V206CN)", 0 ) // 2005 date in internal ROM +GAME( 2005, xypdk, 0, xypdk, lhzb4, igs_m027_state, init_xypdk, ROT0, "IGS", "Xingyun Pao De Kuai (V106CN)", 0 ) GAMEL( 2007, tripslot, 0, tripslot, tripslot, igs_m027_state, init_tripslot, ROT0, "IGS", "Triple Slot (V200VE)", 0, layout_tripslot ) // 2007 date in internal ROM at least, could be later, default settings password is all 'start 1' // this has a 2nd 8255 GAME( 2001, extradrw, 0, extradrw, base, igs_m027_state, init_extradrw, ROT0, "IGS", "Extra Draw (V100VE)", MACHINE_NOT_WORKING ) From f61f83c1dfb8e2edf004fb941faeb85b9135c974 Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 5 Mar 2025 23:31:33 +0900 Subject: [PATCH 092/272] snk/snk.cpp: Split driver state class for different hardware configuration: (#13440) * Added saved state support and suppress side effects for debugger reads. * Use generic graphics decoding layouts. * Added machine reset handler to fix soft reset. * Reduced literal tag use. * Reduced duplication, use more appropriate types for some variables, made more variables const. --- src/mame/snk/snk.cpp | 1284 ++++++++++++++++++++-------------------- src/mame/snk/snk.h | 416 ++++++++----- src/mame/snk/snk_v.cpp | 347 ++++++----- 3 files changed, 1067 insertions(+), 980 deletions(-) diff --git a/src/mame/snk/snk.cpp b/src/mame/snk/snk.cpp index 44afe9481f059..c0dd831684304 100644 --- a/src/mame/snk/snk.cpp +++ b/src/mame/snk/snk.cpp @@ -689,35 +689,74 @@ Driver notes: #include "sound/ymopl.h" #include "speaker.h" - void snk_state::machine_start() { + save_item(NAME(m_sound_status)); +} + +void countryc_state::machine_start() +{ + snk_state::machine_start(); m_countryc_trackball = 0; + + save_item(NAME(m_countryc_trackball)); +} + +void ikari_state::machine_start() +{ + snk_state::machine_start(); + + save_item(NAME(m_hf_posx)); + save_item(NAME(m_hf_posy)); +} + +void bermudat_state::machine_start() +{ + snk_state::machine_start(); + + save_item(NAME(m_tc16_posx)); + save_item(NAME(m_tc16_posy)); + save_item(NAME(m_tc32_posx)); + save_item(NAME(m_tc32_posy)); +} + +void gwar_state::machine_start() +{ + bermudat_state::machine_start(); + + save_item(NAME(m_last_value)); + save_item(NAME(m_cp_count)); +} + +void snk_state::machine_reset() +{ + m_sound_status = 0; + m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } /*********************************************************************/ // Interrupt handlers common to all SNK triple Z80 games -uint8_t snk_state::snk_cpuA_nmi_trigger_r() +uint8_t snk_state::cpuA_nmi_trigger_r() { if (!machine().side_effects_disabled()) m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); return 0xff; } -void snk_state::snk_cpuA_nmi_ack_w(uint8_t data) +void snk_state::cpuA_nmi_ack_w(uint8_t data) { m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } -uint8_t snk_state::snk_cpuB_nmi_trigger_r() +uint8_t snk_state::cpuB_nmi_trigger_r() { if (!machine().side_effects_disabled()) m_subcpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); return 0xff; } -void snk_state::snk_cpuB_nmi_ack_w(uint8_t data) +void snk_state::cpuB_nmi_ack_w(uint8_t data) { m_subcpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); } @@ -737,7 +776,7 @@ enum /*********************************************************************/ -uint8_t snk_state::marvins_sound_nmi_ack_r() +uint8_t marvins_state::marvins_sound_nmi_ack_r() { if (!machine().side_effects_disabled()) m_audiocpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE); @@ -748,7 +787,7 @@ uint8_t snk_state::marvins_sound_nmi_ack_r() TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback) { - switch(param) + switch (param) { case CMDIRQ_BUSY_ASSERT: m_sound_status |= 8|4; @@ -763,7 +802,7 @@ TIMER_CALLBACK_MEMBER(snk_state::sgladiat_sndirq_update_callback) break; } - m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_sound_status & 0x8) ? ASSERT_LINE : CLEAR_LINE); + m_audiocpu->set_input_line(INPUT_LINE_NMI, BIT(m_sound_status, 3) ? ASSERT_LINE : CLEAR_LINE); } @@ -820,7 +859,7 @@ uint8_t snk_state::sgladiat_sound_irq_ack_r() TIMER_CALLBACK_MEMBER(snk_state::sndirq_update_callback) { - switch(param) + switch (param) { case YM1IRQ_ASSERT: m_sound_status |= 1; @@ -868,7 +907,7 @@ void snk_state::ymirq_callback_2(int state) } -void snk_state::snk_soundlatch_w(uint8_t data) +void snk_state::soundlatch_w(uint8_t data) { m_soundlatch->write(data); machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_BUSY_ASSERT); @@ -876,27 +915,27 @@ void snk_state::snk_soundlatch_w(uint8_t data) int snk_state::sound_busy_r() { - return (m_sound_status & 4) ? 1 : 0; + return BIT(m_sound_status, 2); } -uint8_t snk_state::snk_sound_status_r() +uint8_t snk_state::sound_status_r() { return m_sound_status; } -void snk_state::snk_sound_status_w(uint8_t data) +void snk_state::sound_status_w(uint8_t data) { - if (~data & 0x10) // ack YM1 irq + if (BIT(~data, 4)) // ack YM1 irq machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM1IRQ_CLEAR); - if (~data & 0x20) // ack YM2 irq + if (BIT(~data, 5)) // ack YM2 irq machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM2IRQ_CLEAR); - if (~data & 0x40) // clear busy flag + if (BIT(~data, 6)) // clear busy flag machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), BUSY_CLEAR); - if (~data & 0x80) // ack command from main cpu + if (BIT(~data, 7)) // ack command from main cpu machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), CMDIRQ_CLEAR); } @@ -942,17 +981,17 @@ A trojan could be used on the board to verify the exact behaviour. *****************************************************************************/ -void snk_state::hardflags_scrollx_w(uint8_t data) +void ikari_state::hardflags_scrollx_w(uint8_t data) { m_hf_posx = (m_hf_posx & ~0xff) | data; } -void snk_state::hardflags_scrolly_w(uint8_t data) +void ikari_state::hardflags_scrolly_w(uint8_t data) { m_hf_posy = (m_hf_posy & ~0xff) | data; } -void snk_state::hardflags_scroll_msb_w(uint8_t data) +void ikari_state::hardflags_scroll_msb_w(uint8_t data) { m_hf_posx = (m_hf_posx & 0xff) | ((data & 0x80) << 1); m_hf_posy = (m_hf_posy & 0xff) | ((data & 0x40) << 2); @@ -960,14 +999,14 @@ void snk_state::hardflags_scroll_msb_w(uint8_t data) // low 6 bits might indicate radius, but it's not clear } -int snk_state::hardflags_check(int num) +int ikari_state::hardflags_check(int num) { - const uint8_t *sr = &m_spriteram[0x800 + 4*num]; - int x = sr[2] + ((sr[3] & 0x80) << 1); - int y = sr[0] + ((sr[3] & 0x10) << 4); + uint8_t const *const sr = &m_spriteram[0x800 + 4 * num]; + const int x = sr[2] + ((sr[3] & 0x80) << 1); + const int y = sr[0] + ((sr[3] & 0x10) << 4); - int dx = (x - m_hf_posx) & 0x1ff; - int dy = (y - m_hf_posy) & 0x1ff; + const int dx = (x - m_hf_posx) & 0x1ff; + const int dy = (y - m_hf_posy) & 0x1ff; if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0) return 0; @@ -975,26 +1014,21 @@ int snk_state::hardflags_check(int num) return 1; } -int snk_state::hardflags_check8(int num) +template +uint8_t ikari_state::hardflags_check8() { return - (hardflags_check(num + 0) << 0) | - (hardflags_check(num + 1) << 1) | - (hardflags_check(num + 2) << 2) | - (hardflags_check(num + 3) << 3) | - (hardflags_check(num + 4) << 4) | - (hardflags_check(num + 5) << 5) | - (hardflags_check(num + 6) << 6) | - (hardflags_check(num + 7) << 7); + (hardflags_check((Num * 8) + 0) << 0) | + (hardflags_check((Num * 8) + 1) << 1) | + (hardflags_check((Num * 8) + 2) << 2) | + (hardflags_check((Num * 8) + 3) << 3) | + (hardflags_check((Num * 8) + 4) << 4) | + (hardflags_check((Num * 8) + 5) << 5) | + (hardflags_check((Num * 8) + 6) << 6) | + (hardflags_check((Num * 8) + 7) << 7); } -uint8_t snk_state::hardflags1_r() { return hardflags_check8(0*8); } -uint8_t snk_state::hardflags2_r() { return hardflags_check8(1*8); } -uint8_t snk_state::hardflags3_r() { return hardflags_check8(2*8); } -uint8_t snk_state::hardflags4_r() { return hardflags_check8(3*8); } -uint8_t snk_state::hardflags5_r() { return hardflags_check8(4*8); } -uint8_t snk_state::hardflags6_r() { return hardflags_check8(5*8); } -uint8_t snk_state::hardflags7_r() +uint8_t ikari_state::hardflags7_r() { // apparently the startup tests use bits 0&1 while the game uses bits 4&5 return @@ -1021,27 +1055,27 @@ A trojan could be used on the board to verify the exact behaviour. *****************************************************************************/ -void snk_state::turbocheck16_1_w(uint8_t data) +void bermudat_state::turbocheck16_1_w(uint8_t data) { m_tc16_posy = (m_tc16_posy & ~0xff) | data; } -void snk_state::turbocheck16_2_w(uint8_t data) +void bermudat_state::turbocheck16_2_w(uint8_t data) { m_tc16_posx = (m_tc16_posx & ~0xff) | data; } -void snk_state::turbocheck32_1_w(uint8_t data) +void bermudat_state::turbocheck32_1_w(uint8_t data) { m_tc32_posy = (m_tc32_posy & ~0xff) | data; } -void snk_state::turbocheck32_2_w(uint8_t data) +void bermudat_state::turbocheck32_2_w(uint8_t data) { m_tc32_posx = (m_tc32_posx & ~0xff) | data; } -void snk_state::turbocheck_msb_w(uint8_t data) +void bermudat_state::turbocheck_msb_w(uint8_t data) { m_tc16_posx = (m_tc16_posx & 0xff) | ((data & 0x80) << 1); m_tc16_posy = (m_tc16_posy & 0xff) | ((data & 0x40) << 2); @@ -1051,14 +1085,14 @@ void snk_state::turbocheck_msb_w(uint8_t data) // low 6 bits might indicate radius, but it's not clear } -int snk_state::turbofront_check(int small, int num) +int bermudat_state::turbofront_check(bool small, int num) { - const uint8_t *sr = &m_spriteram[0x800*small + 4*num]; - int x = sr[2] + ((sr[3] & 0x80) << 1); - int y = sr[0] + ((sr[3] & 0x10) << 4); + uint8_t const *const sr = &m_spriteram[(small ? 0x800 : 0) + 4 * num]; + const int x = sr[2] + ((sr[3] & 0x80) << 1); + const int y = sr[0] + ((sr[3] & 0x10) << 4); - int dx = (x - (small ? m_tc16_posx : m_tc32_posx)) & 0x1ff; - int dy = (y - (small ? m_tc16_posy : m_tc32_posy)) & 0x1ff; + const int dx = (x - (small ? m_tc16_posx : m_tc32_posx)) & 0x1ff; + const int dy = (y - (small ? m_tc16_posy : m_tc32_posy)) & 0x1ff; if (dx > 0x20 && dx <= 0x1e0 && dy > 0x20 && dy <= 0x1e0) return 0; @@ -1066,32 +1100,20 @@ int snk_state::turbofront_check(int small, int num) return 1; } -int snk_state::turbofront_check8(int small, int num) +template +uint8_t bermudat_state::turbofront_check8() { return - (turbofront_check(small, num + 0) << 0) | - (turbofront_check(small, num + 1) << 1) | - (turbofront_check(small, num + 2) << 2) | - (turbofront_check(small, num + 3) << 3) | - (turbofront_check(small, num + 4) << 4) | - (turbofront_check(small, num + 5) << 5) | - (turbofront_check(small, num + 6) << 6) | - (turbofront_check(small, num + 7) << 7); + (turbofront_check(Small, (num * 8) + 0) << 0) | + (turbofront_check(Small, (num * 8) + 1) << 1) | + (turbofront_check(Small, (num * 8) + 2) << 2) | + (turbofront_check(Small, (num * 8) + 3) << 3) | + (turbofront_check(Small, (num * 8) + 4) << 4) | + (turbofront_check(Small, (num * 8) + 5) << 5) | + (turbofront_check(Small, (num * 8) + 6) << 6) | + (turbofront_check(Small, (num * 8) + 7) << 7); } -uint8_t snk_state::turbocheck16_1_r() { return turbofront_check8(1, 0*8); } -uint8_t snk_state::turbocheck16_2_r() { return turbofront_check8(1, 1*8); } -uint8_t snk_state::turbocheck16_3_r() { return turbofront_check8(1, 2*8); } -uint8_t snk_state::turbocheck16_4_r() { return turbofront_check8(1, 3*8); } -uint8_t snk_state::turbocheck16_5_r() { return turbofront_check8(1, 4*8); } -uint8_t snk_state::turbocheck16_6_r() { return turbofront_check8(1, 5*8); } -uint8_t snk_state::turbocheck16_7_r() { return turbofront_check8(1, 6*8); } -uint8_t snk_state::turbocheck16_8_r() { return turbofront_check8(1, 7*8); } -uint8_t snk_state::turbocheck32_1_r() { return turbofront_check8(0, 0*8); } -uint8_t snk_state::turbocheck32_2_r() { return turbofront_check8(0, 1*8); } -uint8_t snk_state::turbocheck32_3_r() { return turbofront_check8(0, 2*8); } -uint8_t snk_state::turbocheck32_4_r() { return turbofront_check8(0, 3*8); } - /***************************************************************************** @@ -1111,7 +1133,7 @@ hand, always returning 0xf inbetween valid values confuses the game. *****************************************************************************/ template -ioport_value snk_state::gwar_rotary() +ioport_value gwar_state::gwar_rotary() { int value = m_rot_io[Which]->read(); @@ -1119,15 +1141,17 @@ ioport_value snk_state::gwar_rotary() { if (!m_cp_count[Which]) value = 0xf; - m_cp_count[Which] = (m_cp_count[Which] + 1) & 0x07; + if (!machine().side_effects_disabled()) + m_cp_count[Which] = (m_cp_count[Which] + 1) & 0x07; } - m_last_value[Which] = value; + if (!machine().side_effects_disabled()) + m_last_value[Which] = value; return value; } template -ioport_value snk_state::gwarb_rotary() +ioport_value gwarb_state::gwarb_rotary() { if (m_joymode_io->read() == 1) { @@ -1144,19 +1168,19 @@ ioport_value snk_state::gwarb_rotary() void snk_state::athena_coin_counter_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, ~data & 2); - machine().bookkeeping().coin_counter_w(1, ~data & 1); + machine().bookkeeping().coin_counter_w(0, BIT(~data, 1)); + machine().bookkeeping().coin_counter_w(1, BIT(~data, 0)); } void snk_state::ikari_coin_counter_w(uint8_t data) { - if (~data & 0x80) + if (BIT(~data, 7)) { machine().bookkeeping().coin_counter_w(0, 1); machine().bookkeeping().coin_counter_w(0, 0); } - if (~data & 0x40) + if (BIT(~data, 6)) { machine().bookkeeping().coin_counter_w(1, 1); machine().bookkeeping().coin_counter_w(1, 0); @@ -1165,21 +1189,21 @@ void snk_state::ikari_coin_counter_w(uint8_t data) void snk_state::tdfever_coin_counter_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); + machine().bookkeeping().coin_counter_w(0, BIT(data, 0)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 1)); } -void snk_state::countryc_trackball_w(uint8_t data) +void countryc_state::countryc_trackball_w(uint8_t data) { m_countryc_trackball = data & 1; } -ioport_value snk_state::countryc_trackball_x() +ioport_value countryc_state::countryc_trackball_x() { return m_trackball_x_io[m_countryc_trackball]->read(); } -ioport_value snk_state::countryc_trackball_y() +ioport_value countryc_state::countryc_trackball_y() { return m_trackball_y_io[m_countryc_trackball]->read(); } @@ -1203,64 +1227,57 @@ ioport_value snk_state::snk_bonus_r() return ((m_bonus_io->read() & Mask) >> 4); default: - logerror("snk_bonus_r : invalid %02X bit_mask\n",Mask); + if (!machine().side_effects_disabled()) + logerror("snk_bonus_r : invalid %02X bit_mask\n",Mask); return 0; } } /************************************************************************/ -void snk_state::marvins_cpuA_map(address_map &map) +void marvins_state::marvins_common_map(address_map &map) { + map(0xc000, 0xcfff).ram().share(m_spriteram); // + work RAM + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().share("sharedram2"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); +} + +void marvins_state::marvins_cpuA_map(address_map &map) +{ + marvins_common_map(map); map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6000).w(FUNC(snk_state::marvins_palette_bank_w)); + map(0x6000, 0x6000).w(FUNC(marvins_state::marvins_palette_bank_w)); map(0x8000, 0x8000).portr("IN0"); map(0x8100, 0x8100).portr("IN1"); map(0x8200, 0x8200).portr("IN2"); map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xcfff).ram().share("spriteram"); // + work ram - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8600, 0x8600).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); } -void snk_state::marvins_cpuB_map(address_map &map) +void marvins_state::marvins_cpuB_map(address_map &map) { + marvins_common_map(map); map(0x0000, 0x5fff).rom(); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xcfff).ram().share("spriteram"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuA_nmi_trigger_r), FUNC(marvins_state::cpuB_nmi_ack_w)); } // vangrd2 accesses video registers at xxF1 instead of xx00 -void snk_state::madcrash_cpuA_map(address_map &map) +void marvins_state::madcrash_cpuA_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x8000).portr("IN0"); @@ -1269,47 +1286,47 @@ void snk_state::madcrash_cpuA_map(address_map &map) map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).mirror(0xff).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xe800, 0xefff).ram().share("share5"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xf800, 0xf800).mirror(0xff).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xf900, 0xf900).mirror(0xff).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfa00, 0xfa00).mirror(0xff).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xfb00, 0xfb00).mirror(0xff).w(FUNC(snk_state::marvins_scroll_msb_w)); - map(0xfc00, 0xfc00).mirror(0xff).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xfd00, 0xfd00).mirror(0xff).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfe00, 0xfe00).mirror(0xff).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xff00, 0xff00).mirror(0xff).w(FUNC(snk_state::snk_fg_scrollx_w)); + map(0x8600, 0x8600).mirror(0xff).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xe800, 0xefff).ram().share("sharedram2"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xf800, 0xf800).mirror(0xff).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xf900, 0xf900).mirror(0xff).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfa00, 0xfa00).mirror(0xff).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xfb00, 0xfb00).mirror(0xff).w(FUNC(marvins_state::marvins_scroll_msb_w)); + map(0xfc00, 0xfc00).mirror(0xff).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xfd00, 0xfd00).mirror(0xff).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfe00, 0xfe00).mirror(0xff).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xff00, 0xff00).mirror(0xff).w(FUNC(marvins_state::fg_scrollx_w)); } -void snk_state::madcrash_cpuB_map(address_map &map) +void marvins_state::madcrash_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0x8700, 0x8700).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); // vangrd2 - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); // madcrash - map(0xc000, 0xc7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xc800, 0xcfff).ram().share("share5"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xd800, 0xd800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd900, 0xd900).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xda00, 0xda00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xdb00, 0xdb00).w(FUNC(snk_state::marvins_scroll_msb_w)); - map(0xdc00, 0xdc00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xdd00, 0xdd00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xde00, 0xde00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xdf00, 0xdf00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xe000, 0xe7ff).ram().share("spriteram"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().share("share3"); + map(0x8700, 0x8700).w(FUNC(marvins_state::cpuB_nmi_ack_w)); // vangrd2 + map(0xa000, 0xa000).w(FUNC(marvins_state::cpuB_nmi_ack_w)); // madcrash + map(0xc000, 0xc7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xc800, 0xcfff).ram().share("sharedram2"); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xd800, 0xd800).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xd900, 0xd900).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xda00, 0xda00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xdb00, 0xdb00).w(FUNC(marvins_state::marvins_scroll_msb_w)); + map(0xdc00, 0xdc00).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xdd00, 0xdd00).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xde00, 0xde00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xdf00, 0xdf00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xe000, 0xe7ff).ram().share(m_spriteram); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().share("sharedram"); } -void snk_state::madcrush_cpuA_map(address_map &map) +void marvins_state::madcrush_cpuA_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0x8000, 0x8000).portr("IN0"); @@ -1318,44 +1335,44 @@ void snk_state::madcrush_cpuA_map(address_map &map) map(0x8300, 0x8300).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0x8400, 0x8400).portr("DSW1"); map(0x8500, 0x8500).portr("DSW2"); - map(0x8600, 0x8600).mirror(0xff).w(FUNC(snk_state::marvins_flipscreen_w)); - map(0x8700, 0x8700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd800, 0xdfff).ram().share("share5"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().share("share3"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0x8600, 0x8600).mirror(0xff).w(FUNC(marvins_state::marvins_flipscreen_w)); + map(0x8700, 0x8700).rw(FUNC(marvins_state::cpuB_nmi_trigger_r), FUNC(marvins_state::cpuA_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram2"); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().share("sharedram"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); } -void snk_state::madcrush_cpuB_map(address_map &map) +void marvins_state::madcrush_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); // + work ram - map(0xc800, 0xcfff).ram().share("share5"); - map(0xc800, 0xc800).mirror(0xff).w(FUNC(snk_state::marvins_palette_bank_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::marvins_fg_videoram_w)).share("fg_videoram"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); // ?? - map(0xe800, 0xefff).ram().share("share3"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xf800, 0xf800).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xfa00, 0xfa00).w(FUNC(snk_state::snk_fg_scrolly_w)); - map(0xfb00, 0xfb00).w(FUNC(snk_state::snk_fg_scrollx_w)); - map(0xfc00, 0xfc00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xfd00, 0xfd00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xfe00, 0xfe00).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xff00, 0xff00).w(FUNC(snk_state::marvins_scroll_msb_w)); + map(0xa000, 0xa000).w(FUNC(marvins_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); // + work RAM + map(0xc800, 0xcfff).ram().share("sharedram2"); + map(0xc800, 0xc800).mirror(0xff).w(FUNC(marvins_state::marvins_palette_bank_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(marvins_state::marvins_fg_videoram_w)).share(m_fg_videoram); + map(0xe000, 0xe7ff).ram().w(FUNC(marvins_state::marvins_bg_videoram_w)).share(m_bg_videoram); // ?? + map(0xe800, 0xefff).ram().share("sharedram"); + map(0xf000, 0xf7ff).ram().w(FUNC(marvins_state::tx_videoram_w)).share(m_tx_videoram); + map(0xf800, 0xf800).w(FUNC(marvins_state::sp16_scrolly_w)); + map(0xf900, 0xf900).w(FUNC(marvins_state::sp16_scrollx_w)); + map(0xfa00, 0xfa00).w(FUNC(marvins_state::fg_scrolly_w)); + map(0xfb00, 0xfb00).w(FUNC(marvins_state::fg_scrollx_w)); + map(0xfc00, 0xfc00).w(FUNC(marvins_state::bg_scrolly_w)); + map(0xfd00, 0xfd00).w(FUNC(marvins_state::bg_scrollx_w)); + map(0xfe00, 0xfe00).w(FUNC(marvins_state::sprite_split_point_w)); + map(0xff00, 0xff00).w(FUNC(marvins_state::marvins_scroll_msb_w)); } @@ -1369,25 +1386,25 @@ void snk_state::jcross_cpuA_map(address_map &map) map(0xa400, 0xa400).portr("DSW1"); map(0xa500, 0xa500).portr("DSW2"); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd300, 0xd300).w(FUNC(snk_state::jcross_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xd800, 0xdfff).ram().share("spriteram"); // + work ram - map(0xe000, 0xefff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xd800, 0xdfff).ram().share(m_spriteram); // + work RAM + map(0xe000, 0xefff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM map(0xffff, 0xffff).nopw(); // simply a program patch to not write to two not existing video registers? } void snk_state::jcross_cpuB_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xc800, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xc800, 0xd7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1401,33 +1418,33 @@ void snk_state::sgladiat_cpuA_map(address_map &map) map(0xa400, 0xa400).portr("DSW1"); map(0xa500, 0xa500).portr("DSW2"); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xa700, 0xa700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xa700, 0xa700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd200, 0xd200).nopw(); // unknown map(0xd300, 0xd300).w(FUNC(snk_state::sgladiat_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xd800, 0xdfff).ram().share("spriteram"); // + work ram - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xd800, 0xdfff).ram().share(m_spriteram); // + work RAM + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); map(0xe800, 0xefff).ram(); - map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xf000, 0xf7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::sgladiat_cpuB_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0xa000, 0xa000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); + map(0xa000, 0xa000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); map(0xa600, 0xa600).w(FUNC(snk_state::sgladiat_flipscreen_w)); // flip screen, bg palette bank - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xc800, 0xcfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); map(0xda00, 0xda00).nopw(); // unknown map(0xdb00, 0xdb00).w(FUNC(snk_state::sgladiat_scroll_msb_w)); - map(0xdc00, 0xdc00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xdd00, 0xdd00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xde00, 0xde00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xdf00, 0xdf00).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xdc00, 0xdc00).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xdd00, 0xdd00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xde00, 0xde00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xdf00, 0xdf00).w(FUNC(snk_state::bg_scrollx_w)); + map(0xe000, 0xe7ff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1441,24 +1458,24 @@ void snk_state::hal21_cpuA_map(address_map &map) map(0xc400, 0xc400).portr("DSW1"); map(0xc500, 0xc500).portr("DSW2"); map(0xc600, 0xc600).w(FUNC(snk_state::hal21_flipscreen_w)); // flip screen, bg tile and palette bank - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xd300, 0xd300).w(FUNC(snk_state::jcross_scroll_msb_w)); - map(0xd400, 0xd400).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xd500, 0xd500).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xd600, 0xd600).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xd700, 0xd700).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xe000, 0xe7ff).ram().share("spriteram"); // + work ram - map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd400, 0xd400).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xd500, 0xd500).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xd600, 0xd600).w(FUNC(snk_state::bg_scrolly_w)); + map(0xd700, 0xd700).w(FUNC(snk_state::bg_scrollx_w)); + map(0xe000, 0xe7ff).ram().share(m_spriteram); // + work RAM + map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::hal21_cpuB_map(address_map &map) { map(0x0000, 0x9fff).rom(); - map(0xa000, 0xa000).w(FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc000, 0xc7ff).ram().share("spriteram"); - map(0xd000, 0xdfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xe800, 0xefff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xa000, 0xa000).w(FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc000, 0xc7ff).ram().share(m_spriteram); + map(0xd000, 0xdfff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xe800, 0xefff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1468,31 +1485,31 @@ void snk_state::aso_cpuA_map(address_map &map) map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc400, 0xc400).w(FUNC(snk_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xc800, 0xc800).w(FUNC(snk_state::aso_videoattrs_w)); // flip screen, scroll msb - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::snk_bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xca00, 0xca00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xcc00, 0xcc00).w(FUNC(snk_state::bg_scrollx_w)); map(0xce00, 0xce00).nopw(); // always 05? map(0xcf00, 0xcf00).w(FUNC(snk_state::aso_bg_bank_w)); // tile and palette bank - map(0xd800, 0xdfff).ram().share("share1"); - map(0xe000, 0xe7ff).ram().share("spriteram"); // + work ram - map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xe7ff).ram().share(m_spriteram); // + work RAM + map(0xe800, 0xf7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } void snk_state::aso_cpuB_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xcfff).ram().share("share1"); - map(0xd000, 0xd7ff).ram().share("spriteram"); - map(0xd800, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); + map(0xc800, 0xcfff).ram().share("sharedram"); + map(0xd000, 0xd7ff).ram().share(m_spriteram); + map(0xd800, 0xe7ff).ram().w(FUNC(snk_state::marvins_bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } @@ -1505,243 +1522,240 @@ void snk_state::tnk3_cpuA_map(address_map &map) // c300 is an input in tnk3, output in athena/fitegolf (coin counter) // and in countryc (trackball select) (see DRIVER_INIT). map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::athena_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc400, 0xc400).w(FUNC(snk_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuB_nmi_trigger_r), FUNC(snk_state::cpuA_nmi_ack_w)); map(0xc800, 0xc800).w(FUNC(snk_state::tnk3_videoattrs_w)); // flip screen, char bank, scroll msb - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::snk_bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(snk_state::sp16_scrolly_w)); + map(0xca00, 0xca00).w(FUNC(snk_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(snk_state::bg_scrolly_w)); + map(0xcc00, 0xcc00).w(FUNC(snk_state::bg_scrollx_w)); map(0xcf00, 0xcf00).nopw(); // fitegolf/countryc only. Either 0 or 1. Video related? - map(0xd000, 0xd7ff).ram().share("spriteram"); // + work ram - map(0xd800, 0xf7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xd000, 0xd7ff).ram().share(m_spriteram); // + work RAM + map(0xd800, 0xf7ff).ram().w(FUNC(snk_state::bg_videoram_w)).share(m_bg_videoram); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM } // replace coin counter with trackball select -void snk_state::countryc_cpuA_map(address_map &map) +void countryc_state::countryc_cpuA_map(address_map &map) { tnk3_cpuA_map(map); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::countryc_trackball_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(countryc_state::countryc_trackball_w)); } void snk_state::tnk3_cpuB_map(address_map &map) { map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // tnk3, athena - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // fitegolf - map(0xc800, 0xcfff).ram().share("spriteram"); - map(0xd000, 0xefff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); + map(0xc000, 0xc000).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); // tnk3, athena + map(0xc700, 0xc700).rw(FUNC(snk_state::cpuA_nmi_trigger_r), FUNC(snk_state::cpuB_nmi_ack_w)); // fitegolf + map(0xc800, 0xcfff).ram().share(m_spriteram); + map(0xd000, 0xefff).ram().w(FUNC(snk_state::bg_videoram_w)).share(m_bg_videoram); map(0xf000, 0xf7ff).ram(); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xf800, 0xffff).ram().w(FUNC(snk_state::tx_videoram_w)).share(m_tx_videoram); } -void snk_state::ikari_cpuA_map(address_map &map) +void ikari_state::ikari_common_map(address_map &map) +{ + map(0xc980, 0xc980).w(FUNC(ikari_state::ikari_unknown_video_w)); + map(0xcc00, 0xcc00).w(FUNC(ikari_state::hardflags_scrolly_w)); + map(0xcc80, 0xcc80).w(FUNC(ikari_state::hardflags_scrollx_w)); + map(0xcd80, 0xcd80).w(FUNC(ikari_state::hardflags_scroll_msb_w)); + map(0xce00, 0xce00).r(FUNC(ikari_state::hardflags_check8<0>)); + map(0xce20, 0xce20).r(FUNC(ikari_state::hardflags_check8<1>)); + map(0xce40, 0xce40).r(FUNC(ikari_state::hardflags_check8<2>)); + map(0xce60, 0xce60).r(FUNC(ikari_state::hardflags_check8<3>)); + map(0xce80, 0xce80).r(FUNC(ikari_state::hardflags_check8<4>)); + map(0xcea0, 0xcea0).r(FUNC(ikari_state::hardflags_check8<5>)); + map(0xcee0, 0xcee0).r(FUNC(ikari_state::hardflags7_r)); + // note the mirror. ikari and victroad use d800, ikarijp uses d000 + map(0xd000, 0xd7ff).ram().w(FUNC(ikari_state::bg_videoram_w)).mirror(0x0800).share(m_bg_videoram); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(ikari_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void ikari_state::ikari_cpuA_map(address_map &map) { + ikari_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); // ikarijp doesn't use the coin counter - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(ikari_state::ikari_coin_counter_w)); // ikarijp doesn't use the coin counter + map(0xc400, 0xc400).w(FUNC(ikari_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc900, 0xc900).w(FUNC(snk_state::ikari_bg_scroll_msb_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::ikari_unknown_video_w)); - map(0xca00, 0xca00).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xcb00, 0xcb00).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xcb80, 0xcb80).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::hardflags_scrolly_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::hardflags_scrollx_w)); - map(0xcd00, 0xcd00).w(FUNC(snk_state::ikari_sp_scroll_msb_w)); - map(0xcd80, 0xcd80).w(FUNC(snk_state::hardflags_scroll_msb_w)); - map(0xce00, 0xce00).r(FUNC(snk_state::hardflags1_r)); - map(0xce20, 0xce20).r(FUNC(snk_state::hardflags2_r)); - map(0xce40, 0xce40).r(FUNC(snk_state::hardflags3_r)); - map(0xce60, 0xce60).r(FUNC(snk_state::hardflags4_r)); - map(0xce80, 0xce80).r(FUNC(snk_state::hardflags5_r)); - map(0xcea0, 0xcea0).r(FUNC(snk_state::hardflags6_r)); - map(0xcee0, 0xcee0).r(FUNC(snk_state::hardflags7_r)); - // note the mirror. ikari and victroad use d800, ikarijp uses d000 - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).mirror(0x0800).share("bg_videoram"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc700, 0xc700).rw(FUNC(ikari_state::cpuB_nmi_trigger_r), FUNC(ikari_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(ikari_state::bg_scrolly_w)); + map(0xc880, 0xc880).w(FUNC(ikari_state::bg_scrollx_w)); + map(0xc900, 0xc900).w(FUNC(ikari_state::ikari_bg_scroll_msb_w)); + map(0xca00, 0xca00).w(FUNC(ikari_state::sp16_scrolly_w)); + map(0xca80, 0xca80).w(FUNC(ikari_state::sp16_scrollx_w)); + map(0xcb00, 0xcb00).w(FUNC(ikari_state::sp32_scrolly_w)); + map(0xcb80, 0xcb80).w(FUNC(ikari_state::sp32_scrollx_w)); + map(0xcd00, 0xcd00).w(FUNC(ikari_state::ikari_sp_scroll_msb_w)); } -void snk_state::ikari_cpuB_map(address_map &map) +void ikari_state::ikari_cpuB_map(address_map &map) { + ikari_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::ikari_unknown_video_w)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::hardflags_scrolly_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::hardflags_scrollx_w)); - map(0xcd80, 0xcd80).w(FUNC(snk_state::hardflags_scroll_msb_w)); - map(0xce00, 0xce00).r(FUNC(snk_state::hardflags1_r)); - map(0xce20, 0xce20).r(FUNC(snk_state::hardflags2_r)); - map(0xce40, 0xce40).r(FUNC(snk_state::hardflags3_r)); - map(0xce60, 0xce60).r(FUNC(snk_state::hardflags4_r)); - map(0xce80, 0xce80).r(FUNC(snk_state::hardflags5_r)); - map(0xcea0, 0xcea0).r(FUNC(snk_state::hardflags6_r)); - map(0xcee0, 0xcee0).r(FUNC(snk_state::hardflags7_r)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).mirror(0x0800).share("bg_videoram"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(ikari_state::cpuA_nmi_trigger_r), FUNC(ikari_state::cpuB_nmi_ack_w)); } -void snk_state::bermudat_cpuA_map(address_map &map) +void bermudat_state::bermudat_common_map(address_map &map) +{ + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xc900, 0xc900).w(FUNC(bermudat_state::sp16_scrolly_w)); + map(0xc940, 0xc940).w(FUNC(bermudat_state::sp16_scrollx_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); + map(0xca80, 0xca80).w(FUNC(bermudat_state::gwara_sp_scroll_msb_w)); + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::bermudat_cpuA_map(address_map &map) { + bermudat_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(bermudat_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(bermudat_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - // the "turbo check" addresses are only used by bermudat/bermudaj, not bermudaa/worldwar or the other games - map(0xca00, 0xca00).w(FUNC(snk_state::turbocheck16_1_w)); - map(0xca40, 0xca40).w(FUNC(snk_state::turbocheck16_2_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xcac0, 0xcac0).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xcb00, 0xcb00).r(FUNC(snk_state::turbocheck16_1_r)); - map(0xcb10, 0xcb10).r(FUNC(snk_state::turbocheck16_2_r)); - map(0xcb20, 0xcb20).r(FUNC(snk_state::turbocheck16_3_r)); - map(0xcb30, 0xcb30).r(FUNC(snk_state::turbocheck16_4_r)); - map(0xcb40, 0xcb40).r(FUNC(snk_state::turbocheck16_5_r)); - map(0xcb50, 0xcb50).r(FUNC(snk_state::turbocheck16_6_r)); - map(0xcb60, 0xcb60).r(FUNC(snk_state::turbocheck16_7_r)); - map(0xcb70, 0xcb70).r(FUNC(snk_state::turbocheck16_8_r)); - map(0xcc00, 0xcc00).w(FUNC(snk_state::turbocheck32_1_w)); - map(0xcc40, 0xcc40).w(FUNC(snk_state::turbocheck32_2_w)); - map(0xcc80, 0xcc80).w(FUNC(snk_state::turbocheck_msb_w)); - map(0xccc0, 0xccc0).r(FUNC(snk_state::turbocheck32_1_r)); - map(0xccd0, 0xccd0).r(FUNC(snk_state::turbocheck32_2_r)); - map(0xcce0, 0xcce0).r(FUNC(snk_state::turbocheck32_3_r)); - map(0xccf0, 0xccf0).r(FUNC(snk_state::turbocheck32_4_r)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + // the "turbo check" addresses are only used by bermudat/bermudatj, not bermudata/worldwar or the other games + map(0xca00, 0xca00).w(FUNC(bermudat_state::turbocheck16_1_w)); + map(0xca40, 0xca40).w(FUNC(bermudat_state::turbocheck16_2_w)); + map(0xcac0, 0xcac0).w(FUNC(bermudat_state::sprite_split_point_w)); + map(0xcb00, 0xcb00).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb10, 0xcb10).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb20, 0xcb20).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb30, 0xcb30).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb40, 0xcb40).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb50, 0xcb50).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb60, 0xcb60).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcb70, 0xcb70).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcc00, 0xcc00).w(FUNC(bermudat_state::turbocheck32_1_w)); + map(0xcc40, 0xcc40).w(FUNC(bermudat_state::turbocheck32_2_w)); + map(0xcc80, 0xcc80).w(FUNC(bermudat_state::turbocheck_msb_w)); + map(0xccc0, 0xccc0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xccd0, 0xccd0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xcce0, 0xcce0).r(NAME((&bermudat_state::turbofront_check8))); + map(0xccf0, 0xccf0).r(NAME((&bermudat_state::turbofront_check8))); } -void snk_state::bermudat_cpuB_map(address_map &map) +void bermudat_state::bermudat_cpuB_map(address_map &map) { + bermudat_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xca80, 0xca80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); } -void snk_state::gwar_cpuA_map(address_map &map) +void bermudat_state::gwar_common_map(address_map &map) +{ + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::gwar_cpuA_map(address_map &map) { + gwar_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(bermudat_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(bermudat_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwar_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xc940, 0xc940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwar_videoattrs_w)); // flip screen, scroll msb + map(0xc900, 0xc900).w(FUNC(bermudat_state::sp16_scrolly_w)); + map(0xc940, 0xc940).w(FUNC(bermudat_state::sp16_scrollx_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); map(0xca00, 0xca00).nopw(); // always 0? map(0xca40, 0xca40).nopw(); // always 0? - map(0xcac0, 0xcac0).w(FUNC(snk_state::snk_sprite_split_point_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xcac0, 0xcac0).w(FUNC(bermudat_state::sprite_split_point_w)); } -void snk_state::gwar_cpuB_map(address_map &map) +void bermudat_state::gwar_cpuB_map(address_map &map) { + gwar_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); } -void snk_state::gwara_cpuA_map(address_map &map) +void gwar_state::gwara_common_map(address_map &map) { + map(0xc800, 0xcfff).ram().w(FUNC(gwar_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM + map(0xd000, 0xd7ff).ram().w(FUNC(gwar_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().share(m_spriteram); // + work RAM + map(0xf8c0, 0xf8c0).w(FUNC(gwar_state::gwar_tx_bank_w)); // char and palette bank +} + +void gwar_state::gwara_cpuA_map(address_map &map) +{ + gwara_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc100, 0xc100).portr("IN1"); map(0xc200, 0xc200).portr("IN2"); - map(0xc300, 0xc300).portr("IN3").w(FUNC(snk_state::ikari_coin_counter_w)); - map(0xc400, 0xc400).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc300, 0xc300).portr("IN3").w(FUNC(gwar_state::ikari_coin_counter_w)); + map(0xc400, 0xc400).w(FUNC(gwar_state::soundlatch_w)); map(0xc500, 0xc500).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf800, 0xf800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xf840, 0xf840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xf880, 0xf880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xf8c0, 0xf8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xf900, 0xf900).w(FUNC(snk_state::snk_sp16_scrolly_w)); - map(0xf940, 0xf940).w(FUNC(snk_state::snk_sp16_scrollx_w)); - map(0xf980, 0xf980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xf9c0, 0xf9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xfa80, 0xfa80).w(FUNC(snk_state::gwara_sp_scroll_msb_w)); - map(0xfac0, 0xfac0).w(FUNC(snk_state::snk_sprite_split_point_w)); + map(0xc700, 0xc700).rw(FUNC(gwar_state::cpuB_nmi_trigger_r), FUNC(gwar_state::cpuA_nmi_ack_w)); + map(0xf800, 0xf800).w(FUNC(gwar_state::bg_scrolly_w)); + map(0xf840, 0xf840).w(FUNC(gwar_state::bg_scrollx_w)); + map(0xf880, 0xf880).w(FUNC(gwar_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xf900, 0xf900).w(FUNC(gwar_state::sp16_scrolly_w)); + map(0xf940, 0xf940).w(FUNC(gwar_state::sp16_scrollx_w)); + map(0xf980, 0xf980).w(FUNC(gwar_state::sp32_scrolly_w)); + map(0xf9c0, 0xf9c0).w(FUNC(gwar_state::sp32_scrollx_w)); + map(0xfa80, 0xfa80).w(FUNC(gwar_state::gwara_sp_scroll_msb_w)); + map(0xfac0, 0xfac0).w(FUNC(gwar_state::sprite_split_point_w)); } -void snk_state::gwara_cpuB_map(address_map &map) +void gwar_state::gwara_cpuB_map(address_map &map) { + gwara_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); - map(0xc800, 0xcfff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share3"); - map(0xe000, 0xf7ff).ram().share("spriteram"); // + work ram - map(0xf8c0, 0xf8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank + map(0xc000, 0xc000).rw(FUNC(gwar_state::cpuA_nmi_trigger_r), FUNC(gwar_state::cpuB_nmi_ack_w)); } -void snk_state::tdfever_cpuA_map(address_map &map) +void bermudat_state::tdfever_common_map(address_map &map) { + map(0xc8c0, 0xc8c0).w(FUNC(bermudat_state::gwar_tx_bank_w)); // char and palette bank + map(0xd000, 0xd7ff).ram().w(FUNC(bermudat_state::bg_videoram_w)).share(m_bg_videoram); + map(0xd800, 0xdfff).ram().share("sharedram"); + map(0xe000, 0xf7ff).ram().w(FUNC(bermudat_state::tdfever_spriteram_w)).share(m_spriteram); // + work RAM + map(0xf800, 0xffff).ram().w(FUNC(bermudat_state::tx_videoram_w)).share(m_tx_videoram); // + work RAM +} + +void bermudat_state::tdfever_cpuA_map(address_map &map) +{ + tdfever_common_map(map); map(0x0000, 0xbfff).rom(); map(0xc000, 0xc000).portr("IN0"); map(0xc080, 0xc080).portr("IN1"); @@ -1753,46 +1767,37 @@ void snk_state::tdfever_cpuA_map(address_map &map) map(0xc380, 0xc380).portr("IN7"); map(0xc400, 0xc400).portr("IN8"); map(0xc480, 0xc480).portr("IN9"); - map(0xc500, 0xc500).w(FUNC(snk_state::snk_soundlatch_w)); + map(0xc500, 0xc500).w(FUNC(bermudat_state::soundlatch_w)); map(0xc580, 0xc580).portr("DSW1"); map(0xc600, 0xc600).portr("DSW2"); - map(0xc680, 0xc680).w(FUNC(snk_state::tdfever_coin_counter_w)); - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuB_nmi_trigger_r), FUNC(snk_state::snk_cpuA_nmi_ack_w)); - map(0xc800, 0xc800).w(FUNC(snk_state::snk_bg_scrolly_w)); - map(0xc840, 0xc840).w(FUNC(snk_state::snk_bg_scrollx_w)); - map(0xc880, 0xc880).w(FUNC(snk_state::gwara_videoattrs_w)); // flip screen, scroll msb - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xc900, 0xc900).w(FUNC(snk_state::tdfever_sp_scroll_msb_w)); - map(0xc980, 0xc980).w(FUNC(snk_state::snk_sp32_scrolly_w)); - map(0xc9c0, 0xc9c0).w(FUNC(snk_state::snk_sp32_scrollx_w)); - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().w(FUNC(snk_state::tdfever_spriteram_w)).share("spriteram"); // + work ram - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); // + work RAM + map(0xc680, 0xc680).w(FUNC(bermudat_state::tdfever_coin_counter_w)); + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuB_nmi_trigger_r), FUNC(bermudat_state::cpuA_nmi_ack_w)); + map(0xc800, 0xc800).w(FUNC(bermudat_state::bg_scrolly_w)); + map(0xc840, 0xc840).w(FUNC(bermudat_state::bg_scrollx_w)); + map(0xc880, 0xc880).w(FUNC(bermudat_state::gwara_videoattrs_w)); // flip screen, scroll msb + map(0xc900, 0xc900).w(FUNC(bermudat_state::tdfever_sp_scroll_msb_w)); + map(0xc980, 0xc980).w(FUNC(bermudat_state::sp32_scrolly_w)); + map(0xc9c0, 0xc9c0).w(FUNC(bermudat_state::sp32_scrollx_w)); } -void snk_state::tdfever_cpuB_map(address_map &map) +void bermudat_state::tdfever_cpuB_map(address_map &map) { + tdfever_common_map(map); map(0x0000, 0xbfff).rom(); - map(0xc000, 0xc000).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // tdfever, tdfever2 - map(0xc700, 0xc700).rw(FUNC(snk_state::snk_cpuA_nmi_trigger_r), FUNC(snk_state::snk_cpuB_nmi_ack_w)); // fsoccer - map(0xc8c0, 0xc8c0).w(FUNC(snk_state::gwar_tx_bank_w)); // char and palette bank - map(0xd000, 0xd7ff).ram().w(FUNC(snk_state::snk_bg_videoram_w)).share("bg_videoram"); - map(0xd800, 0xdfff).ram().share("share2"); - map(0xe000, 0xf7ff).ram().w(FUNC(snk_state::tdfever_spriteram_w)).share("spriteram"); - map(0xf800, 0xffff).ram().w(FUNC(snk_state::snk_tx_videoram_w)).share("tx_videoram"); + map(0xc000, 0xc000).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); // tdfever, tdfever2 + map(0xc700, 0xc700).rw(FUNC(bermudat_state::cpuA_nmi_trigger_r), FUNC(bermudat_state::cpuB_nmi_ack_w)); // fsoccer } /***********************************************************************/ -void snk_state::marvins_sound_map(address_map &map) +void marvins_state::marvins_sound_map(address_map &map) { map(0x0000, 0x3fff).rom(); map(0x4000, 0x4000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); map(0x8000, 0x8001).w("ay1", FUNC(ay8910_device::address_data_w)); map(0x8002, 0x8007).w("wave", FUNC(snkwave_device::snkwave_w)); map(0x8008, 0x8009).w("ay2", FUNC(ay8910_device::address_data_w)); - map(0xa000, 0xa000).r(FUNC(snk_state::marvins_sound_nmi_ack_r)); + map(0xa000, 0xa000).r(FUNC(marvins_state::marvins_sound_nmi_ack_r)); map(0xe000, 0xe7ff).ram(); } @@ -1832,12 +1837,6 @@ void snk_state::hal21_sound_map(address_map &map) map(0xe008, 0xe009).w("ay2", FUNC(ay8910_device::address_data_w)); } -void snk_state::hal21_sound_portmap(address_map &map) -{ - map.global_mask(0xff); - map(0x00, 0x00).nopr(); // read on startup, then the Z80 automatically pulls down the IORQ pin to ack irq -} - void snk_state::tnk3_YM3526_sound_map(address_map &map) { @@ -1862,60 +1861,53 @@ void snk_state::aso_YM3526_sound_map(address_map &map) map(0xf006, 0xf006).r(FUNC(snk_state::tnk3_ymirq_ack_r)); } -void snk_state::YM3526_YM3526_sound_map(address_map &map) +void snk_state::sound_common_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xcfff).ram(); map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0xf800, 0xf800).rw(FUNC(snk_state::sound_status_r), FUNC(snk_state::sound_status_w)); +} + +void snk_state::YM3526_YM3526_sound_map(address_map &map) +{ + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3526_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(ym3526_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } void snk_state::YM3812_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3812_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } void snk_state::YM3526_Y8950_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3526_device::status_r), FUNC(ym3526_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3526_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } -void snk_state::YM3812_Y8950_sound_map(address_map &map) +void bermudat_state::chopper1_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xe800, 0xe800).rw("ym1", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); map(0xec00, 0xec00).w("ym1", FUNC(ym3812_device::data_w)); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } -void snk_state::Y8950_sound_map(address_map &map) +void bermudat_state::tdfever2_sound_map(address_map &map) { - map(0x0000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram(); - map(0xe000, 0xe000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + sound_common_map(map); map(0xf000, 0xf000).rw("ym2", FUNC(y8950_device::status_r), FUNC(y8950_device::address_w)); map(0xf400, 0xf400).w("ym2", FUNC(y8950_device::data_w)); - map(0xf800, 0xf800).rw(FUNC(snk_state::snk_sound_status_r), FUNC(snk_state::snk_sound_status_w)); } /*********************************************************************/ @@ -2877,7 +2869,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( countryc ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(countryc_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0450 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch */ @@ -2887,10 +2879,10 @@ static INPUT_PORTS_START( countryc ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_START("IN1") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::countryc_trackball_x)) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(countryc_state::countryc_trackball_x)) PORT_START("IN2") - PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::countryc_trackball_y)) + PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(countryc_state::countryc_trackball_y)) PORT_START("IN3") PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -2959,7 +2951,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( ikari ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a15 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -2999,7 +2991,7 @@ static INPUT_PORTS_START( ikari ) PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, "Separate" ) PORT_DIPSETTING( 0x00, "Common" ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3025,7 +3017,7 @@ static INPUT_PORTS_START( ikari ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x04, "Freeze" ) PORT_DIPSETTING( 0x00, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x30>)) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DIP2:7" ) /* read at 0x07c4, but strange test at 0x07cc */ PORT_DIPNAME( 0x80, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:8") PORT_DIPSETTING( 0x80, DEF_STR( No ) ) @@ -3054,7 +3046,7 @@ static INPUT_PORTS_START( ikaria ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a00 */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ INPUT_PORTS_END @@ -3096,7 +3088,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( victroad ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(ikari_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x0a19 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3136,7 +3128,7 @@ static INPUT_PORTS_START( victroad ) PORT_DIPNAME( 0x02, 0x02, "P1 & P2 Fire Buttons" ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, "Separate" ) PORT_DIPSETTING( 0x00, "Common" ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3162,7 +3154,7 @@ static INPUT_PORTS_START( victroad ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(ikari_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -3200,7 +3192,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( bermudat ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0a0a */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3238,7 +3230,7 @@ static INPUT_PORTS_START( bermudat ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3264,7 +3256,7 @@ static INPUT_PORTS_START( bermudat ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0xc0, 0x80, "Game Style" ) PORT_DIPLOCATION("DIP2:7,8") PORT_DIPSETTING( 0xc0, "Normal without continue" ) PORT_DIPSETTING( 0x80, "Normal with continue" ) @@ -3329,7 +3321,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( psychos ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -3366,7 +3358,7 @@ static INPUT_PORTS_START( psychos ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3393,7 +3385,7 @@ static INPUT_PORTS_START( psychos ) PORT_DIPNAME( 0x08, 0x08, "Freeze" ) PORT_DIPLOCATION("DIP2:4") PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x40, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) @@ -3414,7 +3406,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( gwar ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(gwar_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x08c8 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -3428,7 +3420,7 @@ static INPUT_PORTS_START( gwar ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwar_rotary<0>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::gwar_rotary<0>)) PORT_START("P1ROT") PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_Z) PORT_CODE_INC(KEYCODE_X) PORT_REVERSE PORT_FULL_TURN_COUNT(12) @@ -3438,7 +3430,7 @@ static INPUT_PORTS_START( gwar ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwar_rotary<1>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::gwar_rotary<1>)) PORT_START("P2ROT") PORT_BIT( 0x0f, 0x00, IPT_POSITIONAL ) PORT_POSITIONS(12) PORT_WRAPS PORT_SENSITIVITY(15) PORT_KEYDELTA(1) PORT_CODE_DEC(KEYCODE_N) PORT_CODE_INC(KEYCODE_M) PORT_PLAYER(2) PORT_REVERSE PORT_FULL_TURN_COUNT(12) @@ -3460,7 +3452,7 @@ static INPUT_PORTS_START( gwar ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3486,7 +3478,7 @@ static INPUT_PORTS_START( gwar ) PORT_DIPSETTING( 0x08, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwar_state::snk_bonus_r<0x30>)) PORT_DIPUNUSED_DIPLOC( 0x40, 0x40, "DSW2:7" ) PORT_DIPUNUSED_DIPLOC( 0x80, 0x80, "DSW2:8" ) @@ -3509,10 +3501,10 @@ static INPUT_PORTS_START( gwarb ) // connected. If rotary is not connected, player fires in the direction he's facing. PORT_MODIFY("IN1") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwarb_rotary<0>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwarb_state::gwarb_rotary<0>)) PORT_MODIFY("IN2") - PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::gwarb_rotary<1>)) + PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(gwarb_state::gwarb_rotary<1>)) PORT_START("JOYSTICK_MODE") PORT_CONFNAME( 0x01, 0x00, "Joystick mode" ) @@ -3523,7 +3515,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( chopper ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x0849 */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_TILT ) /* reset */ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SERVICE ) @@ -3562,7 +3554,7 @@ static INPUT_PORTS_START( chopper ) PORT_DIPNAME( 0x02, 0x02, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("DIP1:2") PORT_DIPSETTING( 0x02, DEF_STR( Upright ) ) /* Single Controls */ PORT_DIPSETTING( 0x00, DEF_STR( Cocktail ) ) - PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x04>)) + PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x04>)) PORT_DIPNAME( 0x08, 0x08, DEF_STR( Lives ) ) PORT_DIPLOCATION("DIP1:4") PORT_DIPSETTING( 0x08, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -3588,7 +3580,7 @@ static INPUT_PORTS_START( chopper ) PORT_DIPSETTING( 0x0c, "Demo Sounds On" ) PORT_DIPSETTING( 0x00, "Freeze" ) PORT_DIPSETTING( 0x04, "Infinite Lives (Cheat)") - PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(snk_state::snk_bonus_r<0x30>)) + PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(bermudat_state::snk_bonus_r<0x30>)) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("DIP2:7") PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x40, DEF_STR( Yes ) ) @@ -3644,7 +3636,7 @@ static INPUT_PORTS_START( tdfever ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* also reset - code at 0x074a */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* adds 1 credit - code at 0x1065 */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") @@ -3786,7 +3778,7 @@ static INPUT_PORTS_START( fsoccer ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE ) /* same as the dip switch / also reset - code at 0x00cc */ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) /* uses "Coin A" settings - code at 0x677f */ - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(snk_state::sound_busy_r)) + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(bermudat_state::sound_busy_r)) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start Game A") @@ -3934,18 +3926,6 @@ INPUT_PORTS_END /*********************************************************************/ -static const gfx_layout tilelayout_4bpp = -{ - 16,16, - RGN_FRAC(1,1), - 4, - { STEP4(0,1) }, - { 4*1, 4*0, 4*3, 4*2, 4*5, 4*4, 4*7, 4*6, - 32+4*1, 32+4*0, 32+4*3, 32+4*2, 32+4*5, 32+4*4, 32+4*7, 32+4*6 }, - { STEP16(0,4*16) }, - 64*16 -}; - static const gfx_layout spritelayout_3bpp = { 16,16, @@ -4008,44 +3988,44 @@ static GFXDECODE_START( gfx_tnk3 ) GFXDECODE_END static GFXDECODE_START( gfx_ikari ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x100, 0x080>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x180, 0x080>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x100, 0x080>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_3bpp, 0x000, 0x080>>3 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_3bpp, 0x080, 0x080>>3 ) /* colors 0x200-0x3ff contain shadows */ GFXDECODE_END static GFXDECODE_START( gfx_gwar ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x300, 0x100>>4 ) - GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x300, 0x100>>4 ) + GFXDECODE_ENTRY( "sp16_tiles", 0, spritelayout_4bpp, 0x100, 0x100>>4 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x200, 0x100>>4 ) GFXDECODE_END static GFXDECODE_START( gfx_tdfever ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) - GFXDECODE_ENTRY( "bg_tiles", 0, tilelayout_4bpp, 0x200, 0x100>>4 ) - GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_lsb, 0x000, 0x100>>4 ) + GFXDECODE_ENTRY( "bg_tiles", 0, gfx_16x16x4_packed_lsb, 0x200, 0x100>>4 ) + GFXDECODE_ENTRY( "sp32_tiles", 0, bigspritelayout_4bpp, 0x100, 0x100>>4 ) /* colors 0x300-0x3ff contain shadows */ GFXDECODE_END /**********************************************************************/ -void snk_state::marvins(machine_config &config) +void marvins_state::marvins(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 3360000); // 3.36 MHz - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(marvins_state::irq0_line_hold)); Z80(config, m_subcpu, 3360000); // 3.36 MHz - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(marvins_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); // verified on schematics - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::marvins_sound_map); - m_audiocpu->set_addrmap(AS_IO, &snk_state::marvins_sound_portmap); - m_audiocpu->set_periodic_int(FUNC(snk_state::nmi_line_assert), attotime::from_ticks(0x4000, 8_MHz_XTAL/2)); // 244Hz + m_audiocpu->set_addrmap(AS_PROGRAM, &marvins_state::marvins_sound_map); + m_audiocpu->set_addrmap(AS_IO, &marvins_state::marvins_sound_portmap); + m_audiocpu->set_periodic_int(FUNC(marvins_state::nmi_line_assert), attotime::from_ticks(0x4000, 8_MHz_XTAL/2)); // 244Hz config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4054,16 +4034,14 @@ void snk_state::marvins(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(36*8, 28*8); m_screen->set_visarea(0*8, 36*8-1, 1*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_marvins)); + m_screen->set_screen_update(FUNC(marvins_state::screen_update_marvins)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_marvins); - PALETTE(config, m_palette, FUNC(snk_state::tnk3_palette), 0x400); + PALETTE(config, m_palette, FUNC(marvins_state::tnk3_palette), 0x400); m_palette->enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,marvins) - /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4075,22 +4053,22 @@ void snk_state::marvins(machine_config &config) SNKWAVE(config, "wave", 8_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 0.30); // verified on schematics } -void snk_state::vangrd2(machine_config &config) +void marvins_state::vangrd2(machine_config &config) { marvins(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::madcrash_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::madcrash_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrash_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrash_cpuB_map); } -void snk_state::madcrush(machine_config &config) +void marvins_state::madcrush(machine_config &config) { marvins(config); /* basic machine hardware */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::madcrush_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::madcrush_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrush_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &marvins_state::madcrush_cpuB_map); } void snk_state::jcross(machine_config &config) @@ -4159,7 +4137,7 @@ void snk_state::hal21(machine_config &config) m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::hal21_cpuB_map); m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::hal21_sound_map); - m_audiocpu->set_addrmap(AS_IO, &snk_state::hal21_sound_portmap); + m_audiocpu->set_addrmap(AS_IO, &snk_state::marvins_sound_portmap); m_audiocpu->set_periodic_int(FUNC(snk_state::irq0_line_hold), attotime::from_hz(220)); // music tempo, hand tuned /* video hardware */ @@ -4253,25 +4231,25 @@ void snk_state::fitegolf2(machine_config &config) m_screen->set_screen_update(FUNC(snk_state::screen_update_fitegolf2)); } -void snk_state::countryc(machine_config &config) +void countryc_state::countryc(machine_config &config) { fitegolf(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::countryc_cpuA_map); + m_maincpu->set_addrmap(AS_PROGRAM, &countryc_state::countryc_cpuA_map); } -void snk_state::ikari(machine_config &config) +void ikari_state::ikari(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 13.4_MHz_XTAL/4); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::ikari_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &ikari_state::ikari_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(ikari_state::irq0_line_hold)); Z80(config, m_subcpu, 13.4_MHz_XTAL/4); /* verified on pcb */ - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::ikari_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &ikari_state::ikari_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(ikari_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_YM3526_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &ikari_state::YM3526_YM3526_sound_map); config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4280,55 +4258,53 @@ void snk_state::ikari(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(36*8, 28*8); m_screen->set_visarea(0*8, 36*8-1, 1*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_ikari)); + m_screen->set_screen_update(FUNC(ikari_state::screen_update_ikari)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ikari); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400); m_palette->enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,ikari) - /* sound hardware */ SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 8_MHz_XTAL/2)); /* verified on pcb */ - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(ikari_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 2.0); ym3526_device &ym2(YM3526(config, "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(ikari_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::victroad(machine_config &config) +void ikari_state::victroad(machine_config &config) { ikari(config); /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &ikari_state::YM3526_Y8950_sound_map); /* sound hardware */ y8950_device &ym2(Y8950(config.replace(), "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(ikari_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::bermudat(machine_config &config) +void bermudat_state::bermudat(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::bermudat_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::bermudat_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_subcpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::bermudat_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::bermudat_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_audiocpu, 8_MHz_XTAL/2); /* verified on pcb */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::YM3526_Y8950_sound_map); config.set_maximum_quantum(attotime::from_hz(24000)); @@ -4338,13 +4314,13 @@ void snk_state::bermudat(machine_config &config) // this visible area matches the psychos pcb m_screen->set_size(50*8, 28*8); m_screen->set_visarea(0*8, 50*8-1, 0*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_gwar)); + m_screen->set_screen_update(FUNC(bermudat_state::screen_update_gwar)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_gwar); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400); - MCFG_VIDEO_START_OVERRIDE(snk_state,gwar) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,gwar) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4352,66 +4328,66 @@ void snk_state::bermudat(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 8_MHz_XTAL/2)); /* verified on pcb */ - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 2.0); y8950_device &ym2(Y8950(config, "ym2", 8_MHz_XTAL/2)); /* verified on pcb */ - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(bermudat_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 2.0); } -void snk_state::psychos(machine_config &config) +void bermudat_state::psychos(machine_config &config) { bermudat(config); - MCFG_VIDEO_START_OVERRIDE(snk_state,psychos) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,psychos) } -void snk_state::gwar(machine_config &config) +void gwar_state::gwar(machine_config &config) { bermudat(config); // Note: XTAL is 16MHz on Guerilla War video PCB with divider 16/4 - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gwar_state::gwar_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &gwar_state::gwar_cpuB_map); } -void snk_state::gwara(machine_config &config) +void gwar_state::gwara(machine_config &config) { bermudat(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwara_cpuA_map); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwara_cpuB_map); + m_maincpu->set_addrmap(AS_PROGRAM, &gwar_state::gwara_cpuA_map); + m_subcpu->set_addrmap(AS_PROGRAM, &gwar_state::gwara_cpuB_map); } -void snk_state::chopper1(machine_config &config) +void bermudat_state::chopper1(machine_config &config) { bermudat(config); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuB_map); - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3812_Y8950_sound_map); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::gwar_cpuB_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::chopper1_sound_map); /* sound hardware */ ym3812_device &ym1(YM3812(config.replace(), "ym1", 4000000)); - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 1.0); } -void snk_state::choppera(machine_config &config) +void bermudat_state::choppera(machine_config &config) { chopper1(config); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::gwar_cpuA_map); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::gwar_cpuA_map); } -void snk_state::tdfever(machine_config &config) +void bermudat_state::tdfever(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, 4000000); - m_maincpu->set_addrmap(AS_PROGRAM, &snk_state::tdfever_cpuA_map); - m_maincpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_maincpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever_cpuA_map); + m_maincpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_subcpu, 4000000); - m_subcpu->set_addrmap(AS_PROGRAM, &snk_state::tdfever_cpuB_map); - m_subcpu->set_vblank_int("screen", FUNC(snk_state::irq0_line_hold)); + m_subcpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever_cpuB_map); + m_subcpu->set_vblank_int("screen", FUNC(bermudat_state::irq0_line_hold)); Z80(config, m_audiocpu, 4000000); - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::YM3526_Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::YM3526_Y8950_sound_map); config.set_maximum_quantum(attotime::from_hz(6000)); @@ -4420,13 +4396,13 @@ void snk_state::tdfever(machine_config &config) m_screen->set_refresh_hz(60); m_screen->set_size(50*8, 28*8); m_screen->set_visarea(0*8, 50*8-1, 0*8, 28*8-1); - m_screen->set_screen_update(FUNC(snk_state::screen_update_tdfever)); + m_screen->set_screen_update(FUNC(bermudat_state::screen_update_tdfever)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_tdfever); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 0x400).enable_shadows(); - MCFG_VIDEO_START_OVERRIDE(snk_state,tdfever) + MCFG_VIDEO_START_OVERRIDE(bermudat_state,tdfever) /* sound hardware */ SPEAKER(config, "mono").front_center(); @@ -4434,20 +4410,20 @@ void snk_state::tdfever(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); ym3526_device &ym1(YM3526(config, "ym1", 4000000)); - ym1.irq_handler().set(FUNC(snk_state::ymirq_callback_1)); + ym1.irq_handler().set(FUNC(bermudat_state::ymirq_callback_1)); ym1.add_route(ALL_OUTPUTS, "mono", 1.0); y8950_device &ym2(Y8950(config, "ym2", 4000000)); - ym2.irq_handler().set(FUNC(snk_state::ymirq_callback_2)); + ym2.irq_handler().set(FUNC(bermudat_state::ymirq_callback_2)); ym2.add_route(ALL_OUTPUTS, "mono", 1.0); } -void snk_state::tdfever2(machine_config &config) +void bermudat_state::tdfever2(machine_config &config) { tdfever(config); /* basic machine hardware */ - m_audiocpu->set_addrmap(AS_PROGRAM, &snk_state::Y8950_sound_map); + m_audiocpu->set_addrmap(AS_PROGRAM, &bermudat_state::tdfever2_sound_map); /* sound hardware */ @@ -5005,7 +4981,7 @@ ROM_START( tnk3 ) ROM_REGION( 0x4000, "tx_tiles", 0 ) ROM_LOAD( "p14.1e", 0x0000, 0x2000, CRC(1fd18c43) SHA1(611b5aa97df84c0117681772deb006f32a899ad3) ) - ROM_RELOAD( 0x2000, 0x2000 ) + ROM_RELOAD( 0x2000, 0x2000 ) ROM_REGION( 0x8000, "bg_tiles", 0 ) ROM_LOAD( "p12.3d", 0x0000, 0x4000, CRC(ff495a16) SHA1(e6b97a63efe58018260ff34f0ea4edc81718cb14) ) @@ -5376,13 +5352,13 @@ Video board: A5004UP01-02 ROM_START( ikari ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "1.4p", 0x0000, 0x10000, CRC(52a8b2dd) SHA1(a896387d68ed9a55c313bdb81acdf8d68b7a1264) ) + ROM_LOAD( "1.4p", 0x00000, 0x10000, CRC(52a8b2dd) SHA1(a896387d68ed9a55c313bdb81acdf8d68b7a1264) ) ROM_REGION( 0x10000, "sub", 0 ) - ROM_LOAD( "2.8p", 0x0000, 0x10000, CRC(45364d55) SHA1(323b998f782a4681ceb18016c5fb0fa1d6361aac) ) + ROM_LOAD( "2.8p", 0x00000, 0x10000, CRC(45364d55) SHA1(323b998f782a4681ceb18016c5fb0fa1d6361aac) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "3.7k", 0x0000, 0x10000, CRC(56a26699) SHA1(e9ccb27f1e711e4648fdfe3c7ff956038d3e101c) ) + ROM_LOAD( "3.7k", 0x00000, 0x10000, CRC(56a26699) SHA1(e9ccb27f1e711e4648fdfe3c7ff956038d3e101c) ) // Sockets at 5g and 6e are empty ROM_REGION( 0x0c00, "proms", 0 ) // MB7122 or 82S137 or 63S441 @@ -5716,7 +5692,7 @@ Video board: A5004UP01-02 ROM_START( victroad ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(e334acef) SHA1(f6d8da554276abbe5579c92eea46591a92623f6e) ) ROM_REGION( 0x10000 , "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) ) @@ -5768,7 +5744,7 @@ ROM_END ROM_START( dogosoke ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(37867ad2) SHA1(4444e428eb7126451f34351b1a2bc193484ca641) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(37867ad2) SHA1(4444e428eb7126451f34351b1a2bc193484ca641) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(907fac83) SHA1(691d95f95ef7a308c7f5e7defb20971b54423745) ) @@ -5871,7 +5847,7 @@ Video board: A6004UP01-01 ROM_START( bermudat ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(43dec5e9) SHA1(2b29016d4af2a0a6be87f440f235a6a76f8a52a0) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(43dec5e9) SHA1(2b29016d4af2a0a6be87f440f235a6a76f8a52a0) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) ) @@ -5924,7 +5900,7 @@ ROM_END ROM_START( bermudatj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "p1.4p", 0x0000, 0x10000, CRC(eda75f36) SHA1(d6fcb46dc45007a77bf6a8ca7aa53aefedcecf92) ) + ROM_LOAD( "p1.4p", 0x00000, 0x10000, CRC(eda75f36) SHA1(d6fcb46dc45007a77bf6a8ca7aa53aefedcecf92) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "p2.8p", 0x00000, 0x10000, CRC(0e193265) SHA1(765ad63d1f752920d3d7829747e8f2808670ee84) ) @@ -5977,7 +5953,7 @@ ROM_END ROM_START( worldwar ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ww4.4p", 0x0000, 0x10000, CRC(bc29d09f) SHA1(9bd5a47565934590347b7152457869331ae94375) ) + ROM_LOAD( "ww4.4p", 0x00000, 0x10000, CRC(bc29d09f) SHA1(9bd5a47565934590347b7152457869331ae94375) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "ww5.8p", 0x00000, 0x10000, CRC(8dc15909) SHA1(dc0f0e969c36469cc91ecfb1a98cfdb1020972eb) ) @@ -6030,7 +6006,7 @@ ROM_END ROM_START( bermudata ) // Bermuda Triangle title, World Wars game. No YM ROMs (no speech). ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "wwu4.4p", 0x0000, 0x10000, CRC(4de39d01) SHA1(4312660c6658079c2d148c07d24f741804f3e45c) ) + ROM_LOAD( "wwu4.4p", 0x00000, 0x10000, CRC(4de39d01) SHA1(4312660c6658079c2d148c07d24f741804f3e45c) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "wwu5.8p", 0x00000, 0x10000, CRC(76158e94) SHA1(221e59b3fd87c6193755753d6ac6a96807e23120) ) @@ -6099,7 +6075,7 @@ ROM_START( psychos ) ROM_LOAD( "ps6.8m", 0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) ) ROM_REGION( 0x10000, "audiocpu", 0 ) - ROM_LOAD( "ps5.6j", 0x0000, 0x10000, CRC(64503283) SHA1(e380164ac4268eda1d9ca2404b3dddc5fd3f9dcc) ) + ROM_LOAD( "ps5.6j", 0x00000, 0x10000, CRC(64503283) SHA1(e380164ac4268eda1d9ca2404b3dddc5fd3f9dcc) ) ROM_REGION( 0x1400, "proms", 0 ) // MB7122 or 82S137 or 63S441 ROM_LOAD( "psc1.1k", 0x0000, 0x400, CRC(27b8ca8c) SHA1(a2dbc22ca10c2c2c874bf766fe64981f9be75aba) ) // red @@ -6142,7 +6118,7 @@ ROM_END ROM_START( psychosj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "ps7.4m", 0x0000, 0x10000, CRC(05dfb409) SHA1(e6c378c86689c7ab9190908c8e4aa2d4563c3774) ) + ROM_LOAD( "ps7.4m", 0x00000, 0x10000, CRC(05dfb409) SHA1(e6c378c86689c7ab9190908c8e4aa2d4563c3774) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "ps6.8m", 0x00000, 0x10000, CRC(5f426ddb) SHA1(d4b2215122b23066ba2b231992f0f27057259ded) ) @@ -6851,7 +6827,7 @@ Video board: A6006UP01-03 ROM_START( tdfever ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "td2-ver3u.6c", 0x0000, 0x10000, CRC(92138fe4) SHA1(17a2bc12f516cdbea3cc5e283b0a8a2d101dfa47) ) // Red "U" stamped on label + ROM_LOAD( "td2-ver3u.6c", 0x00000, 0x10000, CRC(92138fe4) SHA1(17a2bc12f516cdbea3cc5e283b0a8a2d101dfa47) ) // Red "U" stamped on label ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "td1-ver3u.2c", 0x00000, 0x10000, CRC(798711f5) SHA1(a67d6b71c08df00592cf1a18806ed1c2ee757066) ) // Red "U" stamped on label @@ -6891,7 +6867,7 @@ ROM_END ROM_START( tdfeverj ) ROM_REGION( 0x10000, "maincpu", 0 ) - ROM_LOAD( "td2.6c", 0x0000, 0x10000, CRC(88d88ec4) SHA1(774de920290b5c787b0f3d0076883dda106364be) ) + ROM_LOAD( "td2.6c", 0x00000, 0x10000, CRC(88d88ec4) SHA1(774de920290b5c787b0f3d0076883dda106364be) ) ROM_REGION( 0x10000, "sub", 0 ) ROM_LOAD( "td1.2c", 0x00000, 0x10000, CRC(191e6442) SHA1(6a4d0d7efea734443eef538e99562ce4e2949a84) ) @@ -7034,63 +7010,63 @@ ROM_END // TODO: according to Kold at very least Athena is ROT180 not ROT0 -GAME( 1983, marvins, 0, marvins, marvins, snk_state, empty_init, ROT270, "SNK", "Marvin's Maze", 0 ) -GAME( 1984, vangrd2, 0, vangrd2, vangrd2, snk_state, empty_init, ROT270, "SNK", "Vanguard II", 0 ) -GAME( 1984, madcrash, 0, vangrd2, madcrash, snk_state, empty_init, ROT0, "SNK", "Mad Crasher", 0 ) -GAME( 1984, madcrush, madcrash, madcrush, madcrash, snk_state, empty_init, ROT0, "SNK", "Mad Crusher (Japan)", 0 ) - -GAME( 1984, jcross, 0, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 1)", 0 ) -GAME( 1984, jcrossa, jcross, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 2)", 0 ) -GAME( 1984, sgladiat, 0, sgladiat, sgladiat, snk_state, empty_init, ROT0, "SNK", "Gladiator 1984", 0 ) -GAME( 1985, hal21, 0, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21", 0 ) -GAME( 1985, hal21j, hal21, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21 (Japan)", 0 ) - -GAME( 1985, aso, 0, aso, aso, snk_state, empty_init, ROT270, "SNK", "ASO - Armored Scrum Object", 0 ) -GAME( 1985, alphamis, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Alpha Mission", 0 ) -GAME( 1985, arian, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Arian Mission", 0 ) -GAME( 1985, tnk3, 0, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.N.K III (US)", 0 ) -GAME( 1985, tnk3j, tnk3, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (Japan)", 0 ) -GAME( 1985, tnk3b, tnk3, tnk3, tnk3b, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (bootleg, 8-way joystick)", 0 ) -GAME( 1986, athena, 0, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena", 0 ) -GAME( 1986, athenab, athena, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena (bootleg)", 0 ) // is this really a bootleg? -GAME( 1987, sathena, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Super Athena (bootleg)", 0 ) -GAME( 1988, fitegolf, 0, fitegolf, fitegolf, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (World?)", 0 ) -GAME( 1988, fitegolfu, fitegolf, fitegolf, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 1)", 0 ) -GAME( 1988, fitegolfua,fitegolf, fitegolf2, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 2)", 0 ) -GAME( 1988, countryc, 0, countryc, countryc, snk_state, empty_init, ROT0, "SNK", "Country Club", 0 ) - -GAME( 1986, ikari, 0, ikari, ikari, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US JAMMA)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikaria, ikari, ikari, ikaria, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 1)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikaria2, ikari, ikari, ikaria, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 2)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikarinc, ikari, ikari, ikarinc, snk_state, empty_init, ROT270, "SNK", "Ikari Warriors (US No Continues)", 0 ) // distributed by Tradewest(?) -GAME( 1986, ikarijp, ikari, ikari, ikarinc, snk_state, empty_init, ROT270, "SNK", "Ikari (Japan No Continues)", 0 ) -GAME( 1986, ikarijpb, ikari, ikari, ikarijpb, snk_state, empty_init, ROT270, "bootleg", "Ikari (Joystick hack bootleg)", 0 ) -GAME( 1986, ikariram, ikari, ikari, ikarijpb, snk_state, empty_init, ROT270, "bootleg", "Rambo 3 (bootleg of Ikari, Joystick hack)", 0 ) -GAME( 1986, victroad, 0, victroad, victroad, snk_state, empty_init, ROT270, "SNK", "Victory Road", 0 ) -GAME( 1986, dogosoke, victroad, victroad, victroad, snk_state, empty_init, ROT270, "SNK", "Dogou Souken", 0 ) -GAME( 1986, dogosokb, victroad, victroad, dogosokb, snk_state, empty_init, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", 0 ) - -GAME( 1987, bermudat, 0, bermudat, bermudat, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World?)", 0 ) -GAME( 1987, bermudatj, bermudat, bermudat, bermudat, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (Japan)", 0 ) -GAME( 1987, worldwar, 0, bermudat, worldwar, snk_state, empty_init, ROT270, "SNK", "World Wars (World?)", 0 ) -GAME( 1987, bermudata, worldwar, bermudat, bermudaa, snk_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 ) -GAME( 1987, psychos, 0, psychos, psychos, snk_state, empty_init, ROT0, "SNK", "Psycho Soldier (US)", 0 ) -GAME( 1987, psychosj, psychos, psychos, psychos, snk_state, empty_init, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) -GAME( 1987, gwar, 0, gwar, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (US)", 0 ) -GAME( 1987, gwarj, gwar, gwar, gwar, snk_state, empty_init, ROT270, "SNK", "Guevara (Japan)", 0 ) -GAME( 1987, gwara, gwar, gwara, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 1)", 0 ) -GAME( 1987, gwarab, gwar, gwara, gwar, snk_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 2)", 0 ) -GAME( 1987, gwarb, gwar, gwar, gwarb, snk_state, empty_init, ROT270, "bootleg", "Guerrilla War (Joystick hack bootleg)", 0 ) -GAME( 1988, chopper, 0, choppera, choppera, snk_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 2)", 0 ) -GAME( 1988, choppera, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 1?)", 0 ) -GAME( 1988, chopperb, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Chopper I (US)", 0 ) // First version, without the rev "A" roms -GAME( 1988, legofair, chopper, chopper1, chopper, snk_state, empty_init, ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", 0 ) - -GAME( 1987, tdfever, 0, tdfever, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever (US)", 0 ) -GAME( 1987, tdfeverj, tdfever, tdfever, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever (Japan)", 0 ) -GAME( 1988, tdfever2, tdfever, tdfever2, tdfever, snk_state, empty_init, ROT90, "SNK", "TouchDown Fever 2", 0 ) // upgrade kit for Touchdown Fever -GAME( 1988, tdfever2b, tdfever, tdfever2, tdfever, snk_state, empty_init, ROT90, "bootleg", "TouchDown Fever 2 (bootleg)", 0 ) -GAME( 1988, fsoccer, 0, tdfever2, fsoccer, snk_state, empty_init, ROT0, "SNK", "Fighting Soccer (version 4)", 0 ) -GAME( 1988, fsoccerj, fsoccer, tdfever2, fsoccer, snk_state, empty_init, ROT0, "SNK", "Fighting Soccer (Japan)", 0 ) -GAME( 1988, fsoccerb, fsoccer, tdfever2, fsoccerb, snk_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg)", 0 ) -GAME( 1988, fsoccerba, fsoccer, tdfever2, fsoccerb, snk_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg, alt)", 0 ) +GAME( 1983, marvins, 0, marvins, marvins, marvins_state, empty_init, ROT270, "SNK", "Marvin's Maze", 0 ) +GAME( 1984, vangrd2, 0, vangrd2, vangrd2, marvins_state, empty_init, ROT270, "SNK", "Vanguard II", 0 ) +GAME( 1984, madcrash, 0, vangrd2, madcrash, marvins_state, empty_init, ROT0, "SNK", "Mad Crasher", 0 ) +GAME( 1984, madcrush, madcrash, madcrush, madcrash, marvins_state, empty_init, ROT0, "SNK", "Mad Crusher (Japan)", 0 ) + +GAME( 1984, jcross, 0, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 1)", 0 ) +GAME( 1984, jcrossa, jcross, jcross, jcross, snk_state, empty_init, ROT270, "SNK", "Jumping Cross (set 2)", 0 ) +GAME( 1984, sgladiat, 0, sgladiat, sgladiat, snk_state, empty_init, ROT0, "SNK", "Gladiator 1984", 0 ) +GAME( 1985, hal21, 0, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21", 0 ) +GAME( 1985, hal21j, hal21, hal21, hal21, snk_state, empty_init, ROT270, "SNK", "HAL21 (Japan)", 0 ) + +GAME( 1985, aso, 0, aso, aso, snk_state, empty_init, ROT270, "SNK", "ASO - Armored Scrum Object", 0 ) +GAME( 1985, alphamis, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Alpha Mission", 0 ) +GAME( 1985, arian, aso, aso, alphamis, snk_state, empty_init, ROT270, "SNK", "Arian Mission", 0 ) +GAME( 1985, tnk3, 0, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.N.K III (US)", 0 ) +GAME( 1985, tnk3j, tnk3, tnk3, tnk3, snk_state, empty_init, ROT270, "SNK", "T.A.N.K (Japan)", 0 ) +GAME( 1985, tnk3b, tnk3, tnk3, tnk3b, snk_state, empty_init, ROT270, "bootleg", "T.A.N.K (bootleg, 8-way joystick)", 0 ) +GAME( 1986, athena, 0, athena, athena, snk_state, empty_init, ROT0, "SNK", "Athena", 0 ) +GAME( 1986, athenab, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Athena (bootleg)", 0 ) // is this really a bootleg? +GAME( 1987, sathena, athena, athena, athena, snk_state, empty_init, ROT0, "bootleg", "Super Athena (bootleg)", 0 ) +GAME( 1988, fitegolf, 0, fitegolf, fitegolf, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (World?)", 0 ) +GAME( 1988, fitegolfu, fitegolf, fitegolf, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 1)", 0 ) +GAME( 1988, fitegolfua,fitegolf, fitegolf2, fitegolfu, snk_state, empty_init, ROT0, "SNK", "Lee Trevino's Fighting Golf (US, Ver 2, set 2)", 0 ) +GAME( 1988, countryc, 0, countryc, countryc, countryc_state, empty_init, ROT0, "SNK", "Country Club", 0 ) + +GAME( 1986, ikari, 0, ikari, ikari, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US JAMMA)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikaria, ikari, ikari, ikaria, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 1)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikaria2, ikari, ikari, ikaria, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US, set 2)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikarinc, ikari, ikari, ikarinc, ikari_state, empty_init, ROT270, "SNK", "Ikari Warriors (US No Continues)", 0 ) // distributed by Tradewest(?) +GAME( 1986, ikarijp, ikari, ikari, ikarinc, ikari_state, empty_init, ROT270, "SNK", "Ikari (Japan No Continues)", 0 ) +GAME( 1986, ikarijpb, ikari, ikari, ikarijpb, ikari_state, empty_init, ROT270, "bootleg", "Ikari (Joystick hack bootleg)", 0 ) +GAME( 1986, ikariram, ikari, ikari, ikarijpb, ikari_state, empty_init, ROT270, "bootleg", "Rambo 3 (bootleg of Ikari, Joystick hack)", 0 ) +GAME( 1986, victroad, 0, victroad, victroad, ikari_state, empty_init, ROT270, "SNK", "Victory Road", 0 ) +GAME( 1986, dogosoke, victroad, victroad, victroad, ikari_state, empty_init, ROT270, "SNK", "Dogou Souken (Japan)", 0 ) +GAME( 1986, dogosokb, victroad, victroad, dogosokb, ikari_state, empty_init, ROT270, "bootleg", "Dogou Souken (Joystick hack bootleg)", 0 ) + +GAME( 1987, bermudat, 0, bermudat, bermudat, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World?)", 0 ) +GAME( 1987, bermudatj, bermudat, bermudat, bermudat, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (Japan)", 0 ) +GAME( 1987, worldwar, 0, bermudat, worldwar, bermudat_state, empty_init, ROT270, "SNK", "World Wars (World?)", 0 ) +GAME( 1987, bermudata, worldwar, bermudat, bermudaa, bermudat_state, empty_init, ROT270, "SNK", "Bermuda Triangle (World Wars) (US)", 0 ) +GAME( 1987, psychos, 0, psychos, psychos, bermudat_state, empty_init, ROT0, "SNK", "Psycho Soldier (US)", 0 ) +GAME( 1987, psychosj, psychos, psychos, psychos, bermudat_state, empty_init, ROT0, "SNK", "Psycho Soldier (Japan)", 0 ) +GAME( 1987, gwar, 0, gwar, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (US)", 0 ) +GAME( 1987, gwarj, gwar, gwar, gwar, gwar_state, empty_init, ROT270, "SNK", "Guevara (Japan)", 0 ) +GAME( 1987, gwara, gwar, gwara, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 1)", 0 ) +GAME( 1987, gwarab, gwar, gwara, gwar, gwar_state, empty_init, ROT270, "SNK", "Guerrilla War (Version 1, set 2)", 0 ) +GAME( 1987, gwarb, gwar, gwar, gwarb, gwarb_state, empty_init, ROT270, "bootleg", "Guerrilla War (Joystick hack bootleg)", 0 ) +GAME( 1988, chopper, 0, choppera, choppera, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 2)", 0 ) +GAME( 1988, choppera, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US Ver 1?)", 0 ) +GAME( 1988, chopperb, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Chopper I (US)", 0 ) // First version, without the rev "A" roms +GAME( 1988, legofair, chopper, chopper1, chopper, bermudat_state, empty_init, ROT270, "SNK", "Koukuu Kihei Monogatari - The Legend of Air Cavalry (Japan)", 0 ) + +GAME( 1987, tdfever, 0, tdfever, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever (US)", 0 ) +GAME( 1987, tdfeverj, tdfever, tdfever, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever (Japan)", 0 ) +GAME( 1988, tdfever2, tdfever, tdfever2, tdfever, bermudat_state, empty_init, ROT90, "SNK", "TouchDown Fever 2", 0 ) // upgrade kit for Touchdown Fever +GAME( 1988, tdfever2b, tdfever, tdfever2, tdfever, bermudat_state, empty_init, ROT90, "bootleg", "TouchDown Fever 2 (bootleg)", 0 ) +GAME( 1988, fsoccer, 0, tdfever2, fsoccer, bermudat_state, empty_init, ROT0, "SNK", "Fighting Soccer (version 4)", 0 ) +GAME( 1988, fsoccerj, fsoccer, tdfever2, fsoccer, bermudat_state, empty_init, ROT0, "SNK", "Fighting Soccer (Japan)", 0 ) +GAME( 1988, fsoccerb, fsoccer, tdfever2, fsoccerb, bermudat_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg)", 0 ) +GAME( 1988, fsoccerba, fsoccer, tdfever2, fsoccerb, bermudat_state, empty_init, ROT0, "bootleg", "Fighting Soccer (Joystick hack bootleg, alt)", 0 ) diff --git a/src/mame/snk/snk.h b/src/mame/snk/snk.h index 7c3be3aa28f3d..8fa9e72fa999b 100644 --- a/src/mame/snk/snk.h +++ b/src/mame/snk/snk.h @@ -30,50 +30,27 @@ class snk_state : public driver_device m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch"), m_spriteram(*this, "spriteram"), - m_fg_videoram(*this, "fg_videoram"), m_bg_videoram(*this, "bg_videoram"), m_tx_videoram(*this, "tx_videoram"), - m_rot_io(*this, "P%uROT", 1U), - m_trackball_x_io(*this, "TRACKBALLX%u", 1U), - m_trackball_y_io(*this, "TRACKBALLY%u", 1U), - m_joymode_io(*this, "JOYSTICK_MODE"), m_bonus_io(*this, "BONUS") { } - void gwar(machine_config &config); - void psychos(machine_config &config); - void fitegolf(machine_config &config); - void countryc(machine_config &config); - void tdfever2(machine_config &config); - void aso(machine_config &config); - void gwara(machine_config &config); - void tdfever(machine_config &config); - void fitegolf2(machine_config &config); - void jcross(machine_config &config); - void choppera(machine_config &config); - void tnk3(machine_config &config); - void victroad(machine_config &config); - void chopper1(machine_config &config); - void vangrd2(machine_config &config); - void bermudat(machine_config &config); - void hal21(machine_config &config); - void marvins(machine_config &config); - void athena(machine_config &config); - void ikari(machine_config &config); - void sgladiat(machine_config &config); - void madcrush(machine_config &config); + void fitegolf(machine_config &config) ATTR_COLD; + void aso(machine_config &config) ATTR_COLD; + void fitegolf2(machine_config &config) ATTR_COLD; + void jcross(machine_config &config) ATTR_COLD; + void tnk3(machine_config &config) ATTR_COLD; + void hal21(machine_config &config) ATTR_COLD; + void athena(machine_config &config) ATTR_COLD; + void sgladiat(machine_config &config) ATTR_COLD; int sound_busy_r(); - template ioport_value gwar_rotary(); - template ioport_value gwarb_rotary(); - ioport_value countryc_trackball_x(); - ioport_value countryc_trackball_y(); template ioport_value snk_bonus_r(); protected: virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; -private: required_device m_maincpu; required_device m_audiocpu; required_device m_subcpu; @@ -83,210 +60,323 @@ class snk_state : public driver_device optional_device m_soundlatch; required_shared_ptr m_spriteram; - optional_shared_ptr m_fg_videoram; required_shared_ptr m_bg_videoram; required_shared_ptr m_tx_videoram; - optional_ioport_array<2> m_rot_io; - optional_ioport_array<2> m_trackball_x_io; - optional_ioport_array<2> m_trackball_y_io; - optional_ioport m_joymode_io; optional_ioport m_bonus_io; - int m_countryc_trackball = 0; - int m_last_value[2]{}; - int m_cp_count[2]{}; - - // FIXME this should be initialised on machine reset - int m_sound_status = 0; + uint8_t m_sound_status = 0; tilemap_t *m_tx_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; tilemap_t *m_bg_tilemap = nullptr; - int m_fg_scrollx = 0; - int m_fg_scrolly = 0; - int m_bg_scrollx = 0; - int m_bg_scrolly = 0; - int m_sp16_scrollx = 0; - int m_sp16_scrolly = 0; - int m_sp32_scrollx = 0; - int m_sp32_scrolly = 0; + int32_t m_bg_scrollx = 0; + int32_t m_bg_scrolly = 0; + int32_t m_sp16_scrollx = 0; + int32_t m_sp16_scrolly = 0; + int32_t m_sp32_scrollx = 0; + int32_t m_sp32_scrolly = 0; uint8_t m_sprite_split_point = 0; + int m_num_sprites = 0; int m_yscroll_mask = 0; uint32_t m_bg_tile_offset = 0; uint32_t m_tx_tile_offset = 0; - int m_is_psychos = 0; uint8_t m_drawmode_table[16]{}; - uint8_t m_empty_tile[16*16]{}; - int m_hf_posy = 0; - int m_hf_posx = 0; - int m_tc16_posy = 0; - int m_tc16_posx = 0; - int m_tc32_posy = 0; - int m_tc32_posx = 0; - uint8_t snk_cpuA_nmi_trigger_r(); - void snk_cpuA_nmi_ack_w(uint8_t data); - uint8_t snk_cpuB_nmi_trigger_r(); - void snk_cpuB_nmi_ack_w(uint8_t data); - uint8_t marvins_sound_nmi_ack_r(); + + uint8_t cpuA_nmi_trigger_r(); + void cpuA_nmi_ack_w(uint8_t data); + uint8_t cpuB_nmi_trigger_r(); + void cpuB_nmi_ack_w(uint8_t data); void sgladiat_soundlatch_w(uint8_t data); uint8_t sgladiat_soundlatch_r(); uint8_t sgladiat_sound_nmi_ack_r(); uint8_t sgladiat_sound_irq_ack_r(); - void snk_soundlatch_w(uint8_t data); - uint8_t snk_sound_status_r(); - void snk_sound_status_w(uint8_t data); + void soundlatch_w(uint8_t data); + uint8_t sound_status_r(); + void sound_status_w(uint8_t data); uint8_t tnk3_cmdirq_ack_r(); uint8_t tnk3_ymirq_ack_r(); uint8_t tnk3_busy_clear_r(); - void hardflags_scrollx_w(uint8_t data); - void hardflags_scrolly_w(uint8_t data); - void hardflags_scroll_msb_w(uint8_t data); - uint8_t hardflags1_r(); - uint8_t hardflags2_r(); - uint8_t hardflags3_r(); - uint8_t hardflags4_r(); - uint8_t hardflags5_r(); - uint8_t hardflags6_r(); - uint8_t hardflags7_r(); - void turbocheck16_1_w(uint8_t data); - void turbocheck16_2_w(uint8_t data); - void turbocheck32_1_w(uint8_t data); - void turbocheck32_2_w(uint8_t data); - void turbocheck_msb_w(uint8_t data); - uint8_t turbocheck16_1_r(); - uint8_t turbocheck16_2_r(); - uint8_t turbocheck16_3_r(); - uint8_t turbocheck16_4_r(); - uint8_t turbocheck16_5_r(); - uint8_t turbocheck16_6_r(); - uint8_t turbocheck16_7_r(); - uint8_t turbocheck16_8_r(); - uint8_t turbocheck32_1_r(); - uint8_t turbocheck32_2_r(); - uint8_t turbocheck32_3_r(); - uint8_t turbocheck32_4_r(); void athena_coin_counter_w(uint8_t data); void ikari_coin_counter_w(uint8_t data); void tdfever_coin_counter_w(uint8_t data); - void countryc_trackball_w(uint8_t data); - void snk_tx_videoram_w(offs_t offset, uint8_t data); - void marvins_fg_videoram_w(offs_t offset, uint8_t data); + void tx_videoram_w(offs_t offset, uint8_t data); void marvins_bg_videoram_w(offs_t offset, uint8_t data); - void snk_bg_videoram_w(offs_t offset, uint8_t data); - void snk_fg_scrollx_w(uint8_t data); - void snk_fg_scrolly_w(uint8_t data); - void snk_bg_scrollx_w(uint8_t data); - void snk_bg_scrolly_w(uint8_t data); - void snk_sp16_scrollx_w(uint8_t data); - void snk_sp16_scrolly_w(uint8_t data); - void snk_sp32_scrollx_w(uint8_t data); - void snk_sp32_scrolly_w(uint8_t data); - void snk_sprite_split_point_w(uint8_t data); - void marvins_palette_bank_w(uint8_t data); - void marvins_flipscreen_w(uint8_t data); + void bg_videoram_w(offs_t offset, uint8_t data); + void bg_scrollx_w(uint8_t data); + void bg_scrolly_w(uint8_t data); + void sp16_scrollx_w(uint8_t data); + void sp16_scrolly_w(uint8_t data); + void sp32_scrollx_w(uint8_t data); + void sp32_scrolly_w(uint8_t data); + void sprite_split_point_w(uint8_t data); void sgladiat_flipscreen_w(uint8_t data); void hal21_flipscreen_w(uint8_t data); - void marvins_scroll_msb_w(uint8_t data); void jcross_scroll_msb_w(uint8_t data); void sgladiat_scroll_msb_w(uint8_t data); void aso_videoattrs_w(uint8_t data); void tnk3_videoattrs_w(uint8_t data); void aso_bg_bank_w(uint8_t data); - void ikari_bg_scroll_msb_w(uint8_t data); - void ikari_sp_scroll_msb_w(uint8_t data); - void ikari_unknown_video_w(uint8_t data); - void gwar_tx_bank_w(uint8_t data); - void gwar_videoattrs_w(uint8_t data); - void gwara_videoattrs_w(uint8_t data); - void gwara_sp_scroll_msb_w(uint8_t data); - void tdfever_sp_scroll_msb_w(uint8_t data); - void tdfever_spriteram_w(offs_t offset, uint8_t data); + void register_save_state() ATTR_COLD; TILEMAP_MAPPER_MEMBER(marvins_tx_scan_cols); TILE_GET_INFO_MEMBER(marvins_get_tx_tile_info); - TILE_GET_INFO_MEMBER(ikari_get_tx_tile_info); - TILE_GET_INFO_MEMBER(gwar_get_tx_tile_info); - TILE_GET_INFO_MEMBER(marvins_get_fg_tile_info); - TILE_GET_INFO_MEMBER(marvins_get_bg_tile_info); TILE_GET_INFO_MEMBER(aso_get_bg_tile_info); TILE_GET_INFO_MEMBER(tnk3_get_bg_tile_info); - TILE_GET_INFO_MEMBER(ikari_get_bg_tile_info); - TILE_GET_INFO_MEMBER(gwar_get_bg_tile_info); - DECLARE_VIDEO_START(marvins); void tnk3_palette(palette_device &palette) const; DECLARE_VIDEO_START(jcross); DECLARE_VIDEO_START(tnk3); - DECLARE_VIDEO_START(ikari); - DECLARE_VIDEO_START(gwar); - DECLARE_VIDEO_START(tdfever); DECLARE_VIDEO_START(sgladiat); DECLARE_VIDEO_START(hal21); DECLARE_VIDEO_START(aso); - DECLARE_VIDEO_START(psychos); - DECLARE_VIDEO_START(snk_3bpp_shadow); - DECLARE_VIDEO_START(snk_4bpp_shadow); - uint32_t screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_VIDEO_START(_3bpp_shadow); uint32_t screen_update_tnk3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_fitegolf2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback); TIMER_CALLBACK_MEMBER(sndirq_update_callback); - void ymirq_callback_2(int state); - void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); void tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll); - void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ); - void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, const int hw_xflip, const int from, const int to); - int hardflags_check(int num); - int hardflags_check8(int num); - int turbofront_check(int small, int num); - int turbofront_check8(int small, int num); void ymirq_callback_1(int state); + void ymirq_callback_2(int state); - void Y8950_sound_map(address_map &map) ATTR_COLD; void YM3526_Y8950_sound_map(address_map &map) ATTR_COLD; void YM3526_YM3526_sound_map(address_map &map) ATTR_COLD; - void YM3812_Y8950_sound_map(address_map &map) ATTR_COLD; void YM3812_sound_map(address_map &map) ATTR_COLD; void aso_YM3526_sound_map(address_map &map) ATTR_COLD; void aso_cpuA_map(address_map &map) ATTR_COLD; void aso_cpuB_map(address_map &map) ATTR_COLD; - void bermudat_cpuA_map(address_map &map) ATTR_COLD; - void bermudat_cpuB_map(address_map &map) ATTR_COLD; - void countryc_cpuA_map(address_map &map) ATTR_COLD; - void gwar_cpuA_map(address_map &map) ATTR_COLD; - void gwar_cpuB_map(address_map &map) ATTR_COLD; - void gwara_cpuA_map(address_map &map) ATTR_COLD; - void gwara_cpuB_map(address_map &map) ATTR_COLD; void hal21_cpuA_map(address_map &map) ATTR_COLD; void hal21_cpuB_map(address_map &map) ATTR_COLD; void hal21_sound_map(address_map &map) ATTR_COLD; - void hal21_sound_portmap(address_map &map) ATTR_COLD; - void ikari_cpuA_map(address_map &map) ATTR_COLD; - void ikari_cpuB_map(address_map &map) ATTR_COLD; void jcross_cpuA_map(address_map &map) ATTR_COLD; void jcross_cpuB_map(address_map &map) ATTR_COLD; void jcross_sound_map(address_map &map) ATTR_COLD; void jcross_sound_portmap(address_map &map) ATTR_COLD; + void marvins_sound_portmap(address_map &map) ATTR_COLD; + void sgladiat_cpuA_map(address_map &map) ATTR_COLD; + void sgladiat_cpuB_map(address_map &map) ATTR_COLD; + void sound_common_map(address_map &map) ATTR_COLD; + void tnk3_YM3526_sound_map(address_map &map) ATTR_COLD; + void tnk3_cpuA_map(address_map &map) ATTR_COLD; + void tnk3_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with Foreground tilemap +class marvins_state : public snk_state +{ +public: + marvins_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag), + m_fg_videoram(*this, "fg_videoram") + { } + + void madcrush(machine_config &config) ATTR_COLD; + void marvins(machine_config &config) ATTR_COLD; + void vangrd2(machine_config &config) ATTR_COLD; + +protected: + virtual void video_start() override ATTR_COLD; + +private: + required_shared_ptr m_fg_videoram; + + tilemap_t *m_fg_tilemap = nullptr; + int32_t m_fg_scrollx = 0; + int32_t m_fg_scrolly = 0; + + uint8_t marvins_sound_nmi_ack_r(); + void marvins_fg_videoram_w(offs_t offset, uint8_t data); + void marvins_palette_bank_w(uint8_t data); + void marvins_flipscreen_w(uint8_t data); + void fg_scrollx_w(uint8_t data); + void fg_scrolly_w(uint8_t data); + void marvins_scroll_msb_w(uint8_t data); + + TILE_GET_INFO_MEMBER(marvins_get_fg_tile_info); + TILE_GET_INFO_MEMBER(marvins_get_bg_tile_info); + void marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to); + uint32_t screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void madcrash_cpuA_map(address_map &map) ATTR_COLD; void madcrash_cpuB_map(address_map &map) ATTR_COLD; void madcrush_cpuA_map(address_map &map) ATTR_COLD; void madcrush_cpuB_map(address_map &map) ATTR_COLD; + void marvins_common_map(address_map &map) ATTR_COLD; void marvins_cpuA_map(address_map &map) ATTR_COLD; void marvins_cpuB_map(address_map &map) ATTR_COLD; void marvins_sound_map(address_map &map) ATTR_COLD; - void marvins_sound_portmap(address_map &map) ATTR_COLD; - void sgladiat_cpuA_map(address_map &map) ATTR_COLD; - void sgladiat_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with trackball +class countryc_state : public snk_state +{ +public: + countryc_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag), + m_trackball_x_io(*this, "TRACKBALLX%u", 1U), + m_trackball_y_io(*this, "TRACKBALLY%u", 1U) + { } + + void countryc(machine_config &config) ATTR_COLD; + + ioport_value countryc_trackball_x(); + ioport_value countryc_trackball_y(); + +protected: + virtual void machine_start() override ATTR_COLD; + +private: + required_ioport_array<2> m_trackball_x_io; + required_ioport_array<2> m_trackball_y_io; + + uint8_t m_countryc_trackball = 0; + + void countryc_trackball_w(uint8_t data); + void countryc_cpuA_map(address_map &map) ATTR_COLD; +}; + +// with "Hard Flags" hardware +class ikari_state : public snk_state +{ +public: + ikari_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag) + { } + + void ikari(machine_config &config) ATTR_COLD; + void victroad(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + int32_t m_hf_posy = 0; + int32_t m_hf_posx = 0; + + void ikari_bg_scroll_msb_w(uint8_t data); + void ikari_sp_scroll_msb_w(uint8_t data); + void ikari_unknown_video_w(uint8_t data); + void hardflags_scrollx_w(uint8_t data); + void hardflags_scrolly_w(uint8_t data); + void hardflags_scroll_msb_w(uint8_t data); + uint8_t hardflags7_r(); + + TILE_GET_INFO_MEMBER(ikari_get_tx_tile_info); + TILE_GET_INFO_MEMBER(ikari_get_bg_tile_info); + uint32_t screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ); + int hardflags_check(int num); + template uint8_t hardflags_check8(); + + void ikari_common_map(address_map &map) ATTR_COLD; + void ikari_cpuA_map(address_map &map) ATTR_COLD; + void ikari_cpuB_map(address_map &map) ATTR_COLD; +}; + +// with "Turbo Front" hardware, Higher screen resolution +class bermudat_state : public snk_state +{ +public: + bermudat_state(const machine_config &mconfig, device_type type, const char *tag) : + snk_state(mconfig, type, tag) + { } + + void bermudat(machine_config &config) ATTR_COLD; + void chopper1(machine_config &config) ATTR_COLD; + void choppera(machine_config &config) ATTR_COLD; + void psychos(machine_config &config) ATTR_COLD; + void tdfever(machine_config &config) ATTR_COLD; + void tdfever2(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + + bool m_is_psychos = false; + uint8_t m_empty_tile[16*16]{}; + + int32_t m_tc16_posy = 0; + int32_t m_tc16_posx = 0; + int32_t m_tc32_posy = 0; + int32_t m_tc32_posx = 0; + + void gwar_tx_bank_w(uint8_t data); + void gwar_videoattrs_w(uint8_t data); + void gwara_videoattrs_w(uint8_t data); + void gwara_sp_scroll_msb_w(uint8_t data); + void tdfever_sp_scroll_msb_w(uint8_t data); + void tdfever_spriteram_w(offs_t offset, uint8_t data); + void turbocheck16_1_w(uint8_t data); + void turbocheck16_2_w(uint8_t data); + void turbocheck32_1_w(uint8_t data); + void turbocheck32_2_w(uint8_t data); + void turbocheck_msb_w(uint8_t data); + int turbofront_check(bool small, int num); + template uint8_t turbofront_check8(); + + TILE_GET_INFO_MEMBER(gwar_get_tx_tile_info); + TILE_GET_INFO_MEMBER(gwar_get_bg_tile_info); + DECLARE_VIDEO_START(gwar); + DECLARE_VIDEO_START(psychos); + DECLARE_VIDEO_START(_4bpp_shadow); + DECLARE_VIDEO_START(tdfever); + uint32_t screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, const bool hw_xflip, const int from, const int to); + + void bermudat_common_map(address_map &map) ATTR_COLD; + void bermudat_cpuA_map(address_map &map) ATTR_COLD; + void bermudat_cpuB_map(address_map &map) ATTR_COLD; + void chopper1_sound_map(address_map &map) ATTR_COLD; + void gwar_common_map(address_map &map) ATTR_COLD; + void gwar_cpuA_map(address_map &map) ATTR_COLD; + void gwar_cpuB_map(address_map &map) ATTR_COLD; + void tdfever_common_map(address_map &map) ATTR_COLD; void tdfever_cpuA_map(address_map &map) ATTR_COLD; void tdfever_cpuB_map(address_map &map) ATTR_COLD; - void tnk3_YM3526_sound_map(address_map &map) ATTR_COLD; - void tnk3_cpuA_map(address_map &map) ATTR_COLD; - void tnk3_cpuB_map(address_map &map) ATTR_COLD; + void tdfever2_sound_map(address_map &map) ATTR_COLD; +}; + +// bermudat_state with rotary joystick protection +class gwar_state : public bermudat_state +{ +public: + gwar_state(const machine_config &mconfig, device_type type, const char *tag) : + bermudat_state(mconfig, type, tag), + m_rot_io(*this, "P%uROT", 1U) + { } + + void gwar(machine_config &config) ATTR_COLD; + void gwara(machine_config &config) ATTR_COLD; + + template ioport_value gwar_rotary(); + +protected: + virtual void machine_start() override ATTR_COLD; + + required_ioport_array<2> m_rot_io; + + int32_t m_last_value[2]{}; + int32_t m_cp_count[2]{}; + + void gwara_common_map(address_map &map) ATTR_COLD; + void gwara_cpuA_map(address_map &map) ATTR_COLD; + void gwara_cpuB_map(address_map &map) ATTR_COLD; +}; + +// gwar_state bootleg with joystick mode +class gwarb_state : public gwar_state +{ +public: + gwarb_state(const machine_config &mconfig, device_type type, const char *tag) : + gwar_state(mconfig, type, tag), + m_joymode_io(*this, "JOYSTICK_MODE") + { } + + template ioport_value gwarb_rotary() ATTR_COLD; + +private: + required_ioport m_joymode_io; }; #endif // MAME_SNK_SNK_H diff --git a/src/mame/snk/snk_v.cpp b/src/mame/snk/snk_v.cpp index d2aa058b78f55..ace214f9b6f96 100644 --- a/src/mame/snk/snk_v.cpp +++ b/src/mame/snk/snk_v.cpp @@ -41,19 +41,19 @@ void snk_state::tnk3_palette(palette_device &palette) const bit1 = BIT(color_prom[i], 1); bit2 = BIT(color_prom[i], 2); bit3 = BIT(color_prom[i], 3); - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[i + 2*num_colors], 2); bit1 = BIT(color_prom[i + num_colors], 2); bit2 = BIT(color_prom[i + num_colors], 3); bit3 = BIT(color_prom[i], 0); - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; bit0 = BIT(color_prom[i + 2*num_colors], 0); bit1 = BIT(color_prom[i + 2*num_colors], 1); bit2 = BIT(color_prom[i + num_colors], 0); bit3 = BIT(color_prom[i + num_colors], 1); - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + const int b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette.set_pen_color(i, rgb_t(r, g, b)); } @@ -74,28 +74,28 @@ TILEMAP_MAPPER_MEMBER(snk_state::marvins_tx_scan_cols) TILE_GET_INFO_MEMBER(snk_state::marvins_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; - int color = code >> 5; + const int code = m_tx_videoram[tile_index]; + const int color = code >> 5; tileinfo.set(0, m_tx_tile_offset + code, color, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } -TILE_GET_INFO_MEMBER(snk_state::ikari_get_tx_tile_info) +TILE_GET_INFO_MEMBER(ikari_state::ikari_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; + const int code = m_tx_videoram[tile_index]; tileinfo.set(0, m_tx_tile_offset + code, 0, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } -TILE_GET_INFO_MEMBER(snk_state::gwar_get_tx_tile_info) +TILE_GET_INFO_MEMBER(bermudat_state::gwar_get_tx_tile_info) { - int code = m_tx_videoram[tile_index]; + const int code = m_tx_videoram[tile_index]; tileinfo.set(0, m_tx_tile_offset + code, @@ -104,9 +104,9 @@ TILE_GET_INFO_MEMBER(snk_state::gwar_get_tx_tile_info) } -TILE_GET_INFO_MEMBER(snk_state::marvins_get_fg_tile_info) +TILE_GET_INFO_MEMBER(marvins_state::marvins_get_fg_tile_info) { - int code = m_fg_videoram[tile_index]; + const int code = m_fg_videoram[tile_index]; tileinfo.set(1, code, @@ -114,9 +114,9 @@ TILE_GET_INFO_MEMBER(snk_state::marvins_get_fg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::marvins_get_bg_tile_info) +TILE_GET_INFO_MEMBER(marvins_state::marvins_get_bg_tile_info) { - int code = m_bg_videoram[tile_index]; + const int code = m_bg_videoram[tile_index]; tileinfo.set(2, code, @@ -127,7 +127,7 @@ TILE_GET_INFO_MEMBER(snk_state::marvins_get_bg_tile_info) TILE_GET_INFO_MEMBER(snk_state::aso_get_bg_tile_info) { - int code = m_bg_videoram[tile_index]; + const int code = m_bg_videoram[tile_index]; tileinfo.set(1, m_bg_tile_offset + code, @@ -137,9 +137,9 @@ TILE_GET_INFO_MEMBER(snk_state::aso_get_bg_tile_info) TILE_GET_INFO_MEMBER(snk_state::tnk3_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x30) << 4); - int color = (attr & 0xf) ^ 8; + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x30) << 4); + const int color = (attr & 0xf) ^ 8; tileinfo.set(1, code, @@ -147,11 +147,11 @@ TILE_GET_INFO_MEMBER(snk_state::tnk3_get_bg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::ikari_get_bg_tile_info) +TILE_GET_INFO_MEMBER(ikari_state::ikari_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x03) << 8); - int color = (attr & 0x70) >> 4; + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x03) << 8); + const int color = (attr & 0x70) >> 4; tileinfo.set(1, code, @@ -159,10 +159,10 @@ TILE_GET_INFO_MEMBER(snk_state::ikari_get_bg_tile_info) 0); } -TILE_GET_INFO_MEMBER(snk_state::gwar_get_bg_tile_info) +TILE_GET_INFO_MEMBER(bermudat_state::gwar_get_bg_tile_info) { - int attr = m_bg_videoram[2*tile_index+1]; - int code = m_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8); + const int attr = m_bg_videoram[2*tile_index+1]; + const int code = m_bg_videoram[2*tile_index] | ((attr & 0x0f) << 8); int color = (attr & 0xf0) >> 4; if (m_is_psychos) // psychos has a separate palette bank bit @@ -183,50 +183,58 @@ TILE_GET_INFO_MEMBER(snk_state::gwar_get_bg_tile_info) /**************************************************************************************/ -VIDEO_START_MEMBER(snk_state,snk_3bpp_shadow) +void snk_state::register_save_state() { - int i; + save_item(NAME(m_bg_scrollx)); + save_item(NAME(m_bg_scrolly)); + save_item(NAME(m_sp16_scrollx)); + save_item(NAME(m_sp16_scrolly)); + save_item(NAME(m_sp32_scrollx)); + save_item(NAME(m_sp32_scrolly)); + save_item(NAME(m_sprite_split_point)); +} - if(!(m_palette->shadows_enabled())) +VIDEO_START_MEMBER(snk_state,_3bpp_shadow) +{ + if (!(m_palette->shadows_enabled())) fatalerror("driver should use VIDEO_HAS_SHADOWS\n"); /* prepare shadow draw table */ - for(i = 0; i <= 5; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 5; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[6] = (m_palette->shadows_enabled()) ? DRAWMODE_SHADOW : DRAWMODE_SOURCE; m_drawmode_table[7] = DRAWMODE_NONE; - for (i = 0x000;i < 0x400;i++) + for (int i = 0x000;i < 0x400;i++) m_palette->shadow_table()[i] = i | 0x200; + + register_save_state(); } -VIDEO_START_MEMBER(snk_state,snk_4bpp_shadow) +VIDEO_START_MEMBER(bermudat_state,_4bpp_shadow) { - int i; - - if(!(m_palette->shadows_enabled())) + if (!(m_palette->shadows_enabled())) fatalerror("driver should use VIDEO_HAS_SHADOWS\n"); /* prepare shadow draw table */ - for(i = 0; i <= 13; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 13; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[14] = DRAWMODE_SHADOW; m_drawmode_table[15] = DRAWMODE_NONE; /* all palette entries are not affected by shadow sprites... */ - for (i = 0x000;i < 0x400;i++) + for (int i = 0x000;i < 0x400;i++) m_palette->shadow_table()[i] = i; /* ... except for tilemap colors */ - for (i = 0x200;i < 0x300;i++) + for (int i = 0x200;i < 0x300;i++) m_palette->shadow_table()[i] = i + 0x100; } - -VIDEO_START_MEMBER(snk_state,marvins) +void marvins_state::video_start() { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_fg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(marvins_state::marvins_tx_scan_cols)), 8, 8, 36, 28); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_fg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(marvins_state::marvins_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); m_tx_tilemap->set_transparent_pen(15); m_tx_tilemap->set_scrolldy(8, 8); @@ -239,11 +247,14 @@ VIDEO_START_MEMBER(snk_state,marvins) m_bg_tilemap->set_scrolldy(8, -32); m_tx_tile_offset = 0; + + save_item(NAME(m_fg_scrollx)); + save_item(NAME(m_fg_scrolly)); } VIDEO_START_MEMBER(snk_state,jcross) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::aso_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 64); @@ -262,7 +273,7 @@ VIDEO_START_MEMBER(snk_state,jcross) VIDEO_START_MEMBER(snk_state,sgladiat) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::aso_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 32); @@ -302,7 +313,7 @@ VIDEO_START_MEMBER(snk_state,aso) VIDEO_START_MEMBER(snk_state,tnk3) { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::marvins_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::tnk3_get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 64, 64); @@ -318,12 +329,12 @@ VIDEO_START_MEMBER(snk_state,tnk3) m_tx_tile_offset = 0; } -VIDEO_START_MEMBER(snk_state,ikari) +void ikari_state::video_start() { - VIDEO_START_CALL_MEMBER(snk_3bpp_shadow); + VIDEO_START_CALL_MEMBER(_3bpp_shadow); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::ikari_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(snk_state::marvins_tx_scan_cols)), 8, 8, 36, 28); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::ikari_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ikari_state::ikari_get_tx_tile_info)), tilemap_mapper_delegate(*this, FUNC(ikari_state::marvins_tx_scan_cols)), 8, 8, 36, 28); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(ikari_state::ikari_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); m_tx_tilemap->set_transparent_pen(15); m_tx_tilemap->set_scrolldy(8, 8); @@ -334,18 +345,16 @@ VIDEO_START_MEMBER(snk_state,ikari) m_tx_tile_offset = 0; } -VIDEO_START_MEMBER(snk_state,gwar) +VIDEO_START_MEMBER(bermudat_state,gwar) { - int i; - /* prepare drawmode table */ - for(i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; + for (int i = 0; i <= 14; i++) m_drawmode_table[i] = DRAWMODE_SOURCE; m_drawmode_table[15] = DRAWMODE_NONE; memset(m_empty_tile, 0xf, sizeof(m_empty_tile)); - m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::gwar_get_tx_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 50, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(snk_state::gwar_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); + m_tx_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bermudat_state::gwar_get_tx_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 50, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(bermudat_state::gwar_get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 32); m_tx_tilemap->set_transparent_pen(15); @@ -354,30 +363,32 @@ VIDEO_START_MEMBER(snk_state,gwar) m_tx_tile_offset = 0; - m_is_psychos = 0; + m_is_psychos = false; + + register_save_state(); } -VIDEO_START_MEMBER(snk_state,psychos) +VIDEO_START_MEMBER(bermudat_state,psychos) { VIDEO_START_CALL_MEMBER(gwar); - m_is_psychos = 1; + m_is_psychos = true; } -VIDEO_START_MEMBER(snk_state,tdfever) +VIDEO_START_MEMBER(bermudat_state,tdfever) { VIDEO_START_CALL_MEMBER(gwar); - VIDEO_START_CALL_MEMBER(snk_4bpp_shadow); + VIDEO_START_CALL_MEMBER(_4bpp_shadow); } /**************************************************************************************/ -void snk_state::snk_tx_videoram_w(offs_t offset, uint8_t data) +void snk_state::tx_videoram_w(offs_t offset, uint8_t data) { m_tx_videoram[offset] = data; m_tx_tilemap->mark_tile_dirty(offset); } -void snk_state::marvins_fg_videoram_w(offs_t offset, uint8_t data) +void marvins_state::marvins_fg_videoram_w(offs_t offset, uint8_t data) { m_fg_videoram[offset] = data; m_fg_tilemap->mark_tile_dirty(offset); @@ -389,75 +400,75 @@ void snk_state::marvins_bg_videoram_w(offs_t offset, uint8_t data) m_bg_tilemap->mark_tile_dirty(offset); } -void snk_state::snk_bg_videoram_w(offs_t offset, uint8_t data) +void snk_state::bg_videoram_w(offs_t offset, uint8_t data) { m_bg_videoram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset >> 1); } -void snk_state::snk_fg_scrollx_w(uint8_t data) +void marvins_state::fg_scrollx_w(uint8_t data) { m_fg_scrollx = (m_fg_scrollx & ~0xff) | data; } -void snk_state::snk_fg_scrolly_w(uint8_t data) +void marvins_state::fg_scrolly_w(uint8_t data) { m_fg_scrolly = (m_fg_scrolly & ~0xff) | data; } -void snk_state::snk_bg_scrollx_w(uint8_t data) +void snk_state::bg_scrollx_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & ~0xff) | data; } -void snk_state::snk_bg_scrolly_w(uint8_t data) +void snk_state::bg_scrolly_w(uint8_t data) { m_bg_scrolly = (m_bg_scrolly & ~0xff) | data; } -void snk_state::snk_sp16_scrollx_w(uint8_t data) +void snk_state::sp16_scrollx_w(uint8_t data) { m_sp16_scrollx = (m_sp16_scrollx & ~0xff) | data; } -void snk_state::snk_sp16_scrolly_w(uint8_t data) +void snk_state::sp16_scrolly_w(uint8_t data) { m_sp16_scrolly = (m_sp16_scrolly & ~0xff) | data; } -void snk_state::snk_sp32_scrollx_w(uint8_t data) +void snk_state::sp32_scrollx_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & ~0xff) | data; } -void snk_state::snk_sp32_scrolly_w(uint8_t data) +void snk_state::sp32_scrolly_w(uint8_t data) { m_sp32_scrolly = (m_sp32_scrolly & ~0xff) | data; } -void snk_state::snk_sprite_split_point_w(uint8_t data) +void snk_state::sprite_split_point_w(uint8_t data) { m_sprite_split_point = data; } -void snk_state::marvins_palette_bank_w(uint8_t data) +void marvins_state::marvins_palette_bank_w(uint8_t data) { m_bg_tilemap->set_palette_offset(data & 0x70); m_fg_tilemap->set_palette_offset((data & 0x07) << 4); } -void snk_state::marvins_flipscreen_w(uint8_t data) +void marvins_state::marvins_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); // other bits unknown } void snk_state::sgladiat_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); @@ -466,7 +477,7 @@ void snk_state::sgladiat_flipscreen_w(uint8_t data) void snk_state::hal21_flipscreen_w(uint8_t data) { - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); m_bg_tilemap->set_palette_offset(((data & 0xf) ^ 8) << 4); if (m_bg_tile_offset != ((data & 0x20) << 3)) @@ -478,7 +489,7 @@ void snk_state::hal21_flipscreen_w(uint8_t data) // other bits unknown } -void snk_state::marvins_scroll_msb_w(uint8_t data) +void marvins_state::marvins_scroll_msb_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x04) << 6); m_fg_scrollx = (m_fg_scrollx & 0xff) | ((data & 0x02) << 7); @@ -514,7 +525,7 @@ void snk_state::aso_videoattrs_w(uint8_t data) */ - flip_screen_set(data & 0x20); + flip_screen_set(BIT(data, 5)); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x10) << 4); m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x08) << 5); @@ -537,7 +548,7 @@ void snk_state::tnk3_videoattrs_w(uint8_t data) */ - flip_screen_set(data & 0x80); + flip_screen_set(BIT(data, 7)); if (m_tx_tile_offset != ((data & 0x40) << 2)) { @@ -561,13 +572,13 @@ void snk_state::aso_bg_bank_w(uint8_t data) } } -void snk_state::ikari_bg_scroll_msb_w(uint8_t data) +void ikari_state::ikari_bg_scroll_msb_w(uint8_t data) { m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x02) << 7); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::ikari_sp_scroll_msb_w(uint8_t data) +void ikari_state::ikari_sp_scroll_msb_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x20) << 3); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x10) << 4); @@ -575,7 +586,7 @@ void snk_state::ikari_sp_scroll_msb_w(uint8_t data) m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x04) << 6); } -void snk_state::ikari_unknown_video_w(uint8_t data) +void ikari_state::ikari_unknown_video_w(uint8_t data) { /* meaning of 0xc980 uncertain. Normally 0x20, ikaria/ikarijp sets it to 0x31 during test mode. @@ -597,7 +608,7 @@ void snk_state::ikari_unknown_video_w(uint8_t data) } } -void snk_state::gwar_tx_bank_w(uint8_t data) +void bermudat_state::gwar_tx_bank_w(uint8_t data) { m_tx_tilemap->set_palette_offset((data & 0xf) << 4); if (m_tx_tile_offset != ((data & 0x30) << 4)) @@ -610,9 +621,9 @@ void snk_state::gwar_tx_bank_w(uint8_t data) m_bg_tilemap->set_palette_offset((data & 0x80)); } -void snk_state::gwar_videoattrs_w(uint8_t data) +void bermudat_state::gwar_videoattrs_w(uint8_t data) { - flip_screen_set(data & 0x04); + flip_screen_set(BIT(data, 2)); m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x80) << 1); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x40) << 2); @@ -622,15 +633,15 @@ void snk_state::gwar_videoattrs_w(uint8_t data) m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::gwara_videoattrs_w(uint8_t data) +void bermudat_state::gwara_videoattrs_w(uint8_t data) { - flip_screen_set(data & 0x10); + flip_screen_set(BIT(data, 4)); m_bg_scrollx = (m_bg_scrollx & 0xff) | ((data & 0x02) << 7); m_bg_scrolly = (m_bg_scrolly & 0xff) | ((data & 0x01) << 8); } -void snk_state::gwara_sp_scroll_msb_w(uint8_t data) +void bermudat_state::gwara_sp_scroll_msb_w(uint8_t data) { m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x20) << 3); m_sp16_scrollx = (m_sp16_scrollx & 0xff) | ((data & 0x10) << 4); @@ -638,18 +649,18 @@ void snk_state::gwara_sp_scroll_msb_w(uint8_t data) m_sp16_scrolly = (m_sp16_scrolly & 0xff) | ((data & 0x04) << 6); } -void snk_state::tdfever_sp_scroll_msb_w(uint8_t data) +void bermudat_state::tdfever_sp_scroll_msb_w(uint8_t data) { m_sp32_scrolly = (m_sp32_scrolly & 0xff) | ((data & 0x80) << 1); m_sp32_scrollx = (m_sp32_scrollx & 0xff) | ((data & 0x40) << 2); } -void snk_state::tdfever_spriteram_w(offs_t offset, uint8_t data) +void bermudat_state::tdfever_spriteram_w(offs_t offset, uint8_t data) { /* partial updates avoid flickers in the fsoccer radar. */ if (offset < 0x80 && m_spriteram[offset] != data) { - int vpos = m_screen->vpos(); + const int vpos = m_screen->vpos(); if (vpos > 0) m_screen->update_partial(vpos - 1); @@ -660,23 +671,28 @@ void snk_state::tdfever_spriteram_w(offs_t offset, uint8_t data) /**************************************************************************************/ -void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int scrollx, const int scrolly, const int from, const int to) +void marvins_state::marvins_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int scrollx, + const int scrolly, + const int from, + const int to) { - gfx_element *gfx = m_gfxdecode->gfx(3); - const uint8_t *source, *finish; + gfx_element *const gfx = m_gfxdecode->gfx(3); - source = m_spriteram + from*4; - finish = m_spriteram + to*4; + const uint8_t *source = m_spriteram + from * 4; + const uint8_t *finish = m_spriteram + to * 4; - while( source 512-16) sx -= 512; - if (sy > 256-16) sy -= 256; + if (sx > 512 - 16) sx -= 512; + if (sy > 256 - 16) sy -= 256; gfx->transtable(bitmap,cliprect, tile_number, @@ -698,19 +714,15 @@ void snk_state::marvins_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip sx, sy, m_drawmode_table); - source+=4; + source += 4; } } void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll) { - uint8_t *spriteram = m_spriteram; - gfx_element *gfx = m_gfxdecode->gfx(2); + gfx_element *const gfx = m_gfxdecode->gfx(2); const int size = gfx->width(); - int tile_number, attributes, color, sx, sy; - int xflip,yflip; - int offs; /* jcross and sgladiat have only 25 sprites, the others 50 */ @@ -718,17 +730,17 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec /* sgladiat and tnk3 have 512 tiles, bit 6 is bank and bit 5 is y-flip */ /* athena has 1024 tiles, bit 6 and bit 5 are bank */ - for (offs = 0; offs < m_num_sprites*4; offs += 4) + for (int offs = 0; offs < m_num_sprites * 4; offs += 4) { - tile_number = spriteram[offs+1]; - attributes = spriteram[offs+3]; - color = attributes & 0xf; - sx = xscroll + 301 - size - spriteram[offs+2]; - sy = -yscroll + 7 - size + spriteram[offs]; + uint32_t tile_number = m_spriteram[offs + 1]; + const uint8_t attributes = m_spriteram[offs + 3]; + const uint32_t color = attributes & 0xf; + int sx = xscroll + 301 - size - m_spriteram[offs + 2]; + int sy = -yscroll + 7 - size + m_spriteram[offs]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; - xflip = 0; - yflip = 0; + bool xflip = false; + bool yflip = false; if (gfx->elements() > 256) // all except jcross { @@ -741,7 +753,7 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } else // all others { - yflip = attributes & 0x20; + yflip = BIT(attributes, 5); } if (flip_screen()) @@ -754,8 +766,8 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec sx &= 0x1ff; sy &= m_yscroll_mask; // sgladiat apparently has only 256 pixels of vertical scrolling range - if (sx > 512-size) sx -= 512; - if (sy > (m_yscroll_mask+1)-size) sy -= (m_yscroll_mask+1); + if (sx > 512 - size) sx -= 512; + if (sy > (m_yscroll_mask + 1) - size) sy -= (m_yscroll_mask + 1); gfx->transtable(bitmap,cliprect, tile_number, @@ -767,22 +779,27 @@ void snk_state::tnk3_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec } -void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int start, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum ) +void ikari_state::ikari_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int start, + const int xscroll, + const int yscroll, + const uint8_t *source, + const int gfxnum) { - gfx_element *gfx = m_gfxdecode->gfx(gfxnum); + gfx_element *const gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); - int tile_number, attributes, color, sx, sy; - int which, finish; - finish = (start+25)*4; + const int finish = (start + 25) * 4; - for (which = start*4; which < finish; which += 4) + for (int which = start * 4; which < finish; which += 4) { - tile_number = source[which+1]; - attributes = source[which+3]; - color = attributes & 0xf; - sx = xscroll + 300 - size - source[which+2]; - sy = -yscroll + 7 - size + source[which]; + uint32_t tile_number = source[which + 1]; + const uint8_t attributes = source[which + 3]; + const uint32_t color = attributes & 0xf; + int sx = xscroll + 300 - size - source[which + 2]; + int sy = -yscroll + 7 - size + source[which]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; @@ -799,8 +816,8 @@ void snk_state::ikari_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clipre sx &= 0x1ff; sy &= 0x1ff; - if (sx > 512-size) sx -= 512; - if (sy > 512-size) sy -= 512; + if (sx > 512 - size) sx -= 512; + if (sy > 512 - size) sy -= 512; gfx->transtable(bitmap,cliprect, tile_number, @@ -837,22 +854,27 @@ byte3: attributes -xx-x--- (bank number) x------- (x offset bit8) */ -void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, const int xscroll, const int yscroll, const uint8_t *source, const int gfxnum, - const int hw_xflip, const int from, const int to) -{ - gfx_element *gfx = m_gfxdecode->gfx(gfxnum); +void bermudat_state::tdfever_draw_sprites( + bitmap_ind16 &bitmap, + const rectangle &cliprect, + const int xscroll, + const int yscroll, + const uint8_t *source, + const int gfxnum, + const bool hw_xflip, + const int from, + const int to) +{ + gfx_element *const gfx = m_gfxdecode->gfx(gfxnum); const int size = gfx->width(); - int tile_number, attributes, sx, sy, color; - int which; - int flipx, flipy; - for(which = from*4; which < to*4; which+=4) + for (int which = from * 4; which < to * 4; which += 4) { - tile_number = source[which+1]; - attributes = source[which+3]; - color = attributes & 0x0f; - sx = -xscroll - 9 + source[which+2]; - sy = -yscroll + 1 - size + source[which]; + uint32_t tile_number = source[which+1]; + const uint8_t attributes = source[which+3]; + uint32_t color = attributes & 0x0f; + int sx = -xscroll - 9 + source[which+2]; + int sy = -yscroll + 1 - size + source[which]; sx += (attributes & 0x80) << 1; sy += (attributes & 0x10) << 4; @@ -870,8 +892,8 @@ void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip break; } - flipx = hw_xflip; - flipy = 0; + bool flipx = hw_xflip; + bool flipy = false; if (hw_xflip) sx = 495 - size - sx; @@ -900,7 +922,7 @@ void snk_state::tdfever_draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip /**************************************************************/ -uint32_t snk_state::screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t marvins_state::screen_update_marvins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); @@ -935,15 +957,14 @@ uint32_t snk_state::screen_update_fitegolf2(screen_device &screen, bitmap_ind16 m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tnk3_draw_sprites(bitmap, cliprect, m_sp16_scrollx+1, m_sp16_scrolly); // needs an extra offset?? neither this or fitegolf actually write to sprite offset registers tho? + tnk3_draw_sprites(bitmap, cliprect, m_sp16_scrollx + 1, m_sp16_scrolly); // needs an extra offset?? neither this or fitegolf actually write to sprite offset registers tho? m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); return 0; } - -uint32_t snk_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t ikari_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); @@ -959,16 +980,16 @@ uint32_t snk_state::screen_update_ikari(screen_device &screen, bitmap_ind16 &bit } -uint32_t snk_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bermudat_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, 0, m_sprite_split_point ); - tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, 0, 0, 32 ); - tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, 0, m_sprite_split_point, 64 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, false, 0, m_sprite_split_point ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 3, false, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp16_scrollx, m_sp16_scrolly, m_spriteram + 0x800, 2, false, m_sprite_split_point, 64 ); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -976,14 +997,14 @@ uint32_t snk_state::screen_update_gwar(screen_device &screen, bitmap_ind16 &bitm } -uint32_t snk_state::screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t bermudat_state::screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_bg_scrollx); m_bg_tilemap->set_scrolly(0, m_bg_scrolly); m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, 1, 0, 32 ); + tdfever_draw_sprites(bitmap, cliprect, m_sp32_scrollx, m_sp32_scrolly, m_spriteram, 2, true, 0, 32); m_tx_tilemap->draw(screen, bitmap, cliprect, 0, 0); From a90981be5f678b5e6339ddb13586449748cda41b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 6 Mar 2025 01:35:43 +1100 Subject: [PATCH 093/272] snk/snk.cpp: Fix build; igs/igs_m027.cpp: Added note about tct2p inputs. --- src/mame/igs/igs_m027.cpp | 1 + src/mame/snk/snk.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 243def19386fd..6997c01e860f3 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -749,6 +749,7 @@ INPUT_PORTS_START( jking02 ) INPUT_PORTS_END INPUT_PORTS_START( tct2p ) + // uses the kan/pon/chi/reach/ron buttons as the main controls in mahjong panel mode IGS_MAHJONG_MATRIX_CONDITIONAL("DSW2", 0x01, 0x00) PORT_START("PORTB") diff --git a/src/mame/snk/snk.cpp b/src/mame/snk/snk.cpp index c0dd831684304..b9ed04fb0dc73 100644 --- a/src/mame/snk/snk.cpp +++ b/src/mame/snk/snk.cpp @@ -1104,14 +1104,14 @@ template uint8_t bermudat_state::turbofront_check8() { return - (turbofront_check(Small, (num * 8) + 0) << 0) | - (turbofront_check(Small, (num * 8) + 1) << 1) | - (turbofront_check(Small, (num * 8) + 2) << 2) | - (turbofront_check(Small, (num * 8) + 3) << 3) | - (turbofront_check(Small, (num * 8) + 4) << 4) | - (turbofront_check(Small, (num * 8) + 5) << 5) | - (turbofront_check(Small, (num * 8) + 6) << 6) | - (turbofront_check(Small, (num * 8) + 7) << 7); + (turbofront_check(Small, (Num * 8) + 0) << 0) | + (turbofront_check(Small, (Num * 8) + 1) << 1) | + (turbofront_check(Small, (Num * 8) + 2) << 2) | + (turbofront_check(Small, (Num * 8) + 3) << 3) | + (turbofront_check(Small, (Num * 8) + 4) << 4) | + (turbofront_check(Small, (Num * 8) + 5) << 5) | + (turbofront_check(Small, (Num * 8) + 6) << 6) | + (turbofront_check(Small, (Num * 8) + 7) << 7); } From 4d7370bcbcc99129ae09ecfaa1d06592597cfc6b Mon Sep 17 00:00:00 2001 From: cam900 Date: Wed, 5 Mar 2025 23:55:53 +0900 Subject: [PATCH 094/272] snk/mainsnk.cpp: Suppress side effects for debugger reads and cleaned up code. (#13445) Cleaned up graphics decoding layouts, use bit helpers, made some variables const. --- src/mame/snk/mainsnk.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mame/snk/mainsnk.cpp b/src/mame/snk/mainsnk.cpp index 28869f35f65d2..bd4d27540b2b2 100644 --- a/src/mame/snk/mainsnk.cpp +++ b/src/mame/snk/mainsnk.cpp @@ -138,7 +138,7 @@ class mainsnk_state : public driver_device m_fgram(*this, "fgram") { } - void mainsnk(machine_config &config); + void mainsnk(machine_config &config) ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -213,7 +213,7 @@ TILEMAP_MAPPER_MEMBER(mainsnk_state::tx_scan_cols) // tilemap is 36x28, the central part is from the first RAM page and the // extra 4 columns are from the second page col -= 2; - if (col & 0x20) + if (BIT(col, 5)) return 0x400 + row + ((col & 0x1f) << 5); else return row + (col << 5); @@ -221,17 +221,17 @@ TILEMAP_MAPPER_MEMBER(mainsnk_state::tx_scan_cols) TILE_GET_INFO_MEMBER(mainsnk_state::get_tx_tile_info) { - int code = m_fgram[tile_index]; + int const code = m_fgram[tile_index]; tileinfo.set(0, code, 0, - tile_index & 0x400 ? TILE_FORCE_LAYER0 : 0); + BIT(tile_index, 10) ? TILE_FORCE_LAYER0 : 0); } TILE_GET_INFO_MEMBER(mainsnk_state::get_bg_tile_info) { - int code = (m_bgram[tile_index]); + int const code = (m_bgram[tile_index]); tileinfo.set(0, m_bg_tile_offset + code, @@ -257,7 +257,7 @@ void mainsnk_state::video_start() void mainsnk_state::c600_w(uint8_t data) { - int total_elements = m_gfxdecode->gfx(0)->elements(); + int const total_elements = m_gfxdecode->gfx(0)->elements(); flip_screen_set(BIT(data, 7)); @@ -299,13 +299,13 @@ void mainsnk_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect while (source < finish) { - int attributes = source[3]; + int const attributes = source[3]; int tile_number = source[1]; int sy = source[0]; int sx = source[2]; - int color = attributes & 0xf; - int flipx = 0; - int flipy = 0; + int const color = attributes & 0xf; + bool flipx = false; + bool flipy = false; if (sy > 240) sy -= 256; tile_number |= attributes << 4 & 0x300; @@ -344,7 +344,8 @@ uint32_t mainsnk_state::screen_update(screen_device &screen, bitmap_ind16 &bitma uint8_t mainsnk_state::sound_ack_r() { - m_audiocpu->set_input_line(0, CLEAR_LINE); + if (!machine().side_effects_disabled()) + m_audiocpu->set_input_line(0, CLEAR_LINE); return 0xff; } @@ -573,9 +574,8 @@ static const gfx_layout sprite_layout = RGN_FRAC(1,3), 3, { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, - { 7,6,5,4,3,2,1,0, 15,14,13,12,11,10,9,8 }, - { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, - 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, + { STEP8(7,-1), STEP8(15,-1) }, + { STEP16(0,16) }, 256 }; From 32a2633ba75c3df56baa475f684a995bc910f6e6 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 4 Mar 2025 20:10:54 +0100 Subject: [PATCH 095/272] 6525tpi: clear latches on write to portc in interrupt mode --- src/devices/machine/6525tpi.cpp | 28 +++++++++++----------------- src/devices/machine/6525tpi.h | 4 ---- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/src/devices/machine/6525tpi.cpp b/src/devices/machine/6525tpi.cpp index cffb9ba5f50be..addebf837b1da 100644 --- a/src/devices/machine/6525tpi.cpp +++ b/src/devices/machine/6525tpi.cpp @@ -476,7 +476,18 @@ void tpi6525_device::write(offs_t offset, uint8_t data) m_port_c = data; if (!INTERRUPT_MODE) + { m_out_pc_cb((offs_t)0, (m_port_c & m_ddr_c) | (m_ddr_c ^ 0xff)); + } + else + { + // clear latches + if (BIT(data, 0) == 0) m_irq_level[0] = 1; + if (BIT(data, 1) == 0) m_irq_level[1] = 1; + if (BIT(data, 2) == 0) m_irq_level[2] = 1; + if (BIT(data, 3) == 0) m_irq_level[3] = INTERRUPT3_RISING_EDGE ? 0 : 1; + if (BIT(data, 4) == 0) m_irq_level[4] = INTERRUPT4_RISING_EDGE ? 0 : 1; + } break; case 3: @@ -532,20 +543,3 @@ void tpi6525_device::port_line_w(uint8_t &port, int line, int state) port &= ~(1 << line); port |= state << line; } - -/* this should probably be done better, needed for amigacd.c */ - -uint8_t tpi6525_device::get_ddr_a() -{ - return m_ddr_a; -} - -uint8_t tpi6525_device::get_ddr_b() -{ - return m_ddr_b; -} - -uint8_t tpi6525_device::get_ddr_c() -{ - return m_ddr_c; -} diff --git a/src/devices/machine/6525tpi.h b/src/devices/machine/6525tpi.h index 9aefd8a4a2a1d..c2487bde39b12 100644 --- a/src/devices/machine/6525tpi.h +++ b/src/devices/machine/6525tpi.h @@ -78,10 +78,6 @@ class tpi6525_device : public device_t void pb6_w(int state) { port_line_w(m_in_b, 6, state); } void pb7_w(int state) { port_line_w(m_in_b, 7, state); } - uint8_t get_ddr_a(); - uint8_t get_ddr_b(); - uint8_t get_ddr_c(); - protected: // device-level overrides virtual void device_start() override ATTR_COLD; From 48b7920613cf7200f6e1ed356d6a37daea995f16 Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Wed, 5 Mar 2025 17:39:29 +0100 Subject: [PATCH 096/272] amiga: CDTV CD-ROM support - CDTV can boot from CD and play audio discs - Alternatively use the A570 expansion for the A500 --- src/devices/bus/amiga/cpuslot/a570.cpp | 64 ++- src/devices/bus/amiga/cpuslot/a570.h | 14 + src/devices/machine/cr511b.cpp | 753 +++++++++++++++++++++++-- src/devices/machine/cr511b.h | 135 +++-- src/devices/machine/dmac.cpp | 25 +- src/devices/machine/dmac.h | 8 +- src/mame/amiga/amiga.cpp | 124 ++-- 7 files changed, 965 insertions(+), 158 deletions(-) diff --git a/src/devices/bus/amiga/cpuslot/a570.cpp b/src/devices/bus/amiga/cpuslot/a570.cpp index 7689125ee9c3b..4e13400458096 100644 --- a/src/devices/bus/amiga/cpuslot/a570.cpp +++ b/src/devices/bus/amiga/cpuslot/a570.cpp @@ -12,14 +12,17 @@ - ROM label for the A690: "391298-01 V1.0 Copyright ©1991 CBM C480" - The ROM P/N 391298-01 seems to have been used for multiple versions - There are expansion slots for a 2 MB RAM expansion and a SCSI module + - Uses the CR-512-B drive from MKE (Matsushita Kotobuki Electronics) + - An FPGA is used in place of many discrete logic chips of the CDTV TODO: - - DMAC/CD-ROM drive hookup (needs DMAC rev 2) + - Volume control (LC7883M) ***************************************************************************/ #include "emu.h" #include "a570.h" +#include "speaker.h" #define VERBOSE (LOG_GENERAL) @@ -37,7 +40,10 @@ namespace bus::amiga::cpuslot { a570_device::a570_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, AMIGA_CPUSLOT_A570, tag, owner, clock), device_amiga_cpuslot_interface(mconfig, *this), + m_irq(*this, "irq"), m_dmac(*this, "dmac"), + m_tpi(*this, "tpi"), + m_drive(*this, "drive"), m_config(*this, "config") { } @@ -94,12 +100,39 @@ const tiny_rom_entry *a570_device::device_rom_region() const void a570_device::device_add_mconfig(machine_config &config) { + INPUT_MERGER_ANY_HIGH(config, m_irq); + m_irq->output_handler().set([this] (int state) { m_host->int2_w(state); }); + AMIGA_DMAC_REV2(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M m_dmac->cfgout_cb().set([this] (int state) { m_host->cfgout_w(state); }); - m_dmac->int_cb().set([this] (int state) { m_host->int2_w(state); }); + m_dmac->int_cb().set(m_irq, FUNC(input_merger_any_high_device::in_w<0>)); + m_dmac->csx0_read_cb().set(m_drive, FUNC(cr511b_device::read)); + m_dmac->csx0_write_cb().set(m_drive, FUNC(cr511b_device::write)); + m_dmac->csx0_a4_read_cb().set(m_tpi, FUNC(tpi6525_device::read)); + m_dmac->csx0_a4_write_cb().set(m_tpi, FUNC(tpi6525_device::write)); + m_dmac->xdack_read_cb().set(m_drive, FUNC(cr511b_device::read)); AT28C16(config, "nvram0", 0); AT28C16(config, "nvram1", 0); + + TPI6525(config, m_tpi, 0); + m_tpi->out_irq_cb().set(m_irq, FUNC(input_merger_any_high_device::in_w<1>)); + m_tpi->out_pb_cb().set(FUNC(a570_device::tpi_portb_w)); + + CR511B(config, m_drive, 0); + m_drive->add_route(0, "lspeaker", 1.0); + m_drive->add_route(1, "rspeaker", 1.0); + m_drive->scor_cb().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); + m_drive->stch_cb().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); + m_drive->sten_cb().set(m_tpi, FUNC(tpi6525_device::i3_w)); + m_drive->sten_cb().append(FUNC(a570_device::sten_w)); + m_drive->drq_cb().set(m_tpi, FUNC(tpi6525_device::i4_w)); + m_drive->drq_cb().append(FUNC(a570_device::drq_w)); + + SPEAKER(config, "lspeaker").front_left(); + SPEAKER(config, "rspeaker").front_right(); + + // TODO: Add stereo input for Amiga sound } @@ -118,6 +151,33 @@ void a570_device::device_start() // register for save states save_pointer(NAME(m_ram), 0x200000/2); + save_item(NAME(m_sten)); +} + +void a570_device::sten_w(int state) +{ + m_sten = bool(state); +} + +void a570_device::drq_w(int state) +{ + if (m_sten) + m_dmac->xdreq_w(state); +} + +void a570_device::tpi_portb_w(uint8_t data) +{ + // 7------- daclch (lc7883m) + // -6------ dacst (lc7883m) + // --5----- dacatt (lc7883m) + // ---4---- weprom + // ----3--- dten (drive) + // -----2-- xaen (drive) + // ------1- enable (drive) + // -------0 cmd (drive) + + m_drive->enable_w(BIT(data, 1)); + m_drive->cmd_w(BIT(data, 0)); } // the dmac handles this diff --git a/src/devices/bus/amiga/cpuslot/a570.h b/src/devices/bus/amiga/cpuslot/a570.h index 09ce1a188449c..63d97b7703f08 100644 --- a/src/devices/bus/amiga/cpuslot/a570.h +++ b/src/devices/bus/amiga/cpuslot/a570.h @@ -14,8 +14,12 @@ #pragma once #include "cpuslot.h" +#include "machine/6525tpi.h" #include "machine/at28c16.h" +#include "machine/cr511b.h" #include "machine/dmac.h" +#include "machine/input_merger.h" + namespace bus::amiga::cpuslot { @@ -38,9 +42,19 @@ class a570_device : public device_t, public device_amiga_cpuslot_interface private: void map(address_map &map) ATTR_COLD; + void sten_w(int state); + void drq_w(int state); + + void tpi_portb_w(uint8_t data); + + required_device m_irq; required_device m_dmac; + required_device m_tpi; + required_device m_drive; required_ioport m_config; + bool m_sten; + std::unique_ptr m_ram; }; diff --git a/src/devices/machine/cr511b.cpp b/src/devices/machine/cr511b.cpp index 3ac800c1db727..dc3fa967ba528 100644 --- a/src/devices/machine/cr511b.cpp +++ b/src/devices/machine/cr511b.cpp @@ -1,97 +1,764 @@ -// license:BSD-3-Clause -// copyright-holders:Dirk Best +// license: BSD-3-Clause +// copyright-holders: Dirk Best /*************************************************************************** CR-511-B CD-ROM drive CD-ROM drive with a custom MKE/Panasonic interface as used in the - Commodore CDTV and early SoundBlaster cards. + Commodore CDTV. Similar to the interface on early SoundBlaster cards. + + Hardware: + - MN188161REB1 + - M50423FP + - 4464S-08LL + - LC8951 + + TODO: + - Subcode P-W data + - Timing for status data or status change ***************************************************************************/ #include "emu.h" #include "cr511b.h" +#define LOG_CMD (1 << 1) +#define LOG_PARAM (1 << 2) +#define LOG_DATA (1 << 3) +#define LOG_SUBQ (1 << 4) +#define LOG_SUBQ2 (1 << 5) // log subq data to popmessage + +#define VERBOSE (LOG_GENERAL | LOG_CMD | LOG_PARAM) + +#define LOGPARAM LOGMASKED(LOG_PARAM, "-> Param: %02x %02x %02x %02x %02x %02x\n", \ + m_input_fifo[1], m_input_fifo[2], m_input_fifo[3], \ + m_input_fifo[4], m_input_fifo[5], m_input_fifo[6]) + +#include "logmacro.h" + //************************************************************************** -// DEVICE DEFINITIONS +// TYPE DEFINITIONS //************************************************************************** DEFINE_DEVICE_TYPE(CR511B, cr511b_device, "cr511b", "CR-511-B CD-ROM drive") -//------------------------------------------------- -// device_add_mconfig - add device configuration -//------------------------------------------------- +cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + cdrom_image_device(mconfig, CR511B, tag, owner, clock), + device_mixer_interface(mconfig, *this, 2), + m_cdda(*this, "cdda"), + m_stch_cb(*this), + m_sten_cb(*this), + m_drq_cb(*this), + m_dten_cb(*this), + m_scor_cb(*this), + m_input_fifo_pos(0), + m_output_fifo_pos(0), + m_output_fifo_length(0), + m_status(0), + m_enabled(false), + m_cmd(false), + m_status_ready(false), + m_data_ready(false) +{ + set_interface("cdrom"); +} + + +//************************************************************************** +// MACHINE DEFINITIONS +//************************************************************************** void cr511b_device::device_add_mconfig(machine_config &config) { - CDROM(config, m_cdrom).set_interface("cdrom"); CDDA(config, m_cdda); - m_cdda->add_route(0, ":lspeaker", 1.0); - m_cdda->add_route(1, ":rspeaker", 1.0); - m_cdda->set_cdrom_tag("cdrom"); + m_cdda->add_route(0, DEVICE_SELF, 1.0, AUTO_ALLOC_INPUT, 0); + m_cdda->add_route(1, DEVICE_SELF, 1.0, AUTO_ALLOC_INPUT, 1); + m_cdda->set_cdrom_tag(*this); + m_cdda->audio_end_cb().set(FUNC(cr511b_device::audio_end_cb)); } //************************************************************************** -// LIVE DEVICE +// MACHINE EMULATION //************************************************************************** -//------------------------------------------------- -// cr511b_device - constructor -//------------------------------------------------- +void cr511b_device::device_start() +{ + cdrom_image_device::device_start(); -cr511b_device::cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, CR511B, tag, owner, clock), - m_cdrom(*this, "cdrom"), - m_cdda(*this, "cdda"), - m_stch_handler(*this), - m_sten_handler(*this), - m_drq_handler(*this), - m_dten_handler(*this), - m_scor_handler(*this), - m_xaen_handler(*this), - //m_motor(false), - m_enabled(-1), - m_cmd(-1) + m_frame_timer = timer_alloc(FUNC(cr511b_device::frame_cb), this); + m_stch_timer = timer_alloc(FUNC(cr511b_device::stch), this); + m_sten_timer = timer_alloc(FUNC(cr511b_device::sten), this); + + std::fill(std::begin(m_input_fifo), std::end(m_input_fifo), 0x00); + std::fill(std::begin(m_output_fifo), std::end(m_output_fifo), 0x00); + + // register for save states + save_item(NAME(m_input_fifo)); + save_item(NAME(m_input_fifo_pos)); + save_item(NAME(m_output_fifo)); + save_item(NAME(m_output_fifo_pos)); + save_item(NAME(m_output_fifo_length)); + save_item(NAME(m_status)); + save_item(NAME(m_sector_size)); + save_item(NAME(m_transfer_lba)); + save_item(NAME(m_transfer_sectors)); + save_item(NAME(m_transfer_length)); + save_item(NAME(m_transfer_buffer)); + save_item(NAME(m_transfer_buffer_pos)); + save_item(NAME(m_enabled)); + save_item(NAME(m_cmd)); + save_item(NAME(m_status_ready)); + save_item(NAME(m_data_ready)); +} + +void cr511b_device::device_reset() { + cdrom_image_device::device_reset(); + + m_input_fifo_pos = 0; + m_output_fifo_pos = 0; + m_output_fifo_length = 0; + + m_status_ready = false; + m_data_ready = false; + + m_status = STATUS_READY; + + if (exists()) + m_status |= STATUS_MEDIA; + + m_sten_cb(1); + m_stch_cb(0); } -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- +std::pair cr511b_device::call_load() +{ + auto ret = cdrom_image_device::call_load(); -void cr511b_device::device_start() + if (!ret.first) + status_change(m_status | STATUS_MEDIA); + + return ret; +} + +void cr511b_device::call_unload() { + status_change(STATUS_READY); + + cdrom_image_device::call_unload(); } -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- +uint32_t cr511b_device::lba_to_msf(int32_t lba) +{ + uint32_t msf = 0; + + lba += 2 * 75; // lba 0 is equivalent to msf 00:02:00 -void cr511b_device::device_reset() + msf |= ((lba / (60 * 75)) & 0xff) << 16; + msf |= (((lba / 75) % 60) & 0xff) << 8; + msf |= ((lba % 75) & 0xff) << 0; + + return msf; +} + +int32_t cr511b_device::msf_to_lba(uint32_t msf) { + uint32_t lba = 0; + + lba += ((msf >> 16) & 0xff) * 60 * 75; + lba += ((msf >> 8) & 0xff) * 75; + lba += ((msf >> 0) & 0xff); + + lba -= 2 * 75; // msf 00:02:00 is equivalent to lba 0 + + return lba; } -//************************************************************************** -// IMPLEMENTATION -//************************************************************************** +int cr511b_device::size_to_track_type() +{ + switch (m_sector_size) + { + case 2048: return cdrom_file::CD_TRACK_MODE1; + } + + // have only seen 2048 so far + fatalerror("Unknown sector mode: %d\n", m_sector_size); +} + +TIMER_CALLBACK_MEMBER(cr511b_device::frame_cb) +{ + if (m_transfer_sectors > 0) + { + // old data hasn't been read completely yet + if (m_data_ready) + return; + + LOGMASKED(LOG_DATA, "Reading sector: %d\n", m_transfer_lba); + + read_data(m_transfer_lba, m_transfer_buffer, size_to_track_type()); + + // prepare for next sector + m_transfer_lba++; + m_transfer_sectors--; + m_transfer_buffer_pos = 0; + + // signal that we have data + m_data_ready = true; + m_drq_cb(1); + } + else if (m_status & STATUS_PLAYING) + { + // TODO: subcode handling + m_scor_cb(0); + m_scor_cb(1); + } +} + +TIMER_CALLBACK_MEMBER(cr511b_device::stch) +{ + m_stch_cb(1); + m_stch_cb(0); +} + +void cr511b_device::status_change(uint8_t status) +{ + if (m_status != status) + { + m_status = status; + + if (m_status & STATUS_MOTOR) + m_frame_timer->adjust(attotime::from_hz(75), 0, attotime::from_hz(75)); + else + m_frame_timer->adjust(attotime::never); + + m_stch_timer->adjust(attotime::from_usec(64 * 3)); // TODO + } +} + +TIMER_CALLBACK_MEMBER(cr511b_device::sten) +{ + m_status_ready = true; + + m_sten_cb(0); + m_sten_cb(1); +} + +void cr511b_device::status_enable(uint8_t output_length) +{ + m_input_fifo_pos = 0; + m_output_fifo_pos = 0; + m_output_fifo_length = output_length; + + // do we have status data to send? + if (m_output_fifo_length > 0) + { + if (m_input_fifo[0] != 0x87 || (VERBOSE & LOG_SUBQ)) + LOGMASKED(LOG_CMD, "-> Output: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", m_output_fifo[0], m_output_fifo[1], m_output_fifo[2], m_output_fifo[3], m_output_fifo[4], m_output_fifo[5], m_output_fifo[6], m_output_fifo[7], m_output_fifo[8], m_output_fifo[9], m_output_fifo[10], m_output_fifo[11]); + + m_sten_timer->adjust(attotime::from_usec(64 * 4)); // TODO + } +} + +void cr511b_device::audio_end_cb(int state) +{ + if (!state) + return; + + LOGMASKED(LOG_CMD, "Playing audio finished\n", state); + + status_change(m_status & ~STATUS_PLAYING); +} uint8_t cr511b_device::read() { - return 0xff; + uint8_t data = 0xff; + + if (!m_enabled) + { + LOG("Read while not enabled!\n"); + return data; + } + + if (m_cmd) + { + // command mode + if (m_status_ready) + { + data = m_output_fifo[m_output_fifo_pos]; + + // clear old data once read + m_output_fifo[m_output_fifo_pos++] = 0x00; + + LOGMASKED(LOG_DATA, "Data from drive: %02x (%d of %d)\n", data, m_output_fifo_pos, m_output_fifo_length); + + // more data? + if (m_output_fifo_pos < m_output_fifo_length) + { + m_sten_cb(0); + m_sten_cb(1); + } + else + { + m_status_ready = false; + } + } + } + else + { + // data mode + if (m_data_ready) + { + data = m_transfer_buffer[m_transfer_buffer_pos]; + m_transfer_length--; + + LOGMASKED(LOG_DATA, "Data = %02x, pos %d, length %d\n", data, m_transfer_buffer_pos, m_transfer_length); + + // finished transferring this sector? + if (++m_transfer_buffer_pos == m_sector_size) + { + m_data_ready = false; + m_drq_cb(0); + + if (m_transfer_sectors == 0) + { + LOGMASKED(LOG_DATA, "Read done\n"); + status_change(m_status | STATUS_SUCCESS); + } + } + } + } + + return data; } void cr511b_device::write(uint8_t data) { + // verify that we're enabled and are in command mode + if (!m_enabled || !m_cmd) + { + LOG("Invalid write: %02x (enabled: %d, cmd: %d)\n", data, m_enabled, m_cmd); + return; + } + + m_input_fifo[m_input_fifo_pos++] = data; + + switch (m_input_fifo[0]) + { + case 0x01: if (m_input_fifo_pos == 7) cmd_seek(); break; + case 0x02: if (m_input_fifo_pos == 7) cmd_read(); break; + case 0x04: if (m_input_fifo_pos == 7) cmd_motor_on(); break; + case 0x05: if (m_input_fifo_pos == 7) cmd_motor_off(); break; + case 0x09: if (m_input_fifo_pos == 7) cmd_play_lba(); break; + case 0x0a: if (m_input_fifo_pos == 7) cmd_play_msf(); break; + case 0x0b: if (m_input_fifo_pos == 7) cmd_play_track(); break; + case 0x81: if (m_input_fifo_pos == 1) cmd_read_status(); break; + case 0x82: if (m_input_fifo_pos == 7) cmd_read_error(); break; + case 0x84: if (m_input_fifo_pos == 7) cmd_set_mode(); break; + case 0x87: if (m_input_fifo_pos == 7) cmd_read_subq(); break; + case 0x89: if (m_input_fifo_pos == 7) cmd_read_disc_info(); break; + case 0x8a: if (m_input_fifo_pos == 7) cmd_read_toc(); break; + case 0x8b: if (m_input_fifo_pos == 7) cmd_pause(); break; + case 0xa3: if (m_input_fifo_pos == 7) cmd_front_panel(); break; + + default: + LOG("Unknown command: %02x\n", m_input_fifo[0]); + status_enable(0); + break; + } +} + +void cr511b_device::cmd_w(int state) +{ + m_cmd = !bool(state); // active low } void cr511b_device::enable_w(int state) { - m_enabled = state; + m_enabled = !bool(state); // active low } -void cr511b_device::cmd_w(int state) +void cr511b_device::cmd_seek() +{ + LOGMASKED(LOG_CMD, "Command: Seek\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_read() +{ + LOGMASKED(LOG_CMD, "Command: Read\n"); + LOGPARAM; + + m_transfer_lba = (m_input_fifo[1] << 16) | (m_input_fifo[2] << 8) | (m_input_fifo[3] << 0); + m_transfer_sectors = (m_input_fifo[4] << 8) | (m_input_fifo[5] << 0); + m_transfer_length = m_transfer_sectors * m_sector_size; + + LOGMASKED(LOG_CMD, "-> LBA %d, sectors %d\n", m_transfer_lba, m_transfer_sectors); + + m_cdda->stop_audio(); + + uint8_t status = m_status; + + status &= ~STATUS_PLAYING; + status |= STATUS_MOTOR; + + status_change(status); + status_enable(0); +} + +void cr511b_device::cmd_motor_on() +{ + LOGMASKED(LOG_CMD, "Command: Motor On\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_motor_off() +{ + LOGMASKED(LOG_CMD, "Command: Motor Off\n"); + LOGPARAM; + + // TODO: Does this enable STATUS_SUCCESS? + + status_change(m_status & ~STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_play_lba() { - m_cmd = state; + LOGMASKED(LOG_CMD, "Command: Play LBA\n"); + LOGPARAM; + + // haven't found anything that uses it yet + fatalerror("Play LBA: Not implemented\n"); +} + +void cr511b_device::cmd_play_msf() +{ + LOGMASKED(LOG_CMD, "Command: Play MSF\n"); + LOGPARAM; + + uint32_t start = (m_input_fifo[1] << 16) | (m_input_fifo[2] << 8) | (m_input_fifo[3] << 0); + uint32_t end = (m_input_fifo[4] << 16) | (m_input_fifo[5] << 8) | (m_input_fifo[6] << 0); + + int32_t start_lba = msf_to_lba(start); + int32_t end_lba = msf_to_lba(end); + + // play to the end of the disc? + if (end == 0xffffff) + end_lba = get_track_start(0xaa) - 1; + + if (start == 0 && end == 0) + { + LOGMASKED(LOG_CMD, "Stop audio\n"); + + uint8_t status = m_status; + + if (m_cdda->audio_active()) + status |= STATUS_SUCCESS; + + m_cdda->stop_audio(); + + status &= ~STATUS_PLAYING; + status &= ~STATUS_MOTOR; + + status_change(status); + } + else if (start_lba < end_lba) + { + LOGMASKED(LOG_CMD, "Playing audio %02d:%02d.%02d to %02d:%02d.%02d (LBA %d to %d)\n", + m_input_fifo[1], m_input_fifo[2], m_input_fifo[3], + m_input_fifo[4], m_input_fifo[5], m_input_fifo[6], start_lba, end_lba); + + m_cdda->start_audio(start_lba, end_lba - start_lba); + + uint8_t status = m_status; + + status |= STATUS_PLAYING; + status |= STATUS_MOTOR; + + status_change(status); + } + else + { + LOGMASKED(LOG_CMD, "Invalid range %d to %d!\n", start_lba, end_lba); + status_change(m_status | STATUS_ERROR); + } + + status_enable(0); +} + +void cr511b_device::cmd_play_track() +{ + LOGMASKED(LOG_CMD, "Command: Play Track\n"); + LOGPARAM; + + uint8_t start_track = m_input_fifo[1]; + uint8_t start_index = m_input_fifo[2]; // TODO + uint8_t end_track = m_input_fifo[3]; + uint8_t end_index = m_input_fifo[4]; // TODO + + uint32_t start_lba = get_track_start(start_track - 1); + uint32_t end_lba = get_track_start(end_track - 1) - 1; + + LOGMASKED(LOG_CMD, "Playing audio track %d-%d to %d-%d (LBA %d to %d)\n", start_track, start_index, end_track, end_index, start_lba, end_lba); + + m_cdda->start_audio(start_lba, end_lba - start_lba); + + status_change(m_status | STATUS_PLAYING | STATUS_MOTOR); + status_enable(0); +} + +void cr511b_device::cmd_read_status() +{ + LOGMASKED(LOG_CMD, "Command: Read Status\n"); + + m_status &= ~STATUS_SUCCESS; + + m_output_fifo[0] = m_status; + + status_enable(1); +} + +void cr511b_device::cmd_read_error() +{ + LOGMASKED(LOG_CMD, "Command: Read Error\n"); + LOGPARAM; + + m_status &= ~STATUS_ERROR; + m_status |= STATUS_READY; + m_status |= STATUS_SUCCESS; + + m_output_fifo[2] |= (m_status & 0x10); + + status_enable(6); +} + +void cr511b_device::cmd_version() +{ + LOGMASKED(LOG_CMD, "Command: Version\n"); + LOGPARAM; + + // haven't found anything that uses it yet + fatalerror("Version: Not implemented\n"); +} + +void cr511b_device::cmd_set_mode() +{ + LOGMASKED(LOG_CMD, "Command: Set Mode\n"); + LOGPARAM; + + // 01: unknown (value seen: 02) + // 02: sector size hi + // 03: sector size lo + // 04: unknown (value seen 00) + // 05: unknown (value seen 0f) + // 06: unknown (value seen 00) + + m_sector_size = (m_input_fifo[2] << 8) | m_input_fifo[3]; + + LOGMASKED(LOG_CMD, "Sector size = %d\n", m_sector_size); + + m_status |= STATUS_SUCCESS; // ? + + status_enable(0); +} + +void cr511b_device::cmd_read_subq() +{ + LOGMASKED(LOG_SUBQ, "Command: Read SubQ\n"); + if (VERBOSE & LOG_SUBQ) + LOGPARAM; + + // 01: bit 1 - msf or lba + // 02: unknown + // 03: unknown + // 04: unknown + // 05: unknown + // 06: unknown + + bool msf = bool(BIT(m_input_fifo[1], 1)); + + if (m_cdda->audio_active()) + { + uint32_t lba = m_cdda->get_audio_lba(); + uint8_t track = get_track(lba); + + uint32_t disc_pos = lba; + uint32_t track_pos = lba - get_track_start(track); + + if (msf) + { + disc_pos = lba_to_msf(disc_pos); + track_pos = lba_to_msf(track_pos - 150); + + if (VERBOSE & LOG_SUBQ2) + popmessage("Playing track %d at %02d:%02d.%02d (disc %02d:%02d.%02d)", track + 1, + track_pos >> 16 & 0xff, track_pos >> 8 & 0xff, track_pos & 0xff, + disc_pos >> 16 & 0xff, disc_pos >> 8 & 0xff, disc_pos & 0xff); + } + else + { + if (VERBOSE & LOG_SUBQ2) + popmessage("Playing track %d at %d (disc %d)", track, track_pos, disc_pos); + } + + m_output_fifo[1] = get_adr_control(track); + m_output_fifo[2] = track + 1; + m_output_fifo[3] = 0x01; // TODO: index + + m_output_fifo[4] = disc_pos >> 24; + m_output_fifo[5] = disc_pos >> 16; + m_output_fifo[6] = disc_pos >> 8; + m_output_fifo[7] = disc_pos >> 0; + m_output_fifo[8] = track_pos >> 24; + m_output_fifo[9] = track_pos >> 16; + m_output_fifo[10] = track_pos >> 8; + m_output_fifo[11] = track_pos >> 0; + m_output_fifo[12] = 0; // TODO: upc flag + + if (m_cdda->audio_paused()) + m_output_fifo[0] = AUDIO_STATUS_PAUSED; + else + m_output_fifo[0] = AUDIO_STATUS_PLAY; + } + else if (m_cdda->audio_ended()) + m_output_fifo[0] = AUDIO_STATUS_COMPLETED; + else + m_output_fifo[0] = AUDIO_STATUS_NO_STATUS; + + LOGMASKED(LOG_SUBQ, "-> Audio status = %02x\n", m_output_fifo[0]); + + status_enable(13); +} + +void cr511b_device::cmd_read_disc_info() +{ + LOGMASKED(LOG_CMD, "Command: Read Disc Info\n"); + LOGPARAM; + + uint8_t last_track = get_last_track(); + uint32_t last_lba = get_track_start(0xaa); + uint32_t last_msf = lba_to_msf(last_lba); + + m_output_fifo[0] = 1; // first track + m_output_fifo[1] = last_track; + m_output_fifo[2] = last_msf >> 16; + m_output_fifo[3] = last_msf >> 8; + m_output_fifo[4] = last_msf >> 0; + + status_change(m_status | STATUS_MOTOR | STATUS_SUCCESS); + status_enable(5); +} + +void cr511b_device::cmd_read_toc() +{ + LOGMASKED(LOG_CMD, "Command: Read TOC\n"); + LOGPARAM; + + // 01: bit 1 - msf or lba + // 02: track + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + bool msf = bool(BIT(m_input_fifo[1], 1)); + uint8_t track = m_input_fifo[2]; + + uint8_t status = m_status; + + status |= STATUS_MOTOR; + + if (track > get_last_track()) + { + LOGMASKED(LOG_CMD, "Invalid track requested: %d\n", track); + + status |= STATUS_ERROR; + status_enable(0); + } + else if (track == 0) + { + uint32_t track_start = get_track_start(0xaa); + + LOGMASKED(LOG_CMD, "Track 0 requested, lead out start %d\n", track_start); + + if (msf) + track_start = lba_to_msf(track_start); + + m_output_fifo[1] = get_adr_control(0xaa); + m_output_fifo[2] = 1; // first track + m_output_fifo[3] = get_last_track(); + m_output_fifo[4] = track_start >> 24; + m_output_fifo[5] = track_start >> 16; + m_output_fifo[6] = track_start >> 8; + m_output_fifo[7] = track_start >> 0; + + status_enable(8); + } + else + { + uint32_t track_start = get_track_start(track - 1); + + LOGMASKED(LOG_CMD, "Track %d requested, start %d\n", track, track_start); + + if (msf) + track_start = lba_to_msf(track_start); + + m_output_fifo[1] = get_adr_control(track - 1); + m_output_fifo[2] = track; + m_output_fifo[3] = 0; + m_output_fifo[4] = track_start >> 24; + m_output_fifo[5] = track_start >> 16; + m_output_fifo[6] = track_start >> 8; + m_output_fifo[7] = track_start >> 0; + + status_enable(8); + } + + status_change(status); +} + +void cr511b_device::cmd_pause() +{ + LOGMASKED(LOG_CMD, "Command: Pause\n"); + LOGPARAM; + + // 01: 00 = pause audio, other values? + // 02: unused? + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + m_cdda->pause_audio(m_input_fifo[1] == 0x00); + + status_enable(0); +} + +void cr511b_device::cmd_front_panel() +{ + LOGMASKED(LOG_CMD, "Command: Front Panel\n"); + LOGPARAM; + + // enables direct control of the drive by the front panel buttons: stop, play/pause, ff, rew + + // 01: enable/disable + // 02: unused? + // 03: unused? + // 04: unused? + // 05: unused? + // 06: unused? + + status_enable(0); } diff --git a/src/devices/machine/cr511b.h b/src/devices/machine/cr511b.h index 0575562b2d4ed..e773c8b1f82ca 100644 --- a/src/devices/machine/cr511b.h +++ b/src/devices/machine/cr511b.h @@ -1,11 +1,11 @@ -// license:BSD-3-Clause -// copyright-holders:Dirk Best +// license: BSD-3-Clause +// copyright-holders: Dirk Best /*************************************************************************** CR-511-B CD-ROM drive CD-ROM drive with a custom MKE/Panasonic interface as used in the - Commodore CDTV and early SoundBlaster cards. + Commodore CDTV. Similar to the interface on early SoundBlaster cards. 1 _RESET 2 GND 3 EFFK 4 SCCK @@ -38,65 +38,122 @@ #include "imagedev/cdromimg.h" #include "sound/cdda.h" -class cr511b_device : public device_t + +class cr511b_device : public cdrom_image_device, public device_mixer_interface { public: - // construction/destruction cr511b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); // callbacks - auto stch_handler() { return m_stch_handler.bind(); } - auto sten_handler() { return m_sten_handler.bind(); } - auto drq_handler() { return m_drq_handler.bind(); } - auto dten_handler() { return m_dten_handler.bind(); } - auto scor_handler() { return m_scor_handler.bind(); } - auto xaen_handler() { return m_xaen_handler.bind(); } + auto stch_cb() { return m_stch_cb.bind(); } + auto sten_cb() { return m_sten_cb.bind(); } + auto drq_cb() { return m_drq_cb.bind(); } + auto dten_cb() { return m_dten_cb.bind(); } + auto scor_cb() { return m_scor_cb.bind(); } uint8_t read(); void write(uint8_t data); - void enable_w(int state); void cmd_w(int state); + void enable_w(int state); protected: - // device-level overrides + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; virtual void device_start() override ATTR_COLD; virtual void device_reset() override ATTR_COLD; - virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // device_image_interface implementation + virtual std::pair call_load() override; + virtual void call_unload() override; private: - enum - { - STATUS_DOOR_CLOSED = 0x80, - STATUS_MEDIA = 0x40, - STATUS_MOTOR = 0x20, - STATUS_ERROR = 0x10, - STATUS_SUCCESS = 0x08, - STATUS_PLAYING = 0x04, - STATUS_DOOR_LOCKED = 0x02, - STATUS_READY = 0x01 - }; - - required_device m_cdrom; + uint32_t lba_to_msf(int32_t lba); + int32_t msf_to_lba(uint32_t msf); + int size_to_track_type(); + + TIMER_CALLBACK_MEMBER(frame_cb); + + TIMER_CALLBACK_MEMBER(stch); + void status_change(uint8_t status); + + TIMER_CALLBACK_MEMBER(sten); + void status_enable(uint8_t output_length); + + void audio_end_cb(int state); + + // commands + void cmd_seek(); + void cmd_read(); + void cmd_motor_on(); + void cmd_motor_off(); + void cmd_play_lba(); + void cmd_play_msf(); + void cmd_play_track(); + void cmd_read_status(); + void cmd_read_error(); + void cmd_version(); + void cmd_set_mode(); + void cmd_read_subq(); + void cmd_read_disc_info(); + void cmd_read_toc(); + void cmd_pause(); + void cmd_front_panel(); + + // drive status + static constexpr uint8_t STATUS_DOOR_CLOSED = 0x80; // unverified, not used + static constexpr uint8_t STATUS_MEDIA = 0x40; + static constexpr uint8_t STATUS_MOTOR = 0x20; + static constexpr uint8_t STATUS_ERROR = 0x10; + static constexpr uint8_t STATUS_SUCCESS = 0x08; // last command has successfully executed + static constexpr uint8_t STATUS_PLAYING = 0x04; + static constexpr uint8_t STATUS_DOOR_LOCKED = 0x02; // unverified, not used + static constexpr uint8_t STATUS_READY = 0x01; + + // audio status + static constexpr uint8_t AUDIO_STATUS_INVALID = 0x00; + static constexpr uint8_t AUDIO_STATUS_PLAY = 0x11; + static constexpr uint8_t AUDIO_STATUS_PAUSED = 0x12; + static constexpr uint8_t AUDIO_STATUS_COMPLETED = 0x13; + static constexpr uint8_t AUDIO_STATUS_ERROR = 0x14; + static constexpr uint8_t AUDIO_STATUS_NO_STATUS = 0x15; + required_device m_cdda; - devcb_write_line m_stch_handler; - devcb_write_line m_sten_handler; - devcb_write_line m_drq_handler; - devcb_write_line m_dten_handler; - devcb_write_line m_scor_handler; - devcb_write_line m_xaen_handler; + devcb_write_line m_stch_cb; + devcb_write_line m_sten_cb; + devcb_write_line m_drq_cb; + devcb_write_line m_dten_cb; + devcb_write_line m_scor_cb; + + emu_timer *m_frame_timer; + emu_timer *m_stch_timer; + emu_timer *m_sten_timer; + + uint8_t m_input_fifo[16]; + uint8_t m_input_fifo_pos; + + uint8_t m_output_fifo[16]; + uint8_t m_output_fifo_pos; + uint8_t m_output_fifo_length; + + uint8_t m_status; + uint16_t m_sector_size; - //bool m_motor; + uint32_t m_transfer_lba; + uint16_t m_transfer_sectors; + uint32_t m_transfer_length; + uint8_t m_transfer_buffer[2352]; + uint16_t m_transfer_buffer_pos; - // state of lines - int m_enabled; - int m_cmd; + // external lines + bool m_enabled; + bool m_cmd; - // data transfer - //uint8_t m_sector_buffer[CD_MAX_SECTOR_DATA]; + bool m_status_ready; + bool m_data_ready; }; +// device type declaration DECLARE_DEVICE_TYPE(CR511B, cr511b_device) #endif // MAME_MACHINE_CR511B_H diff --git a/src/devices/machine/dmac.cpp b/src/devices/machine/dmac.cpp index 83c51fd215bb9..c4abb65fb34c4 100644 --- a/src/devices/machine/dmac.cpp +++ b/src/devices/machine/dmac.cpp @@ -14,7 +14,7 @@ - SCSI - Support newer variant - DAWR - - Data corruption when installing WB31 + - Rev 1: Data corruption when installing WB31 - FIFO? ***************************************************************************/ @@ -47,6 +47,8 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, device_type m_css_write_cb(*this), m_csx0_read_cb(*this, 0), m_csx0_write_cb(*this), + m_csx0_a4_read_cb(*this, 0), + m_csx0_a4_write_cb(*this), m_csx1_read_cb(*this, 0), m_csx1_write_cb(*this), m_sdack_read_cb(*this, 0), @@ -99,6 +101,7 @@ void amiga_dmac_device::map(address_map &map) map(0x008e, 0x008f).w(FUNC(amiga_dmac_device::dawr_w)); map(0x0090, 0x0093).rw(FUNC(amiga_dmac_device::css_r), FUNC(amiga_dmac_device::css_w)).umask16(0x00ff); map(0x00a0, 0x00a7).rw(FUNC(amiga_dmac_device::csx0_r), FUNC(amiga_dmac_device::csx0_w)).umask16(0x00ff); + map(0x00b0, 0x00bf).rw(FUNC(amiga_dmac_device::csx0_a4_r), FUNC(amiga_dmac_device::csx0_a4_w)).umask16(0x00ff); // a4 + csx0 map(0x00c0, 0x00c7).rw(FUNC(amiga_dmac_device::csx1_r), FUNC(amiga_dmac_device::csx1_w)).umask16(0x00ff); map(0x00e0, 0x00e1).rw(FUNC(amiga_dmac_device::st_dma_r), FUNC(amiga_dmac_device::st_dma_w)); map(0x00e2, 0x00e3).rw(FUNC(amiga_dmac_device::sp_dma_r), FUNC(amiga_dmac_device::sp_dma_w)); @@ -192,7 +195,7 @@ TIMER_CALLBACK_MEMBER(amiga_dmac_device::update_dma) m_acr++; - if (m_rev1 && (m_cntr & CNTR_TCEN)) + if (m_cntr & CNTR_TCEN) { // we count words if ((m_acr & 1) == 0) @@ -201,6 +204,8 @@ TIMER_CALLBACK_MEMBER(amiga_dmac_device::update_dma) { LOGMASKED(LOG_DMA, "Terminal count\n"); + stop_dma(); + m_istr |= ISTR_E_INT; update_interrupts(); } @@ -254,22 +259,16 @@ void amiga_dmac_device::wtc_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask { LOGMASKED(LOG_REGS, "wtc_hi_w: %04x & %04x\n", data, mem_mask); - if (m_rev1) - { - m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff; - m_wtc |= ((uint32_t) data & mem_mask) << 16; - } + m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff; + m_wtc |= ((uint32_t) data & mem_mask) << 16; } void amiga_dmac_device::wtc_lo_w(offs_t offset, uint16_t data, uint16_t mem_mask) { LOGMASKED(LOG_REGS, "wtc_lo_w: %04x & %04x\n", data, mem_mask); - if (m_rev1) - { - m_wtc &= 0xffff0000 & (~mem_mask); - m_wtc |= data & mem_mask; - } + m_wtc &= 0xffff0000 & (~mem_mask); + m_wtc |= data & mem_mask; } void amiga_dmac_device::acr_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -298,6 +297,8 @@ uint8_t amiga_dmac_device::css_r(offs_t offset) { return m_css_read_cb(offset); void amiga_dmac_device::css_w(offs_t offset, uint8_t data) { m_css_write_cb(offset, data); } uint8_t amiga_dmac_device::csx0_r(offs_t offset) { return m_csx0_read_cb(offset); } void amiga_dmac_device::csx0_w(offs_t offset, uint8_t data) { m_csx0_write_cb(offset, data); } +uint8_t amiga_dmac_device::csx0_a4_r(offs_t offset) { return m_csx0_a4_read_cb(offset); } +void amiga_dmac_device::csx0_a4_w(offs_t offset, uint8_t data) { m_csx0_a4_write_cb(offset, data); } uint8_t amiga_dmac_device::csx1_r(offs_t offset) { return m_csx1_read_cb(offset); } void amiga_dmac_device::csx1_w(offs_t offset, uint8_t data) { m_csx1_write_cb(offset, data); } diff --git a/src/devices/machine/dmac.h b/src/devices/machine/dmac.h index 3faa6e4d1f090..0bd2d1f7caa0f 100644 --- a/src/devices/machine/dmac.h +++ b/src/devices/machine/dmac.h @@ -26,6 +26,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig auto css_write_cb() { return m_css_write_cb.bind(); } auto csx0_read_cb() { return m_csx0_read_cb.bind(); } auto csx0_write_cb() { return m_csx0_write_cb.bind(); } + auto csx0_a4_read_cb() { return m_csx0_a4_read_cb.bind(); } + auto csx0_a4_write_cb() { return m_csx0_a4_write_cb.bind(); } auto csx1_read_cb() { return m_csx1_read_cb.bind(); } auto csx1_write_cb() { return m_csx1_write_cb.bind(); } auto sdack_read_cb() { return m_sdack_read_cb.bind(); } @@ -77,6 +79,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig void css_w(offs_t offset, uint8_t data); uint8_t csx0_r(offs_t offset); void csx0_w(offs_t offset, uint8_t data); + uint8_t csx0_a4_r(offs_t offset); + void csx0_a4_w(offs_t offset, uint8_t data); uint8_t csx1_r(offs_t offset); void csx1_w(offs_t offset, uint8_t data); @@ -120,6 +124,8 @@ class amiga_dmac_device : public device_t, public amiga_autoconfig devcb_write8 m_css_write_cb; devcb_read8 m_csx0_read_cb; devcb_write8 m_csx0_write_cb; + devcb_read8 m_csx0_a4_read_cb; + devcb_write8 m_csx0_a4_write_cb; devcb_read8 m_csx1_read_cb; devcb_write8 m_csx1_write_cb; devcb_read8 m_sdack_read_cb; @@ -165,7 +171,7 @@ class amiga_dmac_rev2_device : public amiga_dmac_device amiga_dmac_rev2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); }; -// device type definition +// device type declaration DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV1, amiga_dmac_rev1_device) DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV2, amiga_dmac_rev2_device) diff --git a/src/mame/amiga/amiga.cpp b/src/mame/amiga/amiga.cpp index b6e757b916870..ac82186d1bfbd 100644 --- a/src/mame/amiga/amiga.cpp +++ b/src/mame/amiga/amiga.cpp @@ -354,13 +354,6 @@ class cdtv_state : public amiga_state u16 clock_r(offs_t offset); void clock_w(offs_t offset, u16 data); - uint8_t dmac_scsi_data_read(offs_t offset); - void dmac_scsi_data_write(offs_t offset, uint8_t data); - void dmac_int_w(int state); - - void tpi_port_b_write(uint8_t data); - void tpi_int_w(int state); - void cdtv(machine_config &config); void cdtvn(machine_config &config); void cdtv_mem(address_map &map) ATTR_COLD; @@ -369,21 +362,30 @@ class cdtv_state : public amiga_state protected: // driver_device overrides virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; // amiga_state overrides virtual bool int2_pending() override; virtual bool int6_pending() override; private: - // devices + void dmac_int_w(int state); + + void tpi_portb_w(uint8_t data); + void tpi_int_w(int state); + + void sten_w(int state); + void drq_w(int state); + required_device m_rtc; - required_device m_dmac; + required_device m_dmac; required_device m_tpi; required_device m_cdrom; // internal state int m_dmac_irq; int m_tpi_irq; + bool m_sten; }; class a3000_state : public amiga_state @@ -643,43 +645,6 @@ void a500p_state::clock_w(offs_t offset, u16 data) } -//************************************************************************** -// CD-ROM CONTROLLER -//************************************************************************** - -uint8_t cdtv_state::dmac_scsi_data_read(offs_t offset) -{ - if (offset >= 0xb0 && offset <= 0xbf) - return m_tpi->read(offset); - - return 0xff; -} - -void cdtv_state::dmac_scsi_data_write(offs_t offset, uint8_t data) -{ - if (offset >= 0xb0 && offset <= 0xbf) - m_tpi->write(offset, data); -} - -void cdtv_state::dmac_int_w(int state) -{ - m_dmac_irq = state; - update_int2(); -} - -void cdtv_state::tpi_port_b_write(uint8_t data) -{ - m_cdrom->cmd_w(BIT(data, 0)); - m_cdrom->enable_w(BIT(data, 1)); -} - -void cdtv_state::tpi_int_w(int state) -{ - m_tpi_irq = state; - update_int2(); -} - - //************************************************************************** // DRIVER INIT //************************************************************************** @@ -949,6 +914,15 @@ void cdtv_state::machine_start() m_dmac->ramsz_w(0); } +void cdtv_state::machine_reset() +{ + amiga_state::machine_reset(); + + // start autoconfig + m_dmac->configin_w(0); + m_dmac->configin_w(1); +} + bool cdtv_state::int2_pending() { return m_cia_0_irq || m_dmac_irq || m_tpi_irq; @@ -959,6 +933,35 @@ bool cdtv_state::int6_pending() return m_cia_1_irq; } +void cdtv_state::dmac_int_w(int state) +{ + m_dmac_irq = state; + update_int2(); +} + +void cdtv_state::tpi_portb_w(uint8_t data) +{ + m_cdrom->enable_w(BIT(data, 1)); + m_cdrom->cmd_w(BIT(data, 0)); +} + +void cdtv_state::tpi_int_w(int state) +{ + m_tpi_irq = state; + update_int2(); +} + +void cdtv_state::sten_w(int state) +{ + m_sten = bool(state); +} + +void cdtv_state::drq_w(int state) +{ + if (m_sten) + m_dmac->xdreq_w(state); +} + u32 a3000_state::scsi_r(offs_t offset, u32 mem_mask) { u32 data = 0xffffffff; @@ -1961,31 +1964,30 @@ void cdtv_state::cdtv(machine_config &config) // 256kb memory card NVRAM(config, "memcard", nvram_device::DEFAULT_ALL_0); - // real-time clock MSM6242(config, m_rtc, XTAL(32'768)); - // cd-rom controller - AMIGA_DMAC_REV1(config, m_dmac, amiga_state::CLK_7M_PAL); - m_dmac->css_read_cb().set(FUNC(cdtv_state::dmac_scsi_data_read)); - m_dmac->css_write_cb().set(FUNC(cdtv_state::dmac_scsi_data_write)); + AMIGA_DMAC_REV2(config, m_dmac, amiga_state::CLK_7M_PAL); + m_dmac->int_cb().set(FUNC(cdtv_state::dmac_int_w)); m_dmac->csx0_read_cb().set(m_cdrom, FUNC(cr511b_device::read)); m_dmac->csx0_write_cb().set(m_cdrom, FUNC(cr511b_device::write)); - m_dmac->int_cb().set(FUNC(cdtv_state::dmac_int_w)); + m_dmac->csx0_a4_read_cb().set(m_tpi, FUNC(tpi6525_device::read)); + m_dmac->csx0_a4_write_cb().set(m_tpi, FUNC(tpi6525_device::write)); + m_dmac->xdack_read_cb().set(m_cdrom, FUNC(cr511b_device::read)); TPI6525(config, m_tpi, 0); m_tpi->out_irq_cb().set(FUNC(cdtv_state::tpi_int_w)); - m_tpi->out_pb_cb().set(FUNC(cdtv_state::tpi_port_b_write)); + m_tpi->out_pb_cb().set(FUNC(cdtv_state::tpi_portb_w)); - // cd-rom CR511B(config, m_cdrom, 0); - m_cdrom->scor_handler().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); - m_cdrom->stch_handler().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); - m_cdrom->sten_handler().set(m_tpi, FUNC(tpi6525_device::i3_w)); - m_cdrom->xaen_handler().set(m_tpi, FUNC(tpi6525_device::pb2_w)); - m_cdrom->drq_handler().set(m_dmac, FUNC(amiga_dmac_device::xdreq_w)); - m_cdrom->dten_handler().set(m_dmac, FUNC(amiga_dmac_device::xdreq_w)); + m_cdrom->add_route(0, "lspeaker", 1.0); + m_cdrom->add_route(1, "rspeaker", 1.0); + m_cdrom->scor_cb().set(m_tpi, FUNC(tpi6525_device::i1_w)).invert(); + m_cdrom->stch_cb().set(m_tpi, FUNC(tpi6525_device::i2_w)).invert(); + m_cdrom->sten_cb().set(m_tpi, FUNC(tpi6525_device::i3_w)); + m_cdrom->sten_cb().append(FUNC(cdtv_state::sten_w)); + m_cdrom->drq_cb().set(m_tpi, FUNC(tpi6525_device::i4_w)); + m_cdrom->drq_cb().append(FUNC(cdtv_state::drq_w)); - // software SOFTWARE_LIST(config, "cd_list").set_original("cdtv"); } From 0d608ac8223ab4508026c99e5bd876ece957f6be Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Wed, 5 Mar 2025 18:32:07 +0100 Subject: [PATCH 097/272] New systems marked not working ------------------------------ Xing Yun Pao Ma Di (V401CN) [dyq, little0, Guru] Wang Pai Dou Dizhou [dyq, little0, Guru] Wu Lin Zheng Ba [dyq, little0, Guru] New clones marked not working ----------------------------- Xing Yun Pao Ma Di (unknown ver) [dyq, little0, Guru] --- src/mame/bmc/bmcpokr.cpp | 4 +- src/mame/bordun/att.cpp | 2 +- src/mame/igs/goldstar.cpp | 2 +- src/mame/igs/igs_68k_023vid.cpp | 273 ++++++++++++++++++++++++++++ src/mame/mame.lst | 10 + src/mame/misc/gms.cpp | 2 +- src/mame/skeleton/huangyeh_m68k.cpp | 235 ++++++++++++++++++++++++ src/mame/skeleton/sgm.cpp | 177 ++++++++++++++++++ 8 files changed, 701 insertions(+), 4 deletions(-) create mode 100644 src/mame/igs/igs_68k_023vid.cpp create mode 100644 src/mame/skeleton/huangyeh_m68k.cpp create mode 100644 src/mame/skeleton/sgm.cpp diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index 80f8ec6169488..428343eef50a8 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -18,6 +18,7 @@ Other: BMC B816140 (CPLD) dispensed" than the number of coins/tickets the games are supposed to pay out. * xyddzhh: Hook up mahjong-style inputs and improve DSW definitions + * xyddzhh: Add Oki banking ***************************************************************************/ @@ -471,6 +472,7 @@ void bmcpokr_state::xyddzhh_map(address_map &map) { bmcpokr_mem(map); + map(0x00eec6, 0x00eec9).nopw(); // bug in the code? map(0x330000, 0x330001).r(FUNC(bmcpokr_state::xyddzhh_prot_r)); map(0x340009, 0x340009).lr8(NAME([] () -> uint8_t { return 0xff; })); // andi.b #$7f, so returning 0x00 stops it from working map(0x360000, 0x360001).r(FUNC(bmcpokr_state::xyddzhh_dsw_r)); @@ -1633,4 +1635,4 @@ GAME( 1998, fengyunh, 0, fengyunh, fengyunh, bmcpokr_state, empty_init, R GAME( 1998, shendeng, mjmaglmp, shendeng, shendeng, bmcpokr_state, empty_init, ROT0, "BMC", "Pili Shen Deng", MACHINE_SUPPORTS_SAVE ) GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, bmcpokr_state, empty_init, ROT0, "BMC", "Dongfang Shenlong", MACHINE_SUPPORTS_SAVE ) GAME( 2000, mjmaglmp, 0, mjmaglmp, mjmaglmp, bmcpokr_state, empty_init, ROT0, "BMC", "Mahou no Lamp (v. JAA02)", MACHINE_SUPPORTS_SAVE ) -GAME( 2006, xyddzhh, 0, xyddzhh, xyddzhh, bmcpokr_state, empty_init, ROT0, "Herb Home", "Xingyun Dou Dizhu", MACHINE_SUPPORTS_SAVE ) +GAME( 2006, xyddzhh, 0, xyddzhh, xyddzhh, bmcpokr_state, empty_init, ROT0, "Herb Home", "Xingyun Dou Dizhu", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/bordun/att.cpp b/src/mame/bordun/att.cpp index a9ef393b3de6c..c66d5a12e35a2 100644 --- a/src/mame/bordun/att.cpp +++ b/src/mame/bordun/att.cpp @@ -6,7 +6,7 @@ Bordun poker games on ATT / ATT III PCBs TODO: -* this is basically misc/skylncr.cpp without reels and PPIs and with more advanced sound. Merge? +* this is basically bordun/skylncr.cpp without reels and PPIs and with more advanced sound. Merge? * outputs * lianhp3: title screen says 2003TM but PCB is from 2010? Was this really released in 2003? diff --git a/src/mame/igs/goldstar.cpp b/src/mame/igs/goldstar.cpp index 158e914f4fa77..6b4cd32de6e8e 100644 --- a/src/mame/igs/goldstar.cpp +++ b/src/mame/igs/goldstar.cpp @@ -12289,7 +12289,7 @@ RAMs 1x D4016C-1 u23 PLDs -1x unknowun Cl-001 (QFP144) CY144A read protected +1x unknown Cl-001 (QFP144) CY144A read protected 4x GAL20V8A-15LNC pl1, pl4, pl5, pl6 read protected 2x PALCE20V8H-25PC/4 u2,u? read protected 1x PALCE22V10H-25PC/4 u? read protected diff --git a/src/mame/igs/igs_68k_023vid.cpp b/src/mame/igs/igs_68k_023vid.cpp new file mode 100644 index 0000000000000..7cf8f3ee0c844 --- /dev/null +++ b/src/mame/igs/igs_68k_023vid.cpp @@ -0,0 +1,273 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +IGS games based on M68000 + IGS023 for video. +PGM-like but with different sound hardware. + +TODO: +* currently stuck at ACK 2 error during boot (IGS025?) +* identify sound hardware +* identify where the M6502 core is contained +*/ + + +#include "emu.h" + +#include "igs023_video.h" + +#include "cpu/m6502/m6502.h" +#include "cpu/m68000/m68000.h" +#include "machine/timer.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class igs_68k_023vid_state : public driver_device +{ +public: + igs_68k_023vid_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_video(*this, "igs023"), + m_mainram(*this, "sram") + { } + + void xypmd(machine_config &config) ATTR_COLD; + + +private: + required_device m_maincpu; + required_device m_video; + + required_shared_ptr m_mainram; + + void screen_vblank(int state); + + TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + + void main_program_map(address_map &map) ATTR_COLD; + void sub_program_map(address_map &map) ATTR_COLD; +}; + + +TIMER_DEVICE_CALLBACK_MEMBER(igs_68k_023vid_state::interrupt) +{ + int const scanline = param; + + if (scanline == 0) + m_maincpu->set_input_line(4, HOLD_LINE); +} + + +void igs_68k_023vid_state::screen_vblank(int state) +{ + // rising edge + if (state) + { + m_video->get_sprites(); + + // vblank start interrupt + m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); + } +} + + +void igs_68k_023vid_state::main_program_map(address_map &map) +{ + map(0x000000, 0x07ffff).rom(); + map(0x090000, 0x090001).portr("IN0"); + //map(0x0c0000, 0x0c0001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // TODO: IGS025 here + //map(0x0c0002, 0x0c0003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); + map(0x800000, 0x81ffff).ram().mirror(0x0e0000).share(m_mainram); + map(0x900000, 0x907fff).mirror(0x0f8000).rw(m_video, FUNC(igs023_video_device::videoram_r), FUNC(igs023_video_device::videoram_w)); + map(0xa00000, 0xa011ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); + map(0xb00000, 0xb0ffff).rw(m_video, FUNC(igs023_video_device::videoregs_r), FUNC(igs023_video_device::videoregs_w)); +} + +void igs_68k_023vid_state::sub_program_map(address_map &map) +{ + map(0xe000, 0xffff).rom().region("subcpu", 0x0000); +} + + +static INPUT_PORTS_START( xypmd ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + + +void igs_68k_023vid_state::xypmd(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 20_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_map); + TIMER(config, "scantimer").configure_scanline(FUNC(igs_68k_023vid_state::interrupt), "screen", 0, 1); + + m6502_device &subcpu(M6502(config, "subcpu", 8_MHz_XTAL)); // TODO: something M6502 derived (data.u13 is M6502 derived code) + subcpu.set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::sub_program_map); + + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(1000)); + screen.set_size(512, 256); + screen.set_visarea(0, 448-1, 0, 224-1); + screen.set_screen_update("igs023", FUNC(igs023_video_device::screen_update)); + screen.screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank)); + screen.set_palette("palette"); + + + PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1200 / 2); + + IGS023_VIDEO(config, m_video, 0); + m_video->set_palette("palette"); + m_video->read_spriteram_callback().set([this](offs_t offset) { return m_mainram[offset]; }); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + // TODO: is sound provided by the two Novatek chips? +} + + +/* +Xing Yun Pao Ma Di, IGS, 2003 +Hardware Info By Guru +--------------------- + +IGS PCB NO-0255-1 + |----------------------------------------------| + | IDC34 SOCKET.U11 |------| TL082 VOL | +|-| |NOVATEK OM8383S| +|1 TLF521(x23) 8MHz |NT3570F TL082 | +|8 DATA.U13 |------| | +|W | +|A |------| 7805 | +|Y 24257 |NOVATEK | +|-| |NT3580F | + | 24257 24257 |------| T518B| + | TEXT.U5 |---------| | +|-| | IGS023 | PAL V-401CN.U26 | +|1 CG.U6 | | PAL 68000 24258 | +|0 | | PAL | +|W CG.U7 | | |-----| 24258 | +|A |---------| |IGS025 20MHz BATT| +|Y DSW1 50MHz| S8 | SW3 | +|-|ULN2004 DSW2 |-----| TLF521(x17) | + | TLF521(x6) |--| JAMMA |--| | + |-------------| |----------------------| |---| +Notes: + 68000 - Clock 20MHz + 24257 - 32kB x8-bit SRAM + 24258 - 32kB x8-bit SRAM + IGS023 - Custom IGS023 Graphics Chip (also used on IGS PGM) + IGS025 - Custom IGS025 Chip with Sticker 'S8' +*/ + +ROM_START( xypmd ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "v-401cn.u26", 0x00000, 0x80000, CRC(84f4f46c) SHA1(c04d3aaf531caba6cdf8296570ce24964bd7a077) ) // version string at 0x360dc + + ROM_REGION( 0x10000, "subcpu", 0 ) // TODO: sound related? almost empty + ROM_LOAD( "data.u13", 0x00000, 0x10000, CRC(7c0d8c8f) SHA1(d36ae4749fd248c399741f2024f2f44cf22536b8) ) // 111xxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "igs023", 0 ) + ROM_LOAD( "text.u5", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) + + ROM_REGION16_LE( 0x200000, "igs023:sprcol", 0 ) + ROM_LOAD( "cg.u6", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + + ROM_REGION16_LE( 0x200000, "igs023:sprmask", 0 ) + ROM_LOAD( "cg.u7", 0x000000, 0x200000, CRC(1c6764f2) SHA1(ed1efcab927bdc439247d422df5dedc72fce5682) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF + + ROM_REGION( 0x100000, "samples", 0 ) + ROM_LOAD( "u11", 0x000000, 0x100000, NO_DUMP ) // probably removed from this PCB, possibly or even probably the same as xypmda +ROM_END + +/* +Unknown IGS +Hardware Info By Guru +--------------------- + +IGS PCB NO-0198-2 +Basically the same PCB as IGS PCB No-0255-1 with parts shuffled. +IGS did **MANY** board re-designs with no additional functionality. + +Notes: + 68000 - Clock 20MHz + 2x 61256 - 32kB x8-bit SRAM (Main Work RAM) + 3x 61256 - 32kB x8-bit SRAM (VRAM) + IGS023 - Custom IGS023 Graphics Chip (also used on IGS PGM) + IGS025 - Custom IGS025 Chip with Sticker 'T2' + CG/TEXT - vs 0255-1 PCB, this board has EPROMs replaced with SOP40 and SOP44 mask ROMs +*/ + +ROM_START( xypmda ) + ROM_REGION( 0x80000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "prg.u36", 0x00000, 0x80000, CRC(99d6c58c) SHA1(c8db8689c18ef05ad52ef0476033b62f778e6abf) ) // no version string + + ROM_REGION( 0x10000, "subcpu", 0 ) // TODO: sound related? almost empty + ROM_LOAD( "data.u33", 0x00000, 0x10000, CRC(5e3e3558) SHA1(ca9cdb4e8d124b4a7341ef6597c7ccdbbe124138) ) // 111xxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x200000, "igs023", 0 ) + ROM_LOAD( "igs_t1801.u30", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) + + ROM_REGION16_LE( 0x200000, "igs023:sprcol", 0 ) + ROM_LOAD( "igs_a1803.u39", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + + ROM_REGION16_LE( 0x100000, "igs023:sprmask", 0 ) + ROM_LOAD( "igs_a1802.u40", 0x000000, 0x100000, CRC(5bf791cc) SHA1(df23c8a25a26410ec4021948403bb4111810d7af) ) + + ROM_REGION( 0x100000, "samples", 0 ) + ROM_LOAD( "igs_s1804_speech_v100.u32", 0x000000, 0x100000, CRC(d95220ee) SHA1(72259856bc2a12059ff481f7aab5ecc3118edd18) ) +ROM_END + +} // anonymous namespace + + +GAME( 2003, xypmd, 0, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di (V401CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2003, xypmda, xypmd, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di (unknown ver)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 4fd27afc06272..191c6b4cc8128 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20514,6 +20514,10 @@ tarzanb tarzanc tjsb +@source:igs/igs_68k_023vid.cpp +xypmd +xypmda + @source:igs/igs_fear.cpp fearless icescape @@ -42760,6 +42764,9 @@ hprotr8a @source:skeleton/ht68k.cpp ht68k +@source:skeleton/huangyeh_m68k.cpp +wlzb + @source:skeleton/hudson_poems.cpp marimba poembase @@ -43072,6 +43079,9 @@ semcrossw @source:skeleton/seoul88.cpp seoul88 +@source:skeleton/sgm.cpp +wpddz + @source:skeleton/sh4robot.cpp sh4robot diff --git a/src/mame/misc/gms.cpp b/src/mame/misc/gms.cpp index 8ed4822cfb96d..8083bf538275e 100644 --- a/src/mame/misc/gms.cpp +++ b/src/mame/misc/gms.cpp @@ -2772,7 +2772,7 @@ GMS PCB 98-8-2 for Chao Ji Da Lian Zhuang. 99.9% same board with minor part shuf to be a microcontroller with internal ROM. When identically marked chips are swapped between these two games the POST reports an error with this chip. When the chip is swapped back to the correct board it works fine. The same chip was also swapped from San Se Caishen and also - shows this chip with a POST error. + shows this chip with a POST error. This has been verified not to be an 8x51 or MX10EXA. */ ROM_START( hgly ) diff --git a/src/mame/skeleton/huangyeh_m68k.cpp b/src/mame/skeleton/huangyeh_m68k.cpp new file mode 100644 index 0000000000000..d7385d32dc6a5 --- /dev/null +++ b/src/mame/skeleton/huangyeh_m68k.cpp @@ -0,0 +1,235 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Wu Lin Zheng Ba, Huang Yeh, 1999? +Hardware Info by Guru +--------------------- + +HY-9802 +|--------------------------------------------------------------| +| SW5 EPM7032 M5M482128 M5M482128 T518B| +| M5M482128 M5M482128 | +| | +|-| BATT | + | EPM7032 | +|-| |---------| | +| |HUANG YEH| | +| 22MHz | | PAL22V10 | +|J 68000 63484 | HY9920 | PAL16V8 | +|A | | | +|M |---------| | +|M 6116 | +|A Z80 U6612 | +| U34 | +| 6264 U9 U8 U41 U45 U42 U46 | +| 6264 M6295 U28 | +|-| 86171 | + | | +|-| 3.579545MHz U6614 | +| 8.448MHz | +| SW1 SW2 SW3* SW4* T518B LM324 TL084| +| ULN2003 1242H | +|----| 22WAY |-----------------| 10WAY |----| + |----------------------| |-----------| +Notes: + 68000 - Motorola MC68000P8 CPU. Clock Input 8.448MHz + 63484 - Hitachi HD63484P8 Advanced CRT Controller (ACRTC). Clock Input Pin 2CLK = 5.5MHz [22/4] + Z80 - Zilog Z84C0004 Z80 CPU. Clock Input 4.224MHz [8.448/2] + U6612 - Clone of YM3812 FM Operator Type-LII (OPLII) Sound Chip. Clock Input 3.579545MHz + U6614 - Clone of YM3014 Serial Input Floating D/A Converter + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock Input 2.112MHz [8.448/4]. Pin 7 LOW + M5M482128 - Mitsubishi M5M482128AJ-8 1Mbit Dual Port RAM with 128kB x8-bit DRAM and 256 x8-bit Serial Port + 6116 - 6116 2kB x8-bit SRAM + 6264 - 6264 8kB x8-bit SRAM (both chips battery-backed) + HY9920 - Custom QFP160 Graphics Chip + 86171 - HMC HM86171-80 Color Palette With Triple 6-Bit DAC + TL084 - Texas Instruments TL084 Quad JFET-Input Operational Amplifier + LM324 - Texas Instruments LM324 Quad Operational Amplifier + 1242H - NEC uPC1242H Audio Power Amplifier + SW1-4 - 8-Position DIP Switch. * = SW3 and SW4 Not Populated. + SW5 - Reset Switch and Clear NVRAM + T518B - Mitsumi T518B Reset Chip (TO92) + BATT - 3.6V Ni-Cad Battery. Powers 2x 6264 SRAMs when power is off. + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + EPM7032 - Altera EPM7032 CPLD + U8,U9 - 27C040 EPROM (68000 Program) + U4x - 27C040 EPROM (Graphics) + U34 - 27C256 EPROM (Z80 Program) + U28 - 27C040 EPROM (Oki Samples) +*/ + + +#include "emu.h" + +#include "cpu/m68000/m68000.h" +#include "cpu/z80/z80.h" +#include "sound/okim6295.h" +#include "sound/ymopl.h" +#include "video/hd63484.h" +#include "video/ramdac.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class huangyeh_m68k_state : public driver_device +{ +public: + huangyeh_m68k_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void wlzb(machine_config &config) ATTR_COLD; + + +private: + required_device m_maincpu; + + void main_program_map(address_map &map) ATTR_COLD; + void audio_program_map(address_map &map) ATTR_COLD; + void ramdac_map(address_map &map) ATTR_COLD; + void hd63484_map(address_map &map) ATTR_COLD; +}; + + +void huangyeh_m68k_state::main_program_map(address_map &map) +{ + map.unmap_value_high(); + map(0x000000, 0x0fffff).rom(); + //map(0x1d0000, 0x1d0003).rw("acrtc", FUNC(hd63484_device::read16), FUNC(hd63484_device::write16)); + //map(0x1d0009, 0x1d0009).w("ramdac", FUNC(ramdac_device::index_w)); + //map(0x1d000b, 0x1d000b).w("ramdac", FUNC(ramdac_device::pal_w)); + //map(0x1d000d, 0x1d000d).w("ramdac", FUNC(ramdac_device::mask_w)); + map(0x1f0000, 0x1f3fff).ram(); +} + +void huangyeh_m68k_state::audio_program_map(address_map &map) +{ + map(0x0000, 0x7fff).rom(); + map(0xf000, 0xf7ff).ram(); + map(0xf880, 0xf881).w("ymsnd", FUNC(ym3812_device::write)); +} + +void huangyeh_m68k_state::ramdac_map(address_map &map) +{ + map(0x000, 0x3ff).rw("ramdac", FUNC(ramdac_device::ramdac_pal_r), FUNC(ramdac_device::ramdac_rgb666_w)); +} + +void huangyeh_m68k_state::hd63484_map(address_map &map) +{ + //map(0x00000, 0x7ffff).ram(); +} + + +static INPUT_PORTS_START( wlzb ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("DSW1") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW1:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW1:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW1:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW1:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW1:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW1:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW1:8") + + PORT_START("DSW2") + PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW2:1") + PORT_DIPUNKNOWN_DIPLOC(0x02, 0x02, "SW2:2") + PORT_DIPUNKNOWN_DIPLOC(0x04, 0x04, "SW2:3") + PORT_DIPUNKNOWN_DIPLOC(0x08, 0x08, "SW2:4") + PORT_DIPUNKNOWN_DIPLOC(0x10, 0x10, "SW2:5") + PORT_DIPUNKNOWN_DIPLOC(0x20, 0x20, "SW2:6") + PORT_DIPUNKNOWN_DIPLOC(0x40, 0x40, "SW2:7") + PORT_DIPUNKNOWN_DIPLOC(0x80, 0x80, "SW2:8") +INPUT_PORTS_END + + +// TODO +static GFXDECODE_START( gfx ) +GFXDECODE_END + + +void huangyeh_m68k_state::wlzb(machine_config &config) +{ + // basic machine hardware + M68000(config, m_maincpu, 8.448_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &huangyeh_m68k_state::main_program_map); + m_maincpu->set_vblank_int("screen", FUNC(huangyeh_m68k_state::irq0_line_hold)); + + z80_device &audiocpu(Z80(config, "audiocpu", 8.448_MHz_XTAL / 2)); + audiocpu.set_addrmap(AS_PROGRAM, &huangyeh_m68k_state::audio_program_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 64*8-1, 2*8, 30*8-1); + screen.set_screen_update("acrtc", FUNC(hd63484_device::update_screen)); + screen.set_palette("palette"); + + GFXDECODE(config, "gfxdecode", "palette", gfx); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + RAMDAC(config, "ramdac", 0, "palette").set_addrmap(0, &huangyeh_m68k_state::ramdac_map); + + HD63484(config, "acrtc", 22_MHz_XTAL / 4).set_addrmap(0, &huangyeh_m68k_state::hd63484_map); + + // sound hardware + SPEAKER(config, "mono").front_center(); + + YM3812(config, "ymsnd", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); + + OKIM6295(config, "oki", 8.448_MHz_XTAL / 4, okim6295_device::PIN7_LOW).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +ROM_START( wlzb ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD16_BYTE( "w1-a.u9", 0x00000, 0x80000, CRC(2b6cd511) SHA1(0abfe24d83964eb45f348c5cbfd2ad50474db3c6) ) + ROM_LOAD16_BYTE( "w2-a.u8", 0x00001, 0x80000, CRC(df068584) SHA1(de051d56b9d64027f1b6dee609272186c3575bef) ) + + ROM_REGION( 0x8000, "audiocpu", 0 ) + ROM_LOAD( "w7.u34", 0x0000, 0x8000, CRC(c00786b3) SHA1(a8b3ddf3dd1b702d8719eace1b65f42c727b9473) ) + + ROM_REGION( 0x200000, "tiles", 0 ) + ROM_LOAD( "w3.u41", 0x000000, 0x080000, CRC(58e57d87) SHA1(f870d0729528b2fda495da059f110e466ea58de5) ) + ROM_LOAD( "w4.u45", 0x080000, 0x080000, CRC(5e993a35) SHA1(ed39dbc89cafebc8348f05a6327efa1ea26ff466) ) + ROM_LOAD( "w5.u42", 0x100000, 0x080000, CRC(e728751d) SHA1(00bc65793a65ede318e5412d06eb85259015a5c1) ) + ROM_LOAD( "w6.u46", 0x180000, 0x080000, CRC(a0ea7f31) SHA1(ef985de34485cb65ac59f7938583a0607213c81a) ) + + ROM_REGION( 0x80000, "oki", 0 ) + ROM_LOAD( "w8.u28", 0x00000, 0x80000, CRC(aad9367b) SHA1(e0b20087a8eab9d16e5cb1ed6415ca5373a43da7) ) +ROM_END + +} // anonymous namespace + + +GAME( 1999, wlzb, 0, wlzb, wlzb, huangyeh_m68k_state, empty_init, ROT0, "Huang Yeh", "Wu Lin Zheng Ba", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) diff --git a/src/mame/skeleton/sgm.cpp b/src/mame/skeleton/sgm.cpp new file mode 100644 index 0000000000000..c095e0e2cca3b --- /dev/null +++ b/src/mame/skeleton/sgm.cpp @@ -0,0 +1,177 @@ +// license:BSD-3-Clause +// copyright-holders: + +/* +Wang Pai Dou Dizhu, S.G.M., 2004? +Hardware Info by Guru +--------------------- + +SGM-0509L-1 +|--------------------------------------| +| S2 JAMMA TA7252 | +| 6295 VOL | +|1 ULN2803 | +|8 | +|W |----| FLASH.U21 | +|A |CPU | 24MHz 6264 | +|Y FLASH.U15 | | | +| |----| 708SEN | +| FLASH.U16 | +| | +| BUTTON 22MHz | +| A3.3 |----------| | +|1 A1.8 | | | +|0 A5.0 | | 62LV12816 | +|W EPCS1N.U39 | ALTERA | | +|A | CYCLONE | | +|Y BATT | | 62LV12816 | +| JTAG |----------| | +|--------------------------------------| +Notes: + CPU - Unknown QFP144 CPU, looks like Hyperstone or ARM? Clock input 24.000MHz + ALTERA - Altera Cyclone (unknown model, surface scratched) QFP240 FPGA (Graphics Chip) + EPCS1N - Altera EPCS1N-9530B 128kB Serial Configuration Device for FPGA + JTAG - 10 pin JTAG Header + BATT - CR2032 Coin Battery + BUTTON - Push button, does nothing when pressed. + A3.3 - AMS1117-3.3 3.3V Linear Regulator + A1.8 - AMS1117-1.8 1.8V Linear Regulator + A5.0 - AMS1117-5.0 5.0V Linear Regulator + S2 - 8-Position DIP Switch + 708SEN - Sipex 708SEN System Reset IC + ULN2803 - ULN2803 8-Channel Darlington Transistor Array + TA7252 - Toshiba TA7252 5.9W Audio Power Amplifier + 6295 - Oki M6295 ADPCM Sample Player. Clock 1.100MHz [22/20]. Pin 7 HIGH. + Note title screen music is ripped off from cjddz! + FLASH.U21 - Macronix MX29F1615 1MB x16-bit DIP42 Flash ROM +FLASH.U15/U16 - Sharp LH28F320BJD-TTL80 2MB x16-bit DIP42 Flash ROM + 6264 - 8kB x8-bit SRAM (battery-backed by CR2032 Coin Cell) + 62LV12816 - ISSI IS62LV12816 128kB x16-bit SRAM + +TODO: +- identify CPU arch. There is no obvious code in external ROMs. Encrypted or does it have + internal ROM? With either of the larger ROMs removed from PCB it doesn't boot. +*/ + + +#include "emu.h" + +#include "cpu/arm7/arm7.h" +#include "sound/okim6295.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { + +class sgm_state : public driver_device +{ +public: + sgm_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu") + { } + + void wpddz(machine_config &config) ATTR_COLD; + + +private: + required_device m_maincpu; + + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map) ATTR_COLD; +}; + + +uint32_t sgm_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + bitmap.fill(rgb_t::black(), cliprect); + + return 0; +} + + +void sgm_state::program_map(address_map &map) +{ + map(0x00000000, 0x0001ffff).rom(); +} + + +static INPUT_PORTS_START( wpddz ) + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("IN1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + // no DIP switches on PCB +INPUT_PORTS_END + + +// TODO +static GFXDECODE_START( gfx ) +GFXDECODE_END + + +void sgm_state::wpddz(machine_config &config) +{ + // basic machine hardware + ARM7(config, m_maincpu, 24_MHz_XTAL); // actual CPU arch unknown + m_maincpu->set_addrmap(AS_PROGRAM, &sgm_state::program_map); + + // video hardware + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); + screen.set_size(64*8, 32*8); + screen.set_visarea(0*8, 64*8-1, 2*8, 30*8-1); + screen.set_screen_update(FUNC(sgm_state::screen_update)); + + GFXDECODE(config, "gfxdecode", "palette", gfx); + + PALETTE(config, "palette").set_entries(0x100); // TODO + + // sound hardware + SPEAKER(config, "mono").front_center(); + + OKIM6295(config, "oki", 22_MHz_XTAL / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 1.0); +} + + +ROM_START( wpddz ) + ROM_REGION( 0x20000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD( "internal_rom", 0x00000, 0x20000, NO_DUMP ) // TODO: verify this theory + + ROM_REGION( 0x20000, "cyclone_config", 0 ) + ROM_LOAD( "epcs1n.u39", 0x000000, 0x20000, CRC(874f9122) SHA1(f9f5f721065cdb91416f611da987f2edece1237c) ) + + ROM_REGION( 0x800000, "gfx", 0 ) + ROM_LOAD( "flash.u15", 0x000000, 0x400000, CRC(60a6bb59) SHA1(3f0e7e650643901ebbafd2ac195ad1a99cc645d9) ) + ROM_LOAD( "flash.u16", 0x400000, 0x400000, CRC(429b4938) SHA1(4497ed85f6cbfb03b420ea68427f6a24d092f6b1) ) + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "flash.u21", 0x000000, 0x200000, CRC(e0813bdb) SHA1(41b487da6bfbfb231a0c7297d5a4955a5d4019ff) ) +ROM_END + +} // anonymous namespace + + +GAME( 2004?, wpddz, 0, wpddz, wpddz, sgm_state, empty_init, ROT0, "SGM", "Wang Pai Dou Dizhou", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) From 8715486243850405dfbf69a85adb0904aa789dad Mon Sep 17 00:00:00 2001 From: angelosa Date: Wed, 5 Mar 2025 23:06:17 +0100 Subject: [PATCH 098/272] nec/pc88va_sgp.cpp: add 8bpp mode, fix tetris text --- src/mame/nec/pc88va_sgp.cpp | 48 +++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index 9bea62bf93068..9ff1e812b3edb 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -19,7 +19,7 @@ Unknown part number, used as GPU for PC88VA #include "emu.h" #include "pc88va_sgp.h" -#include +//#include #define LOG_COMMAND (1U << 1) @@ -32,7 +32,7 @@ Unknown part number, used as GPU for PC88VA #define LOGCOMMAND(...) LOGMASKED(LOG_COMMAND, __VA_ARGS__) // device type definition -DEFINE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device, "pc88va_sgp", "NEC PC88VA Super Graphic Processor") +DEFINE_DEVICE_TYPE(PC88VA_SGP, pc88va_sgp_device, "pc88va_sgp", "NEC PC-88VA Super Graphic Processor") pc88va_sgp_device::pc88va_sgp_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) : device_t(mconfig, PC88VA_SGP, tag, owner, clock), @@ -374,30 +374,48 @@ void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) return; } + const u8 hsize_shift = m_src.pixel_mode == 1 ? 1 : 0; + for (int yi = 0; yi < m_src.vsize; yi ++) { u32 src_address = m_src.address + (yi * m_src.fb_pitch); u32 dst_address = m_dst.address + (yi * m_dst.fb_pitch); - for (int xi = 0; xi < (m_src.hsize >> 2); xi ++) + for (int xi = 0; xi < (m_src.hsize >> hsize_shift); xi ++) { // TODO: not very efficient, we need a cleaner per-pixel RMW phase - const u16 src_dot = m_data->read_word(src_address); - const u16 dst_dot = m_data->read_word(dst_address); - u16 result = 0; + const u8 src_dot = m_data->read_byte(src_address); + const u8 dst_dot = m_data->read_byte(dst_address); + u8 result = 0; - for (int pixi = 0; pixi < 4; pixi ++) + switch(m_src.pixel_mode) { - u8 cur_pixel = (src_dot & 0xf); - if (cur_pixel || tp_mod == 0) - result |= (src_dot & 0xf) << (pixi * 4); - else - result |= (dst_dot & 0xf) << (pixi * 4); + // 4bpp (shinraba) + case 1: + for (int pixi = 0; pixi < 2; pixi ++) + { + u8 cur_pixel = (src_dot & 0xf); + if (cur_pixel || tp_mod == 0) + result |= (src_dot & 0xf) << (pixi * 4); + else + result |= (dst_dot & 0xf) << (pixi * 4); + } + break; + + // 8bpp (tetris) + case 2: + u8 cur_pixel = (src_dot & 0xff); + if (cur_pixel || tp_mod == 0) + result |= (cur_pixel & 0xff); + else + result |= (dst_dot & 0xff); + + break; } - m_data->write_word(dst_address, result); - src_address += 2; - dst_address += 2; + m_data->write_byte(dst_address, result); + src_address ++; + dst_address ++; } } } From 6ab47fbba3cf9e99468daf4f0ee3dc908b092e0c Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Thu, 6 Mar 2025 00:49:20 +0100 Subject: [PATCH 099/272] More improvements to misc/vpoker.cpp driver: [Roberto Fresca, Grull Osgo] - Rewrote the lamps scheme. - Fixed the button-lamps layouts. - Added workaround for the NMI routine (vpoker). - Fixed vpoker NVRAM issues. - Fixed mech counters support per game. --- src/mame/layout/5acespkr.lay | 4 +- src/mame/layout/vpoker.lay | 28 ++++++------- src/mame/misc/vpoker.cpp | 79 ++++++++++++++++++++++++++++-------- 3 files changed, 79 insertions(+), 32 deletions(-) diff --git a/src/mame/layout/5acespkr.lay b/src/mame/layout/5acespkr.lay index c656ed5ec1087..423f1f9b6bc9d 100644 --- a/src/mame/layout/5acespkr.lay +++ b/src/mame/layout/5acespkr.lay @@ -116,10 +116,10 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + - + diff --git a/src/mame/layout/vpoker.lay b/src/mame/layout/vpoker.lay index 285d6fa97e137..710c4a15f4a6f 100644 --- a/src/mame/layout/vpoker.lay +++ b/src/mame/layout/vpoker.lay @@ -117,42 +117,42 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + - + - + - + - + - + - + - + - + - + @@ -165,10 +165,10 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + - + @@ -181,10 +181,10 @@ copyright-holders: Roberto Fresca, Grull Osgo. - + - + diff --git a/src/mame/misc/vpoker.cpp b/src/mame/misc/vpoker.cpp index ba60e0034f969..4e114c821be6f 100644 --- a/src/mame/misc/vpoker.cpp +++ b/src/mame/misc/vpoker.cpp @@ -142,16 +142,25 @@ - Promoted 5acespkr to working. - Added technical notes. + Updates [2025-03-06]: + + - Rewrote the lamps scheme. + - Fixed the button-lamps layouts. + - Added workaround for the NMI routine (vpoker). + - Fixed vpoker NVRAM issues. + - Fixed mech counters support per game. + TODO: - - Check NVRAM issues. + - Add workaround for the NMI routine (5acespkr). + - Fix the 5acespkr NVRAM issues. - Find why vectors are changed in 5acespkr. - Investigate about what seems to be a custom processor due to the weird routines related to interrupts, and the complete lack of SWI triggers. - + **************************************************************************************************************/ @@ -194,11 +203,14 @@ class vpoker_state : public driver_device virtual void video_start() override ATTR_COLD; private: + uint8_t nvram_r(offs_t offset); + void nvram_w(offs_t offset, u8 data); std::unique_ptr m_videoram; uint8_t m_blit_ram[8]; uint8_t blitter_r(offs_t offset); void blitter_w(offs_t offset, uint8_t data); void ptm_irq(int state); + void ptm_5_irq(int state); void swi_int(int state); uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; @@ -209,6 +221,8 @@ class vpoker_state : public driver_device required_ioport m_in1; output_finder<9> m_lamps; void main_map(address_map &map) ATTR_COLD; + + std::unique_ptr m_nvram_data; }; @@ -263,9 +277,9 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) if(offset == 1) { machine().bookkeeping().coin_counter_w(0, BIT(data, 5)); // coin_in - machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out - - m_lamps[7] = BIT(data, 7); // bet lamp + machine().bookkeeping().coin_counter_w(1, BIT(data, 4)); // coin_out (5aces) + machine().bookkeeping().coin_counter_w(1, BIT(data, 6)); // coin_out (vpoker) + m_lamps[8] = BIT(data, 7); // bet lamp } if(offset == 2) { @@ -276,13 +290,14 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) } if(offset == 3) { - m_lamps[0] = BIT(data, 0); // hold 1 lamp - m_lamps[1] = BIT(data, 1); // hold 2 lamp - m_lamps[2] = BIT(data, 2); // hold 3 lamp - m_lamps[3] = BIT(data, 3); // hold 4 lamp - m_lamps[4] = BIT(data, 4); // hold 5 lamp - m_lamps[5] = BIT(data, 5); // deal lamp - m_lamps[6] = BIT(data, 6); // draw lamp + m_lamps[0] = BIT(data, 0); // hold 1 lamp (5acespkr) + m_lamps[1] = BIT(data, 1); // hold 2 lamp (5acespkr) + m_lamps[2] = BIT(data, 2); // hold 3 lamp (5acespkr) + m_lamps[3] = BIT(data, 3); // hold 4 lamp (5acespkr) + m_lamps[4] = BIT(data, 4); // hold 5 lamp (5acespkr) + m_lamps[5] = BIT(data, 5); // deal lamp (common) + m_lamps[6] = BIT(data, 6); // draw lamp (common) + m_lamps[7] = BIT(data, 7); // holds + cancel (vpoker) } else { @@ -290,6 +305,16 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) } } +uint8_t vpoker_state::nvram_r(offs_t offset) +{ + return m_nvram_data[offset]; +} + +void vpoker_state::nvram_w(offs_t offset, u8 data) +{ + m_nvram_data[offset] = data; +} + /*********************************** * Machine Start * @@ -297,6 +322,9 @@ void vpoker_state::blitter_w(offs_t offset, uint8_t data) void vpoker_state::machine_start() { + m_nvram_data = make_unique_clear(0x200); + subdevice("nvram")->set_base(&m_nvram_data[0], 0x200); + save_pointer(NAME(m_nvram_data), 0x200); m_lamps.resolve(); } @@ -308,7 +336,7 @@ void vpoker_state::machine_start() void vpoker_state::main_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x01ff).ram().share("nvram"); // vpoker has 0x100, 5acespkr has 0x200 + map(0x0000, 0x01ff).rw(FUNC(vpoker_state::nvram_r), FUNC(vpoker_state::nvram_w)); map(0x0400, 0x0407).rw("6840ptm", FUNC(ptm6840_device::read), FUNC(ptm6840_device::write)); map(0x0800, 0x0807).r(FUNC(vpoker_state::blitter_r)).w(FUNC(vpoker_state::blitter_w)); map(0x2000, 0x3fff).rom(); @@ -395,10 +423,31 @@ GFXDECODE_END *****************************************/ void vpoker_state::ptm_irq(int state) +{ + m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); + if(state == 0) + { + // do de job that must be done by NMI. + uint8_t sum = 0; + nvram_w(0x4f, 0x5a); + nvram_w(0x91, 0xa5); + nvram_w(0x9f, 0x00); + + for(int i = 0x40; i < 0xa0; i++) + sum += nvram_r(i); + + sum = ~sum + 1; + nvram_w(0x9f, sum); + sum = 0; + } +} + +void vpoker_state::ptm_5_irq(int state) { m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } + void vpoker_state::swi_int(int state) { if(m_in0->read() == 0xfe) @@ -406,7 +455,6 @@ void vpoker_state::swi_int(int state) } - /***************************************** * Machine Driver * *****************************************/ @@ -416,7 +464,6 @@ void vpoker_state::vpoker(machine_config &config) // basic machine hardware MC6809(config, m_maincpu, XTAL(4'000'000)); m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); - m_maincpu->set_vblank_int("screen", FUNC(vpoker_state::irq0_line_assert)); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); @@ -468,7 +515,7 @@ void vpoker_state::fiveaces(machine_config &config) // 6840 PTM ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); ptm.set_external_clocks(500, 0, 1000000); - ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); + ptm.irq_callback().set(FUNC(vpoker_state::ptm_5_irq)); ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); // sound hardware From 0640d4f8d3c0b05ecd2b57476e16d0638291e3d8 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Thu, 6 Mar 2025 11:07:06 +0100 Subject: [PATCH 100/272] New systems marked not working ------------------------------ Chao Ji Dou Niu (V305CN) [dyq, little0, Guru] Chao Ji Sai Jin Hua [dyq, little0, Guru] --- src/mame/mame.lst | 2 ++ src/mame/skeleton/vgame.cpp | 70 +++++++++++++++++++++++++++++++------ 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 191c6b4cc8128..e6b92e7d83fd8 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -43226,6 +43226,8 @@ vectrix venteta @source:skeleton/vgame.cpp +cjdn +cjsjh hilice mjxy2 diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index a103afd08e5f3..28429d68d302c 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -40,7 +40,7 @@ class vgame_state : public driver_device void vgame(machine_config &config) ATTR_COLD; - void init_hilice() ATTR_COLD; + void init_vgame() ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -152,12 +152,13 @@ void vgame_state::vgame(machine_config &config) // VGAME-0030-02-AI PCB ROM_START( hilice ) - ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD( "hi_lice_v102fa.u13", 0x000000, 0x200000, CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) + ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASE00 ) + ROM_LOAD16_WORD_SWAP( "hi_lice_v102fa.u13", 0x000000, 0x100000, BAD_DUMP CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) // probably read as wrong ROM type + ROM_CONTINUE( 0x000000, 0x100000 ) ROM_REGION( 0x400000, "gfx", 0 ) - ROM_LOAD16_BYTE( "hi_lice_cg_01fu3.u3", 0x000000, 0x200000, CRC(8ad6b233) SHA1(deaffd391265c885afb2f171089c1b33429470f1) ) - ROM_LOAD16_BYTE( "hi_lice_cg_01fu8.u8", 0x000001, 0x200000, BAD_DUMP CRC(b1070209) SHA1(4568977fca2ff96b756a9600ad9a4730a6f8749a) ) // didn't give consistent reads + ROM_LOAD16_BYTE( "hi_lice_cg_01fu3.u3", 0x000000, 0x200000, BAD_DUMP CRC(8ad6b233) SHA1(deaffd391265c885afb2f171089c1b33429470f1) ) // probably read as wrong ROM type + ROM_LOAD16_BYTE( "hi_lice_cg_01fu8.u8", 0x000001, 0x200000, BAD_DUMP CRC(b1070209) SHA1(4568977fca2ff96b756a9600ad9a4730a6f8749a) ) // probably read as wrong ROM type + didn't give consistent reads ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "hi_lice_sp_100f.u45", 0x000000, 0x200000, CRC(b2588f54) SHA1(0d046e56596611954a9d2a9a30746d8aa370431b) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 @@ -167,7 +168,7 @@ ROM_END // while all labels have 麻將學園 (Mahjong School) prepended to what's below, title screen shows 麻將學園 2 - Mahjong School 2 ROM_START( mjxy2 ) ROM_REGION( 0x200000, "maincpu", 0 ) // dumped as EV29LV160 (same rare ROM as some IGS titles) - ROM_LOAD( "u12_v108tw.u12", 0x000000, 0x200000, CRC(a6d99849) SHA1(c280635517d5ffded524e15048568817bd927bf9) ) + ROM_LOAD16_WORD_SWAP( "u12_v108tw.u12", 0x000000, 0x200000, CRC(a6d99849) SHA1(c280635517d5ffded524e15048568817bd927bf9) ) ROM_REGION( 0x400000, "gfx", 0 ) // dumped as EV29LV160 (same rare ROM as some IGS titles) ROM_LOAD16_BYTE( "u3_cg_v105.u3", 0x000000, 0x200000, CRC(fda38fb1) SHA1(7bd744e42f619254ebad2fb60f3851f61073fe8c) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -177,14 +178,63 @@ ROM_START( mjxy2 ) ROM_LOAD( "u43_sp_v105.u43", 0x000000, 0x200000, CRC(5d1ab8f1) SHA1(56473b632dfdb210208ce3b35cb6861f07861cd7) ) ROM_END +ROM_START( cjdn ) // Oct 1 2008 15:58:54 string in ROM + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "v305cn.u8", 0x000000, 0x200000, CRC(bffb20c0) SHA1(bf2293bfc4711d0b930c491f579418d5e7c0800f) ) + + ROM_REGION( 0x400000, "gfx", 0 ) + ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, NO_DUMP ) // not dumped yet + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp_101g.u24", 0x000000, 0x200000, CRC(f361a725) SHA1(9404f955126f16c7f4a2c52e799791f6f2703b5f) ) +ROM_END + +ROM_START( cjsjh ) // Nov 2 2007 16:05:26 string in ROM + ROM_REGION( 0x200000, "maincpu", 0 ) + ROM_LOAD16_WORD_SWAP( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable + + ROM_REGION( 0x400000, "gfx", 0 ) + ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, NO_DUMP ) // not dumped yet + + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp.u24", 0x000000, 0x200000, CRC(ad11c8b9) SHA1(0547a57ff2183e65fa1d51234799a3d521b018c5) ) +ROM_END + -void vgame_state::init_hilice() +// TODO: very incomplete, just enough to show some strings +void vgame_state::init_vgame() { - // TODO: decryption + uint8_t *rom = memregion("maincpu")->base(); + + for (int i = 0; i < 0x200000; i += 2) + { + switch (i & 0x6232) + { + case 0x0000: rom[i] ^= 0x00; break; + case 0x0002: rom[i] ^= 0x20; break; + case 0x0010: rom[i] ^= 0x02; break; + case 0x0012: rom[i] ^= 0x22; break; + case 0x0020: rom[i] ^= 0x20; break; + case 0x0022: rom[i] ^= 0x20; break; + case 0x0030: rom[i] ^= 0x22; break; + case 0x0032: rom[i] ^= 0x22; break; + case 0x0200: rom[i] ^= 0x00; break; + case 0x0202: rom[i] ^= 0x00; break; + case 0x0210: rom[i] ^= 0x02; break; + case 0x0212: rom[i] ^= 0x02; break; + case 0x0220: rom[i] ^= 0x20; break; + case 0x0222: rom[i] ^= 0x20; break; + case 0x0230: rom[i] ^= 0x22; break; + case 0x0232: rom[i] ^= 0x22; break; + default: rom[i] ^= 0x22; + } + } } } // anonymous namespace -GAME( 200?, hilice, 0, vgame, hilice, vgame_state, init_hilice, ROT0, "VGame", "Hi Lice (V102FA)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 200?, mjxy2, 0, vgame, hilice, vgame_state, init_hilice, ROT0, "VGame", "Majiang Xueyuan 2 - Mahjong School (V108TW)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, hilice, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Hi Lice (V102FA)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 200?, mjxy2, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Majiang Xueyuan 2 - Mahjong School (V108TW)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2008, cjdn, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Chao Ji Dou Niu (V305CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 2007, cjsjh, 0, vgame, hilice, vgame_state, init_vgame, ROT0, "VGame", "Chao Ji Sai Jin Hua (V201CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) From d3a110391ff74238ff3f26af00556430fa058d8e Mon Sep 17 00:00:00 2001 From: mamehaze <140764005+mamehaze@users.noreply.github.com> Date: Thu, 6 Mar 2025 10:16:02 +0000 Subject: [PATCH 101/272] igs/igs_68k_023vid.cpp: made xypmd / xypmda show something (#13447) --- src/mame/igs/igs_68k_023vid.cpp | 235 ++++++++++++++++++++++---------- 1 file changed, 165 insertions(+), 70 deletions(-) diff --git a/src/mame/igs/igs_68k_023vid.cpp b/src/mame/igs/igs_68k_023vid.cpp index 7cf8f3ee0c844..2ad7fbcc1e26d 100644 --- a/src/mame/igs/igs_68k_023vid.cpp +++ b/src/mame/igs/igs_68k_023vid.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders: +// copyright-holders: David Haywood /* IGS games based on M68000 + IGS023 for video. @@ -25,7 +25,6 @@ PGM-like but with different sound hardware. #include "speaker.h" #include "tilemap.h" - namespace { class igs_68k_023vid_state : public driver_device @@ -34,88 +33,155 @@ class igs_68k_023vid_state : public driver_device igs_68k_023vid_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_screen(*this, "screen"), m_video(*this, "igs023"), m_mainram(*this, "sram") { } void xypmd(machine_config &config) ATTR_COLD; - + void xypmda(machine_config &config) ATTR_COLD; private: - required_device m_maincpu; - required_device m_video; - - required_shared_ptr m_mainram; + u16 unknown_r() { return (machine().rand() & 0x0010) | 0xffcf; } // 0x0010 seems to be sound CPU status + u16 unknown2_r() { return 0xffff; } void screen_vblank(int state); + void screen_vblank_xypmda(int state); - TIMER_DEVICE_CALLBACK_MEMBER(interrupt); + void main_program_base_map(address_map &map) ATTR_COLD; + void main_program_xypmd_map(address_map &map) ATTR_COLD; + void main_program_xypmda_map(address_map &map) ATTR_COLD; - void main_program_map(address_map &map) ATTR_COLD; void sub_program_map(address_map &map) ATTR_COLD; -}; + required_device m_maincpu; + required_device m_screen; + required_device m_video; + required_shared_ptr m_mainram; +}; -TIMER_DEVICE_CALLBACK_MEMBER(igs_68k_023vid_state::interrupt) +void igs_68k_023vid_state::screen_vblank(int state) { - int const scanline = param; + // Apart from IRQ1 and IRQ2 all other IRQs point to exceptions - if (scanline == 0) - m_maincpu->set_input_line(4, HOLD_LINE); + // rising edge + if (state) + { + m_video->get_sprites(); + m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE); // only IRQ with useful code + } + else + { + // m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); // does nothing + } } - -void igs_68k_023vid_state::screen_vblank(int state) +void igs_68k_023vid_state::screen_vblank_xypmda(int state) { + // Apart from IRQ2 all other IRQs point to exceptions + // rising edge if (state) { m_video->get_sprites(); - - // vblank start interrupt - m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE); + m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE); + } + else + { + // no other possible IRQ vectors } } - -void igs_68k_023vid_state::main_program_map(address_map &map) +void igs_68k_023vid_state::main_program_base_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x090000, 0x090001).portr("IN0"); - //map(0x0c0000, 0x0c0001).nopr().w(m_igs_mux, FUNC(igs_mux_device::address_w)).umask16(0x00ff); // TODO: IGS025 here - //map(0x0c0002, 0x0c0003).rw(m_igs_mux, FUNC(igs_mux_device::data_r), FUNC(igs_mux_device::data_w)).umask16(0x00ff); - map(0x800000, 0x81ffff).ram().mirror(0x0e0000).share(m_mainram); + + map(0x800000, 0x80ffff).ram().share(m_mainram); map(0x900000, 0x907fff).mirror(0x0f8000).rw(m_video, FUNC(igs023_video_device::videoram_r), FUNC(igs023_video_device::videoram_w)); map(0xa00000, 0xa011ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0xb00000, 0xb0ffff).rw(m_video, FUNC(igs023_video_device::videoregs_r), FUNC(igs023_video_device::videoregs_w)); } +void igs_68k_023vid_state::main_program_xypmd_map(address_map &map) +{ + main_program_base_map(map); + + map(0x080000, 0x08ffff).ram(); // why is this tested like it was mainram / spriteram? bug in code? + + map(0x090000, 0x090001).r(FUNC(igs_68k_023vid_state::unknown_r)); + map(0x090018, 0x090019).portr("IN1"); + + // 025 or just I/O? + map(0x0c0000, 0x0c0001).nopr().nopw(); + map(0x0c0002, 0x0c0003).nopw().portr("IN0"); +} + +void igs_68k_023vid_state::main_program_xypmda_map(address_map &map) +{ + main_program_base_map(map); + + // I/O / IGS025 etc. is different here + map(0x080100, 0x080101).r(FUNC(igs_68k_023vid_state::unknown_r)); + map(0x080120, 0x080121).portr("IN1"); + map(0x080200, 0x080201).nopw(); + + map(0x0a0000, 0x0a0001).r(FUNC(igs_68k_023vid_state::unknown2_r)); + map(0x0a0002, 0x0a0003).r(FUNC(igs_68k_023vid_state::unknown2_r)); + + // definitely the same as 0x0c0000 on the parent + map(0x0e0000, 0x0e0001).nopr().nopw(); + map(0x0e0002, 0x0e0003).nopw().portr("IN0"); +} + void igs_68k_023vid_state::sub_program_map(address_map &map) { + map(0x0000, 0x03ff).ram(); + + map(0x4200, 0x46ff).ram(); + + map(0xc000, 0xc000).noprw(); + map(0xc001, 0xc001).nopw(); + map(0xe000, 0xffff).rom().region("subcpu", 0x0000); } static INPUT_PORTS_START( xypmd ) PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("DSW1") PORT_DIPUNKNOWN_DIPLOC(0x01, 0x01, "SW1:1") @@ -142,24 +208,21 @@ INPUT_PORTS_END void igs_68k_023vid_state::xypmd(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, 20_MHz_XTAL / 2); - m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_map); - TIMER(config, "scantimer").configure_scanline(FUNC(igs_68k_023vid_state::interrupt), "screen", 0, 1); + M68000(config, m_maincpu, 20_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_xypmd_map); m6502_device &subcpu(M6502(config, "subcpu", 8_MHz_XTAL)); // TODO: something M6502 derived (data.u13 is M6502 derived code) subcpu.set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::sub_program_map); - // video hardware - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); // TODO: verify everything once emulation works - screen.set_refresh_hz(60); - screen.set_vblank_time(ATTOSECONDS_IN_USEC(1000)); - screen.set_size(512, 256); - screen.set_visarea(0, 448-1, 0, 224-1); - screen.set_screen_update("igs023", FUNC(igs023_video_device::screen_update)); - screen.screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank)); - screen.set_palette("palette"); - + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); // TODO: verify everything once emulation works + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(1000)); + m_screen->set_size(512, 256); + m_screen->set_visarea(0, 448-1, 0, 224-1); + m_screen->set_screen_update("igs023", FUNC(igs023_video_device::screen_update)); + m_screen->screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank)); + m_screen->set_palette("palette"); PALETTE(config, "palette").set_format(palette_device::xRGB_555, 0x1200 / 2); @@ -173,9 +236,16 @@ void igs_68k_023vid_state::xypmd(machine_config &config) // TODO: is sound provided by the two Novatek chips? } +void igs_68k_023vid_state::xypmda(machine_config &config) +{ + xypmd(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &igs_68k_023vid_state::main_program_xypmda_map); + m_screen->screen_vblank().set(FUNC(igs_68k_023vid_state::screen_vblank_xypmda)); +} /* -Xing Yun Pao Ma Di, IGS, 2003 +Xing Yun Pao Ma Di Super, IGS, 2003 Hardware Info By Guru --------------------- @@ -183,7 +253,7 @@ IGS PCB NO-0255-1 |----------------------------------------------| | IDC34 SOCKET.U11 |------| TL082 VOL | |-| |NOVATEK OM8383S| -|1 TLF521(x23) 8MHz |NT3570F TL082 | +|1 TLP521(x23) 8MHz |NT3570F TL082 | |8 DATA.U13 |------| | |W | |A |------| 7805 | @@ -197,15 +267,36 @@ IGS PCB NO-0255-1 |W CG.U7 | | |-----| 24258 | |A |---------| |IGS025 20MHz BATT| |Y DSW1 50MHz| S8 | SW3 | -|-|ULN2004 DSW2 |-----| TLF521(x17) | - | TLF521(x6) |--| JAMMA |--| | +|-|ULN2004 DSW2 |-----| TLP521(x17) | + | TLP521(x6) |--| JAMMA |--| | |-------------| |----------------------| |---| Notes: - 68000 - Clock 20MHz - 24257 - 32kB x8-bit SRAM - 24258 - 32kB x8-bit SRAM + 68000 - Motorola MC68000FN20 CPU. Clock Input 20MHz + Note: This is a 20MHz part without clock divider and runs at 20MHz. + 24257 - Winbond W24257AJ-8N 32kB x8-bit SRAM (VRAM) + 24258 - Winbond W24258S-55LL 32kB x8-bit SRAM (Work RAM) IGS023 - Custom IGS023 Graphics Chip (also used on IGS PGM) IGS025 - Custom IGS025 Chip with Sticker 'S8' + V-401CN - 27C4096 EPROM (main program) + TEXT.U5 - 27C160 EPROM + CG.U6 - 27C4096 EPROM + CG.U7 - 27C160 EPROM + DATA - 27512 Mask ROM + SOCKET.U11 - Empty Socket. ROM is likely to be missing as the socket is clean. PCB printed 'MUSIC1' and '27C080'. + There is space for another unpopulated ROM below this one marked 'MUSIC2' and '27C080'. + IDC34 - IDC34 34-Pin Flat Cable Connector for I/O and Control Expansion (same connector seen on PGM) + NT3580F - Novatek NT3580F-AM019 QFP100 Sound CPU with 6502 Core. Clock Input 8.000MHz. DATA ROM connects to this chip. + NT3570F - Novatek NT3570F QFP80 Sound Chip. Clock Input 8.000MHz. This chip connects to the opamps so this is the sound chip. + ROM U11 connects to this chip. Both Novatek chips are dated 1999. + T518B - Mitsumi T518B Reset Chip + 7805 - LM7805 5V Linear Voltage Regulator + TLP521 - Toshiba TLP521 Opto-Coupler + BATT - 3.6V Ni-Cad Battery (both W24258 RAMs are battery-backed) + SW3 - Toggle Switch for NVRAM Clear and Reset + DSW1/2 - 8-Position DIP Switch + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + TL082 - Texas Instruments TL082 JFET Input Dual Operational Amplifier + OM8383S - Philips OM8383S Audio Power Amplifier */ ROM_START( xypmd ) @@ -219,11 +310,11 @@ ROM_START( xypmd ) ROM_LOAD( "text.u5", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) ROM_REGION16_LE( 0x200000, "igs023:sprcol", 0 ) - ROM_LOAD( "cg.u6", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) - - ROM_REGION16_LE( 0x200000, "igs023:sprmask", 0 ) ROM_LOAD( "cg.u7", 0x000000, 0x200000, CRC(1c6764f2) SHA1(ed1efcab927bdc439247d422df5dedc72fce5682) ) // 1xxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_REGION16_LE( 0x80000, "igs023:sprmask", 0 ) + ROM_LOAD( "cg.u6", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + ROM_REGION( 0x100000, "samples", 0 ) ROM_LOAD( "u11", 0x000000, 0x100000, NO_DUMP ) // probably removed from this PCB, possibly or even probably the same as xypmda ROM_END @@ -256,12 +347,15 @@ ROM_START( xypmda ) ROM_REGION( 0x200000, "igs023", 0 ) ROM_LOAD( "igs_t1801.u30", 0x000000, 0x200000, CRC(253b8517) SHA1(3f583410ab7083d5f45a5e23f73bddd18b000260) ) - ROM_REGION16_LE( 0x200000, "igs023:sprcol", 0 ) - ROM_LOAD( "igs_a1803.u39", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) - - ROM_REGION16_LE( 0x100000, "igs023:sprmask", 0 ) + ROM_REGION16_LE( 0x100000, "igs023:sprcol", 0 ) + // Data is NOT identical to cg.u7 (size difference is irrelevant, cg.u7 just has blank data in 2nd half) + // Unusual however, as the sprcol and sprmask ROMs are essentially a pair. Check if one is bad or if + // some colours have been changed intentionally ROM_LOAD( "igs_a1802.u40", 0x000000, 0x100000, CRC(5bf791cc) SHA1(df23c8a25a26410ec4021948403bb4111810d7af) ) + ROM_REGION16_LE( 0x80000, "igs023:sprmask", 0 ) + ROM_LOAD( "igs_a1803.u39", 0x00000, 0x80000, CRC(20ff0cb3) SHA1(4562996675fe62563f393817f40395c8bce37c5f) ) + ROM_REGION( 0x100000, "samples", 0 ) ROM_LOAD( "igs_s1804_speech_v100.u32", 0x000000, 0x100000, CRC(d95220ee) SHA1(72259856bc2a12059ff481f7aab5ecc3118edd18) ) ROM_END @@ -269,5 +363,6 @@ ROM_END } // anonymous namespace -GAME( 2003, xypmd, 0, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di (V401CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) -GAME( 2003, xypmda, xypmd, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di (unknown ver)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) + +GAME( 2003, xypmd, 0, xypmd, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di Super (V401CN)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) +GAME( 1999, xypmda, xypmd, xypmda, xypmd, igs_68k_023vid_state, empty_init, ROT0, "IGS", "Xing Yun Pao Ma Di (unknown ver)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) From 773a4c8f6486394cd50c8c24b3baabaf17aa4a26 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 7 Mar 2025 00:46:08 +1100 Subject: [PATCH 102/272] -seta/rmhaihai.cpp: Added Real Mahjong Haihai DIP switch locations from manual. -cpu/drcbearm64.cpp: Added some glue for supporting memory access optimisations. --- src/devices/cpu/drcbearm64.cpp | 50 ++++++++++------ src/devices/cpu/drcbex64.cpp | 1 - src/mame/seta/rmhaihai.cpp | 101 ++++++++++++++++----------------- 3 files changed, 81 insertions(+), 71 deletions(-) diff --git a/src/devices/cpu/drcbearm64.cpp b/src/devices/cpu/drcbearm64.cpp index 5477343ce574c..cdac77ba37a43 100644 --- a/src/devices/cpu/drcbearm64.cpp +++ b/src/devices/cpu/drcbearm64.cpp @@ -422,6 +422,29 @@ class drcbe_arm64 : public drcbe_interface be_parameter_value m_value; }; + struct near_state + { + uint32_t emulated_flags; + }; + + using opcode_generate_func = void (drcbe_arm64::*)(asmjit::a64::Assembler &, const uml::instruction &); + struct opcode_table_entry + { + uml::opcode_t opcode; + opcode_generate_func func; + }; + + struct memory_accessors + { + resolved_memory_accessors resolved; + address_space::specific_access_info specific; + offs_t address_mask; + u8 high_bits; + bool no_mask; + bool mask_simple; + bool mask_high_bits; + }; + void op_handle(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_hash(asmjit::a64::Assembler &a, const uml::instruction &inst); void op_label(asmjit::a64::Assembler &a, const uml::instruction &inst); @@ -556,26 +579,11 @@ class drcbe_arm64 : public drcbe_interface uint8_t *m_baseptr; - struct near_state - { - uint32_t emulated_flags; - }; near_state &m_near; - using opcode_generate_func = void (drcbe_arm64::*)(asmjit::a64::Assembler &, const uml::instruction &); - struct opcode_table_entry - { - uml::opcode_t opcode; - opcode_generate_func func; - }; static const opcode_table_entry s_opcode_table_source[]; static opcode_generate_func s_opcode_table[uml::OP_MAX]; - struct memory_accessors - { - resolved_memory_accessors resolved; - address_space::specific_access_info specific; - }; resolved_member_function m_debug_cpu_instruction_hook; resolved_member_function m_drcmap_get_value; std::vector m_memory_accessors; @@ -1245,8 +1253,16 @@ drcbe_arm64::drcbe_arm64(drcuml_state &drcuml, device_t &device, drc_cache &cach { if (m_space[space]) { - m_memory_accessors[space].resolved.set(*m_space[space]); - m_memory_accessors[space].specific = m_space[space]->specific_accessors(); + auto &accessors = m_memory_accessors[space]; + accessors.resolved.set(*m_space[space]); + accessors.specific = m_space[space]->specific_accessors(); + accessors.address_mask = m_space[space]->addrmask() & make_bitmask(accessors.specific.address_width) & ~make_bitmask(accessors.specific.native_mask_bits); + offs_t const shiftedmask = accessors.address_mask >> accessors.specific.low_bits; + offs_t const nomask = ~offs_t(0); + accessors.high_bits = 32 - count_leading_zeros_32(shiftedmask); + accessors.no_mask = nomask == accessors.address_mask; + accessors.mask_simple = !accessors.no_mask && is_valid_immediate_mask(accessors.address_mask, 4); + accessors.mask_high_bits = (shiftedmask & (shiftedmask + 1)) != 0; } } } diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index d6dab04f58d9a..63d57ce6055a8 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -2850,7 +2850,6 @@ void drcbe_x64::op_read(Assembler &a, const instruction &inst) a.mov(Gpq(REG_PARAM1), ptr(rax, Gpd(REG_PARAM2), 3)); // load dispatch table entry if (accessors.specific.low_bits) a.mov(Gpd(REG_PARAM2), r10d); // restore masked address - } else { diff --git a/src/mame/seta/rmhaihai.cpp b/src/mame/seta/rmhaihai.cpp index 073be31b4e65f..87920b3198f94 100644 --- a/src/mame/seta/rmhaihai.cpp +++ b/src/mame/seta/rmhaihai.cpp @@ -31,10 +31,12 @@ driver by Nicola Salmoria ***************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/nvram.h" #include "sound/ay8910.h" #include "sound/msm5205.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -56,11 +58,15 @@ class rmhaihai_state : public driver_device m_key(*this, "KEY%u", 0) { } - void init_rmhaihai(); - void rmhaihai(machine_config &config); - void rmhaibl(machine_config &config); + void rmhaihai(machine_config &config) ATTR_COLD; + void rmhaisei(machine_config &config); + void rmhaibl(machine_config &config) ATTR_COLD; + + void init_rmhaihai() ATTR_COLD; protected: + virtual void video_start() override ATTR_COLD; + void videoram_w(offs_t offset, uint8_t data); void colorram_w(offs_t offset, uint8_t data); uint8_t keyboard_r(); @@ -69,8 +75,6 @@ class rmhaihai_state : public driver_device void ctrl_w(uint8_t data); void adpcm_w(uint8_t data); - virtual void video_start() override ATTR_COLD; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TILE_GET_INFO_MEMBER(get_bg_tile_info); @@ -94,14 +98,6 @@ class rmhaihai_state : public driver_device }; -class rmhaisei_state : public rmhaihai_state -{ -public: - using rmhaihai_state::rmhaihai_state; - void rmhaisei(machine_config &config); -}; - - class themj_state : public rmhaihai_state { public: @@ -110,18 +106,18 @@ class themj_state : public rmhaihai_state m_cpubank(*this, "cpubank%u", 1) { } - void themj(machine_config &config); + void themj(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; private: - required_memory_bank_array<2> m_cpubank; - void themj_io_map(address_map &map) ATTR_COLD; void themj_map(address_map &map) ATTR_COLD; void themj_rombank_w(uint8_t data); + + required_memory_bank_array<2> m_cpubank; }; @@ -179,7 +175,7 @@ uint8_t rmhaihai_state::keyboard_r() { for (int i = 0; i < 31; i++) { - if (m_key[i/16]->read() & (1 << (i & 15))) return i+1; + if (BIT(m_key[i >> 4]->read(), i & 0x0f)) return i+1; } if (m_key[1]->read() & 0x8000) return 0x80; // coin return 0; @@ -190,7 +186,6 @@ uint8_t rmhaihai_state::keyboard_r() case 0x5bf3: // themj, but the test is NOPed out! return 0xcc; // keyboard_cmd = 0xcb - case 0x13a: // additional checks done by rmhaijin if (m_keyboard_cmd == 0x3b) return 0xdd; if (m_keyboard_cmd == 0x85) return 0xdc; @@ -418,41 +413,41 @@ INPUT_PORTS_END static INPUT_PORTS_START( rmhaihai ) PORT_START("DSW2") - PORT_DIPNAME( 0x01, 0x01, "Unknown 2-1" ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xfe, 0xfe, DEF_STR( Difficulty ) ) - PORT_DIPSETTING( 0xfe, "1 (Easy)" ) - PORT_DIPSETTING( 0x7e, "2" ) - PORT_DIPSETTING( 0xbe, "3" ) - PORT_DIPSETTING( 0xde, "4" ) - PORT_DIPSETTING( 0xee, "5" ) - PORT_DIPSETTING( 0xf6, "6" ) - PORT_DIPSETTING( 0xfa, "7" ) - PORT_DIPSETTING( 0xfc, "8 (Difficult)" ) + PORT_DIPUNKNOWN_DIPLOC( 0x01, 0x01, "D. SW2:8" ) // NOT USED + PORT_DIPNAME( 0xfe, 0xfe, "Computer Win Probability" ) PORT_DIPLOCATION("D. SW2:7,6,5,4,3,2,1") // レベル設定コンピュータのあがる確率 + PORT_DIPSETTING( 0xfe, "20% (Weak)" ) // 弱い + PORT_DIPSETTING( 0x7e, "30%" ) + PORT_DIPSETTING( 0xbe, "40%" ) + PORT_DIPSETTING( 0xde, "50%" ) + PORT_DIPSETTING( 0xee, "60%" ) + PORT_DIPSETTING( 0xf6, "70&%" ) + PORT_DIPSETTING( 0xfa, "80%" ) + PORT_DIPSETTING( 0xfc, "90% (Strong)" ) // 強い PORT_START("DSW1") - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Free_Play ) ) - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_SERVICE( 0x02, IP_ACTIVE_LOW ) - PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coinage ) ) - PORT_DIPSETTING( 0x00, "A 2/1 B 1/2" ) - PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x04, "A 1/2 B 2/1" ) - PORT_DIPSETTING( 0x08, "A 1/3 B 3/1" ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Demo_Sounds ) ) - PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) - PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) - PORT_DIPSETTING( 0x40, DEF_STR( Cocktail ) ) - PORT_DIPNAME( 0x80, 0x80, "Medal" ) - PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x01, 0x01, DEF_STR(Free_Play) ) PORT_DIPLOCATION("D. SW1:8") // フリープレイ + PORT_DIPSETTING( 0x01, DEF_STR(Off) ) // ノーマル + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // フリープレイ + PORT_DIPNAME( 0x02, 0x02, DEF_STR(Service_Mode) ) PORT_DIPLOCATION("D. SW1:7") // テストモード + PORT_DIPSETTING( 0x02, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x0c, 0x0c, DEF_STR(Coinage) ) PORT_DIPLOCATION("D. SW1:6,5") // プレイ料金 + PORT_DIPSETTING( 0x00, "A 2/1 B 1/2" ) // 2コイン1クレジット + PORT_DIPSETTING( 0x0c, DEF_STR(1C_1C) ) // 1コイン1クレジット + PORT_DIPSETTING( 0x04, "A 1/2 B 2/1" ) // 1コイン2クレジット + PORT_DIPSETTING( 0x08, "A 1/3 B 3/1" ) // 1コイン3クレジット + PORT_DIPNAME( 0x10, 0x00, DEF_STR(Demo_Sounds) ) PORT_DIPLOCATION("D. SW1:4") // DEMO音楽 + PORT_DIPSETTING( 0x10, DEF_STR(Off) ) // 無 + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 有 + PORT_DIPNAME( 0x20, 0x20, DEF_STR(Flip_Screen) ) PORT_DIPLOCATION("D. SW1:3") // 画面反転 + PORT_DIPSETTING( 0x20, DEF_STR(Off) ) // ノーマル + PORT_DIPSETTING( 0x00, DEF_STR(On) ) // 反転 + PORT_DIPNAME( 0x40, 0x00, DEF_STR(Cabinet) ) PORT_DIPLOCATION("D. SW1:2") // スタイル + PORT_DIPSETTING( 0x40, DEF_STR(Cocktail) ) // テーブル + PORT_DIPSETTING( 0x00, DEF_STR(Upright) ) // アップライト + PORT_DIPNAME( 0x80, 0x80, "Medal" ) PORT_DIPLOCATION("D. SW1:1") // NOT USED + PORT_DIPSETTING( 0x80, DEF_STR(Off) ) + PORT_DIPSETTING( 0x00, DEF_STR(On) ) PORT_INCLUDE( mjctrl ) INPUT_PORTS_END @@ -601,7 +596,7 @@ void rmhaihai_state::rmhaibl(machine_config &config) m_maincpu->set_addrmap(AS_IO, &rmhaihai_state::rmhaihaibl_io_map); } -void rmhaisei_state::rmhaisei(machine_config &config) +void rmhaihai_state::rmhaisei(machine_config &config) { rmhaihai(config); @@ -876,6 +871,6 @@ GAME( 1985, rmhaihai2, rmhaihai, rmhaihai, rmhaihai, rmhaihai_state, init_rmhai GAME( 1985, rmhaihaibl, rmhaihai, rmhaibl, rmhaibl, rmhaihai_state, init_rmhaihai, ROT0, "bootleg", "Real Mahjong Haihai (Japan, bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, init_rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, init_rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaisei_state, init_rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, init_rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, themj, 0, themj, rmhaihai, themj_state, init_rmhaihai, ROT0, "Visco", "The Mah-jong (Japan, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, themj2, themj, themj, rmhaihai, themj_state, init_rmhaihai, ROT0, "Visco", "The Mah-jong (Japan, set 2)", MACHINE_SUPPORTS_SAVE ) From 5da68719826d80d7f804eacc70f799551bc7e61f Mon Sep 17 00:00:00 2001 From: cam900 Date: Thu, 6 Mar 2025 23:08:14 +0900 Subject: [PATCH 103/272] snk/snk_bbusters_spr.cpp, snk/bbusters.cpp, snk/mechatt.cpp: Cleaned up code: (#13448) * Reduced literal tag use, use bit extraction helpers. * Made some variables const, improved member names and tags, cleaned up formatting. --- src/mame/snk/bbusters.cpp | 119 +++++++++++++------------- src/mame/snk/mechatt.cpp | 135 +++++++++++++++--------------- src/mame/snk/snk_bbusters_spr.cpp | 22 ++--- 3 files changed, 137 insertions(+), 139 deletions(-) diff --git a/src/mame/snk/bbusters.cpp b/src/mame/snk/bbusters.cpp index 9d8c0246603c6..db11b634a33e3 100644 --- a/src/mame/snk/bbusters.cpp +++ b/src/mame/snk/bbusters.cpp @@ -130,14 +130,14 @@ class bbusters_state : public driver_device m_sprites(*this, "sprites%u", 1U), m_spriteram(*this, "spriteram%u", 1U), m_soundlatch(*this, "soundlatch%u", 1U), - m_tx_videoram(*this, "tx_videoram"), - m_pf_data(*this, "pf%u_data", 1U), - m_pf_scroll_data(*this, "pf%u_scroll_data", 1U), + m_tx_vram(*this, "tx_videoram"), + m_pf_vram(*this, "pf%u_vram", 1U), + m_pf_scroll_reg(*this, "pf%u_scroll_reg", 1U), m_gun_recoil(*this, "Player%u_Gun_Recoil", 1U), m_eprom_data(*this, "eeprom") { } - void bbusters(machine_config &config); + void bbusters(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -152,9 +152,9 @@ class bbusters_state : public driver_device required_device_array m_spriteram; required_device_array m_soundlatch; - required_shared_ptr m_tx_videoram; - required_shared_ptr_array m_pf_data; - required_shared_ptr_array m_pf_scroll_data; + required_shared_ptr m_tx_vram; + required_shared_ptr_array m_pf_vram; + required_shared_ptr_array m_pf_scroll_reg; output_finder<3> m_gun_recoil; required_shared_ptr m_eprom_data; @@ -162,29 +162,27 @@ class bbusters_state : public driver_device tilemap_t *m_fix_tilemap = nullptr; tilemap_t *m_pf_tilemap[2]{}; + bitmap_ind16 m_bitmap_sprites[2]; + TILE_GET_INFO_MEMBER(get_tile_info); template TILE_GET_INFO_MEMBER(get_pf_tile_info); void sound_cpu_w(uint8_t data); - void video_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - template void pf_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + template void pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void coin_counter_w(uint8_t data); - void bbusters_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void sound_portmap(address_map &map) ATTR_COLD; - uint16_t eprom_r(offs_t offset); - void three_gun_output_w(uint16_t data); - - void mixlow(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect); - void mix(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect); + void gun_output_w(uint16_t data); template void mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect, Proc MIX); - bitmap_ind16 m_bitmap_sprites[2]; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void sound_portmap(address_map &map) ATTR_COLD; }; void bbusters_state::machine_start() @@ -204,16 +202,16 @@ uint16_t bbusters_state::eprom_r(offs_t offset) return (m_eprom_data[offset] & 0xff) | 0xff00; } -void bbusters_state::three_gun_output_w(uint16_t data) +void bbusters_state::gun_output_w(uint16_t data) { for (int i = 0; i < 3; i++) m_gun_recoil[i] = BIT(data, i); } template -void bbusters_state::pf_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void bbusters_state::pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_pf_data[Layer][offset]); + COMBINE_DATA(&m_pf_vram[Layer][offset]); m_pf_tilemap[Layer]->mark_tile_dirty(offset); } @@ -226,22 +224,22 @@ void bbusters_state::coin_counter_w(uint8_t data) TILE_GET_INFO_MEMBER(bbusters_state::get_tile_info) { - uint16_t tile = m_tx_videoram[tile_index]; + uint16_t const tile = m_tx_vram[tile_index]; - tileinfo.set(0, tile&0xfff, tile>>12, 0); + tileinfo.set(0, tile & 0xfff, tile >> 12, 0); } template TILE_GET_INFO_MEMBER(bbusters_state::get_pf_tile_info) { - uint16_t tile = m_pf_data[Layer][tile_index]; + uint16_t const tile = m_pf_vram[Layer][tile_index]; - tileinfo.set(Gfx, tile&0xfff, tile>>12, 0); + tileinfo.set(Gfx, tile & 0xfff, tile >> 12, 0); } -void bbusters_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void bbusters_state::tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_tx_videoram[offset]); + COMBINE_DATA(&m_tx_vram[offset]); m_fix_tilemap->mark_tile_dirty(offset); } @@ -258,12 +256,11 @@ void bbusters_state::video_start() m_pf_tilemap[0]->set_transparent_pen(15); - for (int i = 0; i < 2; i++) + for (auto &bitmap : m_bitmap_sprites) { - m_screen->register_screen_bitmap(m_bitmap_sprites[i]); - m_bitmap_sprites[i].fill(0xffff); + m_screen->register_screen_bitmap(bitmap); + bitmap.fill(0xffff); } - } /******************************************************************************/ @@ -275,11 +272,11 @@ void bbusters_state::mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *srcbuf = &srcbitmap.pix(y); - uint16_t *dstbuf = &bitmap.pix(y); + uint16_t const *const srcbuf = &srcbitmap.pix(y); + uint16_t *const dstbuf = &bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - uint16_t srcdat = srcbuf[x]; + uint16_t const srcdat = srcbuf[x]; if ((srcdat & 0xf) != 0xf) MIX(srcdat, x, dstbuf); } @@ -293,10 +290,10 @@ uint32_t bbusters_state::screen_update(screen_device &screen, bitmap_ind16 &bitm m_sprites[1]->draw_sprites(m_bitmap_sprites[1], cliprect); m_sprites[0]->draw_sprites(m_bitmap_sprites[0], cliprect); - m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_data[0][0]); - m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_data[0][1]); - m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_data[1][0]); - m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_data[1][1]); + m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_reg[0][0]); + m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_reg[0][1]); + m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_reg[1][0]); + m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_reg[1][1]); m_pf_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); @@ -313,20 +310,20 @@ uint32_t bbusters_state::screen_update(screen_device &screen, bitmap_ind16 &bitm /*******************************************************************************/ -void bbusters_state::bbusters_map(address_map &map) +void bbusters_state::main_map(address_map &map) { map(0x000000, 0x07ffff).rom(); - map(0x080000, 0x08ffff).ram().share("ram"); - map(0x090000, 0x090fff).ram().w(FUNC(bbusters_state::video_w)).share("tx_videoram"); + map(0x080000, 0x08ffff).ram(); + map(0x090000, 0x090fff).ram().w(FUNC(bbusters_state::tx_vram_w)).share(m_tx_vram); map(0x0a0000, 0x0a0fff).ram().share("spriteram1"); map(0x0a1000, 0x0a7fff).ram(); /* service mode */ map(0x0a8000, 0x0a8fff).ram().share("spriteram2"); map(0x0a9000, 0x0affff).ram(); /* service mode */ - map(0x0b0000, 0x0b1fff).ram().w(FUNC(bbusters_state::pf_w<0>)).share("pf1_data"); - map(0x0b2000, 0x0b3fff).ram().w(FUNC(bbusters_state::pf_w<1>)).share("pf2_data"); + map(0x0b0000, 0x0b1fff).ram().w(FUNC(bbusters_state::pf_vram_w<0>)).share(m_pf_vram[0]); + map(0x0b2000, 0x0b3fff).ram().w(FUNC(bbusters_state::pf_vram_w<1>)).share(m_pf_vram[1]); map(0x0b4000, 0x0b5fff).ram(); /* service mode */ - map(0x0b8000, 0x0b8003).writeonly().share("pf1_scroll_data"); - map(0x0b8008, 0x0b800b).writeonly().share("pf2_scroll_data"); + map(0x0b8000, 0x0b8003).writeonly().share(m_pf_scroll_reg[0]); + map(0x0b8008, 0x0b800b).writeonly().share(m_pf_scroll_reg[1]); map(0x0d0000, 0x0d0fff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x0e0000, 0x0e0001).portr("COINS"); /* Coins */ map(0x0e0002, 0x0e0003).portr("IN0"); /* Player 1 & 2 */ @@ -336,9 +333,9 @@ void bbusters_state::bbusters_map(address_map &map) map(0x0e0019, 0x0e0019).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)); map(0x0e8000, 0x0e8003).rw("adc", FUNC(upd7004_device::read), FUNC(upd7004_device::write)).umask16(0x00ff); map(0x0f0000, 0x0f0001).w(FUNC(bbusters_state::coin_counter_w)); - map(0x0f0008, 0x0f0009).w(FUNC(bbusters_state::three_gun_output_w)); + map(0x0f0008, 0x0f0009).w(FUNC(bbusters_state::gun_output_w)); map(0x0f0019, 0x0f0019).w(FUNC(bbusters_state::sound_cpu_w)); - map(0x0f8000, 0x0f80ff).r(FUNC(bbusters_state::eprom_r)).writeonly().share("eeprom"); /* Eeprom */ + map(0x0f8000, 0x0f80ff).r(FUNC(bbusters_state::eprom_r)).writeonly().share(m_eprom_data); /* Eeprom */ } /*******************************************************************************/ @@ -464,9 +461,9 @@ INPUT_PORTS_END /******************************************************************************/ static GFXDECODE_START( gfx_bbusters ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) - GFXDECODE_ENTRY( "gfx5", 0, gfx_8x8x4_col_2x2_group_packed_msb, 1024+256, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "bg1_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) + GFXDECODE_ENTRY( "bg2_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 1024+256, 16 ) GFXDECODE_END /******************************************************************************/ @@ -475,7 +472,7 @@ void bbusters_state::bbusters(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &bbusters_state::bbusters_map); + m_maincpu->set_addrmap(AS_PROGRAM, &bbusters_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(bbusters_state::irq6_line_hold)); Z80(config, m_audiocpu, 4000000); // Accurate @@ -561,10 +558,10 @@ ROM_START( bbusters ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -607,10 +604,10 @@ ROM_START( bbustersu ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -653,10 +650,10 @@ ROM_START( bbustersua ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -699,10 +696,10 @@ ROM_START( bbustersj ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ @@ -745,10 +742,10 @@ ROM_START( bbustersja ) ROM_LOAD16_WORD_SWAP( "bb-f23.l13", 0x100000, 0x80000, CRC(c89fe0da) SHA1(92be860a7191e7473c42aa2da981eda873219d3d) ) ROM_LOAD16_WORD_SWAP( "bb-f24.l15", 0x180000, 0x80000, CRC(e0d81359) SHA1(2213c17651b6c023a456447f352b0739439f913a) ) - ROM_REGION( 0x80000, "gfx4", 0 ) + ROM_REGION( 0x80000, "bg1_tiles", 0 ) ROM_LOAD( "bb-back1.m4", 0x000000, 0x80000, CRC(b5445313) SHA1(3c99b557b2af30ff0fbc8a7dc6c40448c4f327db) ) - ROM_REGION( 0x80000, "gfx5", 0 ) + ROM_REGION( 0x80000, "bg2_tiles", 0 ) ROM_LOAD( "bb-back2.m6", 0x000000, 0x80000, CRC(8be996f6) SHA1(1e2c56f4c24793f806d7b366b92edc03145ae94c) ) ROM_REGION( 0x10000, "sprites1:scale_table", 0 ) /* Zoom table - same rom exists in 4 different locations on the board */ diff --git a/src/mame/snk/mechatt.cpp b/src/mame/snk/mechatt.cpp index 1086a95540043..3c41ea4117cc4 100644 --- a/src/mame/snk/mechatt.cpp +++ b/src/mame/snk/mechatt.cpp @@ -156,17 +156,17 @@ class mechatt_state : public driver_device m_audiocpu(*this, "audiocpu"), m_screen(*this, "screen"), m_gfxdecode(*this, "gfxdecode"), - m_sprites(*this, "sprites1"), - m_spriteram(*this, "spriteram1"), + m_sprites(*this, "sprites"), + m_spriteram(*this, "spriteram"), m_soundlatch(*this, "soundlatch%u", 1U), - m_tx_videoram(*this, "tx_videoram"), - m_pf_data(*this, "pf%u_data", 1U), - m_pf_scroll_data(*this, "pf%u_scroll_data", 1U), + m_tx_vram(*this, "tx_videoram"), + m_pf_vram(*this, "pf%u_vram", 1U), + m_pf_scroll_reg(*this, "pf%u_scroll_reg", 1U), m_gun_io(*this, { "GUNX1", "GUNY1", "GUNX2", "GUNY2" }), m_gun_recoil(*this, "Player%u_Gun_Recoil", 1U) { } - void mechatt(machine_config &config); + void mechatt(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -180,35 +180,36 @@ class mechatt_state : public driver_device required_device m_sprites; required_device m_spriteram; required_device_array m_soundlatch; - required_shared_ptr m_tx_videoram; - required_shared_ptr_array m_pf_data; - required_shared_ptr_array m_pf_scroll_data; + required_shared_ptr m_tx_vram; + required_shared_ptr_array m_pf_vram; + required_shared_ptr_array m_pf_scroll_reg; required_ioport_array<4> m_gun_io; output_finder<2> m_gun_recoil; tilemap_t *m_fix_tilemap = nullptr; tilemap_t *m_pf_tilemap[2]{}; + bitmap_ind16 m_bitmap_sprites; + TILE_GET_INFO_MEMBER(get_tile_info); template TILE_GET_INFO_MEMBER(get_pf_tile_info); void sound_cpu_w(uint8_t data); - void video_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - template void pf_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + template void pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void coin_counter_w(uint8_t data); - void mechatt_map(address_map &map) ATTR_COLD; - void sound_map(address_map &map) ATTR_COLD; - void sounda_portmap(address_map &map) ATTR_COLD; - - void two_gun_output_w(uint16_t data); - uint16_t mechatt_gun_r(offs_t offset); + void gun_output_w(uint16_t data); + uint16_t gun_r(offs_t offset); template void mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, const rectangle &cliprect, Proc MIX); - bitmap_ind16 m_bitmap_sprites; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map) ATTR_COLD; + void sound_map(address_map &map) ATTR_COLD; + void sounda_portmap(address_map &map) ATTR_COLD; }; /******************************************************************************/ @@ -225,9 +226,9 @@ void mechatt_state::sound_cpu_w(uint8_t data) } template -void mechatt_state::pf_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void mechatt_state::pf_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_pf_data[Layer][offset]); + COMBINE_DATA(&m_pf_vram[Layer][offset]); m_pf_tilemap[Layer]->mark_tile_dirty(offset); } @@ -240,20 +241,20 @@ void mechatt_state::coin_counter_w(uint8_t data) TILE_GET_INFO_MEMBER(mechatt_state::get_tile_info) { - uint16_t tile = m_tx_videoram[tile_index]; - tileinfo.set(0, tile&0xfff, tile>>12, 0); + uint16_t const tile = m_tx_vram[tile_index]; + tileinfo.set(0, tile & 0xfff, tile >> 12, 0); } template TILE_GET_INFO_MEMBER(mechatt_state::get_pf_tile_info) { - uint16_t tile = m_pf_data[Layer][tile_index]; - tileinfo.set(Gfx, tile&0xfff, tile>>12, 0); + uint16_t const tile = m_pf_vram[Layer][tile_index]; + tileinfo.set(Gfx, tile & 0xfff, tile >> 12, 0); } -void mechatt_state::video_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void mechatt_state::tx_vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { - COMBINE_DATA(&m_tx_videoram[offset]); + COMBINE_DATA(&m_tx_vram[offset]); m_fix_tilemap->mark_tile_dirty(offset); } @@ -278,11 +279,11 @@ void mechatt_state::mix_sprites(bitmap_ind16 &bitmap, bitmap_ind16 &srcbitmap, c { for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { - uint16_t *srcbuf = &srcbitmap.pix(y); - uint16_t *dstbuf = &bitmap.pix(y); + uint16_t const *const srcbuf = &srcbitmap.pix(y); + uint16_t *const dstbuf = &bitmap.pix(y); for (int x = cliprect.min_x; x <= cliprect.max_x; x++) { - uint16_t srcdat = srcbuf[x]; + uint16_t const srcdat = srcbuf[x]; if ((srcdat & 0xf) != 0xf) MIX(srcdat, x, dstbuf); } @@ -294,10 +295,10 @@ uint32_t mechatt_state::screen_update(screen_device &screen, bitmap_ind16 &bitma m_bitmap_sprites.fill(0xffff); m_sprites->draw_sprites(m_bitmap_sprites, cliprect); - m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_data[0][0]); - m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_data[0][1]); - m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_data[1][0]); - m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_data[1][1]); + m_pf_tilemap[0]->set_scrollx(0, m_pf_scroll_reg[0][0]); + m_pf_tilemap[0]->set_scrolly(0, m_pf_scroll_reg[0][1]); + m_pf_tilemap[1]->set_scrollx(0, m_pf_scroll_reg[1][0]); + m_pf_tilemap[1]->set_scrolly(0, m_pf_scroll_reg[1][1]); m_pf_tilemap[1]->draw(screen, bitmap, cliprect, 0, 0); @@ -312,13 +313,13 @@ uint32_t mechatt_state::screen_update(screen_device &screen, bitmap_ind16 &bitma /*******************************************************************************/ -void mechatt_state::two_gun_output_w(uint16_t data) +void mechatt_state::gun_output_w(uint16_t data) { for (int i = 0; i < 2; i++) m_gun_recoil[i] = BIT(data, i); } -uint16_t mechatt_state::mechatt_gun_r(offs_t offset) +uint16_t mechatt_state::gun_r(offs_t offset) { int x = m_gun_io[offset ? 2 : 0]->read(); int y = m_gun_io[offset ? 3 : 1]->read(); @@ -331,23 +332,23 @@ uint16_t mechatt_state::mechatt_gun_r(offs_t offset) return x | (y << 8); } -void mechatt_state::mechatt_map(address_map &map) +void mechatt_state::main_map(address_map &map) { map(0x000000, 0x06ffff).rom(); - map(0x070000, 0x07ffff).ram().share("ram"); - map(0x090000, 0x090fff).ram().w(FUNC(mechatt_state::video_w)).share("tx_videoram"); - map(0x0a0000, 0x0a0fff).ram().share("spriteram1"); + map(0x070000, 0x07ffff).ram(); + map(0x090000, 0x090fff).ram().w(FUNC(mechatt_state::tx_vram_w)).share(m_tx_vram); + map(0x0a0000, 0x0a0fff).ram().share("spriteram"); map(0x0a1000, 0x0a7fff).nopw(); - map(0x0b0000, 0x0b3fff).ram().w(FUNC(mechatt_state::pf_w<0>)).share("pf1_data"); - map(0x0b8000, 0x0b8003).writeonly().share("pf1_scroll_data"); - map(0x0c0000, 0x0c3fff).ram().w(FUNC(mechatt_state::pf_w<1>)).share("pf2_data"); - map(0x0c8000, 0x0c8003).writeonly().share("pf2_scroll_data"); + map(0x0b0000, 0x0b3fff).ram().w(FUNC(mechatt_state::pf_vram_w<0>)).share(m_pf_vram[0]); + map(0x0b8000, 0x0b8003).writeonly().share(m_pf_scroll_reg[0]); + map(0x0c0000, 0x0c3fff).ram().w(FUNC(mechatt_state::pf_vram_w<1>)).share(m_pf_vram[1]); + map(0x0c8000, 0x0c8003).writeonly().share(m_pf_scroll_reg[1]); map(0x0d0000, 0x0d07ff).ram().w("palette", FUNC(palette_device::write16)).share("palette"); map(0x0e0000, 0x0e0001).portr("IN0"); map(0x0e0002, 0x0e0003).portr("DSW1"); - map(0x0e0004, 0x0e0007).r(FUNC(mechatt_state::mechatt_gun_r)); + map(0x0e0004, 0x0e0007).r(FUNC(mechatt_state::gun_r)); map(0x0e4000, 0x0e4001).w(FUNC(mechatt_state::coin_counter_w)); - map(0x0e4002, 0x0e4003).w(FUNC(mechatt_state::two_gun_output_w)); + map(0x0e4002, 0x0e4003).w(FUNC(mechatt_state::gun_output_w)); map(0x0e8001, 0x0e8001).r(m_soundlatch[1], FUNC(generic_latch_8_device::read)).w(FUNC(mechatt_state::sound_cpu_w)); } @@ -476,9 +477,9 @@ INPUT_PORTS_END /******************************************************************************/ static GFXDECODE_START( gfx_mechatt ) - GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, gfx_8x8x4_col_2x2_group_packed_msb, 512, 16 ) - GFXDECODE_ENTRY( "gfx4", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) + GFXDECODE_ENTRY( "tx_tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) + GFXDECODE_ENTRY( "bg1_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 512, 16 ) + GFXDECODE_ENTRY( "bg2_tiles", 0, gfx_8x8x4_col_2x2_group_packed_msb, 768, 16 ) GFXDECODE_END @@ -488,7 +489,7 @@ void mechatt_state::mechatt(machine_config &config) { /* basic machine hardware */ M68000(config, m_maincpu, 12000000); - m_maincpu->set_addrmap(AS_PROGRAM, &mechatt_state::mechatt_map); + m_maincpu->set_addrmap(AS_PROGRAM, &mechatt_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(mechatt_state::irq4_line_hold)); Z80(config, m_audiocpu, 4000000); /* Accurate */ @@ -510,9 +511,9 @@ void mechatt_state::mechatt(machine_config &config) BUFFERED_SPRITERAM16(config, m_spriteram); SNK_BBUSTERS_SPR(config, m_sprites, 0); - m_sprites->set_scaletable_tag("sprites1:scale_table"); + m_sprites->set_scaletable_tag("sprites:scale_table"); m_sprites->set_palette("palette"); - m_sprites->set_spriteram_tag("spriteram1"); + m_sprites->set_spriteram_tag("spriteram"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); @@ -544,22 +545,22 @@ ROM_START( mechatt ) ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-2 board ROM_LOAD16_WORD_SWAP( "mao89p13.bin", 0x000000, 0x80000, CRC(8bcb16cf) SHA1(409ee1944188d9ce39adce29b1df029b560dd5b0) ) ROM_LOAD16_WORD_SWAP( "ma189p15.bin", 0x080000, 0x80000, CRC(b84d9658) SHA1(448adecb0067d8f5b219ec2f94a8dec84187a554) ) ROM_LOAD16_WORD_SWAP( "ma289p17.bin", 0x100000, 0x80000, CRC(6cbe08ac) SHA1(8f81f6e92b84ab6867452011d52f3e7689c62a1a) ) ROM_LOAD16_WORD_SWAP( "ma389m15.bin", 0x180000, 0x80000, CRC(34d4585e) SHA1(38d9fd5d775e4b3c8b8b487a6ba9b8bdcb3274b0) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab189a2.bin", 0x000000, 0x80000, CRC(e1c8b4d0) SHA1(2f8a1839cca892f8380c7cffe7a12e615d38fd55) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab289c2.bin", 0x000000, 0x80000, CRC(14f97ceb) SHA1(a22033532ea616dc3a3db8b66ad6ccc6172ed7cc) ) ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -577,7 +578,7 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-6 sub board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-6 sub board ROM_LOAD16_BYTE( "s_9.a1", 0x000001, 0x20000, CRC(6e8e194c) SHA1(02bbd573a322a3f7f8e92ccceebffdd598b5489e) ) // these 4 == mao89p13.bin ROM_LOAD16_BYTE( "s_1.b1", 0x000000, 0x20000, CRC(fd9161ed) SHA1(b3e2434dd9cb1cafe1022774b863b5f1a008a9d2) ) ROM_LOAD16_BYTE( "s_10.a2", 0x040001, 0x20000, CRC(fad6a1ab) SHA1(5347b4493c8004dc8cedc0b37aba494f203142b8) ) @@ -595,13 +596,13 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_LOAD16_BYTE( "s_16.a8", 0x1c0001, 0x20000, CRC(70f28040) SHA1(91012728953563fcc576725337e6ba7e1b49d1ba) ) ROM_LOAD16_BYTE( "s_8.b8", 0x1c0000, 0x20000, CRC(a6f8574f) SHA1(87c041669b2eaec495ae10a6f45b6668accb92bf) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_21.b3", 0x000000, 0x20000, CRC(701a0072) SHA1(b03b6fa18e0cfcd5c7c541025fa2d3632d2f8387) ) ROM_LOAD( "s_22.b4", 0x020000, 0x20000, CRC(34e6225c) SHA1(f6335084f4f4c7a4b6528e6ad74962b88f81e3bc) ) ROM_LOAD( "s_23.b5", 0x040000, 0x20000, CRC(9a7399d3) SHA1(04e0327b0da75f621b51e1831cbdc4537082e32b) ) ROM_LOAD( "s_24.b6", 0x060000, 0x20000, CRC(f097459d) SHA1(466364677f048519eb2894ddecf76f5c52f6afe9) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_17.a3", 0x000000, 0x20000, CRC(cc47c4a3) SHA1(140f53b671b4eaed6fcc516c4018f07a6d7c2290) ) ROM_LOAD( "s_18.a4", 0x020000, 0x20000, CRC(a04377e8) SHA1(841c6c3073b137f6a5c875db32039186c014f785) ) ROM_LOAD( "s_19.a5", 0x040000, 0x20000, CRC(b07f5289) SHA1(8817bd225edf9b0fa439b220617f925365e39253) ) @@ -610,7 +611,7 @@ ROM_START( mechattj ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub board ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -628,22 +629,22 @@ ROM_START( mechattu ) ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-2 board ROM_LOAD16_WORD_SWAP( "mao89p13.bin", 0x000000, 0x80000, CRC(8bcb16cf) SHA1(409ee1944188d9ce39adce29b1df029b560dd5b0) ) ROM_LOAD16_WORD_SWAP( "ma189p15.bin", 0x080000, 0x80000, CRC(b84d9658) SHA1(448adecb0067d8f5b219ec2f94a8dec84187a554) ) ROM_LOAD16_WORD_SWAP( "ma289p17.bin", 0x100000, 0x80000, CRC(6cbe08ac) SHA1(8f81f6e92b84ab6867452011d52f3e7689c62a1a) ) ROM_LOAD16_WORD_SWAP( "ma389m15.bin", 0x180000, 0x80000, CRC(34d4585e) SHA1(38d9fd5d775e4b3c8b8b487a6ba9b8bdcb3274b0) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab189a2.bin", 0x000000, 0x80000, CRC(e1c8b4d0) SHA1(2f8a1839cca892f8380c7cffe7a12e615d38fd55) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // Located on the A8002-2 board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "mab289c2.bin", 0x000000, 0x80000, CRC(14f97ceb) SHA1(a22033532ea616dc3a3db8b66ad6ccc6172ed7cc) ) ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END @@ -662,7 +663,7 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_REGION( 0x020000, "tx_tiles", 0 ) // Located on the A8002-2 board ROM_LOAD( "ma_1.l2", 0x000000, 0x10000, CRC(24766917) SHA1(9082a8ae849605ce65b5a0493ae69cfe282f7e7b) ) - ROM_REGION( 0x200000, "sprites1", 0 ) // Located on the A8002-6 sub board + ROM_REGION( 0x200000, "sprites", 0 ) // Located on the A8002-6 sub board ROM_LOAD16_BYTE( "s_9.a1", 0x000001, 0x20000, CRC(6e8e194c) SHA1(02bbd573a322a3f7f8e92ccceebffdd598b5489e) ) // these 4 == mao89p13.bin ROM_LOAD16_BYTE( "s_1.b1", 0x000000, 0x20000, CRC(fd9161ed) SHA1(b3e2434dd9cb1cafe1022774b863b5f1a008a9d2) ) ROM_LOAD16_BYTE( "s_10.a2", 0x040001, 0x20000, CRC(fad6a1ab) SHA1(5347b4493c8004dc8cedc0b37aba494f203142b8) ) @@ -680,13 +681,13 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_LOAD16_BYTE( "s_16.a8", 0x1c0001, 0x20000, CRC(70f28040) SHA1(91012728953563fcc576725337e6ba7e1b49d1ba) ) ROM_LOAD16_BYTE( "s_8.b8", 0x1c0000, 0x20000, CRC(a6f8574f) SHA1(87c041669b2eaec495ae10a6f45b6668accb92bf) ) - ROM_REGION( 0x80000, "gfx3", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg1_tiles", 0 ) // these 4 == mab189a2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_21.b3", 0x000000, 0x20000, CRC(701a0072) SHA1(b03b6fa18e0cfcd5c7c541025fa2d3632d2f8387) ) ROM_LOAD( "s_22.b4", 0x020000, 0x20000, CRC(34e6225c) SHA1(f6335084f4f4c7a4b6528e6ad74962b88f81e3bc) ) ROM_LOAD( "s_23.b5", 0x040000, 0x20000, CRC(9a7399d3) SHA1(04e0327b0da75f621b51e1831cbdc4537082e32b) ) ROM_LOAD( "s_24.b6", 0x060000, 0x20000, CRC(f097459d) SHA1(466364677f048519eb2894ddecf76f5c52f6afe9) ) - ROM_REGION( 0x80000, "gfx4", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board + ROM_REGION( 0x80000, "bg2_tiles", 0 ) // these 4 == mab289c2.bin - Located on the A8002-5 sub board ROM_LOAD( "s_17.a3", 0x000000, 0x20000, CRC(cc47c4a3) SHA1(140f53b671b4eaed6fcc516c4018f07a6d7c2290) ) ROM_LOAD( "s_18.a4", 0x020000, 0x20000, CRC(a04377e8) SHA1(841c6c3073b137f6a5c875db32039186c014f785) ) ROM_LOAD( "s_19.a5", 0x040000, 0x20000, CRC(b07f5289) SHA1(8817bd225edf9b0fa439b220617f925365e39253) ) @@ -695,7 +696,7 @@ ROM_START( mechattu1 ) // Uses EPROMs on official SNK A8002-5 & A8002-6 sub boar ROM_REGION( 0x20000, "ymsnd", 0 ) // Located on the A8002-1 main board ROM_LOAD( "ma_2.d10", 0x000000, 0x20000, CRC(ea4cc30d) SHA1(d8f089fc0ce76309411706a8110ad907f93dc97e) ) - ROM_REGION( 0x20000, "sprites1:scale_table", 0 ) // Zoom table - Located on the A8002-2 board + ROM_REGION( 0x20000, "sprites:scale_table", 0 ) // Zoom table - Located on the A8002-2 board ROM_LOAD( "ma_8.f10", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) ROM_LOAD( "ma_9.f12", 0x000000, 0x10000, CRC(61f3de03) SHA1(736f9634fe054ea68a2aa90a743bd0dc320f23c9) ) // identical to ma_8.f10 ROM_END diff --git a/src/mame/snk/snk_bbusters_spr.cpp b/src/mame/snk/snk_bbusters_spr.cpp index 1dc4ca27e72d5..fd56116111b66 100644 --- a/src/mame/snk/snk_bbusters_spr.cpp +++ b/src/mame/snk/snk_bbusters_spr.cpp @@ -98,7 +98,7 @@ inline const uint8_t *snk_bbusters_spr_device::get_source_ptr(gfx_element *tileg break; } - return tilegfx->get_data((sprite + code) % tilegfx->elements()) + ((dy % 16) * tilegfx->rowbytes()); + return tilegfx->get_data((sprite + code) % tilegfx->elements()) + ((dy & 0xf) * tilegfx->rowbytes()); } void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cliprect, int x, int y, int size, int flipx, int flipy, uint32_t sprite, int color, int block) @@ -106,10 +106,10 @@ void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cl // TODO: respect cliprect gfx_element *tilegfx = gfx(0); - pen_t pen_base = tilegfx->colorbase() + tilegfx->granularity() * (color % tilegfx->colors()); - uint32_t xinc = (m_scale_line_count * 0x10000) / size; + pen_t const pen_base = tilegfx->colorbase() + tilegfx->granularity() * (color % tilegfx->colors()); + uint32_t const xinc = (m_scale_line_count * 0x10000) / size; int dy = y; - int ex = m_scale_line_count; + int const ex = m_scale_line_count; while (m_scale_line_count) { @@ -130,11 +130,11 @@ void snk_bbusters_spr_device::draw_block(bitmap_ind16 &dest, const rectangle &cl for (int sx = 0; sx < size; sx++) { - if ((sx % 16) == 0) + if ((sx & 0xf) == 0) srcptr = get_source_ptr(tilegfx, sprite, sx, srcline, block); - uint8_t pixel = *srcptr++; - if (pixel != 15) + uint8_t const pixel = *srcptr++; + if (pixel != 0xf) destline[(x + (x_index >> 16)) & 0x1ff] = pen_base + pixel; if (flipx) @@ -184,14 +184,14 @@ void snk_bbusters_spr_device::draw_sprites(bitmap_ind16 &bitmap, const rectangle Block type 3: 0x00 = no scale, 0x3f == half size - 128 pixel sprite */ + int const block = (colour >> 8) & 0x3; + bool const fy = BIT(colour, 10); + bool const fx = BIT(colour, 11); colour >>= 12; - int block = (sprram[offs + 0] >> 8) & 0x3; - int fy = sprram[offs + 0] & 0x400; - int fx = sprram[offs + 0] & 0x800; sprite &= 0x3fff; int scale; - switch ((sprram[offs + 0] >> 8) & 0x3) + switch (block) { case 0: scale = sprram[offs + 0] & 0x7; From 6192e7bc061cf5b28bb828fa4e3e51c51caee2d2 Mon Sep 17 00:00:00 2001 From: Vincent-Halver Date: Thu, 6 Mar 2025 06:25:00 -0800 Subject: [PATCH 104/272] philips/mcd212.cpp: Fixed handling of transparent layers and simplified code. (#13432) * Only execute the first matte that triggers on an X coordinate. * Ignore transparent layers when mixing. * Show the backdrop when both layers are transparent. --- src/mame/philips/mcd212.cpp | 278 ++++++++++++------------------------ 1 file changed, 95 insertions(+), 183 deletions(-) diff --git a/src/mame/philips/mcd212.cpp b/src/mame/philips/mcd212.cpp index dab10c44e6e08..e5dad0e2ae987 100644 --- a/src/mame/philips/mcd212.cpp +++ b/src/mame/philips/mcd212.cpp @@ -62,133 +62,69 @@ void mcd212_device::update_matte_arrays() const int num_mattes = BIT(m_image_coding_method, ICM_NM_BIT) ? 2 : 1; const bool matte_flag = BIT(m_matte_control[0], MC_MF_BIT); // MF bit must be the same. See 5.10.2 Matte Commands + int matte_idx[2] = { 0, 4 }; int x = 0; - int matte_idx = 0; for (; x < width; x++) { - for (int f1 = 0; f1 < num_mattes; f1++) + for (int matte = 0; matte < num_mattes; matte++) { - const int max_matte_id = (0x10 >> num_mattes) + (f1 << 2); - const int flag = (num_mattes == 2) ? f1 : matte_flag; - if (num_mattes == 2) + const int max_matte_id = ((num_mattes == 2) ? 4 : 8) + (matte ? 4 : 0); + if (matte_idx[matte] >= max_matte_id) { - for (int matte = 0; matte < max_matte_id; matte++) - { - const int matte_idx = (flag << 2) + matte; - const uint32_t matte_ctrl = m_matte_control[matte_idx]; - const uint32_t matte_op = get_matte_op(matte_idx); - if (matte_op == 0) - { - break; - } - if (x == (matte_ctrl & MC_X)) - { - switch (matte_op) - { - case 0: // End of matte control for line - break; - case 1: - case 2: - case 3: // Not used - break; - case 4: // Change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - break; - case 5: // Not used - break; - case 6: // Change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - break; - case 7: // Not used - break; - case 8: // Reset matte flag - latched_mf[flag] = false; - break; - case 9: // Set matte flag - latched_mf[flag] = true; - break; - case 10: // Not used - case 11: // Not used - break; - case 12: // Reset matte flag and change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - latched_mf[flag] = false; - break; - case 13: // Set matte flag and change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - latched_mf[flag] = true; - break; - case 14: // Reset matte flag and change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - latched_mf[flag] = false; - break; - case 15: // Set matte flag and change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - latched_mf[flag] = true; - break; - } - } - } + continue; } - else + const uint32_t matte_ctrl = m_matte_control[matte_idx[matte]]; + const uint32_t matte_op = get_matte_op(matte_idx[matte]); + const int flag = (num_mattes == 2) ? matte : matte_flag; + + if (x == (matte_ctrl & MC_X)) { - if (matte_idx < max_matte_id) + switch (matte_op) { - const uint32_t matte_ctrl = m_matte_control[matte_idx]; - const uint32_t matte_op = get_matte_op(matte_idx); - if (matte_op == 0) - { - break; - } - if (x == (matte_ctrl & MC_X)) - { - switch (matte_op) - { - case 0: // End of matte control for line - break; - case 1: - case 2: - case 3: // Not used - break; - case 4: // Change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - break; - case 5: // Not used - break; - case 6: // Change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - break; - case 7: // Not used - break; - case 8: // Reset matte flag - latched_mf[flag] = false; - break; - case 9: // Set matte flag - latched_mf[flag] = true; - break; - case 10: // Not used - case 11: // Not used - break; - case 12: // Reset matte flag and change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - latched_mf[flag] = false; - break; - case 13: // Set matte flag and change weight of plane A - latched_wfa = get_weight_factor(matte_idx); - latched_mf[flag] = true; - break; - case 14: // Reset matte flag and change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - latched_mf[flag] = false; - break; - case 15: // Set matte flag and change weight of plane B - latched_wfb = get_weight_factor(matte_idx); - latched_mf[flag] = true; - break; - } - matte_idx++; - } + case 0: // Disregard all commands in higher registers. See 5.10.2 + matte_idx[matte] = max_matte_id; + break; + case 1: + case 2: + case 3: // Not used + break; + case 4: // Change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + break; + case 5: // Not used + break; + case 6: // Change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + break; + case 7: // Not used + break; + case 8: // Reset matte flag + latched_mf[flag] = false; + break; + case 9: // Set matte flag + latched_mf[flag] = true; + break; + case 10: // Not used + case 11: // Not used + break; + case 12: // Reset matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = false; + break; + case 13: // Set matte flag and change weight of plane A + latched_wfa = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = true; + break; + case 14: // Reset matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = false; + break; + case 15: // Set matte flag and change weight of plane B + latched_wfb = get_weight_factor(matte_idx[matte]); + latched_mf[flag] = true; + break; } + matte_idx[matte]++; } } m_weight_factor[0][x] = latched_wfa; @@ -735,7 +671,6 @@ const uint32_t mcd212_device::s_4bpp_color[16] = template void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t *plane_b, bool *transparent_b, uint32_t *out) { - const uint32_t backdrop = s_4bpp_color[m_backdrop_color]; const uint8_t mosaic_count_a = (m_mosaic_hold[0] & 0x0000ff) << 1; const uint8_t mosaic_count_b = (m_mosaic_hold[1] & 0x0000ff) << 1; const int width = get_screen_width(); @@ -746,74 +681,51 @@ void mcd212_device::mix_lines(uint32_t *plane_a, bool *transparent_a, uint32_t * for (int x = 0; x < width; x++) { - const uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; - const uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; - if (!(m_transparency_control & TCR_DISABLE_MX)) + if (transparent_a[x] && transparent_b[x]) { - const int32_t plane_a_r = 0xff & (plane_a[x] >> 16); - const int32_t plane_b_r = 0xff & (plane_b[x] >> 16); - const int32_t plane_a_g = 0xff & (plane_a[x] >> 8); - const int32_t plane_b_g = 0xff & (plane_b[x] >> 8); - const int32_t plane_a_b = 0xff & plane_a[x]; - const int32_t plane_b_b = 0xff & plane_b[x]; - const int32_t weighted_a_r = (plane_a_r > 16) ? (((plane_a_r - 16) * weight_a[x]) >> 6) : 0; - const int32_t weighted_a_g = (plane_a_g > 16) ? (((plane_a_g - 16) * weight_a[x]) >> 6) : 0; - const int32_t weighted_a_b = (plane_a_b > 16) ? (((plane_a_b - 16) * weight_a[x]) >> 6) : 0; - const int32_t weighted_b_r = ((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b[x]) >> 6) : 0) + weighted_a_r; - const int32_t weighted_b_g = ((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b[x]) >> 6) : 0) + weighted_a_g; - const int32_t weighted_b_b = ((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b[x]) >> 6) : 0) + weighted_a_b; - const uint8_t out_r = (weighted_b_r > 255) ? 255 : (uint8_t)weighted_b_r; - const uint8_t out_g = (weighted_b_g > 255) ? 255 : (uint8_t)weighted_b_g; - const uint8_t out_b = (weighted_b_b > 255) ? 255 : (uint8_t)weighted_b_b; - out[x] = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; + out[x] = s_4bpp_color[m_backdrop_color]; + continue; } - else + uint32_t plane_a_cur = MosaicA ? plane_a[x - (x % mosaic_count_a)] : plane_a[x]; + uint32_t plane_b_cur = MosaicB ? plane_b[x - (x % mosaic_count_b)] : plane_b[x]; + + if (transparent_a[x]) { - const int32_t plane_a_r = 0xff & (plane_a_cur >> 16); - const int32_t plane_a_g = 0xff & (plane_a_cur >> 8); - const int32_t plane_a_b = 0xff & plane_a_cur; - const int32_t plane_b_r = 0xff & (plane_b_cur >> 16); - const int32_t plane_b_g = 0xff & (plane_b_cur >> 8); - const int32_t plane_b_b = 0xff & plane_b_cur; - - const uint8_t weighted_a_r = std::clamp(((plane_a_r > 16) ? (((plane_a_r - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_g = std::clamp(((plane_a_g > 16) ? (((plane_a_g - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_a_b = std::clamp(((plane_a_b > 16) ? (((plane_a_b - 16) * weight_a[x]) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_r = std::clamp(((plane_b_r > 16) ? (((plane_b_r - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_g = std::clamp(((plane_b_g > 16) ? (((plane_b_g - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); - const uint8_t weighted_b_b = std::clamp(((plane_b_b > 16) ? (((plane_b_b - 16) * weight_b[x]) >> 6) : 0) + 16, 0, 255); - - if (OrderAB) - { - if (!transparent_a[x]) - { - out[x] = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; - } - else if (!transparent_b[x]) - { - out[x] = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; - } - else - { - out[x] = backdrop; - } - } - else - { - if (!transparent_b[x]) - { - out[x] = 0xff000000 | (weighted_b_r << 16) | (weighted_b_g << 8) | weighted_b_b; - } - else if (!transparent_a[x]) - { - out[x] = 0xff000000 | (weighted_a_r << 16) | (weighted_a_g << 8) | weighted_a_b; - } - else - { - out[x] = backdrop; - } - } + plane_a_cur = 0; } + else if (OrderAB && (m_transparency_control & TCR_DISABLE_MX)) + { + plane_b_cur = 0; + } + + if (transparent_b[x]) + { + plane_b_cur = 0; + } + else if (!OrderAB && (m_transparency_control & TCR_DISABLE_MX)) + { + plane_a_cur = 0; + } + + const int32_t plane_a_r = 0xff & (plane_a_cur >> 16); + const int32_t plane_a_g = 0xff & (plane_a_cur >> 8); + const int32_t plane_a_b = 0xff & plane_a_cur; + const int32_t plane_b_r = 0xff & (plane_b_cur >> 16); + const int32_t plane_b_g = 0xff & (plane_b_cur >> 8); + const int32_t plane_b_b = 0xff & plane_b_cur; + + const int32_t weighted_a_r = std::clamp((std::clamp(plane_a_r - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + const int32_t weighted_a_g = std::clamp((std::clamp(plane_a_g - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + const int32_t weighted_a_b = std::clamp((std::clamp(plane_a_b - 16, 0, 255) * weight_a[x]) >> 6, 0, 255); + + const int32_t weighted_b_r = std::clamp((std::clamp(plane_b_r - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + const int32_t weighted_b_g = std::clamp((std::clamp(plane_b_g - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + const int32_t weighted_b_b = std::clamp((std::clamp(plane_b_b - 16, 0, 255) * weight_b[x]) >> 6, 0, 255); + + const uint8_t out_r = std::clamp(weighted_a_r + weighted_b_r + 16, 0, 255); + const uint8_t out_g = std::clamp(weighted_a_g + weighted_b_g + 16, 0, 255); + const uint8_t out_b = std::clamp(weighted_a_b + weighted_b_b + 16, 0, 255); + out[x] = 0xff000000 | (out_r << 16) | (out_g << 8) | out_b; } if (border_width) From 87abee6bd8ff6f115144766e1e7815dc0ec4769b Mon Sep 17 00:00:00 2001 From: goldnchild <48141308+goldnchild@users.noreply.github.com> Date: Thu, 6 Mar 2025 06:45:24 -0800 Subject: [PATCH 105/272] bus/centronics/epson_fx80.cpp: Added skeleton devices Epson FX-80 and JX-80 printers. (#13429) --- scripts/src/bus.lua | 2 + src/devices/bus/centronics/ctronics.cpp | 3 + src/devices/bus/centronics/epson_fx80.cpp | 320 ++++++++++++++++++++++ src/devices/bus/centronics/epson_fx80.h | 20 ++ 4 files changed, 345 insertions(+) create mode 100644 src/devices/bus/centronics/epson_fx80.cpp create mode 100644 src/devices/bus/centronics/epson_fx80.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 55ae9fb2424d1..407757e637179 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -3300,6 +3300,8 @@ if (BUSES["CENTRONICS"]~=null) then MAME_DIR .. "src/devices/bus/centronics/dsjoy.h", MAME_DIR .. "src/devices/bus/centronics/epson_ex800.cpp", MAME_DIR .. "src/devices/bus/centronics/epson_ex800.h", + MAME_DIR .. "src/devices/bus/centronics/epson_fx80.cpp", + MAME_DIR .. "src/devices/bus/centronics/epson_fx80.h", MAME_DIR .. "src/devices/bus/centronics/epson_lx800.cpp", MAME_DIR .. "src/devices/bus/centronics/epson_lx800.h", MAME_DIR .. "src/devices/bus/centronics/epson_lx810l.cpp", diff --git a/src/devices/bus/centronics/ctronics.cpp b/src/devices/bus/centronics/ctronics.cpp index 953ff945728c4..3556cb0d756ff 100644 --- a/src/devices/bus/centronics/ctronics.cpp +++ b/src/devices/bus/centronics/ctronics.cpp @@ -120,6 +120,7 @@ device_centronics_peripheral_interface::~device_centronics_peripheral_interface( #include "adaptator.h" #include "comxpl80.h" #include "epson_ex800.h" +#include "epson_fx80.h" #include "epson_lx800.h" #include "epson_lx810l.h" #include "epson_rx80.h" @@ -137,6 +138,8 @@ void centronics_devices(device_slot_interface &device) device.option_add("adaptator", ADAPTATOR_MULTITAP); device.option_add("pl80", COMX_PL80); device.option_add("ex800", EPSON_EX800); + device.option_add("fx80", EPSON_FX80); + device.option_add("jx80", EPSON_JX80); device.option_add("lx800", EPSON_LX800); device.option_add("lx810l", EPSON_LX810L); device.option_add("ap2000", EPSON_AP2000); diff --git a/src/devices/bus/centronics/epson_fx80.cpp b/src/devices/bus/centronics/epson_fx80.cpp new file mode 100644 index 0000000000000..62960176a8b33 --- /dev/null +++ b/src/devices/bus/centronics/epson_fx80.cpp @@ -0,0 +1,320 @@ +// license:BSD-3-Clause +// copyright-holders:Golden Child +/*************************************************************************** + + Epson FX-80 Dot Matrix Printer (skeleton) + + Main CPU is a UPD7810H6 running at 10 MHz. + Slave CPU is an 8042AH running at 11 Mhz. + + Epson JX-80 Dot Matrix Printer (skeleton) + + based on same hardware, adds an expansion board VX0B + that provides ram expansion and ribbon motor control + +*****************************************************************************/ + +#include "emu.h" +#include "epson_fx80.h" + +#include "cpu/mcs48/mcs48.h" +#include "cpu/upd7810/upd7810.h" + + +namespace { + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +class epson_fx80_device : public device_t, public device_centronics_peripheral_interface +{ +public: + static constexpr feature_type unemulated_features() { return feature::PRINTER; } + + // construction/destruction + epson_fx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + + /* Centronics stuff */ + virtual void input_init(int state) override; + virtual void input_strobe(int state) override; + virtual void input_data0(int state) override { if (state) m_centronics_data |= 0x01; else m_centronics_data &= ~0x01; } + virtual void input_data1(int state) override { if (state) m_centronics_data |= 0x02; else m_centronics_data &= ~0x02; } + virtual void input_data2(int state) override { if (state) m_centronics_data |= 0x04; else m_centronics_data &= ~0x04; } + virtual void input_data3(int state) override { if (state) m_centronics_data |= 0x08; else m_centronics_data &= ~0x08; } + virtual void input_data4(int state) override { if (state) m_centronics_data |= 0x10; else m_centronics_data &= ~0x10; } + virtual void input_data5(int state) override { if (state) m_centronics_data |= 0x20; else m_centronics_data &= ~0x20; } + virtual void input_data6(int state) override { if (state) m_centronics_data |= 0x40; else m_centronics_data &= ~0x40; } + virtual void input_data7(int state) override { if (state) m_centronics_data |= 0x80; else m_centronics_data &= ~0x80; } + +protected: + epson_fx80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + + virtual bool supports_pin35_5v() override { return true; } + + void epson_fx80_mem(address_map &map) ATTR_COLD; + + uint8_t slave_r(offs_t offset); + void slave_w(offs_t offset, uint8_t data); + uint8_t slave_p1_r(); + void slave_p2_w(uint8_t data); + uint8_t centronics_data_r(offs_t offset); + + TIMER_CALLBACK_MEMBER(slave_write_sync); + + uint8_t pts_sensor() { return 0; } + uint8_t home_sensor() { return 0; } + + required_device m_maincpu; + required_device m_slavecpu; + + uint8_t m_centronics_data; +}; + + +class epson_jx80_device : public epson_fx80_device +{ +public: + // construction/destruction + epson_jx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + + void epson_jx80_mem(address_map &map) ATTR_COLD; + uint8_t vxob_r(offs_t offset); + void vxob_w(offs_t offset, uint8_t data); +}; + + + +//------------------------------------------------- +// ROM( epson_fx80 ) +//------------------------------------------------- + +ROM_START( epson_fx80 ) + ROM_REGION(0x4000, "maincpu", 0) // 16K rom for upd7810 FX-80 + // this is from an fx80+ (found with a M20214GA which according to the tech manual goes with an fx80+) + ROM_LOAD("epson_8426k9_m1206ba029_read_as_27c128.bin", 0x0000, 0x4000, CRC(ff5c2b1e) SHA1(e1e38c3e4864e60f701939e23331360b76603a24)) + + ROM_REGION(0x800, "slavecpu", 0) // 2K rom for 8042 + ROM_LOAD("epson_fx_c42040kb_8042ah.bin", 0x0000, 0x800, CRC(3e9d08c1) SHA1(d5074f60497cc75d40996e6cef63231d3a3697f1)) +ROM_END + +ROM_START( epson_jx80 ) + ROM_REGION(0x4000, "maincpu", 0) // JX-80 rom + ROM_LOAD("jx80_a4_fs5_27128.bin", 0x0000, 0x4000, CRC(2925a47b) SHA1(1864d3561491d7dca78ac2cd13a023460f551184)) + + ROM_REGION(0x800, "slavecpu", 0) // 2K rom for 8042 + ROM_LOAD("epson_fx_c42040kb_8042ah.bin", 0x0000, 0x800, CRC(3e9d08c1) SHA1(d5074f60497cc75d40996e6cef63231d3a3697f1)) +ROM_END + + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +const tiny_rom_entry *epson_fx80_device::device_rom_region() const +{ + return ROM_NAME(epson_fx80); +} + +const tiny_rom_entry *epson_jx80_device::device_rom_region() const +{ + return ROM_NAME(epson_jx80); +} + +//------------------------------------------------- +// ADDRESS_MAP( epson_fx80_mem ) +//------------------------------------------------- + +void epson_fx80_device::epson_fx80_mem(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("maincpu", 0); + map(0x8000, 0x97ff).ram(); // external RAM 4K + 2K = 0x1800 + map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_fx80_device::slave_r), FUNC(epson_fx80_device::slave_w)); + map(0xd800, 0xd800).r(FUNC(epson_fx80_device::centronics_data_r)); +} + +void epson_jx80_device::epson_jx80_mem(address_map &map) +{ + map(0x0000, 0x3fff).rom().region("maincpu", 0); + map(0x6000, 0x7fff).ram(); // external RAM VXOB board + map(0x8000, 0x97ff).ram(); // external RAM 4K + 2K = 0x1800 + map(0xc800, 0xc801).rw(FUNC(epson_jx80_device::vxob_r), FUNC(epson_jx80_device::vxob_w)); + map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_fx80_device::slave_r), FUNC(epson_fx80_device::slave_w)); + map(0xd800, 0xd800).r(FUNC(epson_fx80_device::centronics_data_r)); +} + + +//------------------------------------------------- +// device_add_mconfig - add device configuration +//------------------------------------------------- + +void epson_fx80_device::device_add_mconfig(machine_config &config) +{ + /* basic machine hardware */ + upd7810_device &upd(UPD7810(config, m_maincpu, 10000000)); // 10 Mhz + upd.set_addrmap(AS_PROGRAM, &epson_fx80_device::epson_fx80_mem); + + /* upi41 i8042 slave cpu */ + i8042ah_device &sla(I8042AH(config, m_slavecpu, 11000000)); // 11 Mhz + sla.p1_in_cb().set(FUNC(epson_fx80_device::slave_p1_r)); + sla.p2_out_cb().set(FUNC(epson_fx80_device::slave_p2_w)); + sla.t0_in_cb().set(FUNC(epson_fx80_device::home_sensor)); + sla.t1_in_cb().set(FUNC(epson_fx80_device::pts_sensor)); +} + +void epson_jx80_device::device_add_mconfig(machine_config &config) +{ + epson_fx80_device::device_add_mconfig(config); + m_maincpu->set_addrmap(AS_PROGRAM, &epson_jx80_device::epson_jx80_mem); +} + + +//------------------------------------------------- +// INPUT_PORTS( epson_fx80 ) +//------------------------------------------------- + +INPUT_PORTS_START( epson_fx80 ) +INPUT_PORTS_END + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +ioport_constructor epson_fx80_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(epson_fx80); +} + +//------------------------------------------------- +// epson_fx80_device - constructor +//------------------------------------------------- + +// constructor that passes device type +epson_fx80_device::epson_fx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + epson_fx80_device(mconfig, EPSON_FX80, tag, owner, clock) +{ +} + +// constructor to pass through the device type to device_t +epson_fx80_device::epson_fx80_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), + device_centronics_peripheral_interface(mconfig, *this), + m_maincpu(*this, "maincpu"), + m_slavecpu(*this, "slavecpu") +{ +} + +// constructor that pass device type +epson_jx80_device::epson_jx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + epson_fx80_device(mconfig, EPSON_JX80, tag, owner, clock) +{ +} + + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void epson_fx80_device::device_start() +{ + save_item(NAME(m_centronics_data)); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void epson_fx80_device::device_reset() +{ +} + +//------------------------------------------------- +// Slave CPU functions +//------------------------------------------------- + +uint8_t epson_fx80_device::slave_r(offs_t offset) +{ + return m_slavecpu->upi41_master_r(offset); +} + +void epson_fx80_device::slave_w(offs_t offset, uint8_t data) +{ + // pass offset and data packed into param + machine().scheduler().synchronize( + timer_expired_delegate(FUNC(epson_fx80_device::slave_write_sync), this), + (offset << 8) | data); +} + +TIMER_CALLBACK_MEMBER(epson_fx80_device::slave_write_sync) +{ + m_slavecpu->upi41_master_w(u32(param) >> 8, u32(param) & 0xff); +} + +uint8_t epson_fx80_device::slave_p1_r() +{ + // read DIPSW1 + return 0; +} + +void epson_fx80_device::slave_p2_w(uint8_t data) +{ + // p20 - p21 are cr_stepper + // p22, p24 stepper power + // p25 not err + // p26 online lamp + // p27 buzzer +} + + +//------------------------------------------------- +// VX0B expansion board (for JX-80) +//------------------------------------------------- + +uint8_t epson_jx80_device::vxob_r(offs_t offset) +{ + // read color ribbon home position status, MSB is high if in home position zone + return 0; // not hooked up +} + +void epson_jx80_device::vxob_w(offs_t offset, uint8_t data) +{ + // bit 6 and 7 control the color ribbon stepper motor +} + +//------------------------------------------------- +// Centronics data read +//------------------------------------------------- + +uint8_t epson_fx80_device::centronics_data_r(offs_t offset) +{ + return 0; +} + +//------------------------------------------------- +// Centronics device +//------------------------------------------------- + +void epson_fx80_device::input_strobe(int state) +{ +} + +void epson_fx80_device::input_init(int state) +{ +} + +} // anonymous namespace + +// GLOBAL +DEFINE_DEVICE_TYPE_PRIVATE(EPSON_FX80, device_centronics_peripheral_interface, epson_fx80_device, "epson_fx80", "Epson FX-80") +DEFINE_DEVICE_TYPE_PRIVATE(EPSON_JX80, device_centronics_peripheral_interface, epson_jx80_device, "epson_jx80", "Epson JX-80") diff --git a/src/devices/bus/centronics/epson_fx80.h b/src/devices/bus/centronics/epson_fx80.h new file mode 100644 index 0000000000000..0db6a1b62f170 --- /dev/null +++ b/src/devices/bus/centronics/epson_fx80.h @@ -0,0 +1,20 @@ +// license:BSD-3-Clause +// copyright-holders:Golden Child +/********************************************************************** + + Epson FX-80 dot matrix printer emulation (skeleton) + +**********************************************************************/ + +#ifndef MAME_BUS_CENTRONICS_EPSON_FX80_H +#define MAME_BUS_CENTRONICS_EPSON_FX80_H + +#pragma once + +#include "ctronics.h" + +// device type declaration +DECLARE_DEVICE_TYPE(EPSON_FX80, device_centronics_peripheral_interface) +DECLARE_DEVICE_TYPE(EPSON_JX80, device_centronics_peripheral_interface) + +#endif // MAME_BUS_CENTRONICS_EPSON_FX80_H From ea2e33ad194b90e4a0888899612f23a82250f1e0 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 7 Mar 2025 01:49:13 +1100 Subject: [PATCH 106/272] src/devices/bus/centronics/epson_fx80.cpp: C++ has rules about how to refer to protected members of base classes. --- src/devices/bus/centronics/epson_fx80.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/bus/centronics/epson_fx80.cpp b/src/devices/bus/centronics/epson_fx80.cpp index 62960176a8b33..7d64c2eb0c48a 100644 --- a/src/devices/bus/centronics/epson_fx80.cpp +++ b/src/devices/bus/centronics/epson_fx80.cpp @@ -150,8 +150,8 @@ void epson_jx80_device::epson_jx80_mem(address_map &map) map(0x6000, 0x7fff).ram(); // external RAM VXOB board map(0x8000, 0x97ff).ram(); // external RAM 4K + 2K = 0x1800 map(0xc800, 0xc801).rw(FUNC(epson_jx80_device::vxob_r), FUNC(epson_jx80_device::vxob_w)); - map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_fx80_device::slave_r), FUNC(epson_fx80_device::slave_w)); - map(0xd800, 0xd800).r(FUNC(epson_fx80_device::centronics_data_r)); + map(0xd000, 0xd001).mirror(0x08fe).rw(FUNC(epson_jx80_device::slave_r), FUNC(epson_jx80_device::slave_w)); + map(0xd800, 0xd800).r(FUNC(epson_jx80_device::centronics_data_r)); } From f769905a02d480e8a14b04144cabe268071716d8 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Thu, 6 Mar 2025 17:13:22 +0100 Subject: [PATCH 107/272] ti99: Model the Speech Synthesizer as an own unit, with an adapter board for the PEB. --- scripts/src/bus.lua | 6 +- src/devices/bus/ti99/internal/datamux.cpp | 4 + src/devices/bus/ti99/internal/ioport.cpp | 9 + src/devices/bus/ti99/internal/ioport.h | 2 + src/devices/bus/ti99/peb/peribox.cpp | 4 +- src/devices/bus/ti99/peb/spchsyn.cpp | 188 -------------- src/devices/bus/ti99/peb/spchsyn.h | 55 ----- src/devices/bus/ti99/peb/speechadapter.cpp | 158 ++++++++++++ src/devices/bus/ti99/peb/speechadapter.h | 49 ++++ src/devices/bus/ti99/sidecar/speechsyn.cpp | 273 +++++++++++++++++++++ src/devices/bus/ti99/sidecar/speechsyn.h | 65 +++++ 11 files changed, 566 insertions(+), 247 deletions(-) delete mode 100644 src/devices/bus/ti99/peb/spchsyn.cpp delete mode 100644 src/devices/bus/ti99/peb/spchsyn.h create mode 100644 src/devices/bus/ti99/peb/speechadapter.cpp create mode 100644 src/devices/bus/ti99/peb/speechadapter.h create mode 100644 src/devices/bus/ti99/sidecar/speechsyn.cpp create mode 100644 src/devices/bus/ti99/sidecar/speechsyn.h diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 407757e637179..7826a2f84eacc 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4176,8 +4176,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/scsicard.h", MAME_DIR .. "src/devices/bus/ti99/peb/sidmaster.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/sidmaster.h", - MAME_DIR .. "src/devices/bus/ti99/peb/spchsyn.cpp", - MAME_DIR .. "src/devices/bus/ti99/peb/spchsyn.h", + MAME_DIR .. "src/devices/bus/ti99/peb/speechadapter.cpp", + MAME_DIR .. "src/devices/bus/ti99/peb/speechadapter.h", MAME_DIR .. "src/devices/bus/ti99/peb/ti_32kmem.cpp", MAME_DIR .. "src/devices/bus/ti99/peb/ti_32kmem.h", MAME_DIR .. "src/devices/bus/ti99/peb/ti_fdc.cpp", @@ -4192,6 +4192,8 @@ if (BUSES["TI99"]~=null) then MAME_DIR .. "src/devices/bus/ti99/peb/tn_usbsm.h", MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.cpp", MAME_DIR .. "src/devices/bus/ti99/sidecar/arcturus.h", + MAME_DIR .. "src/devices/bus/ti99/sidecar/speechsyn.cpp", + MAME_DIR .. "src/devices/bus/ti99/sidecar/speechsyn.h", } end diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp index d87b2df75e6e3..8359e213d8d38 100644 --- a/src/devices/bus/ti99/internal/datamux.cpp +++ b/src/devices/bus/ti99/internal/datamux.cpp @@ -205,6 +205,9 @@ void datamux_device::setaddress_all(uint16_t addr) // Cartridge ROM bool iscartrom = ((addr & 0xe000)==0x6000); + // Speech (1001 0wxx xxxx xxx0) + bool sbe = ((addr & 0xf801)==0x9000) && validaccess; + // Always deliver to GROM so that the select line may be cleared line_state gsq = isgrom? ASSERT_LINE : CLEAR_LINE; if (isgrom) m_grom_idle = false; @@ -228,6 +231,7 @@ void datamux_device::setaddress_all(uint16_t addr) // I/O port gets all accesses m_memen_state = ASSERT_LINE; m_ioport->memen_in(m_memen_state); + m_ioport->sbe(sbe); m_ioport->setaddress_dbin(addr, m_dbin); } diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index 5ca4f680e0a28..43d083c579755 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -81,6 +81,7 @@ #include "splitter.h" #include "bus/ti99/peb/peribox.h" #include "bus/ti99/sidecar/arcturus.h" +#include "bus/ti99/sidecar/speechsyn.h" DEFINE_DEVICE_TYPE(TI99_IOPORT, bus::ti99::internal::ioport_device, "ti99_ioport", "TI-99 I/O Port") @@ -149,6 +150,12 @@ void ioport_device::reset_in(int state) m_connected->reset_in(state); } +void ioport_device::sbe(int state) +{ + if (m_connected != nullptr) + m_connected->sbe(state); +} + void ioport_device::device_start() { if (m_connected != nullptr) @@ -178,6 +185,7 @@ void ti99_ioport_options_plain(device_slot_interface &device) device.option_add("peb", TI99_PERIBOX); device.option_add("splitter", TI99_IOSPLIT); device.option_add("arcturus", TI99_ARCTURUS); + device.option_add("speechsyn", TI99_SPEECHSYN); } void ti99_ioport_options_evpc(device_slot_interface &device) @@ -185,6 +193,7 @@ void ti99_ioport_options_evpc(device_slot_interface &device) device.option_add("peb", TI99_PERIBOX_EV); device.option_add("splitter", TI99_IOSPLIT); device.option_add("arcturus", TI99_ARCTURUS); + device.option_add("speechsyn", TI99_SPEECHSYN); } // Used for the splitter (to avoid getting multiple EVPCs in the system) diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h index 867ff6dccf4a5..0da1d977621ba 100644 --- a/src/devices/bus/ti99/internal/ioport.h +++ b/src/devices/bus/ti99/internal/ioport.h @@ -38,6 +38,7 @@ class ioport_attached_device : public device_t virtual void msast_in(int state) { } virtual void clock_in(int state) { } virtual void reset_in(int state) { } + virtual void sbe(int state) { } void set_ioport(ioport_device* ioport) { m_ioport = ioport; } @@ -80,6 +81,7 @@ class ioport_device : public device_t, public device_single_card_slot_interface< void msast_in(int state); void clock_in(int state); void reset_in(int state); + void sbe(int state); // Callbacks auto extint_cb() { return m_console_extint.bind(); } diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index d89293c3b6d50..55de5eccc2cc8 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -192,7 +192,7 @@ CRUCLK* 51||52 DBIN #include "evpc.h" #include "hsgpl.h" #include "ti_rs232.h" -#include "spchsyn.h" +#include "speechadapter.h" #include "memex.h" #include "horizon.h" #include "forti.h" @@ -484,7 +484,7 @@ void peribox_device::device_config_complete() void peribox_common_slots(device_slot_interface &device) { device.option_add("tirs232", TI99_RS232); - device.option_add("speech", TI99_SPEECH); + device.option_add("speechadapter", TI99_SPEECHADAPTER); device.option_add("horizon", TI99_HORIZON); device.option_add("ide", TI99_IDE); device.option_add("usbsm", TI99_USBSM); diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp deleted file mode 100644 index 0cf577dad868a..0000000000000 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// license:LGPL-2.1+ -// copyright-holders:Michael Zapf -/**************************************************************************** - - TI-99 Speech synthesizer - - We emulate the Speech Synthesizer plugged onto a P-Box adapter. The original - Speech Synthesizer device was provided as a box to be plugged into the - right side of the console. In order to be used with Geneve and SGCPU, the - speech synthesizer must be moved into the Peripheral Box. - - The Speech Synthesizer used for the TI was the CD2501E, AKA TMS5200, - (internal name TMC0285), a predecessor of the TMS5220 which was used in - other commercial products. - - Note that this adapter also contains the speech roms. - - Michael Zapf - - February 2012: Rewritten as class - -*****************************************************************************/ - -#include "emu.h" -#include "spchsyn.h" - -#include "speaker.h" - -#define LOG_WARN (1U << 1) // Warnings -#define LOG_CONFIG (1U << 2) -#define LOG_MEM (1U << 3) -#define LOG_ADDR (1U << 4) -#define LOG_READY (1U << 5) - -#define VERBOSE (LOG_CONFIG | LOG_WARN) -#include "logmacro.h" - -DEFINE_DEVICE_TYPE(TI99_SPEECH, bus::ti99::peb::ti_speech_synthesizer_device, "ti99_speech", "TI-99 Speech synthesizer (on adapter card)") - -namespace bus::ti99::peb { - -/****************************************************************************/ - -ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, TI99_SPEECH, tag, owner, clock), - device_ti99_peribox_card_interface(mconfig, *this), - m_vsp(*this, "vsp"), - m_reading(false), - m_sbe(false), - m_dec_high(false) -{ -} - -/* - Memory read -*/ - -void ti_speech_synthesizer_device::readz(offs_t offset, uint8_t *value) -{ - if (machine().side_effects_disabled()) return; - - if (m_sbe) - { - *value = m_vsp->status_r() & 0xff; - LOGMASKED(LOG_MEM, "read value = %02x\n", *value); - // We should clear the lines at this point. The TI-99/4A clears the - // lines by setting the address bus to a different value, but the - // Geneve may behave differently. This may not 100% reflect the real - // situation, but it ensures a safe processing. - m_vsp->combined_rsq_wsq_w(~0); - } -} - -/* - Memory write -*/ -void ti_speech_synthesizer_device::write(offs_t offset, uint8_t data) -{ - if (machine().side_effects_disabled()) return; - - if (m_sbe) - { - LOGMASKED(LOG_MEM, "write value = %02x\n", data); - m_vsp->data_w(data); - // Note that we must NOT clear the lines here. Find the lines in the - // READY callback below. - } -} - -void ti_speech_synthesizer_device::setaddress_dbin(offs_t offset, int state) -{ - // 1001 00xx xxxx xxx0 DBIN=1 - // 1001 01xx xxxx xxx0 DBIN=0 - // 1111 1000 0000 0001 mask - m_reading = (state==ASSERT_LINE); - - bool valid = (((offset & 0x0400)==0) == m_reading); - - if (m_dec_high) - m_sbe = ((offset & 0x7f801)==0x79000) && valid; - else - m_sbe = ((offset & 0x0f801)==0x09000) && valid; - - if (m_sbe) - { - LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); - - // Caution: In the current tms5220 emulation, care must be taken - // to clear one line before asserting the other line, or otherwise - // both RS* and WS* are active, which is illegal. - // Alternatively, we'll use the combined settings method - - m_vsp->combined_rsq_wsq_w(m_reading ? ~tms5220_device::RS : ~tms5220_device::WS); - } - else - // If other address, turn off RS* and WS* (negative logic!) - m_vsp->combined_rsq_wsq_w(~0); -} - -/****************************************************************************/ - -void ti_speech_synthesizer_device::speech_ready(int state) -{ - // The TMS5200 implementation uses true/false, not ASSERT/CLEAR semantics - // and we have to adapt a /READY to a READY line. - // The real synthesizer board uses a transistor for that purpose. - m_slot->set_ready((state==0)? ASSERT_LINE : CLEAR_LINE); - LOGMASKED(LOG_READY, "READY = %d\n", (state==0)); - - if ((state==0) && !m_reading) - // Clear the lines only when we are done with writing. - m_vsp->combined_rsq_wsq_w(~0); -} - -void ti_speech_synthesizer_device::device_start() -{ - save_item(NAME(m_reading)); - save_item(NAME(m_sbe)); -} - -void ti_speech_synthesizer_device::device_reset() -{ - m_reading = false; - m_sbe = false; - m_dec_high = (ioport("AMADECODE")->read()!=0); -} - -ROM_START( ti99_speech ) - ROM_REGION(0x8000, "vsm", 0) - ROM_LOAD("cd2325a.u2a", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe)) // at location u2, bottom of stack - ROM_LOAD("cd2326a.u2b", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020)) // at location u2, top of stack -ROM_END - -void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) -{ - SPEAKER(config, "speech_out").front_center(); - CD2501E(config, m_vsp, 640000L); - - m_vsp->ready_cb().set(FUNC(ti_speech_synthesizer_device::speech_ready)); - m_vsp->add_route(ALL_OUTPUTS, "speech_out", 0.50); - - TMS6100(config, "vsm", 0); - m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); - m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); - m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); - m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); - m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); -} - -INPUT_PORTS_START( ti99_speech ) - PORT_START( "AMADECODE" ) - PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) - PORT_CONFSETTING( 0x00, DEF_STR( Off )) - PORT_CONFSETTING( 0x01, DEF_STR( On )) -INPUT_PORTS_END - -ioport_constructor ti_speech_synthesizer_device::device_input_ports() const -{ - return INPUT_PORTS_NAME(ti99_speech); -} - -const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const -{ - return ROM_NAME( ti99_speech ); -} - -} // end namespace bus::ti99::peb - diff --git a/src/devices/bus/ti99/peb/spchsyn.h b/src/devices/bus/ti99/peb/spchsyn.h deleted file mode 100644 index ff9c3f237e65a..0000000000000 --- a/src/devices/bus/ti99/peb/spchsyn.h +++ /dev/null @@ -1,55 +0,0 @@ -// license:LGPL-2.1+ -// copyright-holders:Michael Zapf -/**************************************************************************** - - TI-99 Speech Synthesizer - See spchsyn.c for documentation - - Michael Zapf, October 2010 - February 2012: Rewritten as class - -*****************************************************************************/ - -#ifndef MAME_BUS_TI99_PEB_SPCHSYN_H -#define MAME_BUS_TI99_PEB_SPCHSYN_H - -#pragma once - -#include "peribox.h" -#include "sound/tms5220.h" -#include "machine/tms6100.h" - -namespace bus::ti99::peb { - -class ti_speech_synthesizer_device : public device_t, public device_ti99_peribox_card_interface -{ -public: - ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void readz(offs_t offset, uint8_t *value) override; - void write(offs_t offset, uint8_t data) override; - void setaddress_dbin(offs_t offset, int state) override; - - void crureadz(offs_t offset, uint8_t *value) override { } - void cruwrite(offs_t offset, uint8_t data) override { } - -protected: - virtual void device_start() override; - virtual void device_reset() override; - virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; - virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; - virtual ioport_constructor device_input_ports() const override ATTR_COLD; - -private: - void speech_ready(int state); - - required_device m_vsp; - bool m_reading; - bool m_sbe; // Signal "Speech block enable" - bool m_dec_high; // Decode the AMA/AMB/ABC address lines -}; - -} // end namespace bus::ti99::peb - -DECLARE_DEVICE_TYPE_NS(TI99_SPEECH, bus::ti99::peb, ti_speech_synthesizer_device) - -#endif // MAME_BUS_TI99_PEB_SPCHSYN_H diff --git a/src/devices/bus/ti99/peb/speechadapter.cpp b/src/devices/bus/ti99/peb/speechadapter.cpp new file mode 100644 index 0000000000000..778465d0eb386 --- /dev/null +++ b/src/devices/bus/ti99/peb/speechadapter.cpp @@ -0,0 +1,158 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech synthesizer adapter device + + This adapter card made the sidecar Speech Synthesizer unit available to + systems without a TI-99/4A console, like the SGCPU and the Geneve. The + board must be removed from the sidecar unit and plugged on this simple + adapter board, which is then put in a slot of the Peripheral Expansion Box. + + +-------+ + +-----|-------|---+ + | Speech syn | + | board | + | _________ | + +-----+++++++++---+ + +----------------------------+|||||||+------------+ + | ------- | + | Adapter board | + | | + (((o LED PEB slot connector | + +--------------|||||||||||||||||||||||||----------+ + ||||||||||||||||||||||||| + + Technical detail: + + The SBE signal (Speech Block Enable), which is generated in the TI console, + is not forwarded to the PEB. One of the tasks of this board is thus to + decode the mapped addresses once more and to activate the synthesizer + accordingly. + + A second issue for Geneve users is that the address extension bits (AMA, + AMB, AMC) need to be decoded as well to avoid the synthesizer interfering + with other memory access. This can be activated in the configuration. The + default is on. + + Michael Zapf + March 2025 + +*****************************************************************************/ + +#include "emu.h" +#include "speechadapter.h" + +#include "speaker.h" +#include "bus/ti99/sidecar/speechsyn.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) +#define LOG_MEM (1U << 3) +#define LOG_ADDR (1U << 4) +#define LOG_READY (1U << 5) + +#define VERBOSE (LOG_CONFIG | LOG_WARN) +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_SPEECHADAPTER, bus::ti99::peb::ti_speechsyn_adapter_device, "ti99_speechconn", "TI-99 Speech synthesizer adapter card") + +namespace bus::ti99::peb { + +#define PORT "conn" + +/****************************************************************************/ + +ti_speechsyn_adapter_device::ti_speechsyn_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, TI99_SPEECHADAPTER, tag, owner, clock), + device_ti99_peribox_card_interface(mconfig, *this), + m_port(*this, PORT), + m_dec_high(false) +{ +} + +void ti_speechsyn_adapter_device::readz(offs_t offset, uint8_t *value) +{ + if (m_port != nullptr) + { + LOGMASKED(LOG_MEM, "read %06x\n", offset); + m_port->readz(offset, value); + } +} + +void ti_speechsyn_adapter_device::write(offs_t offset, uint8_t data) +{ + if (m_port != nullptr) + { + LOGMASKED(LOG_MEM, "write %06x\n", offset); + m_port->write(offset, data); + } +} + +void ti_speechsyn_adapter_device::setaddress_dbin(offs_t offset, int state) +{ + // Valid access = not(DBIN and A5) + bool reading = (state==ASSERT_LINE); + + // An access is valid when reading from 9000 and writing to 9400. + bool valid = (((offset & 0x0400)==0) == reading); + bool sbe = false; + + // Recreate the SBE signal that is only available at the I/O port of the console + if (m_dec_high) + // We need to decode the AMA/AMB/AMC address extension lines + sbe = ((offset & 0x7f801)==0x79000) && valid; + else + // No need to decode the extension lines + sbe = ((offset & 0x0f801)==0x09000) && valid; + + if (sbe) LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); + + if (m_port != nullptr) + { + m_port->sbe(sbe); + m_port->setaddress_dbin(offset, state); + } +} + +void ti_speechsyn_adapter_device::ready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from synthesizer %d\n", state); + m_slot->set_ready(state); +} + +void ti_speechsyn_adapter_device::device_start() +{ +} + +void ti_speechsyn_adapter_device::device_reset() +{ + m_dec_high = (ioport("AMADECODE")->read()!=0); + LOGMASKED(LOG_CONFIG, "Speech adapter%s decoding the AMA/B/C lines.\n", m_dec_high? "" : " not"); +} + +void ti_speechsyn_adapter_options(device_slot_interface &device) +{ + device.option_add("speechsyn", TI99_SPEECHSYN); +} + +void ti_speechsyn_adapter_device::device_add_mconfig(machine_config& config) +{ + TI99_IOPORT(config, m_port, 0, ti_speechsyn_adapter_options, "speechsyn"); + m_port->ready_cb().set(FUNC(ti_speechsyn_adapter_device::ready)); +} + +INPUT_PORTS_START( ti99_speechadapter ) + PORT_START( "AMADECODE" ) + PORT_CONFNAME( 0x01, 0x01, "Decode AMA/AMB/AMC lines" ) + PORT_CONFSETTING( 0x00, DEF_STR( Off )) + PORT_CONFSETTING( 0x01, DEF_STR( On )) +INPUT_PORTS_END + +ioport_constructor ti_speechsyn_adapter_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(ti99_speechadapter); +} + +} // end namespace bus::ti99::peb + diff --git a/src/devices/bus/ti99/peb/speechadapter.h b/src/devices/bus/ti99/peb/speechadapter.h new file mode 100644 index 0000000000000..5846b595c5d75 --- /dev/null +++ b/src/devices/bus/ti99/peb/speechadapter.h @@ -0,0 +1,49 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech Synthesizer connector adapter + for the Peripheral Expansion Box + + Michael Zapf, March 2025 + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_PEB_SPCHADPT_H +#define MAME_BUS_TI99_PEB_SPCHADPT_H + +#pragma once + +#include "peribox.h" +#include "bus/ti99/internal/ioport.h" + +namespace bus::ti99::peb { + +class ti_speechsyn_adapter_device : public device_t, public device_ti99_peribox_card_interface +{ +public: + ti_speechsyn_adapter_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + void crureadz(offs_t offset, uint8_t *value) override { } + void cruwrite(offs_t offset, uint8_t data) override { } + +protected: + virtual void device_start() override; + virtual void device_reset() override; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual ioport_constructor device_input_ports() const override ATTR_COLD; + +private: + required_device m_port; + bool m_dec_high; + + void ready(int state); +}; + +} // end namespace bus::ti99::peb + +DECLARE_DEVICE_TYPE_NS(TI99_SPEECHADAPTER, bus::ti99::peb, ti_speechsyn_adapter_device) + +#endif // MAME_BUS_TI99_PEB_SPCHADPT_H diff --git a/src/devices/bus/ti99/sidecar/speechsyn.cpp b/src/devices/bus/ti99/sidecar/speechsyn.cpp new file mode 100644 index 0000000000000..1f55bcc348e22 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/speechsyn.cpp @@ -0,0 +1,273 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + TI-99 Speech synthesizer + + This is the emulation Speech Synthesizer, which plugs into the I/O port of + the TI console. Even though the sidecar expansion concept was largely + abandoned by the introduction of the Peripheral Expansion Box with the 4A, + the Speech Synthesizer was sold as a sidecar expansion until the end. + + Typical setup: + Speech Synthesizer + sidecar + v + +----------------+---+---------- + | TI-99/4(A) | | PEB connection cable + +------------+---+ +---------- + | oooooooooo | |---+ + | oooooooooo | | + +----------------- + + Also as a common modification, users removed the board inside the sidecar + and placed it on an adapter to go into the PEB and thus to become + available for the Geneve or SGCPU. See bus/ti99/peb/speechadapter.cpp. + + The sidecar offers a flippable lid where vocabulary expansion modules were + supposed to be plugged in, but those have never seen daylight. In most of + the units, including mine, no connector can be found under the lid, so the + decision to drop this idea must have come early. + + Technical details: + + The Voice Synthesis Processor (VSP) used for the TI Speech Synthesizer + is the CD2501E, aka TMS5200 (internal name TMC0285), a predecessor of the + TMS5220 which was used in many other commercial products. + Two TMS6100 circuits hold the standard vocabulary, mainly used from Extended + Basic programs. + + The interaction with the TMS5200 relies completely on the READY* + line; the INT* line is not connected. + + The VSP delivers a READY* signal, which needs to be inverted for the rest + of the TI system. The board of the Speech Synthesizer uses a simple + transistor for this purpose. + + Michael Zapf + March 2025 + +*****************************************************************************/ + +#include "emu.h" +#include "speechsyn.h" +#include "speaker.h" + +#define LOG_WARN (1U << 1) // Warnings +#define LOG_CONFIG (1U << 2) +#define LOG_MEM (1U << 3) +#define LOG_ADDR (1U << 4) +#define LOG_READY (1U << 5) + +#define VERBOSE (LOG_GENERAL | LOG_WARN) + +#include "logmacro.h" + +DEFINE_DEVICE_TYPE(TI99_SPEECHSYN, bus::ti99::sidecar::ti_speech_synthesizer_device, "ti99_speech", "TI-99 Speech Synthesizer") + +namespace bus::ti99::sidecar { + +#define VSP "tms5200" +#define PORT "extport" + +/* + Constructor called from subclasses. +*/ +ti_speech_synthesizer_device::ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : bus::ti99::internal::ioport_attached_device(mconfig, TI99_SPEECHSYN, tag, owner, clock), + m_vsp(*this, VSP), + m_port(*this, PORT), + m_reading(false), + m_sbe(CLEAR_LINE), + m_ext_ready(ASSERT_LINE), + m_ssyn_ready(ASSERT_LINE) +{ +} + +/* + Memory read +*/ + +void ti_speech_synthesizer_device::readz(offs_t offset, uint8_t *value) +{ + if (m_sbe) + { + if (machine().side_effects_disabled()) return; + + *value = m_vsp->status_r() & 0xff; + LOGMASKED(LOG_MEM, "read value = %02x\n", *value); + // We should clear the lines at this point. The TI-99/4A clears the + // lines by setting the address bus to a different value, but the + // Geneve may behave differently. This may not 100% reflect the real + // situation, but it ensures a safe processing. + m_vsp->combined_rsq_wsq_w(~0); + } + + // Pass through to the external port + if (m_port != nullptr) + m_port->readz(offset, value); +} +/* + Memory write +*/ +void ti_speech_synthesizer_device::write(offs_t offset, uint8_t data) +{ + if (m_sbe) + { + if (machine().side_effects_disabled()) return; + LOGMASKED(LOG_MEM, "write value = %02x\n", data); + m_vsp->data_w(data); + // Note that we must NOT clear the lines here. Find the lines in the + // READY callback below. + } + + // Pass through to the external port + if (m_port != nullptr) + m_port->write(offset, data); +} + +void ti_speech_synthesizer_device::setaddress_dbin(offs_t offset, int state) +{ + if (m_sbe) + { + m_reading = (state==ASSERT_LINE); + LOGMASKED(LOG_ADDR, "set address = %04x, dbin = %d\n", offset, state); + + // Caution: In the current tms5220 emulation, care must be taken + // to clear one line before asserting the other line, or otherwise + // both RS* and WS* are active, which is illegal. + // Alternatively, we'll use the combined settings method + + m_vsp->combined_rsq_wsq_w(m_reading ? ~tms5220_device::RS : ~tms5220_device::WS); + } + else + { + // If other address, turn off RS* and WS* (negative logic!) + m_vsp->combined_rsq_wsq_w(~0); + + // Pass through to the external port + if (m_port != nullptr) + m_port->setaddress_dbin(offset, state); + } +} + +void ti_speech_synthesizer_device::sbe(int state) +{ + m_sbe = (state==ASSERT_LINE); + // Not forwarded to the external port +} + +void ti_speech_synthesizer_device::crureadz(offs_t offset, uint8_t *value) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->crureadz(offset, value); +} + +void ti_speech_synthesizer_device::cruwrite(offs_t offset, uint8_t data) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->cruwrite(offset, data); +} + +void ti_speech_synthesizer_device::memen_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->memen_in(state); +} + +void ti_speech_synthesizer_device::msast_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->msast_in(state); +} + +void ti_speech_synthesizer_device::clock_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->clock_in(state); +} + +void ti_speech_synthesizer_device::reset_in(int state) +{ + // Pass through to the external port + if (m_port != nullptr) + m_port->reset_in(state); +} + +/* + Forward the incoming interrupt to the console +*/ +void ti_speech_synthesizer_device::extint(int state) +{ + set_extint(state); +} + +void ti_speech_synthesizer_device::extready(int state) +{ + LOGMASKED(LOG_READY, "Incoming READY=%d from external port\n", state); + m_ext_ready = (line_state)state; + set_ready(m_ext_ready & m_ssyn_ready); +} + +void ti_speech_synthesizer_device::speech_ready(int state) +{ + // Invert the READY* signal + m_ssyn_ready = (state==0)? ASSERT_LINE : CLEAR_LINE; + LOGMASKED(LOG_READY, "SSyn READY = %d\n", (state==0)); + + if ((state==0) && !m_reading) + // Clear the lines only when we are done with writing. + m_vsp->combined_rsq_wsq_w(~0); + + set_ready(m_ext_ready & m_ssyn_ready); +} + +void ti_speech_synthesizer_device::device_start() +{ + save_item(NAME(m_reading)); + save_item(NAME(m_sbe)); +} + +void ti_speech_synthesizer_device::device_reset() +{ + m_reading = false; + m_sbe = CLEAR_LINE; +} + +ROM_START( ti99_speech ) + ROM_REGION(0x8000, "vsm", 0) + ROM_LOAD("cd2325a.u2a", 0x0000, 0x4000, CRC(1f58b571) SHA1(0ef4f178716b575a1c0c970c56af8a8d97561ffe)) // at location u2, bottom of stack + ROM_LOAD("cd2326a.u2b", 0x4000, 0x4000, CRC(65d00401) SHA1(a367242c2c96cebf0e2bf21862f3f6734b2b3020)) // at location u2, top of stack +ROM_END + +void ti_speech_synthesizer_device::device_add_mconfig(machine_config& config) +{ + SPEAKER(config, "speech_out").front_center(); + CD2501E(config, m_vsp, 640000L); + + m_vsp->ready_cb().set(FUNC(ti_speech_synthesizer_device::speech_ready)); + m_vsp->add_route(ALL_OUTPUTS, "speech_out", 0.50); + + TMS6100(config, "vsm", 0); + m_vsp->m0_cb().set("vsm", FUNC(tms6100_device::m0_w)); + m_vsp->m1_cb().set("vsm", FUNC(tms6100_device::m1_w)); + m_vsp->addr_cb().set("vsm", FUNC(tms6100_device::add_w)); + m_vsp->data_cb().set("vsm", FUNC(tms6100_device::data_line_r)); + m_vsp->romclk_cb().set("vsm", FUNC(tms6100_device::clk_w)); + + TI99_IOPORT(config, m_port, 0, ti99_ioport_options_evpc1, nullptr); + m_port->extint_cb().set(FUNC(ti_speech_synthesizer_device::extint)); + m_port->ready_cb().set(FUNC(ti_speech_synthesizer_device::extready)); +} + +const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const +{ + return ROM_NAME( ti99_speech ); +} + +} // end namespace bus::ti99::sidecar \ No newline at end of file diff --git a/src/devices/bus/ti99/sidecar/speechsyn.h b/src/devices/bus/ti99/sidecar/speechsyn.h new file mode 100644 index 0000000000000..fab42d09aa065 --- /dev/null +++ b/src/devices/bus/ti99/sidecar/speechsyn.h @@ -0,0 +1,65 @@ +// license:LGPL-2.1+ +// copyright-holders:Michael Zapf +/**************************************************************************** + + Speech Synthesizer sidecar device + Michael Zapf + +*****************************************************************************/ + +#ifndef MAME_BUS_TI99_SIDECAR_SPEECHSYN_H +#define MAME_BUS_TI99_SIDECAR_SPEECHSYN_H + +#pragma once + +#include "bus/ti99/internal/ioport.h" +#include "sound/tms5220.h" +#include "machine/tms6100.h" + +namespace bus::ti99::sidecar { + +class ti_speech_synthesizer_device : public bus::ti99::internal::ioport_attached_device +{ +public: + ti_speech_synthesizer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void readz(offs_t offset, uint8_t *value) override; + void write(offs_t offset, uint8_t data) override; + void setaddress_dbin(offs_t offset, int state) override; + void sbe(int state) override; + + void crureadz(offs_t offset, uint8_t *value) override; + void cruwrite(offs_t offset, uint8_t data) override; + + void memen_in(int state) override; + void msast_in(int state) override; + + void clock_in(int state) override; + void reset_in(int state) override; + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + // Callbacks from the external port + void extint(int state); + void extready(int state); + +private: + required_device m_vsp; + required_device m_port; + + void speech_ready(int state); + + bool m_reading; + bool m_sbe; + line_state m_ext_ready; + line_state m_ssyn_ready; +}; + +} // end namespace bus::ti99::internal + +DECLARE_DEVICE_TYPE_NS(TI99_SPEECHSYN, bus::ti99::sidecar, ti_speech_synthesizer_device) + +#endif // MAME_BUS_TI99_SIDECAR_SPEECHSYN_H From c0b4ed0f446e96a34d420c55df9a67c01c1dcc5c Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Thu, 6 Mar 2025 17:56:48 +0100 Subject: [PATCH 108/272] ti99: Add the lost newline at EOF. --- src/devices/bus/ti99/sidecar/speechsyn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devices/bus/ti99/sidecar/speechsyn.cpp b/src/devices/bus/ti99/sidecar/speechsyn.cpp index 1f55bcc348e22..3d17003dd90d0 100644 --- a/src/devices/bus/ti99/sidecar/speechsyn.cpp +++ b/src/devices/bus/ti99/sidecar/speechsyn.cpp @@ -270,4 +270,4 @@ const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const return ROM_NAME( ti99_speech ); } -} // end namespace bus::ti99::sidecar \ No newline at end of file +} // end namespace bus::ti99::sidecar From ea8d28c70a2c01d37135f1180af17a593bcb66d7 Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 6 Mar 2025 19:37:00 +0100 Subject: [PATCH 109/272] nec/pc88va_sgp.cpp: implement ROP and TPMOD functions, fix pitch bugs in boomer and shinraba --- src/mame/nec/pc88va_sgp.cpp | 152 ++++++++++++++++++++++++------------ src/mame/nec/pc88va_sgp.h | 30 ++++++- 2 files changed, 132 insertions(+), 50 deletions(-) diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index 9ff1e812b3edb..d8f7670e1036c 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -7,10 +7,12 @@ NEC SGP (スーパーグラフィックプロセッサ / Super Graphic Processor Unknown part number, used as GPU for PC88VA TODO: -- timing details -- specifics about what exactly happens in work area when either SGP runs or is idle. +- timing details; +- unemulated CLS, LINE and SCAN; +- Uneven src/dst sizes or color depths (mostly for PATBLT); +- specifics about what exactly happens in work area when either SGP runs or is idle; - famista: during gameplay it BITBLT same source to destination 0x00037076 - with tp_mode = 3 and pitch = 0 (!?); + with tp_mode = 3, uneven color depths (src 1bpp, dst 4bpp) and pitch = 0, assume disabled; - rtype: during gameplay it does transfers with Pitch = 0xfff0, alias for negative draw? - basic fires a VABOT on loading; @@ -21,7 +23,6 @@ Unknown part number, used as GPU for PC88VA //#include - #define LOG_COMMAND (1U << 1) #define VERBOSE (LOG_GENERAL) @@ -88,7 +89,7 @@ void pc88va_sgp_device::vdp_address_w(offs_t offset, u16 data, u16 mem_mask) void pc88va_sgp_device::control_w(u8 data) { if (data) - popmessage("SGP warning write %02x", data); + popmessage("SGP: control_w write %02x", data); } /* @@ -96,6 +97,11 @@ void pc88va_sgp_device::control_w(u8 data) */ u8 pc88va_sgp_device::status_r() { +// crude debug single-stepping +// if (machine().input().code_pressed(KEYCODE_S)) +// return 0; +// if (!machine().input().code_pressed_once(KEYCODE_A)) +// return 1; return 0; } @@ -183,7 +189,8 @@ void pc88va_sgp_device::start_exec() ptr->pixel_mode = (param1 & 0x03); ptr->hsize = m_data->read_word(vdp_pointer + 4) & 0x0fff; ptr->vsize = m_data->read_word(vdp_pointer + 6) & 0x0fff; - ptr->fb_pitch = m_data->read_word(vdp_pointer + 8) & 0xfffc; + // NOTE: & 0xfffc causes pitch issues in boomer intro/title text, shinraba gameplay + ptr->fb_pitch = m_data->read_word(vdp_pointer + 8) & 0xfffe; ptr->address = (m_data->read_word(vdp_pointer + 10) & 0xfffe) | (m_data->read_word(vdp_pointer + 12) << 16); @@ -223,7 +230,7 @@ void pc88va_sgp_device::start_exec() , cmd_mode ? "PATBLT" : "BITBLT" , draw_mode ); - cmd_blit(draw_mode, cmd_mode); + execute_blit(draw_mode, cmd_mode); next_pc += 2; break; @@ -239,7 +246,7 @@ void pc88va_sgp_device::start_exec() // in pixels const u16 h_size = m_data->read_word(vdp_pointer + 6); const u16 v_size = m_data->read_word(vdp_pointer + 8); - const u16 fb_pitch = m_data->read_word(vdp_pointer + 10) & 0xfffc; + const u16 fb_pitch = m_data->read_word(vdp_pointer + 10) & 0xfffe; const u32 src_address = (m_data->read_word(vdp_pointer + 12) & 0xfffe) | (m_data->read_word(vdp_pointer + 14) << 16); @@ -303,9 +310,58 @@ void pc88va_sgp_device::start_exec() } /**************************************** - * Commands + * Blitting ***************************************/ +const pc88va_sgp_device::rop_func pc88va_sgp_device::rop_table[16] = +{ + &pc88va_sgp_device::rop_0_fill_0, + &pc88va_sgp_device::rop_1_s_and_d, + &pc88va_sgp_device::rop_2_ns_and_d, + &pc88va_sgp_device::rop_3_d, + &pc88va_sgp_device::rop_4_s_and_nd, + &pc88va_sgp_device::rop_5_s, + &pc88va_sgp_device::rop_6_s_xor_d, + &pc88va_sgp_device::rop_7_s_or_d, + &pc88va_sgp_device::rop_8_ns_or_d, + &pc88va_sgp_device::rop_9_n_s_xor_d, + &pc88va_sgp_device::rop_A_n_s, + &pc88va_sgp_device::rop_B_n_s_or_d, + &pc88va_sgp_device::rop_C_nd, + &pc88va_sgp_device::rop_D_s_or_nd, + &pc88va_sgp_device::rop_E_n_s_and_d, + &pc88va_sgp_device::rop_F_fill_1, +}; + +u16 pc88va_sgp_device::rop_0_fill_0(u16 src, u16 dst) { return 0; } +u16 pc88va_sgp_device::rop_1_s_and_d(u16 src, u16 dst) { return src & dst; } +u16 pc88va_sgp_device::rop_2_ns_and_d(u16 src, u16 dst) { return (~src) & dst; } +u16 pc88va_sgp_device::rop_3_d(u16 src, u16 dst) { return dst; } +u16 pc88va_sgp_device::rop_4_s_and_nd(u16 src, u16 dst) { return src & (~dst); } +u16 pc88va_sgp_device::rop_5_s(u16 src, u16 dst) { return src; } +u16 pc88va_sgp_device::rop_6_s_xor_d(u16 src, u16 dst) { return src ^ dst; } +u16 pc88va_sgp_device::rop_7_s_or_d(u16 src, u16 dst) { return src | dst; } +u16 pc88va_sgp_device::rop_8_ns_or_d(u16 src, u16 dst) { return ~(src | dst); } +u16 pc88va_sgp_device::rop_9_n_s_xor_d(u16 src, u16 dst) { return ~(src ^ dst); } +u16 pc88va_sgp_device::rop_A_n_s(u16 src, u16 dst) { return ~src; } +u16 pc88va_sgp_device::rop_B_n_s_or_d(u16 src, u16 dst) { return (~src) | dst; } +u16 pc88va_sgp_device::rop_C_nd(u16 src, u16 dst) { return ~dst; } +u16 pc88va_sgp_device::rop_D_s_or_nd(u16 src, u16 dst) { return src | (~dst); } +u16 pc88va_sgp_device::rop_E_n_s_and_d(u16 src, u16 dst) { return ~(src & dst); } +u16 pc88va_sgp_device::rop_F_fill_1(u16 src, u16 dst) { return 0xffff; } + +const pc88va_sgp_device::tpmod_func pc88va_sgp_device::tpmod_table[4] = +{ + &pc88va_sgp_device::tpmod_0_always, + &pc88va_sgp_device::tpmod_1_src, + &pc88va_sgp_device::tpmod_2_dst, + &pc88va_sgp_device::tpmod_3_never +}; + +bool pc88va_sgp_device::tpmod_0_always(u16 src, u16 dst) { return true; } +bool pc88va_sgp_device::tpmod_1_src(u16 src, u16 dst) { return src != 0; } +bool pc88va_sgp_device::tpmod_2_dst(u16 src, u16 dst) { return dst == 0; } +bool pc88va_sgp_device::tpmod_3_never(u16 src, u16 dst) { return false; } /* * ---x ---- ---- ---- SF (0) shift source according to destination position @@ -315,7 +371,7 @@ void pc88va_sgp_device::start_exec() * ---- --00 ---- ---- transfer source as-is * ---- --01 ---- ---- do not transfer if source is 0 (transparent pen) * ---- --10 ---- ---- transfer only if destination is 0 - * ---- --11 ---- ---- + * ---- --11 ---- ---- * ---- ---- ---- xxxx LOGICAL OP * ---- ---- ---- 0000 0 * ---- ---- ---- 0001 Src AND Dst @@ -323,8 +379,8 @@ void pc88va_sgp_device::start_exec() * ---- ---- ---- 0011 NOP * ---- ---- ---- 0100 Src AND /Dst * ---- ---- ---- 0101 Src - * ---- ---- ---- 0110 Src XOR Dst - * ---- ---- ---- 0111 Src OR Dst + * ---- ---- ---- 0110 Src XOR Dst (ballbrkr) + * ---- ---- ---- 0111 Src OR Dst (boomer) * ---- ---- ---- 1000 /(Src OR Dst) * ---- ---- ---- 1001 /(Src XOR Dst) * ---- ---- ---- 1010 /Src @@ -337,10 +393,19 @@ void pc88va_sgp_device::start_exec() * PATBLT is identical to BITBLT except it repeats source copy * if it exceeds the clipping range. */ -void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) +void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) { const u8 logical_op = draw_mode & 0xf; const u8 tp_mod = (draw_mode >> 8) & 0x3; +// const bool hd = !!BIT(draw_mode, 10); + // TODO: rtype gameplay enables VD +// const bool vd = !!BIT(draw_mode, 11); +// const bool sf = !!BIT(draw_mode, 12); + + if (draw_mode & 0xfc00) + { + popmessage("SGP: draw_mode = %04x (HD %d VD %d SF %d)", draw_mode, BIT(draw_mode, 10), BIT(draw_mode, 11), BIT(draw_mode, 12)); + } // TODO: boomer title screen if (is_patblt == true) @@ -349,19 +414,6 @@ void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) // return; } - // ballbrkr: 6 - if (logical_op != 5) - { - LOG("BITBLT logical_op == %d\n", logical_op); - return; - } - - if (tp_mod > 1) - { - LOG("BITBLT tp_mod == %d\n", tp_mod); - return; - } - if (m_src.hsize != m_dst.hsize || m_src.vsize != m_dst.vsize) { LOG("BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize); @@ -374,48 +426,52 @@ void pc88va_sgp_device::cmd_blit(u16 draw_mode, bool is_patblt) return; } - const u8 hsize_shift = m_src.pixel_mode == 1 ? 1 : 0; + //static const u8 shift_table = { 3, 1, 0, -1 }; + //const u8 hsize_shift = m_src.pixel_mode == 1 ? 1 : 0; for (int yi = 0; yi < m_src.vsize; yi ++) { u32 src_address = m_src.address + (yi * m_src.fb_pitch); u32 dst_address = m_dst.address + (yi * m_dst.fb_pitch); - for (int xi = 0; xi < (m_src.hsize >> hsize_shift); xi ++) + // TODO: should fetch on demand, depending on what's the color mode/the start dot etc. + for (int xi = 0; xi < m_src.hsize; xi ++) { - // TODO: not very efficient, we need a cleaner per-pixel RMW phase - const u8 src_dot = m_data->read_byte(src_address); - const u8 dst_dot = m_data->read_byte(dst_address); - u8 result = 0; - switch(m_src.pixel_mode) { // 4bpp (shinraba) case 1: - for (int pixi = 0; pixi < 2; pixi ++) + { + const u8 nibble = xi & 1; + u8 src = (m_data->read_byte(src_address + (xi >> 1)) >> (nibble * 4)) & 0xf; + u8 dst = m_data->read_byte(dst_address + (xi >> 1)); + u8 result = dst & (nibble ? 0x0f : 0xf0); + + if ((this->*tpmod_table[tp_mod])(src, dst)) { - u8 cur_pixel = (src_dot & 0xf); - if (cur_pixel || tp_mod == 0) - result |= (src_dot & 0xf) << (pixi * 4); - else - result |= (dst_dot & 0xf) << (pixi * 4); + result |= (this->*rop_table[logical_op])(src, dst) << (nibble * 4); + m_data->write_byte(dst_address + (xi >> 1), result); } + break; + } // 8bpp (tetris) case 2: - u8 cur_pixel = (src_dot & 0xff); - if (cur_pixel || tp_mod == 0) - result |= (cur_pixel & 0xff); - else - result |= (dst_dot & 0xff); + { + u8 src = m_data->read_byte(src_address + xi) & 0xff; + u8 dst = m_data->read_byte(dst_address + xi) & 0xff; + u8 result = dst; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result = (this->*rop_table[logical_op])(src, dst); + m_data->write_byte(dst_address + xi, result); + } break; + } } - - m_data->write_byte(dst_address, result); - src_address ++; - dst_address ++; } } } diff --git a/src/mame/nec/pc88va_sgp.h b/src/mame/nec/pc88va_sgp.h index 1ef011f72b03f..24a53cc6f9586 100644 --- a/src/mame/nec/pc88va_sgp.h +++ b/src/mame/nec/pc88va_sgp.h @@ -49,8 +49,34 @@ class pc88va_sgp_device : void start_exec(); - // commands - void cmd_blit(u16 draw_mode, bool is_patblt); + void execute_blit(u16 draw_mode, bool is_patblt); + + typedef u16 (pc88va_sgp_device::*rop_func)(u16 src, u16 dst); + + static const rop_func rop_table[16]; + u16 rop_0_fill_0(u16 src, u16 dst); + u16 rop_1_s_and_d(u16 src, u16 dst); + u16 rop_2_ns_and_d(u16 src, u16 dst); + u16 rop_3_d(u16 src, u16 dst); + u16 rop_4_s_and_nd(u16 src, u16 dst); + u16 rop_5_s(u16 src, u16 dst); + u16 rop_6_s_xor_d(u16 src, u16 dst); + u16 rop_7_s_or_d(u16 src, u16 dst); + u16 rop_8_ns_or_d(u16 src, u16 dst); + u16 rop_9_n_s_xor_d(u16 src, u16 dst); + u16 rop_A_n_s(u16 src, u16 dst); + u16 rop_B_n_s_or_d(u16 src, u16 dst); + u16 rop_C_nd(u16 src, u16 dst); + u16 rop_D_s_or_nd(u16 src, u16 dst); + u16 rop_E_n_s_and_d(u16 src, u16 dst); + u16 rop_F_fill_1(u16 src, u16 dst); + + typedef bool (pc88va_sgp_device::*tpmod_func)(u16 src, u16 dst); + static const tpmod_func tpmod_table[4]; + bool tpmod_0_always(u16 src, u16 dst); + bool tpmod_1_src(u16 src, u16 dst); + bool tpmod_2_dst(u16 src, u16 dst); + bool tpmod_3_never(u16 src, u16 dst); }; From 864423c55f3263a4629c44a9a92bee643040786f Mon Sep 17 00:00:00 2001 From: angelosa Date: Thu, 6 Mar 2025 21:02:41 +0100 Subject: [PATCH 110/272] nec/pc88va_v.cpp: vestigial interlace support --- src/mame/nec/pc88va.h | 3 ++ src/mame/nec/pc88va_v.cpp | 72 ++++++++++++++++++++++++++------------- 2 files changed, 52 insertions(+), 23 deletions(-) diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index c70fd076af396..ef405b7973ab0 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -278,6 +278,7 @@ class pc88va_state : public driver_device uint8_t m_buf_size = 0; uint8_t m_buf_index = 0; uint8_t m_buf_ram[16]{}; + u8 m_crtc_regs[15]{}; u16 m_vrtc_irq_line = 432; uint8_t idp_status_r(); @@ -296,6 +297,8 @@ class pc88va_state : public driver_device void execute_sprsw_cmd(); void execute_spwr_cmd(u8 data); + void recompute_parameters(); + void main_map(address_map &map) ATTR_COLD; void io_map(address_map &map) ATTR_COLD; void sysbank_map(address_map &map) ATTR_COLD; diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 68674fc1c10a5..225e98feabed6 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -4,7 +4,7 @@ #include "emu.h" #include "pc88va.h" -#include +//#include #define LOG_IDP (1U << 1) // TSP data @@ -58,11 +58,14 @@ void pc88va_state::video_start() void pc88va_state::video_reset() { m_text_transpen = 0; + m_screen_ctrl_reg = 0; + m_color_mode = 0; + m_pltm = 0; + m_pltp = 0; } void pc88va_state::palette_init(palette_device &palette) const { - // default palette const u16 default_palette[16] = { 0x0000, 0x001f, 0x03e0, 0x03ff, 0xfc00, 0xfc1f, 0xffe0, 0xffff, 0x7def, 0x0015, 0x02a0, 0x02b5, 0xac00, 0xac15, 0xaea0, 0xaeb5 @@ -1138,21 +1141,29 @@ void pc88va_state::execute_sync_cmd() // olteus will punt loading on PC Engine OS if the vblank bit is completely off // illcity expects the actual IDP vblank bit to work, from setup menu to opening transition PC=0x418f6 // upo wants precise vblank bit readouts plus something else (SGP irq?) - - rectangle visarea; - attoseconds_t refresh; - + // TODO: verify fray LOGCRTC("IDP SYNC: "); for (int i = 0; i < 15; i++) + { LOGCRTC("%02x ", m_buf_ram[i]); + m_crtc_regs[i] = m_buf_ram[i]; + } + + recompute_parameters(); +} + +void pc88va_state::recompute_parameters() +{ + rectangle visarea; + attoseconds_t refresh; - const u8 h_blank_start = (m_buf_ram[0x02] & 0x3f) + 1; - const u8 h_border_start = (m_buf_ram[0x03] & 0x3f) + 1; - const u16 h_vis_area = (m_buf_ram[0x04] + 1) * 4; - const u8 h_border_end = (m_buf_ram[0x05] & 0x3f) + 1; - const u8 h_blank_end = (m_buf_ram[0x06] & 0x3f) + 1; - const u8 h_sync = (m_buf_ram[0x07] & 0x3f) + 1; + const u8 h_blank_start = (m_crtc_regs[0x02] & 0x3f) + 1; + const u8 h_border_start = (m_crtc_regs[0x03] & 0x3f) + 1; + const u16 h_vis_area = (m_crtc_regs[0x04] + 1) * 4; + const u8 h_border_end = (m_crtc_regs[0x05] & 0x3f) + 1; + const u8 h_blank_end = (m_crtc_regs[0x06] & 0x3f) + 1; + const u8 h_sync = (m_crtc_regs[0x07] & 0x3f) + 1; LOGCRTC("\n\t"); LOGCRTC("H blank start %d - end %d|", h_blank_start, h_blank_end); @@ -1167,23 +1178,32 @@ void pc88va_state::execute_sync_cmd() LOGCRTC("H Total calc = %d", h_total); LOGCRTC("\n\t"); - const u8 v_blank_start = m_buf_ram[0x08] & 0x3f; - const u8 v_border_start = m_buf_ram[0x09] & 0x3f; - const u16 v_vis_area = (m_buf_ram[0x0a]) | ((m_buf_ram[0x0b] & 0x40) << 2); - const u8 v_border_end = m_buf_ram[0x0b] & 0x3f; - const u8 v_blank_end = m_buf_ram[0x0c] & 0x3f; - const u8 v_sync = (m_buf_ram[0x0d] & 0x3f); + const u8 v_blank_start = m_crtc_regs[0x08] & 0x3f; + const u8 v_border_start = m_crtc_regs[0x09] & 0x3f; + u16 v_vis_area = (m_crtc_regs[0x0a]) | ((m_crtc_regs[0x0b] & 0x40) << 2); + const u8 v_border_end = m_crtc_regs[0x0b] & 0x3f; + const u8 v_blank_end = m_crtc_regs[0x0c] & 0x3f; + const u8 v_sync = (m_crtc_regs[0x0d] & 0x3f); LOGCRTC("V blank start %d - end %d|", v_blank_start, v_blank_end); LOGCRTC("V visible area: %d|", v_vis_area); - LOGCRTC("V border start: %d - end %d|", v_border_start, v_border_end); + LOGCRTC("V border start %d - end %d|", v_border_start, v_border_end); LOGCRTC("V sync: %d", v_sync); LOGCRTC("\n\t"); m_vrtc_irq_line = v_blank_start + v_blank_end + v_vis_area + v_border_start + v_border_end; - const u16 v_total = m_vrtc_irq_line + v_sync; + u16 v_total = m_vrtc_irq_line + v_sync; - LOGCRTC("V Total calc = %d (VRTC %d)\n", v_total, m_vrtc_irq_line); + LOGCRTC("V Total calc = %d (VRTC %d)", v_total, m_vrtc_irq_line); + + if (BIT(m_screen_ctrl_reg, 7)) + { + m_vrtc_irq_line <<= 1; + v_total <<= 1; + v_vis_area <<= 1; + LOGCRTC(" (Interlace)"); + } + LOGCRTC("\n"); // punt with message if values are off (shouldn't happen) // TODO: more validation: @@ -1202,9 +1222,9 @@ void pc88va_state::execute_sync_cmd() visarea.set(0, h_vis_area - 1, 0, v_vis_area - 1); - // TODO: interlace / vertical magnify, bit 7 + // TODO: vertical magnify, bit 7 // TODO: actual clock source must be external, assume known PC-88 XTALs, a bit off compared to PC-88 with the values above - const int clock_speed = BIT(m_buf_ram[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); + const int clock_speed = BIT(m_crtc_regs[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); refresh = HZ_TO_ATTOSECONDS(clock_speed) * h_vis_area * v_vis_area; @@ -1459,6 +1479,12 @@ void pc88va_state::idp_param_w(uint8_t data) */ void pc88va_state::screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask) { + // Interlace mode (inufuto games), cheat for now. + if (BIT(data, 7) != BIT(m_screen_ctrl_reg, 7)) + { + recompute_parameters(); + } + COMBINE_DATA(&m_screen_ctrl_reg); m_ymmd = bool(BIT(m_screen_ctrl_reg, 11)); From 144d3b3989a043ce555bdee613408ff90e3d15c0 Mon Sep 17 00:00:00 2001 From: AJR Date: Thu, 6 Mar 2025 22:02:26 -0500 Subject: [PATCH 111/272] sound/namco.cpp: m_voices is a configuration parameter, so it shouldn't be part of the save state --- src/devices/sound/namco.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/devices/sound/namco.cpp b/src/devices/sound/namco.cpp index 0b3f310270a22..5842c7ada83ab 100644 --- a/src/devices/sound/namco.cpp +++ b/src/devices/sound/namco.cpp @@ -108,7 +108,6 @@ void namco_audio_device::device_start() if (m_wave_ptr == nullptr) save_pointer(NAME(m_wavedata), 0x400); - save_item(NAME(m_voices)); save_item(NAME(m_sound_enable)); for (int v = 0; v < MAX_VOLUME; v++) save_pointer(NAME(m_waveform[v]), 32 * 8 * (1+m_wave_size), v); From 98b3a1c07526a04ba61ea83273fa8f454006b0d9 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Fri, 7 Mar 2025 18:53:33 +0100 Subject: [PATCH 112/272] New systems marked not working ------------------------------ Nu Wang Feng New / Queen Bee New (China, Ver. 1.10) [dyq, little0, Guru] --- src/mame/mame.lst | 1 + src/mame/subsino/subsino2.cpp | 113 +++++++++++++++++++++++----------- 2 files changed, 78 insertions(+), 36 deletions(-) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index e6b92e7d83fd8..7d05cd837e701 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -43746,6 +43746,7 @@ queenbee queenbeeb queenbeei queenbeesa +queenbn saklove squeenb strain diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index b28ee4f41822d..c02025f9d7d6f 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -45,7 +45,7 @@ RAMDAC. - Add sound to SS9804/SS9904 games. - ptrain: missing scroll in race screens. - humlan: empty reels when bonus image should scroll in via L0 scroll. The image (crown/fruits) is at y > 0x100 in the tilemap. -- bishjan, new2001, humlan, saklove, squeenb: game is sometimes too fast (can bishjan read the VBLANK state? saklove and xplan can). +- bishjan, new2001, humlan, saklove, squeenb, queenbn: game is sometimes too fast (can bishjan read the VBLANK state? saklove and xplan can). - xtrain: it runs faster than a video from the real thing. It doesn't use vblank irqs (but reads the vblank bit). - mtrain: implement hopper. - xplan: starts with 4 credits, no controls to move the aircraft @@ -3075,46 +3075,66 @@ void subsino2_state::expcard(machine_config &config) /*************************************************************************** -Bishou Jan (Laugh World) -(C)1999 Subsino - -PCB Layout ----------- - -|------------------------------------------------------| -|TDA1519A 28-WAY | -| VOL | -| HM86171 ULN2003 | -| LM324 | -| S-1 ULN2003 | -| | -| |-------| DSW1(8) | -| |-------| |SUBSINO| | -| 2-V201.U9 |SUBSINO| |SS9802 | | -| |SS9904 | | | | -| | | |-------| | -| |-------| | -| | -| 44.1MHz CXK58257 | -| 3-V201.U25 | -| 1-V203.U21 | -| 4-V201.U26 SW1| -| |-------| |-------| |-----| | -| 5-V201.U27 |SUBSINO| |SUBSINO| |H8 | | -| |SS9601 | |SS9803 | |3044 | | -| 6-V201.U28 | | | | |-----| | -| |-------| |-------| | -| 62256 62256 BATTERY | +Bishou Jan (Laugh World), Subsino, 1999 (with Mahjong 28-way edge instead of 10 + 18 way) +Xiao Ao Jiang Hu (China, Ver. 1.00), Subsino, 1999 +Queen Bee New, Subsino, 2002 +(Several other games produced between 1998-2003 run on this same PCB) +Hardware Info By Guru +--------------------- + +|---| |-----------| |--------------------| |----| +| |--| 10-WAY |------| 18-WAY |--| | +|TDA1519A | +| VOL HM86171 | +|-| LM324 ULN2003 | + |DS1230.Q3 S-1 ULN2003 | +|-| SND.U10 |-------| |-------| DS1| +| LM7805 % |SUBSINO| |SUBSINO| | +| |SS9904 | |SS9802 | | +| | | | | | +|J |-------| |-------| | +|A | +|M XTAL T518B | +|M GFX1.U25 CXK58257| +|A PROG.U21 | +| GFX2.U26 SW1| +| * |-------| |-------| |-----| | +| GFX3.U27 |SUBSINO| |SUBSINO| |H8 | | +|-| |SS9601 | |SS9803 | |3044 | | + | GFX4.U28 | | | | |-----| | +|-| |-------| |-------| | +| CN1 62256 62256 BATTERY | |------------------------------------------------------| Notes: H8/3044 - Subsino re-badged Hitachi H8/3044 HD6433044A22F Microcontroller (QFP100) - The H8/3044 is a H8/3002 with 24bit address bus and has 32k mask ROM and 2k RAM, clock input is 14.7MHz [44.1/3] + The H8/3044 is a H8/3002 with 24bit address bus and has 32kB mask ROM and 2kB RAM, clock input is XTAL/3. MD0,MD1 & MD2 are configured to MODE 6 16MByte Expanded Mode with the on-chip 32k mask ROM enabled. - CXK58257 - Sony CXK58257 32k x8 SRAM (SOP28) + CXK58257 - Sony CXK58257 32kB x8-bit SRAM (SOP28). This RAM is battery-backed. HM86171 - Hualon Microelectronics HMC HM86171 VGA 256 colour RAMDAC (DIP28) - S-1 - ?? Probably some kind of audio OP AMP or DAC? (DIP8) - SW1 - Push Button Test Switch - HSync - 15.75kHz + SS9904 - Custom Subsino Sound Chip (QFP100) + SS9802 - Custom Subsino Chip (QFP100) (I/O & Protection; DS1230A is connected to this chip) + SS9803 - Custom Subsino Chip (QFP100) (Memory Controller) + SS9601 - Custom Subsino Chip (QFP160) (Graphics) + S-1 - Some kind of Audio DAC (DIP8). Connected to LM324 Operational Amplifier + LM324 - Texas Instruments LM324 Quad Operational Amplifier + SW1 - Push Button For NVRAM Clear And Reset + DS1 - 8-Position DIP Switch + BATTERY - 3.6V Ni-Cad Battery + ULN2003 - ULN2003 7-Channel Darlington Transistor Array + CN1 - 64-Pin Expansion Connector for ROM Daughter Board (not populated) + XTAL - Bishou Jan uses 44.1MHz Crystal + Xiao Ao Jiang Hu uses 44.1MHz Crystal + Queen Bee New uses 48.94MHz Crystal + DS1230.Q3 - Dallas DS1230A 1-Wire EEPROM (TO92). Hidden among other parts disguised as a transistor. + Each game has different EEPROM data used for protection. + All these have the surface scratched and the part location is marked Q3. + PROG.U21 - 27C020 or 27C040 EPROM (main program) + SND.U10 - 27C080 or 27C040 EPROM. Game boots to I/O test screen if this ROM is not present so this is a program ROM for + the sound chip and possibly audio data/samples. + % - Location for SOP44 ROM at U9 + GFX.U* - 27C040 or 27C080 EPROM (graphics) + * - Location for a SSOP70 1MB x32-bit ROM at U24. Used on Xiao Ao Jiang Hu instead of 4x EPROMs. + HSync - 15.62kHz VSync - 60Hz ***************************************************************************/ @@ -3153,6 +3173,25 @@ ROM_START( xiaoao ) ROM_LOAD( "xiaoaojianghu-ds2430a.q3", 0x00, 0x28, CRC(518e4ba3) SHA1(704fb6f8ff9966d1b90af849b2b7c6df06d3e4a0) ) ROM_END +ROM_START( queenbn ) + ROM_REGION( 0x100000, "maincpu", 0 ) + ROM_LOAD( "ss9689_6433044a22f.u16", 0x000000, 0x008000, CRC(ece09075) SHA1(a8bc3aa44f30a6f919f4151c6093fb52e5da2f40) ) + ROM_LOAD( "prg.u21", 0x080000, 0x040000, CRC(e04e5926) SHA1(e17d0015742f9646a6702f8e45845b0c537064e8) ) + ROM_RELOAD( 0x0c0000, 0x040000 ) + + ROM_REGION( 0x200000, "tilemap", 0 ) + ROM_LOAD32_BYTE( "gfx.u25", 0x00000, 0x80000, CRC(c1a5269f) SHA1(a99d5ecc404c3b5bbd69f6f6b6aa0d91df5f97b6) ) + ROM_LOAD32_BYTE( "gfx.u26", 0x00002, 0x80000, CRC(11958b79) SHA1(b9e0df7cd31abd081df62df3805d9ad80d69b9f3) ) + ROM_LOAD32_BYTE( "gfx.u27", 0x00001, 0x80000, CRC(56474613) SHA1(c26211d3c1a3e6eea4e097b4a4ea12743559a5ff) ) + ROM_LOAD32_BYTE( "gfx.u28", 0x00003, 0x80000, CRC(860a85cd) SHA1(f54ac488b26b11e37cf990a0804d40a2df5cbb16) ) + + ROM_REGION( 0x80000, "samples", 0 ) + ROM_LOAD( "snd.u9", 0x00000, 0x80000, CRC(aa4edabb) SHA1(b117ad5bba2e410e20b5cbdb606688c6e2112450) ) + + ROM_REGION( 0x28, "eeprom", 0 ) + ROM_LOAD( "ds2430a-queen-bee-new.q3", 0x00, 0x28, CRC(4f9c3db6) SHA1(7cdc8e4c2fc5528ba33489d38732e753ef01b8fc) ) +ROM_END + /*************************************************************************** @@ -4024,6 +4063,8 @@ GAME( 2001, queenbeesa, queenbee, humlan, queenbee, subsino2_state, empty_ini GAME( 2001, humlan, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (Truemax license)", "Humlan's Lyckohjul (Sweden, Ver. 402)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, queenbn, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Nu Wang Feng New / Queen Bee New (China, Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues + GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (ECM license)", "X-Reel", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues From 91f7db1c686ab9b79fa822a76fc7eb7c6bc45f64 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 7 Mar 2025 19:12:26 +0100 Subject: [PATCH 113/272] scripts/build/check_include_guards.py: bail if no argument specified --- scripts/build/check_include_guards.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build/check_include_guards.py b/scripts/build/check_include_guards.py index f294cc6412fd6..bcc1bd889e91f 100755 --- a/scripts/build/check_include_guards.py +++ b/scripts/build/check_include_guards.py @@ -28,6 +28,10 @@ def pathsplit(p): substpat = re.compile('[-.]') guardpat = re.compile('^ *# *ifndef +([^\s]+)(\s+.*)?') bad = False + if len(sys.argv) < 2: + sys.stderr.write("Error: requires at least one path defined\n") + sys.exit(2) + for root in sys.argv[1:]: for path, subdirs, files in os.walk(root): prefix = 'MAME_' + '_'.join([n.upper() for n in pathsplit(os.path.relpath(path, root))]) + '_' From 4a4d82b44f627ed4c017315bd1236875557152c9 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 7 Mar 2025 19:12:47 +0100 Subject: [PATCH 114/272] ti99/peb/speechadapter.h: fix include guard --- src/devices/bus/ti99/peb/speechadapter.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/devices/bus/ti99/peb/speechadapter.h b/src/devices/bus/ti99/peb/speechadapter.h index 5846b595c5d75..b77823811ca49 100644 --- a/src/devices/bus/ti99/peb/speechadapter.h +++ b/src/devices/bus/ti99/peb/speechadapter.h @@ -2,15 +2,15 @@ // copyright-holders:Michael Zapf /**************************************************************************** - TI-99 Speech Synthesizer connector adapter + TI-99 Speech Synthesizer connector adapter for the Peripheral Expansion Box Michael Zapf, March 2025 *****************************************************************************/ -#ifndef MAME_BUS_TI99_PEB_SPCHADPT_H -#define MAME_BUS_TI99_PEB_SPCHADPT_H +#ifndef MAME_BUS_TI99_PEB_SPEECHADAPTER_H +#define MAME_BUS_TI99_PEB_SPEECHADAPTER_H #pragma once @@ -28,7 +28,7 @@ class ti_speechsyn_adapter_device : public device_t, public device_ti99_peribox_ void setaddress_dbin(offs_t offset, int state) override; void crureadz(offs_t offset, uint8_t *value) override { } void cruwrite(offs_t offset, uint8_t data) override { } - + protected: virtual void device_start() override; virtual void device_reset() override; @@ -46,4 +46,4 @@ class ti_speechsyn_adapter_device : public device_t, public device_ti99_peribox_ DECLARE_DEVICE_TYPE_NS(TI99_SPEECHADAPTER, bus::ti99::peb, ti_speechsyn_adapter_device) -#endif // MAME_BUS_TI99_PEB_SPCHADPT_H +#endif // MAME_BUS_TI99_PEB_SPEECHADAPTER_H From 48840e3e7f06f8ebe01635992f5f582c219ad0c3 Mon Sep 17 00:00:00 2001 From: angelosa Date: Fri, 7 Mar 2025 19:14:10 +0100 Subject: [PATCH 115/272] aristocrat/aristmk6.cpp: add note relationship with neon250 --- src/devices/video/pc_vga_nvidia.cpp | 2 ++ src/mame/aristocrat/aristmk6.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/video/pc_vga_nvidia.cpp b/src/devices/video/pc_vga_nvidia.cpp index 31d5c23c6a450..3fa14260a3d8e 100644 --- a/src/devices/video/pc_vga_nvidia.cpp +++ b/src/devices/video/pc_vga_nvidia.cpp @@ -25,9 +25,11 @@ nVidia NV3:G80 VGA core Notes: - NV1 looks very different, not worth to subclass here; +- According to starfrost013 this is really a Weitek core ... References: - https://envytools.readthedocs.io/en/latest/hw/display/nv3/index.html +- https://86box.net/2025/02/25/riva128-part-1.html **************************************************************************************************/ diff --git a/src/mame/aristocrat/aristmk6.cpp b/src/mame/aristocrat/aristmk6.cpp index f2bdf13b6f2ff..70434e44e9a57 100644 --- a/src/mame/aristocrat/aristmk6.cpp +++ b/src/mame/aristocrat/aristmk6.cpp @@ -16,7 +16,7 @@ - Identify irq sources; - Irq acknowledge doesn't work as intended; - Emulate PLX 9054 controller & PCI root; -- PMX1 likely runs under PCI bus too; +- PMX1 likely runs under PCI bus too, as per src/devices/bus/pci/neon250.cpp (x86 AGP card); - Eventually gets to "flyback" errors, pings $12000130-$3f for strobe and/or irq enable. Flyback is an alias for vblank, cfr. Acorn Archimedes. From f3d02b642579bfcf977436eda16d62b2e274a8d2 Mon Sep 17 00:00:00 2001 From: Matthew Daniels <108370479+gm-matthew@users.noreply.github.com> Date: Fri, 7 Mar 2025 22:36:01 +0000 Subject: [PATCH 116/272] Removing erroneously duplicated lines in figure of Model 3 video board (#13452) --- src/mame/sega/model3.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/mame/sega/model3.cpp b/src/mame/sega/model3.cpp index 5547fc3819fad..b4ed68a1dfb90 100644 --- a/src/mame/sega/model3.cpp +++ b/src/mame/sega/model3.cpp @@ -620,24 +620,6 @@ Video Board | M5M4V4169 | | M5M4V4169 | | ADV7120KP30 | -| | -| | -| M5M410092FP M5M410092FP M5M4V4169 | -| SEGA (TQFP128) (TQFP128) M5M4V4169 | -| 315-6061 M5M410092FP | -| (BGA) (TQFP128) M5M4V4169 | -| M5M410092FP M5M4V4169 | -| (TQFP128) M5M410092FP | -| (TQFP128) SEGA SEGA M5M4V4169 | -| SEGA M5M410092FP 315-6059 315-6060 M5M4V4169 | -| 315-5648 (TQFP128) M5M410092FP (BGA) (BGA) | -| (QFP64) (TQFP128) SEGA | -| 315-6060 M5M4V4169 | -| (BGA) M5M4V4169 | -| | -| M5M4V4169 | -| M5M4V4169 | -| ADV7120KP30 | | (PLCC44) | | M5M4V4169 M5M4V4169 M5M4V4169 M5M4V4169 | | M5M4V4169 M5M4V4169 M5M4V4169 M5M4V4169 | From fb6b48711a10f39eaeee678dd352b0286e911393 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 7 Mar 2025 19:36:05 -0500 Subject: [PATCH 117/272] Add disassembler for CDC 160(-A) architecture --- scripts/src/cpu.lua | 10 + src/devices/cpu/cdc160/cdc160d.cpp | 379 +++++++++++++++++++++++++++++ src/devices/cpu/cdc160/cdc160d.h | 34 +++ src/tools/unidasm.cpp | 3 + 4 files changed, 426 insertions(+) create mode 100644 src/devices/cpu/cdc160/cdc160d.cpp create mode 100644 src/devices/cpu/cdc160/cdc160d.h diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 51d8e1b17b576..6b03fc9468d20 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -3521,6 +3521,16 @@ if opt_tool(CPUS, "SIGMA2") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/sigma2/sigma2d.h") end +-------------------------------------------------- +-- Control Data Corporation 160 (disassembler only) +--@src/devices/cpu/cdc160/cdc160.h,CPUS["CDC160"] = true +-------------------------------------------------- + +if opt_tool(CPUS, "CDC160") then + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/cdc160/cdc160d.cpp") + table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/cdc160/cdc160d.h") +end + -------------------------------------------------- -- Control Data Corporation 1700 (disassembler only) --@src/devices/cpu/cdc1700/cdc1700.h,CPUS["CDC1700"] = true diff --git a/src/devices/cpu/cdc160/cdc160d.cpp b/src/devices/cpu/cdc160/cdc160d.cpp new file mode 100644 index 0000000000000..898ef277e0ec2 --- /dev/null +++ b/src/devices/cpu/cdc160/cdc160d.cpp @@ -0,0 +1,379 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + CDC 160/160-A disassembler + + Some departures from the syntax used by CDC's assemblers: + — Two-word instructions are always written on one line each. This + was not necessarily permitted, especially for INP and OUT. + — For forward and backward addressing modes, the effective address is + given rather than the 6-bit displacement to be added to P. + — For 160-A only, a synthetic two-word instruction JPM (Jump Memory) + represents the common pattern of using JFI with a 1-word displacement + to jump to any address in the 4096-word bank. + +***************************************************************************/ + +#include "emu.h" +#include "cdc160d.h" + +cdc160_disassembler::cdc160_disassembler() + : util::disasm_interface() +{ +} + +u32 cdc160_disassembler::opcode_alignment() const +{ + return 1; +} + +cdc160a_disassembler::cdc160a_disassembler() + : cdc160_disassembler() +{ +} + +u32 cdc160a_disassembler::interface_flags() const +{ + return PAGED; +} + +u32 cdc160a_disassembler::page_address_bits() const +{ + return 12; +} + +namespace { + +const char *const f_160a_bank_ops[7] = +{ + "SRJ", "SIC", "IRJ", "SDC", "DRJ", "SID", "ACJ" +}; + +const char *const f_160_alu_ops[10] = +{ + "LP", "LS", "LD", "LC", "AD", "SB", "ST", "SR", "RA", "AO" +}; + +const char *const f_160a_alu_ops[10] = +{ + "LP", "SC", "LD", "LC", "AD", "SB", "ST", "SR", "RA", "AO" +}; + +const char *const f_cond_jp_ops[6] = +{ + "ZJ", "NZ", "PJ", "NJ" +}; + +// 12-bit ones' complement addition +inline u16 add_relative(uint_fast16_t a, uint_fast16_t b) noexcept +{ + u16 c = (a & 07777) + (b & 07777); + if (c >= 07777) + c -= 07777; + return c; +} + +} // anonymous namespace + +offs_t cdc160_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc) & 07777; + if (inst < 0200) + { + util::stream_format(stream, "%s %o", BIT(inst, 6) ? "SHA" : "ERR", inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 01000) + { + // No address (6-bit immediate) mode + util::stream_format(stream, "%sN %o", f_160_alu_ops[BIT(inst, 6, 3) - 2], inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 06000) + { + if (BIT(inst, 7)) + { + // Relative forward or backward address mode + util::stream_format(stream, "%s%c %04o", f_160_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'B' : 'F', + add_relative(pc, BIT(inst, 6) ? ~(inst & 0077) : inst & 0077)); + return 1 | SUPPORTED; + } + else + { + // Direct or indirect address mode + util::stream_format(stream, "%s%c %02o", f_160_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'I' : 'D', inst & 0077); + return 1 | SUPPORTED; + } + } + else if (inst < 07000) + { + // Relative conditional jumps + util::stream_format(stream, "%s%c %04o", f_cond_jp_ops[BIT(inst, 6, 2)], BIT(inst, 8) ? 'B' : 'F', + add_relative(pc, BIT(inst, 8) ? ~(inst & 0077) : inst & 0077)); + return 1 | STEP_COND | SUPPORTED; + } + else switch (BIT(inst, 6, 3)) + { + case 0: + util::stream_format(stream, "JPI %02o", inst & 0077); + return 1 | STEP_OUT | SUPPORTED; + + case 1: + // Jump forward indirect + util::stream_format(stream, "JFI %04o", add_relative(pc, inst & 0077)); + return 1 | SUPPORTED; + + case 2: case 3: + util::stream_format(stream, "%s %04o %04o", BIT(inst, 6) ? "OUT" : "INP", add_relative(pc, inst & 0077), opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + + case 4: + // Output direct + util::stream_format(stream, "OTN %02o", inst & 0077); + return 1 | SUPPORTED; + + case 5: + // External function + util::stream_format(stream, "EXF %04o", (pc + (inst & 0077)) & 07777); + return 1 | SUPPORTED; + + case 6: + util::stream_format(stream, "INA %o", inst & 0077); + return 1 | SUPPORTED; + + case 7: default: + util::stream_format(stream, "HLT %02o", inst & 0077); + return 1 | SUPPORTED; + } +} + +offs_t cdc160a_disassembler::disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) +{ + u16 inst = opcodes.r16(pc) & 07777; + if (inst < 0200) + { + if (inst >= 0010 && inst < 0100) + { + util::stream_format(stream, "%s %d", f_160a_bank_ops[BIT(inst, 3, 3) - 1], inst & 0007); + return 1 | SUPPORTED; + } + else switch (inst) + { + case 0000: + stream << "ERR"; + return 1 | SUPPORTED; + + case 0001: + stream << "NOP"; + return 1 | SUPPORTED; + + case 0100: + util::stream_format(stream, "BLS %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0101: + stream << "PTA"; + return 1 | (BIT(opcodes.r16(pc + 1), 6, 3) == 070 ? STEP_OVER | step_over_extra(1) : 0) | SUPPORTED; + + case 0102: + stream << "LS1"; + return 1 | SUPPORTED; + + case 0103: + stream << "LS2"; + return 1 | SUPPORTED; + + case 0104: + stream << "CBC"; + return 1 | SUPPORTED; + + case 0105: + util::stream_format(stream, "ATE %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0106: + util::stream_format(stream, "ATX %04o", opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + + case 0107: + stream << "ETA"; + return 1 | SUPPORTED; + + case 0110: + stream << "LS3"; + return 1 | SUPPORTED; + + case 0111: + stream << "LS6"; + return 1 | SUPPORTED; + + case 0112: + stream << "MUT"; + return 1 | SUPPORTED; + + case 0113: + stream << "MUH"; + return 1 | SUPPORTED; + + case 0114: + stream << "RS1"; + return 1 | SUPPORTED; + + case 0115: + stream << "RS2"; + return 1 | SUPPORTED; + + case 0120: + stream << "CIL"; + return 1 | SUPPORTED; + + case 0130: + stream << "CTA"; + return 1 | SUPPORTED; + + case 0140: case 0141: case 0142: case 0143: case 0144: case 0145: case 0146: case 0147: + util::stream_format(stream, "SBU %d", inst & 0007); + return 1 | SUPPORTED; + + case 0150: case 0151: case 0152: case 0153: case 0154: case 0155: case 0156: case 0157: + util::stream_format(stream, "STP %02o", inst & 0077); + return 1 | SUPPORTED; + + case 0160: case 0161: case 0162: case 0163: case 0164: case 0165: case 0166: case 0167: + util::stream_format(stream, "STE %02o", inst & 0077); + return 1 | SUPPORTED; + + default: + util::stream_format(stream, "%04o", inst); + return 1 | SUPPORTED; + } + } + else if (inst < 01000) + { + // No address (6-bit immediate) mode + util::stream_format(stream, "%sN %o", f_160a_alu_ops[BIT(inst, 6, 3) - 2], inst & 0077); + return 1 | SUPPORTED; + } + else if (inst < 06000) + { + if (BIT(inst, 7)) + { + if ((inst & 0077) != 0) + { + // Relative forward or backward address mode + util::stream_format(stream, "%s%c %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'B' : 'F', + add_relative(pc, BIT(inst, 6) ? ~(inst & 0077) : inst & 0077)); + return 1 | SUPPORTED; + } + else if (BIT(inst, 6)) + { + // Specific address mode + util::stream_format(stream, "%sS", f_160a_alu_ops[BIT(inst, 8, 4) - 2]); + return 1 | SUPPORTED; + } + else + { + // Constant address (12-bit immediate) mode + util::stream_format(stream, "%sC %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + } + else if ((inst & 0177) == 0100) + { + // Memory address mode + util::stream_format(stream, "%sM %04o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + else + { + // Direct or indirect address mode + util::stream_format(stream, "%s%c %02o", f_160a_alu_ops[BIT(inst, 8, 4) - 2], BIT(inst, 6) ? 'I' : 'D', inst & 0077); + return 1 | SUPPORTED; + } + } + else if (inst < 07000) + { + // Relative conditional jumps + util::stream_format(stream, "%s%c %04o", f_cond_jp_ops[BIT(inst, 6, 2)], BIT(inst, 8) ? 'B' : 'F', + add_relative(pc, BIT(inst, 8) ? ~(inst & 0077) : inst & 0077)); + return 1 | STEP_COND | SUPPORTED; + } + else switch (BIT(inst, 6, 3)) + { + case 0: + util::stream_format(stream, "JPI %02o", inst & 0077); + return 1 | STEP_OUT | SUPPORTED; + + case 1: + if ((inst & 0077) <= 1) + { + util::stream_format(stream, "JP%c %04o", BIT(inst, 0) ? 'M' : 'R', opcodes.r16(pc + 1) & 07777); + return 2 | (BIT(inst, 0) ? 0 : STEP_OVER) | SUPPORTED; + } + else + { + util::stream_format(stream, "JFI %04o", add_relative(pc, inst & 0077)); + return 1 | SUPPORTED; + } + + case 2: case 3: + if ((inst & 0077) == 0) + { + // Buffer input/output + util::stream_format(stream, "IB%c %04o", BIT(inst, 6) ? 'O' : 'I', opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + } + else + { + // Normal input/output + util::stream_format(stream, "%s %04o %04o", BIT(inst, 6) ? "OUT" : "INP", add_relative(pc, inst & 0077), opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + return 1 | SUPPORTED; + + case 4: + // Output direct + util::stream_format(stream, "OTN %02o", inst & 0077); + return 1 | SUPPORTED; + + case 5: + // External function + if ((inst & 0077) == 0) + { + util::stream_format(stream, "EXC %04o", opcodes.r16(pc + 1) & 07777); + return 2 | SUPPORTED; + } + else + { + util::stream_format(stream, "EXF %04o", (pc + (inst & 0077)) & 07777); + return 1 | SUPPORTED; + } + + case 6: + if ((inst & 0077) == 0) + stream << "INA"; + else if ((inst & 0077) == 0077) + stream << "OTA"; + else + util::stream_format(stream, "HWI %02o", inst & 0077); + return 1 | SUPPORTED; + + case 7: default: + if ((inst & 0077) == 0 || (inst & 0077) == 0077) + { + stream << "HLT"; + return 1 | SUPPORTED; + } + else if ((inst & 070) == 0) + { + util::stream_format(stream, "SLS %d", inst & 0007); + return 1 | SUPPORTED; + } + else + { + util::stream_format(stream, "%s %02o %04o", (inst & 0007) != 0 ? "SJS" : "SLJ", inst & 077, opcodes.r16(pc + 1) & 07777); + return 2 | STEP_COND | SUPPORTED; + } + } +} diff --git a/src/devices/cpu/cdc160/cdc160d.h b/src/devices/cpu/cdc160/cdc160d.h new file mode 100644 index 0000000000000..f564f7c6bf92b --- /dev/null +++ b/src/devices/cpu/cdc160/cdc160d.h @@ -0,0 +1,34 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_CDC160_CDC160D_H +#define MAME_CPU_CDC160_CDC160D_H + +#pragma once + +class cdc160_disassembler : public util::disasm_interface +{ +public: + // construction/destruction + cdc160_disassembler(); + +protected: + // util::disasm_interface overrides + virtual u32 opcode_alignment() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; +}; + +class cdc160a_disassembler : public cdc160_disassembler +{ +public: + // construction/destruction + cdc160a_disassembler(); + +protected: + // util::disasm_interface overrides + virtual u32 interface_flags() const override; + virtual u32 page_address_bits() const override; + virtual offs_t disassemble(std::ostream &stream, offs_t pc, const data_buffer &opcodes, const data_buffer ¶ms) override; +}; + +#endif // MAME_CPU_CDC160_CDC160D_H diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp index 1d7e9fc693281..ecc7140368551 100644 --- a/src/tools/unidasm.cpp +++ b/src/tools/unidasm.cpp @@ -30,6 +30,7 @@ using util::BIT; #include "cpu/c33/c33dasm.h" #include "cpu/capricorn/capricorn_dasm.h" #include "cpu/ccpu/ccpudasm.h" +#include "cpu/cdc160/cdc160d.h" #include "cpu/cdc1700/cdc1700d.h" #include "cpu/clipper/clipperd.h" #include "cpu/cop400/cop410ds.h" @@ -423,6 +424,8 @@ static const dasm_table_entry dasm_table[] = { "c33", le, 0, []() -> util::disasm_interface * { return new c33_disassembler; } }, { "capricorn", le, 0, []() -> util::disasm_interface * { return new capricorn_disassembler; } }, { "ccpu", le, 0, []() -> util::disasm_interface * { return new ccpu_disassembler; } }, + { "cdc160", be, -1, []() -> util::disasm_interface * { return new cdc160_disassembler; } }, + { "cdc160a", be, -1, []() -> util::disasm_interface * { return new cdc160a_disassembler; } }, { "cdc1700", be, -1, []() -> util::disasm_interface * { return new cdc1700_disassembler; } }, { "cdp1801", le, 0, []() -> util::disasm_interface * { return new cosmac_disassembler(cosmac_disassembler::TYPE_1801); } }, { "cdp1802", le, 0, []() -> util::disasm_interface * { return new cosmac_disassembler(cosmac_disassembler::TYPE_1802); } }, From a026c8df1274fb54b6469a3d7dfa5a824436954a Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 8 Mar 2025 07:42:31 +0100 Subject: [PATCH 118/272] New clones marked not working ----------------------------- Jin Hu Lu 2 (v120GI) [dyq. little0, Guru] --- src/emu/xtal.cpp | 1 + src/mame/igs/spoker.cpp | 348 ++++++++++++++++++++++++++-------- src/mame/mame.lst | 1 + src/mame/subsino/subsino2.cpp | 73 +++---- 4 files changed, 316 insertions(+), 107 deletions(-) diff --git a/src/emu/xtal.cpp b/src/emu/xtal.cpp index 271a4fcc4c5ec..6fa14b3f2de66 100644 --- a/src/emu/xtal.cpp +++ b/src/emu/xtal.cpp @@ -476,6 +476,7 @@ const double XTAL::known_xtals[] = { 48'556'800, // 48.5568_MHz_XTAL Wyse WY-85 48'654'000, // 48.654_MHz_XTAL Qume QVT-201 48'660'000, // 48.66_MHz_XTAL Zaxxon + 48'940'000, // 48.94_MHz_XTAL Queen Bee New 49'152'000, // 49.152_MHz_XTAL Used on some Namco PCBs, Baraduke h/w, System 21, Super System 22 49'423'500, // 49.4235_MHz_XTAL Wyse WY-185 50'000'000, // 50_MHz_XTAL Williams/Midway T/W/V-unit system diff --git a/src/mame/igs/spoker.cpp b/src/mame/igs/spoker.cpp index f0a27e7f702db..156f72bda9cec 100644 --- a/src/mame/igs/spoker.cpp +++ b/src/mame/igs/spoker.cpp @@ -30,6 +30,9 @@ - 3super8 randomly crashes - 3super8 doesn't have the 8x32 tilemap, change the video emulation accordingly - jinhulu2 stops at "system is connecting". Some type of link feature? + - jinhulu2 has wrong colors and machine translated DIP definitions which + could use improving. Inputs in the "SERVICE" port seem to register two different + buttons ***************************************************************************/ @@ -39,6 +42,7 @@ #include "cpu/z80/z80.h" #include "machine/i8255.h" #include "machine/nvram.h" +#include "sound/ay8910.h" #include "sound/okim6295.h" #include "sound/ymopl.h" @@ -48,6 +52,16 @@ #include "tilemap.h" +// configurable logging +#define LOG_IGS003 (1U << 1) + +// #define VERBOSE (LOG_GENERAL | LOG_IGS003) + +#include "logmacro.h" + +#define LOGIGS003(...) LOGMASKED(LOG_IGS003, __VA_ARGS__) + + namespace { class spoker_state : public driver_device @@ -66,14 +80,14 @@ class spoker_state : public driver_device m_leds(*this, "led%u", 0U) { } - void spoker(machine_config &config); - void _3super8(machine_config &config); + void spoker(machine_config &config) ATTR_COLD; + void _3super8(machine_config &config) ATTR_COLD; - void init_spk100(); - void init_spk114it(); - void init_spk116it(); - void init_spk120in(); - void init_3super8(); + void init_spk100() ATTR_COLD; + void init_spk114it() ATTR_COLD; + void init_spk116it() ATTR_COLD; + void init_spk120in() ATTR_COLD; + void init_3super8() ATTR_COLD; int hopper_r(); @@ -94,7 +108,7 @@ class spoker_state : public driver_device required_shared_ptr m_fg_color_ram; tilemap_t *m_fg_tilemap = nullptr; - required_ioport_array<5> m_dsw; + optional_ioport_array<5> m_dsw; output_finder<7> m_leds; // common @@ -132,9 +146,9 @@ class spokeru_state : public spoker_state public: using spoker_state::spoker_state; - void spokeru(machine_config &config); + void spokeru(machine_config &config) ATTR_COLD; - void init_spokeru(); + void init_spokeru() ATTR_COLD; protected: virtual void video_start() override ATTR_COLD; @@ -155,12 +169,23 @@ class jinhulu2_state : public spokeru_state spokeru_state(mconfig, type, tag) { } - void jinhulu2(machine_config &config); + void jinhulu2(machine_config &config)ATTR_COLD; - void init_jinhulu2(); + void init_jinhulu2() ATTR_COLD; + void init_jinhulu2120gi() ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; private: + uint8_t m_protection_res = 0; + void nmi_w(uint8_t data); + uint8_t igs003c_r(); + void igs003c_w(uint8_t data); + + TILE_GET_INFO_MEMBER(get_fg_tile_info); void portmap(address_map &map) ATTR_COLD; }; @@ -215,6 +240,12 @@ TILE_GET_INFO_MEMBER(spoker_state::get_fg_tile_info) tileinfo.set(0, code, (4 * (code >> 14) + 3), 0); } +TILE_GET_INFO_MEMBER(jinhulu2_state::get_fg_tile_info) // TODO: wrong color bits +{ + int const code = m_fg_tile_ram[tile_index] | (m_fg_color_ram[tile_index] << 8); + tileinfo.set(0, code, 2 * (code >> 13), 0); +} + void spoker_state::fg_tile_w(offs_t offset, uint8_t data) { m_fg_tile_ram[offset] = data; @@ -257,6 +288,11 @@ void spokeru_state::video_start() m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(spokeru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); } +void jinhulu2_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(jinhulu2_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); +} + void jb_state::video_start() { m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(jb_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); @@ -473,6 +509,33 @@ uint8_t spoker_state::magic_r() return 0; } +uint8_t jinhulu2_state::igs003c_r() +{ + LOGIGS003("PC %06X: Protection read %02x\n", m_maincpu->pc(), m_protection_res); + + return m_protection_res; +} + +void jinhulu2_state::igs003c_w(uint8_t data) +{ + switch (data) + { + // case 0x01: break; // TODO: possibly selects inputs read by the SYSTEM port? + case 0x02: m_protection_res = ioport("IN0")->read(); break; + case 0x20: m_protection_res = 0x49; break; + case 0x21: m_protection_res = 0x47; break; + case 0x22: m_protection_res = 0x53; break; + case 0x24: m_protection_res = 0x41; break; + case 0x25: m_protection_res = 0x41; break; + case 0x26: m_protection_res = 0x7f; break; + case 0x27: m_protection_res = 0x41; break; + case 0x28: m_protection_res = 0x41; break; + case 0x2a: m_protection_res = 0x3e; break; + case 0x2b: m_protection_res = 0x41; break; + default: LOGIGS003("PC %06X: Protection write %02x\n", m_maincpu->pc(), data); m_protection_res = data; + } +} + /*************************************************************************** Memory Maps @@ -534,14 +597,14 @@ void jinhulu2_state::portmap(address_map &map) map(0x0000, 0x003f).ram(); // Z180 internal regs map(0x2000, 0x20ff).ram().w(m_palette, FUNC(palette_device::write8)).share("palette"); map(0x3000, 0x30ff).ram().w(m_palette, FUNC(palette_device::write8_ext)).share("palette_ext"); - // TODO: the following reads may be hooked to the wrong inputs - map(0x4000, 0x4000).portr("DSW1"); + map(0x4000, 0x4000).portr("DSW3"); map(0x4001, 0x4001).portr("DSW2"); - map(0x4002, 0x4002).portr("DSW3"); + map(0x4002, 0x4002).portr("DSW1"); map(0x5001, 0x5001).portr("SERVICE"); + map(0x5002, 0x5003).w("ymsnd", FUNC(ym2149_device::data_address_w)); map(0x5010, 0x5010).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - //map(0x5030, 0x5030).w(FUNC()); // TODO: almost surely same protections as seen in igspoker.cpp and igs011.cpp. Probably the IGS003 - //map(0x5031, 0x5031).r(FUNC()); // TODO: " + map(0x5030, 0x5030).w(FUNC(jinhulu2_state::igs003c_w)); + map(0x5031, 0x5031).r(FUNC(jinhulu2_state::igs003c_r)); map(0x5031, 0x5031).w(FUNC(jinhulu2_state::nmi_w)); map(0x7000, 0x77ff).ram().w(FUNC(jinhulu2_state::fg_tile_w)).share(m_fg_tile_ram); map(0x7800, 0x7fff).ram().w(FUNC(jinhulu2_state::fg_color_w)).share(m_fg_color_ram); @@ -1240,6 +1303,101 @@ static INPUT_PORTS_START( jb ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END +static INPUT_PORTS_START( jinhulu2 ) // these are verified for v120GI + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:1") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x06, 0x06, "Auto Hold" ) PORT_DIPLOCATION("SW1:2,3") + PORT_DIPSETTING( 0x06, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x04, DEF_STR( On ) ) + PORT_DIPSETTING( 0x02, "Only When Winning" ) + PORT_DIPSETTING( 0x00, "Only When Winning (duplicate)" ) + PORT_DIPNAME( 0x08, 0x08, "Credit Limit" ) PORT_DIPLOCATION("SW1:4") + PORT_DIPSETTING( 0x08, "4000" ) + PORT_DIPSETTING( 0x00, "Unlimited" ) + PORT_DIPNAME( 0x70, 0x70, "Minimum Bet For Bonus" ) PORT_DIPLOCATION("SW1:5,6,7") + PORT_DIPSETTING( 0x70, "1" ) + PORT_DIPSETTING( 0x60, "10" ) + PORT_DIPSETTING( 0x50, "20" ) + PORT_DIPSETTING( 0x40, "50" ) + PORT_DIPSETTING( 0x30, "80" ) + PORT_DIPSETTING( 0x20, "100" ) + PORT_DIPSETTING( 0x10, "120" ) + PORT_DIPSETTING( 0x00, "150" ) + PORT_DIPNAME( 0x80, 0x80, "Card Opening And Scoring Speed" ) PORT_DIPLOCATION("SW1:8") + PORT_DIPSETTING( 0x80, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + + PORT_START("DSW2") + PORT_DIPNAME( 0x03, 0x03, "Minimum Bet" ) PORT_DIPLOCATION("SW2:1,2") + PORT_DIPSETTING( 0x03, "1" ) + PORT_DIPSETTING( 0x02, "5" ) + PORT_DIPSETTING( 0x01, "10" ) + PORT_DIPSETTING( 0x00, "20" ) + PORT_DIPNAME( 0x1c, 0x1c, "Start Points" ) PORT_DIPLOCATION("SW2:3,4,5") + PORT_DIPSETTING( 0x1c, "10" ) + PORT_DIPSETTING( 0x18, "20" ) + PORT_DIPSETTING( 0x14, "40" ) + PORT_DIPSETTING( 0x10, "50" ) + PORT_DIPSETTING( 0x0c, "100" ) + PORT_DIPSETTING( 0x08, "200" ) + PORT_DIPSETTING( 0x04, "250" ) + PORT_DIPSETTING( 0x00, "500" ) + PORT_DIPNAME( 0x20, 0x20, "Light Points" ) PORT_DIPLOCATION("SW2:6") + PORT_DIPSETTING( 0x20, "10" ) + PORT_DIPSETTING( 0x00, "100" ) + PORT_DIPNAME( 0x40, 0x40, "Double-Up Limit" ) PORT_DIPLOCATION("SW2:7") + PORT_DIPSETTING( 0x40, "5000" ) + PORT_DIPSETTING( 0x00, "7500" ) + PORT_DIPNAME( 0x80, 0x80, "Four Plum Multiplier" ) PORT_DIPLOCATION("SW2:8") + PORT_DIPSETTING( 0x80, "40" ) + PORT_DIPSETTING( 0x00, "60" ) + + PORT_START("DSW3") + PORT_DIPNAME( 0x03, 0x03, "Double-Up Limit Base Number" ) PORT_DIPLOCATION("SW3:1,2") + PORT_DIPSETTING( 0x03, "100" ) + PORT_DIPSETTING( 0x02, "200" ) + PORT_DIPSETTING( 0x01, "300" ) + PORT_DIPSETTING( 0x00, "400" ) + PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Accumulated Jackpot" ) PORT_DIPLOCATION("SW3:3,4") + PORT_DIPSETTING( 0x0c, "300" ) + PORT_DIPSETTING( 0x08, "500" ) + PORT_DIPSETTING( 0x04, "800" ) + PORT_DIPSETTING( 0x00, "1000" ) + PORT_DIPNAME( 0x30, 0x30, "Payout Rate" ) PORT_DIPLOCATION("SW3:5,6") + PORT_DIPSETTING( 0x30, "20000" ) + PORT_DIPSETTING( 0x20, "30000" ) + PORT_DIPSETTING( 0x10, "40000" ) + PORT_DIPSETTING( 0x00, "50000" ) + PORT_DIPNAME( 0x40, 0x40, "Double-Up Card Opening Speed" ) PORT_DIPLOCATION("SW3:7") + PORT_DIPSETTING( 0x40, "Slow" ) + PORT_DIPSETTING( 0x00, "Fast" ) + PORT_DIPNAME( 0x80, 0x80, "Continuous Card Opening" ) PORT_DIPLOCATION("SW3:8") + PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + + PORT_START("IN0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) + + PORT_START("SERVICE") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // lights both Bet and Keyout in test mode + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // lights both Book-Keeping and Small in test mode + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 ) // lights both Start and Big + PORT_SERVICE_NO_TOGGLE( 0x10, IP_ACTIVE_LOW ) // lights both Test and Take Score in test mode + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) // lights both Hold 1 and Double Up in test mode + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) +INPUT_PORTS_END + /*************************************************************************** Graphics Layout & Graphics Decode @@ -1298,13 +1456,13 @@ static GFXDECODE_START( gfx_3super8 ) GFXDECODE_ENTRY( "gfx2", 0x00000, layout_8x32x6, 0, 16 ) GFXDECODE_END -// TODO: probably correct but to be verified once it passes the connection check +// TODO: bitplane order probably wrong static const gfx_layout layout_8x8x4 = { 8, 8, RGN_FRAC(1, 1), 4, - { STEP4(24, -8) }, + { 0, 8, 16, 24 }, { STEP8(0, 1) }, { STEP8(0, 8*4) }, 8*8*4 @@ -1334,6 +1492,13 @@ void spoker_state::machine_start() save_item(NAME(m_igs_magic)); } +void jinhulu2_state::machine_start() +{ + spoker_state::machine_start(); + + save_item(NAME(m_protection_res)); +} + void spoker_state::machine_reset() { m_nmi_ack = 0; @@ -1404,8 +1569,11 @@ void jinhulu2_state::jinhulu2(machine_config &config) spokeru(config); m_maincpu->set_addrmap(AS_IO, &jinhulu2_state::portmap); + m_maincpu->set_clock(12_MHz_XTAL); m_gfxdecode->set_info(gfx_jinhulu2); + + YM2149(config.replace(), "ymsnd", 12_MHz_XTAL / 12).add_route(ALL_OUTPUTS, "mono", 0.5); } @@ -1795,45 +1963,51 @@ ROM_END /********************************************************************************* -Jin Hu Lu 2, IGS (year unknown, board dead/rotten, battery leaked EXTENSIVELY and killed it) -This is a Poker game. -Board is a mix of through-hole and surface mounted parts (lots of logic is SMD). -Some chips have year 1999 so this is 1999 or later. - -PCB Layout ----------- - -IGS PCB No- 0202 - : -|--------------------------------------------| -|SW4 BATTERY 12MHz Z180 | -| | -|1 | -|8 T518B PRG.U40| -|W PAL | -|A PAL 6264 | -|Y 2149C PAL | -| PAL SKT | -| IGS-003C | -| | -|1 | -|0 IGS002 | -|W | -|A IGS001A | -|Y VOL 6264 6264 | -| UPC1242 M6295 27C4002.U39| -|7805 SP_U12.U12 SW1 SW2 SW3 | -|--------------------------------------------| +Jin Hu Lu 2, IGS, 1995 +Hu Lu Wang II, IGS, 1995 +These are Poker / Card games. +Board is a mix of through-hole and surface mounted parts (lots of SMD logic). +Hardware Info By Guru +--------------------- + +IGS PCB NO-0202- +IGS PCB NO-0202-2 + |------------------------------------------| + | BATT 12MHz P1 | +|-| SW4 Z180 | +|18 | +|OR T518B PRG.U40| +|22 TLP521(x20) PAL | +|WAY PAL 6264*| +| 2149C PAL | +|-| PAL PAL | + | IGS-003C | +|-| ULN2004 | +|1 |------| | +|0 |IGS002| | +|W |-------| |------| | +|A |IGS001A| | +|Y VOL 6264 |-------| 6264 | +|-|UPC1242 M6295 GFX.U39| + | 7805 SP.U12 SW1 SW2 SW3 | + |------------------------------------------| Notes: - 2149C - Might be an 8255 PPI. Definitely not a YM2149 ;-) - Z180 - Zilog Z8018008PSC Z180 MPU. Chip rated at 8MHz so clock input likely to be 6MHz [12/2] - IGS003C - In a socket but marked on PCB as 'ASIC3' (which is unusual) so could be a custom chip and not a ROM? - IGS001/2 - Custom IGS Chip (QFP80) - 6264 - 8kBx8-bit SRAM - SKT - Empty socket, missing PAL maybe? - M6295 - Oki Sound Chip. Clock input possibly 1.000MHz [12/12] - T518B - Reset Chip + 2149C - 2149C - Marked '2149C 9913'. This is a clone YM2149. Clock Input 1.000MHz [12/12] + Z180 - Zilog Z8018008PSC or HD64B180ROP Z180 MPU. Chip rated at 8MHz but crystal input on pin 2 is 12MHz + Clock Out on pin 64 is 6.000MHz + IGS003C - In a socket but marked on PCB as 'ASIC3' (which is unusual). It's an IGS custom chip. + IGS001/002 - Custom IGS Chip (QFP80) + 6264 - 8kB x8-bit SRAM. *=This RAM is battery-backed. + M6295 - OKI M6295 4-Channel ADPCM Voice Synthesis LSI. Clock Input 1.000MHz [12/12]. Pin 7 HIGH. + T518B - Mitsumi T518B Reset Chip + ULN2004 - ULN2004 7-Channel Darlington Transistor Array SW1/2/3 - 8-Position DIP Switch - SP_U12.U12 - OKI Samples. Board printed '27C020' but actual chip is Intel FLASH P28F001 + SW4 - Toggle Switch for NVRAM Clear and Reset + P1 - 4-Pin Link Connector + BATT - 3.6V Ni-Cad Battery + PRG.U40 - 27C512 EPROM (main program) + GFX.U39 - 27C4002 or 27C4096 EPROM (Graphics/Tiles) + SP.U12 - OKI Samples. Board printed '27C020' but actual chip is Intel FLASH P28F001 *********************************************************************************/ @@ -1849,6 +2023,18 @@ ROM_START( jinhulu2 ) ROM_LOAD( "sp_u12.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) ROM_END +ROM_START( jinhulu2120gi ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "prg.u40", 0x00000, 0x10000, CRC(379a2965) SHA1(fbff8a6a3b378cac116d8c630082fc866f85ac6b) ) + + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gfx.u39", 0x00000, 0x40000, CRC(d5bc6a5d) SHA1(26b83229e4a2b2502f1e9af31c71872d7d12bf93) ) // 1xxxxxxxxxxxxxxxxxx = 0xFF + ROM_IGNORE( 0x40000 ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "sp.u12", 0x00000, 0x20000, CRC(1aeb078c) SHA1(9b8a256f51e66733c4ec30b451ca0711ed02318e) ) // same as jinhulu2 +ROM_END + /*************************************************************************** Driver Init ***************************************************************************/ @@ -1892,6 +2078,17 @@ void jinhulu2_state::init_jinhulu2() } +void jinhulu2_state::init_jinhulu2120gi() +{ + init_jinhulu2(); + + uint8_t *rom = memregion("maincpu")->base(); + + // extra layer + for (int a = 0; a < 0xf000; a++) + if ((a & 0x0280) == 0x0200) rom[a] ^= 0x40; +} + void spoker_state::init_spk116it() { uint8_t *rom = memregion("maincpu")->base(); @@ -1987,22 +2184,23 @@ void spoker_state::init_3super8() Game Drivers ***************************************************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS -GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk203us, spk306us, spokeru, spk203us, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode -GAME( 1996, spk201ua, spk306us, spokeru, spk201ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode -GAME( 1996, spk200ua, spk306us, spokeru, spk200ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk200, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v200)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk130, spk306us, spoker, spk130, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v130)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk120in, spk306us, spoker, spoker, spoker_state, init_spk120in, ROT0, "IGS", "Super Poker (v120IN)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk102ua, spk306us, spokeru, spk102ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk102u, spk306us, spoker, spk102ua, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v102U)", MACHINE_SUPPORTS_SAVE ) -GAME( 1996, spk100, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // ROMs are badly dumped -GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1995, jinhulu2, 0, jinhulu2, spoker, jinhulu2_state, init_jinhulu2, ROT0, "IGS", "Jin Hu Lu 2 (v412GS)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // tries to link to something? +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS +GAME( 1996, spk306us, 0, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v306US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk205us, spk306us, spokeru, spoker, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v205US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk203us, spk306us, spokeru, spk203us, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v203US)", MACHINE_SUPPORTS_SAVE ) // LS1. 8 203US in test mode +GAME( 1996, spk201ua, spk306us, spokeru, spk201ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v201UA)", MACHINE_SUPPORTS_SAVE ) // still shows 200UA in test mode +GAME( 1996, spk200ua, spk306us, spokeru, spk200ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v200UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk200, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v200)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk130, spk306us, spoker, spk130, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v130)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk120in, spk306us, spoker, spoker, spoker_state, init_spk120in, ROT0, "IGS", "Super Poker (v120IN)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk116it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v116IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk116itmx, spk306us, spoker, spoker, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v116IT-MX)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk115it, spk306us, spoker, spoker, spoker_state, init_spk116it, ROT0, "IGS", "Super Poker (v115IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk114it, spk306us, spoker, spk114it, spoker_state, init_spk114it, ROT0, "IGS", "Super Poker (v114IT)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk102ua, spk306us, spokeru, spk102ua, spokeru_state, init_spokeru, ROT0, "IGS", "Super Poker (v102UA)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk102u, spk306us, spoker, spk102ua, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v102U)", MACHINE_SUPPORTS_SAVE ) +GAME( 1996, spk100, spk306us, spoker, spk100, spoker_state, init_spk100, ROT0, "IGS", "Super Poker (v100)", MACHINE_SUPPORTS_SAVE ) +GAME( 1993?, 3super8, 0, _3super8, 3super8, spoker_state, init_3super8, ROT0, "", "3 Super 8 (Italy)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // ROMs are badly dumped +GAME( 1997, jbell, 0, jb, jb, jb_state, init_spokeru, ROT0, "IGS", "Jingle Bell (v200US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1995, jinhulu2, 0, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2, ROT0, "IGS", "Jin Hu Lu 2 (v412GS)", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // tries to link to something? +GAME( 1995, jinhulu2120gi, jinhulu2, jinhulu2, jinhulu2, jinhulu2_state, init_jinhulu2120gi, ROT0, "IGS", "Jin Hu Lu 2 (v120GI)", MACHINE_NOT_WORKING | MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // inputs diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 7d05cd837e701..bce8d0706693b 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20832,6 +20832,7 @@ kov3hd101 3super8 jbell jinhulu2 +jinhulu2120gi spk100 spk102u spk102ua diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index c02025f9d7d6f..37a1f8be8813a 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -66,6 +66,7 @@ by the otherwise seemingly unnecessary internal ROMs. ************************************************************************************************************/ #include "emu.h" + #include "subsino_crypt.h" #include "subsino_io.h" @@ -78,6 +79,7 @@ by the otherwise seemingly unnecessary internal ROMs. #include "sound/okim6295.h" #include "sound/ymopl.h" #include "video/ramdac.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -132,23 +134,25 @@ class subsino2_state : public driver_device , m_leds(*this, "led%u", 0U) { } - void bishjan(machine_config &config); - void xiaoao(machine_config &config); - void saklove(machine_config &config); - void mtrain(machine_config &config); - void tbonusal(machine_config &config); - void humlan(machine_config &config); - void new2001(machine_config &config); - void expcard(machine_config &config); - void xplan(machine_config &config); - void xtrain(machine_config &config); - void ptrain(machine_config &config); - - void init_wtrnymph(); - void init_mtrain(); - void init_tbonusal(); + void bishjan(machine_config &config) ATTR_COLD; + void xiaoao(machine_config &config) ATTR_COLD; + void saklove(machine_config &config) ATTR_COLD; + void mtrain(machine_config &config) ATTR_COLD; + void tbonusal(machine_config &config) ATTR_COLD; + void humlan(machine_config &config) ATTR_COLD; + void queenbn(machine_config &config) ATTR_COLD; + void new2001(machine_config &config) ATTR_COLD; + void expcard(machine_config &config) ATTR_COLD; + void xplan(machine_config &config) ATTR_COLD; + void xtrain(machine_config &config) ATTR_COLD; + void ptrain(machine_config &config) ATTR_COLD; + + void init_wtrnymph() ATTR_COLD; + void init_mtrain() ATTR_COLD; + void init_tbonusal() ATTR_COLD; protected: + virtual void machine_start() override ATTR_COLD { m_leds.resolve(); } virtual void video_start() override ATTR_COLD; private: @@ -225,7 +229,7 @@ class subsino2_state : public driver_device TILE_GET_INFO_MEMBER(ss9601_get_tile_info_0); TILE_GET_INFO_MEMBER(ss9601_get_tile_info_1); - uint32_t screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void bishjan_map(address_map &map) ATTR_COLD; void mtrain_io(address_map &map) ATTR_COLD; @@ -239,8 +243,6 @@ class subsino2_state : public driver_device void xplan_io(address_map &map) ATTR_COLD; void xplan_map(address_map &map) ATTR_COLD; - virtual void machine_start() override { m_leds.resolve(); } - layer_t m_layers[2]; uint8_t m_ss9601_byte_lo; uint8_t m_ss9601_byte_lo2; @@ -745,7 +747,7 @@ void subsino2_state::video_start() save_item(NAME(m_bishjan_input)); } -uint32_t subsino2_state::screen_update_subsino2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t subsino2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int layers_ctrl = ~m_ss9601_disable; int y; @@ -2807,7 +2809,7 @@ void subsino2_state::bishjan(machine_config &config) m_screen->set_size(512, 256); m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(60); - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); m_screen->screen_vblank().set_inputline(m_maincpu, 0); // edge-triggered interrupt @@ -2868,6 +2870,13 @@ void subsino2_state::humlan(machine_config &config) // SS9804 } +void subsino2_state::queenbn(machine_config &config) +{ + humlan(config); + + m_maincpu->set_clock(48.94_MHz_XTAL / 3); +} + /*************************************************************************** Magic Train ***************************************************************************/ @@ -2902,7 +2911,7 @@ void subsino2_state::mtrain(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-32-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ss9601); @@ -2962,7 +2971,7 @@ void subsino2_state::saklove(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ss9601); @@ -3013,7 +3022,7 @@ void subsino2_state::xplan(machine_config &config) m_screen->set_visarea(0, 512-1, 0, 256-16-1); m_screen->set_refresh_hz(58.7270); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */); // game reads vblank state - m_screen->set_screen_update(FUNC(subsino2_state::screen_update_subsino2)); + m_screen->set_screen_update(FUNC(subsino2_state::screen_update)); m_screen->set_palette(m_palette); m_screen->screen_vblank().set("maincpu", FUNC(am188em_device::int0_w)); @@ -3126,7 +3135,7 @@ Hardware Info By Guru Xiao Ao Jiang Hu uses 44.1MHz Crystal Queen Bee New uses 48.94MHz Crystal DS1230.Q3 - Dallas DS1230A 1-Wire EEPROM (TO92). Hidden among other parts disguised as a transistor. - Each game has different EEPROM data used for protection. + Each game has different EEPROM data used for protection. All these have the surface scratched and the part location is marked Q3. PROG.U21 - 27C020 or 27C040 EPROM (main program) SND.U10 - 27C080 or 27C040 EPROM. Game boots to I/O test screen if this ROM is not present so this is a program ROM for @@ -4056,18 +4065,18 @@ GAME( 2000, new2001, 0, new2001, new2001, subsino2_state, empty_ini GAME( 2006, xplan, 0, xplan, xplan, subsino2_state, empty_init, ROT0, "Subsino", "X-Plan (Ver. 101)", MACHINE_NOT_WORKING ) -GAME( 2001, queenbee, 0, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino (American Alpha license)", "Queen Bee (Ver. 114)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues -GAME( 2001, queenbeeb, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Brazil, Ver. 202)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available -GAME( 2001, queenbeei, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Israel, Ver. 100)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available -GAME( 2001, queenbeesa, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (SA-101-HARD)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues, only program ROM available +GAME( 2001, queenbee, 0, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino (American Alpha license)", "Queen Bee (Ver. 114)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues +GAME( 2001, queenbeeb, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Brazil, Ver. 202)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available +GAME( 2001, queenbeei, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (Israel, Ver. 100)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available +GAME( 2001, queenbeesa, queenbee, humlan, queenbee, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee (SA-101-HARD)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues, only program ROM available -GAME( 2001, humlan, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (Truemax license)", "Humlan's Lyckohjul (Sweden, Ver. 402)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2001, humlan, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (Truemax license)", "Humlan's Lyckohjul (Sweden, Ver. 402)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2002, queenbn, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Nu Wang Feng New / Queen Bee New (China, Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, queenbn, 0, queenbn, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Nv Wang Feng New / Queen Bee New (China, Ver. 1.10)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (ECM license)", "X-Reel", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino (ECM license)", "X-Reel", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues -GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues +GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_TIMING ) // severe timing issues GAME( 2003, qbeebing, 0, humlan, qbeebing, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee Bingo", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) From 8ee55f21e7e89c3a069d5fff6b3677828d14fe84 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 8 Mar 2025 08:09:46 +0100 Subject: [PATCH 119/272] New systems marked not working ------------------------------ Waku Waku Shinkansen (J 971031 V0.002) [Darksoft] --- src/mame/mame.lst | 1 + src/mame/sega/stv.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index bce8d0706693b..716847a7d7a39 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -41227,6 +41227,7 @@ vfremix vmahjong wasafari winterht +wwshin yattrmnp znpwfv znpwfvt diff --git a/src/mame/sega/stv.cpp b/src/mame/sega/stv.cpp index 67ed10c3d5dae..6384866052128 100644 --- a/src/mame/sega/stv.cpp +++ b/src/mame/sega/stv.cpp @@ -3789,6 +3789,20 @@ ROM_START( wasafari ) ROM_LOAD( "wasafari.nv", 0x0000, 0x0080, CRC(50861c5a) SHA1(c431703d7b56185f20af1aec04cabb5f49e2d4ba) ) ROM_END +ROM_START( wwshin ) // 171-7410A PCB with 14284R sticker + STV_BIOS + + ROM_REGION32_BE( 0x3000000, "cart", ROMREGION_ERASE00 ) // SH2 code + ROM_LOAD16_WORD_SWAP( "ic22", 0x0200000, 0x200000, CRC(43f7cafc) SHA1(ac8f8efb752d6357d48090b3152e77fedea90a6f) ) + ROM_LOAD16_WORD_SWAP( "ic24", 0x0400000, 0x200000, CRC(db560e59) SHA1(edaabef7a165a4c309b4a6bac0f6de6bf8fedb34) ) + ROM_LOAD16_WORD_SWAP( "ic26", 0x0600000, 0x200000, CRC(2f411ff1) SHA1(e7bfb6570c0e5b5b64c4291bdc13fe8a62a69382) ) + ROM_LOAD16_WORD_SWAP( "ic28", 0x0800000, 0x200000, CRC(ca5e0446) SHA1(8e1c5c5c35f617129aaf40a1096f409cf7c96dce) ) + ROM_LOAD16_WORD_SWAP( "ic30", 0x0a00000, 0x200000, CRC(2653f758) SHA1(606dcdfe4e1b0fef495a5f62b2414c80405ebeeb) ) + ROM_LOAD16_WORD_SWAP( "ic32", 0x0c00000, 0x200000, CRC(8ebfd947) SHA1(db12bb43aadeb7ca48434286e7ecf2a7c8680e44) ) + ROM_LOAD16_WORD_SWAP( "ic34", 0x0e00000, 0x200000, CRC(22b7180f) SHA1(56aae3c4a9db9dd7443e2f0aa30052fc50b2ab70) ) + ROM_LOAD16_WORD_SWAP( "ic36", 0x1000000, 0x200000, CRC(5b83914c) SHA1(3d0f96345cdf22116d34eb67d51c1000a417889d) ) +ROM_END + ROM_START( dfeverg ) STV_BIOS @@ -3974,6 +3988,7 @@ GAME( 1998, supgoal, stvbios, hopper, patocar, stv_state, init_stv, GAME( 1997, techbowl, stvbios, hopper, patocar, stv_state, init_stv, ROT0, "Sega", "Technical Bowling (J 971212 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1996, vfkids, stvbios, stv, stv, stv_state, init_stv, ROT0, "Sega", "Virtua Fighter Kids (JUET 960319 V0.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, vmahjong, stvbios, stvmp, vmahjong, stv_state, init_stv, ROT0, "Micronet", "Virtual Mahjong (J 961214 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 1997, wwshin, stvbios, stv, wasafari, stv_state, init_stv, ROT0, "Sega", "Waku Waku Shinkansen (J 971031 V0.002)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // needs inputs GAME( 1998, wasafari, stvbios, stv, wasafari, stv_state, init_stv, ROT0, "Sega", "Wanpaku Safari (J 981109 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, winterht, stvbios, stv, stv, stv_state, init_winterht, ROT0, "Sega", "Winter Heat (JUET 971012 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 1997, znpwfv, stvbios, stv, stv, stv_state, init_znpwfv, ROT0, "Sega", "Zen Nippon Pro-Wres Featuring Virtua (J 971123 V1.000)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) From 844926cc2fe118232db651badb1dc0b0c62b8005 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 8 Mar 2025 08:47:17 +0100 Subject: [PATCH 120/272] skeleton/vgame.cpp: dumped GFX ROM for cjsjh --- src/mame/skeleton/vgame.cpp | 2 +- src/mame/subsino/subsino2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index 28429d68d302c..6c36bfb976b05 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -194,7 +194,7 @@ ROM_START( cjsjh ) // Nov 2 2007 16:05:26 string in ROM ROM_LOAD16_WORD_SWAP( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable ROM_REGION( 0x400000, "gfx", 0 ) - ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, NO_DUMP ) // not dumped yet + ROM_LOAD( "gfx.u2", 0x000000, 0x400000, CRC(e2964db3) SHA1(21e021c88136083445b430c618a8eb74e2147d4f ) ) ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "sp.u24", 0x000000, 0x200000, CRC(ad11c8b9) SHA1(0547a57ff2183e65fa1d51234799a3d521b018c5) ) diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index 37a1f8be8813a..e0162927e6018 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -3182,7 +3182,7 @@ ROM_START( xiaoao ) ROM_LOAD( "xiaoaojianghu-ds2430a.q3", 0x00, 0x28, CRC(518e4ba3) SHA1(704fb6f8ff9966d1b90af849b2b7c6df06d3e4a0) ) ROM_END -ROM_START( queenbn ) +ROM_START( queenbn ) // PCB has been hacked to make it work with Queen Bee New instead of Bishou Jan ROM_REGION( 0x100000, "maincpu", 0 ) ROM_LOAD( "ss9689_6433044a22f.u16", 0x000000, 0x008000, CRC(ece09075) SHA1(a8bc3aa44f30a6f919f4151c6093fb52e5da2f40) ) ROM_LOAD( "prg.u21", 0x080000, 0x040000, CRC(e04e5926) SHA1(e17d0015742f9646a6702f8e45845b0c537064e8) ) From d1781a7d1f15cbf202473867f2bf9c019423d8d2 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sat, 8 Mar 2025 23:26:00 +1100 Subject: [PATCH 121/272] docs: Fixed paper size selection (GitHub #13439). Also set paper size to widespread A4 for dist.mak and CI. --- .github/workflows/docs.yml | 2 +- dist.mak | 2 +- docs/Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0b80859804e37..2c3bf61202876 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -28,7 +28,7 @@ jobs: - name: Build HTML run: make -C docs html - name: Build PDF - run: make -C docs latexpdf + run: make -C docs PAPER=a4 latexpdf - uses: actions/upload-artifact@main with: name: mame-docs-${{ github.sha }} diff --git a/dist.mak b/dist.mak index edbb4cd67cbb8..d046914734b3e 100644 --- a/dist.mak +++ b/dist.mak @@ -128,6 +128,6 @@ $(STAGEDIR)/docs/MAME.pdf: docs/build/latex/MAME.pdf | $(GEN_FOLDERS) $(call COPY,$<,$@) docs/build/latex/MAME.pdf: - $(MAKE) -C docs latexpdf + $(MAKE) -C docs PAPER=a4 latexpdf .PHONY: all clean diff --git a/docs/Makefile b/docs/Makefile index b5c45c82ca795..48b674871a7b3 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -8,8 +8,8 @@ PAPER = BUILDDIR = build # Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter +PAPEROPT_a4 = -D latex_elements.papersize=a4paper +PAPEROPT_letter = -D latex_elements.papersize=letterpaper ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source From be13ded5f6bd38e24d426281fc32c651bb772987 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 9 Mar 2025 00:49:21 +1100 Subject: [PATCH 122/272] Fixed some things causing save states to be unportable: * emu/save.cpp: Don't save block stride as it depends on alignment rules. * windows/winmain.cpp: Don't send display orientation to machine outputs. --- src/emu/save.cpp | 2 +- src/osd/windows/winmain.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/emu/save.cpp b/src/emu/save.cpp index 8c3329e7b38b7..6b3d4bbdeb606 100644 --- a/src/emu/save.cpp +++ b/src/emu/save.cpp @@ -505,7 +505,7 @@ u32 save_manager::signature() const temp[0] = little_endianize_int32(entry->m_typesize); temp[1] = little_endianize_int32(entry->m_typecount); temp[2] = little_endianize_int32(entry->m_blockcount); - temp[3] = little_endianize_int32(entry->m_stride); + temp[3] = 0; crc.append(&temp[0], sizeof(temp)); } return crc.finish(); diff --git a/src/osd/windows/winmain.cpp b/src/osd/windows/winmain.cpp index 008c81fe54ba0..2f7df659f4494 100644 --- a/src/osd/windows/winmain.cpp +++ b/src/osd/windows/winmain.cpp @@ -352,12 +352,6 @@ void windows_osd_interface::init(running_machine &machine) // initialize the subsystems osd_common_t::init_subsystems(); - // notify listeners of screen configuration - for (const auto &info : osd_common_t::window_list()) - { - machine.output().set_value(string_format("Orientation(%s)", info->monitor()->devicename()), dynamic_cast(*info).m_targetorient); - } - // hook up the debugger log if (options.oslog()) machine.add_logerror_callback(&windows_osd_interface::output_oslog); From 8e9f5d9e1da25986a834bddbd9314eb0dc8577cf Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 8 Mar 2025 17:13:50 +0100 Subject: [PATCH 123/272] nec/pc88va_v.cpp: hook GDEN0 and VW nec/pc88va_sgp.cpp: hook start_dot for destination transfers --- src/mame/nec/pc88va.cpp | 2 +- src/mame/nec/pc88va.h | 2 ++ src/mame/nec/pc88va_sgp.cpp | 25 +++++++++++----------- src/mame/nec/pc88va_v.cpp | 41 +++++++++++++++++++++++++++++-------- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index 0c702a53a99ba..31e7f363b79b2 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -93,7 +93,7 @@ brk 8Ch AH=02h read calendar clock -> CH = hour, CL = minutes, DH = seconds, DL #define LOG_FDC2 (1U << 3) // $1b4-$1b6 accesses (verbose) #define LOG_GFXCTRL (1U << 4) // $5xx accesses -#define VERBOSE (LOG_GENERAL | LOG_FDC | LOG_GFXCTRL) +#define VERBOSE (LOG_GENERAL | LOG_FDC) //#define LOG_OUTPUT_STREAM std::cout #include "logmacro.h" diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index ef405b7973ab0..3d5bab0173370 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -197,8 +197,10 @@ class pc88va_state : public driver_device uint16_t m_video_pri_reg[2]; u16 m_screen_ctrl_reg; + bool m_gden0; bool m_dm; bool m_ymmd; + u8 m_vw; u16 m_gfx_ctrl_reg; u16 m_color_mode; diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index d8f7670e1036c..24e155361b2a6 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -404,10 +404,10 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) if (draw_mode & 0xfc00) { - popmessage("SGP: draw_mode = %04x (HD %d VD %d SF %d)", draw_mode, BIT(draw_mode, 10), BIT(draw_mode, 11), BIT(draw_mode, 12)); + popmessage("SGP: Warning draw_mode = %04x (HD %d VD %d SF %d)", draw_mode, BIT(draw_mode, 10), BIT(draw_mode, 11), BIT(draw_mode, 12)); } - // TODO: boomer title screen + // boomer title screen just sets the same h/v size, irrelevant if (is_patblt == true) { LOG("PATBLT\n"); @@ -416,25 +416,22 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) if (m_src.hsize != m_dst.hsize || m_src.vsize != m_dst.vsize) { - LOG("BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize); + LOG("SGP: Warning BITBLT non-even sizes (%d x %d) x (%d x %d)\n", m_src.hsize, m_src.vsize, m_dst.hsize, m_dst.vsize); return; } if (m_src.pixel_mode == 0 || m_src.pixel_mode == 3 || m_src.pixel_mode != m_dst.pixel_mode) { - LOG("BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode); + LOG("SGP: Warning BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode); return; } - //static const u8 shift_table = { 3, 1, 0, -1 }; - //const u8 hsize_shift = m_src.pixel_mode == 1 ? 1 : 0; - for (int yi = 0; yi < m_src.vsize; yi ++) { u32 src_address = m_src.address + (yi * m_src.fb_pitch); u32 dst_address = m_dst.address + (yi * m_dst.fb_pitch); - // TODO: should fetch on demand, depending on what's the color mode/the start dot etc. + // TODO: should fetch on demand, depending on color mode/start dot etc. for (int xi = 0; xi < m_src.hsize; xi ++) { switch(m_src.pixel_mode) @@ -443,14 +440,16 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) case 1: { const u8 nibble = xi & 1; + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) >> 1); + u8 src = (m_data->read_byte(src_address + (xi >> 1)) >> (nibble * 4)) & 0xf; - u8 dst = m_data->read_byte(dst_address + (xi >> 1)); + u8 dst = m_data->read_byte(dst_offset); u8 result = dst & (nibble ? 0x0f : 0xf0); if ((this->*tpmod_table[tp_mod])(src, dst)) { result |= (this->*rop_table[logical_op])(src, dst) << (nibble * 4); - m_data->write_byte(dst_address + (xi >> 1), result); + m_data->write_byte(dst_offset, result); } break; @@ -459,14 +458,16 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) // 8bpp (tetris) case 2: { + const u32 dst_offset = dst_address + (xi + m_dst.start_dot); + u8 src = m_data->read_byte(src_address + xi) & 0xff; - u8 dst = m_data->read_byte(dst_address + xi) & 0xff; + u8 dst = m_data->read_byte(dst_offset) & 0xff; u8 result = dst; if ((this->*tpmod_table[tp_mod])(src, dst)) { result = (this->*rop_table[logical_op])(src, dst); - m_data->write_byte(dst_address + xi, result); + m_data->write_byte(dst_offset, result); } break; diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 225e98feabed6..53dbd000393da 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -57,6 +57,7 @@ void pc88va_state::video_start() void pc88va_state::video_reset() { + m_gden0 = false; m_text_transpen = 0; m_screen_ctrl_reg = 0; m_color_mode = 0; @@ -691,6 +692,10 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cliprect, u8 which) { + // Master graphic enable + if (!m_gden0) + return; + // disable graphic B if screen 0 only setting is enabled if (which && !m_ymmd) return; @@ -704,9 +709,13 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli const u8 gfx_ctrl = (m_gfx_ctrl_reg >> (which * 8)) & 0x13; - // TODO: xak2 wants independent doubled Y axis on setup menu & Micro Cabin logo - // i.e. 200 lines draw on a 400 lines canvas + // H320 setting const u32 pixel_size = 0x10000 >> BIT(gfx_ctrl, 4); + // xak2/fray/boomer all sets independent doubled Y axis + // i.e. 200 lines draw on a 400 lines canvas + const int v_sizes[4] = { 400, 408, 200, 204 }; + const u32 line_size = (0x10000 * v_sizes[m_vw]) / m_screen->visible_area().height(); + //popmessage("%08x %d %d %d", line_size, m_screen->visible_area().height(), m_vw, BIT(m_screen_ctrl_reg, 7)); const u8 layer_pal_bank = get_layer_pal_bank(2 + which); @@ -716,6 +725,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli , layer_pal_bank ); +// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); m_graphic_bitmap[which].fill(0, cliprect); const int layer_inc = (!is_5bpp) + 1; @@ -775,6 +785,9 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli switch(gfx_ctrl & 3) { case 1: draw_packed_gfx_4bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); break; + default: + popmessage("pc88va_v.cpp: unhandled %d GFX mode DM = 0", which); + break; } } else @@ -792,15 +805,18 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); break; case 3: draw_direct_gfx_rgb565(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); break; + default: + popmessage("pc88va_v.cpp: unhandled %d GFX mode DM = 1", which); + break; } } } - // TODO: we eventually need primask_copyrozbitmap_trans here, or a custom copy, depending on what the "transpen" registers really do. + // TODO: primask_copyrozbitmap_trans copyrozbitmap_trans( bitmap, cliprect, m_graphic_bitmap[which], 0, 0, - pixel_size, 0, 0, pixel_size, + pixel_size, 0, 0, line_size, false, 0 ); } @@ -1222,9 +1238,11 @@ void pc88va_state::recompute_parameters() visarea.set(0, h_vis_area - 1, 0, v_vis_area - 1); - // TODO: vertical magnify, bit 7 - // TODO: actual clock source must be external, assume known PC-88 XTALs, a bit off compared to PC-88 with the values above - const int clock_speed = BIT(m_crtc_regs[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); + // TODO: vertical global magnify at bit 7 + // TODO: actual clock source must be external, assume known PC-88 XTALs + // TODO: a bit off compared to PC-88 equivalent with the configured values + // TODO: famista pukes a 31.2 Hz vertical in 24kHz mode + const int clock_speed = !!BIT(m_crtc_regs[0x00], 6) ? (31'948'800 / 4) : (28'636'363 / 2); refresh = HZ_TO_ATTOSECONDS(clock_speed) * h_vis_area * v_vis_area; @@ -1487,10 +1505,15 @@ void pc88va_state::screen_ctrl_w(offs_t offset, u16 data, u16 mem_mask) COMBINE_DATA(&m_screen_ctrl_reg); - m_ymmd = bool(BIT(m_screen_ctrl_reg, 11)); - m_dm = bool(BIT(m_screen_ctrl_reg, 10)); // YMMD DM // mightmag 0xb060 (0) screen 0 (0) multiplane + m_gden0 = !!(BIT(m_screen_ctrl_reg, 15)); + m_ymmd = !!(BIT(m_screen_ctrl_reg, 11)); + m_dm = !!(BIT(m_screen_ctrl_reg, 10)); + + m_vw = m_screen_ctrl_reg & 3; + if (m_vw & 1) + popmessage("pc88va_v.cpp: VW = %d (408/204 lines mode)", m_vw); } u16 pc88va_state::screen_ctrl_r() From 913612c42bc287fb6ee51acc449c6cf30cd0fb0c Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 8 Mar 2025 18:27:52 +0100 Subject: [PATCH 124/272] nec/pc88va_v.cpp: draw sprites to odd lines when MG is 1 --- src/mame/nec/pc88va_v.cpp | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 53dbd000393da..52c2b7ee878d8 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -246,6 +246,7 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) } } + // TODO: std::function if(md) // 1bpp mode { int fg_col = (tvram[(offs + i + 6) / 2] & 0xf0) >> 4; @@ -268,19 +269,22 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) for(int x_s = 0; x_s < 16; x_s++) { int res_x = xp + x_i + x_s; - // TODO: MG actually doubles Y size int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; u8 pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8) >> (15 - x_s)) & 1; pen = pen & 1 ? fg_col : (bc) ? 8 : 0; if(pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -304,16 +308,20 @@ void pc88va_state::draw_sprites(bitmap_rgb32 &bitmap, const rectangle &cliprect) int res_x = xp + x_i + x_s; int res_y = (yp + y_i) << m_tsp.spr_mg; - if (!cliprect.contains(res_x, res_y)) - continue; - const u32 data_offset = ((spda + spr_count) & 0xffff) / 2; int pen = (bitswap<16>(tvram[data_offset],7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8)) >> (12 - (x_s * 4)) & 0xf; //if (pen != 0 && pen != m_text_transpen) if (pen != 0) - bitmap.pix(res_y, res_x) = m_palette->pen(pen + layer_pal_bank); + { + for (int mg = 0; mg < m_tsp.spr_mg + 1; mg ++) + { + if (!cliprect.contains(res_x, res_y + mg)) + continue; + bitmap.pix(res_y + mg, res_x) = m_palette->pen(pen + layer_pal_bank); + } + } } spr_count += 2; @@ -725,7 +733,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli , layer_pal_bank ); -// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); +// m_graphic_bitmap[which].fill(m_palette->pen(layer_pal_bank), cliprect); m_graphic_bitmap[which].fill(0, cliprect); const int layer_inc = (!is_5bpp) + 1; From a3576dcdcc2adba56f4bd2b5c58726e693b72a00 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 8 Mar 2025 18:29:22 +0100 Subject: [PATCH 125/272] hash/pc88va.xml: add Inufuto entries New working software list items ------------------------------- pc88va: AntiAir, Bootskell, Cacorm, Cavit, Cracky, Guntus, Lift, Neuras, Osotos, Yewdow New software list items marked not working ------------------------------------------ pc88va: Aerial, Ascend, Battlot, Hopman, Impetus, Ruptus --- hash/pc88va.xml | 271 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 252 insertions(+), 19 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 38e49308aa658..817dcb0ef7e48 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -1320,24 +1320,6 @@ Needs [OFX/OFY] on gameplay - - Saishuu Heiki UPO (Pre-Release) - 1992 - <doujin> - - - - - - - - - - Pac-Man 19?? @@ -1370,8 +1352,259 @@ Gameplay don't mask bullets on right side, [cliprect] + + Saishuu Heiki UPO (Pre-Release) + 1992 + <doujin> + + + + + + + + + + + + + + Aerial + 2023 + Inufuto + + + + + + + + + + AntiAir + 2024 + Inufuto + + + + + + + + + + Ascend + 2023 + Inufuto + + + + + + + + + + Battlot + 2023 + Inufuto + + + + + + + + + + Bootskell + 2023 + Inufuto + + + + + + + + + + Cacorm + 2023 + Inufuto + + + + + + + + + + Cavit + 2023 + Inufuto + + + + + + + + + + Cracky + 2023 + Inufuto + + + + + + + + + + Guntus + 2023 + Inufuto + + + + + + + + + + Hopman + 2023 + Inufuto + + + + + + + + + + Impetus + 2023 + Inufuto + + + + + + + + + + Lift + 2023 + Inufuto + + + + + + + + + + Neuras + 2023 + Inufuto + + + + + + + + + + Osotos + 2024 + Inufuto + + + + + + + + + + Ruptus + 2023 + Inufuto + + + + + + + + + + Yewdow + 2023 + Inufuto + + + + + + + - + From 41a71b0321dd0825c4d067581db3584b4a992e7b Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 8 Mar 2025 19:14:10 +0100 Subject: [PATCH 126/272] New clones marked not working ----------------------------- Meng Hong Lou (earlier) [dyq, little0, Guru] - skeleton/vgame.cpp: dumped GFX ROM for cjdn [Guru] --- src/mame/igs/spoker.cpp | 22 +++--- src/mame/mame.lst | 1 + src/mame/misc/menghong.cpp | 129 ++++++++++++++++++++++-------------- src/mame/skeleton/vgame.cpp | 4 +- 4 files changed, 96 insertions(+), 60 deletions(-) diff --git a/src/mame/igs/spoker.cpp b/src/mame/igs/spoker.cpp index 156f72bda9cec..e2cda59e66217 100644 --- a/src/mame/igs/spoker.cpp +++ b/src/mame/igs/spoker.cpp @@ -1963,24 +1963,24 @@ ROM_END /********************************************************************************* -Jin Hu Lu 2, IGS, 1995 -Hu Lu Wang II, IGS, 1995 +金葫蘆 II - Jin Hu Lu II, IGS, 1995 (v412GS, Link Version) +金葫蘆 II - Jin Hu Lu II, IGS, 1995 (v120GI, Stand-Alone Version) These are Poker / Card games. Board is a mix of through-hole and surface mounted parts (lots of SMD logic). Hardware Info By Guru --------------------- -IGS PCB NO-0202- -IGS PCB NO-0202-2 +IGS PCB NO-0202- (for v412GS) +IGS PCB NO-0202-2 (for v120GI) |------------------------------------------| | BATT 12MHz P1 | |-| SW4 Z180 | -|18 | -|OR T518B PRG.U40| -|22 TLP521(x20) PAL | -|WAY PAL 6264*| -| 2149C PAL | -|-| PAL PAL | +|2 | +|2 T518B PRG.U40| +|W TLP521(x20) PAL | +|A PAL 6264*| +|Y 2149C PAL | +|-| PAL PALx | | IGS-003C | |-| ULN2004 | |1 |------| | @@ -2003,6 +2003,8 @@ IGS PCB NO-0202-2 ULN2004 - ULN2004 7-Channel Darlington Transistor Array SW1/2/3 - 8-Position DIP Switch SW4 - Toggle Switch for NVRAM Clear and Reset + PAL - These PALs match on both boards. + PALx - This PAL is different on both boards (i.e. game-specific) P1 - 4-Pin Link Connector BATT - 3.6V Ni-Cad Battery PRG.U40 - 27C512 EPROM (main program) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 716847a7d7a39..d5783fdc68d4a 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -31337,6 +31337,7 @@ yoyospel @source:misc/menghong.cpp crzyddz2 menghong +menghonga @source:misc/meyc8080.cpp casbjack diff --git a/src/mame/misc/menghong.cpp b/src/mame/misc/menghong.cpp index 7e47feb795727..8115acc929478 100644 --- a/src/mame/misc/menghong.cpp +++ b/src/mame/misc/menghong.cpp @@ -17,63 +17,79 @@ ============================================================================= -Crazy Dou Di Zhu II -Sealy, 2006 - -PCB Layout ----------- +Meng Hong Lou (Dream of the Red Chamber), Sealy, 2008 +Crazy Dou Di Zhu II, Sealy, 2006 +Hardware Info By Guru +--------------------- 070405-fd-VER1.2 -|--------------------------------------| -| PAL 27C322.U36 | -| BATTERY| -| M59PW1282 62256 14.31818MHz | -| W9864G66 | -| | -|J VRENDERZERO+ | -|A W9864G66 | -|M W9864G66 | -|M 8MHz | -|A HY04 0260F8A | -| 28.63636MHz | -| | -| VR1 TLDA1311 | -| TDA1519| -| 18WAY VOL 10WAY | -|--------------------------------------| + |-----------------------------------| +|--| 1086M33 EPROM.U49 SW1 | +| GAL LVC16245 U36 BATTERY| +| 62256 14.31818MHz | +| M59PW1282 T518B W9864G66 | +| LVC16245 |--------| | +|J 817(x26) |VRENDER | | +|A W9864G66 |ZERO+ | | +|M LVC16245 |MAGICEYES | +|M 8MHz |--------| | +|A |------| W9864G66 | +| HY04 |0260F8A 28.63636MHz | +| | | | +| |------| TDA1311A | +| VR1 VOL TDA1519| +|--| 18WAY |-------| 10WAY |--| + |---------------| |--------| Notes: - 0260F8A - unknown TQFP44 - HY04 - rebadged DIP8 PIC - type unknown * - W9864G66 - Winbond 64MBit DRAM - M59PW1282 - ST Microelectronics 128MBit SOP44 FlashROM. - This is two 64MB SOP44 ROMs in one package + VRENDERZERO+ - MagicEyes VRENDERZERO+ EISC System-On-A-Chip. + CPU Clock Input Pins 6 & 7 - 14.31818MHz + Video Clock Input Pin 103 - 28.63636MHz + Another identical PCB has this chip marked "ADC Amazon-LF EISC" so these are 100% compatible. + 0260F8A - unknown TQFP44 (Microcontroller?). Clock Input 8.000MHz + HY04 - rebadged DIP8 PIC - type unknown (*). PCB marked "SAM1" + Some chips are marked "SL01". Chip data is unique to each game but different + versions of the same game work ok with swapped HY04 or swapped main program EPROM. + Clock and data pis are connected to unknown IC 0260F8A. + 62256 - 32kB x8-bit SRAM (battery-backed) + W9864G66 - Winbond 1MB x4-Banks x16-bit (64MBit) SDRAM + TDA1311A - Philips TDA1311A Stereo DAC. VRENDERZERO+ outputs digital audio directly into this + chip on pin 3. + TDA1519 - Philips TDA1519C 22W BTL Stereo Power Amplifier + VR1 - Potentiometer to adjust brightness + VOL - Potentiometer to adjust audio volume + 817 - Sharp PC817 Optocoupler + T518B - Mitsumi T518B System Reset IC + 1086M33 - Toshiba LM1086M33 3.3V Linear Regulator + GAL - Atmel ATF16V8B-15PC GAL + BATTERY - 3.6V Ni-Cad Battery + SW1 = Push Button. Does nothing when pressed. Connected to unknown IC 0260F8A. + LVC16245 - Texas Instruments LVC16245 16-bit Bus Transceiver + EPROM.U49 - 27C160 or 27C322 EPROM (main program) + U36 - Alternative position for a different type of EPROM (not populated) + M59PW1282 - ST Microelectronics 128Mbit SOP44 Flash ROM (= 2x 64Mbit SOP44 ROMs in one chip) * The pins are: - 1 ground - 2 nothing - 3 data (only active for 1/4 second when the playing cards or "PASS" shows in game next to each player) - 4 nothing - 5 nothing - 6 clock - 7 +5V (could be VPP for programming voltage) - 8 +5V - -===== - -Meng Hong Lou (Dream of the Red Chamber) -Sealy, 2004? - -Red PCB, very similar to crzyddz2 + 1 Ground + 2 - + 3 Data (only active for 1/4 second when the playing cards or "PASS" shows in game next to each player) + This pin is connected to 0260F8A. + 4 - + 5 - + 6 Clock. This pin is connected to 0260F8A. + 7 High + 8 VCC ****************************************************************************/ #include "emu.h" + #include "cpu/se3208/se3208.h" #include "machine/ds1302.h" #include "machine/eepromser.h" #include "machine/nvram.h" #include "machine/timer.h" #include "machine/vrender0.h" + #include "emupal.h" #include @@ -99,8 +115,8 @@ class menghong_state : public driver_device { } - void crzyddz2(machine_config &config); - void menghong(machine_config &config); + void crzyddz2(machine_config &config) ATTR_COLD; + void menghong(machine_config &config) ATTR_COLD; protected: virtual void machine_start() override ATTR_COLD; @@ -492,7 +508,7 @@ ROM_START( menghong ) ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(e24257c4) SHA1(569d79a61ff6d35100ba5727069363146df9e0b7) ) ROM_REGION( 0x0400000, "maincpu", 0 ) - ROM_LOAD( "060511_08-01-18.u49", 0x0000000, 0x0200000, CRC(b0c12107) SHA1(b1753757bbdb7d996df563ac6abdc6b46676704b) ) // 27C160 + ROM_LOAD( "060511_08-01-18.u49", 0x0000000, 0x0200000, CRC(b0c12107) SHA1(b1753757bbdb7d996df563ac6abdc6b46676704b) ) // 27C160, also found with mhl_29-4-2008 label and same content ROM_RELOAD( 0x0200000, 0x0200000 ) ROM_REGION( 0x4280, "pic", 0 ) // hy04 @@ -502,6 +518,22 @@ ROM_START( menghong ) ROM_LOAD("hy04_fake_data.bin", 0, 0x100, BAD_DUMP CRC(73cc964b) SHA1(39d223c550e38c97135322e43ccabb70f04964b9) ) ROM_END + +ROM_START( menghonga ) + ROM_REGION32_LE( 0x1000000, "flash", 0 ) // Flash + ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(e24257c4) SHA1(569d79a61ff6d35100ba5727069363146df9e0b7) ) + + ROM_REGION( 0x0400000, "maincpu", 0 ) + ROM_LOAD( "mhl_4-1-2008.u46", 0x0000000, 0x0200000, CRC(68246e07) SHA1(6732b017d274bc47a6b9bae144c54937e24152ee) ) + ROM_RELOAD( 0x0200000, 0x0200000 ) + + ROM_REGION( 0x4280, "pic", 0 ) // hy04 + ROM_LOAD("menghong_hy04", 0x000000, 0x4280, NO_DUMP ) + + ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF ) + ROM_LOAD("hy04_fake_data.bin", 0, 0x100, BAD_DUMP CRC(73cc964b) SHA1(39d223c550e38c97135322e43ccabb70f04964b9) ) +ROM_END + ROM_START( crzyddz2 ) ROM_REGION32_LE( 0x1000000, "flash", 0 ) // Flash ROM_LOAD( "rom.u48", 0x000000, 0x1000000, CRC(0f3a1987) SHA1(6cad943846c79db31226676c7391f32216cfff79) ) @@ -515,8 +547,9 @@ ROM_START( crzyddz2 ) ROM_REGION( 0x0100, "pic_data", ROMREGION_ERASEFF ) ROM_END -} // Anonymous namespace +} // anonymous namespace -GAME( 2004?,menghong, 0, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) -GAME( 2006, crzyddz2, 0, crzyddz2, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Crazy Dou Di Zhu II", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2004?, menghong, 0, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2004?, menghonga, menghong, menghong, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Meng Hong Lou (earlier)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +GAME( 2006, crzyddz2, 0, crzyddz2, crzyddz2, menghong_state, empty_init, ROT0, "Sealy", "Crazy Dou Di Zhu II", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index 6c36bfb976b05..e6d25a8e91d09 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -183,7 +183,7 @@ ROM_START( cjdn ) // Oct 1 2008 15:58:54 string in ROM ROM_LOAD16_WORD_SWAP( "v305cn.u8", 0x000000, 0x200000, CRC(bffb20c0) SHA1(bf2293bfc4711d0b930c491f579418d5e7c0800f) ) ROM_REGION( 0x400000, "gfx", 0 ) - ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, NO_DUMP ) // not dumped yet + ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, CRC(4018790e) SHA1(2b292d4cbfa5d7c3129a7e0c8012bde519e85ef1) ) // FIXED BITS (xxxxxxxx0xxxxxxx) ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "sp_101g.u24", 0x000000, 0x200000, CRC(f361a725) SHA1(9404f955126f16c7f4a2c52e799791f6f2703b5f) ) @@ -194,7 +194,7 @@ ROM_START( cjsjh ) // Nov 2 2007 16:05:26 string in ROM ROM_LOAD16_WORD_SWAP( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable ROM_REGION( 0x400000, "gfx", 0 ) - ROM_LOAD( "gfx.u2", 0x000000, 0x400000, CRC(e2964db3) SHA1(21e021c88136083445b430c618a8eb74e2147d4f ) ) + ROM_LOAD( "gfx.u2", 0x000000, 0x400000, CRC(e2964db3) SHA1(21e021c88136083445b430c618a8eb74e2147d4f ) ) // FIXED BITS (xxxxxxxx0xxxxxxx) ROM_REGION( 0x200000, "oki", 0 ) ROM_LOAD( "sp.u24", 0x000000, 0x200000, CRC(ad11c8b9) SHA1(0547a57ff2183e65fa1d51234799a3d521b018c5) ) From 95ad430a5146e3f2bd0aa133367c7db3333e3754 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 8 Mar 2025 19:56:31 +0100 Subject: [PATCH 127/272] pci/aha2940au.cpp: add enough glue logic to at least try some SCSI --- src/devices/bus/pci/aha2940au.cpp | 79 ++++++++++++++++++++++++++----- src/devices/bus/pci/aha2940au.h | 11 ++++- 2 files changed, 75 insertions(+), 15 deletions(-) diff --git a/src/devices/bus/pci/aha2940au.cpp b/src/devices/bus/pci/aha2940au.cpp index 5fd4f4668c811..abd7c413a4f8e 100644 --- a/src/devices/bus/pci/aha2940au.cpp +++ b/src/devices/bus/pci/aha2940au.cpp @@ -6,9 +6,12 @@ Adaptec AHA-2940AU PCI Based off AIC-7860/7861 +References: +- https://github.com/torvalds/linux/tree/master/drivers/scsi/aic7xxx + TODO: -- Plays with southbridge SMI & APMCAPMS regs soon after entering in its own BIOS (PC=ccfe1), - going off the track blanking the almost entirety of I/O space range. +- Stub, enough to make it surpass initial POST and nothing else; +- Lack specific documentation for AIC-7860, we base on AIC-7890 for now; **************************************************************************************************/ @@ -30,10 +33,12 @@ DEFINE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device, "aha2940au", "Adaptec A aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pci_card_device(mconfig, type, tag, owner, clock) + , m_eeprom(*this, "eeprom") , m_scsi_rom(*this, "scsi_rom") { - // TODO: unknown revision & class code - set_ids(0x90046178, 0x00, 0x010700, 0x90046178); + // TODO: unknown revision + // class code should be 0x01'0000 as per AIC-7890 manual + set_ids(0x90046178, 0x00, 0x010000, 0x90046178); } aha2940au_scsi_device::aha2940au_scsi_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) @@ -49,7 +54,7 @@ ROM_START( aha2940au ) ROMX_LOAD( "589247-00.u3", 0x0000, 0x8000, CRC(de00492b) SHA1(a6015bcd51e51015a5710d7ac1929e28bf033db4), ROM_BIOS(0) ) // default eeprom contents, to be verified - ROM_REGION( 0x80, "eeprom", ROMREGION_ERASEFF ) + ROM_REGION16_LE( 0x80, "eeprom", ROMREGION_ERASEFF ) ROM_LOAD( "93c46.u1", 0x00, 0x80, CRC(c82242ce) SHA1(93311b8c02e87492a40c1df6ea4eb60628bb2825) ) ROM_END @@ -61,36 +66,84 @@ const tiny_rom_entry *aha2940au_scsi_device::device_rom_region() const void aha2940au_scsi_device::device_add_mconfig(machine_config &config) { // AIC-7860Q - // 93C46 EEPROM + + EEPROM_93C46_16BIT(config, m_eeprom); } void aha2940au_scsi_device::device_start() { pci_card_device::device_start(); - // TODO: unknown BAR setup -// add_map( size, M_MEM, FUNC(aha2940au_scsi_device::map)); + // TODO: BAR setup from AIC-7890, verify + add_map( 256, M_IO, FUNC(aha2940au_scsi_device::io_map)); + // TODO: enables M_64A on demand + add_map( 4096, M_MEM, FUNC(aha2940au_scsi_device::mem_map)); add_rom((u8 *)m_scsi_rom->base(), 0x8000); expansion_rom_base = 0xc8000; - // TODO: unknown irq pin -// intr_pin = 1; + // TODO: BIST capable + + // INTA# + intr_pin = 1; + // TODO: definitely uses PCI regs 0x3e/0x3f + // max_lat = 0x19, min_gnt = 0x27 for AIC-7890 + // others may be different } void aha2940au_scsi_device::device_reset() { pci_card_device::device_reset(); - // TODO: unknown startup state command = 0x0000; - status = 0x0200; + // Can be bus master (bit 2), can use Memory Write and Invalidate (bit 4) + command_mask = 0x17; + // cap list (bit 4), fast back-to-back (bit 7), medium DEVSEL# + status = 0x0290; remap_cb(); } +u8 aha2940au_scsi_device::capptr_r() +{ + return 0xdc; +} + void aha2940au_scsi_device::config_map(address_map &map) { pci_card_device::config_map(map); - // ... +// map(0x40, 0x40) DEVCONFIG +// map(0x41, 0x41) DEVSTATUS0 +// map(0x42, 0x42) DEVSTATUS1 +// map(0x43, 0x43) PCIERRGEN + + // PME 1.0 + map(0xdc, 0xdf).lr32(NAME([] { return 0x0001'0001; })); +// map(0xe0, 0xe1) PM_CSR +// map(0xe2, 0xe2) PMCSR_BSE +// map(0xe3, 0xe3) PM_DATA +// map(0xff, 0xff) IDENREG } + +void aha2940au_scsi_device::io_map(address_map &map) +{ + // SEECTL + map(0x1e, 0x1e).lrw8( + NAME([this] (offs_t offset) { + return 0x10 | m_eeprom->do_read(); + }), + NAME([this] (offs_t offset, u8 data) { + LOG("SEECTL %02x\n", data); + m_eeprom->di_write(BIT(data, 1)); + m_eeprom->clk_write(BIT(data, 2)); + m_eeprom->cs_write(BIT(data, 3)); + }) + ); + // HCNTRL + map(0x87, 0x87).lr8(NAME([] () { return 0xff; })); +} + +void aha2940au_scsi_device::mem_map(address_map &map) +{ +} + diff --git a/src/devices/bus/pci/aha2940au.h b/src/devices/bus/pci/aha2940au.h index 5fb0208365c8d..c7964e672b776 100644 --- a/src/devices/bus/pci/aha2940au.h +++ b/src/devices/bus/pci/aha2940au.h @@ -8,6 +8,8 @@ #include "pci_slot.h" +#include "machine/eepromser.h" + class aha2940au_scsi_device : public pci_card_device { public: @@ -29,10 +31,15 @@ class aha2940au_scsi_device : public pci_card_device virtual void config_map(address_map &map) override ATTR_COLD; - required_memory_region m_scsi_rom; + virtual u8 capptr_r() override; + + required_device m_eeprom; private: - // ... + void io_map(address_map &map); + void mem_map(address_map &map); + + required_memory_region m_scsi_rom; }; DECLARE_DEVICE_TYPE(AHA2940AU, aha2940au_scsi_device) From 2285d5f05ac34bc14c791dd961a6836ef32b8109 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 8 Mar 2025 20:31:32 +0100 Subject: [PATCH 128/272] supbtime/chinatwn: lower oki clock a bit --- src/mame/capcom/srumbler.cpp | 6 ++--- src/mame/dataeast/btime.cpp | 2 +- src/mame/dataeast/supbtime.cpp | 40 ++++++++++++++++++++-------------- src/mame/saitek/stratos.cpp | 2 +- src/mame/taito/opwolf.cpp | 4 ++-- src/mame/taito/taito_z.cpp | 3 +-- src/mame/taito/taito_z.h | 2 +- 7 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/mame/capcom/srumbler.cpp b/src/mame/capcom/srumbler.cpp index 584ab6cc12198..f5c270777814f 100644 --- a/src/mame/capcom/srumbler.cpp +++ b/src/mame/capcom/srumbler.cpp @@ -39,14 +39,14 @@ class srumbler_state : public driver_device public: srumbler_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_maincpu(*this,"maincpu"), - m_spriteram(*this,"spriteram"), + m_maincpu(*this, "maincpu"), + m_spriteram(*this, "spriteram"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_backgroundram(*this, "backgroundram"), m_foregroundram(*this, "foregroundram"), m_proms(*this, "proms"), - m_rombank(*this, "%01x000", 5U) + m_rombank(*this, "bank%01x000", 5U) { } void srumbler(machine_config &config); diff --git a/src/mame/dataeast/btime.cpp b/src/mame/dataeast/btime.cpp index ea3cc298f1f07..ad7770fbd469c 100644 --- a/src/mame/dataeast/btime.cpp +++ b/src/mame/dataeast/btime.cpp @@ -2183,7 +2183,7 @@ GAME( 1982, btime2, btime, btime, btime, btime_state, init_btime, R GAME( 1982, btime3, btime, btime, btime3, btime_state, init_btime, ROT270, "Data East USA Inc.", "Burger Time (Data East USA)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, btimem, btime, btime, btime3, btime_state, init_btime, ROT270, "Data East (Bally Midway license)", "Burger Time (Midway)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, cookrace, btime, cookrace, cookrace, btime_state, init_cookrace, ROT270, "bootleg", "Cook Race", MACHINE_SUPPORTS_SAVE ) -GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1981, tisland, 0, tisland, btime, btime_state, init_tisland, ROT270, "Data East Corporation", "Treasure Island (Data East)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1981, lnc, 0, lnc, lnc, btime_state, init_lnc, ROT270, "Data East Corporation", "Lock'n'Chase", MACHINE_SUPPORTS_SAVE ) GAME( 1982, protenn, 0, protenn, protenn, btime_state, init_protennb, ROT270, "Data East Corporation", "Pro Tennis (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1982, protennb, protenn, protenn, protenn, btime_state, init_protennb, ROT270, "bootleg", "Tennis (bootleg of Pro Tennis)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/dataeast/supbtime.cpp b/src/mame/dataeast/supbtime.cpp index 7972f2f601cfa..b0034ac3b6c22 100644 --- a/src/mame/dataeast/supbtime.cpp +++ b/src/mame/dataeast/supbtime.cpp @@ -9,10 +9,13 @@ These games all run on the DE-0343 board. - Sound: YM2151, Oki ADPCM - NOTE! The sound program writes to the address -of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The sound -program is simply the 'generic' Data East sound program unmodified for this cut -down hardware (it doesn't write any good sound data btw, mostly zeros). + CPU: Custom 68000 Data East 55 (Super Burger Time, China Town) or Data East + 56 (Tumble Pop) clocked at 21.422 MHz / 2. + + Sound: Data East 45, YM2151, Oki ADPCM - NOTE! The sound program writes to the + address of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The + sound program is simply the 'generic' Data East sound program unmodified for + this cut down hardware (it doesn't write any good sound data btw, mostly zeros). Super Burgertime has a few bugs: @@ -119,6 +122,8 @@ class supbtime_state : public driver_device void tumblep_map(address_map &map) ATTR_COLD; }; +#define TUMBLEP_HACK 0 + /*************************************************************************** @@ -186,9 +191,6 @@ uint32_t supbtime_state::screen_update_tumblep(screen_device &screen, bitmap_ind } -#define TUMBLEP_HACK 0 - - //************************************************************************** // ADDRESS MAPS //************************************************************************** @@ -281,7 +283,9 @@ void supbtime_state::vblank_w(int state) uint16_t supbtime_state::vblank_ack_r() { - m_maincpu->set_input_line(M68K_IRQ_6, CLEAR_LINE); + if (!machine().side_effects_disabled()) + m_maincpu->set_input_line(M68K_IRQ_6, CLEAR_LINE); + return 0xffff; } @@ -453,16 +457,16 @@ GFXDECODE_END void supbtime_state::supbtime(machine_config &config) { - M68000(config, m_maincpu, XTAL(21'477'272) / 2); + M68000(config, m_maincpu, 21.477272_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &supbtime_state::supbtime_map); - H6280(config, m_audiocpu, XTAL(32'220'000) / 4); + H6280(config, m_audiocpu, 32.22_MHz_XTAL / 4); m_audiocpu->set_addrmap(AS_PROGRAM, &supbtime_state::sound_map); m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(XTAL(28'000'000) / 4, 442, 0, 320, 274, 8, 248); + screen.set_raw(28_MHz_XTAL / 4, 442, 0, 320, 274, 8, 248); screen.screen_vblank().set(FUNC(supbtime_state::vblank_w)); screen.set_screen_update(FUNC(supbtime_state::screen_update_supbtime)); screen.set_palette("palette"); @@ -488,12 +492,13 @@ void supbtime_state::supbtime(machine_config &config) GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, 0); - ym2151_device &ymsnd(YM2151(config, "ymsnd", XTAL(32'220'000) / 9)); - ymsnd.irq_handler().set_inputline(m_audiocpu, 1); /* IRQ2 */ - ymsnd.add_route(0, "mono", 0.45); - ymsnd.add_route(1, "mono", 0.45); + ym2151_device &ymsnd(YM2151(config, "ymsnd", 32.22_MHz_XTAL / 9)); + ymsnd.irq_handler().set_inputline(m_audiocpu, 1); // IRQ2 + ymsnd.add_route(0, "mono", 0.25); + ymsnd.add_route(1, "mono", 0.25); - OKIM6295(config, "oki", XTAL(21'477'272) / 20, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.50); // clock frequency & pin 7 not verified + okim6295_device &oki(OKIM6295(config, "oki", 32.22_MHz_XTAL / 32, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified + oki.add_route(ALL_OUTPUTS, "mono", 0.50); } void supbtime_state::chinatwn(machine_config &config) @@ -510,6 +515,9 @@ void supbtime_state::tumblep(machine_config &config) m_maincpu->set_addrmap(AS_PROGRAM, &supbtime_state::tumblep_map); subdevice("screen")->set_screen_update(FUNC(supbtime_state::screen_update_tumblep)); + + // tumblep oki is a bit higher pitched, clock frequency & pin 7 not verified + subdevice("oki")->set_clock(21.477272_MHz_XTAL / 20); } diff --git a/src/mame/saitek/stratos.cpp b/src/mame/saitek/stratos.cpp index 8ee440c7c3812..d988c4270cd6f 100644 --- a/src/mame/saitek/stratos.cpp +++ b/src/mame/saitek/stratos.cpp @@ -37,7 +37,7 @@ Hardware notes: - unknown LCDC under epoxy blob, suspected to be an MCU Stratos/Turbo King are identical. -Corona has magnet sensors and two HELIOS chips. +Corona has magnet sensors and two NEC gate arrays. There is no official Saitek program versioning for these. The D/D+ versions are known since they're the same chess engine as later Saitek modules, such as the diff --git a/src/mame/taito/opwolf.cpp b/src/mame/taito/opwolf.cpp index dee8b7d961056..7164cbe330ac0 100644 --- a/src/mame/taito/opwolf.cpp +++ b/src/mame/taito/opwolf.cpp @@ -898,8 +898,8 @@ void opwolf_state::opwolf(machine_config &config) m_tc0060dca[0]->add_route(ALL_OUTPUTS, "mixer", 1.0); mixer_device &mixer = MIXER(config, "mixer"); - mixer.add_route(0, m_tc0060dca[1], 1.0); - mixer.add_route(0, m_tc0060dca[1], 1.0); + mixer.add_route(0, m_tc0060dca[1], 1.0, 0); + mixer.add_route(0, m_tc0060dca[1], 1.0, 1); TC0060DCA(config, m_tc0060dca[1]); m_tc0060dca[1]->add_route(0, "lspeaker", 1.0); diff --git a/src/mame/taito/taito_z.cpp b/src/mame/taito/taito_z.cpp index b297d324296f6..90a8f529a9f00 100644 --- a/src/mame/taito/taito_z.cpp +++ b/src/mame/taito/taito_z.cpp @@ -254,7 +254,7 @@ M4300099A CHASE HQ DX (sticker for DX cabinet) | |TC0100SCN| 43256 |-| | 16MHz | | | | TMM2063 |---------| 43256 | -| TC0050DCA |---------| |-| +| TC0060DCA |---------| |-| | Y3016-F TMM2063 |TAITO | |------| | | | |TC0170ABT| |TAITO | | | | TL074 TL074 | | |TC0110| B52-01.IC7 | | @@ -1547,7 +1547,6 @@ void nightstr_state::nightstr_motor_w(offs_t offset, u16 data) m_motor_debug = data; break; } - } void nightstr_state::nightstr_lamps_w(u8 data) diff --git a/src/mame/taito/taito_z.h b/src/mame/taito/taito_z.h index 5314c1e0b3ca9..122431585c07b 100644 --- a/src/mame/taito/taito_z.h +++ b/src/mame/taito/taito_z.h @@ -96,7 +96,7 @@ class taitoz_state : public driver_device output_finder<8> m_cpua_out; /* misc */ - u16 m_cpua_ctrl; + u16 m_cpua_ctrl = 0; private: u32 screen_update_bshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); From bc4a0119a8c624b3719e40d9f6201173c7b509ad Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Sun, 9 Mar 2025 03:05:02 +0100 Subject: [PATCH 129/272] vpoker.cpp driver improvements. [Roberto Fresca, Grull Osgo] - Workaround for NMI to get the Save and Halt function (5-Aces). - Solved any issues regarding interrupt vectors. - Documented the 5-Aces Poker SETUP mode. - Fixed the 5-Aces Poker vertical refresh rate. - Renamed function according to its own interrupts vector name. - Unified most of the inputs. - Rewrote the 5-Aces Poker machine config to use the vpoker one as base config. - Added links to the Challenger Draw Poker flyers. - Added technical notes. --- src/mame/misc/vpoker.cpp | 191 +++++++++++++++++++++------------------ 1 file changed, 105 insertions(+), 86 deletions(-) diff --git a/src/mame/misc/vpoker.cpp b/src/mame/misc/vpoker.cpp index 4e114c821be6f..2e08136b662f8 100644 --- a/src/mame/misc/vpoker.cpp +++ b/src/mame/misc/vpoker.cpp @@ -1,9 +1,22 @@ // license:BSD-3-Clause -// copyright-holders:Angelo Salese, Roberto Fresca +// copyright-holders: Angelo Salese, Roberto Fresca, Grull Osgo /************************************************************************************************************** Challenger Draw Poker (c) 198? Videotronics. - Driver by Angelo Salese & Roberto Fresca. + Driver by Angelo Salese, Roberto Fresca & Grull Osgo. + + + The Challenger series had three games: + + * Challenger Draw Poker + https://flyers.arcade-museum.com/videogames/show/4296 + https://flyers.arcade-museum.com/videogames/show/4374 + + * Challenger Black Jack 21 + https://flyers.arcade-museum.com/videogames/show/4295 + + * Challenger In Between + https://flyers.arcade-museum.com/videogames/show/4297 Notes: @@ -13,15 +26,15 @@ 1) "Challenger Draw Poker", from Bend Electronics Co. Inc. 2) "VHI Draw Poker", from Video Horizons, Inc. - Both companies shared the same address and phone number: - 63353 Nels Anderson Road. Bend, Oregon 97701. - Tel: 503-389-7626. + Both companies shared the same address and phone number: + 63353 Nels Anderson Road. Bend, Oregon 97701. + Tel: 503-389-7626. - Bend Electronics Co. Inc. claims that they are worldwide distributors for Videotronics, Inc. + Bend Electronics Co. Inc. claims that they are worldwide distributors for Videotronics, Inc. - There are some legal issues between all these companies... - https://scholar.google.com/scholar_case?case=7993095852400122011 - http://www.plainsite.org/dockets/201rtodjb/nevada-district-court/videotronics-inc-v-bend-electronics/ + There are some legal issues between all these companies... + https://scholar.google.com/scholar_case?case=7993095852400122011 + http://www.plainsite.org/dockets/201rtodjb/nevada-district-court/videotronics-inc-v-bend-electronics/ =============================================================================================================== @@ -122,6 +135,41 @@ Coins in: dd +=============================================================================================================== + + Notes by game: + + + * 5-Aces Poker + + Game Mode Access: Before entering the game mode, a system check must be completed. + Once the check is finished, you can insert coins and start playing. + + Entering Setup Mode: To enter the Setup Mode, press the SETUP key (F2). + + SET UP + TIMER 6... + + In Setup Mode, you can adjust each item using the following controls: + + - BET button (M key) to increase the value or turn the item off. + - DEAL button (1 key) to decrease the value or turn the item on. + - Use the CANCEL button to move to the next item. + + SET UP + TIMER 6 (range: 1 to 12) + MAX BET 8 (range: 5 to 50) + AUTO BET OFF (options: OFF/ON) + AUTO DEAL OFF (options: OFF/ON) + REBET OFF (options: OFF/ON) + + After adjusting the last item, you will return to the game mode. + + Saving NVRAM Data: If you need to power off the machine but want to save the NVRAM data, + press the "Save and Halt" service (key 9), then turn off the machine. Upon reboot, all + previous data will be restored. + + =============================================================================================================== Updates [2025-03-04]: @@ -145,25 +193,31 @@ Updates [2025-03-06]: - Rewrote the lamps scheme. - - Fixed the button-lamps layouts. + - Fixed the button-lamps layouts accordingly. - Added workaround for the NMI routine (vpoker). - Fixed vpoker NVRAM issues. - Fixed mech counters support per game. + Updates [2025-03-08]: + + - Workaround for NMI to get the Save and Halt function (5-Aces). + - Solved any issues regarding interrupt vectors. + - Documented the 5-Aces Poker SETUP mode. + - Fixed the 5-Aces Poker vertical refresh rate. + - Renamed function according to its own interrupts vector name. + - Unified most of the inputs. + - Rewrote the 5-Aces Poker machine config to use the vpoker one as base config. + - Added links to the Challenger Draw Poker flyers. + - Added technical notes. + TODO: - - Add workaround for the NMI routine (5acespkr). - - Fix the 5acespkr NVRAM issues. - - Find why vectors are changed in 5acespkr. - - Investigate about what seems to be a custom processor - due to the weird routines related to interrupts, and the - complete lack of SWI triggers. + - Nothing... :) **************************************************************************************************************/ - #include "emu.h" #include "cpu/m6809/m6809.h" #include "machine/6840ptm.h" @@ -190,13 +244,13 @@ class vpoker_state : public driver_device m_dac(*this, "dac"), m_in0(*this, "IN0"), m_in1(*this, "IN1"), + m_in2(*this, "IN2"), m_lamps(*this, "lamp%u", 0U) { } void vpoker(machine_config &config); void fiveaces(machine_config &config); - void init_5aces(); protected: virtual void machine_start() override ATTR_COLD; @@ -206,12 +260,14 @@ class vpoker_state : public driver_device uint8_t nvram_r(offs_t offset); void nvram_w(offs_t offset, u8 data); std::unique_ptr m_videoram; + std::unique_ptr m_nvram_data; uint8_t m_blit_ram[8]; uint8_t blitter_r(offs_t offset); void blitter_w(offs_t offset, uint8_t data); void ptm_irq(int state); void ptm_5_irq(int state); - void swi_int(int state); + void firq_coin_line(int state); + void five_nmi_line(int state); uint32_t screen_update_vpoker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); required_device m_maincpu; required_device m_gfxdecode; @@ -219,10 +275,9 @@ class vpoker_state : public driver_device required_device m_dac; required_ioport m_in0; required_ioport m_in1; + required_ioport m_in2; output_finder<9> m_lamps; void main_map(address_map &map) ATTR_COLD; - - std::unique_ptr m_nvram_data; }; @@ -259,9 +314,12 @@ uint32_t vpoker_state::screen_update_vpoker(screen_device &screen, bitmap_ind16 uint8_t vpoker_state::blitter_r(offs_t offset) { + if(m_in2->read() == 1 ) // Save and Halt + m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE); + if(offset == 6) return m_in0->read(); - + if(offset == 7) return m_in1->read(); @@ -352,11 +410,11 @@ static INPUT_PORTS_START( vpoker ) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") PORT_IMPULSE(3) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) // PORT_TOGGLE - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("IN0-10") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E) PORT_NAME("IN0-20") - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN0-40") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN0-80") + PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-10") PORT_CODE(KEYCODE_Q) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-20") PORT_CODE(KEYCODE_E) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-40") PORT_CODE(KEYCODE_R) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("IN0-80") PORT_CODE(KEYCODE_T) PORT_START("IN1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) @@ -367,29 +425,21 @@ static INPUT_PORTS_START( vpoker ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) + + PORT_START("IN2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED ) INPUT_PORTS_END static INPUT_PORTS_START( 5acespkr ) - PORT_START("IN0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("Coin In") PORT_IMPULSE(2) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_GAMBLE_BET ) // setu change value (up/off) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) // PORT_TOGGLE - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) PORT_NAME("IN0-10") - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_NAME("Settings") // setup - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) PORT_NAME("IN0-40") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_T) PORT_NAME("IN0-80") + PORT_INCLUDE( vpoker ) - PORT_START("IN1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Deal") // setup change value (down/up-1) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_NAME("Draw") - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) // setup netx item + PORT_MODIFY("IN0") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_GAMBLE_BOOK ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Settings") // setup + + PORT_MODIFY("IN2") + PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_NAME("Save and Halt") INPUT_PORTS_END @@ -438,7 +488,6 @@ void vpoker_state::ptm_irq(int state) sum = ~sum + 1; nvram_w(0x9f, sum); - sum = 0; } } @@ -447,8 +496,7 @@ void vpoker_state::ptm_5_irq(int state) m_maincpu->set_input_line(M6809_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); } - -void vpoker_state::swi_int(int state) +void vpoker_state::firq_coin_line(int state) { if(m_in0->read() == 0xfe) m_maincpu->set_input_line(M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); @@ -481,7 +529,7 @@ void vpoker_state::vpoker(machine_config &config) // 6840 PTM ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); - ptm.set_external_clocks(500, 0000, 3000); + ptm.set_external_clocks(500, 0, 3000); ptm.irq_callback().set(FUNC(vpoker_state::ptm_irq)); ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); @@ -493,34 +541,22 @@ void vpoker_state::vpoker(machine_config &config) void vpoker_state::fiveaces(machine_config &config) { - // basic machine hardware - MC6809(config, m_maincpu, XTAL(4'000'000)); - m_maincpu->set_addrmap(AS_PROGRAM, &vpoker_state::main_map); - - NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + vpoker(config); // video hardware - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_refresh_hz(30); - screen.screen_vblank().set(FUNC(vpoker_state::swi_int)); + screen_device &screen(SCREEN(config.replace(), "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.screen_vblank().set(FUNC(vpoker_state::firq_coin_line)); screen.set_size(512, 256); screen.set_visarea(48, 448-1, 0, 240-1); // 512x256 total screen.set_screen_update(FUNC(vpoker_state::screen_update_vpoker)); screen.set_palette(m_palette); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_vpoker); - - PALETTE(config, m_palette, palette_device::GBR_3BIT); - // 6840 PTM - ptm6840_device &ptm(PTM6840(config, "6840ptm", XTAL(4'000'000) / 4)); + ptm6840_device &ptm(PTM6840(config.replace(), "6840ptm", XTAL(4'000'000) / 4)); ptm.set_external_clocks(500, 0, 1000000); ptm.irq_callback().set(FUNC(vpoker_state::ptm_5_irq)); ptm.o2_callback().set("dac", FUNC(dac_1bit_device::data_w)); - - // sound hardware - SPEAKER(config, "speaker").front_center(); - DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.5); } @@ -564,23 +600,6 @@ ROM_START( 5acespkr ) ROM_LOAD16_BYTE( "bjok1.bin", 0x2001, 0x1000, CRC(20cdda67) SHA1(6c631b09e3da5f6660aa1c018fc0ff3004f7fe85) ) ROM_END - -/***************************************** -* Driver Init * -*****************************************/ - -void vpoker_state::init_5aces() -{ -// Changing the vector temporarily for testing purposes, -// otherwise the coin in routine will be tied to the -// SW2 interrupt, and there is no code to trigger it. - - uint8_t *ROM = memregion("maincpu")->base(); - - ROM[0x3ffa] = 0x79; -} - - } // Anonymous namespace @@ -588,6 +607,6 @@ void vpoker_state::init_5aces() * Game Drivers * *****************************************/ -// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT -GAMEL( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Challenger Draw Poker", 0, layout_vpoker ) -GAMEL( 198?, 5acespkr, 0, fiveaces, 5acespkr, vpoker_state, init_5aces, ROT0, "", "5-Aces Poker", MACHINE_UNEMULATED_PROTECTION, layout_5acespkr ) +// YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS LAYOUT +GAMEL( 198?, vpoker, 0, vpoker, vpoker, vpoker_state, empty_init, ROT0, "Videotronics, Inc.", "Challenger Draw Poker", 0, layout_vpoker ) +GAMEL( 198?, 5acespkr, 0, fiveaces, 5acespkr, vpoker_state, empty_init, ROT0, "", "5-Aces Poker", 0, layout_5acespkr ) From ec284fef5032e514f8855dba0e99a03e2f703af5 Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Sun, 9 Mar 2025 03:27:16 +0100 Subject: [PATCH 130/272] magicfly.cpp improvements: * Added some notes * Cleaned up the driver. --- src/mame/misc/magicfly.cpp | 250 ++++++++++++++++++------------------- 1 file changed, 121 insertions(+), 129 deletions(-) diff --git a/src/mame/misc/magicfly.cpp b/src/mame/misc/magicfly.cpp index 43f2c14f883c7..34ecea80b6b9f 100644 --- a/src/mame/misc/magicfly.cpp +++ b/src/mame/misc/magicfly.cpp @@ -432,10 +432,9 @@ TODO: - - Simplify the gfx banks to avoid a custom palette. - - Document the correct pinout. - - Analyze the PLD. Try to reconstruct the original equations. - - Split the driver. + - Figure out how the palette is generated, to avoid a custom palette. + - Fix the color issues in Bonne Chance (color codes 00 & 08 for the + cards corners numbers). *******************************************************************************/ @@ -531,14 +530,14 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_magicfly_tile_info) */ int attr = m_colorram[tile_index]; int code = m_videoram[tile_index]; - int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ - int color = attr & 0x07; /* bits 0-2 for color */ + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x07; // bits 0-2 for color - /* Seems that bit 7 is mirrored from bit 3 to have a normal boot */ - /* Boot only check the first color RAM offset */ + // Seems that bit 7 is mirrored from bit 3 to have a normal boot + // Boot only check the first color RAM offset - m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); /* only for 1st offset */ - //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); // for the whole color RAM tileinfo.set(bank, code, color, 0); } @@ -562,14 +561,14 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_7mezzo_tile_info) */ int const attr = m_colorram[tile_index]; int const code = m_videoram[tile_index]; - int const bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ - int const color = attr & 0x07; /* bits 0-2 for color */ + int const bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int const color = attr & 0x07; // bits 0-2 for color - /* Seems that bit 7 is mirrored from bit 2 to have a normal boot */ - /* Boot only check the first color RAM offset */ + // Seems that bit 7 is mirrored from bit 2 to have a normal boot + // Boot only check the first color RAM offset - m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x04) << 5); /* only for 1st offset */ - //m_colorram[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x04) << 5); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x04) << 5); // for the whole color RAM tileinfo.set(bank, code, color, 0); } @@ -589,55 +588,52 @@ uint32_t magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_rg void magicfly_state::magicfly_palette(palette_device &palette) const { - for (int i = 0x00; i < 0x10; i += 0x10) - { - /* 1st gfx bank */ - palette.set_pen_color(i + 0, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 2, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 4, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 6, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 8, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 10, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 12, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 14, rgb_t(0x00, 0x00, 0x00)); - - palette.set_pen_color(i + 1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 3, rgb_t(0xff, 0x00, 0x00)); - palette.set_pen_color(i + 5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(i + 7, rgb_t(0xff, 0xff, 0x00)); - palette.set_pen_color(i + 9, rgb_t(0x00, 0x00, 0xff)); - palette.set_pen_color(i + 11, rgb_t(0xff, 0x00, 0xff)); - palette.set_pen_color(i + 13, rgb_t(0x00, 0xff, 0xff)); - palette.set_pen_color(i + 15, rgb_t(0xff, 0xff, 0xff)); - } + // 1st gfx bank + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(4, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(6, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(10, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(12, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); + + palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); + palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); } void magicfly_state::bchance_palette(palette_device &palette) const { - for (int i = 0x00; i < 0x10; i += 0x10) - { - /* 1st gfx bank */ - palette.set_pen_color(i + 0, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 2, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 4, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 6, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 8, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 10, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 12, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 14, rgb_t(0x00, 0x00, 0x00)); - - palette.set_pen_color(i + 1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(i + 3, rgb_t(0xff, 0x00, 0x00)); - palette.set_pen_color(i + 5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(i + 7, rgb_t(0xff, 0xff, 0x00)); - palette.set_pen_color(i + 9, rgb_t(0x00, 0x00, 0xff)); - palette.set_pen_color(i + 11, rgb_t(0xff, 0x00, 0xff)); - palette.set_pen_color(i + 13, rgb_t(0x00, 0xff, 0xff)); - palette.set_pen_color(i + 15, rgb_t(0xff, 0xff, 0xff)); - } + // 1st gfx bank + palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(2, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(4, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(6, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(8, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(10, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(12, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); + + palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); + palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); palette.set_pen_color(0x08 , rgb_t(0xff, 0xff, 0xff)); // white for the cards back logo background. palette.set_pen_color(0x12 , rgb_t(0x00, 0x00, 0x00)); // black for the cards corners (should be transparent) + +// Bonne Chance cards are using color code 08. For red cards this code is accurate. +// But when cards are black, the numbers at the corners use color code 00 (that should turn them black) } @@ -670,13 +666,13 @@ void magicfly_state::mux_port_w(uint8_t data) x--- ---- Sound DAC. */ - m_input_selector = data & 0x0f; /* Input Selector */ + m_input_selector = data & 0x0f; // Input selector - m_dac->write(BIT(data, 7)); /* Sound DAC */ + m_dac->write(BIT(data, 7)); // Sound DAC - machine().bookkeeping().coin_counter_w(0, data & 0x40); /* Coin1 */ - machine().bookkeeping().coin_counter_w(1, data & 0x10); /* Coin2 */ - machine().bookkeeping().coin_counter_w(2, data & 0x20); /* Payout */ + machine().bookkeeping().coin_counter_w(0, data & 0x40); // Coin1 + machine().bookkeeping().coin_counter_w(1, data & 0x10); // Coin2 + machine().bookkeeping().coin_counter_w(2, data & 0x20); // Payout } @@ -686,14 +682,14 @@ void magicfly_state::mux_port_w(uint8_t data) void magicfly_state::magicfly_map(address_map &map) { - map(0x0000, 0x07ff).ram().share("nvram"); /* MK48Z02B NVRAM */ + map(0x0000, 0x07ff).ram().share("nvram"); // MK48Z02B NVRAM map(0x0800, 0x0800).w("crtc", FUNC(mc6845_device::address_w)); map(0x0801, 0x0801).rw("crtc", FUNC(mc6845_device::register_r), FUNC(mc6845_device::register_w)); - map(0x1000, 0x13ff).ram().w(FUNC(magicfly_state::magicfly_videoram_w)).share("videoram"); /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ - map(0x1800, 0x1bff).ram().w(FUNC(magicfly_state::magicfly_colorram_w)).share("colorram"); /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ - map(0x2800, 0x2800).r(FUNC(magicfly_state::mux_port_r)); /* multiplexed input port */ - map(0x3000, 0x3000).w(FUNC(magicfly_state::mux_port_w)); /* output port */ - map(0xc000, 0xffff).rom(); /* ROM space */ + map(0x1000, 0x13ff).ram().w(FUNC(magicfly_state::magicfly_videoram_w)).share("videoram"); // HM6116LP #1 (2K x 8) RAM (only 1st half used) + map(0x1800, 0x1bff).ram().w(FUNC(magicfly_state::magicfly_colorram_w)).share("colorram"); // HM6116LP #2 (2K x 8) RAM (only 1st half used) + map(0x2800, 0x2800).r(FUNC(magicfly_state::mux_port_r)); // multiplexed input port + map(0x3000, 0x3000).w(FUNC(magicfly_state::mux_port_w)); // output port + map(0xc000, 0xffff).rom(); // ROM space } @@ -702,34 +698,34 @@ void magicfly_state::magicfly_map(address_map &map) *********************************************/ static INPUT_PORTS_START( magicfly ) -/* Multiplexed 4 x 5 bits. - Code accept only bits 0, 1, 2, 3 and 5 as valid. -*/ +// Multiplexed 4 x 5 bits. +// Code accept only bits 0, 1, 2, 3 and 5 as valid. + PORT_START("IN0-0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_2WAY - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_2WAY PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -745,7 +741,7 @@ static INPUT_PORTS_START( magicfly ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* Only 4 physical DIP switches (valid bits = 4, 6, 7) */ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -753,7 +749,7 @@ static INPUT_PORTS_START( magicfly ) PORT_DIPNAME( 0x10, 0x10, "Maximum Bet" ) PORT_DIPSETTING( 0x10, "20" ) PORT_DIPSETTING( 0x00, "100" ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* invalid - don't change */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) // invalid - don't change PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) @@ -765,16 +761,16 @@ static INPUT_PORTS_START( magicfly ) INPUT_PORTS_END static INPUT_PORTS_START( 7mezzo ) -/* Multiplexed 4 x 5 bits. - Code accept only bits 0, 1, 2, 3 and 5 as valid. -*/ +// Multiplexed 4 x 5 bits. +// Code accept only bits 0, 1, 2, 3 and 5 as valid. + PORT_START("IN0-0") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -784,17 +780,17 @@ static INPUT_PORTS_START( 7mezzo ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_NAME("Payout") PORT_CODE(KEYCODE_Q) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("Take") PORT_CODE(KEYCODE_V) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("IN0-2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* present in the input test */ + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN ) // present in the input test PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -808,7 +804,7 @@ static INPUT_PORTS_START( 7mezzo ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") /* Only 4 physical DIP switches (valid bits = 4, 6, 7) */ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -816,7 +812,7 @@ static INPUT_PORTS_START( 7mezzo ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) /* invalid - don't change */ + PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) // invalid - don't change PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) @@ -882,10 +878,7 @@ static INPUT_PORTS_START( bchance ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("DSW0") -/* Only 4 physical DIP switches - (valid bits = 4, 6, 7) -*/ + PORT_START("DSW0") // Only 4 physical DIP switches (valid bits = 4, 6, 7) PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) @@ -946,30 +939,30 @@ GFXDECODE_END void magicfly_state::magicfly(machine_config &config) { - /* basic machine hardware */ - M6502(config, m_maincpu, MASTER_CLOCK / 16); /* guess */ + // basic machine hardware + M6502(config, m_maincpu, MASTER_CLOCK / 16); // guess m_maincpu->set_addrmap(AS_PROGRAM, &magicfly_state::magicfly_map); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); - screen.set_size((39+1)*8, (31+1)*8); /* Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1). */ - screen.set_visarea(0*8, 32*8-1, 0*8, 29*8-1); /* Taken from MC6845 init, registers 01 & 06. */ + screen.set_size((39+1)*8, (31+1)*8); // Taken from MC6845 init, registers 00 & 04. Normally programmed with (value-1). + screen.set_visarea(0*8, 32*8-1, 0*8, 29*8-1); // Taken from MC6845 init, registers 01 & 06. screen.set_screen_update(FUNC(magicfly_state::screen_update_magicfly)); GFXDECODE(config, m_gfxdecode, "palette", gfx_magicfly); PALETTE(config, "palette", FUNC(magicfly_state::magicfly_palette), 32); - mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/16)); /* guess */ + mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/16)); // guess crtc.set_screen("screen"); crtc.set_show_border_area(false); crtc.set_char_width(8); crtc.out_vsync_callback().set_inputline(m_maincpu, INPUT_LINE_NMI); - /* sound hardware */ + // sound hardware SPEAKER(config, "speaker").front_center(); DAC_1BIT(config, m_dac, 0).add_route(ALL_OUTPUTS, "speaker", 0.25); } @@ -979,7 +972,7 @@ void magicfly_state::_7mezzo(machine_config &config) { magicfly(config); - /* video hardware */ + // video hardware MCFG_VIDEO_START_OVERRIDE(magicfly_state, 7mezzo) } @@ -988,7 +981,7 @@ void magicfly_state::bchance(machine_config &config) { magicfly(config); - /* video hardware */ + // video hardware subdevice("palette")->set_init(FUNC(magicfly_state::bchance_palette)); } @@ -1007,16 +1000,15 @@ ROM_START( magicfly ) ROM_LOAD( "magicfly0.bin", 0x4000, 0x2000, CRC(44e3c9d6) SHA1(677d25360d261bf2400f399b8015eeb529ad405e) ) ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* sprites, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* sprites, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* sprites, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // sprites, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // sprites, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // sprites, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) - ROM_LOAD( "pal16r4a-magicfly.bin", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ - + ROM_LOAD( "pal16r4a-magicfly.bin", 0x0000, 0x0104, NO_DUMP ) // PAL is read protected ROM_END ROM_START( 7mezzo ) @@ -1024,17 +1016,17 @@ ROM_START( 7mezzo ) ROM_LOAD( "ns3_1.bin", 0xc000, 0x4000, CRC(b1867b76) SHA1(eb76cffb81c865352f4767015edade54801f6155) ) ROM_REGION( 0x6000, "gfx", 0 ) - ROM_LOAD( "ns2.bin", 0x0000, 0x2000, CRC(7983a41c) SHA1(68805ea960c2738d3cd2c7490ffed84f90da029b) ) /* Renamed as ns2.bin regarding pcb location and content */ + ROM_LOAD( "ns2.bin", 0x0000, 0x2000, CRC(7983a41c) SHA1(68805ea960c2738d3cd2c7490ffed84f90da029b) ) // Renamed as ns2.bin regarding pcb location and content ROM_LOAD( "ns1.bin", 0x2000, 0x2000, CRC(a6ada872) SHA1(7f531a76e73d479161e485bdcf816eb8eb9fdc62) ) - ROM_LOAD( "ns0.bin", 0x4000, 0x2000, CRC(e04fb210) SHA1(81e764e296fe387daf8ca67064d5eba2a4fc3c26) ) /* Renamed as ns0.bin regarding pcb location and content */ + ROM_LOAD( "ns0.bin", 0x4000, 0x2000, CRC(e04fb210) SHA1(81e764e296fe387daf8ca67064d5eba2a4fc3c26) ) // Renamed as ns0.bin regarding pcb location and content ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* 3bpp tiles, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* 3bpp tiles, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* 3bpp tiles, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // 3bpp tiles, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // 3bpp tiles, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // 3bpp tiles, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) ROM_LOAD( "pal16r4a-7mezzo.bin", 0x0000, 0x0104, BAD_DUMP CRC(61ac7372) SHA1(7560506468a7409075094787182ded24e2d0c0a3) ) @@ -1044,21 +1036,21 @@ ROM_START( bchance ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "v-pk-4gag.bin", 0xc000, 0x4000, CRC(7c2dd908) SHA1(97b1390fb4c8c838a0d5b78d6904d597a9abe27f) ) - ROM_REGION( 0x6000, "gfx", 0 ) /* ROM n-pk-2.bin was created from an exhaustive analysis of 25 different bad dumps */ + ROM_REGION( 0x6000, "gfx", 0 ) // ROM n-pk-2.bin was created from an exhaustive analysis of 25 different bad dumps ROM_LOAD( "n-pk-2.bin", 0x0000, 0x2000, BAD_DUMP CRC(462c3dd7) SHA1(fb30d6147e0d607b3fb631d8bdca35e98eccfd2d) ) ROM_LOAD( "n-pk-1.bin", 0x2000, 0x2000, CRC(e35cebd6) SHA1(b0dd86fd4c06f98e486b04e09808985bfa4f0e9c) ) ROM_LOAD( "n-pk-0.bin", 0x4000, 0x2000, CRC(3c64edc4) SHA1(97b677b7c4999b502ab4b4f70c33b40050843796) ) ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) /* chars */ + ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) - ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) /* 3bpp tiles, bitplane 1 */ - ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) /* 3bpp tiles, bitplane 2 */ - ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) /* 3bpp tiles, bitplane 3 */ + ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // 3bpp tiles, bitplane 1 + ROM_COPY( "gfx", 0x3800, 0x0800, 0x0800 ) // 3bpp tiles, bitplane 2 + ROM_COPY( "gfx", 0x5800, 0x1000, 0x0800 ) // 3bpp tiles, bitplane 3 ROM_REGION( 0x0200, "plds", 0 ) - ROM_LOAD( "gal16v8-bchance.bin", 0x0000, 0x0104, NO_DUMP ) /* protected */ + ROM_LOAD( "gal16v8-bchance.bin", 0x0000, 0x0104, NO_DUMP ) // protected ROM_END } // anonymous namespace From 82b391615e15e10060c921337fac42485c42e67b Mon Sep 17 00:00:00 2001 From: cam900 Date: Sun, 9 Mar 2025 18:56:32 +0900 Subject: [PATCH 131/272] dataeast/supbtime.cpp: Fix hardware notes (#13455) --- src/mame/dataeast/supbtime.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mame/dataeast/supbtime.cpp b/src/mame/dataeast/supbtime.cpp index b0034ac3b6c22..6b3deb6b015a6 100644 --- a/src/mame/dataeast/supbtime.cpp +++ b/src/mame/dataeast/supbtime.cpp @@ -9,8 +9,7 @@ These games all run on the DE-0343 board. - CPU: Custom 68000 Data East 55 (Super Burger Time, China Town) or Data East - 56 (Tumble Pop) clocked at 21.422 MHz / 2. + CPU: Custom 68000 Data East 59 clocked at 21.422 MHz / 2. Sound: Data East 45, YM2151, Oki ADPCM - NOTE! The sound program writes to the address of a YM2203 and a 2nd Oki chip but the board does _not_ have them. The From 3029c6c69a88497c368269c809737ab71d693e54 Mon Sep 17 00:00:00 2001 From: arbee Date: Sun, 9 Mar 2025 13:24:05 -0400 Subject: [PATCH 132/272] apple/apple2gs.cpp: Fix language card state after Control-Reset. (GitHub #13420) [R. Belmont] --- src/mame/apple/apple2gs.cpp | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/mame/apple/apple2gs.cpp b/src/mame/apple/apple2gs.cpp index e9f4b85c73bf1..5ebfceda441cb 100644 --- a/src/mame/apple/apple2gs.cpp +++ b/src/mame/apple/apple2gs.cpp @@ -473,6 +473,7 @@ class apple2gs_state : public driver_device u8 m_clkdata = 0, m_clock_control = 0; u8 m_clock_frame = 0; + void lcrom_update(); void do_io(int offset); u8 read_floatingbus(); void update_slotrom_banks(); @@ -1266,20 +1267,7 @@ void apple2gs_state::lc_update(int offset, bool writing) if (m_lcram != old_lcram) { - if (m_lcram) - { - m_lcbank.select(1); - m_lcaux.select(1); - m_lc00.select(1 + (m_romswitch ? 2 : 0)); - m_lc01.select(1); - } - else - { - m_lcbank.select(0); - m_lcaux.select(0); - m_lc00.select(0 + (m_romswitch ? 2 : 0)); - m_lc01.select(0); - } + lcrom_update(); } #if 0 @@ -1291,6 +1279,24 @@ void apple2gs_state::lc_update(int offset, bool writing) #endif } +void apple2gs_state::lcrom_update() +{ + if (m_lcram) + { + m_lcbank.select(1); + m_lcaux.select(1); + m_lc00.select(1 + (m_romswitch ? 2 : 0)); + m_lc01.select(1); + } + else + { + m_lcbank.select(0); + m_lcaux.select(0); + m_lc00.select(0 + (m_romswitch ? 2 : 0)); + m_lc01.select(0); + } +} + // most softswitches don't care about read vs write, so handle them here void apple2gs_state::do_io(int offset) { @@ -3412,6 +3418,7 @@ void apple2gs_state::adbmicro_p2_out(u8 data) m_video->page2_w(false); m_video->res_w(0); + lcrom_update(); auxbank_update(); update_slotrom_banks(); } From b8de24c775b4b673c2951547364306e98400bd28 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 9 Mar 2025 14:51:01 -0400 Subject: [PATCH 133/272] New machines marked as NOT_WORKING ---------------------------------- MicroVAX I [microvax2.org] MicroVAX II [microvax2.org] MicroVAX 3400 [microvax2.org] MicroVAX 3500 [microvax2.org] --- scripts/src/cpu.lua | 7 +++ src/devices/cpu/vax/vax.cpp | 100 ++++++++++++++++++++++++++++++++++++ src/devices/cpu/vax/vax.h | 82 +++++++++++++++++++++++++++++ src/mame/dec/uvax1.cpp | 88 +++++++++++++++++++++++++++++++ src/mame/dec/uvax2.cpp | 65 +++++++++++++++++++++++ src/mame/dec/uvax3.cpp | 66 ++++++++++++++++++++++++ src/mame/mame.lst | 10 ++++ 7 files changed, 418 insertions(+) create mode 100644 src/devices/cpu/vax/vax.cpp create mode 100644 src/devices/cpu/vax/vax.h create mode 100644 src/mame/dec/uvax1.cpp create mode 100644 src/mame/dec/uvax2.cpp create mode 100644 src/mame/dec/uvax3.cpp diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index 6b03fc9468d20..b69f860f813ac 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -3746,6 +3746,13 @@ end --@src/devices/cpu/vax/vax.h,CPUS["VAX"] = true -------------------------------------------------- +if CPUS["VAX"] then + files { + MAME_DIR .. "src/devices/cpu/vax/vax.cpp", + MAME_DIR .. "src/devices/cpu/vax/vax.h", + } +end + if opt_tool(CPUS, "VAX") then table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vax/vaxdasm.cpp") table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/vax/vaxdasm.h") diff --git a/src/devices/cpu/vax/vax.cpp b/src/devices/cpu/vax/vax.cpp new file mode 100644 index 0000000000000..b2930a5502152 --- /dev/null +++ b/src/devices/cpu/vax/vax.cpp @@ -0,0 +1,100 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + DEC VAX CPUs + + Currently these devices are just stubs with no actual execution core. + +***************************************************************************/ + +#include "emu.h" +#include "vax.h" +#include "vaxdasm.h" + +// device type definitions +DEFINE_DEVICE_TYPE(KD32A, kd32a_device, "kd32a", "DEC KD32-A MicroVAX I CPU") +DEFINE_DEVICE_TYPE(DC333, dc333_device, "dc333", "DEC DC333 MicroVAX II CPU") +DEFINE_DEVICE_TYPE(DC341, dc341_device, "dc341", "DEC DC341 CVAX CPU") + + +vax_cpu_device::vax_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int addrwidth) + : cpu_device(mconfig, type, tag, owner, clock) + , m_program_config("program", ENDIANNESS_LITTLE, 32, addrwidth, 0, 32, 9) + , m_psl(0) + , m_icount(0) +{ +} + +kd32a_device::kd32a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, KD32A, tag, owner, clock, 30) +{ +} + +dc333_device::dc333_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, DC333, tag, owner, clock, 32) +{ +} + +dc341_device::dc341_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : vax_cpu_device(mconfig, DC341, tag, owner, clock, 32) +{ +} + +std::unique_ptr vax_cpu_device::create_disassembler() +{ + return std::make_unique(); +} + +device_memory_interface::space_config_vector vax_cpu_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(AS_PROGRAM, &m_program_config), + }; +} + + +void vax_cpu_device::device_start() +{ + address_space &space = this->space(AS_PROGRAM); + space.specific(m_program_space); + space.cache(m_cache); + + std::fill_n(&m_gpr[0], 16, 0); + + set_icountptr(m_icount); + + state_add(STATE_GENPC, "GENPC", m_gpr[15]).noshow(); + state_add(STATE_GENPCBASE, "CURPC", m_gpr[15]).noshow(); + for (int i = 0; i < 12; i++) + state_add(VAX_R0 + i, util::string_format("R%d", i).c_str(), m_gpr[i]); + state_add(VAX_AP, "AP", m_gpr[12]); + state_add(VAX_FP, "FP", m_gpr[13]); + state_add(VAX_SP, "SP", m_gpr[14]); + state_add(VAX_PC, "PC", m_gpr[15]); + state_add(VAX_PSL, "PSL", m_psl); + + save_item(NAME(m_gpr)); + save_item(NAME(m_psl)); +} + +void vax_cpu_device::device_reset() +{ + m_gpr[15] = 0; + m_psl = 0x041f0000; +} + +void dc341_device::device_reset() +{ + vax_cpu_device::device_reset(); + + m_gpr[15] = 0x20040000; // 0x20060000 in run mode +} + + +void vax_cpu_device::execute_run() +{ + debugger_instruction_hook(m_gpr[15]); + + m_icount = 0; +} diff --git a/src/devices/cpu/vax/vax.h b/src/devices/cpu/vax/vax.h new file mode 100644 index 0000000000000..1d2745e97fa75 --- /dev/null +++ b/src/devices/cpu/vax/vax.h @@ -0,0 +1,82 @@ +// license:BSD-3-Clause +// copyright-holders:AJR + +#ifndef MAME_CPU_VAX_VAX_H +#define MAME_CPU_VAX_VAX_H + +#pragma once + + +class vax_cpu_device : public cpu_device +{ +public: + enum + { + VAX_R0, VAX_R1, VAX_R2, VAX_R3, + VAX_R4, VAX_R5, VAX_R6, VAX_R7, + VAX_R8, VAX_R9, VAX_R10, VAX_R11, + VAX_AP, VAX_FP, VAX_SP, VAX_PC, + VAX_PSL + }; + +protected: + // construction/destruction + vax_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int addrwidth); + + // device-level overrides + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; + + // device_disasm_interface overrides + virtual std::unique_ptr create_disassembler() override; + + // device_execute_interface overrides + virtual void execute_run() override; + + // device_memory_interface overrides + virtual space_config_vector memory_space_config() const override; + + // address space + address_space_config m_program_config; + memory_access<32, 2, 0, ENDIANNESS_LITTLE>::specific m_program_space; + memory_access<32, 2, 0, ENDIANNESS_LITTLE>::cache m_cache; + + // internal state + u32 m_gpr[16]; + u32 m_psl; + + // execution sequencing + s32 m_icount; +}; + +class kd32a_device : public vax_cpu_device +{ +public: + // construction/destruction + kd32a_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class dc333_device : public vax_cpu_device +{ +public: + // construction/destruction + dc333_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); +}; + +class dc341_device : public vax_cpu_device +{ +public: + // construction/destruction + dc341_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // device-level overrides + virtual void device_reset() override ATTR_COLD; +}; + + +// device type declarations +DECLARE_DEVICE_TYPE(KD32A, kd32a_device) +DECLARE_DEVICE_TYPE(DC333, dc333_device) +DECLARE_DEVICE_TYPE(DC341, dc341_device) + +#endif // MAME_CPU_VAX_VAX_H diff --git a/src/mame/dec/uvax1.cpp b/src/mame/dec/uvax1.cpp new file mode 100644 index 0000000000000..a801e27e83a76 --- /dev/null +++ b/src/mame/dec/uvax1.cpp @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC MicroVAX I ("Seahorse"). + + The MicroVAX I processor occupies two interconnected PCBs: the M7135 data + path module (DAP) and the M7136 memory controller (MCT). The LSI data path + chip, developed by DEC in conjunction with Silicon Compilers, Inc., is not + really a single-chip VAX CPU, since it relies on a PROM microcode store and + numerous PLDs and support logic ICs. Though the memory controller module + contains TLB/cache SRAMs and a few register files, main memory is provided + separately on the 16-bit Q22 bus in the form of MSV11-P modules. + + There were two versions of the processor: one supporting only F_floating + and D_floating types, the other supporting only F_floating and G_floating. + + Q-bus I/O options used in the MicroVAX I include DLVJ1, DZV11, DEQNA and + RQDX1. + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +#include "machine/scn_pci.h" + +namespace { + +class uvax1_state : public driver_device +{ +public: + uvax1_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void uvax1(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax1_state::mem_map(address_map &map) +{ + map(0x00000000, 0x00001fff).rom().region("bootrom", 0); +} + +static INPUT_PORTS_START(uvax1) +INPUT_PORTS_END + +void uvax1_state::uvax1(machine_config &config) +{ + KD32A(config, m_maincpu, 64_MHz_XTAL / 16); // cycle time is 250 ns + m_maincpu->set_addrmap(AS_PROGRAM, &uvax1_state::mem_map); + + SCN2661C(config, "conuart", 5.0688_MHz_XTAL); +} + +ROM_START(uvax1) + ROM_REGION32_LE(0x2000, "bootrom", 0) + ROM_LOAD("m7135_microvax_i_e78_2764.bin", 0x0000, 0x2000, CRC(8c6f01f0) SHA1(c3effa180faa7767b267b047d724871592466788)) + + ROM_REGION64_LE(0x10000, "dap_proms", ROMREGION_ERASE00) // MB7144H or equivalent + ROM_LOAD64_BYTE("dap0.bin", 0x0000, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap1.bin", 0x0001, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap2.bin", 0x0002, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap3.bin", 0x0003, 0x2000, NO_DUMP) + ROM_LOAD64_BYTE("dap4.bin", 0x0004, 0x2000, NO_DUMP) + + ROM_REGION64_LE(0x2000, "mct_proms", 0) // Am27S35DC + ROM_LOAD64_BYTE("mct0.bin", 0x0000, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct1.bin", 0x0001, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct2.bin", 0x0002, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct3.bin", 0x0003, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct4.bin", 0x0004, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct5.bin", 0x0005, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct6.bin", 0x0006, 0x0400, NO_DUMP) + ROM_LOAD64_BYTE("mct7.bin", 0x0007, 0x0400, NO_DUMP) +ROM_END + +} // anonymous namespace + +COMP(1984, uvax1, 0, 0, uvax1, uvax1, uvax1_state, empty_init, "Digital Equipment Corporation", "MicroVAX I", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/dec/uvax2.cpp b/src/mame/dec/uvax2.cpp new file mode 100644 index 0000000000000..1714f59b3ac68 --- /dev/null +++ b/src/mame/dec/uvax2.cpp @@ -0,0 +1,65 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC MicroVAX II ("Mayflower"). + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +//#include "machine/dc319.h" +#include "machine/mc146818.h" + +namespace { + +class uvax2_state : public driver_device +{ +public: + uvax2_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void uvax2(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax2_state::mem_map(address_map &map) +{ + map(0x00000000, 0x0000ffff).rom().region("bootrom", 0); +} + +static INPUT_PORTS_START(uvax2) +INPUT_PORTS_END + +void uvax2_state::uvax2(machine_config &config) +{ + DC333(config, m_maincpu, 40_MHz_XTAL); + m_maincpu->set_addrmap(AS_PROGRAM, &uvax2_state::mem_map); + + //DC319(config, "dlart", 614.4_MHz_XTAL); + + MC146818(config, "toyclock", 32.768_kHz_XTAL); +} + +ROM_START(uvax2) + ROM_REGION32_LE(0x10000, "bootrom", 0) + ROM_SYSTEM_BIOS(0, "ef", "Rev. EF") // Rev. AF is identical? + ROMX_LOAD("m7606_a1_rev_ef_lm8725_110e6_am27256.bin", 0x0000, 0x8000, CRC(b44e8cab) SHA1(8b74031231248241109b78baa4819659533e1312), ROM_SKIP(1) | ROM_BIOS(0)) + ROMX_LOAD("m7606_a1_rev_ef_lm8729_111e6_am27256.bin", 0x0001, 0x8000, CRC(44ebb04d) SHA1(031c271ead78cae4c3dfc1125b0ab515843e1911), ROM_SKIP(1) | ROM_BIOS(0)) + ROM_SYSTEM_BIOS(1, "ah", "Rev. AH") + ROMX_LOAD("m7606_ah_062_110e6_d27256.bin", 0x0000, 0x8000, CRC(653646fa) SHA1(1f900fe5e998d0f8ed4ae63557f1e63c839991c0), ROM_SKIP(1) | ROM_BIOS(1)) + ROMX_LOAD("m7606_ah_062_111e6_d27256.bin", 0x0001, 0x8000, CRC(725dc43e) SHA1(630a908f7d630a33099ae9c3c3c08df478de941c), ROM_SKIP(1) | ROM_BIOS(1)) +ROM_END + +} // anonymous namespace + +COMP(1984, uvax2, 0, 0, uvax2, uvax2, uvax2_state, empty_init, "Digital Equipment Corporation", "MicroVAX II", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/dec/uvax3.cpp b/src/mame/dec/uvax3.cpp new file mode 100644 index 0000000000000..d296a4b093c49 --- /dev/null +++ b/src/mame/dec/uvax3.cpp @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/******************************************************************************* + + Skeleton driver for DEC third-generation MicroVAX models ("Mayfair"). + +*******************************************************************************/ + +#include "emu.h" + +//#include "bus/dssi/dssi.h" +//#include "bus/qbus/qbus.h" +#include "cpu/vax/vax.h" +//#include "machine/am79c90.h" + +namespace { + +class uvax3_state : public driver_device +{ +public: + uvax3_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + { + } + + void mv3400(machine_config &config) ATTR_COLD; + +private: + void mem_map(address_map &map) ATTR_COLD; + + required_device m_maincpu; +}; + +void uvax3_state::mem_map(address_map &map) +{ + map(0x20040000, 0x2005ffff).mirror(0x20000).rom().region("firmware", 0); +} + +static INPUT_PORTS_START(mv3400) +INPUT_PORTS_END + +void uvax3_state::mv3400(machine_config &config) +{ + DC341(config, m_maincpu, 40_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &uvax3_state::mem_map); + + //AM7990(config, "lance", ?); +} + +ROM_START(mv3400) + ROM_REGION32_LE(0x20000, "firmware", 0) + ROM_LOAD16_BYTE("m7624_dec88_lm8914_152e7_d27512.bin", 0x00000, 0x10000, CRC(eb61f8d0) SHA1(17d56f59120881df2b6522097998b4a9e4bac77e)) + ROM_LOAD16_BYTE("m7624_dec88_lm8914_153e7_d27512.bin", 0x00001, 0x10000, CRC(6727bff2) SHA1(4f566e82a8fa8490056d62b3e44c070ba5ab1754)) +ROM_END + +ROM_START(mv3500) + ROM_REGION32_LE(0x20000, "firmware", 0) + ROM_LOAD16_BYTE("ka650-a-v5.3-vmb2.7_192e7.bin", 0x00000, 0x10000, CRC(a3ec59a6) SHA1(6d0121d7e232c841484a328340c828a4f0fdf903)) + ROM_LOAD16_BYTE("ka650-a-v5.3-vmb2.7_193e7.bin", 0x00001, 0x10000, CRC(873ee8bd) SHA1(b0abfebda60e9394e1045644634a8845b5573d04)) +ROM_END + +} // anonymous namespace + +COMP(1988, mv3400, 0, 0, mv3400, mv3400, uvax3_state, empty_init, "Digital Equipment Corporation", "MicroVAX 3400", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) +COMP(1988, mv3500, 0, 0, mv3400, mv3400, uvax3_state, empty_init, "Digital Equipment Corporation", "MicroVAX 3500", MACHINE_NOT_WORKING | MACHINE_NO_SOUND_HW) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index d5783fdc68d4a..3b5b3d3462967 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17488,6 +17488,16 @@ rainbow rainbow100a rainbow190 +@source:dec/uvax1.cpp +uvax1 + +@source:dec/uvax2.cpp +uvax2 + +@source:dec/uvax3.cpp +mv3400 +mv3500 + @source:dec/vax11.cpp vax785 From 631a761abab2a8dbdfc4d4c36187b465d5655004 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 9 Mar 2025 18:57:21 +0100 Subject: [PATCH 134/272] nec/pc88va_sgp.cpp: add RGB565 ROPs nec/pc88va_v.cpp: use DSA in draw_packed_gfx_4bpp, halve pitch for draw_direct_gfx_rgb565 hash/pc88va.xml: update QA, and use saner defaults where applicable --- hash/pc88va.xml | 111 +++++++++++++++++------------------- src/mame/nec/pc88va.h | 2 +- src/mame/nec/pc88va_sgp.cpp | 29 ++++++++-- src/mame/nec/pc88va_v.cpp | 22 ++++--- 4 files changed, 91 insertions(+), 73 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 817dcb0ef7e48..6bca5f5d7a2b2 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -90,8 +90,8 @@ Operating Systems 19?? NEC @@ -110,10 +110,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -128,10 +125,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 19?? NEC @@ -150,6 +144,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + @@ -175,6 +170,7 @@ Transition between 3rd and 4th sequences don't look right, [IDP] + @@ -196,8 +192,8 @@ Transition between 3rd and 4th sequences don't look right, [IDP] 1989 Music Network @@ -214,9 +210,13 @@ Has unsupported MIF-201 [MIDI] interface cfr. http://www.pc88.gr.jp/vafaq/view.p NEC + @@ -230,11 +230,10 @@ Untested directory NEC_SAMP (cannot type [keyboard] underscore char) 1988 NEC - + + @@ -290,7 +289,6 @@ Lists dual port 1/2 as a unsupported [DE-9] input method Winning newspaper screen has [OFX/OFY] bug How to exit from attract mode once you enter it? ]]> - @@ -349,7 +347,7 @@ Winning newspaper screen has [OFX/OFY] bug 198? スタークラフト (Starcraft) @@ -383,6 +381,7 @@ Currently conceals/wipes out [GVRAM] display + @@ -418,7 +417,7 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s 1987 ウインキーソフト (Winky Soft) 1987 ウインキーソフト (Winky Soft) @@ -524,9 +520,9 @@ Needs graphic [OFX/OFY] scroll 198? スタークラフト (Starcraft) + @@ -557,11 +553,11 @@ Burps on [FDC] access after disk swap with program and player disks, trying to s システムソフト (System Soft) + @@ -576,7 +572,7 @@ Winning animation is glitchy [OFX/OFY]?, uses [IDP] text transpen with upper bit 日本テレネット (Nihon Telenet) @@ -872,8 +868,7 @@ Has unemulated [MIDI] options 1990 マイクロキャビン (Micro Cabin) @@ -907,10 +902,8 @@ Optionally wants kana lock enabled for entering a name for new game [keyboard] i 1991 マイクロキャビン (Micro Cabin) @@ -947,29 +940,29 @@ Ugly pitch for [OPNA] voice samples on intro - + Abunai Tengu Densetsu 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -986,22 +979,23 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) + - + - + - + - + @@ -1018,22 +1012,22 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -1154,22 +1148,23 @@ Loads N88 BASIC then jumps to lalaland [FDC] 1989 アリスソフト (Alicesoft) - + - + - + - + @@ -1248,10 +1243,9 @@ All disks fail initial bootstrap [FDC] 1996 <doujin> @@ -1522,8 +1516,7 @@ https://youtu.be/zxy8lTZ_w_k 2023 Inufuto diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index 3d5bab0173370..d8a656d6b5760 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -264,7 +264,7 @@ class pc88va_state : public driver_device void draw_indexed_gfx_1bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u8 pal_base); void draw_indexed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); - void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); + void draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 fb_width, u16 fb_height); void draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height); void draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height); diff --git a/src/mame/nec/pc88va_sgp.cpp b/src/mame/nec/pc88va_sgp.cpp index 24e155361b2a6..b70860358a715 100644 --- a/src/mame/nec/pc88va_sgp.cpp +++ b/src/mame/nec/pc88va_sgp.cpp @@ -21,10 +21,10 @@ Unknown part number, used as GPU for PC88VA #include "emu.h" #include "pc88va_sgp.h" -//#include - #define LOG_COMMAND (1U << 1) +//#include + #define VERBOSE (LOG_GENERAL) //#define LOG_OUTPUT_STREAM std::cout @@ -420,9 +420,12 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) return; } - if (m_src.pixel_mode == 0 || m_src.pixel_mode == 3 || m_src.pixel_mode != m_dst.pixel_mode) + // TODO: pceva2tb:SKYBD.BAT wants a 1bpp to 4bpp translation + if (m_src.pixel_mode == 0 || m_src.pixel_mode != m_dst.pixel_mode) { - LOG("SGP: Warning BITBLT pixel mode %d x %d\n", m_src.pixel_mode, m_dst.pixel_mode); + static const char *const pixel_mode[] = { "1bpp", "4bpp", "8bpp", "rgb565" }; + + LOG("SGP: Warning BITBLT pixel mode src %s against dst %s\n", pixel_mode[m_src.pixel_mode], pixel_mode[m_dst.pixel_mode]); return; } @@ -472,6 +475,24 @@ void pc88va_sgp_device::execute_blit(u16 draw_mode, bool is_patblt) break; } + + // RGB565 (ballbrkr title) + case 3: + { + const u32 dst_offset = dst_address + ((xi + m_dst.start_dot) << 1); + + u16 src = m_data->read_word(src_address + (xi << 1)) & 0xffff; + u16 dst = m_data->read_word(dst_offset) & 0xffff; + u16 result = dst; + + if ((this->*tpmod_table[tp_mod])(src, dst)) + { + result = (this->*rop_table[logical_op])(src, dst); + m_data->write_word(dst_offset, result); + } + + break; + } } } } diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index 52c2b7ee878d8..e45c2745c62e7 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -4,8 +4,6 @@ #include "emu.h" #include "pc88va.h" -//#include - #define LOG_IDP (1U << 1) // TSP data #define LOG_FB (1U << 2) // framebuffer strips (verbose) @@ -14,6 +12,8 @@ #define LOG_COLOR (1U << 5) // current color mode #define LOG_TEXT (1U << 6) // text strips (verbose) +//#include + #define VERBOSE (LOG_GENERAL | LOG_IDP) //#define LOG_OUTPUT_STREAM std::cout @@ -29,11 +29,11 @@ void pc88va_state::video_start() { const u32 gvram_size = 0x40000; - m_gvram = std::make_unique(gvram_size); + m_gvram = make_unique_clear(gvram_size); std::fill_n(m_gvram.get(), gvram_size, 0); const u32 kanjiram_size = 0x4000; - m_kanji_ram = std::make_unique(kanjiram_size); + m_kanji_ram = make_unique_clear(kanjiram_size); m_gfxdecode->gfx(2)->set_source(m_kanji_ram.get()); m_gfxdecode->gfx(3)->set_source(m_kanji_ram.get()); m_vrtc_irq_line = 432; @@ -55,6 +55,7 @@ void pc88va_state::video_start() save_item(NAME(m_vrtc_irq_line)); } +// TODO: all needs to be verified void pc88va_state::video_reset() { m_gden0 = false; @@ -63,6 +64,7 @@ void pc88va_state::video_reset() m_color_mode = 0; m_pltm = 0; m_pltp = 0; + m_video_pri_reg[0] = m_video_pri_reg[1] = 0; } void pc88va_state::palette_init(palette_device &palette) const @@ -810,7 +812,7 @@ void pc88va_state::draw_graphic_layer(bitmap_rgb32 &bitmap, const rectangle &cli draw_packed_gfx_5bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, layer_pal_bank, fbw, fbl); } else - draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); + draw_direct_gfx_8bpp(m_graphic_bitmap[which], split_cliprect, fsa, dsa, fbw, fbl); break; case 3: draw_direct_gfx_rgb565(m_graphic_bitmap[which], split_cliprect, fsa, fbw, fbl); break; default: @@ -902,7 +904,7 @@ void pc88va_state::draw_packed_gfx_5bpp(bitmap_rgb32 &bitmap, const rectangle &c } } -void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u16 fb_width, u16 fb_height) +void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u16 fb_width, u16 fb_height) { // const u16 y_min = std::max(cliprect.min_y, y_start); // const u16 y_max = std::min(cliprect.max_y, y_min + fb_height); @@ -913,7 +915,7 @@ void pc88va_state::draw_direct_gfx_8bpp(bitmap_rgb32 &bitmap, const rectangle &c for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { - u32 bitmap_offset = line_offset + x; + u32 bitmap_offset = (line_offset + x) & 0x3ffff; uint32_t color = (m_gvram[bitmap_offset] & 0xff); @@ -937,7 +939,8 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle for(int y = cliprect.min_y; y <= cliprect.max_y; y++) { - const u32 line_offset = ((y * fb_width) + fb_start_offset) & 0x3ffff; + // pc88vad requires halved pitch for first screen + const u32 line_offset = ((y * fb_width >> 1) + fb_start_offset) & 0x3ffff; for(int x = cliprect.min_x; x <= cliprect.max_x; x++) { @@ -956,6 +959,7 @@ void pc88va_state::draw_direct_gfx_rgb565(bitmap_rgb32 &bitmap, const rectangle } } +// famista, probably all inufuto games void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &cliprect, u32 fb_start_offset, u32 display_start_offset, u8 pal_base, u16 fb_width, u16 fb_height) { // const u16 y_min = std::max(cliprect.min_y, y_start); @@ -968,7 +972,7 @@ void pc88va_state::draw_packed_gfx_4bpp(bitmap_rgb32 &bitmap, const rectangle &c for(int x = cliprect.min_x; x <= cliprect.max_x; x += 8) { u16 x_char = (x >> 3); - u32 bitmap_offset = line_offset + x_char; + u32 bitmap_offset = (line_offset + x_char + (display_start_offset >> 2)) & 0x0ffff; for (int xi = 0; xi < 8; xi ++) { From 1693281bbfd4e07a1b4c0172d6484225511c7cff Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 9 Mar 2025 20:04:54 +0100 Subject: [PATCH 135/272] pci/virge_pci.cpp: add virgevx_pci stub --- src/devices/bus/pci/pci_slot.cpp | 1 + src/devices/bus/pci/virge_pci.cpp | 80 +++++++++++++++++++++++++++---- src/devices/bus/pci/virge_pci.h | 22 +++++++++ src/devices/video/s3virge.cpp | 29 +++++++++++ src/devices/video/s3virge.h | 18 ++++++- src/mame/pc/przone.cpp | 2 +- 6 files changed, 141 insertions(+), 11 deletions(-) diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp index 238e61be49c9c..ae9d42afc63e0 100644 --- a/src/devices/bus/pci/pci_slot.cpp +++ b/src/devices/bus/pci/pci_slot.cpp @@ -128,6 +128,7 @@ void pci_cards(device_slot_interface &device) device.option_add("vision968", VISION968_PCI); device.option_add("virge", VIRGE_PCI); device.option_add("virgedx", VIRGEDX_PCI); + device.option_add("virgevx", VIRGEVX_PCI); device.option_add("mga2064w", MGA2064W); device.option_add("promotion3210", PROMOTION3210); device.option_add("gd5446", GD5446_PCI); diff --git a/src/devices/bus/pci/virge_pci.cpp b/src/devices/bus/pci/virge_pci.cpp index 26fde9cb6c979..9e7a012b62b21 100644 --- a/src/devices/bus/pci/virge_pci.cpp +++ b/src/devices/bus/pci/virge_pci.cpp @@ -7,6 +7,11 @@ #include "screen.h" +DEFINE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device, "virge_pci", "S3 86C325 ViRGE") +DEFINE_DEVICE_TYPE(VIRGEVX_PCI, virgevx_pci_device, "virgevx_pci", "S3 86C988 ViRGE/VX") +DEFINE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device, "virgedx_pci", "S3 86C375 ViRGE/DX") +//VIRGEGX_PCI, /DX with SGRAM/SDRAM support + virge_pci_device::virge_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : virge_pci_device(mconfig, VIRGE_PCI, tag, owner, clock) { @@ -20,6 +25,11 @@ virge_pci_device::virge_pci_device(const machine_config &mconfig, device_type ty { } +virgevx_pci_device::virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : virge_pci_device(mconfig, VIRGEVX_PCI, tag, owner, clock) +{ +} + virgedx_pci_device::virgedx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : virge_pci_device(mconfig, VIRGEDX_PCI, tag, owner, clock) { @@ -173,6 +183,27 @@ void virge_pci_device::device_start() machine().save().register_postload(save_prepost_delegate(FUNC(virge_pci_device::postload), this)); } +void virgevx_pci_device::device_start() +{ + set_ids(0x5333883d, 0x00, 0x030000, 0x000000); + pci_card_device::device_start(); + + add_rom(m_bios->base(),0x8000); + expansion_rom_base = 0xc0000; + + add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(virgevx_pci_device::lfb_map)); + set_map_address(0, 0x70000000); + + command = 0x0000; + // DAC SNP / BME / MEM / I/O + command_mask = 0x27; + // medium DEVSELB + status = 0x0200; + + remap_cb(); + machine().save().register_postload(save_prepost_delegate(FUNC(virgevx_pci_device::postload), this)); +} + void virgedx_pci_device::device_start() { set_ids(0x53338a01, 0x00, 0x030000, 0x000000); @@ -184,6 +215,12 @@ void virgedx_pci_device::device_start() add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(virge_pci_device::lfb_map)); set_map_address(0, 0x70000000); + command = 0x0000; + // DAC SNP / BME / MEM / I/O + command_mask = 0x27; + // medium DEVSELB + status = 0x0200; + remap_cb(); machine().save().register_postload(save_prepost_delegate(FUNC(virgedx_pci_device::postload), this)); } @@ -222,6 +259,19 @@ void virge_pci_device::device_add_mconfig(machine_config &config) m_vga->linear_config_changed().set(FUNC(virge_pci_device::linear_config_changed_w)); } +void virgevx_pci_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); + screen.set_screen_update("vga", FUNC(s3virge_vga_device::screen_update)); + + S3VIRGEVX(config, m_vga, 0); + m_vga->set_screen("screen"); + // 2MB, 4MB and 8MB, EDO RAM + m_vga->set_vram_size(0x400000); + m_vga->linear_config_changed().set(FUNC(virgevx_pci_device::linear_config_changed_w)); +} + void virgedx_pci_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -247,6 +297,27 @@ ROM_START( virge_pci ) ROM_IGNORE( 0x8000 ) ROM_END +const tiny_rom_entry *virge_pci_device::device_rom_region() const +{ + return ROM_NAME( virge_pci ); +} + +ROM_START( virgevx_pci ) + ROM_REGION(0x8000,"bios", 0) + ROM_DEFAULT_BIOS("dms3d3k") + + // Vlask dump + // v2.xx BIOSes known to exist + ROM_SYSTEM_BIOS( 0, "dms3d3k", "Diamond Stealth 3D 3000 HQ v1.00" ) + ROMX_LOAD("diamondstealth3000.vbi", 0x0000, 0x8000, CRC(c2423896) SHA1(fdab43f15da1d66bca286583f9da86873f3e22de), ROM_BIOS(0) ) +ROM_END + +const tiny_rom_entry *virgevx_pci_device::device_rom_region() const +{ + return ROM_NAME( virgevx_pci ); +} + + ROM_START( virgedx_pci ) ROM_REGION(0x8000,"bios", 0) ROM_DEFAULT_BIOS("virgedx") @@ -258,16 +329,7 @@ ROM_START( virgedx_pci ) ROMX_LOAD("virgedxdiamond.bin", 0x00000, 0x8000, CRC(58b0dcda) SHA1(b13ae6b04db6fc05a76d924ddf2efe150b823029), ROM_BIOS(1) ) ROM_END -const tiny_rom_entry *virge_pci_device::device_rom_region() const -{ - return ROM_NAME( virge_pci ); -} - const tiny_rom_entry *virgedx_pci_device::device_rom_region() const { return ROM_NAME( virgedx_pci ); } - -DEFINE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device, "virge_pci", "S3 86C325 ViRGE") -DEFINE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device, "virgedx_pci", "S3 86C375 ViRGE/DX") -//VIRGEGX_PCI, /DX with SGRAM/SDRAM support diff --git a/src/devices/bus/pci/virge_pci.h b/src/devices/bus/pci/virge_pci.h index 4ddc836f7079d..30e7c348c7e62 100644 --- a/src/devices/bus/pci/virge_pci.h +++ b/src/devices/bus/pci/virge_pci.h @@ -66,6 +66,27 @@ class virge_pci_device : public pci_card_device u32 get_vga_linear_address(); }; +class virgevx_pci_device : public virge_pci_device +{ +public: + template + virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag) + : virgevx_pci_device(mconfig, tag, owner, clock) + { + set_screen_tag(std::forward(screen_tag)); + } + virgevx_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_start() override ATTR_COLD; + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; + +// required_device m_vga; +// required_memory_region m_bios; +// optional_device m_screen; +}; + class virgedx_pci_device : public virge_pci_device { public: @@ -88,6 +109,7 @@ class virgedx_pci_device : public virge_pci_device }; DECLARE_DEVICE_TYPE(VIRGE_PCI, virge_pci_device) +DECLARE_DEVICE_TYPE(VIRGEVX_PCI, virgevx_pci_device) DECLARE_DEVICE_TYPE(VIRGEDX_PCI, virgedx_pci_device) #endif diff --git a/src/devices/video/s3virge.cpp b/src/devices/video/s3virge.cpp index f6c98153c0a0d..d7aeb0a2a1418 100644 --- a/src/devices/video/s3virge.cpp +++ b/src/devices/video/s3virge.cpp @@ -21,6 +21,7 @@ * - Fix PLL calculation for 1k+ width VESA modes (tends to either be too fast or too slow); * - 1600x1200x4 needs line compare fix in downstream pc_vga (cuts too early); * - 1280x1024x16 draws 256 H and stupid high refresh rate; + * - virgevx: stub, uses a beefier RAMDAC (can do up to 1600x1200x16 / 1280x1024x24) * * Notes: * - Most Windows s3dsdk demos starts in software render (at least with win98se base S3 drivers, @@ -58,6 +59,7 @@ #define CRTC_PORT_ADDR ((vga.miscellaneous_output & 1) ? 0x3d0 : 0x3b0) DEFINE_DEVICE_TYPE(S3VIRGE, s3virge_vga_device, "virge_vga", "S3 86C325 VGA core") +DEFINE_DEVICE_TYPE(S3VIRGEVX, s3virgevx_vga_device, "virgevx_vga", "S3 86C988 VGA core") DEFINE_DEVICE_TYPE(S3VIRGEDX, s3virgedx_vga_device, "virgedx_vga", "S3 86C375 VGA core") DEFINE_DEVICE_TYPE(S3VIRGEDX1, s3virgedx_rev1_vga_device, "virgedx_vga_r1", "S3 86C375 (rev 1) VGA core") @@ -74,6 +76,13 @@ s3virge_vga_device::s3virge_vga_device(const machine_config &mconfig, device_typ { } +s3virgevx_vga_device::s3virgevx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3virge_vga_device(mconfig, S3VIRGEVX, tag, owner, clock) +{ + m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgevx_vga_device::crtc_map), this)); + m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3virgevx_vga_device::sequencer_map), this)); +} + s3virgedx_vga_device::s3virgedx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : s3virgedx_vga_device(mconfig, S3VIRGEDX, tag, owner, clock) { @@ -139,6 +148,17 @@ void s3virge_vga_device::device_start() s3.id_cr30 = 0xe1; // CR30 } +void s3virgevx_vga_device::device_start() +{ + s3virge_vga_device::device_start(); + + // set device ID + s3.id_high = 0x88; // CR2D + s3.id_low = 0x3d; // CR2E + s3.revision = 0x00; // CR2F (value unknown) + s3.id_cr30 = 0xe1; // CR30 +} + void s3virgedx_vga_device::device_start() { s3virge_vga_device::device_start(); @@ -190,6 +210,13 @@ void s3virge_vga_device::device_reset() s3d_reset(); } +void s3virgevx_vga_device::device_reset() +{ + s3virge_vga_device::device_reset(); + // TODO: unverified + s3.strapping = 0x000f0912; +} + void s3virgedx_vga_device::device_reset() { s3virge_vga_device::device_reset(); @@ -430,6 +457,8 @@ void s3virge_vga_device::s3_define_video_mode() svga.rgb16_en = 0; svga.rgb24_en = 0; svga.rgb32_en = 0; + // TODO: virgevx has upgraded RAMDAC + // (overhauls color modes for accomodating 1600x1200 resolutions) switch((s3.ext_misc_ctrl_2) >> 4) { case 0x01: svga.rgb8_en = 1; break; diff --git a/src/devices/video/s3virge.h b/src/devices/video/s3virge.h index aafc74a11b8f5..0e97395d19ee2 100644 --- a/src/devices/video/s3virge.h +++ b/src/devices/video/s3virge.h @@ -195,6 +195,21 @@ class s3virge_vga_device : public s3trio64_vga_device }; +// ======================> s3virgevx_vga_device + +class s3virgevx_vga_device : public s3virge_vga_device +{ +public: + s3virgevx_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: +// s3virgevx_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + + virtual void device_start() override ATTR_COLD; + virtual void device_reset() override ATTR_COLD; +}; + + // ======================> s3virgedx_vga_device class s3virgedx_vga_device : public s3virge_vga_device @@ -211,7 +226,7 @@ class s3virgedx_vga_device : public s3virge_vga_device virtual void device_reset() override ATTR_COLD; }; -// ======================> s3virgedx_vga_device +// ======================> s3virgedx_rev1_vga_device class s3virgedx_rev1_vga_device : public s3virgedx_vga_device { @@ -227,6 +242,7 @@ class s3virgedx_rev1_vga_device : public s3virgedx_vga_device // device type definition DECLARE_DEVICE_TYPE(S3VIRGE, s3virge_vga_device) +DECLARE_DEVICE_TYPE(S3VIRGEVX, s3virgevx_vga_device) DECLARE_DEVICE_TYPE(S3VIRGEDX, s3virgedx_vga_device) DECLARE_DEVICE_TYPE(S3VIRGEDX1, s3virgedx_rev1_vga_device) diff --git a/src/mame/pc/przone.cpp b/src/mame/pc/przone.cpp index 0faed06ed985f..20a8652c5da6e 100644 --- a/src/mame/pc/przone.cpp +++ b/src/mame/pc/przone.cpp @@ -273,7 +273,7 @@ void przone_state::przone(machine_config &config) PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr); PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr); PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr); - // TODO: virgevx + // TODO: has a stroke with virgevx PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "virge"); ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", smc_superio_config); From b6f78b1aedc9b56be17164ebbed010465c5a2205 Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 9 Mar 2025 20:14:23 +0100 Subject: [PATCH 136/272] hash/pc88va.xml: fix validation --- hash/pc88va.xml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index 6bca5f5d7a2b2..dd55821146b9b 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -144,8 +144,9 @@ Transition between 3rd and 4th sequences don't look right, [IDP] - + + @@ -216,8 +217,9 @@ PLAYR.BAT has offset [IDP] text display SKYBD.BAT wants a radio cassette player and a PC-KD861 color monitor for audio sampling thru OPNA EOS VIDEO.BAT has various superimpose effects, requires dedicated board ]]> - + + @@ -233,6 +235,7 @@ VIDEO.BAT has various superimpose effects, requires dedicated board (same as pceva2tb) ]]> + @@ -381,8 +384,9 @@ Needs [IDP] text display to go off for bottommost row - + + @@ -522,8 +526,8 @@ Needs graphic [OFX/OFY] scroll - + @@ -557,8 +561,9 @@ May crash with disk error when entering winning animation (verify) Winning animation is glitchy [OFX/OFY]?, uses [IDP] text transpen with upper bits set (for flame effect?), press mouse left button to return to game [OPNA] seems to cut off shortly on intro and winning screen compared to VAEG ]]> - + + From 2f4ca0631f25d0f07847e4372973285a75d412f8 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 9 Mar 2025 15:46:50 -0400 Subject: [PATCH 137/272] scripts/src/cpu.lua: Update comment --- scripts/src/cpu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua index b69f860f813ac..e6132846646b4 100644 --- a/scripts/src/cpu.lua +++ b/scripts/src/cpu.lua @@ -3742,7 +3742,7 @@ if opt_tool(CPUS, "DSP56000") then end -------------------------------------------------- --- DEC VAX, disassembler only +-- DEC VAX --@src/devices/cpu/vax/vax.h,CPUS["VAX"] = true -------------------------------------------------- From d044fa878dd377d4026555eac7d256c69c426dd0 Mon Sep 17 00:00:00 2001 From: Roberto Fresca Date: Mon, 10 Mar 2025 02:08:14 +0100 Subject: [PATCH 138/272] magicfly driver improvements: [Roberto Fresca, Grull Osgo] - Bonne Chance chars and tiles both 3bpp. - New TILE_GET_INFO and video start for Bonne Chance. - Reworked the Bonne Chance and 7mezzo color palette. --- src/mame/misc/magicfly.cpp | 138 +++++++++++++++++++++++++++++-------- 1 file changed, 111 insertions(+), 27 deletions(-) diff --git a/src/mame/misc/magicfly.cpp b/src/mame/misc/magicfly.cpp index 34ecea80b6b9f..9a432c1a92d14 100644 --- a/src/mame/misc/magicfly.cpp +++ b/src/mame/misc/magicfly.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Roberto Fresca +// copyright-holders: Roberto Fresca // thanks-to:Iris Falbala, Rob Ragon /****************************************************************************** @@ -429,12 +429,16 @@ - Added proper palette. Now the game seems to get accurate colors. - Added some notes. + [2025-03-10] + - Bonne Chance chars and tiles both 3bpp. + - New TILE_GET_INFO and video start for Bonne Chance. + - Reworked the Bonne Chance and 7mezzo color palette. + TODO: - Figure out how the palette is generated, to avoid a custom palette. - - Fix the color issues in Bonne Chance (color codes 00 & 08 for the - cards corners numbers). + - Find a board to investigate if the chars GFX are 1bpp or 3bpp. *******************************************************************************/ @@ -466,12 +470,14 @@ class magicfly_state : public driver_device m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), m_dac(*this, "dac"), - m_gfxdecode(*this, "gfxdecode") + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } - void bchance(machine_config &config); void magicfly(machine_config &config); void _7mezzo(machine_config &config); + void bchance(machine_config &config); protected: virtual void video_start() override ATTR_COLD; @@ -484,6 +490,7 @@ class magicfly_state : public driver_device required_device m_maincpu; required_device m_dac; required_device m_gfxdecode; + required_device m_palette; void magicfly_videoram_w(offs_t offset, uint8_t data); void magicfly_colorram_w(offs_t offset, uint8_t data); @@ -491,9 +498,12 @@ class magicfly_state : public driver_device void mux_port_w(uint8_t data); TILE_GET_INFO_MEMBER(get_magicfly_tile_info); TILE_GET_INFO_MEMBER(get_7mezzo_tile_info); + TILE_GET_INFO_MEMBER(get_bchance_tile_info); void magicfly_palette(palette_device &palette) const; + void _7mezzo_palette(palette_device &palette) const; void bchance_palette(palette_device &palette) const; DECLARE_VIDEO_START(7mezzo); + DECLARE_VIDEO_START(bchance); uint32_t screen_update_magicfly(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void magicfly_map(address_map &map) ATTR_COLD; }; @@ -531,7 +541,7 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_magicfly_tile_info) int attr = m_colorram[tile_index]; int code = m_videoram[tile_index]; int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks - int color = attr & 0x07; // bits 0-2 for color + int color = attr & 0x0f; // bits 0-2 for color // Seems that bit 7 is mirrored from bit 3 to have a normal boot // Boot only check the first color RAM offset @@ -559,10 +569,10 @@ TILE_GET_INFO_MEMBER(magicfly_state::get_7mezzo_tile_info) x--- ---- Mirrored from bit 2. The code check this one to boot the game. */ - int const attr = m_colorram[tile_index]; - int const code = m_videoram[tile_index]; - int const bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks - int const color = attr & 0x07; // bits 0-2 for color + int attr = m_colorram[tile_index]; + int code = m_videoram[tile_index]; + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x07; // bits 0-2 for color // Seems that bit 7 is mirrored from bit 2 to have a normal boot // Boot only check the first color RAM offset @@ -579,6 +589,37 @@ VIDEO_START_MEMBER(magicfly_state, 7mezzo) } +TILE_GET_INFO_MEMBER(magicfly_state::get_bchance_tile_info) +{ +/* - bits - + 7654 3210 + ---- xxxx Tiles color. + ---x ---- Tiles bank. + -xx- ---- Apparently not used. + x--- ---- Mirrored from bit 3. The code check this one to boot the game. + +*/ + int attr = m_colorram[tile_index]; + int code = ((attr & 1) << 8) | m_videoram[tile_index]; + + int bank = (attr & 0x10) >> 4; // bit 4 switch the gfx banks + int color = attr & 0x0f; // bits 0-3 for color + + // Seems that bit 7 is mirrored from bit 3 to have a normal boot + // Boot only check the first color RAM offset + + m_colorram[0] = m_colorram[0] | ((m_colorram[0] & 0x08) << 4); // only for 1st offset + //m_colorram[tile_index] = attr | ((attr & 0x08) << 4); // for the whole color RAM + + tileinfo.set(bank, code, color, 0); +} + +VIDEO_START_MEMBER(magicfly_state, bchance) +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(magicfly_state::get_bchance_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 29); +} + + uint32_t magicfly_state::screen_update_magicfly(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); @@ -599,16 +640,16 @@ void magicfly_state::magicfly_palette(palette_device &palette) const palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); // yellow in 7mezzo. palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); // red in 7mezzo. palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); } -void magicfly_state::bchance_palette(palette_device &palette) const +void magicfly_state::_7mezzo_palette(palette_device &palette) const { // 1st gfx bank palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); @@ -621,19 +662,42 @@ void magicfly_state::bchance_palette(palette_device &palette) const palette.set_pen_color(14, rgb_t(0x00, 0x00, 0x00)); palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); - palette.set_pen_color(3, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(3, rgb_t(0xff, 0xff, 0x00)); // red in magicfly palette.set_pen_color(5, rgb_t(0x00, 0xff, 0x00)); - palette.set_pen_color(7, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(7, rgb_t(0xff, 0x00, 0x00)); // yellow in magicfly palette.set_pen_color(9, rgb_t(0x00, 0x00, 0xff)); palette.set_pen_color(11, rgb_t(0xff, 0x00, 0xff)); palette.set_pen_color(13, rgb_t(0x00, 0xff, 0xff)); palette.set_pen_color(15, rgb_t(0xff, 0xff, 0xff)); +} - palette.set_pen_color(0x08 , rgb_t(0xff, 0xff, 0xff)); // white for the cards back logo background. - palette.set_pen_color(0x12 , rgb_t(0x00, 0x00, 0x00)); // black for the cards corners (should be transparent) +void magicfly_state::bchance_palette(palette_device &palette) const +{ + palette.set_pen_color(0*8 + 1, rgb_t(0x00, 0x00, 0x00)); + palette.set_pen_color(1*8 + 1, rgb_t(0xff, 0x00, 0x00)); + palette.set_pen_color(3*8 + 1, rgb_t(0xff, 0xff, 0x00)); + palette.set_pen_color(4*8 + 0, rgb_t(0xff, 0xff, 0xff)); //back card bg (white) + palette.set_pen_color(4*8 + 1, rgb_t(0x00, 0x00, 0xff)); //back card fg (blue) + palette.set_pen_color(5*8 + 1, rgb_t(0xff, 0x00, 0xff)); + palette.set_pen_color(6*8 + 1, rgb_t(0x00, 0xff, 0xff)); + palette.set_pen_color(7*8 + 1, rgb_t(0xff, 0xff, 0xff)); + palette.set_pen_color(0xa*8 + 1, rgb_t(0x00, 0xff, 0x00)); // credits (green) + palette.set_pen_color(0xb*8 + 1, rgb_t(0xff, 0xff, 0x00)); // odds + bet (yell) + palette.set_pen_color(0xd*8 + 1, rgb_t(0xff, 0x00, 0xff)); // push deal (mag) + palette.set_pen_color(0xe*8 + 1, rgb_t(0x00, 0xff, 0xff)); // big good luck (cyan) + palette.set_pen_color(0xf*8 + 1, rgb_t(0xff, 0xff, 0xff)); // odds (white) + + // color code 7 all black + for(int i=0; i < 0x8; i++) + { + palette.set_pen_color(7*8 + i, rgb_t(0x00, 0x00, 0x00)); + } -// Bonne Chance cards are using color code 08. For red cards this code is accurate. -// But when cards are black, the numbers at the corners use color code 00 (that should turn them black) + // all code+2 colors black (corners) + for(int i=0; i < 0x10; i++) + { + palette.set_pen_color(i*8 + 2, rgb_t(0x00, 0x00, 0x00)); + } } @@ -911,7 +975,7 @@ static const gfx_layout tilelayout = 8*8 }; -static const gfx_layout charlayout = +static const gfx_layout charlayout_1bpp = { 8, 8, RGN_FRAC(1,1), @@ -922,14 +986,30 @@ static const gfx_layout charlayout = 8*8 }; +static const gfx_layout charlayout_3bpp = +{ + 8, 8, + RGN_FRAC(1,3), + 3, + { 0, RGN_FRAC(1,3), RGN_FRAC(2,3) }, + { 0, 1, 2, 3, 4, 5, 6, 7 }, + { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, + 8*8 +}; + /************************************************** * Graphics Decode Information * **************************************************/ static GFXDECODE_START( gfx_magicfly ) - GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 16, 1 ) - GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout, 0, 8 ) + GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 16, 1 ) + GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout_1bpp, 0, 8 ) +GFXDECODE_END + +static GFXDECODE_START( gfx_bchance ) + GFXDECODE_ENTRY( "gfxbnk1", 0, tilelayout, 0, 16 ) + GFXDECODE_ENTRY( "gfxbnk0", 0, charlayout_3bpp, 0, 16 ) GFXDECODE_END @@ -974,6 +1054,7 @@ void magicfly_state::_7mezzo(machine_config &config) // video hardware MCFG_VIDEO_START_OVERRIDE(magicfly_state, 7mezzo) + PALETTE(config.replace(), "palette", FUNC(magicfly_state::_7mezzo_palette), 32); } @@ -981,8 +1062,10 @@ void magicfly_state::bchance(machine_config &config) { magicfly(config); - // video hardware - subdevice("palette")->set_init(FUNC(magicfly_state::bchance_palette)); + MCFG_VIDEO_START_OVERRIDE(magicfly_state, bchance) + + GFXDECODE(config.replace(), m_gfxdecode, "palette", gfx_bchance); + PALETTE(config.replace(), "palette", FUNC(magicfly_state::bchance_palette), 128); } @@ -1041,8 +1124,9 @@ ROM_START( bchance ) ROM_LOAD( "n-pk-1.bin", 0x2000, 0x2000, CRC(e35cebd6) SHA1(b0dd86fd4c06f98e486b04e09808985bfa4f0e9c) ) ROM_LOAD( "n-pk-0.bin", 0x4000, 0x2000, CRC(3c64edc4) SHA1(97b677b7c4999b502ab4b4f70c33b40050843796) ) - ROM_REGION( 0x0800, "gfxbnk0", 0 ) - ROM_COPY( "gfx", 0x1800, 0x0000, 0x0800 ) // chars + ROM_REGION( 0x1800, "gfxbnk0", 0 ) + ROM_FILL( 0x0000, 0x1000, 0x00 ) // filling the R-G bitplanes. + ROM_COPY( "gfx", 0x1800, 0x1000, 0x0800 ) // chars ROM_REGION( 0x1800, "gfxbnk1", 0 ) ROM_COPY( "gfx", 0x1000, 0x0000, 0x0800 ) // 3bpp tiles, bitplane 1 @@ -1063,4 +1147,4 @@ ROM_END // YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS GAME( 198?, magicfly, 0, magicfly, magicfly, magicfly_state, empty_init, ROT0, "P&A Games", "Magic Fly", 0 ) GAME( 198?, 7mezzo, 0, _7mezzo, 7mezzo, magicfly_state, empty_init, ROT0, "", "7 e Mezzo", 0 ) -GAME( 198?, bchance, 0, bchance, bchance, magicfly_state, empty_init, ROT0, "", "Bonne Chance! (French/English)", MACHINE_IMPERFECT_GRAPHICS ) +GAME( 198?, bchance, 0, bchance, bchance, magicfly_state, empty_init, ROT0, "", "Bonne Chance! (French/English)", 0 ) From 6b3856b0e5c6a477294e49a37498e08293a042cf Mon Sep 17 00:00:00 2001 From: AJR Date: Mon, 10 Mar 2025 08:53:44 -0400 Subject: [PATCH 139/272] skeleton/vgame.cpp: Tentatively change CPU type to ARM7 --- src/mame/skeleton/vgame.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index e6d25a8e91d09..e2c558f2745eb 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -13,13 +13,13 @@ LY62256SL SRAM (near VGAME-007) U6295 sound chip 2 banks of 8 DIP switches -TODO: everything. CPU core isn't identified and code is encrypted. Possibly internal ROM? +TODO: everything. CPU core is only tentatively identified and code is encrypted. Possibly internal ROM? */ #include "emu.h" -#include "cpu/m68000/m68000.h" +#include "cpu/arm7/arm7.h" #include "sound/okim6295.h" #include "emupal.h" @@ -130,7 +130,7 @@ GFXDECODE_END void vgame_state::vgame(machine_config &config) { - M68000(config, m_maincpu, 44_MHz_XTAL); // CPU core and divider unknown + ARM7(config, m_maincpu, 44_MHz_XTAL); // CPU core and divider unknown; ROMs seem to contain at least some ARM or Thumb code m_maincpu->set_addrmap(AS_PROGRAM, &vgame_state::program_map); // m_maincpu->set_vblank_int("screen", FUNC(vgame_state::irq0_line_hold)); @@ -153,7 +153,7 @@ void vgame_state::vgame(machine_config &config) // VGAME-0030-02-AI PCB ROM_START( hilice ) ROM_REGION( 0x200000, "maincpu", ROMREGION_ERASE00 ) - ROM_LOAD16_WORD_SWAP( "hi_lice_v102fa.u13", 0x000000, 0x100000, BAD_DUMP CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) // probably read as wrong ROM type + ROM_LOAD( "hi_lice_v102fa.u13", 0x000000, 0x100000, BAD_DUMP CRC(4da87481) SHA1(5a20b254cfe8a2f087faa0dd17f682218a2ca1b2) ) // probably read as wrong ROM type ROM_CONTINUE( 0x000000, 0x100000 ) ROM_REGION( 0x400000, "gfx", 0 ) @@ -168,7 +168,7 @@ ROM_END // while all labels have 麻將學園 (Mahjong School) prepended to what's below, title screen shows 麻將學園 2 - Mahjong School 2 ROM_START( mjxy2 ) ROM_REGION( 0x200000, "maincpu", 0 ) // dumped as EV29LV160 (same rare ROM as some IGS titles) - ROM_LOAD16_WORD_SWAP( "u12_v108tw.u12", 0x000000, 0x200000, CRC(a6d99849) SHA1(c280635517d5ffded524e15048568817bd927bf9) ) + ROM_LOAD( "u12_v108tw.u12", 0x000000, 0x200000, CRC(a6d99849) SHA1(c280635517d5ffded524e15048568817bd927bf9) ) ROM_REGION( 0x400000, "gfx", 0 ) // dumped as EV29LV160 (same rare ROM as some IGS titles) ROM_LOAD16_BYTE( "u3_cg_v105.u3", 0x000000, 0x200000, CRC(fda38fb1) SHA1(7bd744e42f619254ebad2fb60f3851f61073fe8c) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -180,7 +180,7 @@ ROM_END ROM_START( cjdn ) // Oct 1 2008 15:58:54 string in ROM ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "v305cn.u8", 0x000000, 0x200000, CRC(bffb20c0) SHA1(bf2293bfc4711d0b930c491f579418d5e7c0800f) ) + ROM_LOAD( "v305cn.u8", 0x000000, 0x200000, CRC(bffb20c0) SHA1(bf2293bfc4711d0b930c491f579418d5e7c0800f) ) ROM_REGION( 0x400000, "gfx", 0 ) ROM_LOAD( "gfx_flashrom", 0x000000, 0x400000, CRC(4018790e) SHA1(2b292d4cbfa5d7c3129a7e0c8012bde519e85ef1) ) // FIXED BITS (xxxxxxxx0xxxxxxx) @@ -191,7 +191,7 @@ ROM_END ROM_START( cjsjh ) // Nov 2 2007 16:05:26 string in ROM ROM_REGION( 0x200000, "maincpu", 0 ) - ROM_LOAD16_WORD_SWAP( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable + ROM_LOAD( "vxxxcn.u8", 0x000000, 0x200000, CRC(911d8dce) SHA1(1d9386c4a9e118d02b5b29f9e9ce90ef1d6f419f) ) // label not readable ROM_REGION( 0x400000, "gfx", 0 ) ROM_LOAD( "gfx.u2", 0x000000, 0x400000, CRC(e2964db3) SHA1(21e021c88136083445b430c618a8eb74e2147d4f ) ) // FIXED BITS (xxxxxxxx0xxxxxxx) From 19a2529f56a1e1cf7b6e35ec41c85298997de4e6 Mon Sep 17 00:00:00 2001 From: Adam Billyard <41291895+Elektraglide@users.noreply.github.com> Date: Mon, 10 Mar 2025 14:58:43 +0100 Subject: [PATCH 140/272] am9513.cpp: more logging for LOG_MODE and LOG_TC (#13406) --- src/devices/machine/am9513.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/devices/machine/am9513.cpp b/src/devices/machine/am9513.cpp index 4f168c7f23123..83b5d11de769d 100644 --- a/src/devices/machine/am9513.cpp +++ b/src/devices/machine/am9513.cpp @@ -448,7 +448,7 @@ void am9513_device::set_counter_mode(int c, u16 data) } if ((data & 0x0018) != (m_counter_mode[c] & 0x0018)) - LOGMASKED(LOG_MODE, "Counter %d: %s %s count\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down"); + LOGMASKED(LOG_MODE, "Counter %d: %s %s count %s\n", c + 1, BIT(data, 4) ? "BCD" : "Binary", BIT(data, 3) ? "up" : "down", BIT(data, 5) ? "repetitively" : "once"); if ((data & 0x0007) != (m_counter_mode[c] & 0x0007)) { @@ -620,8 +620,13 @@ void am9513_device::set_tc(int c, bool state) // TC cascading if ((m_counter_mode[d] & 0x1f00) == (state ? 0x0000 : 0x1000)) + { + LOGMASKED(LOG_TC, "Counter %d: TC cascade Next Count %u \n", c + 1, m_count[d]); + count_edge(d); + } + // TC gating if ((m_counter_mode[d] & 0xe000) == 0x2000) gate_count(d, state && (bus_is_16_bit() || m_gate_alt[d])); @@ -1238,7 +1243,10 @@ void am9513_device::command_write(u8 data) if (BIT(data, 6)) step_counter(c, true); if (BIT(data, 5)) + { + LOGMASKED(LOG_MODE, "Arm Counter %d\n", c + 1); arm_counter(c); + } } } break; @@ -1251,9 +1259,15 @@ void am9513_device::command_write(u8 data) if (BIT(data, c)) { if (!BIT(data, 5)) + { + LOGMASKED(LOG_MODE, "Disarm Counter %d\n", c + 1); disarm_counter(c); + } if (!BIT(data, 6)) + { + LOGMASKED(LOG_MODE, "Save Counter %d\n", c + 1); save_counter(c); + } } } break; @@ -1270,6 +1284,7 @@ void am9513_device::command_write(u8 data) case 0xe3: case 0xeb: // Clear/set toggle out for counter 3 case 0xe4: case 0xec: // Clear/set toggle out for counter 4 case 0xe5: case 0xed: // Clear/set toggle out for counter 5 + LOGMASKED(LOG_MODE, "Counter %d: %s output\n", data & 7, BIT(data, 3) ? "Set" : "Clear"); set_toggle((data & 7) - 1, BIT(data, 3)); break; case 0xe6: case 0xee: // Clear/set MM12 (FOUT gate on/FOUT gate off) @@ -1277,6 +1292,7 @@ void am9513_device::command_write(u8 data) m_mmr = ((m_mmr & ~(1 << 12)) | BIT(data, 3) << 12); break; case 0xe7: case 0xef: // Clear/set MM13 (8-bit bus/16-bit bus) + LOGMASKED(LOG_MODE, "Data Bus Width = %d-Bit\n", BIT(data, 3) ? 16 : 8); m_mmr = ((m_mmr & ~(1 << 13)) | BIT(data, 3) << 13); break; case 0xf1: // Step counter 1 @@ -1284,6 +1300,7 @@ void am9513_device::command_write(u8 data) case 0xf3: // Step counter 3 case 0xf4: // Step counter 4 case 0xf5: // Step counter 5 + LOGMASKED(LOG_MODE, "Counter %d: Step\n", data & 7); step_counter((data & 7) - 1, false); break; case 0xff: // Master reset From 67a8ba074c870670f73738b8b5ddc3c2125050f6 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 10 Mar 2025 18:15:19 +0100 Subject: [PATCH 141/272] New systems marked not working ------------------------------ Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V302CN) [dyq, little0, Guru] Chaoji Dou Dizhu Jiaqiang Ban (S300CN) / unknown second game [little0] New clones marked not working ----------------------------- Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V405CN) [dyq, little0, Guru] --- src/mame/igs/igs_m027.cpp | 162 ++++++++++++++++++++++++++++++++++++ src/mame/mame.lst | 3 + src/mame/skeleton/vgame.cpp | 2 + 3 files changed, 167 insertions(+) diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index 6997c01e860f3..a9ebfd21697fd 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -163,6 +163,8 @@ class igs_m027_state : public driver_device void init_gonefsh2() ATTR_COLD; void init_cjddz() ATTR_COLD; void init_cjddzp() ATTR_COLD; + void init_cjddzs() ATTR_COLD; + void init_cjddzps() ATTR_COLD; void init_cjddzlf() ATTR_COLD; void init_cjtljp() ATTR_COLD; void init_zhongguo() ATTR_COLD; @@ -3047,6 +3049,127 @@ ROM_START( cjddzp ) ROM_LOAD( "cjddzp_sp-1.u4", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) ROM_END +/* +Chaoji Dou Dizhu (V302CN) (hard version) +IGS, 2007 + +PCB: IGS PCB-0489-07-FM-1 + +Main program is on a plug-in daughterboard containing one 27C322 EPROM, Lattice LC4128V CPLD, +3.3V regulator and a 2-position DIP switch. +DIP#1 off sets V219CN. DIP#1 on sets V302CN + +IGS027 Sticker: B1 +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( cjddzs ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "b1_igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, each repeated 4 times (cjddz at 0x000000, 0x080000, 0x200000, 0x280000, cjddzp at the remaining offsets). + // cjddz works correctly with the internal ROM, once a small address line swap is applied. cjddzp doesn't work. + // it is tested on PCB that regardless of DIP setting the same internal ROM string appears, when the external ROM is removed, so there + // must be some kind of additional work done by the CPLD to make cjddzp work. + ROM_LOAD( "v-302cn.u1", 0x000000, 0x080000, CRC(fc525368) SHA1(293a0b30b384b2f294ab7d9dbaafc899002c7a32) ) // BADADDR -x-xxxxxxxxxxxxxxxxxxx + ROM_IGNORE( 0x080000 ) + ROM_CONTINUE( 0x080000, 0x080000 ) + ROM_IGNORE( 0x280000 ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "ani_cg.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + +/* +Chaoji Dou Dizhu (V219GN) (hard version) +IGS, 2009 + +PCB: IGS PCB-0489-03-FM-1 + +Main program is on a plug-in daughterboard containing one 27C322 EPROM, Lattice LC4128V CPLD, +3.3V regulator and a 2-position DIP switch. +DIP#1 off sets V219CN. DIP#1 on sets V405CN + +IGS027 Sticker: not present +ROM String: WED NOV 3 17:21:49 2004 + FIGHT_213CN + +Oki Clock (from PAL): 1.000MHz [22/22] +Oki Pin 7: High +*/ + +ROM_START( cjddzsa ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "igs027a", 0x00000, 0x4000, CRC(124f4bee) SHA1(bf9785516ef36290c2a7bac307bb2d849f2045ae) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, each repeated 2 times (cjddz at 0x200000, 0x300000, cjddzp at 0x280000, 0x380000). First 0x200000 are 0xff filled. + // cjddz works correctly with the internal ROM, once a small address line swap is applied. cjddzp doesn't work. + // it is tested on PCB that regardless of DIP setting the same internal ROM string appears, when the external ROM is removed, so there + // must be some kind of additional work done by the CPLD to make cjddzp work. + ROM_LOAD( "v-219gn.u1", 0x000000, 0x080000, CRC(33ded435) SHA1(ed9911b4d3ab4a0924faf02e0090c24ff83a0d45) ) // 0xxxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x100000 ) + ROM_IGNORE( 0x100000 ) + + ROM_REGION( 0x80000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "text.u27", 0x000000, 0x80000, CRC(520dc392) SHA1(0ab2620f20af8253806b6ff4e1d9d77a694da17c) ) + + ROM_REGION( 0x400000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "ani_cg.u28", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "sp-1.u5", 0x00000, 0x200000, CRC(64fbba95) SHA1(1aecb1b8426939262688e4dbed09d6a56e71b8d5) ) +ROM_END + +ROM_START( cjddzps ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS027A ARM based MCU + ROM_LOAD( "igs027a", 0x00000, 0x4000, CRC(6cf26c3d) SHA1(c74d4ff71ff07c38449242e7e067e956a5c441be) ) + + ROM_REGION32_LE( 0x100000, "user1", 0 ) // external ARM data / prg + // this has 2 programs, (cjddzp at 0x200000, an unknown one at 0x280000). First 0x200000 and last 0x100000 are 0xff filled. + // cjddzp works correctly with the internal ROM, once a small address line swap is applied. the other game doesn't work. + // it's unknown which game it is, since the PCB doesn't work, but given the GFX and sound ROMs match, it should be some variation of cjddz/cjddzp + ROM_LOAD( "rom.u1", 0x000000, 0x080000, CRC(969f7d09) SHA1(6e5eab99d0ab7913d6838e5c357813960640cc14) ) // 01xxxxxxxxxxxxxxxxxxxx = 0xFF + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x080000 ) + ROM_CONTINUE( 0x000000, 0x100000 ) + ROM_IGNORE( 0x100000 ) + + ROM_REGION( 0x200000, "igs017_igs031:tilemaps", 0 ) + ROM_LOAD16_WORD_SWAP( "rom.u27", 0x000000, 0x200000, CRC(c4daedd6) SHA1(1c06e9b8f8c9849d808e12d81588f8d5603941d1) ) // 1xxxxxxxxxxxxxxxxxxxx = 0x00 + + ROM_REGION( 0x600000, "igs017_igs031:sprites", 0 ) + ROM_LOAD( "rom.u26", 0x000000, 0x400000, CRC(72487508) SHA1(9f4bbc858960ddaae403e4a3330b2345f6fd6cb3) ) + ROM_LOAD( "rom.u29", 0x400000, 0x200000, CRC(b0447269) SHA1(bf639abc135b52781340a24820e402db497d8d09) ) + + // OKI, sample tables are every 0x20000 starting at 0x40000 + // 00000-1ffff and 20000-3ffff are likely music, always mapped at 20000 for any of the above banks + ROM_REGION( 0x200000, "oki", 0 ) + ROM_LOAD( "rom.u11", 0x00000, 0x200000, CRC(7ef65d95) SHA1(345c587cd449d6d06908e9687480be76b2cb2d28) ) +ROM_END + // 超级斗地主 两副牌 (Chāojí Dòu Dìzhǔ Liǎng Fù Pái) ROM_START( cjddzlf ) ROM_REGION( 0x04000, "maincpu", 0 ) @@ -3315,6 +3438,40 @@ void igs_m027_state::init_cjddzp() m_igs017_igs031->tarzan_decrypt_sprites(0x400000, 0x400000); } +void igs_m027_state::init_cjddzs() +{ + // extra scrambling applied by CPLD? + uint8_t *rom = memregion("user1")->base(); + std::vector buffer(0x100000); + + memcpy(&buffer[0], rom, 0x100000); + + for (int i = 0; i < 0x100000; i++) + rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; + + // the second program seems to also have additional address based XORs + // TODO + + init_cjddz(); +} + +void igs_m027_state::init_cjddzps() +{ + // extra scrambling applied by CPLD? + uint8_t *rom = memregion("user1")->base(); + std::vector buffer(0x100000); + + memcpy(&buffer[0], rom, 0x100000); + + for (int i = 0; i < 0x100000; i++) + rom[i] = buffer[bitswap<24>(i, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 12, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)]; + + // the second program seems to also have additional address based XORs + // TODO + + init_cjddzp(); +} + void igs_m027_state::init_cjddzlf() { cjddzlf_decrypt(machine()); @@ -3512,6 +3669,11 @@ GAME( 2001, extradrw, 0, extradrw, base, igs_m027_stat // these have an IGS025 protection device instead of the 8255 GAME( 2002, chessc2, 0, chessc2, chessc2, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II (ver. 1445A)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) +// these can select between two different games via DIP switch (currently unemulated feature) +GAME( 2007, cjddzs, 0, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V302CN)", MACHINE_NOT_WORKING ) +GAME( 2009, cjddzsa, cjddzs, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V405CN)", MACHINE_NOT_WORKING ) +GAME( 200?, cjddzps, 0, cjddz, cjddzp, igs_m027_state, init_cjddzps, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN) / unknown second set", MACHINE_NOT_WORKING ) + // Incomplete dumps GAME( 1999, amazonia, 0, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) GAME( 1999, amazonkp, amazonia, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King Plus (V204BR)", MACHINE_NOT_WORKING ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 3b5b3d3462967..3ce5202af7143 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -20544,6 +20544,9 @@ cjddz215cn cjddz217cn cjddzlf cjddzp +cjddzps +cjddzs +cjddzsa cjtljp extradrw fruitpar diff --git a/src/mame/skeleton/vgame.cpp b/src/mame/skeleton/vgame.cpp index e2c558f2745eb..db39b31d37fc8 100644 --- a/src/mame/skeleton/vgame.cpp +++ b/src/mame/skeleton/vgame.cpp @@ -11,6 +11,7 @@ square 208-pin chip, marked VGAME-008 (probably video chip) LY62256SL SRAM (near VGAME-007) 2x LY61L256JL SRAM (near VGAME-008) U6295 sound chip +93C66 EEPROM 2 banks of 8 DIP switches TODO: everything. CPU core is only tentatively identified and code is encrypted. Possibly internal ROM? @@ -20,6 +21,7 @@ TODO: everything. CPU core is only tentatively identified and code is encrypted. #include "emu.h" #include "cpu/arm7/arm7.h" +#include "machine/eepromser.h" #include "sound/okim6295.h" #include "emupal.h" From 4c14cd4c25fc2a970500e39431dcb5d897ef7c3d Mon Sep 17 00:00:00 2001 From: angelosa Date: Mon, 10 Mar 2025 20:04:49 +0100 Subject: [PATCH 142/272] nec/pc88va_v.cpp: hookup TSP Maximum Raster Address (line height per char) Software list items promoted to working --------------------------------------- pc88va.xml: Abunai Tengu Densetsu, Crescent Moon Girl, D.P.S - Dream Program System, Pac-Man --- hash/pc88va.xml | 32 ++++++++++---------------------- src/mame/nec/pc88va_v.cpp | 14 +++++++++----- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/hash/pc88va.xml b/hash/pc88va.xml index dd55821146b9b..592147ac9a6f6 100644 --- a/hash/pc88va.xml +++ b/hash/pc88va.xml @@ -213,7 +213,6 @@ Incomplete MIF-201 [MIDI] emulation Has HDFORM.COM utility JTERM.BAT is for connecting to a PC-VAN or ANSI [terminal] PCALC.BAT requires [keyboard] PC+V press to bring up -PLAYR.BAT has offset [IDP] text display SKYBD.BAT wants a radio cassette player and a PC-KD861 color monitor for audio sampling thru OPNA EOS VIDEO.BAT has various superimpose effects, requires dedicated board ]]> @@ -873,7 +872,6 @@ Has unemulated [MIDI] options 1990 マイクロキャビン (Micro Cabin) @@ -947,13 +945,10 @@ Ugly pitch for [OPNA] voice samples on intro - + Abunai Tengu Densetsu 1989 アリスソフト (Alicesoft) - @@ -979,13 +974,10 @@ Offset [IDP] display - + Crescent Moon Girl 1989 アリスソフト (Alicesoft) - @@ -1012,13 +1004,10 @@ Offset [IDP] display - + D.P.S - Dream Program System 1989 アリスソフト (Alicesoft) - @@ -1153,8 +1142,7 @@ Offset [IDP] display 1989 アリスソフト (Alicesoft) @@ -1319,12 +1307,12 @@ Needs [OFX/OFY] on gameplay - + Pac-Man 19?? <doujin> @@ -1336,12 +1324,12 @@ Needs [OFX/OFY] on gameplay - + Pac-Man (auto-bootable) 19?? <doujin> @@ -1356,7 +1344,7 @@ Needs [OFX/OFY] on gameplay 1992 <doujin> @@ -1376,7 +1364,7 @@ Gameplay don't mask bullets on right side, [cliprect] 2023 Inufuto diff --git a/src/mame/nec/pc88va_v.cpp b/src/mame/nec/pc88va_v.cpp index e45c2745c62e7..ed58d825cd59d 100644 --- a/src/mame/nec/pc88va_v.cpp +++ b/src/mame/nec/pc88va_v.cpp @@ -442,20 +442,24 @@ void pc88va_state::draw_text(bitmap_rgb32 &bitmap, const rectangle &cliprect) rectangle split_cliprect(rxp, rxp + rw - 1, ryp, ryp + rh - 1); split_cliprect &= cliprect; + const int line_height = m_tsp.line_height; + + if (line_height < 8) + continue; + for(int y = 0; y < vh; y++) { - int y_base = y * 16 + ryp - raster_offset; + int y_base = y * line_height + ryp - raster_offset; - // TODO: consult with OG if (!split_cliprect.contains(rxp, y_base) && - !split_cliprect.contains(rxp, y_base + 16)) + !split_cliprect.contains(rxp, y_base + line_height)) continue; for(int x = 0; x < vw; x++) { int x_base = x * 8; if (!split_cliprect.contains(x_base, y_base) && - !split_cliprect.contains(x_base, y_base + 16)) + !split_cliprect.contains(x_base, y_base + line_height)) continue; // TODO: understand where VSA comes into equation @@ -1310,7 +1314,7 @@ void pc88va_state::execute_dspdef_cmd() m_tsp.blink = (m_buf_ram[5] & 0xf8); if (m_tsp.blink == 0) m_tsp.blink = 0x100; - LOGIDP("DSPDEF (%02x %02x %02x %02x %02x %02x) %05x ATTR | %02x pitch | %02x line height| %02x hline | %d blink rate\n" + LOGIDP("DSPDEF (%02x %02x %02x %02x %02x %02x) %05x ATTR | %d pitch | %d line height| %d hline | %d blink rate\n" , m_buf_ram[0], m_buf_ram[1], m_buf_ram[2], m_buf_ram[3], m_buf_ram[4], m_buf_ram[5] , m_tsp.attr_offset | 0x40000 , m_tsp.pitch From a58b23f233569b4dbd46dea4e3b946cf074d445f Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 12 Mar 2025 01:32:56 +1100 Subject: [PATCH 143/272] -cpu/drcbex64.cpp: Align HANDLE entry point to 16-byte boundary. -cpu/mips/mips3drc.cpp: Don't start a new block for every callable helper. --- src/devices/cpu/drcbex64.cpp | 10 +- src/devices/cpu/mips/mips3.h | 14 +- src/devices/cpu/mips/mips3drc.cpp | 204 +++++++++++++----------------- 3 files changed, 102 insertions(+), 126 deletions(-) diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 63d57ce6055a8..63ea601109e0b 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -1223,6 +1223,7 @@ void drcbe_x64::generate(drcuml_block &block, const instruction *instlist, uint3 } Assembler a(&ch); + a.addEncodingOptions(EncodingOptions::kOptimizedAlign); if (logger.file()) a.addDiagnosticOptions(DiagnosticOptions::kValidateIntermediate); @@ -1730,6 +1731,7 @@ void drcbe_x64::op_handle(Assembler &a, const instruction &inst) // emit a jump around the stack adjust in case code falls through here Label skip = a.newLabel(); a.short_().jmp(skip); + a.align(AlignMode::kCode, 16); // register the current pointer for the handle inst.param(0).handle().set_codeptr(drccodeptr(a.code()->baseAddress() + a.offset())); @@ -2890,7 +2892,7 @@ void drcbe_x64::op_read(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer @@ -3089,7 +3091,7 @@ void drcbe_x64::op_readm(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.read.dispatch)); // load dispatch table pointer @@ -3285,7 +3287,7 @@ void drcbe_x64::op_write(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer @@ -3455,7 +3457,7 @@ void drcbe_x64::op_writem(Assembler &a, const instruction &inst) int const shift = m_space[spacesizep.space()]->addr_shift() - 3; if (m_space[spacesizep.space()]->endianness() != ENDIANNESS_LITTLE) - a.not_(ecx); // swizzle address for bit Endian spaces + a.not_(ecx); // swizzle address for big Endian spaces if (accessors.has_high_bits && !accessors.mask_high_bits) a.shr(r10d, accessors.specific.low_bits); // shift off low bits mov_r64_imm(a, rax, uintptr_t(accessors.specific.write.dispatch)); // load dispatch table pointer diff --git a/src/devices/cpu/mips/mips3.h b/src/devices/cpu/mips/mips3.h index 0643cff28fe9d..73105cb0ad368 100644 --- a/src/devices/cpu/mips/mips3.h +++ b/src/devices/cpu/mips/mips3.h @@ -522,7 +522,7 @@ class mips3_device : public cpu_device, public device_vtlb_interface { void static_generate_memory_mode_checks(drcuml_block &block, uml::code_handle &exception_addrerr, int &label, int mode); void static_generate_fastram_accessor(drcuml_block &block, int &label, int size, bool iswrite, bool ismasked); void static_generate_memory_rw(drcuml_block &block, int size, bool iswrite, bool ismasked); - virtual void static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr); + virtual void static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr); virtual void check_irqs(); virtual void handle_mult(uint32_t op); @@ -620,11 +620,11 @@ class mips3_device : public cpu_device, public device_vtlb_interface { uml::code_label labelnum; /* index for local labels */ }; - void static_generate_entry_point(); - void static_generate_nocode_handler(); - void static_generate_out_of_cycles(); - void static_generate_tlb_mismatch(); - void static_generate_exception(uint8_t exception, int recover, const char *name); + void static_generate_entry_point(drcuml_block &block, int &label); + void static_generate_nocode_handler(drcuml_block &block, int &label); + void static_generate_out_of_cycles(drcuml_block &block, int &label); + void static_generate_tlb_mismatch(drcuml_block &block, int &label); + void static_generate_exception(drcuml_block &block, int &label, uint8_t exception, int recover, const char *name); void generate_update_mode(drcuml_block &block); void generate_update_cycles(drcuml_block &block, compiler_state &compiler, uml::parameter param, bool allow_exception); @@ -758,7 +758,7 @@ class r4650_device : public mips3_device { protected: virtual bool memory_translate(int spacenum, int intention, offs_t &address, address_space *&target_space) override; - virtual void static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) override; + virtual void static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) override; virtual bool RBYTE(offs_t address, uint32_t *result) override; virtual bool RHALF(offs_t address, uint32_t *result) override; diff --git a/src/devices/cpu/mips/mips3drc.cpp b/src/devices/cpu/mips/mips3drc.cpp index 6597b6fd20f04..6800f6fa11b0f 100644 --- a/src/devices/cpu/mips/mips3drc.cpp +++ b/src/devices/cpu/mips/mips3drc.cpp @@ -239,45 +239,55 @@ void mips3_device::code_flush_cache() try { - /* generate the entry point and out-of-cycles handlers */ - static_generate_entry_point(); - static_generate_nocode_handler(); - static_generate_out_of_cycles(); - static_generate_tlb_mismatch(); - - /* append exception handlers for various types */ - static_generate_exception(EXCEPTION_INTERRUPT, true, "exception_interrupt"); - static_generate_exception(EXCEPTION_INTERRUPT, false, "exception_interrupt_norecover"); - static_generate_exception(EXCEPTION_TLBMOD, true, "exception_tlbmod"); - static_generate_exception(EXCEPTION_TLBLOAD, true, "exception_tlbload"); - static_generate_exception(EXCEPTION_TLBSTORE, true, "exception_tlbstore"); - static_generate_exception(EXCEPTION_TLBLOAD_FILL, true, "exception_tlbload_fill"); - static_generate_exception(EXCEPTION_TLBSTORE_FILL, true, "exception_tlbstore_fill"); - static_generate_exception(EXCEPTION_ADDRLOAD, true, "exception_addrload"); - static_generate_exception(EXCEPTION_ADDRSTORE, true, "exception_addrstore"); - static_generate_exception(EXCEPTION_SYSCALL, true, "exception_syscall"); - static_generate_exception(EXCEPTION_BREAK, true, "exception_break"); - static_generate_exception(EXCEPTION_INVALIDOP, true, "exception_invalidop"); - static_generate_exception(EXCEPTION_BADCOP, true, "exception_badcop"); - static_generate_exception(EXCEPTION_OVERFLOW, true, "exception_overflow"); - static_generate_exception(EXCEPTION_TRAP, true, "exception_trap"); - static_generate_exception(EXCEPTION_FPE, true, "exception_fpe"); + { + drcuml_block &block(m_drcuml->begin_block(1024)); + int label = 1; + + /* generate the entry point and out-of-cycles handlers */ + static_generate_entry_point(block, label); + static_generate_nocode_handler(block, label); + static_generate_out_of_cycles(block, label); + static_generate_tlb_mismatch(block, label); + + /* append exception handlers for various types */ + static_generate_exception(block, label, EXCEPTION_INTERRUPT, true, "exception_interrupt"); + static_generate_exception(block, label, EXCEPTION_INTERRUPT, false, "exception_interrupt_norecover"); + static_generate_exception(block, label, EXCEPTION_TLBMOD, true, "exception_tlbmod"); + static_generate_exception(block, label, EXCEPTION_TLBLOAD, true, "exception_tlbload"); + static_generate_exception(block, label, EXCEPTION_TLBSTORE, true, "exception_tlbstore"); + static_generate_exception(block, label, EXCEPTION_TLBLOAD_FILL, true, "exception_tlbload_fill"); + static_generate_exception(block, label, EXCEPTION_TLBSTORE_FILL, true, "exception_tlbstore_fill"); + static_generate_exception(block, label, EXCEPTION_ADDRLOAD, true, "exception_addrload"); + static_generate_exception(block, label, EXCEPTION_ADDRSTORE, true, "exception_addrstore"); + static_generate_exception(block, label, EXCEPTION_SYSCALL, true, "exception_syscall"); + static_generate_exception(block, label, EXCEPTION_BREAK, true, "exception_break"); + static_generate_exception(block, label, EXCEPTION_INVALIDOP, true, "exception_invalidop"); + static_generate_exception(block, label, EXCEPTION_BADCOP, true, "exception_badcop"); + static_generate_exception(block, label, EXCEPTION_OVERFLOW, true, "exception_overflow"); + static_generate_exception(block, label, EXCEPTION_TRAP, true, "exception_trap"); + static_generate_exception(block, label, EXCEPTION_FPE, true, "exception_fpe"); + + block.end(); + } /* add subroutines for memory accesses */ for (mode = 0; mode < 3; mode++) { - static_generate_memory_accessor(mode, 1, false, false, "read8", m_read8[mode]); - static_generate_memory_accessor(mode, 1, true, false, "write8", m_write8[mode]); - static_generate_memory_accessor(mode, 2, false, false, "read16", m_read16[mode]); - static_generate_memory_accessor(mode, 2, true, false, "write16", m_write16[mode]); - static_generate_memory_accessor(mode, 4, false, false, "read32", m_read32[mode]); - static_generate_memory_accessor(mode, 4, false, true, "read32mask", m_read32mask[mode]); - static_generate_memory_accessor(mode, 4, true, false, "write32", m_write32[mode]); - static_generate_memory_accessor(mode, 4, true, true, "write32mask", m_write32mask[mode]); - static_generate_memory_accessor(mode, 8, false, false, "read64", m_read64[mode]); - static_generate_memory_accessor(mode, 8, false, true, "read64mask", m_read64mask[mode]); - static_generate_memory_accessor(mode, 8, true, false, "write64", m_write64[mode]); - static_generate_memory_accessor(mode, 8, true, true, "write64mask", m_write64mask[mode]); + drcuml_block &block(m_drcuml->begin_block(1024)); + int label = 1; + static_generate_memory_accessor(block, label, mode, 1, false, false, "read8", m_read8[mode]); + static_generate_memory_accessor(block, label, mode, 1, true, false, "write8", m_write8[mode]); + static_generate_memory_accessor(block, label, mode, 2, false, false, "read16", m_read16[mode]); + static_generate_memory_accessor(block, label, mode, 2, true, false, "write16", m_write16[mode]); + static_generate_memory_accessor(block, label, mode, 4, false, false, "read32", m_read32[mode]); + static_generate_memory_accessor(block, label, mode, 4, false, true, "read32mask", m_read32mask[mode]); + static_generate_memory_accessor(block, label, mode, 4, true, false, "write32", m_write32[mode]); + static_generate_memory_accessor(block, label, mode, 4, true, true, "write32mask", m_write32mask[mode]); + static_generate_memory_accessor(block, label, mode, 8, false, false, "read64", m_read64[mode]); + static_generate_memory_accessor(block, label, mode, 8, false, true, "read64mask", m_read64mask[mode]); + static_generate_memory_accessor(block, label, mode, 8, true, false, "write64", m_write64[mode]); + static_generate_memory_accessor(block, label, mode, 8, true, true, "write64mask", m_write64mask[mode]); + block.end(); } } catch (drcuml_block::abort_compilation &) @@ -585,44 +595,40 @@ static void cfunc_unimplemented(void *param) static entry point -------------------------------------------------*/ -void mips3_device::static_generate_entry_point() +void mips3_device::static_generate_entry_point(drcuml_block &block, int &label) { - uml::code_label const skip = 1; - - drcuml_block &block(m_drcuml->begin_block(20)); + uml::code_label const skip = label++; /* forward references */ alloc_handle(*m_drcuml, m_exception_norecover[EXCEPTION_INTERRUPT], "interrupt_norecover"); alloc_handle(*m_drcuml, m_nocode, "nocode"); alloc_handle(*m_drcuml, m_entry, "entry"); - UML_HANDLE(block, *m_entry); // handle entry + UML_HANDLE(block, *m_entry); // handle entry /* reset the FPU mode */ - UML_AND(block, I0, CCR132(31), 3); // and i0,ccr1[31],3 - UML_LOAD(block, I0, &m_fpmode[0], I0, SIZE_BYTE, SCALE_x1);// load i0,fpmode,i0,byte - UML_SETFMOD(block, I0); // setfmod i0 + UML_AND(block, I0, CCR132(31), 3); // and i0,ccr1[31],3 + UML_LOAD(block, I0, &m_fpmode[0], I0, SIZE_BYTE, SCALE_x1); // load i0,fpmode,i0,byte + UML_SETFMOD(block, I0); // setfmod i0 /* load fast integer registers */ load_fast_iregs(block); /* check for interrupts */ UML_AND(block, I0, CPR032(COP0_Cause), CPR032(COP0_Status)); // and i0,[Cause],[Status] - UML_AND(block, I0, I0, 0xfc00); // and i0,i0,0xfc00,Z - UML_JMPc(block, COND_Z, skip); // jmp skip,Z + UML_AND(block, I0, I0, 0xfc00); // and i0,i0,0xfc00,Z + UML_JMPc(block, COND_Z, skip); // jmp skip,Z UML_TEST(block, CPR032(COP0_Status), SR_IE); // test [Status],SR_IE - UML_JMPc(block, COND_Z, skip); // jmp skip,Z + UML_JMPc(block, COND_Z, skip); // jmp skip,Z UML_TEST(block, CPR032(COP0_Status), SR_EXL | SR_ERL); // test [Status],SR_EXL | SR_ERL - UML_JMPc(block, COND_NZ, skip); // jmp skip,NZ - UML_MOV(block, I0, mem(&m_core->pc)); // mov i0,pc - UML_MOV(block, I1, 0); // mov i1,0 - UML_CALLH(block, *m_exception_norecover[EXCEPTION_INTERRUPT]); // callh exception_norecover + UML_JMPc(block, COND_NZ, skip); // jmp skip,NZ + UML_MOV(block, I0, mem(&m_core->pc)); // mov i0,pc + UML_MOV(block, I1, 0); // mov i1,0 + UML_CALLH(block, *m_exception_norecover[EXCEPTION_INTERRUPT]); // callh exception_norecover UML_LABEL(block, skip); // skip: /* generate a hash jump via the current mode and PC */ - UML_HASHJMP(block, mem(&m_core->mode), mem(&m_core->pc), *m_nocode); - // hashjmp ,,nocode - block.end(); + UML_HASHJMP(block, mem(&m_core->mode), mem(&m_core->pc), *m_nocode); // hashjmp ,,nocode } @@ -631,11 +637,8 @@ void mips3_device::static_generate_entry_point() exception handler for "out of code" -------------------------------------------------*/ -void mips3_device::static_generate_nocode_handler() +void mips3_device::static_generate_nocode_handler(drcuml_block &block, int &label) { - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(10)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_nocode, "nocode"); UML_HANDLE(block, *m_nocode); // handle nocode @@ -643,8 +646,6 @@ void mips3_device::static_generate_nocode_handler() UML_MOV(block, mem(&m_core->pc), I0); // mov [pc],i0 save_fast_iregs(block); UML_EXIT(block, EXECUTE_MISSING_CODE); // exit EXECUTE_MISSING_CODE - - block.end(); } @@ -653,11 +654,8 @@ void mips3_device::static_generate_nocode_handler() out of cycles exception handler -------------------------------------------------*/ -void mips3_device::static_generate_out_of_cycles() +void mips3_device::static_generate_out_of_cycles(drcuml_block &block, int &label) { - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(10)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_out_of_cycles, "out_of_cycles"); UML_HANDLE(block, *m_out_of_cycles); // handle out_of_cycles @@ -665,8 +663,6 @@ void mips3_device::static_generate_out_of_cycles() UML_MOV(block, mem(&m_core->pc), I0); // mov ,i0 save_fast_iregs(block); UML_EXIT(block, EXECUTE_OUT_OF_CYCLES); // exit EXECUTE_OUT_OF_CYCLES - - block.end(); } @@ -675,15 +671,14 @@ void mips3_device::static_generate_out_of_cycles() TLB mismatch handler -------------------------------------------------*/ -void mips3_device::static_generate_tlb_mismatch() +void mips3_device::static_generate_tlb_mismatch(drcuml_block &block, int &label) { + uml::code_label const skip = label++; + /* forward references */ alloc_handle(*m_drcuml, m_exception[EXCEPTION_TLBLOAD], "exception_tlbload"); alloc_handle(*m_drcuml, m_exception[EXCEPTION_TLBLOAD_FILL], "exception_tlbload_fill"); - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(20)); - /* generate a hash jump via the current mode and PC */ alloc_handle(*m_drcuml, m_tlb_mismatch, "tlb_mismatch"); UML_HANDLE(block, *m_tlb_mismatch); // handle tlb_mismatch @@ -702,12 +697,12 @@ void mips3_device::static_generate_tlb_mismatch() UML_MOV(block, mem(&m_core->arg1), I1); // mov [arg1],i1 UML_CALLC(block, cfunc_printf_debug, this); // callc printf_debug } - UML_TEST(block, I1, FETCH_ALLOWED); // test i1,FETCH_ALLOWED - UML_JMPc(block, COND_NZ, 1); // jmp 1,nz - UML_TEST(block, I1, FLAG_FIXED); // test i1,FLAG_FIXED + UML_TEST(block, I1, FETCH_ALLOWED); // test i1,FETCH_ALLOWED + UML_JMPc(block, COND_NZ, skip); // jmp skip,nz + UML_TEST(block, I1, FLAG_FIXED); // test i1,FLAG_FIXED UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBLOAD], I0); // exh exception[TLBLOAD],i0,nz UML_EXH(block, *m_exception[EXCEPTION_TLBLOAD_FILL], I0); // exh exception[TLBLOAD_FILL],i0 - UML_LABEL(block, 1); // 1: + UML_LABEL(block, skip); // skip: save_fast_iregs(block); // the saved PC may be set 1 instruction back with the low bit set to indicate @@ -717,8 +712,6 @@ void mips3_device::static_generate_tlb_mismatch() UML_MOV(block, mem(&m_core->pc), I0); // mov i0,[pc] UML_EXIT(block, EXECUTE_MISSING_CODE); // exit EXECUTE_MISSING_CODE - - block.end(); } @@ -727,12 +720,12 @@ void mips3_device::static_generate_tlb_mismatch() exception handler -------------------------------------------------*/ -void mips3_device::static_generate_exception(uint8_t exception, int recover, const char *name) +void mips3_device::static_generate_exception(drcuml_block &block, int &label, uint8_t exception, int recover, const char *name) { uml::code_handle *&exception_handle = recover ? m_exception[exception] : m_exception_norecover[exception]; uint32_t offset = 0x180; - uml::code_label const next = 1; - uml::code_label const skip = 2; + uml::code_label const next = label++; + uml::code_label const skip = label++; /* translate our fake fill exceptions into real exceptions */ if (exception == EXCEPTION_TLBLOAD_FILL || exception == EXCEPTION_TLBSTORE_FILL) @@ -741,9 +734,6 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con exception = (exception - EXCEPTION_TLBLOAD_FILL) + EXCEPTION_TLBLOAD; } - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); - /* add a global entry for this */ alloc_handle(*m_drcuml, exception_handle, name); UML_HANDLE(block, *exception_handle); // handle name @@ -798,7 +788,7 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con } /* set EXL in the SR */ - UML_OR(block, I0, CPR032(COP0_Status), SR_EXL); // or i0,[Status],SR_EXL + UML_OR(block, I0, CPR032(COP0_Status), SR_EXL); // or i0,[Status],SR_EXL UML_MOV(block, CPR032(COP0_Status), I0); // mov [Status],i0 generate_update_mode(block); @@ -806,24 +796,22 @@ void mips3_device::static_generate_exception(uint8_t exception, int recover, con if ((PRINTF_EXCEPTIONS && exception != EXCEPTION_INTERRUPT && exception != EXCEPTION_SYSCALL) || (PRINTF_MMU && (exception == EXCEPTION_TLBLOAD || exception == EXCEPTION_TLBSTORE))) { - UML_CALLC(block, cfunc_printf_exception, this); // callc cfunc_printf_exception,nullptr + UML_CALLC(block, cfunc_printf_exception, this); // callc cfunc_printf_exception,nullptr //UML_CALLC(block, cfunc_debug_break, this); // callc cfunc_debug_break,nullptr } /* choose our target PC */ - UML_ADD(block, I0, I3, 0xbfc00200); // add i0,i3,0xbfc00200 - UML_TEST(block, CPR032(COP0_Status), SR_BEV); // test CPR032(COP0_Status),SR_BEV - UML_JMPc(block, COND_NZ, skip); // jnz - UML_ADD(block, I0, I3, 0x80000000); // add i0,i3,0x80000000,z + UML_ADD(block, I0, I3, 0xbfc00200); // add i0,i3,0xbfc00200 + UML_TEST(block, CPR032(COP0_Status), SR_BEV); // test CPR032(COP0_Status),SR_BEV + UML_JMPc(block, COND_NZ, skip); // jnz + UML_ADD(block, I0, I3, 0x80000000); // add i0,i3,0x80000000,z UML_LABEL(block, skip); // : /* adjust cycles */ - UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I1); // sub icount,icount,cycles,S - UML_EXHc(block, COND_S, *m_out_of_cycles, I0); // exh out_of_cycles,i0 - - UML_HASHJMP(block, mem(&m_core->mode), I0, *m_nocode);// hashjmp ,i0,nocode + UML_SUB(block, mem(&m_core->icount), mem(&m_core->icount), I1); // sub icount,icount,cycles,S + UML_EXHc(block, COND_S, *m_out_of_cycles, I0); // exh out_of_cycles,i0 - block.end(); + UML_HASHJMP(block, mem(&m_core->mode), I0, *m_nocode); // hashjmp ,i0,nocode } @@ -1018,7 +1006,7 @@ void mips3_device::static_generate_memory_rw(drcuml_block &block, int size, bool static_generate_memory_accessor ------------------------------------------------------------------*/ -void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) +void mips3_device::static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) { /* on entry, address is in I0; data for writes is in I1; mask for accesses is in I2 */ /* on exit, read result is in I0 */ @@ -1027,10 +1015,6 @@ void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswr uml::code_handle &exception_tlbfill = *m_exception[iswrite ? EXCEPTION_TLBSTORE_FILL : EXCEPTION_TLBLOAD_FILL]; uml::code_handle &exception_addrerr = *m_exception[iswrite ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD]; int tlbmiss = 0; - int label = 1; - - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); /* add a global entry for this */ alloc_handle(*m_drcuml, handleptr, name); @@ -1048,32 +1032,23 @@ void mips3_device::static_generate_memory_accessor(int mode, int size, bool iswr static_generate_fastram_accessor(block, label, size, iswrite, ismasked); static_generate_memory_rw(block, size, iswrite, ismasked); - if (tlbmiss != 0) + UML_LABEL(block, tlbmiss); // tlbmiss: + if (iswrite) { - UML_LABEL(block, tlbmiss); // tlbmiss: - if (iswrite) - { - UML_TEST(block, I3, READ_ALLOWED); // test i3,READ_ALLOWED - UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBMOD], I0); // exh tlbmod,i0,nz - } - UML_TEST(block, I3, FLAG_FIXED); // test i3,FLAG_FIXED - UML_EXHc(block, COND_NZ, exception_tlb, I0); // exh tlb,i0,nz - UML_EXH(block, exception_tlbfill, I0); // exh tlbfill,i0 + UML_TEST(block, I3, READ_ALLOWED); // test i3,READ_ALLOWED + UML_EXHc(block, COND_NZ, *m_exception[EXCEPTION_TLBMOD], I0); // exh tlbmod,i0,nz } - - block.end(); + UML_TEST(block, I3, FLAG_FIXED); // test i3,FLAG_FIXED + UML_EXHc(block, COND_NZ, exception_tlb, I0); // exh tlb,i0,nz + UML_EXH(block, exception_tlbfill, I0); // exh tlbfill,i0 } -void r4650_device::static_generate_memory_accessor(int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) +void r4650_device::static_generate_memory_accessor(drcuml_block &block, int &label, int mode, int size, bool iswrite, bool ismasked, const char *name, uml::code_handle *&handleptr) { /* on entry, address is in I0; data for writes is in I1; mask for accesses is in I2 */ /* on exit, read result is in I0 */ /* routine trashes I0-I3 */ uml::code_handle &exception_addrerr = *m_exception[iswrite ? EXCEPTION_ADDRSTORE : EXCEPTION_ADDRLOAD]; - int label = 1; - - /* begin generating */ - drcuml_block &block(m_drcuml->begin_block(1024)); /* add a global entry for this */ alloc_handle(*m_drcuml, handleptr, name); @@ -1093,7 +1068,6 @@ void r4650_device::static_generate_memory_accessor(int mode, int size, bool iswr static_generate_fastram_accessor(block, label, size, iswrite, ismasked); static_generate_memory_rw(block, size, iswrite, ismasked); - block.end(); } From 6294be354a705151a6619d4974f3ec4e294fd351 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 11 Mar 2025 17:58:23 +0100 Subject: [PATCH 144/272] New working clones ------------------ Majiang Caihui Ying (ver 2.20) [little0] Que You Ji - Dian Zi Ji Pan Jiaqiang Ban (v201) [dyq, little0, Guru] - igs/pgm.cpp: identified kovqhsgs302 [FBNeo] --- src/mame/dynax/ddenlovr.cpp | 46 +++++-- src/mame/dynax/dynax.cpp | 237 +++++++++++++++++++++++++++++++----- src/mame/dynax/dynax.h | 49 ++++---- src/mame/dynax/dynax_v.cpp | 4 +- src/mame/igs/igs_m027.cpp | 6 +- src/mame/igs/pgm.cpp | 5 +- src/mame/mame.lst | 7 +- 7 files changed, 282 insertions(+), 72 deletions(-) diff --git a/src/mame/dynax/ddenlovr.cpp b/src/mame/dynax/ddenlovr.cpp index 093a33d1db59f..64afc8713dbe9 100644 --- a/src/mame/dynax/ddenlovr.cpp +++ b/src/mame/dynax/ddenlovr.cpp @@ -198,6 +198,7 @@ class ddenlovr_state : public dynax_state void ddenlovrk(machine_config &config) ATTR_COLD; void quizchq(machine_config &config) ATTR_COLD; void mjmyuniv(machine_config &config) ATTR_COLD; + void mjmyunivbl2(machine_config &config) ATTR_COLD; void dtoyoken(machine_config &config) ATTR_COLD; void hgokou(machine_config &config) ATTR_COLD; void seljan2(machine_config &config) ATTR_COLD; @@ -301,7 +302,6 @@ class ddenlovr_state : public dynax_state protected: void mjmyster_rambank_w(uint8_t data); private: - void mjmyster_rombank_w(uint8_t data); void mjmyster_select2_w(uint8_t data); uint8_t mjmyster_coins_r(); uint8_t mjmyster_keyb_r(); @@ -396,6 +396,7 @@ class ddenlovr_state : public dynax_state void mjflove_portmap(address_map &map) ATTR_COLD; void mjmyorntr_portmap(address_map &map) ATTR_COLD; void mjmyster_map(address_map &map) ATTR_COLD; + void mjmyunivbl2_map(address_map &map) ATTR_COLD; void mjmyster_portmap(address_map &map) ATTR_COLD; void mjmywrld_portmap(address_map &map) ATTR_COLD; void mjschuka_portmap(address_map &map) ATTR_COLD; @@ -3210,9 +3211,14 @@ void ddenlovr_state::mjmyster_map(address_map &map) map(0xf200, 0xffff).nopw(); // "" } -void ddenlovr_state::mjmyster_rombank_w(uint8_t data) +void ddenlovr_state::mjmyunivbl2_map(address_map &map) { - membank("bank1")->set_entry(data & 0x7); + map(0x0000, 0x5fff).rom(); // ROM + map(0x6000, 0x6fff).ram(); // RAM + map(0x7000, 0x7fff).bankrw("bank2"); // RAM (Banked) + map(0x8000, 0xffff).bankr("bank1"); // ROM/RAM (Banked) + map(0xe000, 0xe1ff).w(FUNC(ddenlovr_state::ddenlovr_palette_w)); // RAM enabled by bit 4 of rombank + map(0xe200, 0xefff).nopw(); // "" } void ddenlovr_state::mjmyster_rambank_w(uint8_t data) @@ -9576,7 +9582,7 @@ void ddenlovr_state::mjmyorntr(machine_config &config) tmpz84c015_device &tmpz(*subdevice("maincpu")); tmpz.set_addrmap(AS_IO, &ddenlovr_state::mjmyorntr_portmap); tmpz.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - tmpz.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + tmpz.out_pb_callback().set_membank("bank1").mask(0x07); MCFG_MACHINE_START_OVERRIDE(ddenlovr_state,hparadis) MCFG_VIDEO_START_OVERRIDE(ddenlovr_state,ddenlovr) @@ -9603,7 +9609,7 @@ void ddenlovr_state::mjmyster(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); @@ -9716,7 +9722,7 @@ void ddenlovr_state::mjmyuniv(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); @@ -9732,6 +9738,13 @@ void ddenlovr_state::mjmyuniv(machine_config &config) aysnd.add_route(ALL_OUTPUTS, "mono", 0.30); } +void ddenlovr_state::mjmyunivbl2(machine_config &config) +{ + mjmyuniv(config); + + subdevice("maincpu")->set_addrmap(AS_PROGRAM, &ddenlovr_state::mjmyunivbl2_map); +} + void ddenlovr_state::mjmyornt(machine_config &config) { quizchq(config); @@ -9742,7 +9755,7 @@ void ddenlovr_state::mjmyornt(machine_config &config) maincpu.set_addrmap(AS_IO, &ddenlovr_state::mjmyster_portmap); maincpu.in_pa_callback().set_constant(0); maincpu.out_pa_callback().set(FUNC(ddenlovr_state::mjmyster_rambank_w)); - maincpu.out_pb_callback().set(FUNC(ddenlovr_state::mjmyster_rombank_w)); + maincpu.out_pb_callback().set_membank("bank1").mask(0x07); m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); m_screen->set_visarea(0, 336-1, 4, 256-16+4-1); @@ -11787,6 +11800,24 @@ ROM_START( mjmyunivbl ) ROM_LOAD( "rom.u30", 0x000000, 0x040000, CRC(30e496a6) SHA1(c7ea23079bd4acb6e06af954fafe8462d5576b0e) ) ROM_END +// 麻雀 財会赢 +// also CS166P001 PCB +ROM_START( mjmyunivbl2 ) + ROM_REGION( 0x90000 + 0x1000*8, "maincpu", 0 ) // Z80 Code + space for banked RAM + ROM_LOAD( "romb.u47", 0x00000, 0x40000, CRC(eb447ce4) SHA1(8b38cedd83dbc3dd1dff7f4a60658c1a9ef50428) ) + ROM_RELOAD( 0x10000, 0x40000 ) + + ROM_REGION( 0x400000, "blitter", ROMREGION_ERASE00 ) + // gap + ROM_LOAD( "romf.u60", 0x200000, 0x080000, CRC(a287589a) SHA1(58659dd7e019d1d32efeaec548c84a7ded637c50) ) + ROM_LOAD( "rome.u59", 0x280000, 0x080000, CRC(a3475059) SHA1(ec86dcea3314b65d391a970680c021899c16449e) ) + ROM_LOAD( "romd.u58", 0x300000, 0x080000, CRC(f45c24d6) SHA1(0eca68f2ca5722717f27ac0839359966daa2715b) ) + ROM_LOAD( "romc.u57", 0x380000, 0x080000, CRC(d9e4a01e) SHA1(0a0320cea0581c4278d120752997f67537c46531) ) + + ROM_REGION( 0x40000, "oki", 0 ) // samples + ROM_LOAD( "roma.u30", 0x000000, 0x040000, CRC(f9bf11fa) SHA1(3e781db107d24f456b48a99987c45727454d0a69) ) +ROM_END + /*************************************************************************** Panel & Variety Akamaru Q Joushou Dont-R @@ -12669,6 +12700,7 @@ GAME( 1994, hginga, 0, hginga, hginga, ddenlovr_state, empty_ GAME( 1994, mjmyuniv, 0, mjmyuniv, mjmyster, ddenlovr_state, empty_init, ROT0, "Dynax", "Mahjong The Mysterious Universe (Japan, D85)", MACHINE_NO_COCKTAIL ) GAME( 1995, mjmyunivbl, mjmyuniv, mjmyuniv, mjmyster, ddenlovr_state, empty_init, ROT0, "bootleg", "Maque Long Xiong Hu Di (Taiwan?, D106T)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NO_COCKTAIL ) // One GFX ROM isn't dumped +GAME( 1996, mjmyunivbl2, mjmyuniv, mjmyunivbl2, mjmyster, ddenlovr_state, empty_init, ROT0, "bootleg", "Majiang Caihui Ying (ver 2.20)", MACHINE_NO_COCKTAIL ) GAME( 1994, quiz365, 0, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon", "Quiz 365 (Japan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) GAME( 1994, quiz365t, quiz365, quiz365, quiz365, ddenlovr_state, empty_init, ROT0, "Nakanihon / Taito", "Quiz 365 (Hong Kong & Taiwan)", MACHINE_NO_COCKTAIL | MACHINE_IMPERFECT_GRAPHICS | MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/dynax/dynax.cpp b/src/mame/dynax/dynax.cpp index 3defcb21f9805..8d780abb93faf 100644 --- a/src/mame/dynax/dynax.cpp +++ b/src/mame/dynax/dynax.cpp @@ -253,7 +253,7 @@ void jantouki_state::jantouki_sound_rombank_w(uint8_t data) } -void dynax_adpcm_state::hnoridur_rombank_w(uint8_t data) +void dynax_state::hnoridur_rombank_w(uint8_t data) { m_bankdev->set_bank(data & 0x1f); } @@ -281,19 +281,19 @@ void dynax_adpcm_state::hnoridur_palette_update(offs_t offset) m_palette->set_pen_color(256 * m_palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b)); } -void dynax_adpcm_state::nanajign_palette_lo_w(offs_t offset, uint8_t data) +void dynax_state::nanajign_palette_lo_w(offs_t offset, uint8_t data) { m_palette_ram[256 * m_palbank + offset + 16 * 256] = data; nanajign_palette_update(offset); } -void dynax_adpcm_state::nanajign_palette_hi_w(offs_t offset, uint8_t data) +void dynax_state::nanajign_palette_hi_w(offs_t offset, uint8_t data) { m_palette_ram[256 * m_palbank + offset] = data; nanajign_palette_update(offset); } -void dynax_adpcm_state::nanajign_palette_update(offs_t offset) +void dynax_state::nanajign_palette_update(offs_t offset) { int bg = m_palette_ram[256 * m_palbank + offset]; int br = m_palette_ram[256 * m_palbank + offset + 16 * 256]; @@ -368,15 +368,7 @@ void dynax_adpcm_state::hnoridur_mem_map(address_map &map) map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); } -void dynax_adpcm_state::mcnpshnt_mem_map(address_map &map) -{ - map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6fff).ram(); - map(0x7000, 0x7fff).ram().share("nvram"); - map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); -} - -void dynax_adpcm_state::nanajign_mem_map(address_map &map) +void dynax_state::nanajign_mem_map(address_map &map) { map(0x0000, 0x5fff).rom(); map(0x6000, 0x6fff).ram(); @@ -392,14 +384,6 @@ void dynax_state::mjdialq2_mem_map(address_map &map) map(0x8000, 0xffff).bankr("bank1"); } -void dynax_adpcm_state::yarunara_mem_map(address_map &map) -{ - map(0x0000, 0x5fff).rom(); - map(0x6000, 0x6fff).ram(); - map(0x7000, 0x7fff).ram().share("nvram"); - map(0x8000, 0xffff).m(m_bankdev, FUNC(address_map_bank_device::amap8)); -} - //identical to yarunara, but nvram is in the 0x6000 - 0x6fff range void dynax_adpcm_state::quiztvqq_mem_map(address_map &map) { @@ -434,11 +418,11 @@ void dynax_adpcm_state::hnoridur_banked_map(address_map &map) map(0xc0000, 0xc7fff).ram(); // hnoridur: R/W RAM } -void dynax_adpcm_state::mjelctrn_banked_map(address_map &map) +void dynax_state::mjelctrn_banked_map(address_map &map) { map(0x00000, 0x3ffff).rom().region("maincpu", 0x10000); - map(0x80000, 0x800ff).w(FUNC(dynax_adpcm_state::nanajign_palette_lo_w)); - map(0xa0000, 0xa00ff).w(FUNC(dynax_adpcm_state::nanajign_palette_hi_w)); + map(0x80000, 0x800ff).w(FUNC(dynax_state::nanajign_palette_lo_w)); + map(0xa0000, 0xa00ff).w(FUNC(dynax_state::nanajign_palette_hi_w)); } void dynax_adpcm_state::nanajign_banked_map(address_map &map) @@ -543,7 +527,7 @@ void dynax_adpcm_state::hjingi_lockout_w(int state) machine().bookkeeping().coin_lockout_w(0, !state); } -uint8_t dynax_adpcm_state::hjingi_keyboard_0_r() +uint8_t dynax_state::hjingi_keyboard_0_r() { return hanamai_keyboard_r<0>() | (m_hopper->line_r() ? 0 : (1 << 6)); } @@ -687,8 +671,9 @@ void dynax_adpcm_state::yarunara_rombank_w(uint8_t data) m_bankdev->set_bank(data & 0x3f); } -void dynax_adpcm_state::yarunara_blit_romregion_w(uint8_t data) +void dynax_state::yarunara_blit_romregion_w(uint8_t data) { + logerror("%s: unmapped romregion=%02X\n", machine().describe_context(), data); switch(data) { case 0x00: dynax_blit_romregion_w(0); return; @@ -697,7 +682,6 @@ void dynax_adpcm_state::yarunara_blit_romregion_w(uint8_t data) case 0x81: dynax_blit_romregion_w(3); return; case 0x82: dynax_blit_romregion_w(4); return; // mjcomv1 } - logerror("%s: unmapped romregion=%02X\n", machine().describe_context(), data); } void dynax_adpcm_state::yarunara_io_map(address_map &map) @@ -926,12 +910,12 @@ void jantouki_state::jantouki_sound_io_map(address_map &map) Mahjong Electron Base ***************************************************************************/ -uint8_t dynax_adpcm_state::mjelctrn_keyboard_1_r() +uint8_t dynax_state::mjelctrn_keyboard_1_r() { return (hanamai_keyboard_r<1>() & 0x3f) | (ioport("FAKE")->read() ? 0x40 : 0); } -uint8_t dynax_adpcm_state::mjelctrn_dsw_r() +uint8_t dynax_state::mjelctrn_dsw_r() { int dsw = (m_keyb & 0xc0) >> 6; static const char *const dswnames[] = { "DSW0", "DSW1", "DSW2", "DSW3" }; @@ -973,6 +957,39 @@ void dynax_adpcm_state::mjelctrn_io_map(address_map &map) map(0xe7, 0xe7).w(FUNC(dynax_adpcm_state::hnoridur_palbank_w)); } +void dynax_state::qyjdzjp_io_map(address_map &map) +{ + map.global_mask(0xff); + map(0x04, 0x05).w("ym2413", FUNC(ym2413_device::write)); // + map(0x08, 0x08).w("aysnd", FUNC(ay8912_device::data_w)); // AY8912 + map(0x0a, 0x0a).w("aysnd", FUNC(ay8912_device::address_w)); // + map(0x0c, 0x0c).w("oki", FUNC(okim6295_device::write)); // +// map(0x20, 0x20).nopw(); // CRT Controller +// map(0x21, 0x21).nopw(); // CRT Controller + map(0x40, 0x47).w("outlatch", FUNC(ls259_device::write_d0)); + map(0x60, 0x60).w(FUNC(dynax_state::dynax_extra_scrollx_w)); // screen scroll X + map(0x62, 0x62).w(FUNC(dynax_state::dynax_extra_scrolly_w)); // screen scroll Y +// map(0x64, 0x64).w(FUNC(dynax_state::dynax_extra_scrollx_w)); // screen scroll X +// map(0x66, 0x66).w(FUNC(dynax_state::dynax_extra_scrolly_w)); // screen scroll Y + map(0x6a, 0x6a).w(FUNC(dynax_state::hnoridur_rombank_w)); // BANK ROM Select + map(0x80, 0x80).w(FUNC(dynax_state::hanamai_keyboard_w)); // keyboard row select + map(0x81, 0x81).portr("COINS"); // Coins + map(0x82, 0x82).r(FUNC(dynax_state::mjelctrn_keyboard_1_r)); // P2 + map(0x83, 0x83).r(FUNC(dynax_state::hjingi_keyboard_0_r)); // P1 + map(0x84, 0x84).r(FUNC(dynax_state::mjelctrn_dsw_r)); // DSW8 x 4 + map(0x85, 0x85).portr("SW1"); // DSW2 + map(0xa1, 0xa7).w(m_blitter, FUNC(dynax_blitter_rev2_device::regs_w)); // Blitter + map(0xc0, 0xc7).w(m_mainlatch, FUNC(ls259_device::write_d0)); + map(0xe0, 0xe0).w(m_blitter, FUNC(dynax_blitter_rev2_device::pen_w)); // Destination Pen + map(0xe1, 0xe1).w(FUNC(dynax_state::dynax_blit_dest_w)); // Destination Layer + map(0xe2, 0xe2).w(FUNC(dynax_state::dynax_blit_palette01_w)); // Layers Palettes + map(0xe3, 0xe3).w(FUNC(dynax_state::dynax_blit_palette23_w)); // + map(0xe4, 0xe4).w(FUNC(dynax_state::hanamai_priority_w)); // layer priority and enable + map(0xe5, 0xe5).w(FUNC(dynax_state::dynax_blit_backpen_w)); // Background Color + map(0xe6, 0xe6).w(FUNC(dynax_state::yarunara_blit_romregion_w)); // Blitter ROM bank + map(0xe7, 0xe7).w(FUNC(dynax_state::hnoridur_palbank_w)); +} + void dynax_adpcm_state::mjembase_io_map(address_map &map) { map.global_mask(0xff); @@ -4254,7 +4271,7 @@ void dynax_adpcm_state::yarunara(machine_config &config) hnoridur(config); // basic machine hardware - m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::yarunara_mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::nanajign_mem_map); m_maincpu->set_addrmap(AS_IO, &dynax_adpcm_state::yarunara_io_map); m_bankdev->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::yarunara_banked_map); @@ -4291,7 +4308,7 @@ void dynax_adpcm_state::mcnpshnt(machine_config &config) { hnoridur(config); - m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::mcnpshnt_mem_map); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_adpcm_state::nanajign_mem_map); m_maincpu->set_addrmap(AS_IO, &dynax_adpcm_state::mcnpshnt_io_map); MCFG_VIDEO_START_OVERRIDE(dynax_adpcm_state, mcnpshnt) // different priorities @@ -4495,6 +4512,63 @@ void dynax_adpcm_state::mjembase(machine_config &config) MCFG_VIDEO_START_OVERRIDE(dynax_adpcm_state, mjembase) } +void dynax_state::qyjdzjp(machine_config &config) +{ + /* basic machine hardware */ + TMPZ84C015(config, m_maincpu, 21.477272_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &dynax_state::nanajign_mem_map); + m_maincpu->set_addrmap(AS_IO, &dynax_state::qyjdzjp_io_map); + + ADDRESS_MAP_BANK(config, m_bankdev).set_map(&dynax_state::mjelctrn_banked_map).set_data_width(8).set_addr_width(20).set_stride(0x8000); + + NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_0); + + LS259(config, m_mainlatch); // IC25 + m_mainlatch->q_out_cb<0>().set(FUNC(dynax_state::flipscreen_w)); + m_mainlatch->q_out_cb<1>().set(FUNC(dynax_state::layer_half_w)); + m_mainlatch->q_out_cb<2>().set(FUNC(dynax_state::layer_half2_w)); + // Q3, Q4 seem to be related to wrap around enable + + ls259_device &outlatch(LS259(config, "outlatch")); // IC61 + outlatch.q_out_cb<0>().set(FUNC(dynax_state::coincounter_0_w)); + outlatch.q_out_cb<1>().set(FUNC(dynax_state::coincounter_1_w)); + outlatch.q_out_cb<2>().set(m_hopper, FUNC(hopper_device::motor_w)); + + HOPPER(config, m_hopper, attotime::from_msec(50)); + + /* video hardware */ + SCREEN(config, m_screen, SCREEN_TYPE_RASTER); + m_screen->set_refresh_hz(60); + m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); + m_screen->set_size(512, 256+22); + m_screen->set_visarea(0, 512-1-4, 16, 256-1); + m_screen->set_screen_update(FUNC(dynax_state::screen_update_hnoridur)); + m_screen->set_palette(m_palette); + m_screen->screen_vblank().set(m_maincpu, FUNC(tmpz84c015_device::trg0)).invert(); + + DYNAX_BLITTER_REV2(config, m_blitter, 0); + m_blitter->vram_out_cb().set(FUNC(dynax_state::hnoridur_blit_pixel_w)); + m_blitter->scrollx_cb().set(FUNC(dynax_state::dynax_blit_scrollx_w)); + m_blitter->scrolly_cb().set(FUNC(dynax_state::dynax_blit_scrolly_w)); + m_blitter->ready_cb().set(m_maincpu, FUNC(tmpz84c015_device::trg1)); + m_blitter->ready_cb().append(m_maincpu, FUNC(tmpz84c015_device::trg2)); + + PALETTE(config, m_palette).set_entries(16*256); + + MCFG_VIDEO_START_OVERRIDE(dynax_state, mjelctrn) + + /* sound hardware */ + SPEAKER(config, "mono").front_center(); + + ay8912_device &ay8912(AY8912(config, "aysnd", 12_MHz_XTAL / 8)); + ay8912.port_a_read_callback().set_ioport("DSW0"); + ay8912.add_route(ALL_OUTPUTS, "mono", 0.20); + + YM2413(config, "ym2413", 3.579545_MHz_XTAL).add_route(ALL_OUTPUTS, "mono", 1.0); + + OKIM6295(config, "oki", 12_MHz_XTAL / 12, okim6295_device::PIN7_HIGH).add_route(ALL_OUTPUTS, "mono", 0.8); +} + /*************************************************************************** Neruton ***************************************************************************/ @@ -5952,6 +6026,89 @@ ROM_START( mjelct3bl ) ROM_LOAD( "e2.u83", 0x100000, 0x080000, BAD_DUMP CRC(e1f1b431) SHA1(04a612aff4c30cb8ea741f228bfa7e4289acfee8) ) ROM_END +/*************************************************************************** +Que You Ji - Dian Zi Ji Pan Jiaqiang Ban (Mahjong Electron Base bootleg) +Hom Inn, 1997 +Hardware Info By Guru +--------------------- + +2J-255 +|--------------------------------------------| +| VOL SOCKET2 |-------| | +|uPC1241H | | 41264 41264 | +| S-1.U8 |AL9106A| | +| | | 41264 41264 | +|M3567 |-------| | +| 3.579545MHz 6116 41264 | +| | +|WF19054 6116 41264 | +| | +| | +|6845 |-------| | +| |-------| |TAICOM | | +| | ZILOG | |AL9301 | DSW2| +| |Z80EIPC| | | | +| |-------| |-------| DSW3| +| DSW1 | +| SOCKET1 21.477272MHz DSW4| +| 6264 C1815 T518A C1815 | +|SC DSW5| +| |-| 10-WAY |----| 18-WAY |--| | +|--| |--------| |-----------------| |----| +Notes: + AL9106 - TAICOM Custom Chip + AL9301 - TAICOM AL9301 Graphics Generator (QFP160) + Z84EIPC - Zilog Z84C1510FEC Z80 EIPC (Enhanced Intelligent Peripheral Controller). + Compatible with Toshiba TMPZ84C015BF-6. Clock Input 10.7375MHz [21.477272/2] + M3567 - Clone of Yamaha YM2413 OPLL FM Sound Chip. Clock Input 3.579545MHz + WF19054 - Winbond WF19054 clone of AY-3-8910. Clock 1.500MHz [12/8] + UPC1241H - NEC uPC1241H 7W Audio Power Amplifier + 6116 - 6116 2kB x8-bit SRAM + 6264 - 6264 8kB x8-bit SRAM (battery-backed) + 41264 - NEC D41264C-15 Dual-Port RAM with 64kB x4-bit DRAM Port and 256 x4-bit Serial Port + 6845 - Goldstar GM68B45S CRT Controller + T518A - Mitsumi T518A Reset Chip + DSW1 - 2-Position DIP Switch + DSW2-5 - 8-Position DIP Switch + SC - 0.047F 5.5V Super Cap + C1815 - 2SC1815 General-Purpose NPN Transistor + 358 - LM358 Dual Operational Amplifier + S-1.U8 - 27C4000 mask ROM + SOCKET1 - Plugged in here is a sub-board marked 'HOM INN MJXB-1' containing.... + 12MHz Crystal + EPROM 27C020 (Oki Samples) + EPROM 27C010 (Z80 Program) + Oki M6295 ADPCM Sample Player. Clock Input 1.000MHz [12/12]. Pin 7 HIGH + ALTERA EPM7032 PLCC44 CPLD + 7404 Logic Chip + 74161 Logic Chip + 78L05 5V Linear Regulator (TO92) + 2SC945 Transistor + 10-Pin Connector with cable joined to parts on main board with 7 wires. + SOCKET2 - Plugged in here is a sub-board marked 'HOM INN MJXB-2' containing.... + 2x 27C4000 mask ROMs + 74LS00 Logic Chip + Socket on main board is wired for 8Mbit ROM so when highest address line + A19 is low or high the logic chip enables OE on one of the 4Mbit ROMs. +***************************************************************************/ + +ROM_START( qyjdzjp ) + ROM_REGION( 0x50000, "maincpu", 0 ) // Z80 Code + ROM_LOAD( "prg.u24", 0x00000, 0x20000, CRC(86d53500) SHA1(61f9aed3da2b49bf9c45ee8d7416cd2ea0300453) ) + ROM_RELOAD( 0x28000, 0x08000 ) + ROM_CONTINUE( 0x20000, 0x08000 ) + ROM_CONTINUE( 0x18000, 0x08000 ) + ROM_CONTINUE( 0x10000, 0x08000 ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data + ROM_LOAD( "s-1.u8", 0x000000, 0x100000, CRC(e5c41448) SHA1(b8322e32b0cb3d771316c9c4f7be91de6e422a24) ) + ROM_LOAD( "4m-l.bin", 0x100000, 0x080000, CRC(140738f6) SHA1(996c92ec33b8a3b819a2be7795248c9e214562df) ) + ROM_LOAD( "4m-h.bin", 0x180000, 0x080000, CRC(865987c2) SHA1(0711e309e8c48af7d92b59dbd1407636ce0455ac) ) + + ROM_REGION( 0x40000, "oki", 0 ) + ROM_LOAD( "oki.u22", 0x00000, 0x40000, CRC(a6340587) SHA1(91f55776fc4f20720f3e3ca965ba9388d3668881) ) +ROM_END + /*************************************************************************** Mahjong Electromagnetic Base (Dynax, 1989) @@ -6347,6 +6504,20 @@ ROM_START( mjreach ) ROM_RELOAD( 0x180000, 0x80000 ) ROM_END +ROM_START( mjreacha ) + ROM_REGION( 0x50000, "maincpu", 0 ) + ROM_LOAD( "cs16-1.u15", 0x00000, 0x40000, CRC(d557ddf2) SHA1(504a8184270524a22be7767cc17cc33465e42d21) ) // SLDH + ROM_RELOAD( 0x10000, 0x40000 ) + ROM_LOAD( "mjreach-mcu.u3", 0x00000, 0x02000, CRC(091a85dc) SHA1(964ccbc13466464c2feee10f807078ec517bed5c) ) + + ROM_REGION( 0x200000, "blitter", 0 ) // blitter data + ROM_LOAD( "cs16-3.u13", 0x000000, 0x80000, CRC(90f6036f) SHA1(f92aafd0316dc235e58d615825f3110806bc2cf9) ) + ROM_LOAD( "cs16-2.u12", 0x080000, 0x40000, CRC(5558428d) SHA1(b5e30673695b6e56a8c513b484f4f9c225c682cc) ) + ROM_RELOAD( 0x0c0000, 0x40000 ) + ROM_LOAD( "cs16-3.u13", 0x100000, 0x80000, CRC(90f6036f) SHA1(f92aafd0316dc235e58d615825f3110806bc2cf9) ) + ROM_RELOAD( 0x180000, 0x80000 ) +ROM_END + /*************************************************************************** Mahjong Reach (bootleg) @@ -7086,6 +7257,7 @@ GAME( 1993, mjelct3bl, mjelctrn, mjelctrn, mjelct3, dynax_adpcm_state, init_ GAME( 1990, majxtal7, 7jigen, neruton, majxtal7, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax", "Mahjong X-Tal 7 - Crystal Mahjong / Mahjong Diamond 7 (Japan)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // reuses a subset of 7jigen assets GAME( 1990, neruton, 0, neruton, neruton, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. B?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1990, nerutona, neruton, neruton, nerutona, dynax_adpcm_state, init_mjelct3, ROT180, "Dynax / Yukiyoshi Tokoro", "Mahjong Neruton Haikujiradan (Japan, Rev. A?)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1997, qyjdzjp, mjelctrn, qyjdzjp, mjelct3, dynax_state, empty_init, ROT180, "bootleg (Hom Inn)", "Que You Ji - Dian Zi Ji Pan Jiaqiang Ban (v201)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, hanayara, 0, yarunara, hanayara, dynax_adpcm_state, empty_init, ROT180, "Dynax", "Hana wo Yaraneba! (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, mjcomv1, 0, mjangels, mjcomv1, dynax_adpcm_state, empty_init, ROT180, "Dynax", "Mahjong Comic Gekijou Vol.1 (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, tenkai, 0, tenkai, tenkai, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Tenkaigen (Japan)", MACHINE_SUPPORTS_SAVE ) @@ -7097,7 +7269,8 @@ GAME( 1991, ougonhai, 0, ougonhai, ougonhai, dynax_state, empty GAME( 1991, ougonhaib1, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 1, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, ougonhaib2, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 2, medal)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, ougonhaib3, ougonhai, ougonhaib1, ougonhai, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Ougon no Pai (Japan bootleg set 3, medal)", MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) -GAME( 1994, mjreach, 0, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mjreach, 0, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00, set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1994, mjreacha, mjreach, mjreach, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach (Ver. 1.00, set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, mjreachbl, mjreach, mjreach, mjreach, dynax_state, empty_init, ROT0, "bootleg", "Mahjong Reach (Ver. 1.00, bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, mjreachp2, mjreach, mjreachp2, mjreach, dynax_state, empty_init, ROT0, "Dynax", "Mahjong Reach Part II (Ver. D88)", MACHINE_SUPPORTS_SAVE ) GAME( 1994, cdracula, 0, cdracula, cdracula, cdracula_state, empty_init, ROT0, "Yun Sung (Escape license)", "Castle Of Dracula", MACHINE_SUPPORTS_SAVE ) // not a Dynax board diff --git a/src/mame/dynax/dynax.h b/src/mame/dynax/dynax.h index 061a660a6b338..c9838e0df6316 100644 --- a/src/mame/dynax/dynax.h +++ b/src/mame/dynax/dynax.h @@ -41,16 +41,17 @@ class dynax_state : public driver_device { } - void mjfriday(machine_config &config); - void gekisha(machine_config &config); - void majrjhdx(machine_config &config); - void tenkai(machine_config &config); - void ougonhai(machine_config &config); - void ougonhaib1(machine_config &config); - void mjreach(machine_config &config); - void mjreachp2(machine_config &config); - void mjdialq2(machine_config &config); - void sprtmtch(machine_config &config); + void mjfriday(machine_config &config) ATTR_COLD; + void gekisha(machine_config &config) ATTR_COLD; + void majrjhdx(machine_config &config) ATTR_COLD; + void tenkai(machine_config &config) ATTR_COLD; + void ougonhai(machine_config &config) ATTR_COLD; + void ougonhaib1(machine_config &config) ATTR_COLD; + void mjreach(machine_config &config) ATTR_COLD; + void mjreachp2(machine_config &config) ATTR_COLD; + void mjdialq2(machine_config &config) ATTR_COLD; + void sprtmtch(machine_config &config) ATTR_COLD; + void qyjdzjp(machine_config &config) ATTR_COLD; void blitter_ack_w(int state); void sprtmtch_blitter_irq_w(int state); @@ -99,13 +100,23 @@ class dynax_state : public driver_device void coincounter_1_w(int state); uint8_t ret_ff(); template uint8_t hanamai_keyboard_r(); + uint8_t hjingi_keyboard_0_r(); + uint8_t mjelctrn_keyboard_1_r(); + uint8_t mjelctrn_dsw_r(); void hanamai_keyboard_w(uint8_t data); void dynax_rombank_w(uint8_t data); + void hnoridur_rombank_w(uint8_t data); void dynax_blit_palette23_w(uint8_t data); void blit_palbank_w(int state); void dynax_blit_backpen_w(uint8_t data); void dynax_blit_palette01_w(uint8_t data); void dynax_layer_enable_w(uint8_t data); + void hanamai_priority_w(uint8_t data); + void yarunara_blit_romregion_w(uint8_t data); + void hnoridur_palbank_w(uint8_t data); + void nanajign_palette_lo_w(offs_t offset, uint8_t data); + void nanajign_palette_hi_w(offs_t offset, uint8_t data); + void nanajign_palette_update(offs_t offset); uint32_t screen_update_hanamai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_hnoridur(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -120,6 +131,8 @@ class dynax_state : public driver_device void dynax_common_reset(); void sprtmtch_mem_map(address_map &map) ATTR_COLD; + void nanajign_mem_map(address_map &map) ATTR_COLD; + void mjelctrn_banked_map(address_map &map) ATTR_COLD; // up to 8 layers, 2 images per layer (interleaved on screen) std::unique_ptr m_pixmap[8][2]{}; @@ -221,6 +234,8 @@ class dynax_state : public driver_device void mjreachp2_map(address_map &map) ATTR_COLD; + void qyjdzjp_io_map(address_map &map) ATTR_COLD; + // misc int m_rombank = 0; uint8_t m_tenkai_p5_val = 0U; @@ -271,27 +286,17 @@ class dynax_adpcm_state : public dynax_state // misc int m_toggle = 0; - void hnoridur_rombank_w(uint8_t data); - void hnoridur_palbank_w(uint8_t data); void hnoridur_palette_lo_w(offs_t offset, uint8_t data); void hnoridur_palette_hi_w(offs_t offset, uint8_t data); void hnoridur_palette_update(offs_t offset); - void nanajign_palette_lo_w(offs_t offset, uint8_t data); - void nanajign_palette_hi_w(offs_t offset, uint8_t data); - void nanajign_palette_update(offs_t offset); void hjingi_lockout_w(int state); - uint8_t hjingi_keyboard_0_r(); uint8_t hjingi_keyboard_1_r(); void yarunara_input_w(offs_t offset, uint8_t data); uint8_t yarunara_input_r(offs_t offset); void yarunara_rombank_w(uint8_t data); - void yarunara_blit_romregion_w(uint8_t data); - uint8_t mjelctrn_keyboard_1_r(); - uint8_t mjelctrn_dsw_r(); void mjembase_blit_dest_w(uint8_t data); void mjembase_blit_palette23_w(uint8_t data); void hanamai_blit_pixel_w(offs_t offset, uint8_t data); - void hanamai_priority_w(uint8_t data); void mjembase_priority_w(uint8_t data); void adpcm_int(int state); @@ -304,13 +309,9 @@ class dynax_adpcm_state : public dynax_state DECLARE_VIDEO_START(neruton); void hnoridur_mem_map(address_map &map) ATTR_COLD; - void mcnpshnt_mem_map(address_map &map) ATTR_COLD; - void nanajign_mem_map(address_map &map) ATTR_COLD; - void yarunara_mem_map(address_map &map) ATTR_COLD; void quiztvqq_mem_map(address_map &map) ATTR_COLD; void hnoridur_banked_map(address_map &map) ATTR_COLD; - void mjelctrn_banked_map(address_map &map) ATTR_COLD; void nanajign_banked_map(address_map &map) ATTR_COLD; void yarunara_banked_map(address_map &map) ATTR_COLD; void mjangels_banked_map(address_map &map) ATTR_COLD; diff --git a/src/mame/dynax/dynax_v.cpp b/src/mame/dynax/dynax_v.cpp index e870f691a8f1a..6e132be0bbca8 100644 --- a/src/mame/dynax/dynax_v.cpp +++ b/src/mame/dynax/dynax_v.cpp @@ -201,7 +201,7 @@ void jantouki_state::blit2_palbank_w(int state) LOG("PB'=%d ", state); } -void dynax_adpcm_state::hnoridur_palbank_w(uint8_t data) +void dynax_state::hnoridur_palbank_w(uint8_t data) { m_palbank = data & 0x0f; m_blit_palbank = data; // ??? @@ -832,7 +832,7 @@ void dynax_state::mjdialq2_copylayer( bitmap_ind16 &bitmap, const rectangle &cli } } -void dynax_adpcm_state::hanamai_priority_w(uint8_t data) +void dynax_state::hanamai_priority_w(uint8_t data) { m_hanamai_priority = data; } diff --git a/src/mame/igs/igs_m027.cpp b/src/mame/igs/igs_m027.cpp index a9ebfd21697fd..bd7a3a20140ed 100644 --- a/src/mame/igs/igs_m027.cpp +++ b/src/mame/igs/igs_m027.cpp @@ -3670,9 +3670,9 @@ GAME( 2001, extradrw, 0, extradrw, base, igs_m027_stat GAME( 2002, chessc2, 0, chessc2, chessc2, igs_m027_state, init_chessc2, ROT0, "IGS", "Chess Challenge II (ver. 1445A)", MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION ) // these can select between two different games via DIP switch (currently unemulated feature) -GAME( 2007, cjddzs, 0, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V302CN)", MACHINE_NOT_WORKING ) -GAME( 2009, cjddzsa, cjddzs, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "IGS", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jiaqiang Ban (V405CN)", MACHINE_NOT_WORKING ) -GAME( 200?, cjddzps, 0, cjddz, cjddzp, igs_m027_state, init_cjddzps, ROT0, "IGS", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN) / unknown second set", MACHINE_NOT_WORKING ) +GAME( 2007, cjddzs, 0, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "bootleg", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jianan Ban (V302CN)", MACHINE_NOT_WORKING ) +GAME( 2009, cjddzsa, cjddzs, cjddz, cjddz, igs_m027_state, init_cjddzs, ROT0, "bootleg", "Chaoji Dou Dizhu (V219CN) / Chaoji Dou Dizhu Jianan Ban (V405CN)", MACHINE_NOT_WORKING ) +GAME( 200?, cjddzps, 0, cjddz, cjddzp, igs_m027_state, init_cjddzps, ROT0, "bootleg", "Chaoji Dou Dizhu Jiaqiang Ban (S300CN) / unknown second set", MACHINE_NOT_WORKING ) // Incomplete dumps GAME( 1999, amazonia, 0, m027_1ppi, amazonia, igs_m027_state, init_amazonia, ROT0, "IGS", "Amazonia King (V104BR)", MACHINE_NOT_WORKING ) diff --git a/src/mame/igs/pgm.cpp b/src/mame/igs/pgm.cpp index 8e0f543aab8fa..1b20a95d90993 100644 --- a/src/mame/igs/pgm.cpp +++ b/src/mame/igs/pgm.cpp @@ -1983,7 +1983,7 @@ ROM_START( kovqhsgs ) ROM_IGNORE( 0x400000 ) // c00000-ffffff empty ROM_END -ROM_START( kovqhsgs302 ) // cart with 2010--04--16 main PCB and 2009-09-01 ROM PCB +ROM_START( kovgsyx ) // cart with 2010--04--16 main PCB and 2009-09-01 ROM PCB ROM_REGION( 0x600000, "maincpu", 0 ) /* 68000 Code, on main PCB */ PGM_68K_BIOS ROM_LOAD16_WORD_SWAP( "27c322.u3", 0x100000, 0x400000, CRC(4018559f) SHA1(e7e97ce89e1f563e8e08501ec3c2be6d81107253) ) // V300CN V302CN Dec 29 2010 16:31:32 @@ -5496,7 +5496,6 @@ GAME( 1999, kovsh100, kovsh, pgm_arm_type1, kovsh, pgm_arm_ // 拳皇三国特別版/Quánhuáng sānguó Tèbié bǎn // nasty modern asian bootleg of Knights of Valour Super Heroes with characters ripped from SNK's The King of Fighters series! GAME( 2008, kovqhsgs, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg", "Quanhuang Sanguo Tebie Ban (bootleg of Knights of Valour Super Heroes, V303CN, Nov 21 2008 19:03:49)", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 2010, kovqhsgs302, kovsh, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg", "Quanhuang Sanguo Tebie Ban (bootleg of Knights of Valour Super Heroes, V302CN, Dec 29 2010 16:31:32)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) // needs decryption, actual title is probably different //三國戰紀2/Sānguó zhàn jì 2 (Traditional Chinese only in title screen) // region provided by internal ARM rom @@ -5730,3 +5729,5 @@ GAME( 200?, kovlsqh2, kovshp, pgm_arm_type1, kovsh, pgm_arm_ //乱世街霸/Luànshì jiē bà GAME( 200?, kovlsjb, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovlsqh2, ROT0, "bootleg", "Luanshi Jie Ba (bootleg of Knights of Valour Super Heroes Plus, ver. 200CN, set 1)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ GAME( 200?, kovlsjba, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovlsqh2, ROT0, "bootleg", "Luanshi Jie Ba (bootleg of Knights of Valour Super Heroes Plus, ver. 200CN, set 2)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) /* need internal rom of IGS027A */ + +GAME( 2010, kovgsyx, kovshp, pgm_arm_type1, kovsh, pgm_arm_type1_state, init_kovqhsgs, ROT0, "bootleg", "Gaishi Xingxiong Tebie Ban (bootleg of Knights of Valour Super Heroes Plus, V302CN, Dec 29 2010 16:31:32)", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE ) // needs decryption and IGS027A simulation adaptation diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 3ce5202af7143..4962f65c2e838 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -17632,6 +17632,7 @@ mjmyorntr mjmyster mjmyuniv mjmyunivbl +mjmyunivbl2 mjmywrld mjreach1 mjschuka @@ -17667,6 +17668,7 @@ hjingia hnkochou hnoridur inca +intrgirl jantouki janyuki majxtal7 @@ -17687,6 +17689,7 @@ mjelctrn mjembase mjfriday mjreach +mjreacha mjreachbl mjreachp2 neruton @@ -17696,8 +17699,8 @@ ougonhaib1 ougonhaib2 ougonhaib3 quiztvqq +qyjdzjp shpeng -intrgirl sprtmtch tenkai tenkai2b @@ -20747,6 +20750,7 @@ kov2p200 kov2p202 kov2p203 kov2p204 +kovgsyx kovlsjb kovlsjba kovlsqh @@ -20754,7 +20758,6 @@ kovlsqh2 kovplus kovplusa kovqhsgs -kovqhsgs302 kovsgqyz kovsgqyza kovsgqyzb From 364db2f68936df53238ae67317768e3917ec0224 Mon Sep 17 00:00:00 2001 From: ClawGrip Date: Tue, 11 Mar 2025 18:03:06 +0100 Subject: [PATCH 145/272] Add a skeleton driver for Cisco CSS11501S-K9 Content Services Switch (#13384) --- src/mame/mame.lst | 3 + src/mame/skeleton/css11501sk9.cpp | 141 ++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 src/mame/skeleton/css11501sk9.cpp diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 4962f65c2e838..585a9432c5244 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -42581,6 +42581,9 @@ cosmicos @source:skeleton/cp1.cpp cp1 +@source:skeleton/css11501sk9.cpp +css11501sk9 + @source:skeleton/ct909e_segadvd.cpp megatrix diff --git a/src/mame/skeleton/css11501sk9.cpp b/src/mame/skeleton/css11501sk9.cpp new file mode 100644 index 0000000000000..7aa11b2dce92e --- /dev/null +++ b/src/mame/skeleton/css11501sk9.cpp @@ -0,0 +1,141 @@ +// license:BSD-3-Clause +// copyright-holders: + +/********************************************************************************************************************** + +Skeleton driver for Cisco CSS11501S-K9 Content Services Switch with SSL. + +The appliance has eight 10/100 Ethernet ports, one 10Base-T port for management, one RJ45 serial port for console, two +PCMCIA slots for storage and one Gigabit Ethernet port (GBIC). + +Hardware components: + +Main board. + -Sipex SP3243ECA Intelligent RS-232 Transceiver. + -Crystal CrystalLAN CS8900A Ethernet ISA LAN Controller. + -Exar ST16C1551 UART. + -Microchip PIC16LF877PT next to a 10 MHz crystal (U35). + -Xilinx Spartan XC2S50 (U23). + -Atmel 24C02N SEEPROM (U11) next to the Xilinx Spartan XC2S50 at U23. + -Two PCMCIA slots for Microdrive or Flash Drive. + -Intel SPD6722QCCE PC-Card/PCMCIA controller. + -Two 24C04R6 SEEPROMs near the two PCMCIA slots (U25 and U32). + -Sipex 3223ECY RS-232 transceiver. + -ST M4T32-BR12SH6 Timekeeper. + -Xilinx Spartan XC2S50 (another one, U33). + -Another 24C02N (U28), near the Xilinx Spartan XC2S50 at U33. + -Vitesse VSC2102-08UQ Network Processor / Intelligent Packet Processor, near a 25 MHz crystal. + -Intel LXT9785EHC 8-port Fast Ethernet PHY Transceiver near a 50 MHz crystal. + -PMC RM7000A 400T 64-Bit MIPS RISC Microprocessor with Integrated L2 cache. + -AMD AM29LV3200B Flash Memory. + -PMC PM2329-BC. + -Vitesse VSC2708-00UR. + -AMCC S2068TB. + -Cypress CY7C1360B-166AC 9-Mbit (256K x 36) Pipelined SRAM. + -Samsung K7N403601B-QC13 128Kx36 Pipelined NtRAM. + -SORIMM slot with a 256MB RAM module (Samsung MS18R1628EH0-CM8CI). + -Cypress CY7C1360B-166AC 9-Mbit (256K x 36) Pipelines SRAM (another one). + -Intel SPD6722QCCE PC-Card/PCMCIA controller. + -Xilinx XC18V02 next to the first Xilinx Spartan XC2S50 (U23). + +Sub-board (SSL acceleration). + -Broadcom BCM5821A1KTB Super E-Commerce Processor (high-performance public-key processor) next to a 100 MHz crystal. + -Martel GT-64120A-BN-3 (System Controller for 7000 CPU) next to another 100 MHz crystal. + -PMC RM7000A 400T 64-Bit MIPS RISC Microprocessor with Integrated L2 cache. + -AMD AM29LV1600B Flash Memory. + -Altera Max EPM3128ATC100-5 + -Broadcom BCM5700C2KPB PCI-X 10/100/1000 Base-T controller, near a 125 MHz crystal. + -Vitesse VSC2102-08UQ Network Processor / Intelligent Packet Processor, near a 25 MHz crystal. + -IDT 71V546S133PF 128K x 36, 3.3V Synchronous SRAM with ZBT Feature, Burst Counter and Pipelined Outputs. + -24C04R SEEPROM between the BCM5700C2KPB, the VSC2102-08UQ, and the 71V546S133PF. + -Microchip PIC16LF872 next to a 10 MHz crystal. + -Xilinx Spartan XC2S50. + -Xilinx 18V01JC In-System Programmable Configuration PROM next to the Xilinx Spartan XC2S50. + -SORIMM slot with a 64MB RAM module (Samsung MS18R1622EH0-CM8). + -SODIMM slot with a 512MB RAM module (Cisco CIS00-21160-111CD). + +**********************************************************************************************************************/ + +#include "emu.h" +#include "cpu/mips/mips3.h" + + +namespace { + +class css11501sk9_state : public driver_device +{ +public: + css11501sk9_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_sslcpu(*this, "sslcpu") + { } + + void css11501sk9(machine_config &config); + +private: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + + required_device m_maincpu; + required_device m_sslcpu; +}; + + +// Input ports +static INPUT_PORTS_START( css11501sk9 ) +INPUT_PORTS_END + + +void css11501sk9_state::machine_reset() +{ +} + +void css11501sk9_state::machine_start() +{ +} + +void css11501sk9_state::css11501sk9(machine_config &config) +{ + // basic machine hardware + RM7000BE(config, m_maincpu, 400'000'000); // Main CPU, PMC RM7000A 400T + RM7000BE(config, m_sslcpu, 400'000'000); // SSL CPU, PMC RM7000A 400T +} + + +ROM_START( css11501sk9 ) + ROM_REGION(0x410000, "maincpu", 0) // Main + ROM_LOAD( "css11501s-k9_73-8174-04_17-7009-03_cs-a393_0514_hm_am29lv320db.u46", 0x000000, 0x410000, CRC(fdc00a8f) SHA1(cc89c39462e783d874abebbed2a80bd9ec095047) ) + + ROM_REGION(0x200000, "sslcpu", 0) // SSL + ROM_LOAD( "css11501s-k9_73-6917-06_17-6860-03_cs-7edd_0525_am29lv160db.u36", 0x000000, 0x200000, CRC(6dfe6620) SHA1(06cc9015907c74284a6b85393c0024729146a19b) ) + + ROM_REGION(0x001eb3, "plds", 0) + ROM_LOAD( "css11501s-k9_73-6917-06_17-6858-01_172f5a_2305_i4ps_epm3128atc100-5.u11", 0x000000, 0x001eb3, CRC(a094a0d3) SHA1(a4897096fd7b26b3a3e3c928fa8d1cfd2a2f5641) ) // Altera Max EPM3128ATC100-5 on SSL sub-board + + ROM_REGION(0x040000, "fpga", 0) + ROM_LOAD( "css11501s-k9_73-6917-06_17-6859-02_cs-32cb_0519_xilinx_18v01jc.u2", 0x000000, 0x020000, CRC(bd69fa75) SHA1(9ff93c1f202ad1c178996e7ffd2afd644afd3fe6) ) // Xilinx 18V01JC next to the Xilinx Spartan XC2S50, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-8174-04_17-7008-02_cs-3be7_0524_xc18v02cg44.u43", 0x000000, 0x040000, CRC(a258b636) SHA1(f1cd8409362572cc45fa077179d98a1bb0df383f) ) // Xilinx XC18V02 next to the Xilinx Spartan XC2S50 at U23, on main PCB + + ROM_REGION(0x000200, "seeprom", 0) + ROM_LOAD( "css11501s-k9_73-8174-04_24c02n.u11", 0x000000, 0x000100, CRC(bbe4ba95) SHA1(a56ebd9a98a51d63178da7c93c2b9e557e987a5c) ) // 24C02N SEEPROM near the Xilinx Spartan XC2S50 at U23, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c02n.u28", 0x000000, 0x000100, CRC(a10ac3ca) SHA1(c68610c51106d2351570c1c77ab1cf1fb210ffb1) ) // 24C02N SEEPROM near the Xilinx Spartan XC2S50 at U33, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c04r6.u25", 0x000000, 0x000200, CRC(cfe0b9c1) SHA1(2af0645dc5aaab26c0330ef97b97c4958f3ff173) ) // 24C04R6 SEEPROM near the PCMCIA slots, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_24c04r6.u32", 0x000000, 0x000200, CRC(d2b2c2d3) SHA1(ea2ec6863749e1020a79710b36d1ac42528c7855) ) // 24C04R6 SEEPROM near the PCMCIA slots, on main PCB + ROM_LOAD( "css11501s-k9_73-6917-06_24c04r6.u33", 0x000000, 0x000200, CRC(bd7bc39f) SHA1(9d0ac37bb3ec8c95990fd37a962a17a95ce97aa0) ) // 24C04R SEEPROM between the BCM5700C2KPB, the VSC2102-08UQ, and the 71V546S133PF, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-6917-06_24c02n.u8", 0x000000, 0x000100, CRC(dcbe3083) SHA1(81934196733a8878cc19ced4f1791dfaa4da494a) ) // 24C02N SEEPROM between the BCM5700C2KPB, the 71V546S133PF, and the XC2S50, on SSL sub-board + + ROM_REGION(0x004400, "pic", 0) + // CONFIG = 3eh, ID = ff3fff3fff3fff3fh + ROM_LOAD( "css11501s-k9_73-8174-04_17-6486-03_2605_27af12_pic16lf877pt_user.u35", 0x000000, 0x004000, CRC(22b03fe9) SHA1(984c14fb013763aa4fb981888480d19a6058843b) ) // PIC16LF877, on main PCB + ROM_LOAD( "css11501s-k9_73-8174-04_17-6486-03_2605_27af12_pic16lf877pt_data.u35", 0x000000, 0x000200, CRC(14bfe63a) SHA1(ebe833da793930303ac57c873a97f8383494a939) ) // PIC16LF877, on main PCB + + // CONFIG = 3eh, ID = 7f007f007f007f00h + ROM_LOAD( "css11501s-k9_73-8174-04_17-6494-02_1605_92817_pic16lf872_user.u7", 0x000000, 0x001000, CRC(6deebf3a) SHA1(c8f030657b7959c6d3aa5b1583786eb84ed199c1) ) // PIC16LF872, on SSL sub-board + ROM_LOAD( "css11501s-k9_73-8174-04_17-6494-02_1605_92817_pic16lf872_data.u7", 0x000000, 0x000080, CRC(903500ff) SHA1(d33277afda835773cfcc9bc137690cbe79943f0f) ) // PIC16LF872, on SSL sub-board +ROM_END + +} // Anonymous namespace + +// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS +SYST( 2002, css11501sk9, 0, 0, css11501sk9, css11501sk9, css11501sk9_state, empty_init, "Cisco", "CSS11501S-K9", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) From bf717904e3dda286c69e9813f0a2ba59dc397bb7 Mon Sep 17 00:00:00 2001 From: MetalliC <0vetal0@gmail.com> Date: Tue, 11 Mar 2025 19:04:24 +0200 Subject: [PATCH 146/272] New not working machine ----------------------- Nihonzenkoku-katochan-no-kurukuru-ressya-de-Pe! (Ver.1.00, 2004/10/24) [Darksoft, MetalliC, rtw] --- src/mame/capcom/alien.cpp | 16 ++++++++++++++++ src/mame/mame.lst | 1 + 2 files changed, 17 insertions(+) diff --git a/src/mame/capcom/alien.cpp b/src/mame/capcom/alien.cpp index 1b9d14001c4ba..129e5ba58f963 100644 --- a/src/mame/capcom/alien.cpp +++ b/src/mame/capcom/alien.cpp @@ -567,6 +567,21 @@ ROM_START( dkjfever ) ROM_COPY( "ymz770_flash1", 0, 0, 0x800000 ) ROM_END +ROM_START( katochan ) + ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) // BIOS and game code/data + ROM_LOAD32_WORD( "spk_04.ic30", 0x000000, 0x400000, CRC(46f46ad6) SHA1(131d12a7903ca3d6ee69cb9f1e8fe067302a31c5) ) + ROM_LOAD32_WORD( "spk_05.ic33", 0x000002, 0x400000, CRC(10a6bd39) SHA1(0a0d0f35408733dc77b0e7e06abde35247d4bd75) ) + ROM_LOAD32_WORD( "spk_06.ic39", 0x800000, 0x400000, CRC(f3e08f70) SHA1(fc50dad40e29edcb4bac544064529196e4e46065) ) + ROM_LOAD32_WORD( "spk_07.ic42", 0x800002, 0x400000, CRC(54ce0143) SHA1(8e8cc80f31f3ebe4a1a51aee554ab012a2bc6a66) ) + + ROM_REGION( 0x800100, "ymz770_flash1", ROMREGION_ERASEFF ) + ROM_LOAD16_WORD_SWAP( "spk_01.ic31", 0x000000, 0x400000, CRC(96e2d8d0) SHA1(3437b4dd7f1a7901cb764b9690931bfee1ceee25) ) + ROM_LOAD16_WORD_SWAP( "spk_02.ic38", 0x400000, 0x400000, CRC(3660a0d1) SHA1(0877eaca4665797c1c70cdf9a7ffafbcab754a89) ) + + ROM_REGION( 0x800000, "ymz770", 0 ) + ROM_COPY( "ymz770_flash1", 0, 0, 0x800000 ) +ROM_END + ROM_START( mariojjl ) ROM_REGION32_LE( 0x1000000, "maincpu", 0 ) ROM_LOAD32_WORD( "spm_04c.ic30", 0x000000, 0x400000, CRC(159e912d) SHA1(5db1434d34e52f9c35d71e05675dd035765d2e6f) ) @@ -711,6 +726,7 @@ GAME( 2004, masmarios, 0, alien, alien, alien_state, empty_init, GAME( 2005, masmario2, 0, masmario2, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Super Mario Fushigi no Korokoro Party 2", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // Medalusion 1 GAME( 2005, dkjfever, 0, alien, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Donkey Kong Jungle Fever (Ver.1.000, 2005/08/03)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ドンキーコングジャングルフィーバー +GAME( 2004, katochan, 0, alien, alien, alien_state, empty_init, ROT0, "Capcom", "Nihonzenkoku-katochan-no-kurukuru-ressya-de-Pe! (Ver.1.00, 2004/10/24)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // 日本全国加トちゃんのくるくる列車でペ GAME( 2006, mariojjl, 0, alien, alien, alien_state, empty_init, ROT0, "Nintendo / Capcom", "Super Mario Fushigi no JanJanLand (Ver.1.00C, 2006/08/29)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) GAME( 2005, mmaruchan, 0, alien, alien, alien_state, empty_init, ROT0, "Capcom", "Chibi Maruko-chan ~Minna de Sugoroku Asobi~ no Maki (Ver.1.00B, 2005/06/22)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ちびまる子ちゃん「みんなですごろく遊び」の巻 GAME( 2004, mmaruchana,mmaruchan,alien, alien, alien_state, empty_init, ROT0, "Capcom", "Chibi Maruko-chan ~Minna de Sugoroku Asobi~ no Maki (Ver.1.00A, 2004/04/20)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // ちびまる子ちゃん「みんなですごろく遊び」の巻 diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 4962f65c2e838..6f81496a4ac50 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -15270,6 +15270,7 @@ dkbanans dkjfever dokodemo gekimaka +katochan mariojjl masmario masmarios From d69383bfb699daace0b565aa0ecdecdf39a119d1 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 12 Mar 2025 17:02:57 +1100 Subject: [PATCH 147/272] 3rdparty/lua: Updated to Lua 5.4.7. --- 3rdparty/lua/Makefile | 4 +- 3rdparty/lua/README | 2 +- 3rdparty/lua/doc/OSIApproved_100X125.png | Bin 0 -> 12127 bytes 3rdparty/lua/doc/contents.html | 20 +- 3rdparty/lua/doc/lua.1 | 18 +- 3rdparty/lua/doc/lua.css | 1 + 3rdparty/lua/doc/manual.html | 355 +++++++++++++++-------- 3rdparty/lua/doc/osi-certified-72x60.png | Bin 3774 -> 0 bytes 3rdparty/lua/doc/readme.html | 53 ++-- 3rdparty/lua/src/Makefile | 5 +- 3rdparty/lua/src/lapi.c | 253 ++++++++-------- 3rdparty/lua/src/lapi.h | 17 +- 3rdparty/lua/src/lauxlib.c | 84 ++++-- 3rdparty/lua/src/lcode.c | 170 +++++++---- 3rdparty/lua/src/lcode.h | 3 - 3rdparty/lua/src/lcorolib.c | 4 +- 3rdparty/lua/src/ldebug.c | 298 +++++++++++-------- 3rdparty/lua/src/ldebug.h | 3 +- 3rdparty/lua/src/ldo.c | 239 ++++++++------- 3rdparty/lua/src/ldo.h | 18 +- 3rdparty/lua/src/ldump.c | 8 +- 3rdparty/lua/src/lfunc.c | 54 ++-- 3rdparty/lua/src/lfunc.h | 6 +- 3rdparty/lua/src/lgc.c | 124 ++++---- 3rdparty/lua/src/lgc.h | 19 +- 3rdparty/lua/src/liolib.c | 27 +- 3rdparty/lua/src/llex.c | 6 +- 3rdparty/lua/src/llimits.h | 21 +- 3rdparty/lua/src/lmathlib.c | 41 ++- 3rdparty/lua/src/lmem.c | 68 +++-- 3rdparty/lua/src/loadlib.c | 18 +- 3rdparty/lua/src/lobject.c | 38 ++- 3rdparty/lua/src/lobject.h | 37 ++- 3rdparty/lua/src/lopcodes.h | 10 +- 3rdparty/lua/src/loslib.c | 38 +-- 3rdparty/lua/src/lparser.c | 43 +-- 3rdparty/lua/src/lstate.c | 71 ++--- 3rdparty/lua/src/lstate.h | 28 +- 3rdparty/lua/src/lstring.c | 13 +- 3rdparty/lua/src/lstrlib.c | 2 +- 3rdparty/lua/src/ltable.c | 47 ++- 3rdparty/lua/src/ltable.h | 3 - 3rdparty/lua/src/ltablib.c | 2 +- 3rdparty/lua/src/ltm.c | 38 +-- 3rdparty/lua/src/lua.c | 56 ++-- 3rdparty/lua/src/lua.h | 27 +- 3rdparty/lua/src/luac.c | 6 +- 3rdparty/lua/src/luaconf.h | 22 +- 3rdparty/lua/src/lundump.c | 12 +- 3rdparty/lua/src/lundump.h | 3 +- 3rdparty/lua/src/lutf8lib.c | 27 +- 3rdparty/lua/src/lvm.c | 309 ++++++++++++-------- 3rdparty/lua/src/lvm.h | 5 + COPYING | 2 +- 54 files changed, 1632 insertions(+), 1146 deletions(-) create mode 100644 3rdparty/lua/doc/OSIApproved_100X125.png delete mode 100644 3rdparty/lua/doc/osi-certified-72x60.png diff --git a/3rdparty/lua/Makefile b/3rdparty/lua/Makefile index fef1af4821e65..72ca8ff3cc195 100644 --- a/3rdparty/lua/Makefile +++ b/3rdparty/lua/Makefile @@ -36,7 +36,7 @@ RM= rm -f # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= # Convenience platforms targets. -PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris +PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris # What to install. TO_BIN= lua luac @@ -46,7 +46,7 @@ TO_MAN= lua.1 luac.1 # Lua version and release. V= 5.4 -R= $V.4 +R= $V.7 # Targets start here. all: $(PLAT) diff --git a/3rdparty/lua/README b/3rdparty/lua/README index c394c69828b5c..fe99b874f6168 100644 --- a/3rdparty/lua/README +++ b/3rdparty/lua/README @@ -1,5 +1,5 @@ -This is Lua 5.4.4, released on 13 Jan 2022. +This is Lua 5.4.7, released on 13 Jun 2024. For installation instructions, license details, and further information about Lua, see doc/readme.html. diff --git a/3rdparty/lua/doc/OSIApproved_100X125.png b/3rdparty/lua/doc/OSIApproved_100X125.png new file mode 100644 index 0000000000000000000000000000000000000000..795f7a06ed5b32131e69f245f1e1e0f4fc22c5aa GIT binary patch literal 12127 zcmV-lFQCwgP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U=QHaxA-%ME|i0Edlee90Ufl-hq~{<5@}G;a!i%le3hucKDazdZ7YlV7_3{F~3u;PdnI`B(G% zTKM&O*Y^8DGs~aj^2LW!q*1w`}$J`zMX#L)M70)w9L;OeQR~_dyhUh>bAAe z)Sml)-{|-McVBOftSO!pl7D{2&nnaBdp?i)Ie1@4iQfxf`uVQb(K436@8hlQThxE{ z@1L#S{k;6Q?Z32jtv|Q>`?t5-?yCzmzAvQTx>Ua(|M+|;Ul;nVtxxZM24Mfb^Doc0 z8^X_9c3?cIq^K0g1%3@p~=d zx$Ssvw?g;Z`5ky`3|tKK{O4cpUwz|!W`Y90#RnFwD++b2!Ux)~2i`_U!hMTco&tY; z{r*pVO?0q4W$tWndUKykSP4JCm7Yc?-dK42%u;}EJ{O=w+`6!skm!J~A(c>BQH!yK zKp{H~nk+r09E}cyQsQQjF{e~%4l~TX`AiGXTVsizry;|X9b;Ehqcnw4__KMnF6 zc`}!|lu}D8y^Jzzs+zD`TNSI$mRfG5)z(^fZM4}_&%N~8Tkn1JIpRpLZW+wu=wpmI zx#{G}lTT0HFsDUJmaSN|X5EIfxq#2gtE{@(>T9gI<4&77-gUR#_t^7<1C&la<{%W`;NIAn!7AHeeMEwhT5ozZOgm0 z82a&fGvYP()x&Cs*BB3GD2!(C9iny0J!KuZYi@^x)HGYR=BI^ivz>#QmNQdlRcBW7 zW497^KXncYxLQqvX;^9BGxsUOHaJ?%+D&1sd#p^zcTnDXQ(VR*TiI=fz4EXw;K~RGDAUj8DMw%ZOaUx@R_Ev_~KY6V7n!25LY+@T%W}HvuQcl zISMg!-!OL#eb&Bb=+;77<6M>i66-SD$Ta|0T1%AC`Yk9=8H2W28`EcFQm;?-29}O^ zQrcQ=9Aj%co=||)Xx<$;tabNJAo_Yfdw@V6B_^YNaRZFh+2#b(XIR>!EvgSP4okcJ zw0Y~gbPbzxX5OhVe>K)IZTk6Ox3BmINPk1Slx#>u(W;X}@|)Ze+#pn2D?)Yn9o0Kk zhQCm{@@#Hw5Ht?=VgSpr?v8DmzJq1@Up*^I>D1L3Iu`hNf(-OerAvAj#lE2>q=V~} z3>Mpt^u^ic^Z3mwQ34)yc-FnV0ON&F#05WtW!Za_;@nsewyB1c{NWDbhMJhZ86 z!wxXQr#dtD&o6BJFOTYG4St_hbM7qvtUVI5cI@0zxo{m!+YGbrWQ^?I@Z}yAb~@+O z6v5PCQ2ClBvv~7Zl^%nsGu@8yo|+9;b=mBOMSIcrfsHddkz2TVQVIwFVl$cvaWLlW z*V<`Y0PEA8HAC6^f{nA%i9x^K)R?-OO5ea;wPITL>Sr_ZkUbX~G2hG_2*DV;>|o); z|4ix?K~l(t|M>p=B18T@f)0jttTh+lm4nQpFg6rDKz1@eTxTuK@;%_T8o7i?y{uuu z_aFf1GYfm|UM3W^HwM$UHE|sKW=29Z!cescIr6SPZOyrAKg>kE15Kb(U}ko{ zcpA#ZF2)a+d=QE5YD9zh-aJKj<6zJE!NNJu$W?wnpAF)M{<7n*NB5Uf__B*-oQh8n z%Jj4dx7u<-%8oFydtjc~@!$y*roc^gqqIoYl0}C32O_*mgBsA)L9HgDRDH>PFQb=I zyh_6XGnJ}LL0Nl_!8EyZ@d9{dddm2A;#(_b=su`Rb51+}W#?aSs4DS@qB7KT?sZGU zeavfPS#jD^*^tVw4W~|x)x}(C=xS&~7!toU%l30`*b4VS(`=SYNW6~egQaz?)8VlS zSX$Fs2TnjF!2lp9l&1C(Md3_zr<4b3SHd{d>Kw8NH-V^(-DlVkvS=vL5^34Ru0Bk5 zD0Tmt)NoeAtXI;RWkfjyx6T&F;xR^9A=+7Ni!Hi}V8kFka#I25G36IMdfU27n3L6x27|Xd0tAGZAF8uG#Xku~NSR2d;!V~?8voeMX>;Qd8%Y*lu>Syq(YWj{~2JzD{{c<_5afCz} z9(Zr#^%ltH1v}XP?3d1fpkwCpG7=T4WLA(oZ|Qj4hp*OgXE2?xKzR~Cz-xm@C-Oj9 zG0TfdpyFrjTNqV_=zx$>+GW9%6U&Ika0zT>-HZUVwvlK{0tS*T&A{OYrmRLVv${Mq zJY}SSy-}Q&DH*s;jBrKXXug5~2tEsd&5Xx%5IsbQL{V)|s=)KWueD~Z71D;Q#TCUi zhyl3i29rQ(D3h9WF#xz6^Wu;kU~#zl1cIdA23M~dz<<|`gD2B6S^+P0VGR` zSPn#`5*kiH*O24Jjfgh!hX9m=_m$VKt*nLtLUr*#*kNoQVAIJ2M1VQ74&lM(<~Fy( z(?zOhszqSeau|b{EmfqyBHHbl!G+mJBE&lw1ty{+HhJBKt~)C5;uz$jMKlnEAu^|3 zm`^Z+QiNi*n1$k4DqKDQal$_642%xZwT1A|xz-VmWY8A@gNV2u+q|bdxyOcZ2V8i< z*ubV+(YQ{$JN^|O;T zJB0Lz&IevG9K&8yV_+;bU~9+^3@KiTpuqU;j;FyrP-}$)yD-?6+k;t}qJJ4WCP|FQ zk)qcLPDXK{0hvQd#S@Y05vt>gM1VzVr|LL*`~p^xv{R;HcoSAY* z(|F1-OzcG?*pUkJrv2o&H1^OO;;&n*#+0`*@?2v;#Kbs6F0bX<(+vz59AjXLI6HxV zguB<(i48McjZd;YoCu)kD=BS~<#nJrN7G3F$cC`65x|Swyol}w)G-;*G#IXo125jD zj_{U>3s}$%DWz+0j$u^cdvHXJB36uYXAxtBdU0I~n~5)`4cKG_Fgzzo|ADPy^{*sI z>Yzr13|ccP-e%!==r+mDXKJ`HRAfG5C)j%cs9WGoNvb#E)4(s2dDL+78e_08_AMy` zBUR@i4sJw(wk?`1SgHidQNRVjz3jIDJ0dRz~ z?ztUSXkhTcZk51O4!k5;VRxR^$-_Xaya_(xC+89pHf&b9K z%s~GbP$)XcD3_`dBRs5fgDu84E&!=mg%3b}biyQ4!`gjX!ozLUR7Sn&7|sM_!YFB- zz8sLwzSj60fDp6%kBlFiEWZsLXH*Fi-_#}0)Ejjrrjen5J1QZS*0RMrkn#l|nf?sK z_8Zw4^tTjra)u3*;m6WUWVxk@Nm63015@P=qClvSY@5f5@hT(o z7}g-;jly_Beoc?hh8e-Od9hj3?NX5i;fkx*%#ji9R)yva9f7BiJ!_4+8fecB2kx;H={=A-_Y@iP%Ul6x&-|6m6#yc zM@P5|_Q!oBaLbz%AINSbL;wT*QrzV>c9$5d;ekYhPLLou{k33oK_~|qtU4pbrJs-O z6$z1~rVf6RPPxe0$yL%BOdE3)tqI9yO$lD=l{1eL4CCj;?BG0Eqf zHoIBbj)i4hhndHj(+?DXFv0=9o5e5q;SXIS(m-jkMxtb*N{g{T`H#75&*65|sj8l< z4O*kvh$tqOs<4j^yYTUIbo`qnl-Ng{awjfg+#tnz97BUqELV6zlm@vr%EG0kVORV< z6po;Zs#5XdnXU2s5h>rLJb;J5;Z6sQ1C@v)tvG~|Q-GW>ZLrHYGwJ+rHl0=DfoRCk z5z(L#;mCK{w>O zE>3K#B?;*Ct@Ei;k!322871`6daOVyU<{QQn030skfQw_NrYRwa%QK{?37j){=?xA zci_0alvi0~;cZ&daVTPat`%lu>VGFB_tl z-y>>~j-bpVQq-|-q}!cRVL8~;dvy97MLFTV=*j=-&j*n zj->U@sBiFq;?mG231{@m8k!~CHHt7@YlX0>LmXzi>bR1bX5BrLYfYy0$emu;HtneG zdz5_D9-!apLp{&c55zX`8L(D@N^k&p&6494IbNO6O{H*}z(+~B1?BFQ@JBI3jdHOC zz5$TN+~+DUu7gx;e|Y&ZmDD$L7NaN4E+z}EYzHht4>}~5Wq}r<^)h327|uv-@GySq zumK9Sgm;BTbIA+>E;ewG?=@l~>kBRBbsu*~MfNq4)k6xKs#+)Q2;5okT;p6LFlxKOL`*ZZES&IQak$9FF zW`%fzczUy9aNZ{lvx2M=pA(OnbV1@rt}8CTan3s|@XWB8O3o99iN$;yD{agQrbawP z98oo$@`bd^D(5ZETB*vK_v9}OX7!b2uG1Vw9E(_j1Q80VD58W4qO|IySV+=-%)>wA z_$6{FM<`C{82BS2smXw+=```ES{CxHJMxYAqx zavhlYB)!(sB1b@I8@RY`Y04gOxdRM78L}xmlAorK%K`6a^i3IH;1=jvb9-y<p(JFpkg{pJ$)-R^!a^tkLMVxmfzW%k0UL}lxPhCl zELmMMBh6^q-9OHEM`tc0TV?LJpznF~Xy(>4_dQ>G&v(u>*iEHwQ5{y&%CijXP+%r7 z2bc&P2#f~`fPBCJVn9C-1U3P!z*=A(up9`O4JLbn7`szrY8KUa4a+zII0ZNn_ypj~ z!ll;$F9FX0Pniv7U<{B!#9!|>fa8JlfknWCK@YaT@EUjvJ$Ujxc=8Ouz)DyoqDhjG z1j(4SvtJbzVE%4kEN*OQjEn)IfG7dJ23!tI%ha;sDTNeP6_8iv!&mCVSLnr)@7dvX zt%OCqFF`yUCl-v;-w`F;5+Tu_%yf7ca3^rRxy0Op^)UoQfVcv<%Bc;$5-+9ul~6RP zfP#vA3~!d2XF)U=BhuDSZ(|>kwy5)n1aJ@V^WgU2hMw1Y_I^O7oHoVq=6f#!elE^A z)q?T^ODL@?p@SnhsfIRz- z6|>42H??%9{vg-DbiUI=ye~~-o&dgXHki$OJRtsh|774^V7|Src%MQl539ge;$wG| zWZWX~L6EN10W=5S4xE<=C!TD6!hKx4E`f0*@GNi$fZ;Q!o;QIB2anrrv?62g^cWOY z6;R?YBH9%t5l#XW1Lt`1JpCNPtNriw?>T@Ng$Diw{?mcSfJ%UZ%6ulDSWQuN0egyg z3%r!>TY_ale|yxnB%dxw7VKL#qwLY(+F)|GH(7P3)sf6ko&(%v16_7N36+OcWG{T( z1=8CTrfpd#Rx)M791U$63r3dT(@+s&A=k&Ca$OL0vRecQr{nt`dntn!)V zivw!|)@}uezurF&cofCFQaQJR@&ilR+r*pip`@mWUNejpw?Hw_Rg>mTdaQF*=k5WB zzurFuc+RFk#vfeHxM^kVt>Ve|P&}oO(3Y_6Q|85^@wRAw^v(G8_^$OKwTo&!zy9Dv!r!Fy+MRUB*Z4Dk-SQClQVl?T!Id08`3mmp>F( z6UeQG)GVy=0JkF}c~wV_-)*T7w`Ibi75GY09q~evd?x26%P@>ffWrWa{Y8}27V~ix zPo9VBd1*sBH~Q=S`8hLLVkegX#fAqaA6JDZ&%?)Ad?h{-kp$7M7(y3y1=a?ZtQLb~(OcA7cXJXO-)W#I^opS9en2UPFQp|{j+E>23{g8gz`uhUGbr1)WDJ1}S$xHel$KNjXSt~% zrvP;T<_1M>6AeT<(oF6ThBujrz4We<_ID9PxK2kYXYIDJhKf*jftDKG;# z3RRZsO~#URyxmQ3b1xH*swA&8Hz9iA#6k>@VY9&t{q_D|45!e0D6Rag{h?@LZpOu} zxJBFYPQ9lAyaxO-X(b=uwq#pIHJNeV3_`u3Y6&~91j?daF`Ay<&gA2(D6De7{T`n| zaZRD!_9Ml?w+>b`o77J#mgF&%?fF?BhD4Yb7mOmv+#%EmZ>@1TIbHC;ztX{%u44 zRsMzk$tce4RNItHo?k^_rTd@+H}}&1W|#f-D`tave^#O_3#$y64Nx?tASd*C*SkGB z7+ZlO%?5MmV5o*;Hkd6I*6G0SZJ@Wm(%~$Gb43a!q|sT&W-aVBFy`4>lnZqaw?^n$ zAJTore6zt^KhoyOEXw1yw06IaEx4RscCj=WATmj+O|q zKq|kuyK`;lv)Q_~*?CJ8sE9QpGeujhko-^0AuL=s%3k=xy! z$>!+5{!s%`TVHFd8@^(9%~doI)4x8w^`Bea%A%hGdKDn<7EL?&zR9BoBxxi;4c@z6 zzz|F4rrvhzK8=eT6Tm8f{!VvImZOBWWYmBdmH|+d;o{jhS+TUlyUS&Ny9vOGStMO# zhaLP`{-^;-+n?KdtE9`YlT z@^EvZ0LSQM*QfyzX#?!JcJ9UOrFpuQJ;udb9RO4T6jtWD`kNAwv`)MwTYzk^eTZX% zeRgAZpFz>26nS~PzurH=rCWU=MQykYh{LLMWDAfKvhj$!W=ktc^`UsDY?~_s_(saJ zPb_pdw;JH(k{GPX79guq*>q3LT|o9J(w*#gr7$m>asg`A6J-aM;B~ojCeo2&0ycXL zPb^!2tVjXkG8yN|_fRo2t*+@0HT5;w(vE4s^>#)uZo0d(yb}FM;-Qp9S-y4g(5avu z0uqnJn*bA_uf<*N2cUdvsb1dyRRiOix->ADPSC^*}-lXJVd*rdXVzQusY_B zcD6j;0`M}Z@|t*W++8in^DyzKwCQ5MN?OU^`0M?{euDFuhriyx2zVXX57g2gZfl1! zS83Mdm8=0G@BR@4HL^fgC_hZ8vgrKq|9 z|7Rvqx^Eh_wI6U(?Ux1}fICLd^ou4Hu+J$I89#emPBcS3qqI)@;IPg1&JGBz4uM)` zN!_q1H(CN}9KZS#6PR>tnhATe@t=)@o$@@Yjtg&*m&wOhQ&5qgv-V;^;KS5VbP$6_ zvJQyIeLx7HXMGSW$3^Cj9O%!39cMO}y~wzEBAn23ft*OByEVbTME~Gns!GK?xOGdV|`EUuHpU8uu^PL{&AWZf{$Usc5 z4td(+@oXI8sdu8LDG>NDl!HXDUrz~E;Nf2*PL79jusPRU4gA%Pw}YG9{js5~X+Gel zp>je^k2Q6m=F=1HiqYTg9uH?FEjm}GExdenmdMIR0K1X;uOhjs+izP!toB8YHH zSTEDL#auGHj5lc|pG3xUf*X5XDfx+o;&i^9(vDu>J0tZSBL+nMT5d$mXd=?uulM9E zhLE9wyJ?~9P-WYaZ7JuTj9Xa`)vbg@+Z$<%V_w&?tY!0PuR9_@%!kY*aNdCF>LJpW zy(BE!6Qh5CF@4xFtdVxR+wCAkE9TCMbgu5v+xV={^4$<`9=-V<@vxb>#N327B)a|8 z4rfW|sO+*Pw=_N2G@|Pi78EujY;~lyKdbEv3~2Cn;DXIdHfO~qj(i-`0?V-OLq_6~ zu_W7HX?Ipz4Br~Yk^~3%piSO9?-L`v)(7`}kTP2tqP7wGwunA|Fb(!5a( zEH^#agyAu+My+H`EEuQd<@Ui|o-!oqZ3^r8&0n@Wuw`^T&teHu&J_GGG^zk3($>%R zSJMheE-@R-7qe*!M?KQtxVSM1oQWElBibFK<)yX}Yl;>i#75%GGnm#GYB@p@ktE^P zk@>pt_6RL6wd;WX)G&-&$+Bdn^ulZ~`+(0OQwgHoF}6M5Ml3kIN|pZ3sJ(_Ez=NUf zp|&jj&H=)4)9{^pXloxWFQp^qS!z53*TFi>}o@w7uS`lc~Qc@A$z1Y@VVgD;GagrQw>F2nX49D8zitc@ND_a^0!cHZ51aXNrIbtNkkIlkIPG+gJ(h8 zo1G+8bQT8A53CJjbyj9zZ6H=Yv-|+yh-5TL(WHWptQi^J9-(zvC&5j9I$*B?pEVoI zxB8piAAxjr@?cL{c~I1Fps58|D(Tn;c0_N-=5|)nZxJX~1vM z79#-EdR9Keev=KrQD%erx-0GYVl7tES_K?z7*IB~l+flr=Nv~1H7@`C=4YC>B!UTY zDLGkkt?|J|%m(vOEM}wL?zt|-TXn~DFy8SbJg>Xfj>QAc-Lh29qk&1}Ue89i=E(2XfH)pd zv4qOSM0mh_+|0#2k3qeO`UQ{WS-Ew|R>ovZ#$-&!WK8x}IR^C_ycNKkz@JE8^XWL$ zM4nfG{efSg=0QA#_C{!tLxI1^{^j!d5N-cOa;-n2mU?{vcnkHiu~T=_&M%=VD*psr z159)5KNB^8b_4Kb$G%y>_cL7co21W`|B3wng0%6A+P-8gugIJEgR>`>S#@X9V$8lZATyOz4lHpomV6GhVGuajenjOc*9pLHmOJEJ^ zjSZIy&=+d^?+4ZkP}cx!1#CkDE7OGjw}G!Z62+gQ#(RDaski8SQ?mI#13!>!PnCV2 z1A3&5mjWw+hen(~X%FaY(g^zj{UZY)0n{v~m$hwI$Z__z1h7DQREL&?>44avUx}KR zXK(xAAnja*wgkFEPL*~|)V5WkNWw3S0FY-KG}Aa#+0U7Sq!OEff77;2kdArs&K|x~ zjb<~j`q@$jDC^6CGPFgNHF-!Vk#%CqklycOU{!{&B!D(YG=a>kb>1K*sF{H|DTBTJ z>|yDF9?=G!Q$G!OQ2@5319)0G#>2zxq`#L=rJHn6Q|6p92elI47R?GEmgERA#X|-} zUua7w{ksK_Ofx3!D&uy?b;fJdObJ?rib$rJ`^_3?JCp0gWL+VC;%2e;ebUZM3;k|$ z*!iJ~b0vmqxmG3$)Sg}R14rV$)$vS+1W1ea*>;fm(g5c}PjPnge}Bgh=n%7)FFkdk zMfQl+ml?*A8n!se z#jO%mA?o#eah8Red2-6>qPoA;w!J95=P~&{5%oftsp6zB0}jk$RQLw)2Q2`21UOOa zt+wg=H1MQ+Zxv0_-`#YOqhk#w%Y+L%br2ua;_yR5mQ118g}@7<6<286*Gp*Ulun7v zY+0i@|I6he9RQpyf3`d`N)Y}o_xeB{{N+e>iG<%ziM_sAI>*Hl#xK@DG$pwByO`Ju zC8*h%v;zMn=iMNdW2*SFrNFmPBa{b8@KFXF4g7~hdxJ`*0jf6Cl!I=dNf5skxI~Le z4$>a(jna^IRF&Yxn%V}$lr+k9-xCeIS;9p7RTDjuqdX@MsX)xha?!R-i?@U%YMUjU z=O(!>n!^oApy5YNHo8W0&T%=WRyvJO_HO~+m){QRUB6Gt^U&ob31>ekPP{{o3rT?U zkhJX}0sA>Q$Cc>GuOd!9RSo1^IFp-k=v2X06ss; zHkS%-_Oa@O-$fQG9)|n`c*hZ*If6iCEA+!aRS80@Rxbb(-Kc4di#sx zn0$?}9Ewat=BhiSW_N#p*{;i)AzAZ#^8F-vn3GYg=NYJllGi!TIb7oNxhOJof}A&7 zv}dM-rt37{cQSB3iVmM5p>bS3|4Pp7L%o=5i_kaq62_m5TF7Rzqx~mK!n#pQjxRy6 zxA6?e@AgjpIMUhK3s95&?~%NsUvirN)s8tqOdY8AwC4#kP$j?s%tx`nXh8o?j@^bD z*SJsiO%;FPlWSDT=Q&Kqdz=dj*^_nzR&p?Ox9dEra&_1UbHo}) zzN53n9OiY840|6ZoxS}~e(-1(KC~-u3&r&0YXQMfBq;RGIoh^!Wm^zcGZvT6b~M>9 zZ9d9vC+xO#5ArZaQxkTE_?jZrq|1>MX5T6F#-;LokruMsKJ0eKIjaPiJsOZ~&)A=a zA_UKX)S4nwkyW^dAuovOJVV0a9@&Nf+=Ywl(ChAVM)`~s9Y@?T%zSQpXW(V@GmVg3L#5% zNZyeYdp;30{#}Bi@|TLEeL-@D`6$}^+tSOQ7aQLt*EwCxj{Pz)`@Tudzvanwor7=B zOS|VwmS2GyUU-W!8Iv&?lQD6_hm6Va<#6D5VF0!mW6xuk%1NjKjY`z8MXART0^2k} z;U4(ou0_^^bVwzcYps4wI$^mhq*|gx11XEr0Xda{3iXA1ARwoZ&Q00UF8PX6&O>`A z)h>1!MJU$Vs{?W_s=#X_>Ge}nP_(!QRcLmqmQe18Ds{<64a1(q07o^Q0pf1~1C`-* zz*!RCd*yE~YFq>@f0>Ia!Lg~4b5Nszx|!V%_=;R}xHH=qFu-Hkz4eQd_}PrEN9_CA zq!-Z5L5=ZLOQwIUw$CH&JWm(|`&k)s+}R8i3BCy&EP2~>w3@I|Nu2ILjWfg;7>l@$ zfeLWD^yg{WcL%DF`W0=TU7-D}BzsF``?+Ew^r;T3P~#QvN|I(%CO?(^pO$RflH}38 zw@);ppMmKO8zqC!M3H1#Wm->07s)m3cD*bK>#G8ENdDV}gPVj=2x{m2PNQ_}sT3A! zu&hWZn56bQzNaP12jh5w@i}r(z4USmHUB{e?)M#Sc2m$emS!)#F;B5xNJzF2(HM){uRbpCB z5)D0W2M@hmOq>0u&vW@u%*_H+QNuLxDX(jU>7BqorA<3ph{lIvgzrJs9VaB{dDU^P ze~6ZKX1d4=@(}%w*gYY(&^B2cGzYdsbLy66N-Wg00NbfM3yUujP;{qWt^Jr**?ysR z&UeI|>2nY3#NpfX7Xt$9U?$7?cc{auU#vM{OB{27Xsv$UQq8Hq?_h>)=2|~KA)Pf} z*kpa*iow+Na5-S5W8cAYq0dXybF3tc3C*G2ArEi5^x`h9XHA#r%}G~JMpcY=$Pd)b z&QwX_R+BzdI!Vq+%Jpnj-&fkdRQA

-Lua +Lua Lua 5.4 Reference Manual

@@ -18,7 +18,7 @@

The reference manual is the official definition of the Lua language.
For a complete introduction to Lua programming, see the book -Programming in Lua. +Programming in Lua.

-Copyright © 2020–2022 Lua.org, PUC-Rio. +Copyright © 2020–2024 Lua.org, PUC-Rio. Freely available under the terms of the -Lua license. +Lua license.

Contents

@@ -85,6 +85,8 @@

Contents

  • 3.4.9 – Table Constructors
  • 3.4.10 – Function Calls
  • 3.4.11 – Function Definitions +
  • 3.4.12 – Lists of expressions, multiple results, and adjustment +
  • 3.5 – Visibility Rules @@ -613,7 +615,7 @@

    constants

    LUA_HOOKLINE
    LUA_HOOKRET
    LUA_HOOKTAILCALL
    -LUAL_BUFFERSIZE
    +LUA_LOADED_TABLE
    LUA_MASKCALL
    LUA_MASKCOUNT
    LUA_MASKLINE
    @@ -641,6 +643,7 @@

    constants

    LUA_OPSHR
    LUA_OPSUB
    LUA_OPUNM
    +LUA_PRELOAD_TABLE
    LUA_REFNIL
    LUA_REGISTRYINDEX
    LUA_RIDX_GLOBALS
    @@ -657,6 +660,7 @@

    constants

    LUA_TUSERDATA
    LUA_USE_APICHECK
    LUA_YIELD
    +LUAL_BUFFERSIZE
    @@ -664,10 +668,10 @@

    constants

    diff --git a/3rdparty/lua/doc/lua.1 b/3rdparty/lua/doc/lua.1 index a46a1a67dd045..3c9e000234e34 100644 --- a/3rdparty/lua/doc/lua.1 +++ b/3rdparty/lua/doc/lua.1 @@ -1,5 +1,5 @@ -.\" $Id: lua.man,v 1.14 2020/05/21 19:31:21 lhf Exp $ -.TH LUA 1 "$Date: 2020/05/21 19:31:21 $" +.\" $Id: lua.man,v 1.14 2024/05/08 18:48:27 lhf Exp $ +.TH LUA 1 "$Date: 2024/05/08 18:48:27 $" .SH NAME lua \- Lua interpreter .SH SYNOPSIS @@ -86,11 +86,17 @@ execute statement enter interactive mode after executing .IR script . .TP -.BI \-l " name" +.BI \-l " mod" require library -.I name +.I mod into global -.IR name . +.IR mod . +.TP +.BI \-l " g=mod" +require library +.I mod +into global +.IR g . .TP .B \-v show version information. @@ -117,7 +123,7 @@ and the version-neutral variants are ignored. Code to be executed before command line options and scripts. .TP .B LUA_PATH, LUA_PATH_5_4 -Initial value of package.cpath, +Initial value of package.path, the path used by require to search for Lua loaders. .TP .B LUA_CPATH, LUA_CPATH_5_4 diff --git a/3rdparty/lua/doc/lua.css b/3rdparty/lua/doc/lua.css index cbd0799d1525c..9013b445c6549 100644 --- a/3rdparty/lua/doc/lua.css +++ b/3rdparty/lua/doc/lua.css @@ -143,6 +143,7 @@ table.book td.cover { table.book img { border: solid #000080 1px ; + border-radius: 2px ; } table.book span { diff --git a/3rdparty/lua/doc/manual.html b/3rdparty/lua/doc/manual.html index 61a8220d7fd1f..574c7432c0f3c 100644 --- a/3rdparty/lua/doc/manual.html +++ b/3rdparty/lua/doc/manual.html @@ -10,7 +10,7 @@

    -Lua +Lua Lua 5.4 Reference Manual

    @@ -19,9 +19,9 @@

    -Copyright © 2020–2022 Lua.org, PUC-Rio. +Copyright © 2020–2024 Lua.org, PUC-Rio. Freely available under the terms of the -Lua license. +Lua license.

    @@ -63,7 +63,7 @@

    1 – Introduction

    Lua is implemented as a library, written in clean C, -the common subset of Standard C and C++. +the common subset of standard C and C++. The Lua distribution includes a host program called lua, which uses the Lua library to offer a complete, standalone Lua interpreter, @@ -391,7 +391,7 @@

    2.3 – Error Handling

    an error object is propagated with information about the error. Lua itself only generates errors whose error object is a string, -but programs may generate errors with +but programs can generate errors with any value as the error object. It is up to the Lua program or its host to handle such error objects. For historical reasons, @@ -401,7 +401,7 @@

    2.3 – Error Handling

    When you use xpcall (or lua_pcall, in C) -you may give a message handler +you can give a message handler to be called in case of errors. This function is called with the original error object and returns a new error object. @@ -453,7 +453,7 @@

    2.4 – Metatables and Metamethods

    In the previous example, the key is the string "__add" and the metamethod is the function that performs the addition. Unless stated otherwise, -a metamethod may in fact be any callable value, +a metamethod can in fact be any callable value, which is either a function or a value with a __call metamethod. @@ -1379,7 +1379,9 @@

    3.1 – Lexical Conventions

    which start with 0x or 0X. Hexadecimal constants also accept an optional fractional part plus an optional binary exponent, -marked by a letter 'p' or 'P'. +marked by a letter 'p' or 'P' and written in decimal. +(For instance, 0x1.fp10 denotes 1984, +which is 0x1f / 16 multiplied by 210.)

    @@ -1621,21 +1623,13 @@

    3.3.3 – Assignment

    Before the assignment, the list of values is adjusted to the length of -the list of variables. -If there are more values than needed, -the excess values are thrown away. -If there are fewer values than needed, -the list is extended with nil's. -If the list of expressions ends with a function call, -then all values returned by that call enter the list of values, -before the adjustment -(except when the call is enclosed in parentheses; see §3.4). +the list of variables (see §3.4.12).

    If a variable is both assigned and read inside a multiple assignment, -Lua ensures all reads get the value of the variable +Lua ensures that all reads get the value of the variable before the assignment. Thus the code @@ -1731,18 +1725,13 @@

    3.3.4 – Control Structures

    A label is visible in the entire block where it is defined, except inside nested functions. -A goto may jump to any visible label as long as it does not +A goto can jump to any visible label as long as it does not enter into the scope of a local variable. A label should not be declared where a label with the same name is visible, even if this other label has been declared in an enclosing block. -

    -Labels and empty statements are called void statements, -as they perform no actions. - -

    The break statement terminates the execution of a while, repeat, or for loop, @@ -2059,7 +2048,7 @@

    3.4 – Expressions

    table constructors are explained in §3.4.9. Vararg expressions, denoted by three dots ('...'), can only be used when -directly inside a vararg function; +directly inside a variadic function; they are explained in §3.4.11. @@ -2074,52 +2063,6 @@

    3.4 – Expressions

    and the unary length operator (see §3.4.7). -

    -Both function calls and vararg expressions can result in multiple values. -If a function call is used as a statement (see §3.3.6), -then its return list is adjusted to zero elements, -thus discarding all returned values. -If an expression is used as the last (or the only) element -of a list of expressions, -then no adjustment is made -(unless the expression is enclosed in parentheses). -In all other contexts, -Lua adjusts the result list to one element, -either discarding all values except the first one -or adding a single nil if there are no values. - - -

    -Here are some examples: - -

    -     f()                -- adjusted to 0 results
    -     g(f(), x)          -- f() is adjusted to 1 result
    -     g(x, f())          -- g gets x plus all results from f()
    -     a,b,c = f(), x     -- f() is adjusted to 1 result (c gets nil)
    -     a,b = ...          -- a gets the first vararg argument, b gets
    -                        -- the second (both a and b can get nil if there
    -                        -- is no corresponding vararg argument)
    -     
    -     a,b,c = x, f()     -- f() is adjusted to 2 results
    -     a,b,c = f()        -- f() is adjusted to 3 results
    -     return f()         -- returns all results from f()
    -     return ...         -- returns all received vararg arguments
    -     return x,y,f()     -- returns x, y, and all results from f()
    -     {f()}              -- creates a list with all results from f()
    -     {...}              -- creates a list with all vararg arguments
    -     {f(), nil}         -- f() is adjusted to 1 result
    -
    - -

    -Any expression enclosed in parentheses always results in only one value. -Thus, -(f(x,y,z)) is always a single value, -even if f returns several values. -(The value of (f(x,y,z)) is the first value returned by f -or nil if f does not return any values.) - - @@ -2252,8 +2195,9 @@

    3.4.3 – Coercions and Conversions

    -Nonetheless, it is always a good practice not to rely on these -implicit coercions, as they are not always applied; +It is always a good practice not to rely on the +implicit coercions from strings to numbers, +as they are not always applied; in particular, "1"==1 is false and "1"<1 raises an error (see §3.4.4). These coercions exist mainly for compatibility and may be removed @@ -2558,9 +2502,9 @@

    3.4.9 – Table Constructors

    If the last field in the list has the form exp -and the expression is a function call or a vararg expression, +and the expression is a multires expression, then all values returned by this expression enter the list consecutively -(see §3.4.10). +(see §3.4.12).

    @@ -2624,7 +2568,7 @@

    3.4.10 – Function Calls

    scope of a to-be-closed variable is called a tail call. Lua implements proper tail calls (or proper tail recursion): -in a tail call, +In a tail call, the called function reuses the stack entry of the calling function. Therefore, there is no limit on the number of nested tail calls that a program can execute. @@ -2727,22 +2671,16 @@

    3.4.11 – Function Definitions

    When a Lua function is called, it adjusts its list of arguments to -the length of its list of parameters, -unless the function is a vararg function, +the length of its list of parameters (see §3.4.12), +unless the function is a variadic function, which is indicated by three dots ('...') at the end of its parameter list. -A vararg function does not adjust its argument list; +A variadic function does not adjust its argument list; instead, it collects all extra arguments and supplies them to the function through a vararg expression, which is also written as three dots. The value of this expression is a list of all actual extra arguments, -similar to a function with multiple results. -If a vararg expression is used inside another expression -or in the middle of a list of expressions, -then its return list is adjusted to one element. -If the expression is used as the last element of a list of expressions, -then no adjustment is made -(unless that last expression is enclosed in parentheses). +similar to a function with multiple results (see §3.4.12).

    @@ -2803,6 +2741,122 @@

    3.4.11 – Function Definitions

    +

    3.4.12 – Lists of expressions, multiple results, +and adjustment

    + +

    +Both function calls and vararg expressions can result in multiple values. +These expressions are called multires expressions. + + +

    +When a multires expression is used as the last element +of a list of expressions, +all results from the expression are added to the +list of values produced by the list of expressions. +Note that a single expression +in a place that expects a list of expressions +is the last expression in that (singleton) list. + + +

    +These are the places where Lua expects a list of expressions: + +

      + +
    • A return statement, +for instance return e1, e2, e3 (see §3.3.4).
    • + +
    • A table constructor, +for instance {e1, e2, e3} (see §3.4.9).
    • + +
    • The arguments of a function call, +for instance foo(e1, e2, e3) (see §3.4.10).
    • + +
    • A multiple assignment, +for instance a , b, c = e1, e2, e3 (see §3.3.3).
    • + +
    • A local declaration, +for instance local a , b, c = e1, e2, e3 (see §3.3.7).
    • + +
    • The initial values in a generic for loop, +for instance for k in e1, e2, e3 do ... end (see §3.3.5).
    • + +

    +In the last four cases, +the list of values from the list of expressions +must be adjusted to a specific length: +the number of parameters in a call to a non-variadic function +(see §3.4.11), +the number of variables in a multiple assignment or +a local declaration, +and exactly four values for a generic for loop. +The adjustment follows these rules: +If there are more values than needed, +the extra values are thrown away; +if there are fewer values than needed, +the list is extended with nil's. +When the list of expressions ends with a multires expression, +all results from that expression enter the list of values +before the adjustment. + + +

    +When a multires expression is used +in a list of expressions without being the last element, +or in a place where the syntax expects a single expression, +Lua adjusts the result list of that expression to one element. +As a particular case, +the syntax expects a single expression inside a parenthesized expression; +therefore, adding parentheses around a multires expression +forces it to produce exactly one result. + + +

    +We seldom need to use a vararg expression in a place +where the syntax expects a single expression. +(Usually it is simpler to add a regular parameter before +the variadic part and use that parameter.) +When there is such a need, +we recommend assigning the vararg expression +to a single variable and using that variable +in its place. + + +

    +Here are some examples of uses of mutlres expressions. +In all cases, when the construction needs +"the n-th result" and there is no such result, +it uses a nil. + +

    +     print(x, f())      -- prints x and all results from f().
    +     print(x, (f()))    -- prints x and the first result from f().
    +     print(f(), x)      -- prints the first result from f() and x.
    +     print(1 + f())     -- prints 1 added to the first result from f().
    +     local x = ...      -- x gets the first vararg argument.
    +     x,y = ...          -- x gets the first vararg argument,
    +                        -- y gets the second vararg argument.
    +     x,y,z = w, f()     -- x gets w, y gets the first result from f(),
    +                        -- z gets the second result from f().
    +     x,y,z = f()        -- x gets the first result from f(),
    +                        -- y gets the second result from f(),
    +                        -- z gets the third result from f().
    +     x,y,z = f(), g()   -- x gets the first result from f(),
    +                        -- y gets the first result from g(),
    +                        -- z gets the second result from g().
    +     x,y,z = (f())      -- x gets the first result from f(), y and z get nil.
    +     return f()         -- returns all results from f().
    +     return x, ...      -- returns x and all received vararg arguments.
    +     return x,y,f()     -- returns x, y, and all results from f().
    +     {f()}              -- creates a list with all results from f().
    +     {...}              -- creates a list with all vararg arguments.
    +     {f(), 5}           -- creates a list with the first result from f() and 5.
    +
    + + + +

    3.5 – Visibility Rules

    @@ -2813,6 +2867,7 @@

    3.5 – Visibility Rules

    The scope of a local variable begins at the first statement after its declaration and lasts until the last non-void statement of the innermost block that includes the declaration. +(Void statements are labels and empty statements.) Consider the following example:
    @@ -3071,7 +3126,7 @@ 

    4.1.3 – Pointers to strings

    Lua's garbage collection can free or move internal memory and then invalidate pointers to internal strings. To allow a safe use of these pointers, -The API guarantees that any pointer to a string in a stack index +the API guarantees that any pointer to a string in a stack index is valid while the string value at that index is not removed from the stack. (It can be moved to another index, though.) When the index is a pseudo-index (referring to an upvalue), @@ -3537,7 +3592,7 @@

    4.6 – Functions and Types

    return realloc(ptr, nsize); }

    -Note that Standard C ensures +Note that ISO C ensures that free(NULL) has no effect and that realloc(NULL,size) is equivalent to malloc(size). @@ -3785,8 +3840,36 @@

    4.6 – Functions and Types

    -(Exceptionally, this function was introduced in release 5.4.3. -It is not present in previous 5.4 releases.) +(This function was introduced in release 5.4.3.) + + + + + +


    lua_closethread

    +[-0, +?, –] +

    int lua_closethread (lua_State *L, lua_State *from);
    + +

    +Resets a thread, cleaning its call stack and closing all pending +to-be-closed variables. +Returns a status code: +LUA_OK for no errors in the thread +(either the original error that stopped the thread or +errors in closing methods), +or an error status otherwise. +In case of error, +leaves the error object on the top of the stack. + + +

    +The parameter from represents the coroutine that is resetting L. +If there is no such coroutine, +this parameter can be NULL. + + +

    +(This function was introduced in release 5.4.6.) @@ -4542,7 +4625,7 @@

    4.6 – Functions and Types

    and pushes a key–value pair from the table at the given index, the "next" pair after the given key. If there are no more elements in the table, -then lua_next returns 0 and pushes nothing. +then lua_next returns 0 and pushes nothing.

    @@ -4985,6 +5068,7 @@

    4.6 – Functions and Types

    Similar to lua_gettable, but does a raw access (i.e., without metamethods). +The value at index must be a table. @@ -5051,6 +5135,7 @@

    4.6 – Functions and Types

    Similar to lua_settable, but does a raw assignment (i.e., without metamethods). +The value at index must be a table. @@ -5166,15 +5251,9 @@

    4.6 – Functions and Types

    int lua_resetthread (lua_State *L);

    -Resets a thread, cleaning its call stack and closing all pending -to-be-closed variables. -Returns a status code: -LUA_OK for no errors in the thread -(either the original error that stopped the thread or -errors in closing methods), -or an error status otherwise. -In case of error, -leaves the error object on the top of the stack. +This function is deprecated; +it is equivalent to lua_closethread with +from being NULL. @@ -5492,7 +5571,7 @@

    4.6 – Functions and Types


    lua_toclose

    -[-0, +0, m] +[-0, +0, v]

    void lua_toclose (lua_State *L, int index);

    @@ -5512,6 +5591,11 @@

    4.6 – Functions and Types

    unless previously deactivated by lua_closeslot. +

    +This function raises an error if the value at the given slot +neither has a __close metamethod nor is a false value. + +

    This function should not be called for an index that is equal to or below an active to-be-closed slot. @@ -5585,6 +5669,12 @@

    4.6 – Functions and Types

    but can contain other zeros in its body. +

    +This function can raise memory errors only +when converting a number to a string +(as then it may create a new string). + + @@ -6033,7 +6123,7 @@

    4.7 – The Debug Interface

  • isvararg: -true if the function is a vararg function +true if the function is a variadic function (always true for C functions).
  • @@ -6773,7 +6863,7 @@

    5.1 – Functions and Types

    void luaL_buffsub (luaL_Buffer *B, int n);

    -Removes n bytes from the the buffer B +Removes n bytes from the buffer B (see luaL_Buffer). The buffer must have at least that many bytes. @@ -6968,8 +7058,8 @@

    5.1 – Functions and Types

          (luaL_loadfile(L, filename) || lua_pcall(L, 0, LUA_MULTRET, 0))
     

    -It returns LUA_OK if there are no errors, -or an error code in case of errors (see §4.4.1). +It returns 0 (LUA_OK) if there are no errors, +or 1 in case of errors. @@ -6986,8 +7076,8 @@

    5.1 – Functions and Types

          (luaL_loadstring(L, str) || lua_pcall(L, 0, LUA_MULTRET, 0))
     

    -It returns LUA_OK if there are no errors, -or an error code in case of errors (see §4.4.1). +It returns 0 (LUA_OK) if there are no errors, +or 1 in case of errors. @@ -7294,7 +7384,7 @@

    5.1 – Functions and Types

    Creates a new Lua state. It calls lua_newstate with an -allocator based on the standard C allocation functions +allocator based on the ISO C allocation functions and then sets a warning function and a panic function (see §4.4) that print messages to the standard error output. @@ -7685,9 +7775,7 @@

    5.1 – Functions and Types


    luaL_typeerror

    [-0, +0, v] -

    const char *luaL_typeerror (lua_State *L,
    -                                      int arg,
    -                                      const char *tname);
    +
    int luaL_typeerror (lua_State *L, int arg, const char *tname);

    Raises a type error for the argument arg @@ -8708,6 +8796,8 @@

    6.3 – Modules

    This variable is only a reference to the real table; assignments to this variable do not change the table used by require. +The real table is stored in the C registry (see §4.3), +indexed by the key LUA_LOADED_TABLE, a string. @@ -8745,7 +8835,7 @@

    6.3 – Modules

    -This function is not supported by Standard C. +This functionality is not supported by ISO C. As such, it is only available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD, plus other Unix systems that support the dlfcn standard). @@ -8799,6 +8889,8 @@

    6.3 – Modules

    This variable is only a reference to the real table; assignments to this variable do not change the table used by require. +The real table is stored in the C registry (see §4.3), +indexed by the key LUA_PRELOAD_TABLE, a string. @@ -9311,7 +9403,7 @@

    6.4 – String Manipulation

    -Returns the size of a string resulting from string.pack +Returns the length of a string resulting from string.pack with the given format. The format string cannot have the variable-length options 's' or 'z' (see §6.4.2). @@ -10091,9 +10183,9 @@

    6.7 – Mathematical Functions

    - + Returns the arc tangent of y/x (in radians), -but uses the signs of both arguments to find the +using the signs of both arguments to find the quadrant of the result. It also handles correctly the case of x being zero. @@ -10953,7 +11045,7 @@

    6.9 – Operating System Facilities

    If the optional second argument close is true, -closes the Lua state before exiting. +the function closes the Lua state before exiting (see lua_close). @@ -11195,13 +11287,13 @@

    6.10 – The Debug Library

    with the string what describing which fields to fill in. The default for what is to get all information available, except the table of valid lines. -If present, -the option 'f' +The option 'f' adds a field named func with the function itself. -If present, -the option 'L' -adds a field named activelines with the table of -valid lines. +The option 'L' adds a field named activelines +with the table of valid lines, +provided the function is a Lua function. +If the function has no debug information, +the table is empty.

    @@ -11503,12 +11595,18 @@

    7 – Lua Standalone

  • -i: enter interactive mode after running script;
  • -l mod: "require" mod and assign the result to global mod;
  • +
  • -l g=mod: "require" mod and assign the + result to global g;
  • -v: print version information;
  • -E: ignore environment variables;
  • -W: turn warnings on;
  • --: stop handling options;
  • -: execute stdin as a file and stop handling options.
  • +(The form -l g=mod was introduced in release 5.4.4.) + + +

    After handling its options, lua runs the given script. When called without arguments, lua behaves as lua -v -i @@ -11532,6 +11630,10 @@

    7 – Lua Standalone

    In particular, the values of package.path and package.cpath are set with the default paths defined in luaconf.h. +To signal to the libraries that this option is on, +the stand-alone interpreter sets the field +"LUA_NOENV" in the registry to a true value. +Other libraries may consult this field for the same purpose.

    @@ -11582,7 +11684,7 @@

    7 – Lua Standalone

    the script is called with arguments arg[1], ···, arg[#arg]. Like all chunks in Lua, -the script is compiled as a vararg function. +the script is compiled as a variadic function.

    @@ -11946,13 +12048,12 @@

    9 – The Complete Syntax of Lua

    - diff --git a/3rdparty/lua/doc/osi-certified-72x60.png b/3rdparty/lua/doc/osi-certified-72x60.png deleted file mode 100644 index 07df5f6ee7a7a8b2108025dcd815f73f145a83af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3774 zcmV;v4ngsWP)$kl5 zqcT7g&?zu8?ezWYz4zUB-|zR9d+&Qy2xAN{qY(ew0A7^*gV^7jytKqPFV3{hZfovn zs%x!l>(m&Gdb8C+5XeR7>h0kj=o=X3A39;2KLYfEMt>p1YMW~dt`rpAC{lN~P>5pq zH1L4nAdCT17}*hN=LnEsvMl=5Ij^QArAa&_V~zoht-Ei~)E~(Ivhe0#jik{t$isEK znCH$TxCB8EKmcF>3@pRaHpbR%Gqm*dsZA4H{j(NjZFp^iNFW+RBx6R*X19J*`0XG5 z^Y>cR=^Hi9#ovYGlbFSr#Q*^PgCGC^gb*SC5TcBfzQLe-r2m!Quik&_g9XzTj0qSR zD`FkG_RYWDa^+#UUxL&t+!K+&(ion@Fd`5l5p7{Qsva9vegC|4^NzJUMvn)^gqWsF zvu^j=%FfCVg^cgbXDRl1DE$lsfe;BjjmFmRHER~E-MeWoNsyyNHCpG%Y}igd_(Md;&9La8_B075NDRX9gTD zIHY`}9E~aGi9Kk1@P~rmPna=*=gz~UTdTpsQmjX)J23%v9NliQS)8`xJh6Qz_nE~e z&tP|!dcJdo;JMNa3>afSx$lko8>fp-I}OiCVz(dOF1u6e8$IrsSP?=5mp~lkaFqm? zAUMxRq%ecIu3WE)Uf=%p8g z+RSY?G=VO%wAfdICj?Uzb+5jr{8m|)i#{M}JjaDIoXf#1=DYLwX;1EW&sijPvm6EkBGuOx6r~lKv`g`yH?)|&PRUr$5Ibw2HBM7C74XvE@gaPjN+@;j$J)AgYhnT-U5m+wj|Wz8K630AfO8PUoGD^^Mcq zY9C<~%wUm^u%ox5P21)KNN0$(v^OI$A~?iwsS_fRu1+`EH|CRdpA4zsk8Z#|?x@^vVEAL+2JxH%&^{JUU%B=?EU7`Ar*Q|JvqPofcBt765(*f5JI$>=3{<%K)4ei zogo$)5XP}_X$y^pIYyWTt}EAnhTq}u4sAdBvC(WC{I#x4^>$vCvQ0UDs^18sAQG9o zEaP0qjrSSv1W0FyO%9&y$@em~n@8}}EXBG6x%ew49J_q%l@As_XnNpi|MTTPr~ca_ zW%uon6dBKL*pvzYFvf<~p6K8hK9BDNNN0$7xp^hWC3n^7FoQ?P(=m(6!Pj&S2f1fqH=`(w)KcPl5aEi2}~4hF*f*g}vaS-=c7v>N8c z{yNM*%+azq=@prWtgpi~^3?^AsJqS(>=pb=6PrGH#=O{Hcho$_F#MtsK$$3e2fZvg zy}!-V%`+uFMOW87LIgu3vKuMgqwY0}*Sd;aokQp(F#-{}Ss(Iy1iekY1ZQX?1WEL? z7=zq`lH-#Hw=bHRio3yPun%`c5rI1Hb|wTSWTs|12Mg#QkkwTmy zAYul0H*_b(BnkP#!R_&p@d54uz0JKthGv3C^fdKS%~alookE`QX@%#MQN2=SFWrOha7Ij7ImStNaWsy~? zsylUeT02_-z-G4s0L!v=+Wx|cxr$tmY&$a1by8z#6HBp!*9{@mU9XQ0h@L%V_R}4g z&s#2{MCOj4`5ux-SUautC5@{U895o-biKMWWoQ09{|jx8wz}@_(ep%Yk4{90C#s6-sa}fU5{}m>#>VtE_b#5bn8O+3k{&6GoEkB;yGie;A_5Uy zqPN*tU()pE+_&~``5XX({el-xT_}%`%fsc>_0@m5{+FhXru>rpyLESe31R>cK^FFrCm+#WL$-D{Z3*9>Lg{wi}xEYn_`@Hy`-d z1N}kIY%@Eu&Bpe|Rr6N;%Yk>6&RI$lgpIO26BYT%C!dU-o4bqqQpGY?p6lPru6Hzc z@WuSDI^BYaDH*>R)~)$V1J0Edn4r(9vo>E<2XjOJr2*G124;t^U+p{iUnZN5oapCpCk(F}}<#3ZZli!Nk z^UWT;Q9qm-i`i$kJS}5P%puBJ<&krTO;*#$Y7d$o96EbQ{aF1XFpTj}wf}eI|IOba z%w}_CWu?JjkV>U-ad9L$@Mu$CU;pUQBZgt5QmI@n=W@9K(A(SF-rnxzy|_!5ekKqCQTad`sa|&&Q6jfy}iAEst?|mH*emIjg9SB zRVWlHl?r3bvh2qnf6V6(+>4TulB%kzFveeh{k1?K*t&J=m>dk9P8SjqQdn4sF;*&- z(b3VFnVH$y*$Rb%rs zefJ#z#KpyZ_0?C$jvY%)O?7a?7#}%u1OT>d*)keF*REZ=c=4j6tkr5MilS*cB_$;< zFArmEv)Oby-7}4>TD9uE_ulKT4s6Bp@^Y0*rBEo&o;?cy8#Zi^%jH+DTv4f1SFc_L zfc5LwXJ=;vKt@K!?%liR&!6Almmq$2R@G|tg$oyGnpP+jQBhF<(9qCOR8%AuiBtJCSc zyu1LQw6wIQre^Zw$^E0N)#}R1%J}$rkw`Qc#z0A{)dIkjDN`I(PfyS2=x9f~R4N64 zPe1*1=gytQ#l=RWao4V0bLY-=?Bpl*dQDA@LZMJ9l{Gar$;rvzfB$`Tb#+==T0=ua zSy@?1N{UXWyL9Q&#*G`Zv$GE#JXljxBauj2T3VD!rO9N<%F3#*uP-Sn(P%W=w{Jgx z{(NC!VNOmC0OaN6ZQHg@tJQw^;fGtdZUulVSFX&NGv~~iGoO9-nNq0~2n78w23E{L zmth7T3|W>10ISuSm6cUgRCMXmr5!tV0D!x@`?6)rcI?<8lgZ#IIehqVOiYYpi@x#3 z8xau^+1c4ER;th&( zVHk--A`l3|!os9dsYatANm8TH96x@%qM{-&FmUtc&2qVX-MV%A_U(J~%{TY#*<&ym zX3Ur|c$No?u%e>k#EBDaZEY7XUVLH`0zh|n zw_~XRz;RH!y1MS)zn_X$Km70mNs@ZKo~G$z$BuD09F}FpVzEY}F&d2ug#rLPJUpgPpKh}a^y$-i zJl@%}XHT6vRaaNHckf=MQYn>6Fk&*D<+ja0B z5C{a#&CQN-V`HPyXe3EeAP~gH#>U3RayT5ZSd1}tbaaSNDAZ^)j%n&QHMoE=7KubA zlWEeVNpiV7Dk=&gzM|0Dz(>0HA5Q-_F}_znz(xxqbU~E|+`a#EH|V zPjA|^DJLg~rs?+f_6rv-T)upnAP7fChoq;cFJHcV=gyt)zWXjs(+gZ<%kMDTlOd1+TFW%&z(D`)oKF*0@Bmd zLqkIy?RvewprGK+ojWv5%Ve?@D^>&r1p$CcrMhuv}x1&joiO~|IC>)G)

    -Lua +Lua Welcome to Lua 5.4

    @@ -49,29 +49,31 @@

    About Lua

    Lua is a powerful, efficient, lightweight, embeddable scripting language developed by a -team +team at -PUC-Rio, +PUC-Rio, the Pontifical Catholic University of Rio de Janeiro in Brazil. Lua is free software used in -many products and projects +many products and projects around the world.

    Lua's -official web site +official website provides complete information about Lua, including an -executive summary +executive summary, +tips on +getting started, and updated -documentation, +documentation, especially the -reference manual, +reference manual, which may differ slightly from the local copy distributed in this package. @@ -79,7 +81,7 @@

    About Lua

    Installing Lua

    Lua is distributed in -source +source form. You need to build it before using it. Building Lua should be straightforward @@ -88,7 +90,7 @@

    Installing Lua

    platforms that have an ANSI C compiler. Lua also compiles unmodified as C++. The instructions given below for building Lua are for Unix-like platforms, -such as Linux and Mac OS X. +such as Linux and macOS. See also instructions for other systems and @@ -97,10 +99,7 @@

    Installing Lua

    If you don't have the time or the inclination to compile Lua yourself, get a binary from -LuaBinaries. -Try also -LuaDist, -a multi-platform distribution of Lua that includes batteries. +LuaBinaries.

    Building Lua

    @@ -110,7 +109,7 @@

    Building Lua

    1. Open a terminal window and move to -the top-level directory, which is named lua-5.4.4. +the top-level directory, which is named lua-5.4.7. The Makefile there controls both the build process and the installation process.

    2. @@ -121,7 +120,7 @@

      Building Lua

      The platforms currently supported are:

      - guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris + guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris

      If your platform is listed, just do "make xxx", where xxx @@ -214,8 +213,8 @@

      Customization

      record the changes you've made.

      - On the other hand, if you need to customize some Lua features, you'll need - to edit src/luaconf.h before building and installing Lua. + On the other hand, if you need to customize some Lua features, + edit src/luaconf.h before building and installing Lua. The edited file will be the one installed, and it will be used by any Lua clients that you build, to ensure consistency. Further customization is available to experts by editing the Lua sources. @@ -244,7 +243,7 @@

      Building Lua on other systems

      - To use Lua as a library in your own programs, you'll need to know how to + To use Lua as a library in your own programs, you need to know how to create and use libraries with your compiler. Moreover, to dynamically load C libraries for Lua, you'll need to know how to create dynamic libraries and you'll need to make sure that the Lua API functions are accessible to @@ -287,11 +286,11 @@

      Main changes

      License

      - -[osi certified] + +[Open Source Initiative Approved License] Lua is free software distributed under the terms of the -MIT license +MIT license reproduced below; it may be used for any purpose, including commercial purposes, at absolutely no cost without having to ask us. @@ -299,11 +298,11 @@

      License

      The only requirement is that if you do use Lua, then you should give us credit by including the appropriate copyright notice somewhere in your product or its documentation. -For details, see -this. +For details, see the +license page.
      -Copyright © 1994–2022 Lua.org, PUC-Rio. +Copyright © 1994–2024 Lua.org, PUC-Rio.

      Permission is hereby granted, free of charge, to any person obtaining a copy @@ -330,10 +329,10 @@

      License

      diff --git a/3rdparty/lua/src/Makefile b/3rdparty/lua/src/Makefile index 1907381fef0a7..b7711963bccdb 100644 --- a/3rdparty/lua/src/Makefile +++ b/3rdparty/lua/src/Makefile @@ -30,7 +30,7 @@ CMCFLAGS= # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= -PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris +PLATS= guess aix bsd c89 freebsd generic ios linux linux-readline macosx mingw posix solaris LUA_A= liblua.a CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o @@ -117,6 +117,9 @@ FreeBSD NetBSD OpenBSD freebsd: generic: $(ALL) +ios: + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_IOS" + Linux linux: linux-noreadline linux-noreadline: diff --git a/3rdparty/lua/src/lapi.c b/3rdparty/lua/src/lapi.c index 5ee65792d2770..332e97d169574 100644 --- a/3rdparty/lua/src/lapi.c +++ b/3rdparty/lua/src/lapi.c @@ -60,27 +60,28 @@ const char lua_ident[] = static TValue *index2value (lua_State *L, int idx) { CallInfo *ci = L->ci; if (idx > 0) { - StkId o = ci->func + idx; - api_check(L, idx <= L->ci->top - (ci->func + 1), "unacceptable index"); - if (o >= L->top) return &G(L)->nilvalue; + StkId o = ci->func.p + idx; + api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index"); + if (o >= L->top.p) return &G(L)->nilvalue; else return s2v(o); } else if (!ispseudo(idx)) { /* negative index */ - api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); - return s2v(L->top + idx); + api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), + "invalid index"); + return s2v(L->top.p + idx); } else if (idx == LUA_REGISTRYINDEX) return &G(L)->l_registry; else { /* upvalues */ idx = LUA_REGISTRYINDEX - idx; api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large"); - if (ttisCclosure(s2v(ci->func))) { /* C closure? */ - CClosure *func = clCvalue(s2v(ci->func)); + if (ttisCclosure(s2v(ci->func.p))) { /* C closure? */ + CClosure *func = clCvalue(s2v(ci->func.p)); return (idx <= func->nupvalues) ? &func->upvalue[idx-1] : &G(L)->nilvalue; } else { /* light C function or Lua function (through a hook)?) */ - api_check(L, ttislcf(s2v(ci->func)), "caller not a C function"); + api_check(L, ttislcf(s2v(ci->func.p)), "caller not a C function"); return &G(L)->nilvalue; /* no upvalues */ } } @@ -94,14 +95,15 @@ static TValue *index2value (lua_State *L, int idx) { l_sinline StkId index2stack (lua_State *L, int idx) { CallInfo *ci = L->ci; if (idx > 0) { - StkId o = ci->func + idx; - api_check(L, o < L->top, "invalid index"); + StkId o = ci->func.p + idx; + api_check(L, o < L->top.p, "invalid index"); return o; } else { /* non-positive index */ - api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); + api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), + "invalid index"); api_check(L, !ispseudo(idx), "invalid index"); - return L->top + idx; + return L->top.p + idx; } } @@ -112,17 +114,12 @@ LUA_API int lua_checkstack (lua_State *L, int n) { lua_lock(L); ci = L->ci; api_check(L, n >= 0, "negative 'n'"); - if (L->stack_last - L->top > n) /* stack large enough? */ + if (L->stack_last.p - L->top.p > n) /* stack large enough? */ res = 1; /* yes; check is OK */ - else { /* no; need to grow stack */ - int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; - if (inuse > LUAI_MAXSTACK - n) /* can grow without overflow? */ - res = 0; /* no */ - else /* try to grow stack */ - res = luaD_growstack(L, n, 0); - } - if (res && ci->top < L->top + n) - ci->top = L->top + n; /* adjust frame top */ + else /* need to grow stack */ + res = luaD_growstack(L, n, 0); + if (res && ci->top.p < L->top.p + n) + ci->top.p = L->top.p + n; /* adjust frame top */ lua_unlock(L); return res; } @@ -134,11 +131,11 @@ LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { lua_lock(to); api_checknelems(from, n); api_check(from, G(from) == G(to), "moving among independent states"); - api_check(from, to->ci->top - to->top >= n, "stack overflow"); - from->top -= n; + api_check(from, to->ci->top.p - to->top.p >= n, "stack overflow"); + from->top.p -= n; for (i = 0; i < n; i++) { - setobjs2s(to, to->top, from->top + i); - to->top++; /* stack already checked by previous 'api_check' */ + setobjs2s(to, to->top.p, from->top.p + i); + to->top.p++; /* stack already checked by previous 'api_check' */ } lua_unlock(to); } @@ -172,12 +169,12 @@ LUA_API lua_Number lua_version (lua_State *L) { LUA_API int lua_absindex (lua_State *L, int idx) { return (idx > 0 || ispseudo(idx)) ? idx - : cast_int(L->top - L->ci->func) + idx; + : cast_int(L->top.p - L->ci->func.p) + idx; } LUA_API int lua_gettop (lua_State *L) { - return cast_int(L->top - (L->ci->func + 1)); + return cast_int(L->top.p - (L->ci->func.p + 1)); } @@ -187,24 +184,24 @@ LUA_API void lua_settop (lua_State *L, int idx) { ptrdiff_t diff; /* difference for new top */ lua_lock(L); ci = L->ci; - func = ci->func; + func = ci->func.p; if (idx >= 0) { - api_check(L, idx <= ci->top - (func + 1), "new top too large"); - diff = ((func + 1) + idx) - L->top; + api_check(L, idx <= ci->top.p - (func + 1), "new top too large"); + diff = ((func + 1) + idx) - L->top.p; for (; diff > 0; diff--) - setnilvalue(s2v(L->top++)); /* clear new slots */ + setnilvalue(s2v(L->top.p++)); /* clear new slots */ } else { - api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); + api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top"); diff = idx + 1; /* will "subtract" index (as it is negative) */ } - api_check(L, L->tbclist < L->top, "previous pop of an unclosed slot"); - newtop = L->top + diff; - if (diff < 0 && L->tbclist >= newtop) { + api_check(L, L->tbclist.p < L->top.p, "previous pop of an unclosed slot"); + newtop = L->top.p + diff; + if (diff < 0 && L->tbclist.p >= newtop) { lua_assert(hastocloseCfunc(ci->nresults)); - luaF_close(L, newtop, CLOSEKTOP, 0); + newtop = luaF_close(L, newtop, CLOSEKTOP, 0); } - L->top = newtop; /* correct top only after closing any upvalue */ + L->top.p = newtop; /* correct top only after closing any upvalue */ lua_unlock(L); } @@ -213,10 +210,9 @@ LUA_API void lua_closeslot (lua_State *L, int idx) { StkId level; lua_lock(L); level = index2stack(L, idx); - api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist == level, + api_check(L, hastocloseCfunc(L->ci->nresults) && L->tbclist.p == level, "no variable to close at given level"); - luaF_close(L, level, CLOSEKTOP, 0); - level = index2stack(L, idx); /* stack may be moved */ + level = luaF_close(L, level, CLOSEKTOP, 0); setnilvalue(s2v(level)); lua_unlock(L); } @@ -245,7 +241,7 @@ l_sinline void reverse (lua_State *L, StkId from, StkId to) { LUA_API void lua_rotate (lua_State *L, int idx, int n) { StkId p, t, m; lua_lock(L); - t = L->top - 1; /* end of stack segment being rotated */ + t = L->top.p - 1; /* end of stack segment being rotated */ p = index2stack(L, idx); /* start of segment */ api_check(L, (n >= 0 ? n : -n) <= (t - p + 1), "invalid 'n'"); m = (n >= 0 ? t - n : p - n - 1); /* end of prefix */ @@ -264,7 +260,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { api_check(L, isvalid(L, to), "invalid index"); setobj(L, to, fr); if (isupvalue(toidx)) /* function upvalue? */ - luaC_barrier(L, clCvalue(s2v(L->ci->func)), fr); + luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr); /* LUA_REGISTRYINDEX does not need gc barrier (collector revisits it before finishing collection) */ lua_unlock(L); @@ -273,7 +269,7 @@ LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { LUA_API void lua_pushvalue (lua_State *L, int idx) { lua_lock(L); - setobj2s(L, L->top, index2value(L, idx)); + setobj2s(L, L->top.p, index2value(L, idx)); api_incr_top(L); lua_unlock(L); } @@ -342,12 +338,12 @@ LUA_API void lua_arith (lua_State *L, int op) { api_checknelems(L, 2); /* all other operations expect two operands */ else { /* for unary operations, add fake 2nd operand */ api_checknelems(L, 1); - setobjs2s(L, L->top, L->top - 1); + setobjs2s(L, L->top.p, L->top.p - 1); api_incr_top(L); } /* first operand at top - 2, second at top - 1; result go to top - 2 */ - luaO_arith(L, op, s2v(L->top - 2), s2v(L->top - 1), L->top - 2); - L->top--; /* remove second operand */ + luaO_arith(L, op, s2v(L->top.p - 2), s2v(L->top.p - 1), L->top.p - 2); + L->top.p--; /* remove second operand */ lua_unlock(L); } @@ -373,7 +369,7 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { LUA_API size_t lua_stringtonumber (lua_State *L, const char *s) { - size_t sz = luaO_str2num(s, s2v(L->top)); + size_t sz = luaO_str2num(s, s2v(L->top.p)); if (sz != 0) api_incr_top(L); return sz; @@ -421,9 +417,9 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { o = index2value(L, idx); /* previous call may reallocate the stack */ } if (len != NULL) - *len = vslen(o); + *len = tsslen(tsvalue(o)); lua_unlock(L); - return svalue(o); + return getstr(tsvalue(o)); } @@ -500,7 +496,7 @@ LUA_API const void *lua_topointer (lua_State *L, int idx) { LUA_API void lua_pushnil (lua_State *L) { lua_lock(L); - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); api_incr_top(L); lua_unlock(L); } @@ -508,7 +504,7 @@ LUA_API void lua_pushnil (lua_State *L) { LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { lua_lock(L); - setfltvalue(s2v(L->top), n); + setfltvalue(s2v(L->top.p), n); api_incr_top(L); lua_unlock(L); } @@ -516,7 +512,7 @@ LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { lua_lock(L); - setivalue(s2v(L->top), n); + setivalue(s2v(L->top.p), n); api_incr_top(L); lua_unlock(L); } @@ -531,7 +527,7 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) { TString *ts; lua_lock(L); ts = (len == 0) ? luaS_new(L, "") : luaS_newlstr(L, s, len); - setsvalue2s(L, L->top, ts); + setsvalue2s(L, L->top.p, ts); api_incr_top(L); luaC_checkGC(L); lua_unlock(L); @@ -542,11 +538,11 @@ LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) { LUA_API const char *lua_pushstring (lua_State *L, const char *s) { lua_lock(L); if (s == NULL) - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); else { TString *ts; ts = luaS_new(L, s); - setsvalue2s(L, L->top, ts); + setsvalue2s(L, L->top.p, ts); s = getstr(ts); /* internal copy's address */ } api_incr_top(L); @@ -583,7 +579,7 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { lua_lock(L); if (n == 0) { - setfvalue(s2v(L->top), fn); + setfvalue(s2v(L->top.p), fn); api_incr_top(L); } else { @@ -592,13 +588,13 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { api_check(L, n <= MAXUPVAL, "upvalue index too large"); cl = luaF_newCclosure(L, n); cl->f = fn; - L->top -= n; + L->top.p -= n; while (n--) { - setobj2n(L, &cl->upvalue[n], s2v(L->top + n)); + setobj2n(L, &cl->upvalue[n], s2v(L->top.p + n)); /* does not need barrier because closure is white */ lua_assert(iswhite(cl)); } - setclCvalue(L, s2v(L->top), cl); + setclCvalue(L, s2v(L->top.p), cl); api_incr_top(L); luaC_checkGC(L); } @@ -609,9 +605,9 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { LUA_API void lua_pushboolean (lua_State *L, int b) { lua_lock(L); if (b) - setbtvalue(s2v(L->top)); + setbtvalue(s2v(L->top.p)); else - setbfvalue(s2v(L->top)); + setbfvalue(s2v(L->top.p)); api_incr_top(L); lua_unlock(L); } @@ -619,7 +615,7 @@ LUA_API void lua_pushboolean (lua_State *L, int b) { LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { lua_lock(L); - setpvalue(s2v(L->top), p); + setpvalue(s2v(L->top.p), p); api_incr_top(L); lua_unlock(L); } @@ -627,7 +623,7 @@ LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { LUA_API int lua_pushthread (lua_State *L) { lua_lock(L); - setthvalue(L, s2v(L->top), L); + setthvalue(L, s2v(L->top.p), L); api_incr_top(L); lua_unlock(L); return (G(L)->mainthread == L); @@ -644,16 +640,16 @@ l_sinline int auxgetstr (lua_State *L, const TValue *t, const char *k) { const TValue *slot; TString *str = luaS_new(L, k); if (luaV_fastget(L, t, str, slot, luaH_getstr)) { - setobj2s(L, L->top, slot); + setobj2s(L, L->top.p, slot); api_incr_top(L); } else { - setsvalue2s(L, L->top, str); + setsvalue2s(L, L->top.p, str); api_incr_top(L); - luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); + luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); } lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -680,13 +676,13 @@ LUA_API int lua_gettable (lua_State *L, int idx) { TValue *t; lua_lock(L); t = index2value(L, idx); - if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) { - setobj2s(L, L->top - 1, slot); + if (luaV_fastget(L, t, s2v(L->top.p - 1), slot, luaH_get)) { + setobj2s(L, L->top.p - 1, slot); } else - luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); + luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -702,27 +698,27 @@ LUA_API int lua_geti (lua_State *L, int idx, lua_Integer n) { lua_lock(L); t = index2value(L, idx); if (luaV_fastgeti(L, t, n, slot)) { - setobj2s(L, L->top, slot); + setobj2s(L, L->top.p, slot); } else { TValue aux; setivalue(&aux, n); - luaV_finishget(L, t, &aux, L->top, slot); + luaV_finishget(L, t, &aux, L->top.p, slot); } api_incr_top(L); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } l_sinline int finishrawget (lua_State *L, const TValue *val) { if (isempty(val)) /* avoid copying empty items to the stack */ - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); else - setobj2s(L, L->top, val); + setobj2s(L, L->top.p, val); api_incr_top(L); lua_unlock(L); - return ttype(s2v(L->top - 1)); + return ttype(s2v(L->top.p - 1)); } @@ -739,8 +735,8 @@ LUA_API int lua_rawget (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - val = luaH_get(t, s2v(L->top - 1)); - L->top--; /* remove key */ + val = luaH_get(t, s2v(L->top.p - 1)); + L->top.p--; /* remove key */ return finishrawget(L, val); } @@ -767,7 +763,7 @@ LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { Table *t; lua_lock(L); t = luaH_new(L); - sethvalue2s(L, L->top, t); + sethvalue2s(L, L->top.p, t); api_incr_top(L); if (narray > 0 || nrec > 0) luaH_resize(L, t, narray, nrec); @@ -794,7 +790,7 @@ LUA_API int lua_getmetatable (lua_State *L, int objindex) { break; } if (mt != NULL) { - sethvalue2s(L, L->top, mt); + sethvalue2s(L, L->top.p, mt); api_incr_top(L); res = 1; } @@ -810,12 +806,12 @@ LUA_API int lua_getiuservalue (lua_State *L, int idx, int n) { o = index2value(L, idx); api_check(L, ttisfulluserdata(o), "full userdata expected"); if (n <= 0 || n > uvalue(o)->nuvalue) { - setnilvalue(s2v(L->top)); + setnilvalue(s2v(L->top.p)); t = LUA_TNONE; } else { - setobj2s(L, L->top, &uvalue(o)->uv[n - 1].uv); - t = ttype(s2v(L->top)); + setobj2s(L, L->top.p, &uvalue(o)->uv[n - 1].uv); + t = ttype(s2v(L->top.p)); } api_incr_top(L); lua_unlock(L); @@ -835,14 +831,14 @@ static void auxsetstr (lua_State *L, const TValue *t, const char *k) { TString *str = luaS_new(L, k); api_checknelems(L, 1); if (luaV_fastget(L, t, str, slot, luaH_getstr)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); - L->top--; /* pop value */ + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); + L->top.p--; /* pop value */ } else { - setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */ + setsvalue2s(L, L->top.p, str); /* push 'str' (to make it a TValue) */ api_incr_top(L); - luaV_finishset(L, t, s2v(L->top - 1), s2v(L->top - 2), slot); - L->top -= 2; /* pop value and key */ + luaV_finishset(L, t, s2v(L->top.p - 1), s2v(L->top.p - 2), slot); + L->top.p -= 2; /* pop value and key */ } lua_unlock(L); /* lock done by caller */ } @@ -862,12 +858,12 @@ LUA_API void lua_settable (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 2); t = index2value(L, idx); - if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); + if (luaV_fastget(L, t, s2v(L->top.p - 2), slot, luaH_get)) { + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); } else - luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot); - L->top -= 2; /* pop index and value */ + luaV_finishset(L, t, s2v(L->top.p - 2), s2v(L->top.p - 1), slot); + L->top.p -= 2; /* pop index and value */ lua_unlock(L); } @@ -885,14 +881,14 @@ LUA_API void lua_seti (lua_State *L, int idx, lua_Integer n) { api_checknelems(L, 1); t = index2value(L, idx); if (luaV_fastgeti(L, t, n, slot)) { - luaV_finishfastset(L, t, slot, s2v(L->top - 1)); + luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); } else { TValue aux; setivalue(&aux, n); - luaV_finishset(L, t, &aux, s2v(L->top - 1), slot); + luaV_finishset(L, t, &aux, s2v(L->top.p - 1), slot); } - L->top--; /* pop value */ + L->top.p--; /* pop value */ lua_unlock(L); } @@ -902,16 +898,16 @@ static void aux_rawset (lua_State *L, int idx, TValue *key, int n) { lua_lock(L); api_checknelems(L, n); t = gettable(L, idx); - luaH_set(L, t, key, s2v(L->top - 1)); + luaH_set(L, t, key, s2v(L->top.p - 1)); invalidateTMcache(t); - luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); - L->top -= n; + luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); + L->top.p -= n; lua_unlock(L); } LUA_API void lua_rawset (lua_State *L, int idx) { - aux_rawset(L, idx, s2v(L->top - 2), 2); + aux_rawset(L, idx, s2v(L->top.p - 2), 2); } @@ -927,9 +923,9 @@ LUA_API void lua_rawseti (lua_State *L, int idx, lua_Integer n) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - luaH_setint(L, t, n, s2v(L->top - 1)); - luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); - L->top--; + luaH_setint(L, t, n, s2v(L->top.p - 1)); + luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); + L->top.p--; lua_unlock(L); } @@ -940,11 +936,11 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { lua_lock(L); api_checknelems(L, 1); obj = index2value(L, objindex); - if (ttisnil(s2v(L->top - 1))) + if (ttisnil(s2v(L->top.p - 1))) mt = NULL; else { - api_check(L, ttistable(s2v(L->top - 1)), "table expected"); - mt = hvalue(s2v(L->top - 1)); + api_check(L, ttistable(s2v(L->top.p - 1)), "table expected"); + mt = hvalue(s2v(L->top.p - 1)); } switch (ttype(obj)) { case LUA_TTABLE: { @@ -968,7 +964,7 @@ LUA_API int lua_setmetatable (lua_State *L, int objindex) { break; } } - L->top--; + L->top.p--; lua_unlock(L); return 1; } @@ -984,11 +980,11 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) { if (!(cast_uint(n) - 1u < cast_uint(uvalue(o)->nuvalue))) res = 0; /* 'n' not in [1, uvalue(o)->nuvalue] */ else { - setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top - 1)); - luaC_barrierback(L, gcvalue(o), s2v(L->top - 1)); + setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top.p - 1)); + luaC_barrierback(L, gcvalue(o), s2v(L->top.p - 1)); res = 1; } - L->top--; + L->top.p--; lua_unlock(L); return res; } @@ -1000,7 +996,8 @@ LUA_API int lua_setiuservalue (lua_State *L, int idx, int n) { #define checkresults(L,na,nr) \ - api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \ + api_check(L, (nr) == LUA_MULTRET \ + || (L->ci->top.p - L->top.p >= (nr) - (na)), \ "results from function overflow current stack size") @@ -1013,7 +1010,7 @@ LUA_API void lua_callk (lua_State *L, int nargs, int nresults, api_checknelems(L, nargs+1); api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); checkresults(L, nargs, nresults); - func = L->top - (nargs+1); + func = L->top.p - (nargs+1); if (k != NULL && yieldable(L)) { /* need to prepare continuation? */ L->ci->u.c.k = k; /* save continuation */ L->ci->u.c.ctx = ctx; /* save context */ @@ -1061,7 +1058,7 @@ LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, api_check(L, ttisfunction(s2v(o)), "error handler must be a function"); func = savestack(L, o); } - c.func = L->top - (nargs+1); /* function to be called */ + c.func = L->top.p - (nargs+1); /* function to be called */ if (k == NULL || !yieldable(L)) { /* no continuation or no yieldable? */ c.nresults = nresults; /* do a 'conventional' protected call */ status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); @@ -1096,12 +1093,12 @@ LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, luaZ_init(L, &z, reader, data); status = luaD_protectedparser(L, &z, chunkname, mode); if (status == LUA_OK) { /* no errors? */ - LClosure *f = clLvalue(s2v(L->top - 1)); /* get newly created function */ + LClosure *f = clLvalue(s2v(L->top.p - 1)); /* get new function */ if (f->nupvalues >= 1) { /* does it have an upvalue? */ /* get global table from registry */ const TValue *gt = getGtable(L); /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ - setobj(L, f->upvals[0]->v, gt); + setobj(L, f->upvals[0]->v.p, gt); luaC_barrier(L, f->upvals[0], gt); } } @@ -1115,7 +1112,7 @@ LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data, int strip) { TValue *o; lua_lock(L); api_checknelems(L, 1); - o = s2v(L->top - 1); + o = s2v(L->top.p - 1); if (isLfunction(o)) status = luaU_dump(L, getproto(o), writer, data, strip); else @@ -1241,7 +1238,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { LUA_API int lua_error (lua_State *L) { TValue *errobj; lua_lock(L); - errobj = s2v(L->top - 1); + errobj = s2v(L->top.p - 1); api_checknelems(L, 1); /* error object is the memory error message? */ if (ttisshrstring(errobj) && eqshrstr(tsvalue(errobj), G(L)->memerrmsg)) @@ -1259,12 +1256,12 @@ LUA_API int lua_next (lua_State *L, int idx) { lua_lock(L); api_checknelems(L, 1); t = gettable(L, idx); - more = luaH_next(L, t, L->top - 1); + more = luaH_next(L, t, L->top.p - 1); if (more) { api_incr_top(L); } else /* no more elements */ - L->top -= 1; /* remove key */ + L->top.p -= 1; /* remove key */ lua_unlock(L); return more; } @@ -1276,7 +1273,7 @@ LUA_API void lua_toclose (lua_State *L, int idx) { lua_lock(L); o = index2stack(L, idx); nresults = L->ci->nresults; - api_check(L, L->tbclist < o, "given index below or equal a marked one"); + api_check(L, L->tbclist.p < o, "given index below or equal a marked one"); luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ if (!hastocloseCfunc(nresults)) /* function not marked yet? */ L->ci->nresults = codeNresults(nresults); /* mark it */ @@ -1291,7 +1288,7 @@ LUA_API void lua_concat (lua_State *L, int n) { if (n > 0) luaV_concat(L, n); else { /* nothing to concatenate */ - setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); /* push empty string */ + setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ api_incr_top(L); } luaC_checkGC(L); @@ -1303,7 +1300,7 @@ LUA_API void lua_len (lua_State *L, int idx) { TValue *t; lua_lock(L); t = index2value(L, idx); - luaV_objlen(L, L->top, t); + luaV_objlen(L, L->top.p, t); api_incr_top(L); lua_unlock(L); } @@ -1348,7 +1345,7 @@ LUA_API void *lua_newuserdatauv (lua_State *L, size_t size, int nuvalue) { lua_lock(L); api_check(L, 0 <= nuvalue && nuvalue < USHRT_MAX, "invalid value"); u = luaS_newudata(L, size, nuvalue); - setuvalue(L, s2v(L->top), u); + setuvalue(L, s2v(L->top.p), u); api_incr_top(L); luaC_checkGC(L); lua_unlock(L); @@ -1374,7 +1371,7 @@ static const char *aux_upvalue (TValue *fi, int n, TValue **val, Proto *p = f->p; if (!(cast_uint(n) - 1u < cast_uint(p->sizeupvalues))) return NULL; /* 'n' not in [1, p->sizeupvalues] */ - *val = f->upvals[n-1]->v; + *val = f->upvals[n-1]->v.p; if (owner) *owner = obj2gco(f->upvals[n - 1]); name = p->upvalues[n-1].name; return (name == NULL) ? "(no name)" : getstr(name); @@ -1390,7 +1387,7 @@ LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { lua_lock(L); name = aux_upvalue(index2value(L, funcindex), n, &val, NULL); if (name) { - setobj2s(L, L->top, val); + setobj2s(L, L->top.p, val); api_incr_top(L); } lua_unlock(L); @@ -1408,8 +1405,8 @@ LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { api_checknelems(L, 1); name = aux_upvalue(fi, n, &val, &owner); if (name) { - L->top--; - setobj(L, val, s2v(L->top)); + L->top.p--; + setobj(L, val, s2v(L->top.p)); luaC_barrier(L, owner, val); } lua_unlock(L); diff --git a/3rdparty/lua/src/lapi.h b/3rdparty/lua/src/lapi.h index 9e99cc44824df..a742427cdc796 100644 --- a/3rdparty/lua/src/lapi.h +++ b/3rdparty/lua/src/lapi.h @@ -12,23 +12,26 @@ #include "lstate.h" -/* Increments 'L->top', checking for stack overflows */ -#define api_incr_top(L) {L->top++; api_check(L, L->top <= L->ci->top, \ - "stack overflow");} +/* Increments 'L->top.p', checking for stack overflows */ +#define api_incr_top(L) {L->top.p++; \ + api_check(L, L->top.p <= L->ci->top.p, \ + "stack overflow");} /* ** If a call returns too many multiple returns, the callee may not have ** stack space to accommodate all results. In this case, this macro -** increases its stack space ('L->ci->top'). +** increases its stack space ('L->ci->top.p'). */ #define adjustresults(L,nres) \ - { if ((nres) <= LUA_MULTRET && L->ci->top < L->top) L->ci->top = L->top; } + { if ((nres) <= LUA_MULTRET && L->ci->top.p < L->top.p) \ + L->ci->top.p = L->top.p; } /* Ensure the stack has at least 'n' elements */ -#define api_checknelems(L,n) api_check(L, (n) < (L->top - L->ci->func), \ - "not enough elements in the stack") +#define api_checknelems(L,n) \ + api_check(L, (n) < (L->top.p - L->ci->func.p), \ + "not enough elements in the stack") /* diff --git a/3rdparty/lua/src/lauxlib.c b/3rdparty/lua/src/lauxlib.c index 8ed1da1122fc9..923105ed31769 100644 --- a/3rdparty/lua/src/lauxlib.c +++ b/3rdparty/lua/src/lauxlib.c @@ -80,6 +80,7 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { int top = lua_gettop(L); lua_getinfo(L, "f", ar); /* push function */ lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); + luaL_checkstack(L, 6, "not enough stack"); /* slots for 'findfield' */ if (findfield(L, top + 1, 2)) { const char *name = lua_tostring(L, -1); if (strncmp(name, LUA_GNAME ".", 3) == 0) { /* name start with '_G.'? */ @@ -249,11 +250,13 @@ LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { return 1; } else { + const char *msg; luaL_pushfail(L); + msg = (en != 0) ? strerror(en) : "(no extra info)"; if (fname) - lua_pushfstring(L, "%s: %s", fname, strerror(en)); + lua_pushfstring(L, "%s: %s", fname, msg); else - lua_pushstring(L, strerror(en)); + lua_pushstring(L, msg); lua_pushinteger(L, en); return 3; } @@ -526,13 +529,14 @@ static void newbox (lua_State *L) { /* ** Compute new size for buffer 'B', enough to accommodate extra 'sz' -** bytes. +** bytes. (The test for "not big enough" also gets the case when the +** computation of 'newsize' overflows.) */ static size_t newbuffsize (luaL_Buffer *B, size_t sz) { - size_t newsize = B->size * 2; /* double buffer size */ + size_t newsize = (B->size / 2) * 3; /* buffer size * 1.5 */ if (l_unlikely(MAX_SIZET - sz < B->n)) /* overflow in (B->n + sz)? */ return luaL_error(B->L, "buffer too large"); - if (newsize < B->n + sz) /* double is not big enough? */ + if (newsize < B->n + sz) /* not big enough? */ newsize = B->n + sz; return newsize; } @@ -611,7 +615,7 @@ LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { ** box (if existent) is not on the top of the stack. So, instead of ** calling 'luaL_addlstring', it replicates the code using -2 as the ** last argument to 'prepbuffsize', signaling that the box is (or will -** be) bellow the string being added to the buffer. (Box creation can +** be) below the string being added to the buffer. (Box creation can ** trigger an emergency GC, so we should not remove the string from the ** stack before we have the space guaranteed.) */ @@ -731,25 +735,29 @@ static const char *getF (lua_State *L, void *ud, size_t *size) { static int errfile (lua_State *L, const char *what, int fnameindex) { - const char *serr = strerror(errno); + int err = errno; const char *filename = lua_tostring(L, fnameindex) + 1; - lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + if (err != 0) + lua_pushfstring(L, "cannot %s %s: %s", what, filename, strerror(err)); + else + lua_pushfstring(L, "cannot %s %s", what, filename); lua_remove(L, fnameindex); return LUA_ERRFILE; } -static int skipBOM (LoadF *lf) { - const char *p = "\xEF\xBB\xBF"; /* UTF-8 BOM mark */ - int c; - lf->n = 0; - do { - c = getc(lf->f); - if (c == EOF || c != *(const unsigned char *)p++) return c; - lf->buff[lf->n++] = c; /* to be read by the parser */ - } while (*p != '\0'); - lf->n = 0; /* prefix matched; discard it */ - return getc(lf->f); /* return next character */ +/* +** Skip an optional BOM at the start of a stream. If there is an +** incomplete BOM (the first character is correct but the rest is +** not), returns the first character anyway to force an error +** (as no chunk can start with 0xEF). +*/ +static int skipBOM (FILE *f) { + int c = getc(f); /* read first character */ + if (c == 0xEF && getc(f) == 0xBB && getc(f) == 0xBF) /* correct BOM? */ + return getc(f); /* ignore BOM and return next char */ + else /* no (valid) BOM */ + return c; /* return first character */ } @@ -760,13 +768,13 @@ static int skipBOM (LoadF *lf) { ** first "valid" character of the file (after the optional BOM and ** a first-line comment). */ -static int skipcomment (LoadF *lf, int *cp) { - int c = *cp = skipBOM(lf); +static int skipcomment (FILE *f, int *cp) { + int c = *cp = skipBOM(f); if (c == '#') { /* first line is a comment (Unix exec. file)? */ do { /* skip first line */ - c = getc(lf->f); + c = getc(f); } while (c != EOF && c != '\n'); - *cp = getc(lf->f); /* skip end-of-line, if present */ + *cp = getc(f); /* next character after comment, if present */ return 1; /* there was a comment */ } else return 0; /* no comment */ @@ -785,18 +793,25 @@ LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, } else { lua_pushfstring(L, "@%s", filename); + errno = 0; lf.f = fopen(filename, "r"); if (lf.f == NULL) return errfile(L, "open", fnameindex); } - if (skipcomment(&lf, &c)) /* read initial portion */ - lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */ - if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ - lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ - if (lf.f == NULL) return errfile(L, "reopen", fnameindex); - skipcomment(&lf, &c); /* re-read initial portion */ + lf.n = 0; + if (skipcomment(lf.f, &c)) /* read initial portion */ + lf.buff[lf.n++] = '\n'; /* add newline to correct line numbers */ + if (c == LUA_SIGNATURE[0]) { /* binary file? */ + lf.n = 0; /* remove possible newline */ + if (filename) { /* "real" file? */ + errno = 0; + lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (lf.f == NULL) return errfile(L, "reopen", fnameindex); + skipcomment(lf.f, &c); /* re-read initial portion */ + } } if (c != EOF) lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ + errno = 0; status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); readstatus = ferror(lf.f); if (filename) fclose(lf.f); /* close file (even in case of errors) */ @@ -927,7 +942,7 @@ LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { luaL_checkstack(L, nup, "too many upvalues"); for (; l->name != NULL; l++) { /* fill the table with given functions */ - if (l->func == NULL) /* place holder? */ + if (l->func == NULL) /* placeholder? */ lua_pushboolean(L, 0); else { int i; @@ -1019,9 +1034,14 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { } +/* +** Standard panic funcion just prints an error message. The test +** with 'lua_type' avoids possible memory errors in 'lua_tostring'. +*/ static int panic (lua_State *L) { - const char *msg = lua_tostring(L, -1); - if (msg == NULL) msg = "error object is not a string"; + const char *msg = (lua_type(L, -1) == LUA_TSTRING) + ? lua_tostring(L, -1) + : "error object is not a string"; lua_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", msg); return 0; /* return to Lua to abort */ diff --git a/3rdparty/lua/src/lcode.c b/3rdparty/lua/src/lcode.c index 06425a1db8006..87616140ebe1c 100644 --- a/3rdparty/lua/src/lcode.c +++ b/3rdparty/lua/src/lcode.c @@ -415,7 +415,7 @@ int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { /* ** Format and emit an 'iAsBx' instruction. */ -int luaK_codeAsBx (FuncState *fs, OpCode o, int a, int bc) { +static int codeAsBx (FuncState *fs, OpCode o, int a, int bc) { unsigned int b = bc + OFFSET_sBx; lua_assert(getOpMode(o) == iAsBx); lua_assert(a <= MAXARG_A && b <= MAXARG_Bx); @@ -671,7 +671,7 @@ static int fitsBx (lua_Integer i) { void luaK_int (FuncState *fs, int reg, lua_Integer i) { if (fitsBx(i)) - luaK_codeAsBx(fs, OP_LOADI, reg, cast_int(i)); + codeAsBx(fs, OP_LOADI, reg, cast_int(i)); else luaK_codek(fs, reg, luaK_intK(fs, i)); } @@ -680,7 +680,7 @@ void luaK_int (FuncState *fs, int reg, lua_Integer i) { static void luaK_float (FuncState *fs, int reg, lua_Number f) { lua_Integer fi; if (luaV_flttointeger(f, &fi, F2Ieq) && fitsBx(fi)) - luaK_codeAsBx(fs, OP_LOADF, reg, cast_int(fi)); + codeAsBx(fs, OP_LOADF, reg, cast_int(fi)); else luaK_codek(fs, reg, luaK_numberK(fs, f)); } @@ -776,7 +776,8 @@ void luaK_dischargevars (FuncState *fs, expdesc *e) { break; } case VLOCAL: { /* already in a register */ - e->u.info = e->u.var.ridx; + int temp = e->u.var.ridx; + e->u.info = temp; /* (can't do a direct assignment; values overlap) */ e->k = VNONRELOC; /* becomes a non-relocatable value */ break; } @@ -1025,7 +1026,7 @@ static int luaK_exp2K (FuncState *fs, expdesc *e) { ** in the range of R/K indices). ** Returns 1 iff expression is K. */ -int luaK_exp2RK (FuncState *fs, expdesc *e) { +static int exp2RK (FuncState *fs, expdesc *e) { if (luaK_exp2K(fs, e)) return 1; else { /* not a constant in the right range: put it in a register */ @@ -1037,7 +1038,7 @@ int luaK_exp2RK (FuncState *fs, expdesc *e) { static void codeABRK (FuncState *fs, OpCode o, int a, int b, expdesc *ec) { - int k = luaK_exp2RK(fs, ec); + int k = exp2RK(fs, ec); luaK_codeABCk(fs, o, a, b, ec->u.info, k); } @@ -1215,7 +1216,7 @@ static void codenot (FuncState *fs, expdesc *e) { /* -** Check whether expression 'e' is a small literal string +** Check whether expression 'e' is a short literal string */ static int isKstr (FuncState *fs, expdesc *e) { return (e->k == VK && !hasjumps(e) && e->u.info <= MAXARG_B && @@ -1225,7 +1226,7 @@ static int isKstr (FuncState *fs, expdesc *e) { /* ** Check whether expression 'e' is a literal integer. */ -int luaK_isKint (expdesc *e) { +static int isKint (expdesc *e) { return (e->k == VKINT && !hasjumps(e)); } @@ -1235,7 +1236,7 @@ int luaK_isKint (expdesc *e) { ** proper range to fit in register C */ static int isCint (expdesc *e) { - return luaK_isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C)); + return isKint(e) && (l_castS2U(e->u.ival) <= l_castS2U(MAXARG_C)); } @@ -1244,7 +1245,7 @@ static int isCint (expdesc *e) { ** proper range to fit in register sC */ static int isSCint (expdesc *e) { - return luaK_isKint(e) && fitsC(e->u.ival); + return isKint(e) && fitsC(e->u.ival); } @@ -1283,15 +1284,17 @@ void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { if (t->k == VUPVAL && !isKstr(fs, k)) /* upvalue indexed by non 'Kstr'? */ luaK_exp2anyreg(fs, t); /* put it in a register */ if (t->k == VUPVAL) { - t->u.ind.t = t->u.info; /* upvalue index */ - t->u.ind.idx = k->u.info; /* literal string */ + int temp = t->u.info; /* upvalue index */ + lua_assert(isKstr(fs, k)); + t->u.ind.t = temp; /* (can't do a direct assignment; values overlap) */ + t->u.ind.idx = k->u.info; /* literal short string */ t->k = VINDEXUP; } else { /* register index of the table */ t->u.ind.t = (t->k == VLOCAL) ? t->u.var.ridx: t->u.info; if (isKstr(fs, k)) { - t->u.ind.idx = k->u.info; /* literal string */ + t->u.ind.idx = k->u.info; /* literal short string */ t->k = VINDEXSTR; } else if (isCint(k)) { @@ -1351,6 +1354,35 @@ static int constfolding (FuncState *fs, int op, expdesc *e1, } +/* +** Convert a BinOpr to an OpCode (ORDER OPR - ORDER OP) +*/ +l_sinline OpCode binopr2op (BinOpr opr, BinOpr baser, OpCode base) { + lua_assert(baser <= opr && + ((baser == OPR_ADD && opr <= OPR_SHR) || + (baser == OPR_LT && opr <= OPR_LE))); + return cast(OpCode, (cast_int(opr) - cast_int(baser)) + cast_int(base)); +} + + +/* +** Convert a UnOpr to an OpCode (ORDER OPR - ORDER OP) +*/ +l_sinline OpCode unopr2op (UnOpr opr) { + return cast(OpCode, (cast_int(opr) - cast_int(OPR_MINUS)) + + cast_int(OP_UNM)); +} + + +/* +** Convert a BinOpr to a tag method (ORDER OPR - ORDER TM) +*/ +l_sinline TMS binopr2TM (BinOpr opr) { + lua_assert(OPR_ADD <= opr && opr <= OPR_SHR); + return cast(TMS, (cast_int(opr) - cast_int(OPR_ADD)) + cast_int(TM_ADD)); +} + + /* ** Emit code for unary expressions that "produce values" ** (everything but 'not'). @@ -1389,12 +1421,15 @@ static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2, ** Emit code for binary expressions that "produce values" over ** two registers. */ -static void codebinexpval (FuncState *fs, OpCode op, +static void codebinexpval (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line) { - int v2 = luaK_exp2anyreg(fs, e2); /* both operands are in registers */ + OpCode op = binopr2op(opr, OPR_ADD, OP_ADD); + int v2 = luaK_exp2anyreg(fs, e2); /* make sure 'e2' is in a register */ + /* 'e1' must be already in a register or it is a constant */ + lua_assert((VNIL <= e1->k && e1->k <= VKSTR) || + e1->k == VNONRELOC || e1->k == VRELOC); lua_assert(OP_ADD <= op && op <= OP_SHR); - finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, - cast(TMS, (op - OP_ADD) + TM_ADD)); + finishbinexpval(fs, e1, e2, op, v2, 0, line, OP_MMBIN, binopr2TM(opr)); } @@ -1410,12 +1445,24 @@ static void codebini (FuncState *fs, OpCode op, } +/* +** Code binary operators with K operand. +*/ +static void codebinK (FuncState *fs, BinOpr opr, + expdesc *e1, expdesc *e2, int flip, int line) { + TMS event = binopr2TM(opr); + int v2 = e2->u.info; /* K index */ + OpCode op = binopr2op(opr, OPR_ADD, OP_ADDK); + finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event); +} + + /* Try to code a binary operator negating its second operand. ** For the metamethod, 2nd operand must keep its original value. */ static int finishbinexpneg (FuncState *fs, expdesc *e1, expdesc *e2, OpCode op, int line, TMS event) { - if (!luaK_isKint(e2)) + if (!isKint(e2)) return 0; /* not an integer constant */ else { lua_Integer i2 = e2->u.ival; @@ -1437,24 +1484,27 @@ static void swapexps (expdesc *e1, expdesc *e2) { } +/* +** Code binary operators with no constant operand. +*/ +static void codebinNoK (FuncState *fs, BinOpr opr, + expdesc *e1, expdesc *e2, int flip, int line) { + if (flip) + swapexps(e1, e2); /* back to original order */ + codebinexpval(fs, opr, e1, e2, line); /* use standard operators */ +} + + /* ** Code arithmetic operators ('+', '-', ...). If second operand is a ** constant in the proper range, use variant opcodes with K operands. */ static void codearith (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int flip, int line) { - TMS event = cast(TMS, opr + TM_ADD); - if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) { /* K operand? */ - int v2 = e2->u.info; /* K index */ - OpCode op = cast(OpCode, opr + OP_ADDK); - finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, event); - } - else { /* 'e2' is neither an immediate nor a K operand */ - OpCode op = cast(OpCode, opr + OP_ADD); - if (flip) - swapexps(e1, e2); /* back to original order */ - codebinexpval(fs, op, e1, e2, line); /* use standard operators */ - } + if (tonumeral(e2, NULL) && luaK_exp2K(fs, e2)) /* K operand? */ + codebinK(fs, opr, e1, e2, flip, line); + else /* 'e2' is neither an immediate nor a K operand */ + codebinNoK(fs, opr, e1, e2, flip, line); } @@ -1471,35 +1521,27 @@ static void codecommutative (FuncState *fs, BinOpr op, flip = 1; } if (op == OPR_ADD && isSCint(e2)) /* immediate operand? */ - codebini(fs, cast(OpCode, OP_ADDI), e1, e2, flip, line, TM_ADD); + codebini(fs, OP_ADDI, e1, e2, flip, line, TM_ADD); else codearith(fs, op, e1, e2, flip, line); } /* -** Code bitwise operations; they are all associative, so the function +** Code bitwise operations; they are all commutative, so the function ** tries to put an integer constant as the 2nd operand (a K operand). */ static void codebitwise (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2, int line) { int flip = 0; - int v2; - OpCode op; - if (e1->k == VKINT && luaK_exp2RK(fs, e1)) { + if (e1->k == VKINT) { swapexps(e1, e2); /* 'e2' will be the constant operand */ flip = 1; } - else if (!(e2->k == VKINT && luaK_exp2RK(fs, e2))) { /* no constants? */ - op = cast(OpCode, opr + OP_ADD); - codebinexpval(fs, op, e1, e2, line); /* all-register opcodes */ - return; - } - v2 = e2->u.info; /* index in K array */ - op = cast(OpCode, opr + OP_ADDK); - lua_assert(ttisinteger(&fs->f->k[v2])); - finishbinexpval(fs, e1, e2, op, v2, flip, line, OP_MMBINK, - cast(TMS, opr + TM_ADD)); + if (e2->k == VKINT && luaK_exp2K(fs, e2)) /* K operand? */ + codebinK(fs, opr, e1, e2, flip, line); + else /* no constants */ + codebinNoK(fs, opr, e1, e2, flip, line); } @@ -1507,25 +1549,27 @@ static void codebitwise (FuncState *fs, BinOpr opr, ** Emit code for order comparisons. When using an immediate operand, ** 'isfloat' tells whether the original value was a float. */ -static void codeorder (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { +static void codeorder (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { int r1, r2; int im; int isfloat = 0; + OpCode op; if (isSCnumber(e2, &im, &isfloat)) { /* use immediate operand */ r1 = luaK_exp2anyreg(fs, e1); r2 = im; - op = cast(OpCode, (op - OP_LT) + OP_LTI); + op = binopr2op(opr, OPR_LT, OP_LTI); } else if (isSCnumber(e1, &im, &isfloat)) { /* transform (A < B) to (B > A) and (A <= B) to (B >= A) */ r1 = luaK_exp2anyreg(fs, e2); r2 = im; - op = (op == OP_LT) ? OP_GTI : OP_GEI; + op = binopr2op(opr, OPR_LT, OP_GTI); } else { /* regular case, compare two registers */ r1 = luaK_exp2anyreg(fs, e1); r2 = luaK_exp2anyreg(fs, e2); + op = binopr2op(opr, OPR_LT, OP_LT); } freeexps(fs, e1, e2); e1->u.info = condjump(fs, op, r1, r2, isfloat, 1); @@ -1551,7 +1595,7 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { op = OP_EQI; r2 = im; /* immediate operand */ } - else if (luaK_exp2RK(fs, e2)) { /* 1st expression is constant? */ + else if (exp2RK(fs, e2)) { /* 2nd expression is constant? */ op = OP_EQK; r2 = e2->u.info; /* constant index */ } @@ -1568,16 +1612,16 @@ static void codeeq (FuncState *fs, BinOpr opr, expdesc *e1, expdesc *e2) { /* ** Apply prefix operation 'op' to expression 'e'. */ -void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { +void luaK_prefix (FuncState *fs, UnOpr opr, expdesc *e, int line) { static const expdesc ef = {VKINT, {0}, NO_JUMP, NO_JUMP}; luaK_dischargevars(fs, e); - switch (op) { + switch (opr) { case OPR_MINUS: case OPR_BNOT: /* use 'ef' as fake 2nd operand */ - if (constfolding(fs, op + LUA_OPUNM, e, &ef)) + if (constfolding(fs, opr + LUA_OPUNM, e, &ef)) break; /* else */ /* FALLTHROUGH */ case OPR_LEN: - codeunexpval(fs, cast(OpCode, op + OP_UNM), e, line); + codeunexpval(fs, unopr2op(opr), e, line); break; case OPR_NOT: codenot(fs, e); break; default: lua_assert(0); @@ -1611,12 +1655,13 @@ void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { case OPR_SHL: case OPR_SHR: { if (!tonumeral(v, NULL)) luaK_exp2anyreg(fs, v); - /* else keep numeral, which may be folded with 2nd operand */ + /* else keep numeral, which may be folded or used as an immediate + operand */ break; } case OPR_EQ: case OPR_NE: { if (!tonumeral(v, NULL)) - luaK_exp2RK(fs, v); + exp2RK(fs, v); /* else keep numeral, which may be an immediate operand */ break; } @@ -1706,30 +1751,27 @@ void luaK_posfix (FuncState *fs, BinOpr opr, /* coded as (r1 >> -I) */; } else /* regular case (two registers) */ - codebinexpval(fs, OP_SHL, e1, e2, line); + codebinexpval(fs, opr, e1, e2, line); break; } case OPR_SHR: { if (isSCint(e2)) codebini(fs, OP_SHRI, e1, e2, 0, line, TM_SHR); /* r1 >> I */ else /* regular case (two registers) */ - codebinexpval(fs, OP_SHR, e1, e2, line); + codebinexpval(fs, opr, e1, e2, line); break; } case OPR_EQ: case OPR_NE: { codeeq(fs, opr, e1, e2); break; } - case OPR_LT: case OPR_LE: { - OpCode op = cast(OpCode, (opr - OPR_EQ) + OP_EQ); - codeorder(fs, op, e1, e2); - break; - } case OPR_GT: case OPR_GE: { /* '(a > b)' <=> '(b < a)'; '(a >= b)' <=> '(b <= a)' */ - OpCode op = cast(OpCode, (opr - OPR_NE) + OP_EQ); swapexps(e1, e2); - codeorder(fs, op, e1, e2); + opr = cast(BinOpr, (opr - OPR_GT) + OPR_LT); + } /* FALLTHROUGH */ + case OPR_LT: case OPR_LE: { + codeorder(fs, opr, e1, e2); break; } default: lua_assert(0); diff --git a/3rdparty/lua/src/lcode.h b/3rdparty/lua/src/lcode.h index 3265824452639..0b971fc4359b9 100644 --- a/3rdparty/lua/src/lcode.h +++ b/3rdparty/lua/src/lcode.h @@ -61,10 +61,8 @@ typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; LUAI_FUNC int luaK_code (FuncState *fs, Instruction i); LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); -LUAI_FUNC int luaK_codeAsBx (FuncState *fs, OpCode o, int A, int Bx); LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A, int B, int C, int k); -LUAI_FUNC int luaK_isKint (expdesc *e); LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v); LUAI_FUNC void luaK_fixline (FuncState *fs, int line); LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); @@ -76,7 +74,6 @@ LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2anyregup (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); -LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); diff --git a/3rdparty/lua/src/lcorolib.c b/3rdparty/lua/src/lcorolib.c index 785a1e81aa0ad..c64adf08a8e1a 100644 --- a/3rdparty/lua/src/lcorolib.c +++ b/3rdparty/lua/src/lcorolib.c @@ -76,7 +76,7 @@ static int luaB_auxwrap (lua_State *L) { if (l_unlikely(r < 0)) { /* error? */ int stat = lua_status(co); if (stat != LUA_OK && stat != LUA_YIELD) { /* error in the coroutine? */ - stat = lua_resetthread(co); /* close its tbc variables */ + stat = lua_closethread(co, L); /* close its tbc variables */ lua_assert(stat != LUA_OK); lua_xmove(co, L, 1); /* move error message to the caller */ } @@ -172,7 +172,7 @@ static int luaB_close (lua_State *L) { int status = auxstatus(L, co); switch (status) { case COS_DEAD: case COS_YIELD: { - status = lua_resetthread(co); + status = lua_closethread(co, L); if (status == LUA_OK) { lua_pushboolean(L, 1); return 1; diff --git a/3rdparty/lua/src/ldebug.c b/3rdparty/lua/src/ldebug.c index a716d95e22f61..591b3528a778f 100644 --- a/3rdparty/lua/src/ldebug.c +++ b/3rdparty/lua/src/ldebug.c @@ -31,7 +31,7 @@ -#define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_VCCL) +#define LuaClosure(f) ((f) != NULL && (f)->c.tt == LUA_VLCL) static const char *funcnamefromcall (lua_State *L, CallInfo *ci, @@ -182,10 +182,10 @@ static const char *upvalname (const Proto *p, int uv) { static const char *findvararg (CallInfo *ci, int n, StkId *pos) { - if (clLvalue(s2v(ci->func))->p->is_vararg) { + if (clLvalue(s2v(ci->func.p))->p->is_vararg) { int nextra = ci->u.l.nextraargs; if (n >= -nextra) { /* 'n' is negative */ - *pos = ci->func - nextra - (n + 1); + *pos = ci->func.p - nextra - (n + 1); return "(vararg)"; /* generic name for any vararg */ } } @@ -194,7 +194,7 @@ static const char *findvararg (CallInfo *ci, int n, StkId *pos) { const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) { - StkId base = ci->func + 1; + StkId base = ci->func.p + 1; const char *name = NULL; if (isLua(ci)) { if (n < 0) /* access to vararg values? */ @@ -203,7 +203,7 @@ const char *luaG_findlocal (lua_State *L, CallInfo *ci, int n, StkId *pos) { name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); } if (name == NULL) { /* no 'standard' name? */ - StkId limit = (ci == L->ci) ? L->top : ci->next->func; + StkId limit = (ci == L->ci) ? L->top.p : ci->next->func.p; if (limit - base >= n && n > 0) { /* is 'n' inside 'ci' stack? */ /* generic name for any valid slot */ name = isLua(ci) ? "(temporary)" : "(C temporary)"; @@ -221,16 +221,16 @@ LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { const char *name; lua_lock(L); if (ar == NULL) { /* information about non-active function? */ - if (!isLfunction(s2v(L->top - 1))) /* not a Lua function? */ + if (!isLfunction(s2v(L->top.p - 1))) /* not a Lua function? */ name = NULL; else /* consider live variables at function start (parameters) */ - name = luaF_getlocalname(clLvalue(s2v(L->top - 1))->p, n, 0); + name = luaF_getlocalname(clLvalue(s2v(L->top.p - 1))->p, n, 0); } else { /* active function; get information through 'ar' */ StkId pos = NULL; /* to avoid warnings */ name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { - setobjs2s(L, L->top, pos); + setobjs2s(L, L->top.p, pos); api_incr_top(L); } } @@ -245,8 +245,8 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { lua_lock(L); name = luaG_findlocal(L, ar->i_ci, n, &pos); if (name) { - setobjs2s(L, pos, L->top - 1); - L->top--; /* pop value */ + setobjs2s(L, pos, L->top.p - 1); + L->top.p--; /* pop value */ } lua_unlock(L); return name; @@ -254,7 +254,7 @@ LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { static void funcinfo (lua_Debug *ar, Closure *cl) { - if (noLuaClosure(cl)) { + if (!LuaClosure(cl)) { ar->source = "=[C]"; ar->srclen = LL("=[C]"); ar->linedefined = -1; @@ -288,29 +288,31 @@ static int nextline (const Proto *p, int currentline, int pc) { static void collectvalidlines (lua_State *L, Closure *f) { - if (noLuaClosure(f)) { - setnilvalue(s2v(L->top)); + if (!LuaClosure(f)) { + setnilvalue(s2v(L->top.p)); api_incr_top(L); } else { - int i; - TValue v; const Proto *p = f->l.p; int currentline = p->linedefined; Table *t = luaH_new(L); /* new table to store active lines */ - sethvalue2s(L, L->top, t); /* push it on stack */ + sethvalue2s(L, L->top.p, t); /* push it on stack */ api_incr_top(L); - setbtvalue(&v); /* boolean 'true' to be the value of all indices */ - if (!p->is_vararg) /* regular function? */ - i = 0; /* consider all instructions */ - else { /* vararg function */ - lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); - currentline = nextline(p, currentline, 0); - i = 1; /* skip first instruction (OP_VARARGPREP) */ - } - for (; i < p->sizelineinfo; i++) { /* for each instruction */ - currentline = nextline(p, currentline, i); /* get its line */ - luaH_setint(L, t, currentline, &v); /* table[line] = true */ + if (p->lineinfo != NULL) { /* proto with debug information? */ + int i; + TValue v; + setbtvalue(&v); /* boolean 'true' to be the value of all indices */ + if (!p->is_vararg) /* regular function? */ + i = 0; /* consider all instructions */ + else { /* vararg function */ + lua_assert(GET_OPCODE(p->code[0]) == OP_VARARGPREP); + currentline = nextline(p, currentline, 0); + i = 1; /* skip first instruction (OP_VARARGPREP) */ + } + for (; i < p->sizelineinfo; i++) { /* for each instruction */ + currentline = nextline(p, currentline, i); /* get its line */ + luaH_setint(L, t, currentline, &v); /* table[line] = true */ + } } } } @@ -339,7 +341,7 @@ static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, } case 'u': { ar->nups = (f == NULL) ? 0 : f->c.nupvalues; - if (noLuaClosure(f)) { + if (!LuaClosure(f)) { ar->isvararg = 1; ar->nparams = 0; } @@ -388,20 +390,20 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { lua_lock(L); if (*what == '>') { ci = NULL; - func = s2v(L->top - 1); + func = s2v(L->top.p - 1); api_check(L, ttisfunction(func), "function expected"); what++; /* skip the '>' */ - L->top--; /* pop function */ + L->top.p--; /* pop function */ } else { ci = ar->i_ci; - func = s2v(ci->func); + func = s2v(ci->func.p); lua_assert(ttisfunction(func)); } cl = ttisclosure(func) ? clvalue(func) : NULL; status = auxgetinfo(L, what, ar, cl, ci); if (strchr(what, 'f')) { - setobj2s(L, L->top, func); + setobj2s(L, L->top.p, func); api_incr_top(L); } if (strchr(what, 'L')) @@ -417,40 +419,6 @@ LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { ** ======================================================= */ -static const char *getobjname (const Proto *p, int lastpc, int reg, - const char **name); - - -/* -** Find a "name" for the constant 'c'. -*/ -static void kname (const Proto *p, int c, const char **name) { - TValue *kvalue = &p->k[c]; - *name = (ttisstring(kvalue)) ? svalue(kvalue) : "?"; -} - - -/* -** Find a "name" for the register 'c'. -*/ -static void rname (const Proto *p, int pc, int c, const char **name) { - const char *what = getobjname(p, pc, c, name); /* search for 'c' */ - if (!(what && *what == 'c')) /* did not find a constant name? */ - *name = "?"; -} - - -/* -** Find a "name" for a 'C' value in an RK instruction. -*/ -static void rkname (const Proto *p, int pc, Instruction i, const char **name) { - int c = GETARG_C(i); /* key index */ - if (GETARG_k(i)) /* is 'c' a constant? */ - kname(p, c, name); - else /* 'c' is a register */ - rname(p, pc, c, name); -} - static int filterpc (int pc, int jmptarget) { if (pc < jmptarget) /* is code conditional (inside a jump)? */ @@ -509,28 +477,29 @@ static int findsetreg (const Proto *p, int lastpc, int reg) { /* -** Check whether table being indexed by instruction 'i' is the -** environment '_ENV' +** Find a "name" for the constant 'c'. */ -static const char *gxf (const Proto *p, int pc, Instruction i, int isup) { - int t = GETARG_B(i); /* table index */ - const char *name; /* name of indexed variable */ - if (isup) /* is an upvalue? */ - name = upvalname(p, t); - else - getobjname(p, pc, t, &name); - return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field"; +static const char *kname (const Proto *p, int index, const char **name) { + TValue *kvalue = &p->k[index]; + if (ttisstring(kvalue)) { + *name = getstr(tsvalue(kvalue)); + return "constant"; + } + else { + *name = "?"; + return NULL; + } } -static const char *getobjname (const Proto *p, int lastpc, int reg, - const char **name) { - int pc; - *name = luaF_getlocalname(p, reg + 1, lastpc); +static const char *basicgetobjname (const Proto *p, int *ppc, int reg, + const char **name) { + int pc = *ppc; + *name = luaF_getlocalname(p, reg + 1, pc); if (*name) /* is a local? */ return "local"; /* else try symbolic execution */ - pc = findsetreg(p, lastpc, reg); + *ppc = pc = findsetreg(p, pc, reg); if (pc != -1) { /* could find instruction? */ Instruction i = p->code[pc]; OpCode op = GET_OPCODE(i); @@ -538,18 +507,80 @@ static const char *getobjname (const Proto *p, int lastpc, int reg, case OP_MOVE: { int b = GETARG_B(i); /* move from 'b' to 'a' */ if (b < GETARG_A(i)) - return getobjname(p, pc, b, name); /* get name for 'b' */ + return basicgetobjname(p, ppc, b, name); /* get name for 'b' */ break; } + case OP_GETUPVAL: { + *name = upvalname(p, GETARG_B(i)); + return "upvalue"; + } + case OP_LOADK: return kname(p, GETARG_Bx(i), name); + case OP_LOADKX: return kname(p, GETARG_Ax(p->code[pc + 1]), name); + default: break; + } + } + return NULL; /* could not find reasonable name */ +} + + +/* +** Find a "name" for the register 'c'. +*/ +static void rname (const Proto *p, int pc, int c, const char **name) { + const char *what = basicgetobjname(p, &pc, c, name); /* search for 'c' */ + if (!(what && *what == 'c')) /* did not find a constant name? */ + *name = "?"; +} + + +/* +** Find a "name" for a 'C' value in an RK instruction. +*/ +static void rkname (const Proto *p, int pc, Instruction i, const char **name) { + int c = GETARG_C(i); /* key index */ + if (GETARG_k(i)) /* is 'c' a constant? */ + kname(p, c, name); + else /* 'c' is a register */ + rname(p, pc, c, name); +} + + +/* +** Check whether table being indexed by instruction 'i' is the +** environment '_ENV' +*/ +static const char *isEnv (const Proto *p, int pc, Instruction i, int isup) { + int t = GETARG_B(i); /* table index */ + const char *name; /* name of indexed variable */ + if (isup) /* is 't' an upvalue? */ + name = upvalname(p, t); + else /* 't' is a register */ + basicgetobjname(p, &pc, t, &name); + return (name && strcmp(name, LUA_ENV) == 0) ? "global" : "field"; +} + + +/* +** Extend 'basicgetobjname' to handle table accesses +*/ +static const char *getobjname (const Proto *p, int lastpc, int reg, + const char **name) { + const char *kind = basicgetobjname(p, &lastpc, reg, name); + if (kind != NULL) + return kind; + else if (lastpc != -1) { /* could find instruction? */ + Instruction i = p->code[lastpc]; + OpCode op = GET_OPCODE(i); + switch (op) { case OP_GETTABUP: { int k = GETARG_C(i); /* key index */ kname(p, k, name); - return gxf(p, pc, i, 1); + return isEnv(p, lastpc, i, 1); } case OP_GETTABLE: { int k = GETARG_C(i); /* key index */ - rname(p, pc, k, name); - return gxf(p, pc, i, 0); + rname(p, lastpc, k, name); + return isEnv(p, lastpc, i, 0); } case OP_GETI: { *name = "integer index"; @@ -558,24 +589,10 @@ static const char *getobjname (const Proto *p, int lastpc, int reg, case OP_GETFIELD: { int k = GETARG_C(i); /* key index */ kname(p, k, name); - return gxf(p, pc, i, 0); - } - case OP_GETUPVAL: { - *name = upvalname(p, GETARG_B(i)); - return "upvalue"; - } - case OP_LOADK: - case OP_LOADKX: { - int b = (op == OP_LOADK) ? GETARG_Bx(i) - : GETARG_Ax(p->code[pc + 1]); - if (ttisstring(&p->k[b])) { - *name = svalue(&p->k[b]); - return "constant"; - } - break; + return isEnv(p, lastpc, i, 0); } case OP_SELF: { - rkname(p, pc, i, name); + rkname(p, lastpc, i, name); return "method"; } default: break; /* go through to return NULL */ @@ -627,7 +644,7 @@ static const char *funcnamefromcode (lua_State *L, const Proto *p, default: return NULL; /* cannot find a reasonable name */ } - *name = getstr(G(L)->tmname[tm]) + 2; + *name = getshrstr(G(L)->tmname[tm]) + 2; return "metamethod"; } @@ -656,18 +673,19 @@ static const char *funcnamefromcall (lua_State *L, CallInfo *ci, /* -** Check whether pointer 'o' points to some value in the stack -** frame of the current function. Because 'o' may not point to a -** value in this stack, we cannot compare it with the region -** boundaries (undefined behaviour in ISO C). +** Check whether pointer 'o' points to some value in the stack frame of +** the current function and, if so, returns its index. Because 'o' may +** not point to a value in this stack, we cannot compare it with the +** region boundaries (undefined behavior in ISO C). */ -static int isinstack (CallInfo *ci, const TValue *o) { - StkId pos; - for (pos = ci->func + 1; pos < ci->top; pos++) { - if (o == s2v(pos)) - return 1; +static int instack (CallInfo *ci, const TValue *o) { + int pos; + StkId base = ci->func.p + 1; + for (pos = 0; base + pos < ci->top.p; pos++) { + if (o == s2v(base + pos)) + return pos; } - return 0; /* not found */ + return -1; /* not found */ } @@ -681,7 +699,7 @@ static const char *getupvalname (CallInfo *ci, const TValue *o, LClosure *c = ci_func(ci); int i; for (i = 0; i < c->nupvalues; i++) { - if (c->upvals[i]->v == o) { + if (c->upvals[i]->v.p == o) { *name = upvalname(c->p, i); return "upvalue"; } @@ -708,9 +726,11 @@ static const char *varinfo (lua_State *L, const TValue *o) { const char *kind = NULL; if (isLua(ci)) { kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ - if (!kind && isinstack(ci, o)) /* no? try a register */ - kind = getobjname(ci_func(ci)->p, currentpc(ci), - cast_int(cast(StkId, o) - (ci->func + 1)), &name); + if (!kind) { /* not an upvalue? */ + int reg = instack(ci, o); /* try a register */ + if (reg >= 0) /* is 'o' a register? */ + kind = getobjname(ci_func(ci)->p, currentpc(ci), reg, &name); + } } return formatvarinfo(L, kind, name); } @@ -807,10 +827,10 @@ l_noret luaG_errormsg (lua_State *L) { if (L->errfunc != 0) { /* is there an error handling function? */ StkId errfunc = restorestack(L, L->errfunc); lua_assert(ttisfunction(s2v(errfunc))); - setobjs2s(L, L->top, L->top - 1); /* move argument */ - setobjs2s(L, L->top - 1, errfunc); /* push function */ - L->top++; /* assume EXTRA_STACK */ - luaD_callnoyield(L, L->top - 2, 1); /* call it */ + setobjs2s(L, L->top.p, L->top.p - 1); /* move argument */ + setobjs2s(L, L->top.p - 1, errfunc); /* push function */ + L->top.p++; /* assume EXTRA_STACK */ + luaD_callnoyield(L, L->top.p - 2, 1); /* call it */ } luaD_throw(L, LUA_ERRRUN); } @@ -824,8 +844,11 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { va_start(argp, fmt); msg = luaO_pushvfstring(L, fmt, argp); /* format message */ va_end(argp); - if (isLua(ci)) /* if Lua function, add source:line information */ + if (isLua(ci)) { /* if Lua function, add source:line information */ luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); + setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ + L->top.p--; + } luaG_errormsg(L); } @@ -842,7 +865,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) { if (p->lineinfo == NULL) /* no debug information? */ return 0; if (newpc - oldpc < MAXIWTHABS / 2) { /* not too far apart? */ - int delta = 0; /* line diference */ + int delta = 0; /* line difference */ int pc = oldpc; for (;;) { int lineinfo = p->lineinfo[++pc]; @@ -859,6 +882,28 @@ static int changedline (const Proto *p, int oldpc, int newpc) { } +/* +** Traces Lua calls. If code is running the first instruction of a function, +** and function is not vararg, and it is not coming from an yield, +** calls 'luaD_hookcall'. (Vararg functions will call 'luaD_hookcall' +** after adjusting its variable arguments; otherwise, they could call +** a line/count hook before the call hook. Functions coming from +** an yield already called 'luaD_hookcall' before yielding.) +*/ +int luaG_tracecall (lua_State *L) { + CallInfo *ci = L->ci; + Proto *p = ci_func(ci)->p; + ci->u.l.trap = 1; /* ensure hooks will be checked */ + if (ci->u.l.savedpc == p->code) { /* first instruction (not resuming)? */ + if (p->is_vararg) + return 0; /* hooks will start at VARARGPREP instruction */ + else if (!(ci->callstatus & CIST_HOOKYIELD)) /* not yieded? */ + luaD_hookcall(L, ci); /* check 'call' hook */ + } + return 1; /* keep 'trap' on */ +} + + /* ** Traces the execution of a Lua function. Called before the execution ** of each opcode, when debug is on. 'L->oldpc' stores the last @@ -869,7 +914,7 @@ static int changedline (const Proto *p, int oldpc, int newpc) { ** invalid; if so, use zero as a valid value. (A wrong but valid 'oldpc' ** at most causes an extra call to a line hook.) ** This function is not "Protected" when called, so it should correct -** 'L->top' before calling anything that can run the GC. +** 'L->top.p' before calling anything that can run the GC. */ int luaG_traceexec (lua_State *L, const Instruction *pc) { CallInfo *ci = L->ci; @@ -882,17 +927,17 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) { } pc++; /* reference is always next instruction */ ci->u.l.savedpc = pc; /* save 'pc' */ - counthook = (--L->hookcount == 0 && (mask & LUA_MASKCOUNT)); + counthook = (mask & LUA_MASKCOUNT) && (--L->hookcount == 0); if (counthook) resethookcount(L); /* reset count */ else if (!(mask & LUA_MASKLINE)) return 1; /* no line hook and count != 0; nothing to be done now */ - if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ + if (ci->callstatus & CIST_HOOKYIELD) { /* hook yielded last time? */ ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ return 1; /* do not call hook again (VM yielded, so it did not move) */ } if (!isIT(*(ci->u.l.savedpc - 1))) /* top not being used? */ - L->top = ci->top; /* correct top */ + L->top.p = ci->top.p; /* correct top */ if (counthook) luaD_hook(L, LUA_HOOKCOUNT, -1, 0, 0); /* call count hook */ if (mask & LUA_MASKLINE) { @@ -909,7 +954,6 @@ int luaG_traceexec (lua_State *L, const Instruction *pc) { if (L->status == LUA_YIELD) { /* did hook yield? */ if (counthook) L->hookcount = 1; /* undo decrement to zero */ - ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ luaD_throw(L, LUA_YIELD); } diff --git a/3rdparty/lua/src/ldebug.h b/3rdparty/lua/src/ldebug.h index 974960e99da07..2bfce3cb5e77b 100644 --- a/3rdparty/lua/src/ldebug.h +++ b/3rdparty/lua/src/ldebug.h @@ -15,7 +15,7 @@ /* Active Lua function (given call info) */ -#define ci_func(ci) (clLvalue(s2v((ci)->func))) +#define ci_func(ci) (clLvalue(s2v((ci)->func.p))) #define resethookcount(L) (L->hookcount = L->basehookcount) @@ -58,6 +58,7 @@ LUAI_FUNC const char *luaG_addinfo (lua_State *L, const char *msg, TString *src, int line); LUAI_FUNC l_noret luaG_errormsg (lua_State *L); LUAI_FUNC int luaG_traceexec (lua_State *L, const Instruction *pc); +LUAI_FUNC int luaG_tracecall (lua_State *L); #endif diff --git a/3rdparty/lua/src/ldo.c b/3rdparty/lua/src/ldo.c index a48e35f9dba9f..ea0529507e02e 100644 --- a/3rdparty/lua/src/ldo.c +++ b/3rdparty/lua/src/ldo.c @@ -104,11 +104,11 @@ void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { } default: { lua_assert(errorstatus(errcode)); /* real error */ - setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ + setobjs2s(L, oldtop, L->top.p - 1); /* error message on current top */ break; } } - L->top = oldtop + 1; + L->top.p = oldtop + 1; } @@ -121,7 +121,7 @@ l_noret luaD_throw (lua_State *L, int errcode) { global_State *g = G(L); errcode = luaE_resetthread(L, errcode); /* close all upvalues */ if (g->mainthread->errorJmp) { /* main thread has a handler? */ - setobjs2s(L, g->mainthread->top++, L->top - 1); /* copy error obj. */ + setobjs2s(L, g->mainthread->top.p++, L->top.p - 1); /* copy error obj. */ luaD_throw(g->mainthread, errcode); /* re-throw in main thread */ } else { /* no handler at all; abort */ @@ -157,16 +157,38 @@ int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { ** Stack reallocation ** =================================================================== */ -static void correctstack (lua_State *L, StkId oldstack, StkId newstack) { + + +/* +** Change all pointers to the stack into offsets. +*/ +static void relstack (lua_State *L) { + CallInfo *ci; + UpVal *up; + L->top.offset = savestack(L, L->top.p); + L->tbclist.offset = savestack(L, L->tbclist.p); + for (up = L->openupval; up != NULL; up = up->u.open.next) + up->v.offset = savestack(L, uplevel(up)); + for (ci = L->ci; ci != NULL; ci = ci->previous) { + ci->top.offset = savestack(L, ci->top.p); + ci->func.offset = savestack(L, ci->func.p); + } +} + + +/* +** Change back all offsets into pointers. +*/ +static void correctstack (lua_State *L) { CallInfo *ci; UpVal *up; - L->top = (L->top - oldstack) + newstack; - L->tbclist = (L->tbclist - oldstack) + newstack; + L->top.p = restorestack(L, L->top.offset); + L->tbclist.p = restorestack(L, L->tbclist.offset); for (up = L->openupval; up != NULL; up = up->u.open.next) - up->v = s2v((uplevel(up) - oldstack) + newstack); + up->v.p = s2v(restorestack(L, up->v.offset)); for (ci = L->ci; ci != NULL; ci = ci->previous) { - ci->top = (ci->top - oldstack) + newstack; - ci->func = (ci->func - oldstack) + newstack; + ci->top.p = restorestack(L, ci->top.offset); + ci->func.p = restorestack(L, ci->func.offset); if (isLua(ci)) ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */ } @@ -176,44 +198,45 @@ static void correctstack (lua_State *L, StkId oldstack, StkId newstack) { /* some space for error handling */ #define ERRORSTACKSIZE (LUAI_MAXSTACK + 200) - /* -** Reallocate the stack to a new size, correcting all pointers into -** it. (There are pointers to a stack from its upvalues, from its list -** of call infos, plus a few individual pointers.) The reallocation is -** done in two steps (allocation + free) because the correction must be -** done while both addresses (the old stack and the new one) are valid. -** (In ISO C, any pointer use after the pointer has been deallocated is -** undefined behavior.) +** Reallocate the stack to a new size, correcting all pointers into it. +** In ISO C, any pointer use after the pointer has been deallocated is +** undefined behavior. So, before the reallocation, all pointers are +** changed to offsets, and after the reallocation they are changed back +** to pointers. As during the reallocation the pointers are invalid, the +** reallocation cannot run emergency collections. +** ** In case of allocation error, raise an error or return false according ** to 'raiseerror'. */ int luaD_reallocstack (lua_State *L, int newsize, int raiseerror) { int oldsize = stacksize(L); int i; - StkId newstack = luaM_reallocvector(L, NULL, 0, - newsize + EXTRA_STACK, StackValue); + StkId newstack; + int oldgcstop = G(L)->gcstopem; lua_assert(newsize <= LUAI_MAXSTACK || newsize == ERRORSTACKSIZE); + relstack(L); /* change pointers to offsets */ + G(L)->gcstopem = 1; /* stop emergency collection */ + newstack = luaM_reallocvector(L, L->stack.p, oldsize + EXTRA_STACK, + newsize + EXTRA_STACK, StackValue); + G(L)->gcstopem = oldgcstop; /* restore emergency collection */ if (l_unlikely(newstack == NULL)) { /* reallocation failed? */ + correctstack(L); /* change offsets back to pointers */ if (raiseerror) luaM_error(L); else return 0; /* do not raise an error */ } - /* number of elements to be copied to the new stack */ - i = ((oldsize <= newsize) ? oldsize : newsize) + EXTRA_STACK; - memcpy(newstack, L->stack, i * sizeof(StackValue)); - for (; i < newsize + EXTRA_STACK; i++) + L->stack.p = newstack; + correctstack(L); /* change offsets back to pointers */ + L->stack_last.p = L->stack.p + newsize; + for (i = oldsize + EXTRA_STACK; i < newsize + EXTRA_STACK; i++) setnilvalue(s2v(newstack + i)); /* erase new segment */ - correctstack(L, L->stack, newstack); - luaM_freearray(L, L->stack, oldsize + EXTRA_STACK); - L->stack = newstack; - L->stack_last = L->stack + newsize; return 1; } /* -** Try to grow the stack by at least 'n' elements. when 'raiseerror' +** Try to grow the stack by at least 'n' elements. When 'raiseerror' ** is true, raises any error; otherwise, return 0 in case of errors. */ int luaD_growstack (lua_State *L, int n, int raiseerror) { @@ -227,35 +250,38 @@ int luaD_growstack (lua_State *L, int n, int raiseerror) { luaD_throw(L, LUA_ERRERR); /* error inside message handler */ return 0; /* if not 'raiseerror', just signal it */ } - else { + else if (n < LUAI_MAXSTACK) { /* avoids arithmetic overflows */ int newsize = 2 * size; /* tentative new size */ - int needed = cast_int(L->top - L->stack) + n; + int needed = cast_int(L->top.p - L->stack.p) + n; if (newsize > LUAI_MAXSTACK) /* cannot cross the limit */ newsize = LUAI_MAXSTACK; if (newsize < needed) /* but must respect what was asked for */ newsize = needed; if (l_likely(newsize <= LUAI_MAXSTACK)) return luaD_reallocstack(L, newsize, raiseerror); - else { /* stack overflow */ - /* add extra size to be able to handle the error message */ - luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror); - if (raiseerror) - luaG_runerror(L, "stack overflow"); - return 0; - } } + /* else stack overflow */ + /* add extra size to be able to handle the error message */ + luaD_reallocstack(L, ERRORSTACKSIZE, raiseerror); + if (raiseerror) + luaG_runerror(L, "stack overflow"); + return 0; } +/* +** Compute how much of the stack is being used, by computing the +** maximum top of all call frames in the stack and the current top. +*/ static int stackinuse (lua_State *L) { CallInfo *ci; int res; - StkId lim = L->top; + StkId lim = L->top.p; for (ci = L->ci; ci != NULL; ci = ci->previous) { - if (lim < ci->top) lim = ci->top; + if (lim < ci->top.p) lim = ci->top.p; } - lua_assert(lim <= L->stack_last); - res = cast_int(lim - L->stack) + 1; /* part of stack in use */ + lua_assert(lim <= L->stack_last.p + EXTRA_STACK); + res = cast_int(lim - L->stack.p) + 1; /* part of stack in use */ if (res < LUA_MINSTACK) res = LUA_MINSTACK; /* ensure a minimum size */ return res; @@ -273,17 +299,13 @@ static int stackinuse (lua_State *L) { */ void luaD_shrinkstack (lua_State *L) { int inuse = stackinuse(L); - int nsize = inuse * 2; /* proposed new size */ - int max = inuse * 3; /* maximum "reasonable" size */ - if (max > LUAI_MAXSTACK) { - max = LUAI_MAXSTACK; /* respect stack limit */ - if (nsize > LUAI_MAXSTACK) - nsize = LUAI_MAXSTACK; - } + int max = (inuse > LUAI_MAXSTACK / 3) ? LUAI_MAXSTACK : inuse * 3; /* if thread is currently not handling a stack overflow and its size is larger than maximum "reasonable" size, shrink it */ - if (inuse <= LUAI_MAXSTACK && stacksize(L) > max) + if (inuse <= LUAI_MAXSTACK && stacksize(L) > max) { + int nsize = (inuse > LUAI_MAXSTACK / 2) ? LUAI_MAXSTACK : inuse * 2; luaD_reallocstack(L, nsize, 0); /* ok if that fails */ + } else /* don't change stack */ condmovestack(L,{},{}); /* (change only for debugging) */ luaE_shrinkCI(L); /* shrink CI list */ @@ -292,7 +314,7 @@ void luaD_shrinkstack (lua_State *L) { void luaD_inctop (lua_State *L) { luaD_checkstack(L, 1); - L->top++; + L->top.p++; } /* }================================================================== */ @@ -309,8 +331,8 @@ void luaD_hook (lua_State *L, int event, int line, if (hook && L->allowhook) { /* make sure there is a hook */ int mask = CIST_HOOKED; CallInfo *ci = L->ci; - ptrdiff_t top = savestack(L, L->top); /* preserve original 'top' */ - ptrdiff_t ci_top = savestack(L, ci->top); /* idem for 'ci->top' */ + ptrdiff_t top = savestack(L, L->top.p); /* preserve original 'top' */ + ptrdiff_t ci_top = savestack(L, ci->top.p); /* idem for 'ci->top' */ lua_Debug ar; ar.event = event; ar.currentline = line; @@ -320,11 +342,11 @@ void luaD_hook (lua_State *L, int event, int line, ci->u2.transferinfo.ftransfer = ftransfer; ci->u2.transferinfo.ntransfer = ntransfer; } - if (isLua(ci) && L->top < ci->top) - L->top = ci->top; /* protect entire activation register */ + if (isLua(ci) && L->top.p < ci->top.p) + L->top.p = ci->top.p; /* protect entire activation register */ luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ - if (ci->top < L->top + LUA_MINSTACK) - ci->top = L->top + LUA_MINSTACK; + if (ci->top.p < L->top.p + LUA_MINSTACK) + ci->top.p = L->top.p + LUA_MINSTACK; L->allowhook = 0; /* cannot call hooks inside a hook */ ci->callstatus |= mask; lua_unlock(L); @@ -332,8 +354,8 @@ void luaD_hook (lua_State *L, int event, int line, lua_lock(L); lua_assert(!L->allowhook); L->allowhook = 1; - ci->top = restorestack(L, ci_top); - L->top = restorestack(L, top); + ci->top.p = restorestack(L, ci_top); + L->top.p = restorestack(L, top); ci->callstatus &= ~mask; } } @@ -364,7 +386,7 @@ void luaD_hookcall (lua_State *L, CallInfo *ci) { */ static void rethook (lua_State *L, CallInfo *ci, int nres) { if (L->hookmask & LUA_MASKRET) { /* is return hook on? */ - StkId firstres = L->top - nres; /* index of first result */ + StkId firstres = L->top.p - nres; /* index of first result */ int delta = 0; /* correction for vararg functions */ int ftransfer; if (isLua(ci)) { @@ -372,10 +394,10 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) { if (p->is_vararg) delta = ci->u.l.nextraargs + p->numparams + 1; } - ci->func += delta; /* if vararg, back to virtual 'func' */ - ftransfer = cast(unsigned short, firstres - ci->func); + ci->func.p += delta; /* if vararg, back to virtual 'func' */ + ftransfer = cast(unsigned short, firstres - ci->func.p); luaD_hook(L, LUA_HOOKRET, -1, ftransfer, nres); /* call it */ - ci->func -= delta; + ci->func.p -= delta; } if (isLua(ci = ci->previous)) L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* set 'oldpc' */ @@ -387,16 +409,16 @@ static void rethook (lua_State *L, CallInfo *ci, int nres) { ** stack, below original 'func', so that 'luaD_precall' can call it. Raise ** an error if there is no '__call' metafield. */ -StkId luaD_tryfuncTM (lua_State *L, StkId func) { +static StkId tryfuncTM (lua_State *L, StkId func) { const TValue *tm; StkId p; checkstackGCp(L, 1, func); /* space for metamethod */ tm = luaT_gettmbyobj(L, s2v(func), TM_CALL); /* (after previous GC) */ if (l_unlikely(ttisnil(tm))) luaG_callerror(L, s2v(func)); /* nothing to call */ - for (p = L->top; p > func; p--) /* open space for metamethod */ + for (p = L->top.p; p > func; p--) /* open space for metamethod */ setobjs2s(L, p, p-1); - L->top++; /* stack space pre-allocated by the caller */ + L->top.p++; /* stack space pre-allocated by the caller */ setobj2s(L, func, tm); /* metamethod is the new function to be called */ return func; } @@ -413,28 +435,29 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) { int i; switch (wanted) { /* handle typical cases separately */ case 0: /* no values needed */ - L->top = res; + L->top.p = res; return; case 1: /* one value needed */ if (nres == 0) /* no results? */ setnilvalue(s2v(res)); /* adjust with nil */ else /* at least one result */ - setobjs2s(L, res, L->top - nres); /* move it to proper place */ - L->top = res + 1; + setobjs2s(L, res, L->top.p - nres); /* move it to proper place */ + L->top.p = res + 1; return; case LUA_MULTRET: wanted = nres; /* we want all results */ break; default: /* two/more results and/or to-be-closed variables */ if (hastocloseCfunc(wanted)) { /* to-be-closed variables? */ - ptrdiff_t savedres = savestack(L, res); L->ci->callstatus |= CIST_CLSRET; /* in case of yields */ L->ci->u2.nres = nres; - luaF_close(L, res, CLOSEKTOP, 1); + res = luaF_close(L, res, CLOSEKTOP, 1); L->ci->callstatus &= ~CIST_CLSRET; - if (L->hookmask) /* if needed, call hook after '__close's */ + if (L->hookmask) { /* if needed, call hook after '__close's */ + ptrdiff_t savedres = savestack(L, res); rethook(L, L->ci, nres); - res = restorestack(L, savedres); /* close and hook can move stack */ + res = restorestack(L, savedres); /* hook can move stack */ + } wanted = decodeNresults(wanted); if (wanted == LUA_MULTRET) wanted = nres; /* we want all results */ @@ -442,14 +465,14 @@ l_sinline void moveresults (lua_State *L, StkId res, int nres, int wanted) { break; } /* generic case */ - firstresult = L->top - nres; /* index of first result */ + firstresult = L->top.p - nres; /* index of first result */ if (nres > wanted) /* extra results? */ nres = wanted; /* don't need them */ for (i = 0; i < nres; i++) /* move all results to correct place */ setobjs2s(L, res + i, firstresult + i); for (; i < wanted; i++) /* complete wanted number of results */ setnilvalue(s2v(res + i)); - L->top = res + wanted; /* top points after the last result */ + L->top.p = res + wanted; /* top points after the last result */ } @@ -464,7 +487,7 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { if (l_unlikely(L->hookmask && !hastocloseCfunc(wanted))) rethook(L, ci, nres); /* move results to proper place */ - moveresults(L, ci->func, nres, wanted); + moveresults(L, ci->func.p, nres, wanted); /* function cannot be in any of these cases when returning */ lua_assert(!(ci->callstatus & (CIST_HOOKED | CIST_YPCALL | CIST_FIN | CIST_TRAN | CIST_CLSRET))); @@ -479,10 +502,10 @@ void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { l_sinline CallInfo *prepCallInfo (lua_State *L, StkId func, int nret, int mask, StkId top) { CallInfo *ci = L->ci = next_ci(L); /* new frame */ - ci->func = func; + ci->func.p = func; ci->nresults = nret; ci->callstatus = mask; - ci->top = top; + ci->top.p = top; return ci; } @@ -496,10 +519,10 @@ l_sinline int precallC (lua_State *L, StkId func, int nresults, CallInfo *ci; checkstackGCp(L, LUA_MINSTACK, func); /* ensure minimum stack size */ L->ci = ci = prepCallInfo(L, func, nresults, CIST_C, - L->top + LUA_MINSTACK); - lua_assert(ci->top <= L->stack_last); + L->top.p + LUA_MINSTACK); + lua_assert(ci->top.p <= L->stack_last.p); if (l_unlikely(L->hookmask & LUA_MASKCALL)) { - int narg = cast_int(L->top - func) - 1; + int narg = cast_int(L->top.p - func) - 1; luaD_hook(L, LUA_HOOKCALL, -1, 1, narg); } lua_unlock(L); @@ -531,21 +554,21 @@ int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int nfixparams = p->numparams; int i; checkstackGCp(L, fsize - delta, func); - ci->func -= delta; /* restore 'func' (if vararg) */ + ci->func.p -= delta; /* restore 'func' (if vararg) */ for (i = 0; i < narg1; i++) /* move down function and arguments */ - setobjs2s(L, ci->func + i, func + i); - func = ci->func; /* moved-down function */ + setobjs2s(L, ci->func.p + i, func + i); + func = ci->func.p; /* moved-down function */ for (; narg1 <= nfixparams; narg1++) setnilvalue(s2v(func + narg1)); /* complete missing arguments */ - ci->top = func + 1 + fsize; /* top for new function */ - lua_assert(ci->top <= L->stack_last); + ci->top.p = func + 1 + fsize; /* top for new function */ + lua_assert(ci->top.p <= L->stack_last.p); ci->u.l.savedpc = p->code; /* starting point */ ci->callstatus |= CIST_TAIL; - L->top = func + narg1; /* set top */ + L->top.p = func + narg1; /* set top */ return -1; } default: { /* not a function */ - func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */ + func = tryfuncTM(L, func); /* try to get '__call' metamethod */ /* return luaD_pretailcall(L, ci, func, narg1 + 1, delta); */ narg1++; goto retry; /* try again */ @@ -574,19 +597,19 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { case LUA_VLCL: { /* Lua function */ CallInfo *ci; Proto *p = clLvalue(s2v(func))->p; - int narg = cast_int(L->top - func) - 1; /* number of real arguments */ + int narg = cast_int(L->top.p - func) - 1; /* number of real arguments */ int nfixparams = p->numparams; int fsize = p->maxstacksize; /* frame size */ checkstackGCp(L, fsize, func); L->ci = ci = prepCallInfo(L, func, nresults, 0, func + 1 + fsize); ci->u.l.savedpc = p->code; /* starting point */ for (; narg < nfixparams; narg++) - setnilvalue(s2v(L->top++)); /* complete missing arguments */ - lua_assert(ci->top <= L->stack_last); + setnilvalue(s2v(L->top.p++)); /* complete missing arguments */ + lua_assert(ci->top.p <= L->stack_last.p); return ci; } default: { /* not a function */ - func = luaD_tryfuncTM(L, func); /* try to get '__call' metamethod */ + func = tryfuncTM(L, func); /* try to get '__call' metamethod */ /* return luaD_precall(L, func, nresults); */ goto retry; /* try again with metamethod */ } @@ -598,12 +621,17 @@ CallInfo *luaD_precall (lua_State *L, StkId func, int nresults) { ** Call a function (C or Lua) through C. 'inc' can be 1 (increment ** number of recursive invocations in the C stack) or nyci (the same ** plus increment number of non-yieldable calls). +** This function can be called with some use of EXTRA_STACK, so it should +** check the stack before doing anything else. 'luaD_precall' already +** does that. */ -l_sinline void ccall (lua_State *L, StkId func, int nResults, int inc) { +l_sinline void ccall (lua_State *L, StkId func, int nResults, l_uint32 inc) { CallInfo *ci; L->nCcalls += inc; - if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) + if (l_unlikely(getCcalls(L) >= LUAI_MAXCCALLS)) { + checkstackp(L, 0, func); /* free any use of EXTRA_STACK */ luaE_checkcstack(L); + } if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */ ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */ luaV_execute(L, ci); /* call it */ @@ -651,8 +679,7 @@ static int finishpcallk (lua_State *L, CallInfo *ci) { else { /* error */ StkId func = restorestack(L, ci->u2.funcidx); L->allowhook = getoah(ci->callstatus); /* restore 'allowhook' */ - luaF_close(L, func, status, 1); /* can yield or raise an error */ - func = restorestack(L, ci->u2.funcidx); /* stack may be moved */ + func = luaF_close(L, func, status, 1); /* can yield or raise an error */ luaD_seterrorobj(L, status, func); luaD_shrinkstack(L); /* restore stack size in case of overflow */ setcistrecst(ci, LUA_OK); /* clear original status */ @@ -740,8 +767,8 @@ static CallInfo *findpcall (lua_State *L) { ** coroutine error handler and should not kill the coroutine.) */ static int resume_error (lua_State *L, const char *msg, int narg) { - L->top -= narg; /* remove args from the stack */ - setsvalue2s(L, L->top, luaS_new(L, msg)); /* push error message */ + L->top.p -= narg; /* remove args from the stack */ + setsvalue2s(L, L->top.p, luaS_new(L, msg)); /* push error message */ api_incr_top(L); lua_unlock(L); return LUA_ERRRUN; @@ -757,7 +784,7 @@ static int resume_error (lua_State *L, const char *msg, int narg) { */ static void resume (lua_State *L, void *ud) { int n = *(cast(int*, ud)); /* number of arguments */ - StkId firstArg = L->top - n; /* first argument */ + StkId firstArg = L->top.p - n; /* first argument */ CallInfo *ci = L->ci; if (L->status == LUA_OK) /* starting a coroutine? */ ccall(L, firstArg - 1, LUA_MULTRET, 0); /* just call its body */ @@ -765,7 +792,11 @@ static void resume (lua_State *L, void *ud) { lua_assert(L->status == LUA_YIELD); L->status = LUA_OK; /* mark that it is running (again) */ if (isLua(ci)) { /* yielded inside a hook? */ - L->top = firstArg; /* discard arguments */ + /* undo increment made by 'luaG_traceexec': instruction was not + executed yet */ + lua_assert(ci->callstatus & CIST_HOOKYIELD); + ci->u.l.savedpc--; + L->top.p = firstArg; /* discard arguments */ luaV_execute(L, ci); /* just continue running Lua code */ } else { /* 'common' yield */ @@ -808,7 +839,7 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, if (L->status == LUA_OK) { /* may be starting a coroutine */ if (L->ci != &L->base_ci) /* not in base level? */ return resume_error(L, "cannot resume non-suspended coroutine", nargs); - else if (L->top - (L->ci->func + 1) == nargs) /* no function? */ + else if (L->top.p - (L->ci->func.p + 1) == nargs) /* no function? */ return resume_error(L, "cannot resume dead coroutine", nargs); } else if (L->status != LUA_YIELD) /* ended with errors? */ @@ -826,11 +857,11 @@ LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs, lua_assert(status == L->status); /* normal end or yield */ else { /* unrecoverable error */ L->status = cast_byte(status); /* mark thread as 'dead' */ - luaD_seterrorobj(L, status, L->top); /* push error message */ - L->ci->top = L->top; + luaD_seterrorobj(L, status, L->top.p); /* push error message */ + L->ci->top.p = L->top.p; } *nresults = (status == LUA_YIELD) ? L->ci->u2.nyield - : cast_int(L->top - (L->ci->func + 1)); + : cast_int(L->top.p - (L->ci->func.p + 1)); lua_unlock(L); return status; } @@ -985,7 +1016,7 @@ int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, p.dyd.gt.arr = NULL; p.dyd.gt.size = 0; p.dyd.label.arr = NULL; p.dyd.label.size = 0; luaZ_initbuffer(L, &p.buff); - status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); + status = luaD_pcall(L, f_parser, &p, savestack(L, L->top.p), L->errfunc); luaZ_freebuffer(L, &p.buff); luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size); luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size); diff --git a/3rdparty/lua/src/ldo.h b/3rdparty/lua/src/ldo.h index 911e67f660a16..56008ab30f0af 100644 --- a/3rdparty/lua/src/ldo.h +++ b/3rdparty/lua/src/ldo.h @@ -8,6 +8,7 @@ #define ldo_h +#include "llimits.h" #include "lobject.h" #include "lstate.h" #include "lzio.h" @@ -23,7 +24,7 @@ ** at every check. */ #define luaD_checkstackaux(L,n,pre,pos) \ - if (l_unlikely(L->stack_last - L->top <= (n))) \ + if (l_unlikely(L->stack_last.p - L->top.p <= (n))) \ { pre; luaD_growstack(L, n, 1); pos; } \ else { condmovestack(L,pre,pos); } @@ -32,11 +33,18 @@ -#define savestack(L,p) ((char *)(p) - (char *)L->stack) -#define restorestack(L,n) ((StkId)((char *)L->stack + (n))) +#define savestack(L,pt) (cast_charp(pt) - cast_charp(L->stack.p)) +#define restorestack(L,n) cast(StkId, cast_charp(L->stack.p) + (n)) /* macro to check stack size, preserving 'p' */ +#define checkstackp(L,n,p) \ + luaD_checkstackaux(L, n, \ + ptrdiff_t t__ = savestack(L, p), /* save 'p' */ \ + p = restorestack(L, t__)) /* 'pos' part: restore 'p' */ + + +/* macro to check stack size and GC, preserving 'p' */ #define checkstackGCp(L,n,p) \ luaD_checkstackaux(L, n, \ ptrdiff_t t__ = savestack(L, p); /* save 'p' */ \ @@ -58,11 +66,11 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, int fTransfer, int nTransfer); LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); -LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int narg1, int delta); +LUAI_FUNC int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, + int narg1, int delta); LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); -LUAI_FUNC StkId luaD_tryfuncTM (lua_State *L, StkId func); LUAI_FUNC int luaD_closeprotected (lua_State *L, ptrdiff_t level, int status); LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, ptrdiff_t oldtop, ptrdiff_t ef); diff --git a/3rdparty/lua/src/ldump.c b/3rdparty/lua/src/ldump.c index f848b669cbdd3..f231691b77955 100644 --- a/3rdparty/lua/src/ldump.c +++ b/3rdparty/lua/src/ldump.c @@ -10,6 +10,7 @@ #include "lprefix.h" +#include #include #include "lua.h" @@ -55,8 +56,11 @@ static void dumpByte (DumpState *D, int y) { } -/* dumpInt Buff Size */ -#define DIBS ((sizeof(size_t) * 8 / 7) + 1) +/* +** 'dumpSize' buffer size: each byte can store up to 7 bits. (The "+6" +** rounds up the division.) +*/ +#define DIBS ((sizeof(size_t) * CHAR_BIT + 6) / 7) static void dumpSize (DumpState *D, size_t x) { lu_byte buff[DIBS]; diff --git a/3rdparty/lua/src/lfunc.c b/3rdparty/lua/src/lfunc.c index f5889a21d12ea..0945f241de2d5 100644 --- a/3rdparty/lua/src/lfunc.c +++ b/3rdparty/lua/src/lfunc.c @@ -50,8 +50,8 @@ void luaF_initupvals (lua_State *L, LClosure *cl) { for (i = 0; i < cl->nupvalues; i++) { GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); UpVal *uv = gco2upv(o); - uv->v = &uv->u.value; /* make it closed */ - setnilvalue(uv->v); + uv->v.p = &uv->u.value; /* make it closed */ + setnilvalue(uv->v.p); cl->upvals[i] = uv; luaC_objbarrier(L, cl, uv); } @@ -62,12 +62,11 @@ void luaF_initupvals (lua_State *L, LClosure *cl) { ** Create a new upvalue at the given level, and link it to the list of ** open upvalues of 'L' after entry 'prev'. **/ -static UpVal *newupval (lua_State *L, int tbc, StkId level, UpVal **prev) { +static UpVal *newupval (lua_State *L, StkId level, UpVal **prev) { GCObject *o = luaC_newobj(L, LUA_VUPVAL, sizeof(UpVal)); UpVal *uv = gco2upv(o); UpVal *next = *prev; - uv->v = s2v(level); /* current value lives in the stack */ - uv->tbc = tbc; + uv->v.p = s2v(level); /* current value lives in the stack */ uv->u.open.next = next; /* link it to list of open upvalues */ uv->u.open.previous = prev; if (next) @@ -96,7 +95,7 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { pp = &p->u.open.next; } /* not found: create a new upvalue after 'pp' */ - return newupval(L, 0, level, pp); + return newupval(L, level, pp); } @@ -106,12 +105,12 @@ UpVal *luaF_findupval (lua_State *L, StkId level) { ** (This function assumes EXTRA_STACK.) */ static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) { - StkId top = L->top; + StkId top = L->top.p; const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE); setobj2s(L, top, tm); /* will call metamethod... */ setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */ setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */ - L->top = top + 3; /* add function and arguments */ + L->top.p = top + 3; /* add function and arguments */ if (yy) luaD_call(L, top, 0); else @@ -126,7 +125,7 @@ static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) { static void checkclosemth (lua_State *L, StkId level) { const TValue *tm = luaT_gettmbyobj(L, s2v(level), TM_CLOSE); if (ttisnil(tm)) { /* no metamethod? */ - int idx = cast_int(level - L->ci->func); /* variable index */ + int idx = cast_int(level - L->ci->func.p); /* variable index */ const char *vname = luaG_findlocal(L, L->ci, idx, NULL); if (vname == NULL) vname = "?"; luaG_runerror(L, "variable '%s' got a non-closable value", vname); @@ -160,23 +159,23 @@ static void prepcallclosemth (lua_State *L, StkId level, int status, int yy) { ** is used.) */ #define MAXDELTA \ - ((256ul << ((sizeof(L->stack->tbclist.delta) - 1) * 8)) - 1) + ((256ul << ((sizeof(L->stack.p->tbclist.delta) - 1) * 8)) - 1) /* ** Insert a variable in the list of to-be-closed variables. */ void luaF_newtbcupval (lua_State *L, StkId level) { - lua_assert(level > L->tbclist); + lua_assert(level > L->tbclist.p); if (l_isfalse(s2v(level))) return; /* false doesn't need to be closed */ checkclosemth(L, level); /* value must have a close method */ - while (cast_uint(level - L->tbclist) > MAXDELTA) { - L->tbclist += MAXDELTA; /* create a dummy node at maximum delta */ - L->tbclist->tbclist.delta = 0; + while (cast_uint(level - L->tbclist.p) > MAXDELTA) { + L->tbclist.p += MAXDELTA; /* create a dummy node at maximum delta */ + L->tbclist.p->tbclist.delta = 0; } - level->tbclist.delta = cast(unsigned short, level - L->tbclist); - L->tbclist = level; + level->tbclist.delta = cast(unsigned short, level - L->tbclist.p); + L->tbclist.p = level; } @@ -196,10 +195,10 @@ void luaF_closeupval (lua_State *L, StkId level) { StkId upl; /* stack index pointed by 'uv' */ while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) { TValue *slot = &uv->u.value; /* new position for value */ - lua_assert(uplevel(uv) < L->top); + lua_assert(uplevel(uv) < L->top.p); luaF_unlinkupval(uv); /* remove upvalue from 'openupval' list */ - setobj(L, slot, uv->v); /* move value to upvalue slot */ - uv->v = slot; /* now current value lives here */ + setobj(L, slot, uv->v.p); /* move value to upvalue slot */ + uv->v.p = slot; /* now current value lives here */ if (!iswhite(uv)) { /* neither white nor dead? */ nw2black(uv); /* closed upvalues cannot be gray */ luaC_barrier(L, uv, slot); @@ -209,31 +208,32 @@ void luaF_closeupval (lua_State *L, StkId level) { /* -** Remove firt element from the tbclist plus its dummy nodes. +** Remove first element from the tbclist plus its dummy nodes. */ static void poptbclist (lua_State *L) { - StkId tbc = L->tbclist; + StkId tbc = L->tbclist.p; lua_assert(tbc->tbclist.delta > 0); /* first element cannot be dummy */ tbc -= tbc->tbclist.delta; - while (tbc > L->stack && tbc->tbclist.delta == 0) + while (tbc > L->stack.p && tbc->tbclist.delta == 0) tbc -= MAXDELTA; /* remove dummy nodes */ - L->tbclist = tbc; + L->tbclist.p = tbc; } /* ** Close all upvalues and to-be-closed variables up to the given stack -** level. +** level. Return restored 'level'. */ -void luaF_close (lua_State *L, StkId level, int status, int yy) { +StkId luaF_close (lua_State *L, StkId level, int status, int yy) { ptrdiff_t levelrel = savestack(L, level); luaF_closeupval(L, level); /* first, close the upvalues */ - while (L->tbclist >= level) { /* traverse tbc's down to that level */ - StkId tbc = L->tbclist; /* get variable index */ + while (L->tbclist.p >= level) { /* traverse tbc's down to that level */ + StkId tbc = L->tbclist.p; /* get variable index */ poptbclist(L); /* remove it from list */ prepcallclosemth(L, tbc, status, yy); /* close variable */ level = restorestack(L, levelrel); } + return level; } diff --git a/3rdparty/lua/src/lfunc.h b/3rdparty/lua/src/lfunc.h index dc1cebccd1bcb..3be265efb5848 100644 --- a/3rdparty/lua/src/lfunc.h +++ b/3rdparty/lua/src/lfunc.h @@ -29,10 +29,10 @@ #define MAXUPVAL 255 -#define upisopen(up) ((up)->v != &(up)->u.value) +#define upisopen(up) ((up)->v.p != &(up)->u.value) -#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v)) +#define uplevel(up) check_exp(upisopen(up), cast(StkId, (up)->v.p)) /* @@ -54,7 +54,7 @@ LUAI_FUNC void luaF_initupvals (lua_State *L, LClosure *cl); LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); LUAI_FUNC void luaF_newtbcupval (lua_State *L, StkId level); LUAI_FUNC void luaF_closeupval (lua_State *L, StkId level); -LUAI_FUNC void luaF_close (lua_State *L, StkId level, int status, int yy); +LUAI_FUNC StkId luaF_close (lua_State *L, StkId level, int status, int yy); LUAI_FUNC void luaF_unlinkupval (UpVal *uv); LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, diff --git a/3rdparty/lua/src/lgc.c b/3rdparty/lua/src/lgc.c index 42a73d813acca..5817f9eec35a4 100644 --- a/3rdparty/lua/src/lgc.c +++ b/3rdparty/lua/src/lgc.c @@ -252,12 +252,13 @@ void luaC_fix (lua_State *L, GCObject *o) { /* -** create a new collectable object (with given type and size) and link -** it to 'allgc' list. +** create a new collectable object (with given type, size, and offset) +** and link it to 'allgc' list. */ -GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { +GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, size_t offset) { global_State *g = G(L); - GCObject *o = cast(GCObject *, luaM_newobject(L, novariant(tt), sz)); + char *p = cast_charp(luaM_newobject(L, novariant(tt), sz)); + GCObject *o = cast(GCObject *, p + offset); o->marked = luaC_white(g); o->tt = tt; o->next = g->allgc; @@ -265,6 +266,11 @@ GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { return o; } + +GCObject *luaC_newobj (lua_State *L, int tt, size_t sz) { + return luaC_newobjdt(L, tt, sz, 0); +} + /* }====================================================== */ @@ -301,7 +307,7 @@ static void reallymarkobject (global_State *g, GCObject *o) { set2gray(uv); /* open upvalues are kept gray */ else set2black(uv); /* closed upvalues are visited here */ - markvalue(g, uv->v); /* mark its content */ + markvalue(g, uv->v.p); /* mark its content */ break; } case LUA_VUSERDATA: { @@ -376,7 +382,7 @@ static int remarkupvals (global_State *g) { work++; if (!iswhite(uv)) { /* upvalue already visited? */ lua_assert(upisopen(uv) && isgray(uv)); - markvalue(g, uv->v); /* mark its value */ + markvalue(g, uv->v.p); /* mark its value */ } } } @@ -536,10 +542,12 @@ static void traversestrongtable (global_State *g, Table *h) { static lu_mem traversetable (global_State *g, Table *h) { const char *weakkey, *weakvalue; const TValue *mode = gfasttm(g, h->metatable, TM_MODE); + TString *smode; markobjectN(g, h->metatable); - if (mode && ttisstring(mode) && /* is there a weak mode? */ - (cast_void(weakkey = strchr(svalue(mode), 'k')), - cast_void(weakvalue = strchr(svalue(mode), 'v')), + if (mode && ttisshrstring(mode) && /* is there a weak mode? */ + (cast_void(smode = tsvalue(mode)), + cast_void(weakkey = strchr(getshrstr(smode), 'k')), + cast_void(weakvalue = strchr(getshrstr(smode), 'v')), (weakkey || weakvalue))) { /* is really weak? */ if (!weakkey) /* strong keys? */ traverseweakvalue(g, h); @@ -620,19 +628,21 @@ static int traverseLclosure (global_State *g, LClosure *cl) { */ static int traversethread (global_State *g, lua_State *th) { UpVal *uv; - StkId o = th->stack; + StkId o = th->stack.p; if (isold(th) || g->gcstate == GCSpropagate) linkgclist(th, g->grayagain); /* insert into 'grayagain' list */ if (o == NULL) return 1; /* stack not completely built yet */ lua_assert(g->gcstate == GCSatomic || th->openupval == NULL || isintwups(th)); - for (; o < th->top; o++) /* mark live elements in the stack */ + for (; o < th->top.p; o++) /* mark live elements in the stack */ markvalue(g, s2v(o)); for (uv = th->openupval; uv != NULL; uv = uv->u.open.next) markobject(g, uv); /* open upvalues cannot be collected */ if (g->gcstate == GCSatomic) { /* final traversal? */ - for (; o < th->stack_last + EXTRA_STACK; o++) + if (!g->gcemergency) + luaD_shrinkstack(th); /* do not change stack in emergency cycle */ + for (o = th->top.p; o < th->stack_last.p + EXTRA_STACK; o++) setnilvalue(s2v(o)); /* clear dead stack slice */ /* 'remarkupvals' may have removed thread from 'twups' list */ if (!isintwups(th) && th->openupval != NULL) { @@ -640,8 +650,6 @@ static int traversethread (global_State *g, lua_State *th) { g->twups = th; } } - else if (!g->gcemergency) - luaD_shrinkstack(th); /* do not change stack in emergency cycle */ return 1 + stacksize(th); } @@ -892,7 +900,7 @@ static GCObject *udata2finalize (global_State *g) { static void dothecall (lua_State *L, void *ud) { UNUSED(ud); - luaD_callnoyield(L, L->top - 2, 0); + luaD_callnoyield(L, L->top.p - 2, 0); } @@ -909,16 +917,16 @@ static void GCTM (lua_State *L) { int oldgcstp = g->gcstp; g->gcstp |= GCSTPGC; /* avoid GC steps */ L->allowhook = 0; /* stop debug hooks during GC metamethod */ - setobj2s(L, L->top++, tm); /* push finalizer... */ - setobj2s(L, L->top++, &v); /* ... and its argument */ + setobj2s(L, L->top.p++, tm); /* push finalizer... */ + setobj2s(L, L->top.p++, &v); /* ... and its argument */ L->ci->callstatus |= CIST_FIN; /* will run a finalizer */ - status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0); + status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top.p - 2), 0); L->ci->callstatus &= ~CIST_FIN; /* not running a finalizer anymore */ L->allowhook = oldah; /* restore hooks */ g->gcstp = oldgcstp; /* restore state */ if (l_unlikely(status != LUA_OK)) { /* error while running __gc? */ luaE_warnerror(L, "__gc"); - L->top--; /* pops error object */ + L->top.p--; /* pops error object */ } } } @@ -1041,7 +1049,25 @@ void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { ** ======================================================= */ -static void setpause (global_State *g); + +/* +** Set the "time" to wait before starting a new GC cycle; cycle will +** start when memory use hits the threshold of ('estimate' * pause / +** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero, +** because Lua cannot even start with less than PAUSEADJ bytes). +*/ +static void setpause (global_State *g) { + l_mem threshold, debt; + int pause = getgcparam(g->gcpause); + l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ + lua_assert(estimate > 0); + threshold = (pause < MAX_LMEM / estimate) /* overflow? */ + ? estimate * pause /* no overflow */ + : MAX_LMEM; /* overflow; truncate to maximum */ + debt = gettotalbytes(g) - threshold; + if (debt > 0) debt = 0; + luaE_setdebt(g, debt); +} /* @@ -1285,6 +1311,15 @@ static void atomic2gen (lua_State *L, global_State *g) { } +/* +** Set debt for the next minor collection, which will happen when +** memory grows 'genminormul'%. +*/ +static void setminordebt (global_State *g) { + luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul)); +} + + /* ** Enter generational mode. Must go until the end of an atomic cycle ** to ensure that all objects are correctly marked and weak tables @@ -1297,6 +1332,7 @@ static lu_mem entergen (lua_State *L, global_State *g) { luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */ numobjs = atomic(L); /* propagates all and then do the atomic stuff */ atomic2gen(L, g); + setminordebt(g); /* set debt assuming next cycle will be minor */ return numobjs; } @@ -1342,15 +1378,6 @@ static lu_mem fullgen (lua_State *L, global_State *g) { } -/* -** Set debt for the next minor collection, which will happen when -** memory grows 'genminormul'%. -*/ -static void setminordebt (global_State *g) { - luaE_setdebt(g, -(cast(l_mem, (gettotalbytes(g) / 100)) * g->genminormul)); -} - - /* ** Does a major collection after last collection was a "bad collection". ** @@ -1384,7 +1411,7 @@ static void stepgenfull (lua_State *L, global_State *g) { setminordebt(g); } else { /* another bad collection; stay in incremental mode */ - g->GCestimate = gettotalbytes(g); /* first estimate */; + g->GCestimate = gettotalbytes(g); /* first estimate */ entersweep(L); luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */ setpause(g); @@ -1422,8 +1449,8 @@ static void genstep (lua_State *L, global_State *g) { lu_mem numobjs = fullgen(L, g); /* do a major collection */ if (gettotalbytes(g) < majorbase + (majorinc / 2)) { /* collected at least half of memory growth since last major - collection; keep doing minor collections */ - setminordebt(g); + collection; keep doing minor collections. */ + lua_assert(g->lastatomic == 0); } else { /* bad collection */ g->lastatomic = numobjs; /* signal that last collection was bad */ @@ -1449,26 +1476,6 @@ static void genstep (lua_State *L, global_State *g) { */ -/* -** Set the "time" to wait before starting a new GC cycle; cycle will -** start when memory use hits the threshold of ('estimate' * pause / -** PAUSEADJ). (Division by 'estimate' should be OK: it cannot be zero, -** because Lua cannot even start with less than PAUSEADJ bytes). -*/ -static void setpause (global_State *g) { - l_mem threshold, debt; - int pause = getgcparam(g->gcpause); - l_mem estimate = g->GCestimate / PAUSEADJ; /* adjust 'estimate' */ - lua_assert(estimate > 0); - threshold = (pause < MAX_LMEM / estimate) /* overflow? */ - ? estimate * pause /* no overflow */ - : MAX_LMEM; /* overflow; truncate to maximum */ - debt = gettotalbytes(g) - threshold; - if (debt > 0) debt = 0; - luaE_setdebt(g, debt); -} - - /* ** Enter first sweep phase. ** The call to 'sweeptolive' makes the pointer point to an object @@ -1599,7 +1606,7 @@ static lu_mem singlestep (lua_State *L) { case GCSenteratomic: { work = atomic(L); /* work is what was traversed by 'atomic' */ entersweep(L); - g->GCestimate = gettotalbytes(g); /* first estimate */; + g->GCestimate = gettotalbytes(g); /* first estimate */ break; } case GCSswpallgc: { /* sweep "regular" objects */ @@ -1676,12 +1683,15 @@ static void incstep (lua_State *L, global_State *g) { } /* -** performs a basic GC step if collector is running +** Performs a basic GC step if collector is running. (If collector is +** not running, set a reasonable debt to avoid it being called at +** every single check.) */ void luaC_step (lua_State *L) { global_State *g = G(L); - lua_assert(!g->gcemergency); - if (gcrunning(g)) { /* running? */ + if (!gcrunning(g)) /* not running? */ + luaE_setdebt(g, -2000); + else { if(isdecGCmodegen(g)) genstep(L, g); else @@ -1702,6 +1712,8 @@ static void fullinc (lua_State *L, global_State *g) { entersweep(L); /* sweep everything to turn them back to white */ /* finish any pending sweep phase to start a new cycle */ luaC_runtilstate(L, bitmask(GCSpause)); + luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */ + g->gcstate = GCSenteratomic; /* go straight to atomic phase */ luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */ /* estimate must be correct after a full GC cycle */ lua_assert(g->GCestimate == gettotalbytes(g)); diff --git a/3rdparty/lua/src/lgc.h b/3rdparty/lua/src/lgc.h index 4a125634b9eac..538f6edcccf2a 100644 --- a/3rdparty/lua/src/lgc.h +++ b/3rdparty/lua/src/lgc.h @@ -172,24 +172,27 @@ #define luaC_checkGC(L) luaC_condGC(L,(void)0,(void)0) -#define luaC_barrier(L,p,v) ( \ - (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ - luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0)) - -#define luaC_barrierback(L,p,v) ( \ - (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ - luaC_barrierback_(L,p) : cast_void(0)) - #define luaC_objbarrier(L,p,o) ( \ (isblack(p) && iswhite(o)) ? \ luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) +#define luaC_barrier(L,p,v) ( \ + iscollectable(v) ? luaC_objbarrier(L,p,gcvalue(v)) : cast_void(0)) + +#define luaC_objbarrierback(L,p,o) ( \ + (isblack(p) && iswhite(o)) ? luaC_barrierback_(L,p) : cast_void(0)) + +#define luaC_barrierback(L,p,v) ( \ + iscollectable(v) ? luaC_objbarrierback(L, p, gcvalue(v)) : cast_void(0)) + LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); LUAI_FUNC void luaC_freeallobjects (lua_State *L); LUAI_FUNC void luaC_step (lua_State *L); LUAI_FUNC void luaC_runtilstate (lua_State *L, int statesmask); LUAI_FUNC void luaC_fullgc (lua_State *L, int isemergency); LUAI_FUNC GCObject *luaC_newobj (lua_State *L, int tt, size_t sz); +LUAI_FUNC GCObject *luaC_newobjdt (lua_State *L, int tt, size_t sz, + size_t offset); LUAI_FUNC void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v); LUAI_FUNC void luaC_barrierback_ (lua_State *L, GCObject *o); LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); diff --git a/3rdparty/lua/src/liolib.c b/3rdparty/lua/src/liolib.c index b08397da45da6..c5075f3e78a98 100644 --- a/3rdparty/lua/src/liolib.c +++ b/3rdparty/lua/src/liolib.c @@ -245,8 +245,8 @@ static int f_gc (lua_State *L) { */ static int io_fclose (lua_State *L) { LStream *p = tolstream(L); - int res = fclose(p->f); - return luaL_fileresult(L, (res == 0), NULL); + errno = 0; + return luaL_fileresult(L, (fclose(p->f) == 0), NULL); } @@ -272,6 +272,7 @@ static int io_open (lua_State *L) { LStream *p = newfile(L); const char *md = mode; /* to traverse/check mode */ luaL_argcheck(L, l_checkmode(md), 2, "invalid mode"); + errno = 0; p->f = fopen(filename, mode); return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; } @@ -292,6 +293,7 @@ static int io_popen (lua_State *L) { const char *mode = luaL_optstring(L, 2, "r"); LStream *p = newprefile(L); luaL_argcheck(L, l_checkmodep(mode), 2, "invalid mode"); + errno = 0; p->f = l_popen(L, filename, mode); p->closef = &io_pclose; return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; @@ -300,6 +302,7 @@ static int io_popen (lua_State *L) { static int io_tmpfile (lua_State *L) { LStream *p = newfile(L); + errno = 0; p->f = tmpfile(); return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1; } @@ -567,6 +570,7 @@ static int g_read (lua_State *L, FILE *f, int first) { int nargs = lua_gettop(L) - 1; int n, success; clearerr(f); + errno = 0; if (nargs == 0) { /* no arguments? */ success = read_line(L, f, 1); n = first + 1; /* to return 1 result */ @@ -660,6 +664,7 @@ static int io_readline (lua_State *L) { static int g_write (lua_State *L, FILE *f, int arg) { int nargs = lua_gettop(L) - arg; int status = 1; + errno = 0; for (; nargs--; arg++) { if (lua_type(L, arg) == LUA_TNUMBER) { /* optimization: could be done exactly as for strings */ @@ -678,7 +683,8 @@ static int g_write (lua_State *L, FILE *f, int arg) { } if (l_likely(status)) return 1; /* file handle already on stack top */ - else return luaL_fileresult(L, status, NULL); + else + return luaL_fileresult(L, status, NULL); } @@ -703,6 +709,7 @@ static int f_seek (lua_State *L) { l_seeknum offset = (l_seeknum)p3; luaL_argcheck(L, (lua_Integer)offset == p3, 3, "not an integer in proper range"); + errno = 0; op = l_fseek(f, offset, mode[op]); if (l_unlikely(op)) return luaL_fileresult(L, 0, NULL); /* error */ @@ -719,19 +726,25 @@ static int f_setvbuf (lua_State *L) { FILE *f = tofile(L); int op = luaL_checkoption(L, 2, NULL, modenames); lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); - int res = setvbuf(f, NULL, mode[op], (size_t)sz); + int res; + errno = 0; + res = setvbuf(f, NULL, mode[op], (size_t)sz); return luaL_fileresult(L, res == 0, NULL); } static int io_flush (lua_State *L) { - return luaL_fileresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); + FILE *f = getiofile(L, IO_OUTPUT); + errno = 0; + return luaL_fileresult(L, fflush(f) == 0, NULL); } static int f_flush (lua_State *L) { - return luaL_fileresult(L, fflush(tofile(L)) == 0, NULL); + FILE *f = tofile(L); + errno = 0; + return luaL_fileresult(L, fflush(f) == 0, NULL); } @@ -773,7 +786,7 @@ static const luaL_Reg meth[] = { ** metamethods for file handles */ static const luaL_Reg metameth[] = { - {"__index", NULL}, /* place holder */ + {"__index", NULL}, /* placeholder */ {"__gc", f_gc}, {"__close", f_gc}, {"__tostring", f_tostring}, diff --git a/3rdparty/lua/src/llex.c b/3rdparty/lua/src/llex.c index e99151787a63c..5fc39a5cdec17 100644 --- a/3rdparty/lua/src/llex.c +++ b/3rdparty/lua/src/llex.c @@ -128,7 +128,7 @@ l_noret luaX_syntaxerror (LexState *ls, const char *msg) { ** ensuring there is only one copy of each unique string. The table ** here is used as a set: the string enters as the key, while its value ** is irrelevant. We use the string itself as the value only because it -** is a TValue readly available. Later, the code generation can change +** is a TValue readily available. Later, the code generation can change ** this value. */ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { @@ -138,12 +138,12 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) { if (!ttisnil(o)) /* string already present? */ ts = keystrval(nodefromval(o)); /* get saved copy */ else { /* not in use yet */ - TValue *stv = s2v(L->top++); /* reserve stack space for string */ + TValue *stv = s2v(L->top.p++); /* reserve stack space for string */ setsvalue(L, stv, ts); /* temporarily anchor the string */ luaH_finishset(L, ls->h, stv, o, stv); /* t[string] = string */ /* table is not a metatable, so it does not need to invalidate cache */ luaC_checkGC(L); - L->top--; /* remove string from stack */ + L->top.p--; /* remove string from stack */ } return ts; } diff --git a/3rdparty/lua/src/llimits.h b/3rdparty/lua/src/llimits.h index 52a32f92e302e..1c826f7be205b 100644 --- a/3rdparty/lua/src/llimits.h +++ b/3rdparty/lua/src/llimits.h @@ -71,11 +71,24 @@ typedef signed char ls_byte; /* -** conversion of pointer to unsigned integer: -** this is for hashing only; there is no problem if the integer -** cannot hold the whole pointer value +** conversion of pointer to unsigned integer: this is for hashing only; +** there is no problem if the integer cannot hold the whole pointer +** value. (In strict ISO C this may cause undefined behavior, but no +** actual machine seems to bother.) */ -#define point2uint(p) ((unsigned int)((size_t)(p) & UINT_MAX)) +#if !defined(LUA_USE_C89) && defined(__STDC_VERSION__) && \ + __STDC_VERSION__ >= 199901L +#include +#if defined(UINTPTR_MAX) /* even in C99 this type is optional */ +#define L_P2I uintptr_t +#else /* no 'intptr'? */ +#define L_P2I uintmax_t /* use the largest available integer */ +#endif +#else /* C89 option */ +#define L_P2I size_t +#endif + +#define point2uint(p) ((unsigned int)((L_P2I)(p) & UINT_MAX)) diff --git a/3rdparty/lua/src/lmathlib.c b/3rdparty/lua/src/lmathlib.c index e0c61a168d986..4381063480840 100644 --- a/3rdparty/lua/src/lmathlib.c +++ b/3rdparty/lua/src/lmathlib.c @@ -249,6 +249,15 @@ static int math_type (lua_State *L) { ** =================================================================== */ +/* +** This code uses lots of shifts. ANSI C does not allow shifts greater +** than or equal to the width of the type being shifted, so some shifts +** are written in convoluted ways to match that restriction. For +** preprocessor tests, it assumes a width of 32 bits, so the maximum +** shift there is 31 bits. +*/ + + /* number of binary digits in the mantissa of a float */ #define FIGS l_floatatt(MANT_DIG) @@ -267,20 +276,23 @@ static int math_type (lua_State *L) { /* try to find an integer type with at least 64 bits */ -#if (ULONG_MAX >> 31 >> 31) >= 3 +#if ((ULONG_MAX >> 31) >> 31) >= 3 /* 'long' has at least 64 bits */ #define Rand64 unsigned long +#define SRand64 long #elif !defined(LUA_USE_C89) && defined(LLONG_MAX) /* there is a 'long long' type (which must have at least 64 bits) */ #define Rand64 unsigned long long +#define SRand64 long long -#elif (LUA_MAXUNSIGNED >> 31 >> 31) >= 3 +#elif ((LUA_MAXUNSIGNED >> 31) >> 31) >= 3 -/* 'lua_Integer' has at least 64 bits */ +/* 'lua_Unsigned' has at least 64 bits */ #define Rand64 lua_Unsigned +#define SRand64 lua_Integer #endif @@ -319,23 +331,30 @@ static Rand64 nextrand (Rand64 *state) { } -/* must take care to not shift stuff by more than 63 slots */ - - /* ** Convert bits from a random integer into a float in the ** interval [0,1), getting the higher FIG bits from the ** random unsigned integer and converting that to a float. +** Some old Microsoft compilers cannot cast an unsigned long +** to a floating-point number, so we use a signed long as an +** intermediary. When lua_Number is float or double, the shift ensures +** that 'sx' is non negative; in that case, a good compiler will remove +** the correction. */ /* must throw out the extra (64 - FIGS) bits */ #define shift64_FIG (64 - FIGS) -/* to scale to [0, 1), multiply by scaleFIG = 2^(-FIGS) */ +/* 2^(-FIGS) == 2^-1 / 2^(FIGS-1) */ #define scaleFIG (l_mathop(0.5) / ((Rand64)1 << (FIGS - 1))) static lua_Number I2d (Rand64 x) { - return (lua_Number)(trim64(x) >> shift64_FIG) * scaleFIG; + SRand64 sx = (SRand64)(trim64(x) >> shift64_FIG); + lua_Number res = (lua_Number)(sx) * scaleFIG; + if (sx < 0) + res += l_mathop(1.0); /* correct the two's complement if negative */ + lua_assert(0 <= res && res < 1); + return res; } /* convert a 'Rand64' to a 'lua_Unsigned' */ @@ -471,8 +490,6 @@ static lua_Number I2d (Rand64 x) { #else /* 32 < FIGS <= 64 */ -/* must take care to not shift stuff by more than 31 slots */ - /* 2^(-FIGS) = 1.0 / 2^30 / 2^3 / 2^(FIGS-33) */ #define scaleFIG \ (l_mathop(1.0) / (UONE << 30) / l_mathop(8.0) / (UONE << (FIGS - 33))) @@ -500,12 +517,12 @@ static lua_Number I2d (Rand64 x) { /* convert a 'Rand64' to a 'lua_Unsigned' */ static lua_Unsigned I2UInt (Rand64 x) { - return ((lua_Unsigned)trim32(x.h) << 31 << 1) | (lua_Unsigned)trim32(x.l); + return (((lua_Unsigned)trim32(x.h) << 31) << 1) | (lua_Unsigned)trim32(x.l); } /* convert a 'lua_Unsigned' to a 'Rand64' */ static Rand64 Int2I (lua_Unsigned n) { - return packI((lu_int32)(n >> 31 >> 1), (lu_int32)n); + return packI((lu_int32)((n >> 31) >> 1), (lu_int32)n); } #endif /* } */ diff --git a/3rdparty/lua/src/lmem.c b/3rdparty/lua/src/lmem.c index 9029d588c12e5..9800a86fc024f 100644 --- a/3rdparty/lua/src/lmem.c +++ b/3rdparty/lua/src/lmem.c @@ -22,25 +22,6 @@ #include "lstate.h" -#if defined(EMERGENCYGCTESTS) -/* -** First allocation will fail whenever not building initial state. -** (This fail will trigger 'tryagain' and a full GC cycle at every -** allocation.) -*/ -static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { - if (completestate(g) && ns > 0) /* frees never fail */ - return NULL; /* fail */ - else /* normal allocation */ - return (*g->frealloc)(g->ud, block, os, ns); -} -#else -#define firsttry(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns)) -#endif - - - - /* ** About the realloc function: @@ -60,6 +41,43 @@ static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { */ +/* +** Macro to call the allocation function. +*/ +#define callfrealloc(g,block,os,ns) ((*g->frealloc)(g->ud, block, os, ns)) + + +/* +** When an allocation fails, it will try again after an emergency +** collection, except when it cannot run a collection. The GC should +** not be called while the state is not fully built, as the collector +** is not yet fully initialized. Also, it should not be called when +** 'gcstopem' is true, because then the interpreter is in the middle of +** a collection step. +*/ +#define cantryagain(g) (completestate(g) && !g->gcstopem) + + + + +#if defined(EMERGENCYGCTESTS) +/* +** First allocation will fail except when freeing a block (frees never +** fail) and when it cannot try again; this fail will trigger 'tryagain' +** and a full GC cycle at every allocation. +*/ +static void *firsttry (global_State *g, void *block, size_t os, size_t ns) { + if (ns > 0 && cantryagain(g)) + return NULL; /* fail */ + else /* normal allocation */ + return callfrealloc(g, block, os, ns); +} +#else +#define firsttry(g,block,os,ns) callfrealloc(g, block, os, ns) +#endif + + + /* @@ -132,7 +150,7 @@ l_noret luaM_toobig (lua_State *L) { void luaM_free_ (lua_State *L, void *block, size_t osize) { global_State *g = G(L); lua_assert((osize == 0) == (block == NULL)); - (*g->frealloc)(g->ud, block, osize, 0); + callfrealloc(g, block, osize, 0); g->GCdebt -= osize; } @@ -140,19 +158,15 @@ void luaM_free_ (lua_State *L, void *block, size_t osize) { /* ** In case of allocation fail, this function will do an emergency ** collection to free some memory and then try the allocation again. -** The GC should not be called while state is not fully built, as the -** collector is not yet fully initialized. Also, it should not be called -** when 'gcstopem' is true, because then the interpreter is in the -** middle of a collection step. */ static void *tryagain (lua_State *L, void *block, size_t osize, size_t nsize) { global_State *g = G(L); - if (completestate(g) && !g->gcstopem) { + if (cantryagain(g)) { luaC_fullgc(L, 1); /* try to free some memory... */ - return (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ + return callfrealloc(g, block, osize, nsize); /* try again */ } - else return NULL; /* cannot free any memory without a full state */ + else return NULL; /* cannot run an emergency collection */ } diff --git a/3rdparty/lua/src/loadlib.c b/3rdparty/lua/src/loadlib.c index 6f9fa37366e46..6d289fcebb8ce 100644 --- a/3rdparty/lua/src/loadlib.c +++ b/3rdparty/lua/src/loadlib.c @@ -24,15 +24,6 @@ #include "lualib.h" -/* -** LUA_IGMARK is a mark to ignore all before it when building the -** luaopen_ function name. -*/ -#if !defined (LUA_IGMARK) -#define LUA_IGMARK "-" -#endif - - /* ** LUA_CSUBSEP is the character that replaces dots in submodule names ** when searching for a C loader. @@ -708,8 +699,13 @@ static const luaL_Reg ll_funcs[] = { static void createsearcherstable (lua_State *L) { - static const lua_CFunction searchers[] = - {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL}; + static const lua_CFunction searchers[] = { + searcher_preload, + searcher_Lua, + searcher_C, + searcher_Croot, + NULL + }; int i; /* create 'searchers' table */ lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0); diff --git a/3rdparty/lua/src/lobject.c b/3rdparty/lua/src/lobject.c index 301aa900be0ad..9cfa5227eb467 100644 --- a/3rdparty/lua/src/lobject.c +++ b/3rdparty/lua/src/lobject.c @@ -62,7 +62,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, case LUA_OPBOR: return intop(|, v1, v2); case LUA_OPBXOR: return intop(^, v1, v2); case LUA_OPSHL: return luaV_shiftl(v1, v2); - case LUA_OPSHR: return luaV_shiftl(v1, -v2); + case LUA_OPSHR: return luaV_shiftr(v1, v2); case LUA_OPUNM: return intop(-, 0, v1); case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); default: lua_assert(0); return 0; @@ -386,29 +386,39 @@ void luaO_tostring (lua_State *L, TValue *obj) { ** =================================================================== */ -/* size for buffer space used by 'luaO_pushvfstring' */ -#define BUFVFS 200 +/* +** Size for buffer space used by 'luaO_pushvfstring'. It should be +** (LUA_IDSIZE + MAXNUMBER2STR) + a minimal space for basic messages, +** so that 'luaG_addinfo' can work directly on the buffer. +*/ +#define BUFVFS (LUA_IDSIZE + MAXNUMBER2STR + 95) /* buffer used by 'luaO_pushvfstring' */ typedef struct BuffFS { lua_State *L; - int pushed; /* number of string pieces already on the stack */ + int pushed; /* true if there is a part of the result on the stack */ int blen; /* length of partial string in 'space' */ char space[BUFVFS]; /* holds last part of the result */ } BuffFS; /* -** Push given string to the stack, as part of the buffer, and -** join the partial strings in the stack into one. +** Push given string to the stack, as part of the result, and +** join it to previous partial result if there is one. +** It may call 'luaV_concat' while using one slot from EXTRA_STACK. +** This call cannot invoke metamethods, as both operands must be +** strings. It can, however, raise an error if the result is too +** long. In that case, 'luaV_concat' frees the extra slot before +** raising the error. */ -static void pushstr (BuffFS *buff, const char *str, size_t l) { +static void pushstr (BuffFS *buff, const char *str, size_t lstr) { lua_State *L = buff->L; - setsvalue2s(L, L->top, luaS_newlstr(L, str, l)); - L->top++; /* may use one extra slot */ - buff->pushed++; - luaV_concat(L, buff->pushed); /* join partial results into one */ - buff->pushed = 1; + setsvalue2s(L, L->top.p, luaS_newlstr(L, str, lstr)); + L->top.p++; /* may use one slot from EXTRA_STACK */ + if (!buff->pushed) /* no previous string on the stack? */ + buff->pushed = 1; /* now there is one */ + else /* join previous string with new one */ + luaV_concat(L, 2); } @@ -454,7 +464,7 @@ static void addstr2buff (BuffFS *buff, const char *str, size_t slen) { /* -** Add a number to the buffer. +** Add a numeral to the buffer. */ static void addnum2buff (BuffFS *buff, TValue *num) { char *numbuff = getbuff(buff, MAXNUMBER2STR); @@ -532,7 +542,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { addstr2buff(&buff, fmt, strlen(fmt)); /* rest of 'fmt' */ clearbuff(&buff); /* empty buffer into the stack */ lua_assert(buff.pushed == 1); - return svalue(s2v(L->top - 1)); + return getstr(tsvalue(s2v(L->top.p - 1))); } diff --git a/3rdparty/lua/src/lobject.h b/3rdparty/lua/src/lobject.h index 0e05b3e42ea92..980e42f8c27ac 100644 --- a/3rdparty/lua/src/lobject.h +++ b/3rdparty/lua/src/lobject.h @@ -52,6 +52,8 @@ typedef union Value { lua_CFunction f; /* light C functions */ lua_Integer i; /* integer numbers */ lua_Number n; /* float numbers */ + /* not used, but may avoid warnings for uninitialized value */ + lu_byte ub; } Value; @@ -155,6 +157,17 @@ typedef union StackValue { /* index to stack elements */ typedef StackValue *StkId; + +/* +** When reallocating the stack, change all pointers to the stack into +** proper offsets. +*/ +typedef union { + StkId p; /* actual pointer */ + ptrdiff_t offset; /* used while the stack is being reallocated */ +} StkIdRel; + + /* convert a 'StackValue' to a 'TValue' */ #define s2v(o) (&(o)->val) @@ -373,7 +386,7 @@ typedef struct GCObject { typedef struct TString { CommonHeader; lu_byte extra; /* reserved words for short strings; "has hash" for longs */ - lu_byte shrlen; /* length for short strings */ + lu_byte shrlen; /* length for short strings, 0xFF for long strings */ unsigned int hash; union { size_t lnglen; /* length for long strings */ @@ -385,19 +398,17 @@ typedef struct TString { /* -** Get the actual string (array of bytes) from a 'TString'. +** Get the actual string (array of bytes) from a 'TString'. (Generic +** version and specialized versions for long and short strings.) */ -#define getstr(ts) ((ts)->contents) - +#define getstr(ts) ((ts)->contents) +#define getlngstr(ts) check_exp((ts)->shrlen == 0xFF, (ts)->contents) +#define getshrstr(ts) check_exp((ts)->shrlen != 0xFF, (ts)->contents) -/* get the actual string (array of bytes) from a Lua value */ -#define svalue(o) getstr(tsvalue(o)) /* get string length from 'TString *s' */ -#define tsslen(s) ((s)->tt == LUA_VSHRSTR ? (s)->shrlen : (s)->u.lnglen) - -/* get string length from 'TValue *o' */ -#define vslen(o) tsslen(tsvalue(o)) +#define tsslen(s) \ + ((s)->shrlen != 0xFF ? (s)->shrlen : (s)->u.lnglen) /* }================================================================== */ @@ -615,8 +626,10 @@ typedef struct Proto { */ typedef struct UpVal { CommonHeader; - lu_byte tbc; /* true if it represents a to-be-closed variable */ - TValue *v; /* points to stack or to its own value */ + union { + TValue *p; /* points to stack or to its own value */ + ptrdiff_t offset; /* used while the stack is being reallocated */ + } v; union { struct { /* (when open) */ struct UpVal *next; /* linked list */ diff --git a/3rdparty/lua/src/lopcodes.h b/3rdparty/lua/src/lopcodes.h index 7c27451596065..46911cac14e09 100644 --- a/3rdparty/lua/src/lopcodes.h +++ b/3rdparty/lua/src/lopcodes.h @@ -21,7 +21,7 @@ iABC C(8) | B(8) |k| A(8) | Op(7) | iABx Bx(17) | A(8) | Op(7) | iAsBx sBx (signed)(17) | A(8) | Op(7) | iAx Ax(25) | Op(7) | -isJ sJ(25) | Op(7) | +isJ sJ (signed)(25) | Op(7) | A signed argument is represented in excess K: the represented value is the written unsigned value minus K, where K is half the maximum for the @@ -210,15 +210,15 @@ OP_LOADNIL,/* A B R[A], R[A+1], ..., R[A+B] := nil */ OP_GETUPVAL,/* A B R[A] := UpValue[B] */ OP_SETUPVAL,/* A B UpValue[B] := R[A] */ -OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:string] */ +OP_GETTABUP,/* A B C R[A] := UpValue[B][K[C]:shortstring] */ OP_GETTABLE,/* A B C R[A] := R[B][R[C]] */ OP_GETI,/* A B C R[A] := R[B][C] */ -OP_GETFIELD,/* A B C R[A] := R[B][K[C]:string] */ +OP_GETFIELD,/* A B C R[A] := R[B][K[C]:shortstring] */ -OP_SETTABUP,/* A B C UpValue[A][K[B]:string] := RK(C) */ +OP_SETTABUP,/* A B C UpValue[A][K[B]:shortstring] := RK(C) */ OP_SETTABLE,/* A B C R[A][R[B]] := RK(C) */ OP_SETI,/* A B C R[A][B] := RK(C) */ -OP_SETFIELD,/* A B C R[A][K[B]:string] := RK(C) */ +OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */ OP_NEWTABLE,/* A B C k R[A] := {} */ diff --git a/3rdparty/lua/src/loslib.c b/3rdparty/lua/src/loslib.c index 3e20d622bacd4..ba80d72c4575e 100644 --- a/3rdparty/lua/src/loslib.c +++ b/3rdparty/lua/src/loslib.c @@ -30,23 +30,14 @@ */ #if !defined(LUA_STRFTIMEOPTIONS) /* { */ -/* options for ANSI C 89 (only 1-char options) */ -#define L_STRFTIMEC89 "aAbBcdHIjmMpSUwWxXyYZ%" - -/* options for ISO C 99 and POSIX */ -#define L_STRFTIMEC99 "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \ - "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */ - -/* options for Windows */ -#define L_STRFTIMEWIN "aAbBcdHIjmMpSUwWxXyYzZ%" \ - "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */ - #if defined(LUA_USE_WINDOWS) -#define LUA_STRFTIMEOPTIONS L_STRFTIMEWIN -#elif defined(LUA_USE_C89) -#define LUA_STRFTIMEOPTIONS L_STRFTIMEC89 +#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYzZ%" \ + "||" "#c#x#d#H#I#j#m#M#S#U#w#W#y#Y" /* two-char options */ +#elif defined(LUA_USE_C89) /* ANSI C 89 (only 1-char options) */ +#define LUA_STRFTIMEOPTIONS "aAbBcdHIjmMpSUwWxXyYZ%" #else /* C99 specification */ -#define LUA_STRFTIMEOPTIONS L_STRFTIMEC99 +#define LUA_STRFTIMEOPTIONS "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%" \ + "||" "EcECExEXEyEY" "OdOeOHOIOmOMOSOuOUOVOwOWOy" /* two-char options */ #endif #endif /* } */ @@ -138,12 +129,21 @@ /* }================================================================== */ +#if !defined(l_system) +#if defined(LUA_USE_IOS) +/* Despite claiming to be ISO C, iOS does not implement 'system'. */ +#define l_system(cmd) ((cmd) == NULL ? 0 : -1) +#else +#define l_system(cmd) system(cmd) /* default definition */ +#endif +#endif + static int os_execute (lua_State *L) { const char *cmd = luaL_optstring(L, 1, NULL); int stat; errno = 0; - stat = system(cmd); + stat = l_system(cmd); if (cmd != NULL) return luaL_execresult(L, stat); else { @@ -155,6 +155,7 @@ static int os_execute (lua_State *L) { static int os_remove (lua_State *L) { const char *filename = luaL_checkstring(L, 1); + errno = 0; return luaL_fileresult(L, remove(filename) == 0, filename); } @@ -162,6 +163,7 @@ static int os_remove (lua_State *L) { static int os_rename (lua_State *L) { const char *fromname = luaL_checkstring(L, 1); const char *toname = luaL_checkstring(L, 2); + errno = 0; return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); } @@ -260,9 +262,7 @@ static int getfield (lua_State *L, const char *key, int d, int delta) { res = d; } else { - /* unsigned avoids overflow when lua_Integer has 32 bits */ - if (!(res >= 0 ? (lua_Unsigned)res <= (lua_Unsigned)INT_MAX + delta - : (lua_Integer)INT_MIN + delta <= res)) + if (!(res >= 0 ? res - delta <= INT_MAX : INT_MIN + delta <= res)) return luaL_error(L, "field '%s' is out-of-bound", key); res -= delta; } diff --git a/3rdparty/lua/src/lparser.c b/3rdparty/lua/src/lparser.c index 3abe3d75187b7..2b888c7cff177 100644 --- a/3rdparty/lua/src/lparser.c +++ b/3rdparty/lua/src/lparser.c @@ -468,6 +468,7 @@ static void singlevar (LexState *ls, expdesc *var) { expdesc key; singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ lua_assert(var->k != VVOID); /* this one must exist */ + luaK_exp2anyregup(fs, var); /* but could be a constant */ codestring(&key, varname); /* key is variable name */ luaK_indexed(fs, var, &key); /* env[varname] */ } @@ -520,12 +521,12 @@ static l_noret jumpscopeerror (LexState *ls, Labeldesc *gt) { /* ** Solves the goto at index 'g' to given 'label' and removes it -** from the list of pending goto's. +** from the list of pending gotos. ** If it jumps into the scope of some variable, raises an error. */ static void solvegoto (LexState *ls, int g, Labeldesc *label) { int i; - Labellist *gl = &ls->dyd->gt; /* list of goto's */ + Labellist *gl = &ls->dyd->gt; /* list of gotos */ Labeldesc *gt = &gl->arr[g]; /* goto to be resolved */ lua_assert(eqstr(gt->name, label->name)); if (l_unlikely(gt->nactvar < label->nactvar)) /* enter some scope? */ @@ -579,7 +580,7 @@ static int newgotoentry (LexState *ls, TString *name, int line, int pc) { /* ** Solves forward jumps. Check whether new label 'lb' matches any ** pending gotos in current block and solves them. Return true -** if any of the goto's need to close upvalues. +** if any of the gotos need to close upvalues. */ static int solvegotos (LexState *ls, Labeldesc *lb) { Labellist *gl = &ls->dyd->gt; @@ -600,7 +601,7 @@ static int solvegotos (LexState *ls, Labeldesc *lb) { /* ** Create a new label with the given 'name' at the given 'line'. ** 'last' tells whether label is the last non-op statement in its -** block. Solves all pending goto's to this new label and adds +** block. Solves all pending gotos to this new label and adds ** a close instruction if necessary. ** Returns true iff it added a close instruction. */ @@ -673,19 +674,19 @@ static void leaveblock (FuncState *fs) { LexState *ls = fs->ls; int hasclose = 0; int stklevel = reglevel(fs, bl->nactvar); /* level outside the block */ - if (bl->isloop) /* fix pending breaks? */ + removevars(fs, bl->nactvar); /* remove block locals */ + lua_assert(bl->nactvar == fs->nactvar); /* back to level on entry */ + if (bl->isloop) /* has to fix pending breaks? */ hasclose = createlabel(ls, luaS_newliteral(ls->L, "break"), 0, 0); - if (!hasclose && bl->previous && bl->upval) + if (!hasclose && bl->previous && bl->upval) /* still need a 'close'? */ luaK_codeABC(fs, OP_CLOSE, stklevel, 0, 0); - fs->bl = bl->previous; - removevars(fs, bl->nactvar); - lua_assert(bl->nactvar == fs->nactvar); fs->freereg = stklevel; /* free registers */ ls->dyd->label.n = bl->firstlabel; /* remove local labels */ - if (bl->previous) /* inner block? */ - movegotosout(fs, bl); /* update pending gotos to outer block */ + fs->bl = bl->previous; /* current block now is previous one */ + if (bl->previous) /* was it a nested block? */ + movegotosout(fs, bl); /* update pending gotos to enclosing block */ else { - if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */ + if (bl->firstgoto < ls->dyd->gt.n) /* still pending gotos? */ undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ } } @@ -1021,10 +1022,11 @@ static int explist (LexState *ls, expdesc *v) { } -static void funcargs (LexState *ls, expdesc *f, int line) { +static void funcargs (LexState *ls, expdesc *f) { FuncState *fs = ls->fs; expdesc args; int base, nparams; + int line = ls->linenumber; switch (ls->t.token) { case '(': { /* funcargs -> '(' [ explist ] ')' */ luaX_next(ls); @@ -1062,8 +1064,8 @@ static void funcargs (LexState *ls, expdesc *f, int line) { } init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); luaK_fixline(fs, line); - fs->freereg = base+1; /* call remove function and arguments and leaves - (unless changed) one result */ + fs->freereg = base+1; /* call removes function and arguments and leaves + one result (unless changed later) */ } @@ -1102,7 +1104,6 @@ static void suffixedexp (LexState *ls, expdesc *v) { /* suffixedexp -> primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ FuncState *fs = ls->fs; - int line = ls->linenumber; primaryexp(ls, v); for (;;) { switch (ls->t.token) { @@ -1122,12 +1123,12 @@ static void suffixedexp (LexState *ls, expdesc *v) { luaX_next(ls); codename(ls, &key); luaK_self(fs, v, &key); - funcargs(ls, v, line); + funcargs(ls, v); break; } case '(': case TK_STRING: case '{': { /* funcargs */ luaK_exp2nextreg(fs, v); - funcargs(ls, v, line); + funcargs(ls, v); break; } default: return; @@ -1943,10 +1944,10 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, LexState lexstate; FuncState funcstate; LClosure *cl = luaF_newLclosure(L, 1); /* create main closure */ - setclLvalue2s(L, L->top, cl); /* anchor it (to avoid being collected) */ + setclLvalue2s(L, L->top.p, cl); /* anchor it (to avoid being collected) */ luaD_inctop(L); lexstate.h = luaH_new(L); /* create table for scanner */ - sethvalue2s(L, L->top, lexstate.h); /* anchor it */ + sethvalue2s(L, L->top.p, lexstate.h); /* anchor it */ luaD_inctop(L); funcstate.f = cl->p = luaF_newproto(L); luaC_objbarrier(L, cl, cl->p); @@ -1960,7 +1961,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); /* all scopes should be correctly finished */ lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); - L->top--; /* remove scanner's table */ + L->top.p--; /* remove scanner's table */ return cl; /* closure is on the stack, too */ } diff --git a/3rdparty/lua/src/lstate.c b/3rdparty/lua/src/lstate.c index 1ffe1a0f71cde..7fefacba2c17c 100644 --- a/3rdparty/lua/src/lstate.c +++ b/3rdparty/lua/src/lstate.c @@ -119,7 +119,7 @@ CallInfo *luaE_extendCI (lua_State *L) { /* ** free all CallInfo structures not in use by a thread */ -void luaE_freeCI (lua_State *L) { +static void freeCI (lua_State *L) { CallInfo *ci = L->ci; CallInfo *next = ci->next; ci->next = NULL; @@ -180,33 +180,33 @@ LUAI_FUNC void luaE_incCstack (lua_State *L) { static void stack_init (lua_State *L1, lua_State *L) { int i; CallInfo *ci; /* initialize stack array */ - L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue); - L1->tbclist = L1->stack; + L1->stack.p = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, StackValue); + L1->tbclist.p = L1->stack.p; for (i = 0; i < BASIC_STACK_SIZE + EXTRA_STACK; i++) - setnilvalue(s2v(L1->stack + i)); /* erase new stack */ - L1->top = L1->stack; - L1->stack_last = L1->stack + BASIC_STACK_SIZE; + setnilvalue(s2v(L1->stack.p + i)); /* erase new stack */ + L1->top.p = L1->stack.p; + L1->stack_last.p = L1->stack.p + BASIC_STACK_SIZE; /* initialize first ci */ ci = &L1->base_ci; ci->next = ci->previous = NULL; ci->callstatus = CIST_C; - ci->func = L1->top; + ci->func.p = L1->top.p; ci->u.c.k = NULL; ci->nresults = 0; - setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */ - L1->top++; - ci->top = L1->top + LUA_MINSTACK; + setnilvalue(s2v(L1->top.p)); /* 'function' entry for this 'ci' */ + L1->top.p++; + ci->top.p = L1->top.p + LUA_MINSTACK; L1->ci = ci; } static void freestack (lua_State *L) { - if (L->stack == NULL) + if (L->stack.p == NULL) return; /* stack not completely built yet */ L->ci = &L->base_ci; /* free the entire 'ci' list */ - luaE_freeCI(L); + freeCI(L); lua_assert(L->nci == 0); - luaM_freearray(L, L->stack, stacksize(L) + EXTRA_STACK); /* free stack */ + luaM_freearray(L, L->stack.p, stacksize(L) + EXTRA_STACK); /* free stack */ } @@ -248,7 +248,7 @@ static void f_luaopen (lua_State *L, void *ud) { */ static void preinit_thread (lua_State *L, global_State *g) { G(L) = g; - L->stack = NULL; + L->stack.p = NULL; L->ci = NULL; L->nci = 0; L->twups = L; /* thread has no upvalues */ @@ -284,20 +284,16 @@ static void close_state (lua_State *L) { LUA_API lua_State *lua_newthread (lua_State *L) { - global_State *g; + global_State *g = G(L); + GCObject *o; lua_State *L1; lua_lock(L); - g = G(L); luaC_checkGC(L); /* create new thread */ - L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l; - L1->marked = luaC_white(g); - L1->tt = LUA_VTHREAD; - /* link it on list 'allgc' */ - L1->next = g->allgc; - g->allgc = obj2gco(L1); + o = luaC_newobjdt(L, LUA_TTHREAD, sizeof(LX), offsetof(LX, l)); + L1 = gco2th(o); /* anchor it on L stack */ - setthvalue2s(L, L->top, L1); + setthvalue2s(L, L->top.p, L1); api_incr_top(L); preinit_thread(L1, g); L1->hookmask = L->hookmask; @@ -316,7 +312,7 @@ LUA_API lua_State *lua_newthread (lua_State *L) { void luaE_freethread (lua_State *L, lua_State *L1) { LX *l = fromstate(L1); - luaF_closeupval(L1, L1->stack); /* close all upvalues */ + luaF_closeupval(L1, L1->stack.p); /* close all upvalues */ lua_assert(L1->openupval == NULL); luai_userstatefree(L, L1); freestack(L1); @@ -326,32 +322,41 @@ void luaE_freethread (lua_State *L, lua_State *L1) { int luaE_resetthread (lua_State *L, int status) { CallInfo *ci = L->ci = &L->base_ci; /* unwind CallInfo list */ - setnilvalue(s2v(L->stack)); /* 'function' entry for basic 'ci' */ - ci->func = L->stack; + setnilvalue(s2v(L->stack.p)); /* 'function' entry for basic 'ci' */ + ci->func.p = L->stack.p; ci->callstatus = CIST_C; if (status == LUA_YIELD) status = LUA_OK; L->status = LUA_OK; /* so it can run __close metamethods */ status = luaD_closeprotected(L, 1, status); if (status != LUA_OK) /* errors? */ - luaD_seterrorobj(L, status, L->stack + 1); + luaD_seterrorobj(L, status, L->stack.p + 1); else - L->top = L->stack + 1; - ci->top = L->top + LUA_MINSTACK; - luaD_reallocstack(L, cast_int(ci->top - L->stack), 0); + L->top.p = L->stack.p + 1; + ci->top.p = L->top.p + LUA_MINSTACK; + luaD_reallocstack(L, cast_int(ci->top.p - L->stack.p), 0); return status; } -LUA_API int lua_resetthread (lua_State *L) { +LUA_API int lua_closethread (lua_State *L, lua_State *from) { int status; lua_lock(L); + L->nCcalls = (from) ? getCcalls(from) : 0; status = luaE_resetthread(L, L->status); lua_unlock(L); return status; } +/* +** Deprecated! Use 'lua_closethread' instead. +*/ +LUA_API int lua_resetthread (lua_State *L) { + return lua_closethread(L, NULL); +} + + LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { int i; lua_State *L; @@ -426,9 +431,9 @@ void luaE_warning (lua_State *L, const char *msg, int tocont) { ** Generate a warning from an error message */ void luaE_warnerror (lua_State *L, const char *where) { - TValue *errobj = s2v(L->top - 1); /* error object */ + TValue *errobj = s2v(L->top.p - 1); /* error object */ const char *msg = (ttisstring(errobj)) - ? svalue(errobj) + ? getstr(tsvalue(errobj)) : "error object is not a string"; /* produce warning "error in %s (%s)" (where, msg) */ luaE_warning(L, "error in ", 1); diff --git a/3rdparty/lua/src/lstate.h b/3rdparty/lua/src/lstate.h index 61e82cde72530..007704c826be2 100644 --- a/3rdparty/lua/src/lstate.h +++ b/3rdparty/lua/src/lstate.h @@ -9,6 +9,11 @@ #include "lua.h" + +/* Some header files included here need this definition */ +typedef struct CallInfo CallInfo; + + #include "lobject.h" #include "ltm.h" #include "lzio.h" @@ -139,7 +144,7 @@ struct lua_longjmp; /* defined in ldo.c */ #define BASIC_STACK_SIZE (2*LUA_MINSTACK) -#define stacksize(th) cast_int((th)->stack_last - (th)->stack) +#define stacksize(th) cast_int((th)->stack_last.p - (th)->stack.p) /* kinds of Garbage Collection */ @@ -169,14 +174,14 @@ typedef struct stringtable { ** - field 'transferinfo' is used only during call/returnhooks, ** before the function starts or after it ends. */ -typedef struct CallInfo { - StkId func; /* function index in the stack */ - StkId top; /* top for this function */ +struct CallInfo { + StkIdRel func; /* function index in the stack */ + StkIdRel top; /* top for this function */ struct CallInfo *previous, *next; /* dynamic call link */ union { struct { /* only for Lua functions */ const Instruction *savedpc; - volatile l_signalT trap; + volatile l_signalT trap; /* function is tracing lines/counts */ int nextraargs; /* # of extra arguments in vararg functions */ } l; struct { /* only for C functions */ @@ -196,7 +201,7 @@ typedef struct CallInfo { } u2; short nresults; /* expected number of results from this function */ unsigned short callstatus; -} CallInfo; +}; /* @@ -291,7 +296,7 @@ typedef struct global_State { struct lua_State *mainthread; TString *memerrmsg; /* message for memory-allocation errors */ TString *tmname[TM_N]; /* array with tag-method names */ - struct Table *mt[LUA_NUMTAGS]; /* metatables for basic types */ + struct Table *mt[LUA_NUMTYPES]; /* metatables for basic types */ TString *strcache[STRCACHE_N][STRCACHE_M]; /* cache for strings in API */ lua_WarnFunction warnf; /* warning function */ void *ud_warn; /* auxiliary data to 'warnf' */ @@ -306,13 +311,13 @@ struct lua_State { lu_byte status; lu_byte allowhook; unsigned short nci; /* number of items in 'ci' list */ - StkId top; /* first free slot in the stack */ + StkIdRel top; /* first free slot in the stack */ global_State *l_G; CallInfo *ci; /* call info for current function */ - StkId stack_last; /* end of stack (last element + 1) */ - StkId stack; /* stack base */ + StkIdRel stack_last; /* end of stack (last element + 1) */ + StkIdRel stack; /* stack base */ UpVal *openupval; /* list of open upvalues in this stack */ - StkId tbclist; /* list of to-be-closed variables */ + StkIdRel tbclist; /* list of to-be-closed variables */ GCObject *gclist; struct lua_State *twups; /* list of threads with open upvalues */ struct lua_longjmp *errorJmp; /* current error recover point */ @@ -391,7 +396,6 @@ union GCUnion { LUAI_FUNC void luaE_setdebt (global_State *g, l_mem debt); LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); -LUAI_FUNC void luaE_freeCI (lua_State *L); LUAI_FUNC void luaE_shrinkCI (lua_State *L); LUAI_FUNC void luaE_checkcstack (lua_State *L); LUAI_FUNC void luaE_incCstack (lua_State *L); diff --git a/3rdparty/lua/src/lstring.c b/3rdparty/lua/src/lstring.c index 13dcaf4259bc0..97757355c0b65 100644 --- a/3rdparty/lua/src/lstring.c +++ b/3rdparty/lua/src/lstring.c @@ -36,7 +36,7 @@ int luaS_eqlngstr (TString *a, TString *b) { lua_assert(a->tt == LUA_VLNGSTR && b->tt == LUA_VLNGSTR); return (a == b) || /* same instance or... */ ((len == b->u.lnglen) && /* equal length and ... */ - (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ + (memcmp(getlngstr(a), getlngstr(b), len) == 0)); /* equal contents */ } @@ -52,7 +52,7 @@ unsigned int luaS_hashlongstr (TString *ts) { lua_assert(ts->tt == LUA_VLNGSTR); if (ts->extra == 0) { /* no hash? */ size_t len = ts->u.lnglen; - ts->hash = luaS_hash(getstr(ts), len, ts->hash); + ts->hash = luaS_hash(getlngstr(ts), len, ts->hash); ts->extra = 1; /* now it has its hash */ } return ts->hash; @@ -157,6 +157,7 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { TString *luaS_createlngstrobj (lua_State *L, size_t l) { TString *ts = createstrobj(L, l, LUA_VLNGSTR, G(L)->seed); ts->u.lnglen = l; + ts->shrlen = 0xFF; /* signals that it is a long string */ return ts; } @@ -193,7 +194,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { TString **list = &tb->hash[lmod(h, tb->size)]; lua_assert(str != NULL); /* otherwise 'memcmp'/'memcpy' are undefined */ for (ts = *list; ts != NULL; ts = ts->u.hnext) { - if (l == ts->shrlen && (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { + if (l == ts->shrlen && (memcmp(str, getshrstr(ts), l * sizeof(char)) == 0)) { /* found! */ if (isdead(g, ts)) /* dead (but not collected yet)? */ changewhite(ts); /* resurrect it */ @@ -206,8 +207,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { list = &tb->hash[lmod(h, tb->size)]; /* rehash with new size */ } ts = createstrobj(L, l, LUA_VSHRSTR, h); - memcpy(getstr(ts), str, l * sizeof(char)); ts->shrlen = cast_byte(l); + memcpy(getshrstr(ts), str, l * sizeof(char)); ts->u.hnext = *list; *list = ts; tb->nuse++; @@ -223,10 +224,10 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { return internshrstr(L, str, l); else { TString *ts; - if (l_unlikely(l >= (MAX_SIZE - sizeof(TString))/sizeof(char))) + if (l_unlikely(l * sizeof(char) >= (MAX_SIZE - sizeof(TString)))) luaM_toobig(L); ts = luaS_createlngstrobj(L, l); - memcpy(getstr(ts), str, l * sizeof(char)); + memcpy(getlngstr(ts), str, l * sizeof(char)); return ts; } } diff --git a/3rdparty/lua/src/lstrlib.c b/3rdparty/lua/src/lstrlib.c index 0b4fdbb7b5bf5..03167161df188 100644 --- a/3rdparty/lua/src/lstrlib.c +++ b/3rdparty/lua/src/lstrlib.c @@ -570,7 +570,7 @@ static const char *match_capture (MatchState *ms, const char *s, int l) { static const char *match (MatchState *ms, const char *s, const char *p) { if (l_unlikely(ms->matchdepth-- == 0)) luaL_error(ms->L, "pattern too complex"); - init: /* using goto's to optimize tail recursion */ + init: /* using goto to optimize tail recursion */ if (p != ms->p_end) { /* end of pattern? */ switch (*p) { case '(': { /* start capture */ diff --git a/3rdparty/lua/src/ltable.c b/3rdparty/lua/src/ltable.c index 1b1cd2415b60c..3353c047939a8 100644 --- a/3rdparty/lua/src/ltable.c +++ b/3rdparty/lua/src/ltable.c @@ -107,7 +107,7 @@ static const TValue absentkey = {ABSTKEYCONSTANT}; */ static Node *hashint (const Table *t, lua_Integer i) { lua_Unsigned ui = l_castS2U(i); - if (ui <= (unsigned int)INT_MAX) + if (ui <= cast_uint(INT_MAX)) return hashmod(t, cast_int(ui)); else return hashmod(t, ui); @@ -252,14 +252,16 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t) { return t->alimit; /* this is the size */ else { unsigned int size = t->alimit; - /* compute the smallest power of 2 not smaller than 'n' */ + /* compute the smallest power of 2 not smaller than 'size' */ size |= (size >> 1); size |= (size >> 2); size |= (size >> 4); size |= (size >> 8); +#if (UINT_MAX >> 14) > 3 /* unsigned int has more than 16 bits */ size |= (size >> 16); #if (UINT_MAX >> 30) > 3 size |= (size >> 32); /* unsigned int has more than 32 bits */ +#endif #endif size++; lua_assert(ispow2(size) && size/2 < t->alimit && t->alimit < size); @@ -488,7 +490,7 @@ static void setnodevector (lua_State *L, Table *t, unsigned int size) { luaG_runerror(L, "table overflow"); size = twoto(lsize); t->node = luaM_newvector(L, size, Node); - for (i = 0; i < (int)size; i++) { + for (i = 0; i < cast_int(size); i++) { Node *n = gnode(t, i); gnext(n) = 0; setnilkey(n); @@ -660,7 +662,8 @@ static Node *getfreepos (Table *t) { ** put new key in its main position; otherwise (colliding node is in its main ** position), new key goes to an empty position. */ -void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { +static void luaH_newkey (lua_State *L, Table *t, const TValue *key, + TValue *value) { Node *mp; TValue aux; if (l_unlikely(ttisnil(key))) @@ -719,22 +722,36 @@ void luaH_newkey (lua_State *L, Table *t, const TValue *key, TValue *value) { /* ** Search function for integers. If integer is inside 'alimit', get it -** directly from the array part. Otherwise, if 'alimit' is not equal to -** the real size of the array, key still can be in the array part. In -** this case, try to avoid a call to 'luaH_realasize' when key is just -** one more than the limit (so that it can be incremented without -** changing the real size of the array). +** directly from the array part. Otherwise, if 'alimit' is not +** the real size of the array, the key still can be in the array part. +** In this case, do the "Xmilia trick" to check whether 'key-1' is +** smaller than the real size. +** The trick works as follow: let 'p' be an integer such that +** '2^(p+1) >= alimit > 2^p', or '2^(p+1) > alimit-1 >= 2^p'. +** That is, 2^(p+1) is the real size of the array, and 'p' is the highest +** bit on in 'alimit-1'. What we have to check becomes 'key-1 < 2^(p+1)'. +** We compute '(key-1) & ~(alimit-1)', which we call 'res'; it will +** have the 'p' bit cleared. If the key is outside the array, that is, +** 'key-1 >= 2^(p+1)', then 'res' will have some bit on higher than 'p', +** therefore it will be larger or equal to 'alimit', and the check +** will fail. If 'key-1 < 2^(p+1)', then 'res' has no bit on higher than +** 'p', and as the bit 'p' itself was cleared, 'res' will be smaller +** than 2^p, therefore smaller than 'alimit', and the check succeeds. +** As special cases, when 'alimit' is 0 the condition is trivially false, +** and when 'alimit' is 1 the condition simplifies to 'key-1 < alimit'. +** If key is 0 or negative, 'res' will have its higher bit on, so that +** if cannot be smaller than alimit. */ const TValue *luaH_getint (Table *t, lua_Integer key) { - if (l_castS2U(key) - 1u < t->alimit) /* 'key' in [1, t->alimit]? */ + lua_Unsigned alimit = t->alimit; + if (l_castS2U(key) - 1u < alimit) /* 'key' in [1, t->alimit]? */ return &t->array[key - 1]; - else if (!limitequalsasize(t) && /* key still may be in the array part? */ - (l_castS2U(key) == t->alimit + 1 || - l_castS2U(key) - 1u < luaH_realasize(t))) { + else if (!isrealasize(t) && /* key still may be in the array part? */ + (((l_castS2U(key) - 1u) & ~(alimit - 1u)) < alimit)) { t->alimit = cast_uint(key); /* probably '#t' is here now */ return &t->array[key - 1]; } - else { + else { /* key is not in the array part; check the hash */ Node *n = hashint(t, key); for (;;) { /* check whether 'key' is somewhere in the chain */ if (keyisinteger(n) && keyival(n) == key) @@ -975,6 +992,4 @@ Node *luaH_mainposition (const Table *t, const TValue *key) { return mainpositionTV(t, key); } -int luaH_isdummy (const Table *t) { return isdummy(t); } - #endif diff --git a/3rdparty/lua/src/ltable.h b/3rdparty/lua/src/ltable.h index 7bbbcb213f8b7..8e68903423483 100644 --- a/3rdparty/lua/src/ltable.h +++ b/3rdparty/lua/src/ltable.h @@ -41,8 +41,6 @@ LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key, LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); -LUAI_FUNC void luaH_newkey (lua_State *L, Table *t, const TValue *key, - TValue *value); LUAI_FUNC void luaH_set (lua_State *L, Table *t, const TValue *key, TValue *value); LUAI_FUNC void luaH_finishset (lua_State *L, Table *t, const TValue *key, @@ -59,7 +57,6 @@ LUAI_FUNC unsigned int luaH_realasize (const Table *t); #if defined(LUA_DEBUG) LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); -LUAI_FUNC int luaH_isdummy (const Table *t); #endif diff --git a/3rdparty/lua/src/ltablib.c b/3rdparty/lua/src/ltablib.c index 868d78fd83ec6..e6bc4d04af47e 100644 --- a/3rdparty/lua/src/ltablib.c +++ b/3rdparty/lua/src/ltablib.c @@ -93,7 +93,7 @@ static int tremove (lua_State *L) { lua_Integer pos = luaL_optinteger(L, 2, size); if (pos != size) /* validate 'pos' if given */ /* check whether 'pos' is in [1, size + 1] */ - luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 1, + luaL_argcheck(L, (lua_Unsigned)pos - 1u <= (lua_Unsigned)size, 2, "position out of bounds"); lua_geti(L, 1, pos); /* result = t[pos] */ for ( ; pos < size; pos++) { diff --git a/3rdparty/lua/src/ltm.c b/3rdparty/lua/src/ltm.c index b657b783a801d..07a060811d5c3 100644 --- a/3rdparty/lua/src/ltm.c +++ b/3rdparty/lua/src/ltm.c @@ -102,12 +102,12 @@ const char *luaT_objtypename (lua_State *L, const TValue *o) { void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, const TValue *p3) { - StkId func = L->top; + StkId func = L->top.p; setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */ setobj2s(L, func + 1, p1); /* 1st argument */ setobj2s(L, func + 2, p2); /* 2nd argument */ setobj2s(L, func + 3, p3); /* 3rd argument */ - L->top = func + 4; + L->top.p = func + 4; /* metamethod may yield only when called from Lua code */ if (isLuacode(L->ci)) luaD_call(L, func, 0); @@ -119,18 +119,18 @@ void luaT_callTM (lua_State *L, const TValue *f, const TValue *p1, void luaT_callTMres (lua_State *L, const TValue *f, const TValue *p1, const TValue *p2, StkId res) { ptrdiff_t result = savestack(L, res); - StkId func = L->top; + StkId func = L->top.p; setobj2s(L, func, f); /* push function (assume EXTRA_STACK) */ setobj2s(L, func + 1, p1); /* 1st argument */ setobj2s(L, func + 2, p2); /* 2nd argument */ - L->top += 3; + L->top.p += 3; /* metamethod may yield only when called from Lua code */ if (isLuacode(L->ci)) luaD_call(L, func, 1); else luaD_callnoyield(L, func, 1); res = restorestack(L, result); - setobjs2s(L, res, --L->top); /* move result to its place */ + setobjs2s(L, res, --L->top.p); /* move result to its place */ } @@ -165,7 +165,7 @@ void luaT_trybinTM (lua_State *L, const TValue *p1, const TValue *p2, void luaT_tryconcatTM (lua_State *L) { - StkId top = L->top; + StkId top = L->top.p; if (l_unlikely(!callbinTM(L, s2v(top - 2), s2v(top - 1), top - 2, TM_CONCAT))) luaG_concaterror(L, s2v(top - 2), s2v(top - 1)); @@ -200,15 +200,15 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, */ int luaT_callorderTM (lua_State *L, const TValue *p1, const TValue *p2, TMS event) { - if (callbinTM(L, p1, p2, L->top, event)) /* try original event */ - return !l_isfalse(s2v(L->top)); + if (callbinTM(L, p1, p2, L->top.p, event)) /* try original event */ + return !l_isfalse(s2v(L->top.p)); #if defined(LUA_COMPAT_LT_LE) else if (event == TM_LE) { /* try '!(p2 < p1)' for '(p1 <= p2)' */ L->ci->callstatus |= CIST_LEQ; /* mark it is doing 'lt' for 'le' */ - if (callbinTM(L, p2, p1, L->top, TM_LT)) { + if (callbinTM(L, p2, p1, L->top.p, TM_LT)) { L->ci->callstatus ^= CIST_LEQ; /* clear mark */ - return l_isfalse(s2v(L->top)); + return l_isfalse(s2v(L->top.p)); } /* else error will remove this 'ci'; no need to clear mark */ } @@ -238,20 +238,20 @@ int luaT_callorderiTM (lua_State *L, const TValue *p1, int v2, void luaT_adjustvarargs (lua_State *L, int nfixparams, CallInfo *ci, const Proto *p) { int i; - int actual = cast_int(L->top - ci->func) - 1; /* number of arguments */ + int actual = cast_int(L->top.p - ci->func.p) - 1; /* number of arguments */ int nextra = actual - nfixparams; /* number of extra arguments */ ci->u.l.nextraargs = nextra; luaD_checkstack(L, p->maxstacksize + 1); /* copy function to the top of the stack */ - setobjs2s(L, L->top++, ci->func); + setobjs2s(L, L->top.p++, ci->func.p); /* move fixed parameters to the top of the stack */ for (i = 1; i <= nfixparams; i++) { - setobjs2s(L, L->top++, ci->func + i); - setnilvalue(s2v(ci->func + i)); /* erase original parameter (for GC) */ + setobjs2s(L, L->top.p++, ci->func.p + i); + setnilvalue(s2v(ci->func.p + i)); /* erase original parameter (for GC) */ } - ci->func += actual + 1; - ci->top += actual + 1; - lua_assert(L->top <= ci->top && ci->top <= L->stack_last); + ci->func.p += actual + 1; + ci->top.p += actual + 1; + lua_assert(L->top.p <= ci->top.p && ci->top.p <= L->stack_last.p); } @@ -261,10 +261,10 @@ void luaT_getvarargs (lua_State *L, CallInfo *ci, StkId where, int wanted) { if (wanted < 0) { wanted = nextra; /* get all extra arguments available */ checkstackGCp(L, nextra, where); /* ensure stack space */ - L->top = where + nextra; /* next instruction will need top */ + L->top.p = where + nextra; /* next instruction will need top */ } for (i = 0; i < wanted && i < nextra; i++) - setobjs2s(L, where + i, ci->func - nextra + i); + setobjs2s(L, where + i, ci->func.p - nextra + i); for (; i < wanted; i++) /* complete required results with nil */ setnilvalue(s2v(where + i)); } diff --git a/3rdparty/lua/src/lua.c b/3rdparty/lua/src/lua.c index 0f19004444993..6da331f11867a 100644 --- a/3rdparty/lua/src/lua.c +++ b/3rdparty/lua/src/lua.c @@ -115,12 +115,13 @@ static void l_message (const char *pname, const char *msg) { /* ** Check whether 'status' is not OK and, if so, prints the error -** message on the top of the stack. It assumes that the error object -** is a string, as it was either generated by Lua or by 'msghandler'. +** message on the top of the stack. */ static int report (lua_State *L, int status) { if (status != LUA_OK) { const char *msg = lua_tostring(L, -1); + if (msg == NULL) + msg = "(error message not a string)"; l_message(progname, msg); lua_pop(L, 1); /* remove message */ } @@ -177,10 +178,11 @@ static void print_version (void) { ** to the script (everything after 'script') go to positive indices; ** other arguments (before the script name) go to negative indices. ** If there is no script name, assume interpreter's name as base. +** (If there is no interpreter's name either, 'script' is -1, so +** table sizes are zero.) */ static void createargtable (lua_State *L, char **argv, int argc, int script) { int i, narg; - if (script == argc) script = 0; /* no script name? */ narg = argc - (script + 1); /* number of positive indices */ lua_createtable(L, narg, script + 1); for (i = 0; i < argc; i++) { @@ -209,12 +211,17 @@ static int dostring (lua_State *L, const char *s, const char *name) { /* ** Receives 'globname[=modname]' and runs 'globname = require(modname)'. +** If there is no explicit modname and globname contains a '-', cut +** the suffix after '-' (the "version") to make the global name. */ static int dolibrary (lua_State *L, char *globname) { int status; + char *suffix = NULL; char *modname = strchr(globname, '='); - if (modname == NULL) /* no explicit name? */ + if (modname == NULL) { /* no explicit name? */ modname = globname; /* module name is equal to global name */ + suffix = strchr(modname, *LUA_IGMARK); /* look for a suffix mark */ + } else { *modname = '\0'; /* global name ends here */ modname++; /* module name starts after the '=' */ @@ -222,8 +229,11 @@ static int dolibrary (lua_State *L, char *globname) { lua_getglobal(L, "require"); lua_pushstring(L, modname); status = docall(L, 1, 1); /* call 'require(modname)' */ - if (status == LUA_OK) + if (status == LUA_OK) { + if (suffix != NULL) /* is there a suffix mark? */ + *suffix = '\0'; /* remove suffix from global name */ lua_setglobal(L, globname); /* globname = require(modname) */ + } return report(L, status); } @@ -268,14 +278,23 @@ static int handle_script (lua_State *L, char **argv) { /* ** Traverses all arguments from 'argv', returning a mask with those -** needed before running any Lua code (or an error code if it finds -** any invalid argument). 'first' returns the first not-handled argument -** (either the script name or a bad argument in case of error). +** needed before running any Lua code or an error code if it finds any +** invalid argument. In case of error, 'first' is the index of the bad +** argument. Otherwise, 'first' is -1 if there is no program name, +** 0 if there is no script name, or the index of the script name. */ static int collectargs (char **argv, int *first) { int args = 0; int i; - for (i = 1; argv[i] != NULL; i++) { + if (argv[0] != NULL) { /* is there a program name? */ + if (argv[0][0]) /* not empty? */ + progname = argv[0]; /* save it */ + } + else { /* no program name */ + *first = -1; + return 0; + } + for (i = 1; argv[i] != NULL; i++) { /* handle arguments */ *first = i; if (argv[i][0] != '-') /* not an option? */ return args; /* stop handling options */ @@ -316,7 +335,7 @@ static int collectargs (char **argv, int *first) { return has_error; } } - *first = i; /* no script name */ + *first = 0; /* no script name */ return args; } @@ -609,8 +628,8 @@ static int pmain (lua_State *L) { char **argv = (char **)lua_touserdata(L, 2); int script; int args = collectargs(argv, &script); + int optlim = (script > 0) ? script : argc; /* first argv not an option */ luaL_checkversion(L); /* check that interpreter has correct version */ - if (argv[0] && argv[0][0]) progname = argv[0]; if (args == has_error) { /* bad arg? */ print_usage(argv[script]); /* 'script' has index of bad arg. */ return 0; @@ -623,19 +642,21 @@ static int pmain (lua_State *L) { } luaL_openlibs(L); /* open standard libraries */ createargtable(L, argv, argc, script); /* create table 'arg' */ - lua_gc(L, LUA_GCGEN, 0, 0); /* GC in generational mode */ + lua_gc(L, LUA_GCRESTART); /* start GC... */ + lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */ if (!(args & has_E)) { /* no option '-E'? */ if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */ return 0; /* error running LUA_INIT */ } - if (!runargs(L, argv, script)) /* execute arguments -e and -l */ + if (!runargs(L, argv, optlim)) /* execute arguments -e and -l */ return 0; /* something failed */ - if (script < argc && /* execute main script (if there is one) */ - handle_script(L, argv + script) != LUA_OK) - return 0; + if (script > 0) { /* execute main script (if there is one) */ + if (handle_script(L, argv + script) != LUA_OK) + return 0; /* interrupt in case of error */ + } if (args & has_i) /* -i option? */ doREPL(L); /* do read-eval-print loop */ - else if (script == argc && !(args & (has_e | has_v))) { /* no arguments? */ + else if (script < 1 && !(args & (has_e | has_v))) { /* no active option? */ if (lua_stdin_is_tty()) { /* running in interactive mode? */ print_version(); doREPL(L); /* do read-eval-print loop */ @@ -654,6 +675,7 @@ int main (int argc, char **argv) { l_message(argv[0], "cannot create state: not enough memory"); return EXIT_FAILURE; } + lua_gc(L, LUA_GCSTOP); /* stop GC while building state */ lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ lua_pushinteger(L, argc); /* 1st argument */ lua_pushlightuserdata(L, argv); /* 2nd argument */ diff --git a/3rdparty/lua/src/lua.h b/3rdparty/lua/src/lua.h index e6618392cc7e3..f050dac091317 100644 --- a/3rdparty/lua/src/lua.h +++ b/3rdparty/lua/src/lua.h @@ -18,14 +18,14 @@ #define LUA_VERSION_MAJOR "5" #define LUA_VERSION_MINOR "4" -#define LUA_VERSION_RELEASE "4" +#define LUA_VERSION_RELEASE "7" #define LUA_VERSION_NUM 504 -#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 4) +#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + 7) #define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR #define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE -#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2022 Lua.org, PUC-Rio" +#define LUA_COPYRIGHT LUA_RELEASE " Copyright (C) 1994-2024 Lua.org, PUC-Rio" #define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo, W. Celes" @@ -131,6 +131,16 @@ typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); typedef void (*lua_WarnFunction) (void *ud, const char *msg, int tocont); +/* +** Type used by the debug API to collect debug information +*/ +typedef struct lua_Debug lua_Debug; + + +/* +** Functions to be called by the debugger in specific events +*/ +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); /* @@ -153,7 +163,8 @@ extern const char lua_ident[]; LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); LUA_API void (lua_close) (lua_State *L); LUA_API lua_State *(lua_newthread) (lua_State *L); -LUA_API int (lua_resetthread) (lua_State *L); +LUA_API int (lua_closethread) (lua_State *L, lua_State *from); +LUA_API int (lua_resetthread) (lua_State *L); /* Deprecated! */ LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); @@ -442,12 +453,6 @@ LUA_API void (lua_closeslot) (lua_State *L, int idx); #define LUA_MASKLINE (1 << LUA_HOOKLINE) #define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) -typedef struct lua_Debug lua_Debug; /* activation record */ - - -/* Functions to be called by the debugger in specific events */ -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - LUA_API int (lua_getstack) (lua_State *L, int level, lua_Debug *ar); LUA_API int (lua_getinfo) (lua_State *L, const char *what, lua_Debug *ar); @@ -492,7 +497,7 @@ struct lua_Debug { /****************************************************************************** -* Copyright (C) 1994-2022 Lua.org, PUC-Rio. +* Copyright (C) 1994-2024 Lua.org, PUC-Rio. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the diff --git a/3rdparty/lua/src/luac.c b/3rdparty/lua/src/luac.c index f6db9cf656bb7..5f4a141bddd99 100644 --- a/3rdparty/lua/src/luac.c +++ b/3rdparty/lua/src/luac.c @@ -121,7 +121,7 @@ static int doargs(int argc, char* argv[]) return i; } -#define FUNCTION "(function()end)();" +#define FUNCTION "(function()end)();\n" static const char* reader(lua_State* L, void* ud, size_t* size) { @@ -138,7 +138,7 @@ static const char* reader(lua_State* L, void* ud, size_t* size) } } -#define toproto(L,i) getproto(s2v(L->top+(i))) +#define toproto(L,i) getproto(s2v(L->top.p+(i))) static const Proto* combine(lua_State* L, int n) { @@ -155,8 +155,6 @@ static const Proto* combine(lua_State* L, int n) f->p[i]=toproto(L,i-n-1); if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; } - luaM_freearray(L,f->lineinfo,f->sizelineinfo); - f->sizelineinfo=0; return f; } } diff --git a/3rdparty/lua/src/luaconf.h b/3rdparty/lua/src/luaconf.h index d42d14b7d5f1a..33bb580d17c5b 100644 --- a/3rdparty/lua/src/luaconf.h +++ b/3rdparty/lua/src/luaconf.h @@ -70,6 +70,12 @@ #endif +#if defined(LUA_USE_IOS) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN +#endif + + /* @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. */ @@ -251,6 +257,15 @@ #endif + +/* +** LUA_IGMARK is a mark to ignore all after it when building the +** module name (e.g., used to build the luaopen_ function name). +** Typically, the suffix after the mark is the module version, +** as in "mod-v1.2.so". +*/ +#define LUA_IGMARK "-" + /* }================================================================== */ @@ -728,7 +743,7 @@ ** CHANGE it if you need a different limit. This limit is arbitrary; ** its only purpose is to stop Lua from consuming unlimited stack ** space (and to reserve some numbers for pseudo-indices). -** (It must fit into max(size_t)/32.) +** (It must fit into max(size_t)/32 and max(int)/2.) */ #if LUAI_IS32INT #define LUAI_MAXSTACK 1000000 @@ -747,14 +762,15 @@ /* @@ LUA_IDSIZE gives the maximum size for the description of the source -@@ of a function in debug information. +** of a function in debug information. ** CHANGE it if you want a different size. */ #define LUA_IDSIZE 60 /* -@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +@@ LUAL_BUFFERSIZE is the initial buffer size used by the lauxlib +** buffer system. */ #define LUAL_BUFFERSIZE ((int)(16 * sizeof(void*) * sizeof(lua_Number))) diff --git a/3rdparty/lua/src/lundump.c b/3rdparty/lua/src/lundump.c index 5aa55c4457897..e8d92a8534ff6 100644 --- a/3rdparty/lua/src/lundump.c +++ b/3rdparty/lua/src/lundump.c @@ -81,7 +81,7 @@ static size_t loadUnsigned (LoadState *S, size_t limit) { static size_t loadSize (LoadState *S) { - return loadUnsigned(S, ~(size_t)0); + return loadUnsigned(S, MAX_SIZET); } @@ -120,10 +120,10 @@ static TString *loadStringN (LoadState *S, Proto *p) { } else { /* long string */ ts = luaS_createlngstrobj(L, size); /* create string */ - setsvalue2s(L, L->top, ts); /* anchor it ('loadVector' can GC) */ + setsvalue2s(L, L->top.p, ts); /* anchor it ('loadVector' can GC) */ luaD_inctop(L); - loadVector(S, getstr(ts), size); /* load directly in final place */ - L->top--; /* pop string */ + loadVector(S, getlngstr(ts), size); /* load directly in final place */ + L->top.p--; /* pop string */ } luaC_objbarrier(L, p, ts); return ts; @@ -248,6 +248,8 @@ static void loadDebug (LoadState *S, Proto *f) { f->locvars[i].endpc = loadInt(S); } n = loadInt(S); + if (n != 0) /* does it have debug information? */ + n = f->sizeupvalues; /* must be this many */ for (i = 0; i < n; i++) f->upvalues[i].name = loadStringN(S, f); } @@ -321,7 +323,7 @@ LClosure *luaU_undump(lua_State *L, ZIO *Z, const char *name) { S.Z = Z; checkHeader(&S); cl = luaF_newLclosure(L, loadByte(&S)); - setclLvalue2s(L, L->top, cl); + setclLvalue2s(L, L->top.p, cl); luaD_inctop(L); cl->p = luaF_newproto(L); luaC_objbarrier(L, cl, cl->p); diff --git a/3rdparty/lua/src/lundump.h b/3rdparty/lua/src/lundump.h index f3748a9980754..a97676ca18527 100644 --- a/3rdparty/lua/src/lundump.h +++ b/3rdparty/lua/src/lundump.h @@ -21,8 +21,7 @@ /* ** Encode major-minor version in one byte, one nibble for each */ -#define MYINT(s) (s[0]-'0') /* assume one-digit numerals */ -#define LUAC_VERSION (MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR)) +#define LUAC_VERSION (((LUA_VERSION_NUM / 100) * 16) + LUA_VERSION_NUM % 100) #define LUAC_FORMAT 0 /* this is the official format */ diff --git a/3rdparty/lua/src/lutf8lib.c b/3rdparty/lua/src/lutf8lib.c index e7bf098f6d049..3a5b9bc38a5bb 100644 --- a/3rdparty/lua/src/lutf8lib.c +++ b/3rdparty/lua/src/lutf8lib.c @@ -25,6 +25,9 @@ #define MAXUTF 0x7FFFFFFFu + +#define MSGInvalid "invalid UTF-8 code" + /* ** Integer type for decoded UTF-8 values; MAXUTF needs 31 bits. */ @@ -35,7 +38,8 @@ typedef unsigned long utfint; #endif -#define iscont(p) ((*(p) & 0xC0) == 0x80) +#define iscont(c) (((c) & 0xC0) == 0x80) +#define iscontp(p) iscont(*(p)) /* from strlib */ @@ -65,7 +69,7 @@ static const char *utf8_decode (const char *s, utfint *val, int strict) { int count = 0; /* to count number of continuation bytes */ for (; c & 0x40; c <<= 1) { /* while it needs continuation bytes... */ unsigned int cc = (unsigned char)s[++count]; /* read next byte */ - if ((cc & 0xC0) != 0x80) /* not a continuation byte? */ + if (!iscont(cc)) /* not a continuation byte? */ return NULL; /* invalid byte sequence */ res = (res << 6) | (cc & 0x3F); /* add lower 6 bits from cont. byte */ } @@ -140,7 +144,7 @@ static int codepoint (lua_State *L) { utfint code; s = utf8_decode(s, &code, !lax); if (s == NULL) - return luaL_error(L, "invalid UTF-8 code"); + return luaL_error(L, MSGInvalid); lua_pushinteger(L, code); n++; } @@ -190,16 +194,16 @@ static int byteoffset (lua_State *L) { "position out of bounds"); if (n == 0) { /* find beginning of current byte sequence */ - while (posi > 0 && iscont(s + posi)) posi--; + while (posi > 0 && iscontp(s + posi)) posi--; } else { - if (iscont(s + posi)) + if (iscontp(s + posi)) return luaL_error(L, "initial position is a continuation byte"); if (n < 0) { while (n < 0 && posi > 0) { /* move back */ do { /* find beginning of previous character */ posi--; - } while (posi > 0 && iscont(s + posi)); + } while (posi > 0 && iscontp(s + posi)); n++; } } @@ -208,7 +212,7 @@ static int byteoffset (lua_State *L) { while (n > 0 && posi < (lua_Integer)len) { do { /* find beginning of next character */ posi++; - } while (iscont(s + posi)); /* (cannot pass final '\0') */ + } while (iscontp(s + posi)); /* (cannot pass final '\0') */ n--; } } @@ -226,15 +230,15 @@ static int iter_aux (lua_State *L, int strict) { const char *s = luaL_checklstring(L, 1, &len); lua_Unsigned n = (lua_Unsigned)lua_tointeger(L, 2); if (n < len) { - while (iscont(s + n)) n++; /* skip continuation bytes */ + while (iscontp(s + n)) n++; /* go to next character */ } if (n >= len) /* (also handles original 'n' being negative) */ return 0; /* no more codepoints */ else { utfint code; const char *next = utf8_decode(s + n, &code, strict); - if (next == NULL) - return luaL_error(L, "invalid UTF-8 code"); + if (next == NULL || iscontp(next)) + return luaL_error(L, MSGInvalid); lua_pushinteger(L, n + 1); lua_pushinteger(L, code); return 2; @@ -253,7 +257,8 @@ static int iter_auxlax (lua_State *L) { static int iter_codes (lua_State *L) { int lax = lua_toboolean(L, 2); - luaL_checkstring(L, 1); + const char *s = luaL_checkstring(L, 1); + luaL_argcheck(L, !iscontp(s), 1, MSGInvalid); lua_pushcfunction(L, lax ? iter_auxlax : iter_auxstrict); lua_pushvalue(L, 1); lua_pushinteger(L, 0); diff --git a/3rdparty/lua/src/lvm.c b/3rdparty/lua/src/lvm.c index 2ec3440031948..fcd24e11dc87d 100644 --- a/3rdparty/lua/src/lvm.c +++ b/3rdparty/lua/src/lvm.c @@ -91,8 +91,10 @@ static int l_strton (const TValue *obj, TValue *result) { lua_assert(obj != result); if (!cvt2num(obj)) /* is object not a string? */ return 0; - else - return (luaO_str2num(svalue(obj), result) == vslen(obj) + 1); + else { + TString *st = tsvalue(obj); + return (luaO_str2num(getstr(st), result) == tsslen(st) + 1); + } } @@ -366,30 +368,32 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key, /* -** Compare two strings 'ls' x 'rs', returning an integer less-equal- -** -greater than zero if 'ls' is less-equal-greater than 'rs'. +** Compare two strings 'ts1' x 'ts2', returning an integer less-equal- +** -greater than zero if 'ts1' is less-equal-greater than 'ts2'. ** The code is a little tricky because it allows '\0' in the strings -** and it uses 'strcoll' (to respect locales) for each segments -** of the strings. +** and it uses 'strcoll' (to respect locales) for each segment +** of the strings. Note that segments can compare equal but still +** have different lengths. */ -static int l_strcmp (const TString *ls, const TString *rs) { - const char *l = getstr(ls); - size_t ll = tsslen(ls); - const char *r = getstr(rs); - size_t lr = tsslen(rs); +static int l_strcmp (const TString *ts1, const TString *ts2) { + const char *s1 = getstr(ts1); + size_t rl1 = tsslen(ts1); /* real length */ + const char *s2 = getstr(ts2); + size_t rl2 = tsslen(ts2); for (;;) { /* for each segment */ - int temp = strcoll(l, r); + int temp = strcoll(s1, s2); if (temp != 0) /* not equal? */ return temp; /* done */ else { /* strings are equal up to a '\0' */ - size_t len = strlen(l); /* index of first '\0' in both strings */ - if (len == lr) /* 'rs' is finished? */ - return (len == ll) ? 0 : 1; /* check 'ls' */ - else if (len == ll) /* 'ls' is finished? */ - return -1; /* 'ls' is less than 'rs' ('rs' is not finished) */ - /* both strings longer than 'len'; go on comparing after the '\0' */ - len++; - l += len; ll -= len; r += len; lr -= len; + size_t zl1 = strlen(s1); /* index of first '\0' in 's1' */ + size_t zl2 = strlen(s2); /* index of first '\0' in 's2' */ + if (zl2 == rl2) /* 's2' is finished? */ + return (zl1 == rl1) ? 0 : 1; /* check 's1' */ + else if (zl1 == rl1) /* 's1' is finished? */ + return -1; /* 's1' is less than 's2' ('s2' is not finished) */ + /* both strings longer than 'zl'; go on comparing after the '\0' */ + zl1++; zl2++; + s1 += zl1; rl1 -= zl1; s2 += zl2; rl2 -= zl2; } } } @@ -608,8 +612,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { if (tm == NULL) /* no TM? */ return 0; /* objects are different */ else { - luaT_callTMres(L, tm, t1, t2, L->top); /* call TM */ - return !l_isfalse(s2v(L->top)); + luaT_callTMres(L, tm, t1, t2, L->top.p); /* call TM */ + return !l_isfalse(s2v(L->top.p)); } } @@ -624,8 +628,9 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) { static void copy2buff (StkId top, int n, char *buff) { size_t tl = 0; /* size already copied */ do { - size_t l = vslen(s2v(top - n)); /* length of string being copied */ - memcpy(buff + tl, svalue(s2v(top - n)), l * sizeof(char)); + TString *st = tsvalue(s2v(top - n)); + size_t l = tsslen(st); /* length of string being copied */ + memcpy(buff + tl, getstr(st), l * sizeof(char)); tl += l; } while (--n > 0); } @@ -633,17 +638,17 @@ static void copy2buff (StkId top, int n, char *buff) { /* ** Main operation for concatenation: concat 'total' values in the stack, -** from 'L->top - total' up to 'L->top - 1'. +** from 'L->top.p - total' up to 'L->top.p - 1'. */ void luaV_concat (lua_State *L, int total) { if (total == 1) return; /* "all" values already concatenated */ do { - StkId top = L->top; + StkId top = L->top.p; int n = 2; /* number of elements handled in this pass (at least 2) */ if (!(ttisstring(s2v(top - 2)) || cvt2str(s2v(top - 2))) || !tostring(L, s2v(top - 1))) - luaT_tryconcatTM(L); + luaT_tryconcatTM(L); /* may invalidate 'top' */ else if (isemptystr(s2v(top - 1))) /* second operand is empty? */ cast_void(tostring(L, s2v(top - 2))); /* result is first operand */ else if (isemptystr(s2v(top - 2))) { /* first operand is empty string? */ @@ -651,13 +656,15 @@ void luaV_concat (lua_State *L, int total) { } else { /* at least two non-empty string values; get as many as possible */ - size_t tl = vslen(s2v(top - 1)); + size_t tl = tsslen(tsvalue(s2v(top - 1))); TString *ts; /* collect total length and number of strings */ for (n = 1; n < total && tostring(L, s2v(top - n - 1)); n++) { - size_t l = vslen(s2v(top - n - 1)); - if (l_unlikely(l >= (MAX_SIZE/sizeof(char)) - tl)) + size_t l = tsslen(tsvalue(s2v(top - n - 1))); + if (l_unlikely(l >= MAX_SIZE - sizeof(TString) - tl)) { + L->top.p = top - total; /* pop strings to avoid wasting stack */ luaG_runerror(L, "string length overflow"); + } tl += l; } if (tl <= LUAI_MAXSHORTLEN) { /* is result a short string? */ @@ -667,12 +674,12 @@ void luaV_concat (lua_State *L, int total) { } else { /* long string; copy strings directly to final result */ ts = luaS_createlngstrobj(L, tl); - copy2buff(top, n, getstr(ts)); + copy2buff(top, n, getlngstr(ts)); } setsvalue2s(L, top - n, ts); /* create result */ } - total -= n-1; /* got 'n' strings to create 1 new */ - L->top -= n-1; /* popped 'n' strings and pushed one */ + total -= n - 1; /* got 'n' strings to create one new */ + L->top.p -= n - 1; /* popped 'n' strings and pushed one */ } while (total > 1); /* repeat until only 1 result left */ } @@ -763,12 +770,10 @@ lua_Number luaV_modf (lua_State *L, lua_Number m, lua_Number n) { /* number of bits in an integer */ #define NBITS cast_int(sizeof(lua_Integer) * CHAR_BIT) + /* ** Shift left operation. (Shift right just negates 'y'.) */ -#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y)) - - lua_Integer luaV_shiftl (lua_Integer x, lua_Integer y) { if (y < 0) { /* shift right? */ if (y <= -NBITS) return 0; @@ -808,26 +813,26 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, */ void luaV_finishOp (lua_State *L) { CallInfo *ci = L->ci; - StkId base = ci->func + 1; + StkId base = ci->func.p + 1; Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ OpCode op = GET_OPCODE(inst); switch (op) { /* finish its execution */ case OP_MMBIN: case OP_MMBINI: case OP_MMBINK: { - setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top); + setobjs2s(L, base + GETARG_A(*(ci->u.l.savedpc - 2)), --L->top.p); break; } case OP_UNM: case OP_BNOT: case OP_LEN: case OP_GETTABUP: case OP_GETTABLE: case OP_GETI: case OP_GETFIELD: case OP_SELF: { - setobjs2s(L, base + GETARG_A(inst), --L->top); + setobjs2s(L, base + GETARG_A(inst), --L->top.p); break; } case OP_LT: case OP_LE: case OP_LTI: case OP_LEI: case OP_GTI: case OP_GEI: case OP_EQ: { /* note that 'OP_EQI'/'OP_EQK' cannot yield */ - int res = !l_isfalse(s2v(L->top - 1)); - L->top--; + int res = !l_isfalse(s2v(L->top.p - 1)); + L->top.p--; #if defined(LUA_COMPAT_LT_LE) if (ci->callstatus & CIST_LEQ) { /* "<=" using "<" instead? */ ci->callstatus ^= CIST_LEQ; /* clear mark */ @@ -840,11 +845,11 @@ void luaV_finishOp (lua_State *L) { break; } case OP_CONCAT: { - StkId top = L->top - 1; /* top when 'luaT_tryconcatTM' was called */ + StkId top = L->top.p - 1; /* top when 'luaT_tryconcatTM' was called */ int a = GETARG_A(inst); /* first element to concatenate */ int total = cast_int(top - 1 - (base + a)); /* yet to concatenate */ setobjs2s(L, top - 2, top); /* put TM result in proper position */ - L->top = top - 1; /* top is one after last element (at top-2) */ + L->top.p = top - 1; /* top is one after last element (at top-2) */ luaV_concat(L, total); /* concat them (may yield again) */ break; } @@ -856,7 +861,7 @@ void luaV_finishOp (lua_State *L) { StkId ra = base + GETARG_A(inst); /* adjust top to signal correct number of returns, in case the return is "up to top" ('isIT') */ - L->top = ra + ci->u2.nres; + L->top.p = ra + ci->u2.nres; /* repeat instruction to close other vars. and complete the return */ ci->u.l.savedpc--; break; @@ -898,6 +903,7 @@ void luaV_finishOp (lua_State *L) { ** operation, 'fop' is the float operation. */ #define op_arithI(L,iop,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ int imm = GETARG_sC(i); \ if (ttisinteger(v1)) { \ @@ -926,6 +932,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations over floats and others with register operands. */ #define op_arithf(L,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = vRC(i); \ op_arithf_aux(L, v1, v2, fop); } @@ -935,6 +942,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations with K operands for floats. */ #define op_arithfK(L,fop) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = KC(i); lua_assert(ttisnumber(v2)); \ op_arithf_aux(L, v1, v2, fop); } @@ -944,6 +952,7 @@ void luaV_finishOp (lua_State *L) { ** Arithmetic operations over integers and floats. */ #define op_arith_aux(L,v1,v2,iop,fop) { \ + StkId ra = RA(i); \ if (ttisinteger(v1) && ttisinteger(v2)) { \ lua_Integer i1 = ivalue(v1); lua_Integer i2 = ivalue(v2); \ pc++; setivalue(s2v(ra), iop(L, i1, i2)); \ @@ -973,6 +982,7 @@ void luaV_finishOp (lua_State *L) { ** Bitwise operations with constant operand. */ #define op_bitwiseK(L,op) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = KC(i); \ lua_Integer i1; \ @@ -986,6 +996,7 @@ void luaV_finishOp (lua_State *L) { ** Bitwise operations with register operands. */ #define op_bitwise(L,op) { \ + StkId ra = RA(i); \ TValue *v1 = vRB(i); \ TValue *v2 = vRC(i); \ lua_Integer i1; lua_Integer i2; \ @@ -1000,18 +1011,19 @@ void luaV_finishOp (lua_State *L) { ** integers. */ #define op_order(L,opi,opn,other) { \ - int cond; \ - TValue *rb = vRB(i); \ - if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \ - lua_Integer ia = ivalue(s2v(ra)); \ - lua_Integer ib = ivalue(rb); \ - cond = opi(ia, ib); \ - } \ - else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \ - cond = opn(s2v(ra), rb); \ - else \ - Protect(cond = other(L, s2v(ra), rb)); \ - docondjump(); } + StkId ra = RA(i); \ + int cond; \ + TValue *rb = vRB(i); \ + if (ttisinteger(s2v(ra)) && ttisinteger(rb)) { \ + lua_Integer ia = ivalue(s2v(ra)); \ + lua_Integer ib = ivalue(rb); \ + cond = opi(ia, ib); \ + } \ + else if (ttisnumber(s2v(ra)) && ttisnumber(rb)) \ + cond = opn(s2v(ra), rb); \ + else \ + Protect(cond = other(L, s2v(ra), rb)); \ + docondjump(); } /* @@ -1019,20 +1031,21 @@ void luaV_finishOp (lua_State *L) { ** always small enough to have an exact representation as a float.) */ #define op_orderI(L,opi,opf,inv,tm) { \ - int cond; \ - int im = GETARG_sB(i); \ - if (ttisinteger(s2v(ra))) \ - cond = opi(ivalue(s2v(ra)), im); \ - else if (ttisfloat(s2v(ra))) { \ - lua_Number fa = fltvalue(s2v(ra)); \ - lua_Number fim = cast_num(im); \ - cond = opf(fa, fim); \ - } \ - else { \ - int isf = GETARG_C(i); \ - Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \ - } \ - docondjump(); } + StkId ra = RA(i); \ + int cond; \ + int im = GETARG_sB(i); \ + if (ttisinteger(s2v(ra))) \ + cond = opi(ivalue(s2v(ra)), im); \ + else if (ttisfloat(s2v(ra))) { \ + lua_Number fa = fltvalue(s2v(ra)); \ + lua_Number fim = cast_num(im); \ + cond = opf(fa, fim); \ + } \ + else { \ + int isf = GETARG_C(i); \ + Protect(cond = luaT_callorderiTM(L, s2v(ra), im, inv, isf, tm)); \ + } \ + docondjump(); } /* }================================================================== */ @@ -1061,7 +1074,7 @@ void luaV_finishOp (lua_State *L) { #define updatetrap(ci) (trap = ci->u.l.trap) -#define updatebase(ci) (base = ci->func + 1) +#define updatebase(ci) (base = ci->func.p + 1) #define updatestack(ci) \ @@ -1096,7 +1109,7 @@ void luaV_finishOp (lua_State *L) { ** Whenever code can raise errors, the global 'pc' and the global ** 'top' must be correct to report occasional errors. */ -#define savestate(L,ci) (savepc(L), L->top = ci->top) +#define savestate(L,ci) (savepc(L), L->top.p = ci->top.p) /* @@ -1116,7 +1129,7 @@ void luaV_finishOp (lua_State *L) { /* 'c' is the limit of live values in the stack */ #define checkGC(L,c) \ - { luaC_condGC(L, (savepc(L), L->top = (c)), \ + { luaC_condGC(L, (savepc(L), L->top.p = (c)), \ updatetrap(ci)); \ luai_threadyield(L); } @@ -1128,7 +1141,6 @@ void luaV_finishOp (lua_State *L) { updatebase(ci); /* correct stack */ \ } \ i = *(pc++); \ - ra = RA(i); /* WARNING: any stack reallocation invalidates 'ra' */ \ } #define vmdispatch(o) switch(o) @@ -1148,72 +1160,73 @@ void luaV_execute (lua_State *L, CallInfo *ci) { startfunc: trap = L->hookmask; returning: /* trap already set */ - cl = clLvalue(s2v(ci->func)); + cl = ci_func(ci); k = cl->p->k; pc = ci->u.l.savedpc; - if (l_unlikely(trap)) { - if (pc == cl->p->code) { /* first instruction (not resuming)? */ - if (cl->p->is_vararg) - trap = 0; /* hooks will start after VARARGPREP instruction */ - else /* check 'call' hook */ - luaD_hookcall(L, ci); - } - ci->u.l.trap = 1; /* assume trap is on, for now */ - } - base = ci->func + 1; + if (l_unlikely(trap)) + trap = luaG_tracecall(L); + base = ci->func.p + 1; /* main loop of interpreter */ for (;;) { Instruction i; /* instruction being executed */ - StkId ra; /* instruction's A register */ vmfetch(); #if 0 /* low-level line tracing for debugging Lua */ printf("line: %d\n", luaG_getfuncline(cl->p, pcRel(pc, cl->p))); #endif - lua_assert(base == ci->func + 1); - lua_assert(base <= L->top && L->top < L->stack_last); + lua_assert(base == ci->func.p + 1); + lua_assert(base <= L->top.p && L->top.p <= L->stack_last.p); /* invalidate top for instructions not expecting it */ - lua_assert(isIT(i) || (cast_void(L->top = base), 1)); + lua_assert(isIT(i) || (cast_void(L->top.p = base), 1)); vmdispatch (GET_OPCODE(i)) { vmcase(OP_MOVE) { + StkId ra = RA(i); setobjs2s(L, ra, RB(i)); vmbreak; } vmcase(OP_LOADI) { + StkId ra = RA(i); lua_Integer b = GETARG_sBx(i); setivalue(s2v(ra), b); vmbreak; } vmcase(OP_LOADF) { + StkId ra = RA(i); int b = GETARG_sBx(i); setfltvalue(s2v(ra), cast_num(b)); vmbreak; } vmcase(OP_LOADK) { + StkId ra = RA(i); TValue *rb = k + GETARG_Bx(i); setobj2s(L, ra, rb); vmbreak; } vmcase(OP_LOADKX) { + StkId ra = RA(i); TValue *rb; rb = k + GETARG_Ax(*pc); pc++; setobj2s(L, ra, rb); vmbreak; } vmcase(OP_LOADFALSE) { + StkId ra = RA(i); setbfvalue(s2v(ra)); vmbreak; } vmcase(OP_LFALSESKIP) { + StkId ra = RA(i); setbfvalue(s2v(ra)); pc++; /* skip next instruction */ vmbreak; } vmcase(OP_LOADTRUE) { + StkId ra = RA(i); setbtvalue(s2v(ra)); vmbreak; } vmcase(OP_LOADNIL) { + StkId ra = RA(i); int b = GETARG_B(i); do { setnilvalue(s2v(ra++)); @@ -1221,21 +1234,24 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETUPVAL) { + StkId ra = RA(i); int b = GETARG_B(i); - setobj2s(L, ra, cl->upvals[b]->v); + setobj2s(L, ra, cl->upvals[b]->v.p); vmbreak; } vmcase(OP_SETUPVAL) { + StkId ra = RA(i); UpVal *uv = cl->upvals[GETARG_B(i)]; - setobj(L, uv->v, s2v(ra)); + setobj(L, uv->v.p, s2v(ra)); luaC_barrier(L, uv, s2v(ra)); vmbreak; } vmcase(OP_GETTABUP) { + StkId ra = RA(i); const TValue *slot; - TValue *upval = cl->upvals[GETARG_B(i)]->v; + TValue *upval = cl->upvals[GETARG_B(i)]->v.p; TValue *rc = KC(i); - TString *key = tsvalue(rc); /* key must be a string */ + TString *key = tsvalue(rc); /* key must be a short string */ if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { setobj2s(L, ra, slot); } @@ -1244,6 +1260,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETTABLE) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = vRC(i); @@ -1258,6 +1275,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETI) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); int c = GETARG_C(i); @@ -1272,10 +1290,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_GETFIELD) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = KC(i); - TString *key = tsvalue(rc); /* key must be a string */ + TString *key = tsvalue(rc); /* key must be a short string */ if (luaV_fastget(L, rb, key, slot, luaH_getshortstr)) { setobj2s(L, ra, slot); } @@ -1285,10 +1304,10 @@ void luaV_execute (lua_State *L, CallInfo *ci) { } vmcase(OP_SETTABUP) { const TValue *slot; - TValue *upval = cl->upvals[GETARG_A(i)]->v; + TValue *upval = cl->upvals[GETARG_A(i)]->v.p; TValue *rb = KB(i); TValue *rc = RKC(i); - TString *key = tsvalue(rb); /* key must be a string */ + TString *key = tsvalue(rb); /* key must be a short string */ if (luaV_fastget(L, upval, key, slot, luaH_getshortstr)) { luaV_finishfastset(L, upval, slot, rc); } @@ -1297,6 +1316,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETTABLE) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); /* key (table is in 'ra') */ TValue *rc = RKC(i); /* value */ @@ -1311,6 +1331,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETI) { + StkId ra = RA(i); const TValue *slot; int c = GETARG_B(i); TValue *rc = RKC(i); @@ -1325,10 +1346,11 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SETFIELD) { + StkId ra = RA(i); const TValue *slot; TValue *rb = KB(i); TValue *rc = RKC(i); - TString *key = tsvalue(rb); /* key must be a string */ + TString *key = tsvalue(rb); /* key must be a short string */ if (luaV_fastget(L, s2v(ra), key, slot, luaH_getshortstr)) { luaV_finishfastset(L, s2v(ra), slot, rc); } @@ -1337,6 +1359,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_NEWTABLE) { + StkId ra = RA(i); int b = GETARG_B(i); /* log2(hash size) + 1 */ int c = GETARG_C(i); /* array size */ Table *t; @@ -1346,7 +1369,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { if (TESTARG_k(i)) /* non-zero extra argument? */ c += GETARG_Ax(*pc) * (MAXARG_C + 1); /* add it to size */ pc++; /* skip extra argument */ - L->top = ra + 1; /* correct top in case of emergency GC */ + L->top.p = ra + 1; /* correct top in case of emergency GC */ t = luaH_new(L); /* memory allocation */ sethvalue2s(L, ra, t); if (b != 0 || c != 0) @@ -1355,6 +1378,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SELF) { + StkId ra = RA(i); const TValue *slot; TValue *rb = vRB(i); TValue *rc = RKC(i); @@ -1384,6 +1408,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MODK) { + savestate(L, ci); /* in case of division by 0 */ op_arithK(L, luaV_mod, luaV_modf); vmbreak; } @@ -1396,6 +1421,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_IDIVK) { + savestate(L, ci); /* in case of division by 0 */ op_arithK(L, luaV_idiv, luai_numidiv); vmbreak; } @@ -1412,6 +1438,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SHRI) { + StkId ra = RA(i); TValue *rb = vRB(i); int ic = GETARG_sC(i); lua_Integer ib; @@ -1421,6 +1448,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_SHLI) { + StkId ra = RA(i); TValue *rb = vRB(i); int ic = GETARG_sC(i); lua_Integer ib; @@ -1442,6 +1470,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MOD) { + savestate(L, ci); /* in case of division by 0 */ op_arith(L, luaV_mod, luaV_modf); vmbreak; } @@ -1454,6 +1483,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_IDIV) { /* floor division */ + savestate(L, ci); /* in case of division by 0 */ op_arith(L, luaV_idiv, luai_numidiv); vmbreak; } @@ -1478,6 +1508,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBIN) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ TValue *rb = vRB(i); TMS tm = (TMS)GETARG_C(i); @@ -1487,6 +1518,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBINI) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ int imm = GETARG_sB(i); TMS tm = (TMS)GETARG_C(i); @@ -1496,6 +1528,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_MMBINK) { + StkId ra = RA(i); Instruction pi = *(pc - 2); /* original arith. expression */ TValue *imm = KB(i); TMS tm = (TMS)GETARG_C(i); @@ -1505,6 +1538,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_UNM) { + StkId ra = RA(i); TValue *rb = vRB(i); lua_Number nb; if (ttisinteger(rb)) { @@ -1519,6 +1553,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_BNOT) { + StkId ra = RA(i); TValue *rb = vRB(i); lua_Integer ib; if (tointegerns(rb, &ib)) { @@ -1529,6 +1564,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_NOT) { + StkId ra = RA(i); TValue *rb = vRB(i); if (l_isfalse(rb)) setbtvalue(s2v(ra)); @@ -1537,21 +1573,25 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_LEN) { + StkId ra = RA(i); Protect(luaV_objlen(L, ra, vRB(i))); vmbreak; } vmcase(OP_CONCAT) { + StkId ra = RA(i); int n = GETARG_B(i); /* number of elements to concatenate */ - L->top = ra + n; /* mark the end of concat operands */ + L->top.p = ra + n; /* mark the end of concat operands */ ProtectNT(luaV_concat(L, n)); - checkGC(L, L->top); /* 'luaV_concat' ensures correct top */ + checkGC(L, L->top.p); /* 'luaV_concat' ensures correct top */ vmbreak; } vmcase(OP_CLOSE) { + StkId ra = RA(i); Protect(luaF_close(L, ra, LUA_OK, 1)); vmbreak; } vmcase(OP_TBC) { + StkId ra = RA(i); /* create new to-be-closed upvalue */ halfProtect(luaF_newtbcupval(L, ra)); vmbreak; @@ -1561,6 +1601,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQ) { + StkId ra = RA(i); int cond; TValue *rb = vRB(i); Protect(cond = luaV_equalobj(L, s2v(ra), rb)); @@ -1576,6 +1617,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQK) { + StkId ra = RA(i); TValue *rb = KB(i); /* basic types do not use '__eq'; we can use raw equality */ int cond = luaV_rawequalobj(s2v(ra), rb); @@ -1583,6 +1625,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_EQI) { + StkId ra = RA(i); int cond; int im = GETARG_sB(i); if (ttisinteger(s2v(ra))) @@ -1611,11 +1654,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_TEST) { + StkId ra = RA(i); int cond = !l_isfalse(s2v(ra)); docondjump(); vmbreak; } vmcase(OP_TESTSET) { + StkId ra = RA(i); TValue *rb = vRB(i); if (l_isfalse(rb) == GETARG_k(i)) pc++; @@ -1626,11 +1671,12 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_CALL) { + StkId ra = RA(i); CallInfo *newci; int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) /* fixed number of arguments? */ - L->top = ra + b; /* top signals number of arguments */ + L->top.p = ra + b; /* top signals number of arguments */ /* else previous instruction set top */ savepc(L); /* in case of errors */ if ((newci = luaD_precall(L, ra, nresults)) == NULL) @@ -1642,54 +1688,57 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_TAILCALL) { + StkId ra = RA(i); int b = GETARG_B(i); /* number of arguments + 1 (function) */ int n; /* number of results when calling a C function */ int nparams1 = GETARG_C(i); /* delta is virtual 'func' - real 'func' (vararg functions) */ int delta = (nparams1) ? ci->u.l.nextraargs + nparams1 : 0; if (b != 0) - L->top = ra + b; + L->top.p = ra + b; else /* previous instruction set top */ - b = cast_int(L->top - ra); + b = cast_int(L->top.p - ra); savepc(ci); /* several calls here can raise errors */ if (TESTARG_k(i)) { luaF_closeupval(L, base); /* close upvalues from current call */ - lua_assert(L->tbclist < base); /* no pending tbc variables */ - lua_assert(base == ci->func + 1); + lua_assert(L->tbclist.p < base); /* no pending tbc variables */ + lua_assert(base == ci->func.p + 1); } if ((n = luaD_pretailcall(L, ci, ra, b, delta)) < 0) /* Lua function? */ goto startfunc; /* execute the callee */ else { /* C function? */ - ci->func -= delta; /* restore 'func' (if vararg) */ + ci->func.p -= delta; /* restore 'func' (if vararg) */ luaD_poscall(L, ci, n); /* finish caller */ updatetrap(ci); /* 'luaD_poscall' can change hooks */ goto ret; /* caller returns after the tail call */ } } vmcase(OP_RETURN) { + StkId ra = RA(i); int n = GETARG_B(i) - 1; /* number of results */ int nparams1 = GETARG_C(i); if (n < 0) /* not fixed? */ - n = cast_int(L->top - ra); /* get what is available */ + n = cast_int(L->top.p - ra); /* get what is available */ savepc(ci); if (TESTARG_k(i)) { /* may there be open upvalues? */ ci->u2.nres = n; /* save number of returns */ - if (L->top < ci->top) - L->top = ci->top; + if (L->top.p < ci->top.p) + L->top.p = ci->top.p; luaF_close(L, base, CLOSEKTOP, 1); updatetrap(ci); updatestack(ci); } if (nparams1) /* vararg function? */ - ci->func -= ci->u.l.nextraargs + nparams1; - L->top = ra + n; /* set call for 'luaD_poscall' */ + ci->func.p -= ci->u.l.nextraargs + nparams1; + L->top.p = ra + n; /* set call for 'luaD_poscall' */ luaD_poscall(L, ci, n); updatetrap(ci); /* 'luaD_poscall' can change hooks */ goto ret; } vmcase(OP_RETURN0) { if (l_unlikely(L->hookmask)) { - L->top = ra; + StkId ra = RA(i); + L->top.p = ra; savepc(ci); luaD_poscall(L, ci, 0); /* no hurry... */ trap = 1; @@ -1697,15 +1746,16 @@ void luaV_execute (lua_State *L, CallInfo *ci) { else { /* do the 'poscall' here */ int nres; L->ci = ci->previous; /* back to caller */ - L->top = base - 1; + L->top.p = base - 1; for (nres = ci->nresults; l_unlikely(nres > 0); nres--) - setnilvalue(s2v(L->top++)); /* all results are nil */ + setnilvalue(s2v(L->top.p++)); /* all results are nil */ } goto ret; } vmcase(OP_RETURN1) { if (l_unlikely(L->hookmask)) { - L->top = ra + 1; + StkId ra = RA(i); + L->top.p = ra + 1; savepc(ci); luaD_poscall(L, ci, 1); /* no hurry... */ trap = 1; @@ -1714,12 +1764,13 @@ void luaV_execute (lua_State *L, CallInfo *ci) { int nres = ci->nresults; L->ci = ci->previous; /* back to caller */ if (nres == 0) - L->top = base - 1; /* asked for no results */ + L->top.p = base - 1; /* asked for no results */ else { + StkId ra = RA(i); setobjs2s(L, base - 1, ra); /* at least this result */ - L->top = base; + L->top.p = base; for (; l_unlikely(nres > 1); nres--) - setnilvalue(s2v(L->top++)); /* complete missing results */ + setnilvalue(s2v(L->top.p++)); /* complete missing results */ } } ret: /* return from a Lua function */ @@ -1731,6 +1782,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { } } vmcase(OP_FORLOOP) { + StkId ra = RA(i); if (ttisinteger(s2v(ra + 2))) { /* integer loop? */ lua_Unsigned count = l_castS2U(ivalue(s2v(ra + 1))); if (count > 0) { /* still more iterations? */ @@ -1749,12 +1801,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_FORPREP) { + StkId ra = RA(i); savestate(L, ci); /* in case of errors */ if (forprep(L, ra)) pc += GETARG_Bx(i) + 1; /* skip the loop */ vmbreak; } vmcase(OP_TFORPREP) { + StkId ra = RA(i); /* create to-be-closed upvalue (if needed) */ halfProtect(luaF_newtbcupval(L, ra + 3)); pc += GETARG_Bx(i); @@ -1763,7 +1817,8 @@ void luaV_execute (lua_State *L, CallInfo *ci) { goto l_tforcall; } vmcase(OP_TFORCALL) { - l_tforcall: + l_tforcall: { + StkId ra = RA(i); /* 'ra' has the iterator function, 'ra + 1' has the state, 'ra + 2' has the control variable, and 'ra + 3' has the to-be-closed variable. The call will use the stack after @@ -1771,29 +1826,31 @@ void luaV_execute (lua_State *L, CallInfo *ci) { */ /* push function, state, and control variable */ memcpy(ra + 4, ra, 3 * sizeof(*ra)); - L->top = ra + 4 + 3; + L->top.p = ra + 4 + 3; ProtectNT(luaD_call(L, ra + 4, GETARG_C(i))); /* do the call */ updatestack(ci); /* stack may have changed */ i = *(pc++); /* go to next instruction */ lua_assert(GET_OPCODE(i) == OP_TFORLOOP && ra == RA(i)); goto l_tforloop; - } + }} vmcase(OP_TFORLOOP) { - l_tforloop: + l_tforloop: { + StkId ra = RA(i); if (!ttisnil(s2v(ra + 4))) { /* continue loop? */ setobjs2s(L, ra + 2, ra + 4); /* save control variable */ pc -= GETARG_Bx(i); /* jump back */ } vmbreak; - } + }} vmcase(OP_SETLIST) { + StkId ra = RA(i); int n = GETARG_B(i); unsigned int last = GETARG_C(i); Table *h = hvalue(s2v(ra)); if (n == 0) - n = cast_int(L->top - ra) - 1; /* get up to the top */ + n = cast_int(L->top.p - ra) - 1; /* get up to the top */ else - L->top = ci->top; /* correct top in case of emergency GC */ + L->top.p = ci->top.p; /* correct top in case of emergency GC */ last += n; if (TESTARG_k(i)) { last += GETARG_Ax(*pc) * (MAXARG_C + 1); @@ -1810,12 +1867,14 @@ void luaV_execute (lua_State *L, CallInfo *ci) { vmbreak; } vmcase(OP_CLOSURE) { + StkId ra = RA(i); Proto *p = cl->p->p[GETARG_Bx(i)]; halfProtect(pushclosure(L, p, cl->upvals, base, ra)); checkGC(L, ra + 1); vmbreak; } vmcase(OP_VARARG) { + StkId ra = RA(i); int n = GETARG_C(i) - 1; /* required results */ Protect(luaT_getvarargs(L, ci, ra, n)); vmbreak; diff --git a/3rdparty/lua/src/lvm.h b/3rdparty/lua/src/lvm.h index 1bc16f3a50ba4..dba1ad277025e 100644 --- a/3rdparty/lua/src/lvm.h +++ b/3rdparty/lua/src/lvm.h @@ -110,6 +110,11 @@ typedef enum { luaC_barrierback(L, gcvalue(t), v); } +/* +** Shift right is the same as shift left with a negative 'y' +*/ +#define luaV_shiftr(x,y) luaV_shiftl(x,intop(-, 0, y)) + LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); diff --git a/COPYING b/COPYING index 373663ecab22f..686e518ea9497 100644 --- a/COPYING +++ b/COPYING @@ -164,7 +164,7 @@ Clark Cooper Copyright (c) 2001-2019 Expat maintainers Lua - a powerful, fast, lightweight, embeddable scripting language -Copyright (c) 1994-2017 Lua.org, PUC-Rio +Copyright (c) 1994-2024 Lua.org, PUC-Rio LuaFileSystem - File System Library for Lua Copyright (c) 2003-2015 Kepler Project From 288839a39514c5fa8d105655fa7c11bd6ca0de03 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 12 Mar 2025 17:23:33 +1100 Subject: [PATCH 148/272] 3rdparty/expat: Updated to expat 2.6.4. --- 3rdparty/expat/CMake.README | 14 +- 3rdparty/expat/CMakeLists.txt | 567 +- 3rdparty/expat/COPYING | 2 +- 3rdparty/expat/Changes | 744 +- 3rdparty/expat/ConfigureChecks.cmake | 24 +- 3rdparty/expat/Makefile.am | 41 +- 3rdparty/expat/Makefile.in | 162 +- 3rdparty/expat/README.md | 161 +- 3rdparty/expat/acinclude.m4 | 2 + 3rdparty/expat/aclocal.m4 | 113 +- 3rdparty/expat/buildconf.sh | 35 + .../autotools/expat-config-version.cmake.in | 65 + .../autotools/expat-noconfig__linux.cmake.in | 19 + .../autotools/expat-noconfig__macos.cmake.in | 19 + .../expat-noconfig__windows.cmake.in | 19 + .../cmake/autotools/expat-package-init.cmake | 25 + 3rdparty/expat/cmake/autotools/expat.cmake | 107 + 3rdparty/expat/cmake/mingw-toolchain.cmake | 1 + 3rdparty/expat/configure | 9754 +++++++------ 3rdparty/expat/configure.ac | 196 +- 3rdparty/expat/conftools/PrintPath | 116 - 3rdparty/expat/conftools/ar-lib | 2 +- .../conftools/ax-cxx-compile-stdcxx-11.m4 | 39 + .../expat/conftools/ax-cxx-compile-stdcxx.m4 | 1018 ++ 3rdparty/expat/conftools/compile | 2 +- 3rdparty/expat/conftools/config.guess | 1209 +- 3rdparty/expat/conftools/config.sub | 655 +- 3rdparty/expat/conftools/depcomp | 2 +- 3rdparty/expat/conftools/get-version.sh | 30 +- 3rdparty/expat/conftools/install-sh | 148 +- 3rdparty/expat/conftools/ltmain.sh | 1347 +- 3rdparty/expat/conftools/missing | 2 +- 3rdparty/expat/conftools/test-driver | 19 +- 3rdparty/expat/doc/Makefile.am | 26 +- 3rdparty/expat/doc/Makefile.in | 96 +- 3rdparty/expat/doc/expat.png | Bin 920 -> 0 bytes 3rdparty/expat/doc/ok.min.css | 2 + 3rdparty/expat/doc/reference.html | 631 +- 3rdparty/expat/doc/style.css | 134 +- 3rdparty/expat/doc/valid-xhtml10.png | Bin 1981 -> 0 bytes 3rdparty/expat/doc/xmlwf.1 | 135 +- 3rdparty/expat/doc/xmlwf.xml | 223 +- 3rdparty/expat/examples/Makefile.am | 8 +- 3rdparty/expat/examples/Makefile.in | 74 +- .../expat/examples/element_declarations.c | 235 + 3rdparty/expat/examples/elements.c | 52 +- 3rdparty/expat/examples/outline.c | 83 +- 3rdparty/expat/expat.pc.cmake | 13 + 3rdparty/expat/expat.pc.in | 8 +- 3rdparty/expat/expat_config.h.cmake | 19 +- 3rdparty/expat/expat_config.h.in | 24 +- 3rdparty/expat/fix-xmltest-log.sh | 16 +- 3rdparty/expat/fuzz/xml_parse_fuzzer.c | 105 + 3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c | 117 + 3rdparty/expat/lib/Makefile.am | 17 +- 3rdparty/expat/lib/Makefile.in | 139 +- 3rdparty/expat/lib/ascii.h | 7 +- 3rdparty/expat/lib/asciitab.h | 4 +- 3rdparty/expat/lib/expat.h | 77 +- 3rdparty/expat/lib/expat_external.h | 9 +- 3rdparty/expat/lib/iasciitab.h | 4 +- 3rdparty/expat/lib/internal.h | 71 +- 3rdparty/expat/lib/latin1tab.h | 4 +- 3rdparty/expat/lib/libexpat.def | 78 - .../lib/{libexpatw.def => libexpat.def.cmake} | 11 +- 3rdparty/expat/lib/nametab.h | 4 +- 3rdparty/expat/lib/siphash.h | 26 +- 3rdparty/expat/lib/utf8tab.h | 4 +- 3rdparty/expat/lib/winconfig.h | 24 +- 3rdparty/expat/lib/xmlparse.c | 2331 +++- 3rdparty/expat/lib/xmlrole.c | 18 +- 3rdparty/expat/lib/xmlrole.h | 9 +- 3rdparty/expat/lib/xmltok.c | 78 +- 3rdparty/expat/lib/xmltok.h | 12 +- 3rdparty/expat/lib/xmltok_impl.c | 38 +- 3rdparty/expat/lib/xmltok_impl.h | 5 +- 3rdparty/expat/lib/xmltok_ns.c | 8 +- 3rdparty/expat/m4/libtool.m4 | 527 +- 3rdparty/expat/m4/ltoptions.m4 | 108 +- 3rdparty/expat/m4/ltsugar.m4 | 2 +- 3rdparty/expat/m4/ltversion.m4 | 13 +- 3rdparty/expat/m4/lt~obsolete.m4 | 4 +- 3rdparty/expat/run.sh.in | 41 +- 3rdparty/expat/test-driver-wrapper.sh | 3 +- 3rdparty/expat/tests/Makefile.am | 65 +- 3rdparty/expat/tests/Makefile.in | 302 +- 3rdparty/expat/tests/README.md | 11 + 3rdparty/expat/tests/README.txt | 13 - 3rdparty/expat/tests/acc_tests.c | 455 + 3rdparty/expat/tests/acc_tests.h | 56 + 3rdparty/expat/tests/acc_tests_cxx.cpp | 32 + 3rdparty/expat/tests/alloc_tests.c | 2127 +++ 3rdparty/expat/tests/alloc_tests.h | 56 + 3rdparty/expat/tests/alloc_tests_cxx.cpp | 32 + 3rdparty/expat/tests/basic_tests.c | 6159 ++++++++ 3rdparty/expat/tests/basic_tests.h | 56 + 3rdparty/expat/tests/basic_tests_cxx.cpp | 32 + 3rdparty/expat/tests/benchmark/Makefile.am | 3 +- 3rdparty/expat/tests/benchmark/Makefile.in | 40 +- 3rdparty/expat/tests/benchmark/benchmark.c | 18 +- 3rdparty/expat/tests/chardata.c | 22 +- 3rdparty/expat/tests/chardata.h | 5 +- 3rdparty/expat/tests/chardata_cxx.cpp | 32 + 3rdparty/expat/tests/common.c | 296 + 3rdparty/expat/tests/common.h | 153 + 3rdparty/expat/tests/common_cxx.cpp | 32 + 3rdparty/expat/tests/dummy.c | 261 + 3rdparty/expat/tests/dummy.h | 150 + 3rdparty/expat/tests/dummy_cxx.cpp | 32 + 3rdparty/expat/tests/handlers.c | 1956 +++ 3rdparty/expat/tests/handlers.h | 606 + 3rdparty/expat/tests/handlers_cxx.cpp | 32 + 3rdparty/expat/tests/memcheck.c | 21 +- 3rdparty/expat/tests/memcheck.h | 4 +- 3rdparty/expat/tests/memcheck_cxx.cpp | 32 + 3rdparty/expat/tests/minicheck.c | 80 +- 3rdparty/expat/tests/minicheck.h | 82 +- 3rdparty/expat/tests/minicheck_cxx.cpp | 32 + 3rdparty/expat/tests/misc_tests.c | 548 + 3rdparty/expat/tests/misc_tests.h | 56 + 3rdparty/expat/tests/misc_tests_cxx.cpp | 32 + 3rdparty/expat/tests/ns_tests.c | 754 + 3rdparty/expat/tests/ns_tests.h | 56 + 3rdparty/expat/tests/ns_tests_cxx.cpp | 32 + 3rdparty/expat/tests/nsalloc_tests.c | 1537 ++ 3rdparty/expat/tests/nsalloc_tests.h | 56 + 3rdparty/expat/tests/nsalloc_tests_cxx.cpp | 32 + 3rdparty/expat/tests/runtests.c | 11615 +--------------- .../{runtestspp.cpp => runtests_cxx.cpp} | 4 +- 3rdparty/expat/tests/structdata.c | 41 +- 3rdparty/expat/tests/structdata.h | 3 +- 3rdparty/expat/tests/structdata_cxx.cpp | 32 + 3rdparty/expat/tests/udiffer.py | 3 +- 3rdparty/expat/tests/xmltest.sh | 43 +- 3rdparty/expat/win32/README.txt | 4 +- 3rdparty/expat/win32/build_expat_iss.bat | 12 +- 3rdparty/expat/win32/expat.iss | 57 +- 3rdparty/expat/win32/version.rc.cmake | 17 + 3rdparty/expat/xmlwf/Makefile.am | 4 +- 3rdparty/expat/xmlwf/Makefile.in | 41 +- 3rdparty/expat/xmlwf/codepage.c | 6 +- 3rdparty/expat/xmlwf/codepage.h | 4 +- 3rdparty/expat/xmlwf/ct.c | 3 +- 3rdparty/expat/xmlwf/filemap.h | 4 +- 3rdparty/expat/xmlwf/readfilemap.c | 28 +- 3rdparty/expat/xmlwf/unixfilemap.c | 6 +- 3rdparty/expat/xmlwf/win32filemap.c | 7 +- 3rdparty/expat/xmlwf/xmlfile.c | 29 +- 3rdparty/expat/xmlwf/xmlfile.h | 7 +- 3rdparty/expat/xmlwf/xmlmime.c | 4 +- 3rdparty/expat/xmlwf/xmlmime.h | 3 +- 3rdparty/expat/xmlwf/xmltchar.h | 7 +- 3rdparty/expat/xmlwf/xmlwf.c | 293 +- 3rdparty/expat/xmlwf/xmlwf_helpgen.py | 41 +- 3rdparty/expat/xmlwf/xmlwf_helpgen.sh | 5 +- COPYING | 2 +- scripts/src/3rdparty.lua | 10 +- 157 files changed, 31942 insertions(+), 19117 deletions(-) create mode 100755 3rdparty/expat/buildconf.sh create mode 100644 3rdparty/expat/cmake/autotools/expat-config-version.cmake.in create mode 100644 3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in create mode 100644 3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in create mode 100644 3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in create mode 100644 3rdparty/expat/cmake/autotools/expat-package-init.cmake create mode 100644 3rdparty/expat/cmake/autotools/expat.cmake delete mode 100755 3rdparty/expat/conftools/PrintPath create mode 100644 3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 create mode 100644 3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 mode change 100644 => 100755 3rdparty/expat/conftools/ltmain.sh delete mode 100644 3rdparty/expat/doc/expat.png create mode 100644 3rdparty/expat/doc/ok.min.css delete mode 100644 3rdparty/expat/doc/valid-xhtml10.png create mode 100644 3rdparty/expat/examples/element_declarations.c create mode 100644 3rdparty/expat/expat.pc.cmake create mode 100644 3rdparty/expat/fuzz/xml_parse_fuzzer.c create mode 100644 3rdparty/expat/fuzz/xml_parsebuffer_fuzzer.c delete mode 100644 3rdparty/expat/lib/libexpat.def rename 3rdparty/expat/lib/{libexpatw.def => libexpat.def.cmake} (85%) create mode 100644 3rdparty/expat/tests/README.md delete mode 100644 3rdparty/expat/tests/README.txt create mode 100644 3rdparty/expat/tests/acc_tests.c create mode 100644 3rdparty/expat/tests/acc_tests.h create mode 100644 3rdparty/expat/tests/acc_tests_cxx.cpp create mode 100644 3rdparty/expat/tests/alloc_tests.c create mode 100644 3rdparty/expat/tests/alloc_tests.h create mode 100644 3rdparty/expat/tests/alloc_tests_cxx.cpp create mode 100644 3rdparty/expat/tests/basic_tests.c create mode 100644 3rdparty/expat/tests/basic_tests.h create mode 100644 3rdparty/expat/tests/basic_tests_cxx.cpp create mode 100644 3rdparty/expat/tests/chardata_cxx.cpp create mode 100644 3rdparty/expat/tests/common.c create mode 100644 3rdparty/expat/tests/common.h create mode 100644 3rdparty/expat/tests/common_cxx.cpp create mode 100644 3rdparty/expat/tests/dummy.c create mode 100644 3rdparty/expat/tests/dummy.h create mode 100644 3rdparty/expat/tests/dummy_cxx.cpp create mode 100644 3rdparty/expat/tests/handlers.c create mode 100644 3rdparty/expat/tests/handlers.h create mode 100644 3rdparty/expat/tests/handlers_cxx.cpp create mode 100644 3rdparty/expat/tests/memcheck_cxx.cpp create mode 100644 3rdparty/expat/tests/minicheck_cxx.cpp create mode 100644 3rdparty/expat/tests/misc_tests.c create mode 100644 3rdparty/expat/tests/misc_tests.h create mode 100644 3rdparty/expat/tests/misc_tests_cxx.cpp create mode 100644 3rdparty/expat/tests/ns_tests.c create mode 100644 3rdparty/expat/tests/ns_tests.h create mode 100644 3rdparty/expat/tests/ns_tests_cxx.cpp create mode 100644 3rdparty/expat/tests/nsalloc_tests.c create mode 100644 3rdparty/expat/tests/nsalloc_tests.h create mode 100644 3rdparty/expat/tests/nsalloc_tests_cxx.cpp rename 3rdparty/expat/tests/{runtestspp.cpp => runtests_cxx.cpp} (91%) create mode 100644 3rdparty/expat/tests/structdata_cxx.cpp create mode 100644 3rdparty/expat/win32/version.rc.cmake diff --git a/3rdparty/expat/CMake.README b/3rdparty/expat/CMake.README index aa098b4f94299..86e1eb98918b7 100644 --- a/3rdparty/expat/CMake.README +++ b/3rdparty/expat/CMake.README @@ -3,25 +3,25 @@ The cmake based buildsystem for expat works on Windows (cygwin, mingw, Visual Studio) and should work on all other platform cmake supports. -Assuming ~/expat-2.2.10 is the source directory of expat, add a subdirectory +Assuming ~/expat-2.6.4 is the source directory of expat, add a subdirectory build and change into that directory: -~/expat-2.2.10$ mkdir build && cd build -~/expat-2.2.10/build$ +~/expat-2.6.4$ mkdir build && cd build +~/expat-2.6.4/build$ From that directory, call cmake first, then call make, make test and make install in the usual way: -~/expat-2.2.10/build$ cmake .. +~/expat-2.6.4/build$ cmake .. -- The C compiler identification is GNU -- The CXX compiler identification is GNU .... -- Configuring done -- Generating done --- Build files have been written to: /home/patrick/expat-2.2.10/build +-- Build files have been written to: /home/patrick/expat-2.6.4/build If you want to specify the install location for your files, append -DCMAKE_INSTALL_PREFIX=/your/install/path to the cmake call. -~/expat-2.2.10/build$ make && make test && make install +~/expat-2.6.4/build$ make && make test && make install Scanning dependencies of target expat [ 5%] Building C object CMakeFiles/expat.dir/lib/xmlparse.c.o [ 11%] Building C object CMakeFiles/expat.dir/lib/xmlrole.c.o @@ -36,7 +36,7 @@ Visual Studio Command Prompt or when using mingw, you must open a cmd.exe and make sure that gcc can be called. On Windows, you also might want to specify a special Generator for CMake: for Visual Studio builds do: -cmake .. -G "Visual Studio 15 2017" && msbuild /m expat.sln +cmake .. -G "Visual Studio 16 2019" && msbuild /m expat.sln for mingw builds do: cmake .. -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=D:\expat-install && gmake && gmake install diff --git a/3rdparty/expat/CMakeLists.txt b/3rdparty/expat/CMakeLists.txt index dfbd0c5943b18..1f6503390628f 100644 --- a/3rdparty/expat/CMakeLists.txt +++ b/3rdparty/expat/CMakeLists.txt @@ -1,44 +1,52 @@ -# This file is copyrighted under the BSD-license for buildsystem files of KDE -# copyright 2010, Patrick Spendrin - -cmake_minimum_required(VERSION 3.1.3) - -# This allows controlling documented build time switches -# when Expat is pulled in using the add_subdirectory function, e.g. -# -# set(EXPAT_BUILD_DOCS OFF) -# set(EXPAT_BUILD_TOOLS OFF) -# add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR}) -# -# would disable compilation of the xmlwf CLI and its man page. -# Without activating behaviour NEW for policy CMP0077 here, -# a user with -Wdev enabled would see warning -# -# Policy CMP0077 is not set: option() honors normal variables. Run "cmake -# --help-policy CMP0077" for policy details. Use the cmake_policy command to -# set the policy and suppress this warning. -# -# For compatibility with older versions of CMake, option is clearing the -# normal variable 'EXPAT_BUILD_DOCS'. -# -# and effectively not be able to adjust option EXPAT_BUILD_DOCS. -# -# For more details please see: -# - https://cmake.org/cmake/help/latest/policy/CMP0077.html -# - https://github.com/libexpat/libexpat/pull/419 -# -if(POLICY CMP0077) - cmake_policy(SET CMP0077 NEW) -endif() +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2010 Patrick Spendrin +# Copyright (c) 2012 Karl Waclawek +# Copyright (c) 2016-2024 Sebastian Pipping +# Copyright (c) 2016 Sergei Nikulov +# Copyright (c) 2016 Björn Lindahl +# Copyright (c) 2016 Tobias Taschner +# Copyright (c) 2016 Ben Boeckel +# Copyright (c) 2017-2022 Rhodri James +# Copyright (c) 2017 Rolf Eike Beer +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Franek Korta +# Copyright (c) 2018 pedro-vicente +# Copyright (c) 2018 Frank Rast +# Copyright (c) 2018 userwithuid +# Copyright (c) 2018 Yury Gribov +# Copyright (c) 2019 Kishore Kunche +# Copyright (c) 2019 xantares +# Copyright (c) 2019 Mohammed Khajapasha +# Copyright (c) 2019 David Loffredo +# Copyright (c) 2019 Bhargava Shastry +# Copyright (c) 2020 Maciej Sroczyński +# Copyright (c) 2020 Gulliver +# Copyright (c) 2020 Thomas Beutlich +# Copyright (c) 2021 Alex Richardson +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2022 David Faure +# Unlike most of Expat, +# this file is copyrighted under the BSD-license for buildsystem files of KDE. + +cmake_minimum_required(VERSION 3.5.0) project(expat VERSION - 2.2.10 + 2.6.4 LANGUAGES C ) +set(CMAKE_C_STANDARD 99) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) # i.e. -std=c99 rather than default -std=gnu99 -set(PACKAGE_BUGREPORT "expat-bugs@libexpat.org") +set(PACKAGE_BUGREPORT "https://github.com/libexpat/libexpat/issues") set(PACKAGE_NAME "expat") set(PACKAGE_VERSION "${PROJECT_VERSION}") set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}") @@ -47,11 +55,6 @@ set(PACKAGE_TARNAME "${PACKAGE_NAME}") include(CMakePackageConfigHelpers) include(GNUInstallDirs) -# -# Detect use by means of add_subdirectory -# -get_directory_property(_EXPAT_PARENT_DIRECTORY PARENT_DIRECTORY) - # # Configuration defaults # @@ -75,51 +78,114 @@ if(MSVC) else() set(_EXPAT_BUILD_PKGCONFIG_DEFAULT ON) endif() +if(DEFINED BUILD_SHARED_LIBS) + set(_EXPAT_SHARED_LIBS_DEFAULT ${BUILD_SHARED_LIBS}) +else() + set(_EXPAT_SHARED_LIBS_DEFAULT ON) +endif() +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE NoConfig) # so that accessing EXPAT_*_POSTFIX will be waterproof +endif() +string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER) # # Configuration # -option(EXPAT_BUILD_TOOLS "build the xmlwf tool for expat library" ${_EXPAT_BUILD_TOOLS_DEFAULT}) -option(EXPAT_BUILD_EXAMPLES "build the examples for expat library" ON) -option(EXPAT_BUILD_TESTS "build the tests for expat library" ON) -option(EXPAT_SHARED_LIBS "build a shared expat library" ON) -option(EXPAT_BUILD_DOCS "build man page for xmlwf" ${_EXPAT_BUILD_DOCS_DEFAULT}) -option(EXPAT_BUILD_FUZZERS "build fuzzers for the expat library" OFF) -option(EXPAT_BUILD_PKGCONFIG "build pkg-config file" ${_EXPAT_BUILD_PKGCONFIG_DEFAULT}) -option(EXPAT_OSSFUZZ_BUILD "build fuzzers via ossfuzz for the expat library" OFF) + +macro(expat_shy_set var default cache type desc) + # Macro expat_shy_set came into life because: + # - Expat was previously using an inconsistent mix of CMake's native set() + # and option() to define public build time options. + # - option() is more friendly than set() with regard to configuring an + # external project that is pulled in by means of add_subdirectory() -- + # see comments in issue #597 -- so we wanted to get away from set(). + # - option() auto-converts non-bool values to bool when writing to the CMake + # cache, so we needed something that supports non-bool better and hence + # wanted to get away from plain option(), too. + # + # As a result, this function serves as a hybrid between CMake's regular set() + # and option(): from set() it takes support for non-bool types and the function + # name and signature whereas from option() (with policy CMP0077 mode NEW) it + # takes being shy when a value has previously been defined for that variable. + # + # So that resolves all need for set(.. FORCE) when pulling in Expat by means of + # add_subdirectory(). + # + if(NOT ${cache} STREQUAL "CACHE") + message(SEND_ERROR "Macro usage is: expat_shy_set(var default CACHE type desc)") + endif() + + if(DEFINED ${var}) + # NOTE: The idea is to (ideally) only add to the cache if + # there is no cache entry, yet. "if(DEFINED CACHE{var})" + # requires CMake >=3.14. + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.14" AND NOT DEFINED "CACHE{${var}}") + set("${var}" "${${var}}" CACHE "${type}" "${desc}") + endif() + else() + set("${var}" "${default}" CACHE "${type}" "${desc}") + endif() +endmacro() + +expat_shy_set(EXPAT_BUILD_TOOLS ${_EXPAT_BUILD_TOOLS_DEFAULT} CACHE BOOL "Build the xmlwf tool for expat library") +expat_shy_set(EXPAT_BUILD_EXAMPLES ON CACHE BOOL "Build the examples for expat library") +expat_shy_set(EXPAT_BUILD_TESTS ON CACHE BOOL "Build the tests for expat library") +expat_shy_set(EXPAT_SHARED_LIBS ${_EXPAT_SHARED_LIBS_DEFAULT} CACHE BOOL "Build a shared expat library") +expat_shy_set(EXPAT_BUILD_DOCS ${_EXPAT_BUILD_DOCS_DEFAULT} CACHE BOOL "Build man page for xmlwf") +expat_shy_set(EXPAT_BUILD_FUZZERS OFF CACHE BOOL "Build fuzzers for the expat library") +expat_shy_set(EXPAT_BUILD_PKGCONFIG ${_EXPAT_BUILD_PKGCONFIG_DEFAULT} CACHE BOOL "Build pkg-config file") +expat_shy_set(EXPAT_OSSFUZZ_BUILD OFF CACHE BOOL "Build fuzzers via ossfuzz for the expat library") if(UNIX OR _EXPAT_HELP) - option(EXPAT_WITH_LIBBSD "utilize libbsd (for arc4random_buf)" OFF) + expat_shy_set(EXPAT_WITH_LIBBSD OFF CACHE BOOL "Utilize libbsd (for arc4random_buf)") endif() -option(EXPAT_ENABLE_INSTALL "install expat files in cmake install target" ON) -set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point") +expat_shy_set(EXPAT_ENABLE_INSTALL ON CACHE BOOL "Install expat files in cmake install target") +expat_shy_set(EXPAT_CONTEXT_BYTES 1024 CACHE STRING "Define to specify how much context to retain around the current parse point, 0 to disable") mark_as_advanced(EXPAT_CONTEXT_BYTES) -option(EXPAT_DTD "Define to make parameter entity parsing functionality available" ON) +expat_shy_set(EXPAT_DTD ON CACHE BOOL "Define to make parameter entity parsing functionality available") mark_as_advanced(EXPAT_DTD) -option(EXPAT_NS "Define to make XML Namespaces functionality available" ON) +expat_shy_set(EXPAT_GE ON CACHE BOOL "Define to make general entity parsing functionality available") +mark_as_advanced(EXPAT_GE) +expat_shy_set(EXPAT_NS ON CACHE BOOL "Define to make XML Namespaces functionality available") mark_as_advanced(EXPAT_NS) -option(EXPAT_WARNINGS_AS_ERRORS "Treat all compiler warnings as errors" OFF) +expat_shy_set(EXPAT_WARNINGS_AS_ERRORS OFF CACHE BOOL "Treat all compiler warnings as errors") if(UNIX OR _EXPAT_HELP) - option(EXPAT_DEV_URANDOM "Define to include code reading entropy from `/dev/urandom'." ON) - set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING - "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]") - set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING - "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]") + expat_shy_set(EXPAT_DEV_URANDOM ON CACHE BOOL "Define to include code reading entropy from `/dev/urandom'.") + expat_shy_set(EXPAT_WITH_GETRANDOM "AUTO" CACHE STRING "Make use of getrandom function (ON|OFF|AUTO) [default=AUTO]") + expat_shy_set(EXPAT_WITH_SYS_GETRANDOM "AUTO" CACHE STRING "Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO]") mark_as_advanced(EXPAT_DEV_URANDOM) endif() -set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]") -option(EXPAT_ATTR_INFO "Define to allow retrieving the byte offsets for attribute names and values" OFF) +expat_shy_set(EXPAT_CHAR_TYPE "char" CACHE STRING "Character type to use (char|ushort|wchar_t) [default=char]") +expat_shy_set(EXPAT_ATTR_INFO OFF CACHE BOOL "Define to allow retrieving the byte offsets for attribute names and values") mark_as_advanced(EXPAT_ATTR_INFO) -option(EXPAT_LARGE_SIZE "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>" OFF) +expat_shy_set(EXPAT_LARGE_SIZE OFF CACHE BOOL "Make XML_GetCurrent* functions return <(unsigned) long long> rather than <(unsigned) long>") mark_as_advanced(EXPAT_LARGE_SIZE) -option(EXPAT_MIN_SIZE "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)" OFF) +expat_shy_set(EXPAT_MIN_SIZE OFF CACHE BOOL "Get a smaller (but slower) parser (in particular avoid multiple copies of the tokenizer)") mark_as_advanced(EXPAT_MIN_SIZE) if(MSVC OR _EXPAT_HELP) - set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC") + expat_shy_set(EXPAT_MSVC_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC") +endif() +if(NOT _EXPAT_HELP) + expat_shy_set(_EXPAT_M32 OFF CACHE BOOL "(Unofficial!) Produce 32bit code with -m32") + mark_as_advanced(_EXPAT_M32) +endif() + +if(EXPAT_BUILD_TESTS) + # We have to call enable_language() before modifying any CMAKE_CXX_* variables + enable_language(CXX) + + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) + set(CMAKE_CXX_EXTENSIONS OFF) # i.e. -std=c++11 rather than default -std=gnu++11 endif() # # Environment checks # +if(EXPAT_DTD AND NOT EXPAT_GE) + message(SEND_ERROR "Option EXPAT_DTD requires that EXPAT_GE is also enabled.") + message(SEND_ERROR "Please either enable option EXPAT_GE (recommended) or disable EXPAT_DTD also.") +endif() + if(EXPAT_WITH_LIBBSD) find_library(LIB_BSD NAMES bsd) if(NOT LIB_BSD) @@ -129,6 +195,26 @@ if(EXPAT_WITH_LIBBSD) endif() endif() +if(MSVC) + # For the three types of MSVC version values, please see: + # - https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + # - https://sourceforge.net/p/predef/wiki/Compilers/ + # - https://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History + set(_EXPAT_MSVC_REQUIRED_INT 1800) # i.e. 12.0/2013/1800; see PR #426 + set(_EXPAT_MSVC_SUPPORTED_INT 1920) + set(_EXPAT_MSVC_SUPPORTED_DISPLAY "Visual Studio 16.0/2019/${_EXPAT_MSVC_SUPPORTED_INT}") + + if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_SUPPORTED_INT}) + if(MSVC_VERSION VERSION_LESS ${_EXPAT_MSVC_REQUIRED_INT}) + message(SEND_ERROR "MSVC_VERSION ${MSVC_VERSION} is TOO OLD to compile Expat without errors.") + message(SEND_ERROR "Please use officially supported ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!") + else() + message(WARNING "MSVC_VERSION ${MSVC_VERSION} is NOT OFFICIALLY SUPPORTED by Expat.") + message(WARNING "Please use ${_EXPAT_MSVC_SUPPORTED_DISPLAY} or later. Thank you!") + endif() + endif() +endif() + macro(_expat_copy_bool_int source_ref dest_ref) if(${source_ref}) set(${dest_ref} 1) @@ -202,12 +288,16 @@ endif() _expat_copy_bool_int(EXPAT_ATTR_INFO XML_ATTR_INFO) _expat_copy_bool_int(EXPAT_DTD XML_DTD) +_expat_copy_bool_int(EXPAT_GE XML_GE) _expat_copy_bool_int(EXPAT_LARGE_SIZE XML_LARGE_SIZE) _expat_copy_bool_int(EXPAT_MIN_SIZE XML_MIN_SIZE) _expat_copy_bool_int(EXPAT_NS XML_NS) if(NOT WIN32) _expat_copy_bool_int(EXPAT_DEV_URANDOM XML_DEV_URANDOM) endif() +if(NOT EXPAT_CONTEXT_BYTES GREATER 0) # in particular with -DEXPAT_CONTEXT_BYTES=OFF + set(EXPAT_CONTEXT_BYTES 0) +endif() set(XML_CONTEXT_BYTES ${EXPAT_CONTEXT_BYTES}) macro(expat_install) @@ -217,7 +307,6 @@ macro(expat_install) endmacro() configure_file(expat_config.h.cmake "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h") -add_definitions(-DHAVE_EXPAT_CONFIG_H) expat_install(FILES "${CMAKE_CURRENT_BINARY_DIR}/expat_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) @@ -226,14 +315,24 @@ if(FLAG_NO_STRICT_ALIASING) set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fno-strict-aliasing") endif() if(FLAG_VISIBILITY) - add_definitions(-DXML_ENABLE_VISIBILITY=1) + if(EXPAT_SHARED_LIBS) + add_definitions(-DXML_ENABLE_VISIBILITY=1) + endif() set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -fvisibility=hidden") endif() +if(MINGW) + # Without __USE_MINGW_ANSI_STDIO the compiler produces a false positive + set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-pedantic-ms-format") +endif() if (EXPAT_WARNINGS_AS_ERRORS) if(MSVC) add_definitions(/WX) else() set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Werror") + if(MINGW) + # To avoid "error: unknown conversion type character ‘l’ in format [-Werror=format=]" + set(EXTRA_COMPILE_FLAGS "${EXTRA_COMPILE_FLAGS} -Wno-format") + endif() endif() endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_COMPILE_FLAGS}") @@ -243,10 +342,12 @@ if (MSVC) if (EXPAT_MSVC_STATIC_CRT) message("-- Using static CRT ${EXPAT_MSVC_STATIC_CRT}") foreach(flag_var + CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL @@ -257,43 +358,32 @@ if (MSVC) endif() endif() +if(_EXPAT_M32 AND NOT MSVC) + foreach(flag_var + CMAKE_CXX_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL + CMAKE_CXX_FLAGS_RELWITHDEBINFO + CMAKE_C_FLAGS_${_EXPAT_BUILD_TYPE_UPPER} + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE + CMAKE_C_FLAGS_MINSIZEREL + CMAKE_C_FLAGS_RELWITHDEBINFO + ) + set(${flag_var} "${${flag_var}} -m32") + endforeach() +endif() + include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib) if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -wd4996) endif() -if(WIN32) - if(_EXPAT_UNICODE_WCHAR_T) - set(_POSTFIX_WIDE "w") - endif() - - if(MSVC AND NOT EXPAT_SHARED_LIBS) - if(EXPAT_MSVC_STATIC_CRT) - set(_POSTFIX_CRT "MT") - else() - set(_POSTFIX_CRT "MD") - endif() - endif() - - foreach(postfix_var - CMAKE_DEBUG_POSTFIX - CMAKE_RELEASE_POSTFIX - CMAKE_MINSIZEREL_POSTFIX - CMAKE_RELWITHDEBINFO_POSTFIX - ) - if(postfix_var STREQUAL "CMAKE_DEBUG_POSTFIX") - set(_POSTFIX_DEBUG "d") - else() - set(_POSTFIX_DEBUG "") - endif() - - set(${postfix_var} "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Windows binary postfix, e.g. libexpat.lib") - endforeach() -endif() # # C library # -set(expat_SRCS +set(_EXPAT_C_SOURCES lib/xmlparse.c lib/xmlrole.c lib/xmltok.c @@ -304,39 +394,116 @@ set(expat_SRCS if(EXPAT_SHARED_LIBS) set(_SHARED SHARED) - if(MSVC) - set(expat_SRCS ${expat_SRCS} lib/libexpat.def) + if(WIN32) + macro(_expat_def_file_toggle source_var target_var) + if(${source_var}) + set(${target_var} " ") # i.e. not commented out, a single space + else() + set(${target_var} ";") # i.e. commented out + endif() + endmacro() + + if(EXPAT_DTD OR EXPAT_GE) + set(_EXPAT_DTD_OR_GE TRUE) + else() + set(_EXPAT_DTD_OR_GE FALSE) + endif() + + _expat_def_file_toggle(_EXPAT_DTD_OR_GE _EXPAT_COMMENT_DTD_OR_GE) + _expat_def_file_toggle(EXPAT_ATTR_INFO _EXPAT_COMMENT_ATTR_INFO) + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/lib/libexpat.def.cmake" "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/lib/libexpat.def") + + # Add DLL version + string(REPLACE "." "," _EXPAT_DLL_VERSION ${PROJECT_VERSION}.0) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/win32/version.rc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") + set(_EXPAT_EXTRA_SOURCES ${_EXPAT_EXTRA_SOURCES} "${CMAKE_CURRENT_BINARY_DIR}/win32/version.rc") endif() else() set(_SHARED STATIC) endif() -# Avoid colliding with Expat.dll of Perl's XML::Parser::Expat -if(WIN32 AND NOT MINGW) - set(_EXPAT_OUTPUT_NAME libexpat) # CMAKE_*_POSTFIX applies, see above -else() - if(_EXPAT_UNICODE) - set(_EXPAT_OUTPUT_NAME expatw) - else() - set(_EXPAT_OUTPUT_NAME expat) - endif() +add_library(expat ${_SHARED} ${_EXPAT_C_SOURCES} ${_EXPAT_EXTRA_SOURCES}) +add_library(expat::expat ALIAS expat) +if(_EXPAT_LIBM_FOUND) + target_link_libraries(expat m) endif() - -add_library(expat ${_SHARED} ${expat_SRCS}) if(EXPAT_WITH_LIBBSD) target_link_libraries(expat ${LIB_BSD}) endif() -set(LIBCURRENT 7) # sync -set(LIBREVISION 12) # with -set(LIBAGE 6) # configure.ac! +# +# Library filename postfix +# +if(_EXPAT_UNICODE) + set(_POSTFIX_WIDE "w") +endif() + +if(MSVC AND NOT EXPAT_SHARED_LIBS) + if(EXPAT_MSVC_STATIC_CRT) + set(_POSTFIX_CRT "MT") + else() + set(_POSTFIX_CRT "MD") + endif() +endif() + +foreach(build_type_upper + ${_EXPAT_BUILD_TYPE_UPPER} + DEBUG + RELEASE + MINSIZEREL + RELWITHDEBINFO + ) + if(WIN32 AND build_type_upper STREQUAL "DEBUG") + set(_POSTFIX_DEBUG "d") + else() + set(_POSTFIX_DEBUG "") # needs a reset because of being looped + endif() + + expat_shy_set(EXPAT_${build_type_upper}_POSTFIX "${_POSTFIX_WIDE}${_POSTFIX_DEBUG}${_POSTFIX_CRT}" CACHE STRING "Library filename postfix for build type ${build_type_upper}; yields filenames libexpat.(dll|dylib|lib|so)") + mark_as_advanced(EXPAT_${build_type_upper}_POSTFIX) + set_property(TARGET expat PROPERTY ${build_type_upper}_POSTFIX ${EXPAT_${build_type_upper}_POSTFIX}) +endforeach() + +set(LIBCURRENT 11) # sync +set(LIBREVISION 0) # with +set(LIBAGE 10) # configure.ac! math(EXPR LIBCURRENT_MINUS_AGE "${LIBCURRENT} - ${LIBAGE}") -set_property(TARGET expat PROPERTY OUTPUT_NAME "${_EXPAT_OUTPUT_NAME}") if(NOT WIN32) set_property(TARGET expat PROPERTY VERSION ${LIBCURRENT_MINUS_AGE}.${LIBAGE}.${LIBREVISION}) set_property(TARGET expat PROPERTY SOVERSION ${LIBCURRENT_MINUS_AGE}) set_property(TARGET expat PROPERTY NO_SONAME ${NO_SONAME}) + + if(APPLE) + if(NOT CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) + message(FATAL_ERROR "Expat requires CMake >=3.17 on platform \"APPLE\".") + endif() + + # NOTE: This intends to talk CMake into compatibility with GNU Libtool + math(EXPR _EXPAT_MACHO_COMPATIBILITY_VERSION "${LIBCURRENT} + 1") + set(_EXPAT_MACHO_CURRENT_VERSION "${_EXPAT_MACHO_COMPATIBILITY_VERSION}.${LIBREVISION}") + set_property(TARGET expat PROPERTY MACHO_COMPATIBILITY_VERSION ${_EXPAT_MACHO_COMPATIBILITY_VERSION}) + set_property(TARGET expat PROPERTY MACHO_CURRENT_VERSION ${_EXPAT_MACHO_CURRENT_VERSION}) + endif() +endif() + +if(MINGW AND EXPAT_SHARED_LIBS) + set_target_properties(expat PROPERTIES SUFFIX "-${LIBCURRENT_MINUS_AGE}.dll") +endif() + +if(WIN32 AND NOT MINGW) + # NOTE: This avoids a name collision with Expat.dll of Perl's XML::Parser::Expat + # on Windows by resorting to filename libexpat.dll since Expat 1.95.3. + # Everything but MSVC is already adding prefix "lib", automatically. + # NOTE: "set_property(TARGET expat PROPERTY PREFIX lib)" would only affect *.dll + # files but not *.lib files, so we have to rely on property OUTPUT_NAME, instead. + # Target property _POSTFIX still applies. + set(_EXPAT_OUTPUT_NAME libexpat) + set_property(TARGET expat PROPERTY OUTPUT_NAME ${_EXPAT_OUTPUT_NAME}) +else() + set(_EXPAT_OUTPUT_NAME expat) endif() target_include_directories(expat @@ -346,8 +513,8 @@ target_include_directories(expat $ ) -if(NOT EXPAT_SHARED_LIBS AND WIN32) - target_compile_definitions(expat PUBLIC -DXML_STATIC) +if(WIN32 AND EXPAT_SHARED_LIBS) + target_compile_definitions(expat PRIVATE VER_FILEVERSION=${_EXPAT_DLL_VERSION}) endif() expat_install(TARGETS expat EXPORT expat @@ -361,12 +528,42 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL # pkg-config file # if(EXPAT_BUILD_PKGCONFIG) - set(prefix ${CMAKE_INSTALL_PREFIX}) - set(exec_prefix "\${prefix}") - set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") - set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") - configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY) - expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + if(CMAKE_INSTALL_LIBDIR MATCHES "^/") + set(_expat_pkgconfig_libdir "${CMAKE_INSTALL_LIBDIR}") + else() + set(_expat_pkgconfig_libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") + endif() + + if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/") + set(_expat_pkgconfig_includedir "${CMAKE_INSTALL_INCLUDEDIR}") + else() + set(_expat_pkgconfig_includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") + endif() + + set_target_properties(expat PROPERTIES + pkgconfig_prefix "${CMAKE_INSTALL_PREFIX}" + pkgconfig_exec_prefix "\${prefix}" + pkgconfig_libdir "${_expat_pkgconfig_libdir}" + pkgconfig_includedir "${_expat_pkgconfig_includedir}" + pkgconfig_version "${PACKAGE_VERSION}") + + foreach(_build_type ${CMAKE_BUILD_TYPE} Debug Release RelWithDebInfo MinSizeRel) + string(TOLOWER "${_build_type}" _build_type_lower) + string(TOUPPER "${_build_type}" _build_type_upper) + set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_name" "expat${EXPAT_${_build_type_upper}_POSTFIX}") + set_property(TARGET expat PROPERTY "pkgconfig_${_build_type_lower}_output_name" "${_EXPAT_OUTPUT_NAME}${EXPAT_${_build_type_upper}_POSTFIX}") + if(_EXPAT_LIBM_FOUND) + set_property(TARGET expat PROPERTY "pkgconfig_libm" "-lm") + else() + set_property(TARGET expat PROPERTY "pkgconfig_libm" "") + endif() + endforeach() + + file(GENERATE + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$/expat.pc + INPUT ${PROJECT_SOURCE_DIR}/expat.pc.cmake) + + expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/$/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() # @@ -374,15 +571,18 @@ endif() # if(EXPAT_BUILD_TOOLS) set(xmlwf_SRCS - xmlwf/xmlwf.c - xmlwf/xmlfile.c xmlwf/codepage.c xmlwf/readfilemap.c + xmlwf/xmlfile.c + xmlwf/xmlwf.c ) add_executable(xmlwf ${xmlwf_SRCS}) set_property(TARGET xmlwf PROPERTY RUNTIME_OUTPUT_DIRECTORY xmlwf) target_link_libraries(xmlwf expat) + if(_EXPAT_LIBM_FOUND) + target_link_libraries(xmlwf m) + endif() expat_install(TARGETS xmlwf DESTINATION ${CMAKE_INSTALL_BINDIR}) if(MINGW AND _EXPAT_UNICODE_WCHAR_T) @@ -409,13 +609,11 @@ endif() # C code examples # if(EXPAT_BUILD_EXAMPLES) - add_executable(elements examples/elements.c) - set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) - target_link_libraries(elements expat) - - add_executable(outline examples/outline.c) - set_property(TARGET outline PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) - target_link_libraries(outline expat) + foreach(_target element_declarations elements outline) + add_executable(${_target} examples/${_target}.c) + set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY examples) + target_link_libraries(${_target} expat) + endforeach() endif() # @@ -423,16 +621,8 @@ endif() # if(EXPAT_BUILD_TESTS) ## these are unittests that can be run on any platform - enable_language(CXX) enable_testing() - set(test_SRCS - tests/chardata.c - tests/memcheck.c - tests/minicheck.c - tests/structdata.c - ) - if(NOT MSVC) if(MINGW) set(host whatever-mingw32) # for nothing but run.sh @@ -448,17 +638,67 @@ if(EXPAT_BUILD_TESTS) endif() endfunction() - add_executable(runtests tests/runtests.c ${test_SRCS}) - set_property(TARGET runtests PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) - target_link_libraries(runtests expat) - expat_add_test(runtests $) + set(_EXPAT_TEST_TARGETS runtests runtests_cxx) + + add_executable(runtests + tests/acc_tests.c + tests/alloc_tests.c + tests/basic_tests.c + tests/chardata.c + tests/common.c + tests/dummy.c + tests/handlers.c + tests/memcheck.c + tests/minicheck.c + tests/misc_tests.c + tests/ns_tests.c + tests/nsalloc_tests.c + tests/runtests.c + tests/structdata.c + ${_EXPAT_C_SOURCES} + ) + + add_executable(runtests_cxx + tests/acc_tests_cxx.cpp + tests/alloc_tests_cxx.cpp + tests/basic_tests_cxx.cpp + tests/chardata_cxx.cpp + tests/common_cxx.cpp + tests/dummy_cxx.cpp + tests/handlers_cxx.cpp + tests/memcheck_cxx.cpp + tests/minicheck_cxx.cpp + tests/misc_tests_cxx.cpp + tests/ns_tests_cxx.cpp + tests/nsalloc_tests_cxx.cpp + tests/runtests_cxx.cpp + tests/structdata_cxx.cpp + ${_EXPAT_C_SOURCES} + ) + + foreach(_target ${_EXPAT_TEST_TARGETS}) + target_compile_definitions(${_target} PRIVATE -DXML_TESTING) + + set_property(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) + expat_add_test(${_target} $) - add_executable(runtestspp tests/runtestspp.cpp ${test_SRCS}) - set_property(TARGET runtestspp PROPERTY RUNTIME_OUTPUT_DIRECTORY tests) - target_link_libraries(runtestspp expat) - expat_add_test(runtestspp $) + if(_EXPAT_LIBM_FOUND) + target_link_libraries(${_target} m) + endif() + + if(EXPAT_WITH_LIBBSD) + target_link_libraries(${_target} ${LIB_BSD}) + endif() + endforeach() + + add_executable(benchmark tests/benchmark/benchmark.c) + set_property(TARGET benchmark PROPERTY RUNTIME_OUTPUT_DIRECTORY tests/benchmark) + target_link_libraries(benchmark expat) endif() +# +# Fuzzers +# if(EXPAT_BUILD_FUZZERS) if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") message(SEND_ERROR @@ -491,7 +731,7 @@ if(EXPAT_BUILD_FUZZERS) set(encoding_types UTF-16 UTF-8 ISO-8859-1 US-ASCII UTF-16BE UTF-16LE) set(fuzz_targets xml_parse_fuzzer xml_parsebuffer_fuzzer) - add_library(fuzzpat STATIC ${expat_SRCS}) + add_library(fuzzpat STATIC ${_EXPAT_C_SOURCES}) if(NOT EXPAT_OSSFUZZ_BUILD) target_compile_options(fuzzpat PRIVATE -fsanitize=fuzzer-no-link) endif() @@ -526,6 +766,23 @@ else() endif() endif() +# +# C/C++ config affecting multiple targets +# +if(WIN32) + set(_EXPAT_STATIC_TARGETS ${_EXPAT_TEST_TARGETS}) + if(NOT EXPAT_SHARED_LIBS) + list(APPEND _EXPAT_STATIC_TARGETS expat) + endif() + if(EXPAT_BUILD_FUZZERS) + list(APPEND _EXPAT_STATIC_TARGETS fuzzpat) + endif() + + foreach(_target ${_EXPAT_STATIC_TARGETS}) + target_compile_definitions(${_target} PUBLIC -DXML_STATIC) + endforeach() +endif() + # # Custom target "run-xmltest" # @@ -656,20 +913,31 @@ elseif(EXPAT_CHAR_TYPE STREQUAL "wchar_t") else() set(_EXPAT_CHAR_TYPE_SUMMARY "ERROR") endif() -string(TOUPPER "${CMAKE_BUILD_TYPE}" _EXPAT_BUILD_TYPE_UPPER) +# NOTE: We're not accessing global property GENERATOR_IS_MULTI_CONFIG +# because that would require CMake >=3.9 +if(CMAKE_CONFIGURATION_TYPES) + set(_EXPAT_GENERATOR_IS_MULTI_CONFIG TRUE) +else() + set(_EXPAT_GENERATOR_IS_MULTI_CONFIG FALSE) +endif() message(STATUS "===========================================================================") message(STATUS "") message(STATUS "Configuration") +message(STATUS " Generator .................. ${CMAKE_GENERATOR}") +if(_EXPAT_GENERATOR_IS_MULTI_CONFIG) + message(STATUS " Build types ................ ${CMAKE_CONFIGURATION_TYPES}") +else() + message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}") +endif() message(STATUS " Prefix ..................... ${CMAKE_INSTALL_PREFIX}") -message(STATUS " Build type ................. ${CMAKE_BUILD_TYPE}") message(STATUS " Shared libraries ........... ${EXPAT_SHARED_LIBS}") if(MSVC) message(STATUS " Static CRT ................. ${EXPAT_MSVC_STATIC_CRT}") endif() message(STATUS " Character type ............. ${_EXPAT_CHAR_TYPE_SUMMARY}") -if(WIN32) - message(STATUS " Binary postfix ............. ${CMAKE_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}") +if(NOT _EXPAT_GENERATOR_IS_MULTI_CONFIG) + message(STATUS " Library name postfix ....... ${EXPAT_${_EXPAT_BUILD_TYPE_UPPER}_POSTFIX}") endif() message(STATUS "") message(STATUS " Build documentation ........ ${EXPAT_BUILD_DOCS}") @@ -685,6 +953,7 @@ message(STATUS " // Advanced options, changes not advised") message(STATUS " Attributes info .......... ${EXPAT_ATTR_INFO}") message(STATUS " Context bytes ............ ${EXPAT_CONTEXT_BYTES}") message(STATUS " DTD support .............. ${EXPAT_DTD}") +message(STATUS " General entities ......... ${EXPAT_GE}") message(STATUS " Large size ............... ${EXPAT_LARGE_SIZE}") message(STATUS " Minimum size ............. ${EXPAT_MIN_SIZE}") message(STATUS " Namespace support ........ ${EXPAT_NS}") diff --git a/3rdparty/expat/COPYING b/3rdparty/expat/COPYING index 3c0142e71c8d4..ce9e5939291e4 100644 --- a/3rdparty/expat/COPYING +++ b/3rdparty/expat/COPYING @@ -1,5 +1,5 @@ Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper -Copyright (c) 2001-2019 Expat maintainers +Copyright (c) 2001-2022 Expat maintainers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/3rdparty/expat/Changes b/3rdparty/expat/Changes index b74a7c56a961d..aa19f70ae2195 100644 --- a/3rdparty/expat/Changes +++ b/3rdparty/expat/Changes @@ -1,6 +1,742 @@ -NOTE: We are looking for help with a few things: - https://github.com/libexpat/libexpat/labels/help%20wanted - If you can help, please get in touch. Thanks! + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! Expat is UNDERSTAFFED and WITHOUT FUNDING. !! +!! ~~~~~~~~~~~~ !! +!! The following topics need *additional skilled C developers* to progress !! +!! in a timely manner or at all (loosely ordered by descending priority): !! +!! !! +!! - fixing a complex non-public security issue, !! +!! - teaming up on researching and fixing future security reports and !! +!! ClusterFuzz findings with few-days-max response times in communication !! +!! in order to (1) have a sound fix ready before the end of a 90 days !! +!! grace period and (2) in a sustainable manner, !! +!! - implementing and auto-testing XML 1.0r5 support !! +!! (needs discussion before pull requests), !! +!! - smart ideas on fixing the Autotools CMake files generation issue !! +!! without breaking CI (needs discussion before pull requests), !! +!! - the Windows binaries topic (needs requirements engineering first), !! +!! - pushing migration from `int` to `size_t` further !! +!! including edge-cases test coverage (needs discussion before anything). !! +!! !! +!! For details, please reach out via e-mail to sebastian@pipping.org so we !! +!! can schedule a voice call on the topic, in English or German. !! +!! !! +!! THANK YOU! Sebastian Pipping -- Berlin, 2024-03-09 !! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +Release 2.6.4 Wed November 6 2024 + Security fixes: + #915 CVE-2024-50602 -- Fix crash within function XML_ResumeParser + from a NULL pointer dereference by disallowing function + XML_StopParser to (stop or) suspend an unstarted parser. + A new error code XML_ERROR_NOT_STARTED was introduced to + properly communicate this situation. // CWE-476 CWE-754 + + Other changes: + #903 CMake: Add alias target "expat::expat" + #905 docs: Document use via CMake >=3.18 with FetchContent + and SOURCE_SUBDIR and its consequences + #902 tests: Reduce use of global parser instance + #904 tests: Resolve duplicate handler + #317 #918 tests: Improve tests on doctype closing (ex CVE-2019-15903) + #914 Fix signedness of format strings + #919 #920 Version info bumped from 10:3:9 (libexpat*.so.1.9.3) + to 11:0:10 (libexpat*.so.1.10.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #907 CI: Upgrade Clang from 18 to 19 + #913 CI: Drop macos-12 and add macos-15 + #910 CI: Adapt to breaking changes in GitHub Actions + #898 Add missing entries to .gitignore + + Special thanks to: + Hanno Böck + José Eduardo Gutiérrez Conejo + José Ricardo Cardona Quesada + +Release 2.6.3 Wed September 4 2024 + Security fixes: + #887 #890 CVE-2024-45490 -- Calling function XML_ParseBuffer with + len < 0 without noticing and then calling XML_GetBuffer + will have XML_ParseBuffer fail to recognize the problem + and XML_GetBuffer corrupt memory. + With the fix, XML_ParseBuffer now complains with error + XML_ERROR_INVALID_ARGUMENT just like sibling XML_Parse + has been doing since Expat 2.2.1, and now documented. + Impact is denial of service to potentially artitrary code + execution. + #888 #891 CVE-2024-45491 -- Internal function dtdCopy can have an + integer overflow for nDefaultAtts on 32-bit platforms + (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + #889 #892 CVE-2024-45492 -- Internal function nextScaffoldPart can + have an integer overflow for m_groupSize on 32-bit + platforms (where UINT_MAX equals SIZE_MAX). + Impact is denial of service to potentially artitrary code + execution. + + Other changes: + #851 #879 Autotools: Sync CMake templates with CMake 3.28 + #853 Autotools: Always provide path to find(1) for portability + #861 Autotools: Ensure that the m4 directory always exists. + #870 Autotools: Simplify handling of SIZEOF_VOID_P + #869 Autotools: Support non-GNU sed + #856 Autotools|CMake: Fix main() to main(void) + #865 Autotools|CMake: Fix compile tests for HAVE_SYSCALL_GETRANDOM + #863 Autotools|CMake: Stop requiring dos2unix + #854 #855 CMake: Fix check for symbols size_t and off_t + #864 docs|tests: Convert README to Markdown and update + #741 Windows: Drop support for Visual Studio <=15.0/2017 + #886 Drop needless XML_DTD guards around is_param access + #885 Fix typo in a code comment + #894 #896 Version info bumped from 10:2:9 (libexpat*.so.1.9.2) + to 10:3:9 (libexpat*.so.1.9.3); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #880 Readme: Promote the call for help + #868 CI: Fix various issues + #849 CI: Allow triggering GitHub Actions workflows manually + #851 #872 .. + #873 #879 CI: Adapt to breaking changes in GitHub Actions + + Special thanks to: + Alexander Bluhm + Berkay Eren Ürün + Dag-Erling Smørgrav + Ferenc Géczi + TaiYou + +Release 2.6.2 Wed March 13 2024 + Security fixes: + #839 #842 CVE-2024-28757 -- Prevent billion laughs attacks with + isolated use of external parsers. Please see the commit + message of commit 1d50b80cf31de87750103656f6eb693746854aa8 + for details. + + Bug fixes: + #839 #841 Reject direct parameter entity recursion + and avoid the related undefined behavior + + Other changes: + #847 Autotools: Fix build for DOCBOOK_TO_MAN containing spaces + #837 Add missing #821 and #824 to 2.6.1 change log + #838 #843 Version info bumped from 10:1:9 (libexpat*.so.1.9.1) + to 10:2:9 (libexpat*.so.1.9.2); see https://verbump.de/ + for what these numbers do + + Special thanks to: + Philippe Antoine + Tomas Korbar + and + Clang UndefinedBehaviorSanitizer + OSS-Fuzz / ClusterFuzz + +Release 2.6.1 Thu February 29 2024 + Bug fixes: + #817 Make tests independent of CPU speed, and thus more robust + #828 #836 Expose billion laughs API with XML_DTD defined and + XML_GE undefined, regression from 2.6.0 + + Other changes: + #829 Hide test-only code behind new internal macro + #833 Autotools: Reject expat_config.h.in defining SIZEOF_VOID_P + #821 #824 Autotools: Fix "make clean" for case: + ./configure --without-docbook && make clean all + #819 Address compiler warnings + #832 #834 Version info bumped from 10:0:9 (libexpat*.so.1.9.0) + to 10:1:9 (libexpat*.so.1.9.1); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #818 CI: Adapt to breaking changes in clang-format + + Special thanks to: + David Hall + Snild Dolkow + +Release 2.6.0 Tue February 6 2024 + Security fixes: + #789 #814 CVE-2023-52425 -- Fix quadratic runtime issues with big tokens + that can cause denial of service, in partial where + dealing with compressed XML input. Applications + that parsed a document in one go -- a single call to + functions XML_Parse or XML_ParseBuffer -- were not affected. + The smaller the chunks/buffers you use for parsing + previously, the bigger the problem prior to the fix. + Backporters should be careful to no omit parts of + pull request #789 and to include earlier pull request #771, + in order to not break the fix. + #777 CVE-2023-52426 -- Fix billion laughs attacks for users + compiling *without* XML_DTD defined (which is not common). + Users with XML_DTD defined have been protected since + Expat >=2.4.0 (and that was CVE-2013-0340 back then). + + Bug fixes: + #753 Fix parse-size-dependent "invalid token" error for + external entities that start with a byte order mark + #780 Fix NULL pointer dereference in setContext via + XML_ExternalEntityParserCreate for compilation with + XML_DTD undefined + #812 #813 Protect against closing entities out of order + + Other changes: + #723 Improve support for arc4random/arc4random_buf + #771 #788 Improve buffer growth in XML_GetBuffer and XML_Parse + #761 #770 xmlwf: Support --help and --version + #759 #770 xmlwf: Support custom buffer size for XML_GetBuffer and read + #744 xmlwf: Improve language and URL clickability in help output + #673 examples: Add new example "element_declarations.c" + #764 Be stricter about macro XML_CONTEXT_BYTES at build time + #765 Make inclusion to expat_config.h consistent + #726 #727 Autotools: configure.ac: Support --disable-maintainer-mode + #678 #705 .. + #706 #733 #792 Autotools: Sync CMake templates with CMake 3.26 + #795 Autotools: Make installation of shipped man page doc/xmlwf.1 + independent of docbook2man availability + #815 Autotools|CMake: Add missing -DXML_STATIC to pkg-config file + section "Cflags.private" in order to fix compilation + against static libexpat using pkg-config on Windows + #724 #751 Autotools|CMake: Require a C99 compiler + (a de-facto requirement already since Expat 2.2.2 of 2017) + #793 Autotools|CMake: Fix PACKAGE_BUGREPORT variable + #750 #786 Autotools|CMake: Make test suite require a C++11 compiler + #749 CMake: Require CMake >=3.5.0 + #672 CMake: Lowercase off_t and size_t to help a bug in Meson + #746 CMake: Sort xmlwf sources alphabetically + #785 CMake|Windows: Fix generation of DLL file version info + #790 CMake: Build tests/benchmark/benchmark.c as well for + a build with -DEXPAT_BUILD_TESTS=ON + #745 #757 docs: Document the importance of isFinal + adjust tests + accordingly + #736 docs: Improve use of "NULL" and "null" + #713 docs: Be specific about version of XML (XML 1.0r4) + and version of C (C99); (XML 1.0r5 will need a sponsor.) + #762 docs: reference.html: Promote function XML_ParseBuffer more + #779 docs: reference.html: Add HTML anchors to XML_* macros + #760 docs: reference.html: Upgrade to OK.css 1.2.0 + #763 #739 docs: Fix typos + #696 docs|CI: Use HTTPS URLs instead of HTTP at various places + #669 #670 .. + #692 #703 .. + #733 #772 Address compiler warnings + #798 #800 Address clang-tidy warnings + #775 #776 Version info bumped from 9:10:8 (libexpat*.so.1.8.10) + to 10:0:9 (libexpat*.so.1.9.0); see https://verbump.de/ + for what these numbers do + + Infrastructure: + #700 #701 docs: Document security policy in file SECURITY.md + #766 docs: Improve parse buffer variables in-code documentation + #674 #738 .. + #740 #747 .. + #748 #781 #782 Refactor coverage and conformance tests + #714 #716 Refactor debug level variables to unsigned long + #671 Improve handling of empty environment variable value + in function getDebugLevel (without visible user effect) + #755 #774 .. + #758 #783 .. + #784 #787 tests: Improve test coverage with regard to parse chunk size + #660 #797 #801 Fuzzing: Improve fuzzing coverage + #367 #799 Fuzzing|CI: Start running OSS-Fuzz fuzzing regression tests + #698 #721 CI: Resolve some Travis CI leftovers + #669 CI: Be robust towards absence of Git tags + #693 #694 CI: Set permissions to "contents: read" for security + #709 CI: Pin all GitHub Actions to specific commits for security + #739 CI: Reject spelling errors using codespell + #798 CI: Enforce clang-tidy clean code + #773 #808 .. + #809 #810 CI: Upgrade Clang from 15 to 18 + #796 CI: Start using Clang's Control Flow Integrity sanitizer + #675 #720 #722 CI: Adapt to breaking changes in GitHub Actions Ubuntu images + #689 CI: Adapt to breaking changes in Clang/LLVM Debian packaging + #763 CI: Adapt to breaking changes in codespell + #803 CI: Adapt to breaking changes in Cppcheck + + Special thanks to: + Ivan Galkin + Joyce Brum + Philippe Antoine + Rhodri James + Snild Dolkow + spookyahell + Steven Garske + and + Clang AddressSanitizer + Clang UndefinedBehaviorSanitizer + codespell + GCC Farm Project + OSS-Fuzz + Sony Mobile + +Release 2.5.0 Tue October 25 2022 + Security fixes: + #616 #649 #650 CVE-2022-43680 -- Fix heap use-after-free after overeager + destruction of a shared DTD in function + XML_ExternalEntityParserCreate in out-of-memory situations. + Expected impact is denial of service or potentially + arbitrary code execution. + + Bug fixes: + #612 #645 Fix corruption from undefined entities + #613 #654 Fix case when parsing was suspended while processing nested + entities + #616 #652 #653 Stop leaking opening tag bindings after a closing tag + mismatch error where a parser is reset through + XML_ParserReset and then reused to parse + #656 CMake: Fix generation of pkg-config file + #658 MinGW|CMake: Fix static library name + + Other changes: + #663 Protect header expat_config.h from multiple inclusion + #666 examples: Make use of XML_GetBuffer and be more + consistent across examples + #648 Address compiler warnings + #667 #668 Version info bumped from 9:9:8 to 9:10:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Jann Horn + Mark Brand + Osyotr + Rhodri James + and + Google Project Zero + +Release 2.4.9 Tue September 20 2022 + Security fixes: + #629 #640 CVE-2022-40674 -- Heap use-after-free vulnerability in + function doContent. Expected impact is denial of service + or potentially arbitrary code execution. + + Bug fixes: + #634 MinGW: Fix mis-compilation for -D__USE_MINGW_ANSI_STDIO=0 + #614 docs: Fix documentation on effect of switch XML_DTD on + symbol visibility in doc/reference.html + + Other changes: + #638 MinGW: Make fix-xmltest-log.sh drop more Wine bug output + #596 #625 Autotools: Sync CMake templates with CMake 3.22 + #608 CMake: Migrate from use of CMAKE_*_POSTFIX to + dedicated variables EXPAT_*_POSTFIX to stop affecting + other projects + #597 #599 Windows|CMake: Add missing -DXML_STATIC to test runners + and fuzzers + #512 #621 Windows|CMake: Render .def file from a template to fix + linking with -DEXPAT_DTD=OFF and/or -DEXPAT_ATTR_INFO=ON + #611 #621 MinGW|CMake: Apply MSVC .def file when linking + #622 #624 MinGW|CMake: Sync library name with GNU Autotools, + i.e. produce libexpat-1.dll rather than libexpat.dll + by default. Filename libexpat.dll.a is unaffected. + #632 MinGW|CMake: Set missing variable CMAKE_RC_COMPILER in + toolchain file "cmake/mingw-toolchain.cmake" to avoid + error "windres: Command not found" on e.g. Ubuntu 20.04 + #597 #627 CMake: Unify inconsistent use of set() and option() in + context of public build time options to take need for + set(.. FORCE) in projects using Expat by means of + add_subdirectory(..) off Expat's users' shoulders + #626 #641 Stop exporting API symbols when building a static library + #644 Resolve use of deprecated "fgrep" by "grep -F" + #620 CMake: Make documentation on variables a bit more consistent + #636 CMake: Drop leading whitespace from a #cmakedefine line in + file expat_config.h.cmake + #594 xmlwf: Fix harmless variable mix-up in function nsattcmp + #592 #593 #610 Address Cppcheck warnings + #643 Address Clang 15 compiler warnings + #642 #644 Version info bumped from 9:8:8 to 9:9:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #597 #598 CI: Windows: Start covering MSVC 2022 + #619 CI: macOS: Migrate off deprecated macOS 10.15 + #632 CI: Linux: Make migration off deprecated Ubuntu 18.04 work + #643 CI: Upgrade Clang from 14 to 15 + #637 apply-clang-format.sh: Add support for BSD find + #633 coverage.sh: Exclude MinGW headers + #635 coverage.sh: Fix name collision for -funsigned-char + + Special thanks to: + David Faure + Felix Wilhelm + Frank Bergmann + Rhodri James + Rosen Penev + Thijs Schreijer + Vincent Torri + and + Google Project Zero + +Release 2.4.8 Mon March 28 2022 + Other changes: + #587 pkg-config: Move "-lm" to section "Libs.private" + #587 CMake|MSVC: Fix pkg-config section "Libs" + #55 #582 CMake|macOS: Start using linker arguments + "-compatibility_version " and + "-current_version " in a way compatible with + GNU Libtool + #590 #591 Version info bumped from 9:7:8 to 9:8:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #589 CI: Upgrade Clang from 13 to 14 + + Special thanks to: + evpobr + Kai Pastor + Sam James + +Release 2.4.7 Fri March 4 2022 + Bug fixes: + #572 #577 Relax fix to CVE-2022-25236 (introduced with release 2.4.5) + with regard to all valid URI characters (RFC 3986), + i.e. the following set (excluding whitespace): + ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz + 0123456789 % -._~ :/?#[]@ !$&'()*+,;= + + Other changes: + #555 #570 #581 CMake|Windows: Store Expat version in the DLL + #577 Document consequences of namespace separator choices not just + in doc/reference.html but also in header + #577 Document Expat's lack of validation of namespace URIs against + RFC 3986, and that the XML 1.0r4 specification doesn't + require Expat to validate namespace URIs, and that Expat + may do more in that regard in future releases. + If you find need for strict RFC 3986 URI validation on + application level today, https://uriparser.github.io/ may + be of interest. + #579 Fix documentation of XML_EndDoctypeDeclHandler in + #575 Document that a call to XML_FreeContentModel can be done at + a later time from outside the element declaration handler + #574 Make hardcoded namespace URIs easier to find in code + #573 Update documentation on use of XML_POOR_ENTOPY on Solaris + #569 #571 tests: Resolve use of macros NAN and INFINITY for GNU G++ + 4.8.2 on Solaris. + #578 #580 Version info bumped from 9:6:8 to 9:7:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Jeffrey Walton + Johnny Jazeix + Thijs Schreijer + +Release 2.4.6 Sun February 20 2022 + Bug fixes: + #566 Fix a regression introduced by the fix for CVE-2022-25313 + in release 2.4.5 that affects applications that (1) + call function XML_SetElementDeclHandler and (2) are + parsing XML that contains nested element declarations + (e.g. ""). + + Other changes: + #567 #568 Version info bumped from 9:5:8 to 9:6:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Matt Sergeant + Samanta Navarro + Sergei Trofimovich + and + NixOS + Perl XML::Parser + +Release 2.4.5 Fri February 18 2022 + Security fixes: + #562 CVE-2022-25235 -- Passing malformed 2- and 3-byte UTF-8 + sequences (e.g. from start tag names) to the XML + processing application on top of Expat can cause + arbitrary damage (e.g. code execution) depending + on how invalid UTF-8 is handled inside the XML + processor; validation was not their job but Expat's. + Exploits with code execution are known to exist. + #561 CVE-2022-25236 -- Passing (one or more) namespace separator + characters in "xmlns[:prefix]" attribute values + made Expat send malformed tag names to the XML + processor on top of Expat which can cause + arbitrary damage (e.g. code execution) depending + on such unexpectable cases are handled inside the XML + processor; validation was not their job but Expat's. + Exploits with code execution are known to exist. + #558 CVE-2022-25313 -- Fix stack exhaustion in doctype parsing + that could be triggered by e.g. a 2 megabytes + file with a large number of opening braces. + Expected impact is denial of service or potentially + arbitrary code execution. + #560 CVE-2022-25314 -- Fix integer overflow in function copyString; + only affects the encoding name parameter at parser creation + time which is often hardcoded (rather than user input), + takes a value in the gigabytes to trigger, and a 64-bit + machine. Expected impact is denial of service. + #559 CVE-2022-25315 -- Fix integer overflow in function storeRawNames; + needs input in the gigabytes and a 64-bit machine. + Expected impact is denial of service or potentially + arbitrary code execution. + + Other changes: + #557 #564 Version info bumped from 9:4:8 to 9:5:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Ivan Fratric + Samanta Navarro + and + Google Project Zero + JetBrains + +Release 2.4.4 Sun January 30 2022 + Security fixes: + #550 CVE-2022-23852 -- Fix signed integer overflow + (undefined behavior) in function XML_GetBuffer + (that is also called by function XML_Parse internally) + for when XML_CONTEXT_BYTES is defined to >0 (which is both + common and default). + Impact is denial of service or more. + #551 CVE-2022-23990 -- Fix unsigned integer overflow in function + doProlog triggered by large content in element type + declarations when there is an element declaration handler + present (from a prior call to XML_SetElementDeclHandler). + Impact is denial of service or more. + + Bug fixes: + #544 #545 xmlwf: Fix a memory leak on output file opening error + + Other changes: + #546 Autotools: Fix broken CMake support under Cygwin + #554 Windows: Add missing files to the installer to fix + compilation with CMake from installed sources + #552 #554 Version info bumped from 9:3:8 to 9:4:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Carlo Bramini + hwt0415 + Roland Illig + Samanta Navarro + and + Clang LeakSan and the Clang team + +Release 2.4.3 Sun January 16 2022 + Security fixes: + #531 #534 CVE-2021-45960 -- Fix issues with left shifts by >=29 places + resulting in + a) realloc acting as free + b) realloc allocating too few bytes + c) undefined behavior + depending on architecture and precise value + for XML documents with >=2^27+1 prefixed attributes + on a single XML tag a la + "" + where XML_ParserCreateNS is used to create the parser + (which needs argument "-n" when running xmlwf). + Impact is denial of service, or more. + #532 #538 CVE-2021-46143 (ZDI-CAN-16157) -- Fix integer overflow + on variable m_groupSize in function doProlog leading + to realloc acting as free. + Impact is denial of service or more. + #539 CVE-2022-22822 to CVE-2022-22827 -- Prevent integer overflows + near memory allocation at multiple places. Mitre assigned + a dedicated CVE for each involved internal C function: + - CVE-2022-22822 for function addBinding + - CVE-2022-22823 for function build_model + - CVE-2022-22824 for function defineAttribute + - CVE-2022-22825 for function lookup + - CVE-2022-22826 for function nextScaffoldPart + - CVE-2022-22827 for function storeAtts + Impact is denial of service or more. + + Other changes: + #535 CMake: Make call to file(GENERATE [..]) work for CMake <3.19 + #541 Autotools|CMake: MinGW: Make run.sh(.in) work for Cygwin + and MSYS2 by not going through Wine on these platforms + #527 #528 Address compiler warnings + #533 #543 Version info bumped from 9:2:8 to 9:3:8; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #536 CI: Check for realistic minimum CMake version + #529 #539 CI: Cover compilation with -m32 + #529 CI: Store coverage reports as artifacts for download + #528 CI: Upgrade Clang from 11 to 13 + + Special thanks to: + An anonymous whitehat + Christopher Degawa + J. Peter Mugaas + Tyson Smith + and + GCC Farm Project + Trend Micro Zero Day Initiative + +Release 2.4.2 Sun December 19 2021 + Other changes: + #509 #510 Link againgst libm for function "isnan" + #513 #514 Include expat_config.h as early as possible + #498 Autotools: Include files with release archives: + - buildconf.sh + - fuzz/*.c + #507 #519 Autotools: Sync CMake templates with CMake 3.20 + #495 #524 CMake: MinGW: Fix pkg-config section "Libs" for + - non-release build types (e.g. -DCMAKE_BUILD_TYPE=Debug) + - multi-config CMake generators (e.g. Ninja Multi-Config) + #502 #503 docs: Document that function XML_GetBuffer may return NULL + when asking for a buffer of 0 (zero) bytes size + #522 #523 docs: Fix return value docs for both + XML_SetBillionLaughsAttackProtection* functions + #525 #526 Version info bumped from 9:1:8 to 9:2:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Donghee Na + Joergen Ibsen + Kai Pastor + +Release 2.4.1 Sun May 23 2021 + Bug fixes: + #488 #490 Autotools: Fix installed header expat_config.h for multilib + systems; regression introduced in 2.4.0 by pull request #486 + + Other changes: + #491 #492 Version info bumped from 9:0:8 to 9:1:8; + see https://verbump.de/ for what these numbers do + + Special thanks to: + Gentoo's QA check "multilib_check_headers" + +Release 2.4.0 Sun May 23 2021 + Security fixes: + #34 #466 #484 CVE-2013-0340/CWE-776 -- Protect against billion laughs attacks + (denial-of-service; flavors targeting CPU time or RAM or both, + leveraging general entities or parameter entities or both) + by tracking and limiting the input amplification factor + ( := ( + ) / ). + By conservative default, amplification up to a factor of 100.0 + is tolerated and rejection only starts after 8 MiB of output bytes + (= + ) have been processed. + The fix adds the following to the API: + - A new error code XML_ERROR_AMPLIFICATION_LIMIT_BREACH to + signals this specific condition. + - Two new API functions .. + - XML_SetBillionLaughsAttackProtectionMaximumAmplification and + - XML_SetBillionLaughsAttackProtectionActivationThreshold + .. to further tighten billion laughs protection parameters + when desired. Please see file "doc/reference.html" for details. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + - Two new XML_FEATURE_* constants .. + - that can be queried using the XML_GetFeatureList function, and + - that are shown in "xmlwf -v" output. + - Two new environment variable switches .. + - EXPAT_ACCOUNTING_DEBUG=(0|1|2|3) and + - EXPAT_ENTITY_DEBUG=(0|1) + .. for runtime debugging of accounting and entity processing. + Specific behavior of these values may change in the future. + - Two new command line arguments "-a FACTOR" and "-b BYTES" + for xmlwf to further tighten billion laughs protection + parameters when desired. + If you ever need to increase the defaults for non-attack XML + payload, please file a bug report with libexpat. + + Bug fixes: + #332 #470 For (non-default) compilation with -DEXPAT_MIN_SIZE=ON (CMake) + or CPPFLAGS=-DXML_MIN_SIZE (GNU Autotools): Fix segfault + for UTF-16 payloads containing CDATA sections. + #485 #486 Autotools: Fix generated CMake files for non-64bit and + non-Linux platforms (e.g. macOS and MinGW in particular) + that were introduced with release 2.3.0 + + Other changes: + #468 #469 xmlwf: Improve help output and the xmlwf man page + #463 xmlwf: Improve maintainability through some refactoring + #477 xmlwf: Fix man page DocBook validity + #456 Autotools: Sync CMake templates with CMake 3.18 + #458 #459 CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR + and CMAKE_INSTALL_INCLUDEDIR + #471 #481 CMake: Add support for standard variable BUILD_SHARED_LIBS + #457 Unexpose symbol _INTERNAL_trim_to_complete_utf8_characters + #467 Resolve macro HAVE_EXPAT_CONFIG_H + #472 Delete unused legacy helper file "conftools/PrintPath" + #473 #483 Improve attribution + #464 #465 #477 doc/reference.html: Fix XHTML validity + #475 #478 doc/reference.html: Replace the 90s look by OK.css + #479 Version info bumped from 8:0:7 to 9:0:8 + due to addition of new symbols and error codes; + see https://verbump.de/ for what these numbers do + + Infrastructure: + #456 CI: Enable periodic runs + #457 CI: Start covering the list of exported symbols + #474 CI: Isolate coverage task + #476 #482 CI: Adapt to breaking changes in image "ubuntu-18.04" + #477 CI: Cover well-formedness and DocBook/XHTML validity + of doc/reference.html and doc/xmlwf.xml + + Special thanks to: + Dimitry Andric + Eero Helenius + Nick Wellnhofer + Rhodri James + Tomas Korbar + Yury Gribov + and + Clang LeakSan + JetBrains + OSS-Fuzz + +Release 2.3.0 Thu March 25 2021 + Bug fixes: + #438 When calling XML_ParseBuffer without a prior successful call to + XML_GetBuffer as a user, no longer trigger undefined behavior + (by adding an integer to a NULL pointer) but rather return + XML_STATUS_ERROR and set the error code to (new) code + XML_ERROR_NO_BUFFER. Found by UBSan (UndefinedBehaviorSanitizer) + of Clang 11 (but not Clang 9). + #444 xmlwf: Exit status 2 was used for both: + - malformed input files (documented) and + - invalid command-line arguments (undocumented). + The case of invalid command-line arguments now + has its own exit status 4, resolving the ambiguity. + + Other changes: + #439 xmlwf: Add argument -k to allow continuing after + non-fatal errors + #439 xmlwf: Add section about exit status to the -h help output + #422 #426 #447 Windows: Drop support for Visual Studio <=14.0/2015 + #434 Windows: CMake: Detect unsupported Visual Studio at + configure time (rather than at compile time) + #382 #428 testrunner: Make verbose mode (argument "-v") report + about passed tests, and make default mode report about + failures, as well. + #442 CMake: Call "enable_language(CXX)" prior to tinkering + with CMAKE_CXX_* variables + #448 Document use of libexpat from a CMake-based project + #451 Autotools: Install CMake files as generated by CMake 3.19.6 + so that users with "find_package(expat [..] CONFIG [..])" + are served on distributions that are *not* using the CMake + build system inside for libexpat packaging + #436 #437 Autotools: Drop obsolescent macro AC_HEADER_STDC + #450 #452 Autotools: Resolve use of obsolete macro AC_CONFIG_HEADER + #441 Address compiler warnings + #443 Version info bumped from 7:12:6 to 8:0:7 + due to addition of error code XML_ERROR_NO_BUFFER + (see https://verbump.de/ for what these numbers do) + + Infrastructure: + #435 #446 Replace Travis CI by GitHub Actions + + Special thanks to: + Alexander Richardson + Oleksandr Popovych + Thomas Beutlich + Tim Bray + and + Clang LeakSan, Clang 11 UBSan and the Clang team Release 2.2.10 Sat October 3 2020 Bug fixes: @@ -46,7 +782,7 @@ Release 2.2.10 Sat October 3 2020 #354 #355 .. #356 #412 Address compiler warnings #368 #369 Address pngcheck warnings with doc/*.png images - Version info bumped from 7:11:6 to 7:12:6 + #425 Version info bumped from 7:11:6 to 7:12:6 Special thanks to: asavah diff --git a/3rdparty/expat/ConfigureChecks.cmake b/3rdparty/expat/ConfigureChecks.cmake index d85e48c972dbe..c06b2f27857ab 100644 --- a/3rdparty/expat/ConfigureChecks.cmake +++ b/3rdparty/expat/ConfigureChecks.cmake @@ -2,6 +2,7 @@ include(CheckCCompilerFlag) include(CheckCSourceCompiles) include(CheckIncludeFile) include(CheckIncludeFiles) +include(CheckLibraryExists) include(CheckSymbolExists) include(TestBigEndian) @@ -45,18 +46,25 @@ else(WORDS_BIGENDIAN) endif(WORDS_BIGENDIAN) if(HAVE_SYS_TYPES_H) - check_symbol_exists("off_t" "sys/types.h" OFF_T) - check_symbol_exists("size_t" "sys/types.h" SIZE_T) -else(HAVE_SYS_TYPES_H) - set(OFF_T "long") - set(SIZE_T "unsigned") -endif(HAVE_SYS_TYPES_H) + check_c_source_compiles(" + #include + int main(void) { + const off_t offset = -123; + return 0; + }" + HAVE_OFF_T) +endif() + +if(NOT HAVE_OFF_T) + set(off_t "long") +endif() check_c_source_compiles(" + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; }" @@ -64,3 +72,5 @@ check_c_source_compiles(" check_c_compiler_flag("-fno-strict-aliasing" FLAG_NO_STRICT_ALIASING) check_c_compiler_flag("-fvisibility=hidden" FLAG_VISIBILITY) + +check_library_exists(m cos "" _EXPAT_LIBM_FOUND) diff --git a/3rdparty/expat/Makefile.am b/3rdparty/expat/Makefile.am index 5e1d37dd1a830..3a7f0a0e9503e 100644 --- a/3rdparty/expat/Makefile.am +++ b/3rdparty/expat/Makefile.am @@ -6,7 +6,12 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2023 Sebastian Pipping +# Copyright (c) 2018 KangLin +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smrgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -53,20 +58,36 @@ pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ + + _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt + win32/README.txt \ + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -74,11 +95,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ @@ -92,10 +116,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 @@ -110,6 +134,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/3rdparty/expat/Makefile.in b/3rdparty/expat/Makefile.in index ab846398cb718..2c7025471912c 100644 --- a/3rdparty/expat/Makefile.in +++ b/3rdparty/expat/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,12 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2023 Sebastian Pipping +# Copyright (c) 2018 KangLin +# Copyright (c) 2022 Johnny Jazeix +# Copyright (c) 2023 Sony Corporation / Snild Dolkow +# Copyright (c) 2024 Alexander Bluhm +# Copyright (c) 2024 Dag-Erling Smrgrav # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -134,16 +139,20 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ - $(am__configure_deps) $(am__DIST_COMMON) + $(am__configure_deps) $(dist_cmake_DATA) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = expat_config.h -CONFIG_CLEAN_FILES = expat.pc run.sh +CONFIG_CLEAN_FILES = expat.pc cmake/expat-config.cmake \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake run.sh CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) @@ -199,8 +208,9 @@ am__uninstall_files_from_dir = { \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -am__installdirs = "$(DESTDIR)$(pkgconfigdir)" -DATA = $(pkgconfig_DATA) +am__installdirs = "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" \ + "$(DESTDIR)$(pkgconfigdir)" +DATA = $(dist_cmake_DATA) $(nodist_cmake_DATA) $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ @@ -227,18 +237,17 @@ am__define_uniq_tagged_files = \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` -ETAGS = etags -CTAGS = ctags -CSCOPE = cscope DIST_SUBDIRS = lib examples tests xmlwf doc am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/expat.pc.in \ $(srcdir)/expat_config.h.in $(srcdir)/run.sh.in \ + $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in \ + $(top_srcdir)/cmake/expat-config.cmake.in \ $(top_srcdir)/conftools/ar-lib $(top_srcdir)/conftools/compile \ $(top_srcdir)/conftools/config.guess \ $(top_srcdir)/conftools/config.sub \ $(top_srcdir)/conftools/install-sh \ $(top_srcdir)/conftools/ltmain.sh \ - $(top_srcdir)/conftools/missing AUTHORS COPYING \ + $(top_srcdir)/conftools/missing AUTHORS COPYING README.md \ conftools/ar-lib conftools/compile conftools/config.guess \ conftools/config.sub conftools/depcomp conftools/install-sh \ conftools/ltmain.sh conftools/missing @@ -281,6 +290,8 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.lz \ $(distdir).tar.xz GZIP_ENV = --best DIST_TARGETS = dist-lzip dist-xz dist-bzip2 dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -301,8 +312,10 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ +CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -318,10 +331,20 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ +EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ +EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ +EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ +EXPAT_DTD = @EXPAT_DTD@ +EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ +EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ +EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -331,6 +354,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -339,6 +364,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -360,9 +386,12 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ -_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -429,20 +458,34 @@ LIBTOOLFLAGS = --verbose SUBDIRS = lib $(am__append_1) $(am__append_2) $(am__append_3) pkgconfig_DATA = expat.pc pkgconfigdir = $(libdir)/pkgconfig +dist_cmake_DATA = \ + cmake/autotools/expat.cmake + +nodist_cmake_DATA = \ + cmake/autotools/expat-config-version.cmake \ + cmake/autotools/expat-noconfig.cmake \ + cmake/expat-config.cmake + +cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@ _EXTRA_DIST_CMAKE = \ - cmake/expat-config.cmake.in \ + cmake/autotools/expat-noconfig__linux.cmake.in \ + cmake/autotools/expat-noconfig__macos.cmake.in \ + cmake/autotools/expat-noconfig__windows.cmake.in \ + cmake/autotools/expat-package-init.cmake \ cmake/mingw-toolchain.cmake \ \ CMakeLists.txt \ CMake.README \ ConfigureChecks.cmake \ + expat.pc.cmake \ expat_config.h.cmake _EXTRA_DIST_WINDOWS = \ win32/build_expat_iss.bat \ win32/expat.iss \ win32/MANIFEST.txt \ - win32/README.txt + win32/README.txt \ + win32/version.rc.cmake EXTRA_DIST = \ $(_EXTRA_DIST_CMAKE) \ @@ -450,11 +493,14 @@ EXTRA_DIST = \ \ conftools/expat.m4 \ conftools/get-version.sh \ - conftools/PrintPath \ + \ + fuzz/xml_parsebuffer_fuzzer.c \ + fuzz/xml_parse_fuzzer.c \ \ xmlwf/xmlwf_helpgen.py \ xmlwf/xmlwf_helpgen.sh \ \ + buildconf.sh \ Changes \ README.md \ \ @@ -467,7 +513,7 @@ all: expat_config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -493,9 +539,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -506,7 +552,7 @@ expat_config.h: stamp-h1 stamp-h1: $(srcdir)/expat_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status expat_config.h -$(srcdir)/expat_config.h.in: $(am__configure_deps) +$(srcdir)/expat_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -515,6 +561,12 @@ distclean-hdr: -rm -f expat_config.h stamp-h1 expat.pc: $(top_builddir)/config.status $(srcdir)/expat.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/expat-config.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/expat-config.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-config-version.cmake: $(top_builddir)/config.status $(top_srcdir)/cmake/autotools/expat-config-version.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +cmake/autotools/expat-noconfig.cmake: $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ run.sh: $(top_builddir)/config.status $(srcdir)/run.sh.in cd $(top_builddir) && $(SHELL) ./config.status $@ @@ -526,6 +578,48 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-dist_cmakeDATA: $(dist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-dist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) +install-nodist_cmakeDATA: $(nodist_cmake_DATA) + @$(NORMAL_INSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(cmakedir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(cmakedir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(cmakedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(cmakedir)" || exit $$?; \ + done + +uninstall-nodist_cmakeDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_cmake_DATA)'; test -n "$(cmakedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(cmakedir)'; $(am__uninstall_files_from_dir) install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ @@ -653,7 +747,6 @@ cscopelist-am: $(am__tagged_files) distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files - distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -797,7 +890,7 @@ distcheck: dist $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -853,7 +946,7 @@ check: check-recursive all-am: Makefile $(DATA) expat_config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ + for dir in "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(cmakedir)" "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -908,7 +1001,8 @@ info: info-recursive info-am: -install-data-am: install-pkgconfigDATA +install-data-am: install-dist_cmakeDATA install-nodist_cmakeDATA \ + install-pkgconfigDATA install-dvi: install-dvi-recursive @@ -954,7 +1048,8 @@ ps: ps-recursive ps-am: -uninstall-am: uninstall-pkgconfigDATA +uninstall-am: uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ + uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) all install-am install-strip @@ -966,14 +1061,16 @@ uninstall-am: uninstall-pkgconfigDATA distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ + install-data install-data-am install-dist_cmakeDATA \ + install-dvi install-dvi-am install-exec install-exec-am \ + install-html install-html-am install-info install-info-am \ + install-man install-nodist_cmakeDATA install-pdf \ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-dist_cmakeDATA uninstall-nodist_cmakeDATA \ uninstall-pkgconfigDATA .PRECIOUS: Makefile @@ -985,10 +1082,10 @@ buildlib: @echo 'ERROR: is no longer supported. INSTEAD please:' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2 - @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2 + @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2 - @echo 'ERROR: -i {} +' >&2 + @echo 'ERROR: -i.bak {} +' >&2 @echo 'ERROR:' >&2 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2 @echo 'ERROR:' >&2 @@ -1002,6 +1099,11 @@ buildlib: run-benchmark: $(MAKE) -C tests/benchmark ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3 + ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3 .PHONY: download-xmlts-zip download-xmlts-zip: diff --git a/3rdparty/expat/README.md b/3rdparty/expat/README.md index 428a11ab2450e..2a90b3761374c 100644 --- a/3rdparty/expat/README.md +++ b/3rdparty/expat/README.md @@ -1,12 +1,21 @@ -[![Travis CI Build Status](https://travis-ci.org/libexpat/libexpat.svg?branch=master)](https://travis-ci.org/libexpat/libexpat) +[![Run Linux CI tasks](https://github.com/libexpat/libexpat/actions/workflows/linux.yml/badge.svg)](https://github.com/libexpat/libexpat/actions/workflows/linux.yml) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/libexpat/libexpat?svg=true)](https://ci.appveyor.com/project/libexpat/libexpat) [![Packaging status](https://repology.org/badge/tiny-repos/expat.svg)](https://repology.org/metapackage/expat/versions) +[![Downloads SourceForge](https://img.shields.io/sourceforge/dt/expat?label=Downloads%20SourceForge)](https://sourceforge.net/projects/expat/files/) +[![Downloads GitHub](https://img.shields.io/github/downloads/libexpat/libexpat/total?label=Downloads%20GitHub)](https://github.com/libexpat/libexpat/releases) +> [!CAUTION] +> +> Expat is **understaffed** and without funding. +> There is a [call for help with details](https://github.com/libexpat/libexpat/blob/master/expat/Changes) +> at the top of the `Changes` file. -# Expat, Release 2.2.10 -This is Expat, a C library for parsing XML, started by -[James Clark](https://en.wikipedia.org/wiki/James_Clark_(programmer)) in 1997. +# Expat, Release 2.6.4 + +This is Expat, a C99 library for parsing +[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by +[James Clark](https://en.wikipedia.org/wiki/James_Clark_%28programmer%29) in 1997. Expat is a stream-oriented XML parser. This means that you register handlers with the parser before starting the parse. These handlers are called when the parser discovers the associated structures in the @@ -14,13 +23,14 @@ document being parsed. A start tag is an example of the kind of structures for which you may register handlers. Expat supports the following compilers: + - GNU GCC >=4.5 - LLVM Clang >=3.5 -- Microsoft Visual Studio >=9.0/2008 +- Microsoft Visual Studio >=16.0/2019 (rolling `${today} minus 5 years`) Windows users can use the -[`expat_win32` package](https://sourceforge.net/projects/expat/files/expat_win32/), -which includes both precompiled libraries and executables, and source code for +[`expat-win32bin-*.*.*.{exe,zip}` download](https://github.com/libexpat/libexpat/releases), +which includes both pre-compiled libraries and executables, and source code for developers. Expat is [free software](https://www.gnu.org/philosophy/free-sw.en.html). @@ -30,6 +40,106 @@ contained in the file distributed with this package. This license is the same as the MIT/X Consortium license. + +## Using libexpat in your CMake-Based Project + +There are three documented ways of using libexpat with CMake: + +### a) `find_package` with Module Mode + +This approach leverages CMake's own [module `FindEXPAT`](https://cmake.org/cmake/help/latest/module/FindEXPAT.html). + +Notice the *uppercase* `EXPAT` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) # or 3.10, see below + +project(hello VERSION 1.0.0) + +find_package(EXPAT 2.2.8 MODULE REQUIRED) + +add_executable(hello + hello.c +) + +# a) for CMake >=3.10 (see CMake's FindEXPAT docs) +target_link_libraries(hello PUBLIC EXPAT::EXPAT) + +# b) for CMake >=3.0 +target_include_directories(hello PRIVATE ${EXPAT_INCLUDE_DIRS}) +target_link_libraries(hello PUBLIC ${EXPAT_LIBRARIES}) +``` + +### b) `find_package` with Config Mode + +This approach requires files from + +- libexpat >=2.2.8 where packaging uses the CMake build system +or +- libexpat >=2.3.0 where packaging uses the GNU Autotools build system + on Linux +or +- libexpat >=2.4.0 where packaging uses the GNU Autotools build system + on macOS or MinGW. + +Notice the *lowercase* `expat` in the following example: + +```cmake +cmake_minimum_required(VERSION 3.0) + +project(hello VERSION 1.0.0) + +find_package(expat 2.2.8 CONFIG REQUIRED char dtd ns) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat::expat) +``` + +### c) The `FetchContent` module + +This approach as demonstrated below requires CMake >=3.18 for both the +[`FetchContent` module](https://cmake.org/cmake/help/latest/module/FetchContent.html) +and its support for the `SOURCE_SUBDIR` option to be available. + +Please note that: +- Use of the `FetchContent` module with *non-release* SHA1s or `master` + of libexpat is neither advised nor considered officially supported. +- Pinning to a specific commit is great for robust CI. +- Pinning to a specific commit needs updating every time there is a new + release of libexpat either manually or through automation , + to not miss out on libexpat security updates. + +For an example that pulls in libexpat via Git: + +```cmake +cmake_minimum_required(VERSION 3.18) + +include(FetchContent) + +project(hello VERSION 1.0.0) + +FetchContent_Declare( + expat + GIT_REPOSITORY https://github.com/libexpat/libexpat/ + GIT_TAG 000000000_GIT_COMMIT_SHA1_HERE_000000000 # i.e. Git tag R_0_Y_Z + SOURCE_SUBDIR expat/ +) + +FetchContent_MakeAvailable(expat) + +add_executable(hello + hello.c +) + +target_link_libraries(hello PUBLIC expat) +``` + + +## Building from a Git Clone + If you are building Expat from a check-out from the [Git repository](https://github.com/libexpat/libexpat/), you need to run a script that generates the configure script using the @@ -43,6 +153,11 @@ autoconf 2.58 or newer. Run the script like this: Once this has been done, follow the same instructions as for building from a source distribution. + +## Building from a Source Distribution + +### a) Building with the configure script (i.e. GNU Autotools) + To build Expat from a source distribution, you first run the configuration shell script in the top level distribution directory: @@ -88,10 +203,10 @@ support this mode of compilation (yet): 1. Mass-patch `Makefile.am` files to use `libexpatw.la` for a library name:
      - `find -name Makefile.am -exec sed + `find . -name Makefile.am -exec sed -e 's,libexpat\.la,libexpatw.la,' -e 's,libexpat_la,libexpatw_la,' - -i {} +` + -i.bak {} +` 1. Run `automake` to re-write `Makefile.in` files:
      `automake` @@ -132,8 +247,14 @@ A reference manual is available in the file `doc/reference.html` in this distribution. -The CMake build system is still *experimental* and will replace the primary +### b) Building with CMake + +The CMake build system is still *experimental* and may replace the primary build system based on GNU Autotools at some point when it is ready. + + +#### Available Options + For an idea of the available (non-advanced) options for building with CMake: ```console @@ -147,37 +268,37 @@ CMAKE_INSTALL_PREFIX:PATH=/usr/local // Path to a program. DOCBOOK_TO_MAN:FILEPATH=/usr/bin/docbook2x-man -// build man page for xmlwf +// Build man page for xmlwf EXPAT_BUILD_DOCS:BOOL=ON -// build the examples for expat library +// Build the examples for expat library EXPAT_BUILD_EXAMPLES:BOOL=ON -// build fuzzers for the expat library +// Build fuzzers for the expat library EXPAT_BUILD_FUZZERS:BOOL=OFF -// build pkg-config file +// Build pkg-config file EXPAT_BUILD_PKGCONFIG:BOOL=ON -// build the tests for expat library +// Build the tests for expat library EXPAT_BUILD_TESTS:BOOL=ON -// build the xmlwf tool for expat library +// Build the xmlwf tool for expat library EXPAT_BUILD_TOOLS:BOOL=ON // Character type to use (char|ushort|wchar_t) [default=char] EXPAT_CHAR_TYPE:STRING=char -// install expat files in cmake install target +// Install expat files in cmake install target EXPAT_ENABLE_INSTALL:BOOL=ON // Use /MT flag (static CRT) when compiling in MSVC EXPAT_MSVC_STATIC_CRT:BOOL=OFF -// build fuzzers via ossfuzz for the expat library +// Build fuzzers via ossfuzz for the expat library EXPAT_OSSFUZZ_BUILD:BOOL=OFF -// build a shared expat library +// Build a shared expat library EXPAT_SHARED_LIBS:BOOL=ON // Treat all compiler warnings as errors @@ -186,7 +307,7 @@ EXPAT_WARNINGS_AS_ERRORS:BOOL=OFF // Make use of getrandom function (ON|OFF|AUTO) [default=AUTO] EXPAT_WITH_GETRANDOM:STRING=AUTO -// utilize libbsd (for arc4random_buf) +// Utilize libbsd (for arc4random_buf) EXPAT_WITH_LIBBSD:BOOL=OFF // Make use of syscall SYS_getrandom (ON|OFF|AUTO) [default=AUTO] diff --git a/3rdparty/expat/acinclude.m4 b/3rdparty/expat/acinclude.m4 index 7277ab29bbb9b..498f709bdf952 100644 --- a/3rdparty/expat/acinclude.m4 +++ b/3rdparty/expat/acinclude.m4 @@ -8,5 +8,7 @@ m4_include(conftools/ax-append-flag.m4) m4_include(conftools/ax-append-compile-flags.m4) m4_include(conftools/ax-append-link-flags.m4) m4_include(conftools/expatcfg-compiler-supports-visibility.m4) +m4_include(conftools/ax-cxx-compile-stdcxx.m4) +m4_include(conftools/ax-cxx-compile-stdcxx-11.m4) ### end of file diff --git a/3rdparty/expat/aclocal.m4 b/3rdparty/expat/aclocal.m4 index b8cb1fc8ca05c..8a0016bd4e22d 100644 --- a/3rdparty/expat/aclocal.m4 +++ b/3rdparty/expat/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.2 -*- Autoconf -*- +# generated automatically by aclocal 1.16.5 -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2020 Free Software Foundation, Inc. +# Copyright (C) 2002-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.2], [], +m4_if([$1], [1.16.5], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,12 +51,12 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.2])dnl +[AM_AUTOMAKE_VERSION([1.16.5])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -118,7 +118,7 @@ AC_SUBST([AR])dnl # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -170,7 +170,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd` # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -201,7 +201,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -392,7 +392,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -460,7 +460,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -488,6 +488,10 @@ m4_defn([AC_PROG_CC]) # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl +m4_ifdef([_$0_ALREADY_INIT], + [m4_fatal([$0 expanded multiple times +]m4_defn([_$0_ALREADY_INIT]))], + [m4_define([_$0_ALREADY_INIT], m4_expansion_stack)])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -524,7 +528,7 @@ m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( - m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + m4_ifset([AC_PACKAGE_NAME], [ok]):m4_ifset([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl @@ -576,6 +580,20 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi +AC_SUBST([CTAGS]) +if test -z "$ETAGS"; then + ETAGS=etags +fi +AC_SUBST([ETAGS]) +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi +AC_SUBST([CSCOPE]) + AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This @@ -657,7 +675,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -678,7 +696,7 @@ if test x"${install_sh+set}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2020 Free Software Foundation, Inc. +# Copyright (C) 2003-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -697,9 +715,45 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996-2021 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless 'enable' is passed literally. +# For symmetry, 'disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], + [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], + am_maintainer_other[ make rules and dependencies not useful + (and sometimes confusing) to the casual installer])], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -742,7 +796,7 @@ AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2020 Free Software Foundation, Inc. +# Copyright (C) 1997-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -763,12 +817,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -781,7 +830,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -810,7 +859,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -857,7 +906,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -876,7 +925,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2020 Free Software Foundation, Inc. +# Copyright (C) 1996-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -957,7 +1006,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2020 Free Software Foundation, Inc. +# Copyright (C) 2009-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1017,7 +1066,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2020 Free Software Foundation, Inc. +# Copyright (C) 2001-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1045,7 +1094,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2020 Free Software Foundation, Inc. +# Copyright (C) 2006-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1064,7 +1113,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2020 Free Software Foundation, Inc. +# Copyright (C) 2004-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/3rdparty/expat/buildconf.sh b/3rdparty/expat/buildconf.sh new file mode 100755 index 0000000000000..4e506b30082bf --- /dev/null +++ b/3rdparty/expat/buildconf.sh @@ -0,0 +1,35 @@ +#! /usr/bin/env bash +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2017-2022 Sebastian Pipping +# Copyright (c) 2018 Marco Maggi +# Copyright (c) 2024 Dag-Erling Smørgrav +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. + +set -e + +exec autoreconf --warnings=all --install --verbose "$@" diff --git a/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in new file mode 100644 index 0000000000000..17ab1924c35a5 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-config-version.cmake.in @@ -0,0 +1,65 @@ +# This is a basic version file for the Config-mode of find_package(). +# It is used by write_basic_package_version_file() as input file for configure_file() +# to create a version-file which can be installed along a config.cmake file. +# +# The created file sets PACKAGE_VERSION_EXACT if the current version string and +# the requested version string are exactly the same and it sets +# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, +# but only if the requested major version is the same as the current one. +# The variable CVF_VERSION must be set before calling configure_file(). + + +set(PACKAGE_VERSION "@PACKAGE_VERSION@") + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + if("@PACKAGE_VERSION@" MATCHES "^([0-9]+)\\.") + set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") + if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) + string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") + endif() + else() + set(CVF_VERSION_MAJOR "@PACKAGE_VERSION@") + endif() + + if(PACKAGE_FIND_VERSION_RANGE) + # both endpoints of the range must have the expected major version + math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") + if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) + set(PACKAGE_VERSION_COMPATIBLE FALSE) + elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR + AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) + OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + else() + if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() + endif() +endif() + + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@SIZEOF_VOID_P@") + math(EXPR installedBits "@SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in new file mode 100644 index 0000000000000..d0ad645c03f5d --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__linux.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" + IMPORTED_SONAME_NOCONFIG "libexpat.so.@SO_MAJOR@" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.so.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in new file mode 100644 index 0000000000000..bb48d9810ee84 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__macos.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" + IMPORTED_SONAME_NOCONFIG "@rpath/libexpat.@SO_MAJOR@.dylib" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.@SO_MAJOR@.@SO_MINOR@.@SO_PATCH@.dylib" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in new file mode 100644 index 0000000000000..2f7454e2ca2e7 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-noconfig__windows.cmake.in @@ -0,0 +1,19 @@ +#---------------------------------------------------------------- +# Generated CMake target import file for configuration "NoConfig". +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Import target "expat::expat" for configuration "NoConfig" +set_property(TARGET expat::expat APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG) +set_target_properties(expat::expat PROPERTIES + IMPORTED_IMPLIB_NOCONFIG "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" + IMPORTED_LOCATION_NOCONFIG "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" + ) + +list(APPEND _cmake_import_check_targets expat::expat ) +list(APPEND _cmake_import_check_files_for_expat::expat "${_IMPORT_PREFIX}/@LIBDIR_BASENAME@/libexpat.dll.a" "${_IMPORT_PREFIX}/bin/@CMAKE_SHARED_LIBRARY_PREFIX@expat-@SO_MAJOR@.dll" ) + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) diff --git a/3rdparty/expat/cmake/autotools/expat-package-init.cmake b/3rdparty/expat/cmake/autotools/expat-package-init.cmake new file mode 100644 index 0000000000000..5cf17705329ca --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat-package-init.cmake @@ -0,0 +1,25 @@ + +####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### +####### Any changes to this file will be overwritten by the next CMake run #### +####### The input file was expat-config.cmake.in ######## + +get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) + +macro(set_and_check _var _file) + set(${_var} "${_file}") + if(NOT EXISTS "${_file}") + message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") + endif() +endmacro() + +macro(check_required_components _NAME) + foreach(comp ${${_NAME}_FIND_COMPONENTS}) + if(NOT ${_NAME}_${comp}_FOUND) + if(${_NAME}_FIND_REQUIRED_${comp}) + set(${_NAME}_FOUND FALSE) + endif() + endif() + endforeach() +endmacro() + +#################################################################################### diff --git a/3rdparty/expat/cmake/autotools/expat.cmake b/3rdparty/expat/cmake/autotools/expat.cmake new file mode 100644 index 0000000000000..7850358bb3a17 --- /dev/null +++ b/3rdparty/expat/cmake/autotools/expat.cmake @@ -0,0 +1,107 @@ +# Generated by CMake + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) + message(FATAL_ERROR "CMake >= 2.8.0 required") +endif() +if(CMAKE_VERSION VERSION_LESS "2.8.12") + message(FATAL_ERROR "CMake >= 2.8.12 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.8.12...3.28) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_cmake_targets_defined "") +set(_cmake_targets_not_defined "") +set(_cmake_expected_targets "") +foreach(_cmake_expected_target IN ITEMS expat::expat) + list(APPEND _cmake_expected_targets "${_cmake_expected_target}") + if(TARGET "${_cmake_expected_target}") + list(APPEND _cmake_targets_defined "${_cmake_expected_target}") + else() + list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") + endif() +endforeach() +unset(_cmake_expected_target) +if(_cmake_targets_defined STREQUAL _cmake_expected_targets) + unset(_cmake_targets_defined) + unset(_cmake_targets_not_defined) + unset(_cmake_expected_targets) + unset(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT _cmake_targets_defined STREQUAL "") + string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") + string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") +endif() +unset(_cmake_targets_defined) +unset(_cmake_targets_not_defined) +unset(_cmake_expected_targets) + + +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +# Create imported target expat::expat +add_library(expat::expat SHARED IMPORTED) + +set_target_properties(expat::expat PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "m" +) + +# Load information for each installed configuration. +file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/expat-*.cmake") +foreach(_cmake_config_file IN LISTS _cmake_config_files) + include("${_cmake_config_file}") +endforeach() +unset(_cmake_config_file) +unset(_cmake_config_files) + +# Cleanup temporary variables. +set(_IMPORT_PREFIX) + +# Loop over all imported files and verify that they actually exist +foreach(_cmake_target IN LISTS _cmake_import_check_targets) + if(CMAKE_VERSION VERSION_LESS "3.28" + OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target} + OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}") + foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") + if(NOT EXISTS "${_cmake_file}") + message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file + \"${_cmake_file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + endif() + unset(_cmake_file) + unset("_cmake_import_check_files_for_${_cmake_target}") +endforeach() +unset(_cmake_target) +unset(_cmake_import_check_targets) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) diff --git a/3rdparty/expat/cmake/mingw-toolchain.cmake b/3rdparty/expat/cmake/mingw-toolchain.cmake index 31a238b05ca01..9032d9e552260 100644 --- a/3rdparty/expat/cmake/mingw-toolchain.cmake +++ b/3rdparty/expat/cmake/mingw-toolchain.cmake @@ -31,6 +31,7 @@ set(CMAKE_SYSTEM_NAME Windows) set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) set(WIN32 ON) set(MINGW ON) diff --git a/3rdparty/expat/configure b/3rdparty/expat/configure index 947bc0ebcdef8..c2f7bb797ef3f 100755 --- a/3rdparty/expat/configure +++ b/3rdparty/expat/configure @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for expat 2.2.10. +# Generated by GNU Autoconf 2.71 for expat 2.6.4. # -# Report bugs to . +# Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,12 +169,15 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO @@ -207,30 +192,38 @@ test -x / || exit 1" test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ fi esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,22 +263,23 @@ esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: expat-bugs@libexpat.org about your system, including -$0: any error possibly output before this message. Then -$0: install a modern shell, or manually run the script -$0: under such a shell if you do have one." + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and +$0: https://github.com/libexpat/libexpat/issues about your +$0: system, including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi exit 1 fi @@ -302,6 +303,7 @@ as_fn_unset () } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ as_fn_executable_p () # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -590,66 +621,86 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='expat' PACKAGE_TARNAME='expat' -PACKAGE_VERSION='2.2.10' -PACKAGE_STRING='expat 2.2.10' -PACKAGE_BUGREPORT='expat-bugs@libexpat.org' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='expat 2.6.4' +PACKAGE_BUGREPORT='https://github.com/libexpat/libexpat/issues' PACKAGE_URL='' ac_unique_file="Makefile.in" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" -ac_header_list= +ac_header_c_list= +ac_func_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS -_EXPAT_OUTPUT_NAME +CMAKE_SHARED_LIBRARY_PREFIX AM_LDFLAGS AM_CXXFLAGS AM_CFLAGS AM_CPPFLAGS -WITH_DOCBOOK_FALSE -WITH_DOCBOOK_TRUE +SIZEOF_VOID_P +SO_PATCH +SO_MINOR +SO_MAJOR +LIBDIR_BASENAME +EXPAT_CHAR_TYPE +EXPAT_CONTEXT_BYTES +EXPAT_NS +EXPAT_MIN_SIZE +EXPAT_LARGE_SIZE +EXPAT_DTD +EXPAT_ATTR_INFO +WITH_DISTRIBUTABLE_MANPAGE_FALSE +WITH_DISTRIBUTABLE_MANPAGE_TRUE +WITH_PREBUILT_MANPAGE_FALSE +WITH_PREBUILT_MANPAGE_TRUE +WITH_MANPAGE_FALSE +WITH_MANPAGE_TRUE DOCBOOK_TO_MAN FILEMAP +LIBM +_INTERNAL_LARGE_SIZE_FALSE +_INTERNAL_LARGE_SIZE_TRUE +_INTERNAL_MIN_SIZE_FALSE +_INTERNAL_MIN_SIZE_TRUE +_INTERNAL_UNICODE_WCHAR_T_FALSE +_INTERNAL_UNICODE_WCHAR_T_TRUE UNICODE_FALSE UNICODE_TRUE MINGW_FALSE MINGW_TRUE +HAVE_CXX11 WITH_TESTS_FALSE WITH_TESTS_TRUE WITH_EXAMPLES_FALSE @@ -666,7 +717,6 @@ CXX LIBAGE LIBREVISION LIBCURRENT -CPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -675,6 +725,7 @@ NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB +FILECMD NM ac_ct_DUMPBIN DUMPBIN @@ -706,10 +757,16 @@ CFLAGS CC ac_ct_AR AR +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V +CSCOPE +ETAGS +CTAGS am__untar am__tar AMTAR @@ -781,15 +838,18 @@ PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' -ac_subst_files='' +ac_subst_files='PACKAGE_INIT' ac_user_opts=' enable_option_checking enable_silent_rules +enable_maintainer_mode enable_dependency_tracking enable_shared enable_static +enable_pic with_pic enable_fast_install +enable_aix_soname with_aix_soname with_gnu_ld with_sysroot @@ -813,7 +873,6 @@ LDFLAGS LIBS CPPFLAGS LT_SYS_LIBRARY_PATH -CPP CXX CXXFLAGS CCC @@ -887,8 +946,6 @@ do *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -929,9 +986,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -955,9 +1012,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1168,9 +1225,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1184,9 +1241,9 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1230,9 +1287,9 @@ Try \`$0 --help' for more information" *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1248,7 +1305,7 @@ if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1312,7 +1369,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1369,7 +1426,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures expat 2.2.10 to adapt to many kinds of systems. +\`configure' configures expat 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1440,7 +1497,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of expat 2.2.10:";; + short | recursive ) echo "Configuration of expat 2.6.4:";; esac cat <<\_ACEOF @@ -1450,14 +1507,22 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") + --disable-maintainer-mode + disable make rules and dependencies not useful (and + sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] + --enable-pic[=PKGS] try to use only PIC/non-PIC objects [default=use + both] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] + --enable-aix-soname=aix|svr4|both + shared library versioning (aka "SONAME") variant to + provide on AIX, [default=aix]. --disable-libtool-lock avoid locking (might break parallel builds) --enable-xml-attr-info Enable retrieving the byte offsets for attribute names and values [default=no] @@ -1469,11 +1534,6 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use - both] - --with-aix-soname=aix|svr4|both - shared library versioning (aka "SONAME") variant to - provide on AIX, [default=aix]. --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified). @@ -1501,7 +1561,6 @@ Some influential environment variables: you have headers in a nonstandard directory LT_SYS_LIBRARY_PATH User-defined run-time library search path. - CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor @@ -1511,7 +1570,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -1527,9 +1586,9 @@ if test "$ac_init_help" = "recursive"; then case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1557,7 +1616,8 @@ esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1565,7 +1625,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1574,10 +1634,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -expat configure 2.2.10 -generated by GNU Autoconf 2.69 +expat configure 2.6.4 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1594,14 +1654,14 @@ fi ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1609,14 +1669,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1632,14 +1693,14 @@ fi ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1647,17 +1708,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1679,120 +1741,44 @@ fi ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1800,16 +1786,9 @@ else #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (void); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1818,7 +1797,7 @@ else #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1827,24 +1806,25 @@ choke me #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1855,14 +1835,14 @@ $as_echo "$ac_res" >&6; } ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1870,14 +1850,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1899,7 +1880,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1907,14 +1888,15 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1930,14 +1912,14 @@ fi ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1945,17 +1927,18 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1970,6 +1953,49 @@ fi } # ac_fn_cxx_try_link +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1977,17 +2003,18 @@ fi ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -1995,12 +2022,13 @@ if (sizeof ($2)) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2008,130 +2036,249 @@ if (sizeof (($2))) return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +int +main (void) +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0; +return test_array [0]; -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> + ; + return 0; +} _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## -------------------------------------- ## -## Report this to expat-bugs@libexpat.org ## -## -------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by expat $as_me 2.2.10, which was -generated by GNU Autoconf 2.69. Invocation command line was +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; - $ $0 $@ + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid; break +else $as_nop + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0; +return test_array [0]; + ; + return 0; +} _ACEOF -exec 5>>config.log +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_lo=$ac_mid; break +else $as_nop + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + done +else $as_nop + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main (void) +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0; +return test_array [0]; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_hi=$ac_mid +else $as_nop + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval (void) { return $2; } +static unsigned long int ulongval (void) { return $2; } +#include +#include +int +main (void) +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + echo >>conftest.val; read $3 config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by expat $as_me 2.6.4, which was +generated by GNU Autoconf 2.71. Invocation command line was + + $ $0$ac_configure_args_raw + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` @@ -2154,8 +2301,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2190,7 +2341,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2225,11 +2376,13 @@ done # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2240,8 +2393,8 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2265,7 +2418,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2273,14 +2426,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2288,15 +2441,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2304,8 +2457,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2319,63 +2472,48 @@ ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2385,189 +2523,796 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -as_fn_append ac_header_list " stdlib.h" -as_fn_append ac_header_list " unistd.h" -as_fn_append ac_header_list " sys/param.h" -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (char **p, int i) +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' -ac_aux_dir= -for ac_dir in conftools "$srcdir"/conftools; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in conftools \"$srcdir\"/conftools" "$LINENO" 5 -fi +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); +extern void free (void *); +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 +struct incomplete_array +{ + int datasize; + double data[]; +}; -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +struct named_init { + int number; + const wchar_t *name; + double average; +}; -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +typedef const char *ccp; +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +# Test code for whether the C++ compiler supports C++98 (global declarations) +ac_cxx_conftest_cxx98_globals=' +// Does the compiler advertise C++98 conformance? +#if !defined __cplusplus || __cplusplus < 199711L +# error "Compiler does not advertise C++98 conformance" +#endif + +// These inclusions are to reject old compilers that +// lack the unsuffixed header files. +#include +#include + +// and are *not* freestanding headers in C++98. +extern void assert (int); +namespace std { + extern int strcmp (const char *, const char *); +} + +// Namespaces, exceptions, and templates were all added after "C++ 2.0". +using std::exception; +using std::strcmp; + +namespace { + +void test_exception_syntax() +{ + try { + throw "test"; + } catch (const char *s) { + // Extra parentheses suppress a warning when building autoconf itself, + // due to lint rules shared with more typical C programs. + assert (!(strcmp) (s, "test")); + } +} + +template struct test_template +{ + T const val; + explicit test_template(T t) : val(t) {} + template T add(U u) { return static_cast(u) + val; } +}; + +} // anonymous namespace +' + +# Test code for whether the C++ compiler supports C++98 (body of main) +ac_cxx_conftest_cxx98_main=' + assert (argc); + assert (! argv[0]); +{ + test_exception_syntax (); + test_template tt (2.0); + assert (tt.add (4) == 6.0); + assert (true && !false); +} +' + +# Test code for whether the C++ compiler supports C++11 (global declarations) +ac_cxx_conftest_cxx11_globals=' +// Does the compiler advertise C++ 2011 conformance? +#if !defined __cplusplus || __cplusplus < 201103L +# error "Compiler does not advertise C++11 conformance" +#endif + +namespace cxx11test +{ + constexpr int get_val() { return 20; } + + struct testinit + { + int i; + double d; + }; + + class delegate + { + public: + delegate(int n) : n(n) {} + delegate(): delegate(2354) {} + + virtual int getval() { return this->n; }; + protected: + int n; + }; + + class overridden : public delegate + { + public: + overridden(int n): delegate(n) {} + virtual int getval() override final { return this->n * 2; } + }; + + class nocopy + { + public: + nocopy(int i): i(i) {} + nocopy() = default; + nocopy(const nocopy&) = delete; + nocopy & operator=(const nocopy&) = delete; + private: + int i; + }; + + // for testing lambda expressions + template Ret eval(Fn f, Ret v) + { + return f(v); + } + + // for testing variadic templates and trailing return types + template auto sum(V first) -> V + { + return first; + } + template auto sum(V first, Args... rest) -> V + { + return first + sum(rest...); + } +} +' + +# Test code for whether the C++ compiler supports C++11 (body of main) +ac_cxx_conftest_cxx11_main=' +{ + // Test auto and decltype + auto a1 = 6538; + auto a2 = 48573953.4; + auto a3 = "String literal"; + + int total = 0; + for (auto i = a3; *i; ++i) { total += *i; } + + decltype(a2) a4 = 34895.034; +} +{ + // Test constexpr + short sa[cxx11test::get_val()] = { 0 }; +} +{ + // Test initializer lists + cxx11test::testinit il = { 4323, 435234.23544 }; +} +{ + // Test range-based for + int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, + 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; + for (auto &x : array) { x += 23; } +} +{ + // Test lambda expressions + using cxx11test::eval; + assert (eval ([](int x) { return x*2; }, 21) == 42); + double d = 2.0; + assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); + assert (d == 5.0); + assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); + assert (d == 5.0); +} +{ + // Test use of variadic templates + using cxx11test::sum; + auto a = sum(1); + auto b = sum(1, 2); + auto c = sum(1.0, 2.0, 3.0); +} +{ + // Test constructor delegation + cxx11test::delegate d1; + cxx11test::delegate d2(); + cxx11test::delegate d3(45); +} +{ + // Test override and final + cxx11test::overridden o1(55464); +} +{ + // Test nullptr + char *c = nullptr; +} +{ + // Test template brackets + test_template<::test_template> v(test_template(12)); +} +{ + // Unicode literals + char const *utf8 = u8"UTF-8 string \u2500"; + char16_t const *utf16 = u"UTF-8 string \u2500"; + char32_t const *utf32 = U"UTF-32 string \u2500"; +} +' + +# Test code for whether the C compiler supports C++11 (complete). +ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} +${ac_cxx_conftest_cxx11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + ${ac_cxx_conftest_cxx11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C++98 (complete). +ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_cxx_conftest_cxx98_main} + return ok; +} +" + +as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H" +as_fn_append ac_func_c_list " getpagesize HAVE_GETPAGESIZE" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh compile ar-lib missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/conftools" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" + break + fi + ac_first_candidate=false + + as_found=false +done +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +fi + + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` +test "x$ac_build_alias" = x && + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac @@ -2575,7 +3320,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2589,20 +3335,25 @@ am__api_version='1.16' # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2612,13 +3363,13 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2626,12 +3377,12 @@ case $as_dir/ in #(( echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2647,7 +3398,7 @@ IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2657,8 +3408,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2668,8 +3419,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2723,8 +3474,8 @@ else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -2743,26 +3494,23 @@ test "$program_suffix" != NONE && # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -2782,11 +3530,12 @@ if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -2794,11 +3543,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2809,11 +3562,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2822,11 +3575,12 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -2834,11 +3588,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2849,11 +3607,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2861,8 +3619,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2874,25 +3632,31 @@ fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -2903,7 +3667,7 @@ IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -2913,18 +3677,19 @@ fi MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -2932,11 +3697,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2947,24 +3716,25 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -2980,12 +3750,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2999,7 +3769,8 @@ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3009,12 +3780,13 @@ case $enable_silent_rules in # ((( *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3026,8 +3798,8 @@ else am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3059,17 +3831,13 @@ fi # Define the identity of the package. PACKAGE='expat' - VERSION='2.2.10' + VERSION='2.6.4' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3109,6 +3877,20 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' +# Variables for tags utilities; see am/tags.am +if test -z "$CTAGS"; then + CTAGS=ctags +fi + +if test -z "$ETAGS"; then + ETAGS=etags +fi + +if test -z "$CSCOPE"; then + CSCOPE=cscope +fi + + # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile @@ -3153,53 +3935,56 @@ END fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test ${enable_maintainer_mode+y} +then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else $as_nop + USE_MAINTAINER_MODE=yes +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + # to allow argument --disable-maintainer-mode + + + +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! + +ac_config_headers="$ac_config_headers expat_config.h" + -LIBCURRENT=7 # sync -LIBREVISION=12 # with -LIBAGE=6 # CMakeLists.txt! -if ${AM_CPPFLAGS+:} false; then : - case " $AM_CPPFLAGS " in #( - *" -DHAVE_EXPAT_CONFIG_H "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H"; } >&5 - (: AM_CPPFLAGS already contains -DHAVE_EXPAT_CONFIG_H) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - as_fn_append AM_CPPFLAGS " -DHAVE_EXPAT_CONFIG_H" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac -else - AM_CPPFLAGS=-DHAVE_EXPAT_CONFIG_H - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -fi -ac_config_headers="$ac_config_headers expat_config.h" DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out @@ -3235,11 +4020,12 @@ esac fi done rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3265,11 +4051,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3277,11 +4064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3292,11 +4083,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3305,11 +4096,12 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3317,11 +4109,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3332,11 +4128,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3344,8 +4140,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3358,11 +4154,12 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3370,11 +4167,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3385,11 +4186,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3398,11 +4199,12 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3411,15 +4213,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3435,18 +4241,18 @@ if test $ac_prog_rejected = yes; then # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3457,11 +4263,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3469,11 +4276,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3484,11 +4295,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3501,11 +4312,12 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3513,11 +4325,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3528,11 +4344,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3544,8 +4360,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3553,25 +4369,129 @@ esac fi fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3581,7 +4501,7 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3589,7 +4509,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3601,9 +4521,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3624,11 +4544,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3645,7 +4566,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3661,44 +4582,46 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3712,15 +4635,15 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3729,7 +4652,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3741,8 +4664,8 @@ _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3750,10 +4673,10 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3761,39 +4684,40 @@ $as_echo "$ac_try_echo"; } >&5 *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3807,11 +4731,12 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3820,31 +4745,32 @@ $as_echo "$ac_try_echo"; } >&5 break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3854,29 +4780,33 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -3885,57 +4815,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -3950,94 +4883,144 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c89=no +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c89_program _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC - fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi fi ac_ext=c @@ -4046,21 +5029,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -4088,8 +5073,8 @@ _ACEOF rm -f core conftest* unset am_i fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. @@ -4107,11 +5092,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4218,8 +5204,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if @@ -4234,16 +5220,18 @@ fi -if test -n "$ac_tool_prefix"; then + + if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -4251,11 +5239,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4266,11 +5258,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4283,11 +5275,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -4295,11 +5288,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4310,11 +5307,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -4326,8 +5323,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -4336,11 +5333,12 @@ fi : ${AR=ar} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 -$as_echo_n "checking the archiver ($AR) interface... " >&6; } -if ${am_cv_ar_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 +printf %s "checking the archiver ($AR) interface... " >&6; } +if test ${am_cv_ar_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4352,12 +5350,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int some_variable = 0; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar @@ -4366,7 +5365,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib @@ -4377,7 +5376,7 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.lib libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4385,8 +5384,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 -$as_echo "$am_cv_ar_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 +printf "%s\n" "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) @@ -4406,24 +5405,25 @@ unknown) esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -4439,12 +5439,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -4452,14 +5452,15 @@ fi case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.4.6' -macro_revision='2.4.6' +macro_version='2.5.3' +macro_revision='2.5.3' + @@ -4496,8 +5497,8 @@ ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -4523,12 +5524,12 @@ func_echo_all () } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -4544,11 +5545,12 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -4562,10 +5564,15 @@ else for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -4574,13 +5581,13 @@ case `"$ac_path_SED" --version 2>&1` in ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4608,8 +5615,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4626,11 +5633,12 @@ Xsed="$SED -e 1s/^X//" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4638,10 +5646,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4650,13 +5663,13 @@ case `"$ac_path_GREP" --version 2>&1` in ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4684,16 +5697,17 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -4704,10 +5718,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -4716,13 +5735,13 @@ case `"$ac_path_EGREP" --version 2>&1` in ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4751,16 +5770,17 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -4771,10 +5791,15 @@ else for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -4783,13 +5808,13 @@ case `"$ac_path_FGREP" --version 2>&1` in ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4818,8 +5843,8 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -4844,19 +5869,20 @@ test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -4883,15 +5909,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -4920,18 +5947,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -4954,11 +5982,12 @@ with_gnu_ld=$lt_cv_prog_gnu_ld -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -4980,16 +6009,16 @@ else # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in - mingw*) lt_bad_file=conftest.nm/nofile ;; + mingw* | windows*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac - case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in + case `"$tmp_nm" -B $lt_bad_file 2>&1 | $SED '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + case `"$tmp_nm" -p /dev/null 2>&1 | $SED '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 @@ -5008,8 +6037,8 @@ else : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -5022,11 +6051,12 @@ else do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -5034,11 +6064,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5049,11 +6083,11 @@ fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5066,11 +6100,12 @@ if test -z "$DUMPBIN"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -5078,11 +6113,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5093,11 +6132,11 @@ fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5109,15 +6148,15 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi - case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in + case `$DUMPBIN -symbols -headers /dev/null 2>&1 | $SED '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; @@ -5138,11 +6177,12 @@ test -z "$NM" && NM=nm -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -5158,15 +6198,16 @@ else fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -5186,7 +6227,7 @@ else lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -5202,18 +6243,13 @@ else lt_cv_sys_max_cmd_len=8192; ;; - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; - bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) + darwin* | dragonfly* | freebsd* | midnightbsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5256,7 +6292,7 @@ else sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | $SED 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi @@ -5298,11 +6334,11 @@ else fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -5346,15 +6382,16 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) @@ -5367,7 +6404,7 @@ else ;; *-*-cygwin* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) @@ -5386,24 +6423,25 @@ esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in - *-*-mingw* ) + *-*-mingw* | *-*-windows* ) case $build in - *-*-mingw* ) # actually msys + *-*-mingw* | *-*-windows* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac @@ -5413,22 +6451,23 @@ esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -5436,7 +6475,7 @@ case $reload_flag in esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) if test yes != "$GCC"; then reload_cmds=false fi @@ -5458,14 +6497,64 @@ esac +# Extract the first word of "file", so it can be a program name with args. +set dummy file; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_FILECMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$FILECMD"; then + ac_cv_prog_FILECMD="$FILECMD" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_FILECMD="file" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_FILECMD" && ac_cv_prog_FILECMD=":" +fi +fi +FILECMD=$ac_cv_prog_FILECMD +if test -n "$FILECMD"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FILECMD" >&5 +printf "%s\n" "$FILECMD" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + + + + + + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -5473,11 +6562,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5488,11 +6581,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5501,11 +6594,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -5513,11 +6607,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5528,11 +6626,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -5540,8 +6638,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -5557,11 +6655,12 @@ test -z "$OBJDUMP" && OBJDUMP=objdump -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -5570,7 +6669,6 @@ lt_cv_deplibs_check_method='unknown' # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure @@ -5587,7 +6685,7 @@ beos*) bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' - lt_cv_file_magic_cmd='/usr/bin/file -L' + lt_cv_file_magic_cmd='$FILECMD -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; @@ -5597,7 +6695,7 @@ cygwin*) lt_cv_file_magic_cmd='func_win32_libid' ;; -mingw* | pw32*) +mingw* | windows* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. @@ -5606,7 +6704,7 @@ mingw* | pw32*) lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; @@ -5621,14 +6719,14 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac @@ -5642,7 +6740,7 @@ haiku*) ;; hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' @@ -5689,7 +6787,7 @@ netbsd*) newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_cmd=$FILECMD lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; @@ -5697,7 +6795,7 @@ newos6*) lt_cv_deplibs_check_method=pass_all ;; -openbsd* | bitrig*) +openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else @@ -5757,14 +6855,14 @@ os2*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in - mingw* | pw32*) + mingw* | windows* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else @@ -5802,11 +6900,12 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -5814,11 +6913,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5829,11 +6932,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5842,11 +6945,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -5854,11 +6958,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5869,11 +6977,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -5881,8 +6989,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -5899,15 +7007,16 @@ test -z "$DLLTOOL" && DLLTOOL=dlltool -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in @@ -5926,8 +7035,8 @@ cygwin* | mingw* | pw32* | cegcc*) esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -5937,16 +7046,119 @@ test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -5954,11 +7166,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5969,11 +7185,11 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -5986,11 +7202,12 @@ if test -z "$AR"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -5998,11 +7215,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6013,11 +7234,11 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -6029,8 +7250,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -6038,42 +7259,60 @@ esac fi : ${AR=ar} -: ${AR_FLAGS=cru} +# Use ARFLAGS variable as AR's operation code to sync the variable naming with +# Automake. If both AR_FLAGS and ARFLAGS are specified, AR_FLAGS should have +# higher priority because that's what people were doing historically (setting +# ARFLAGS for automake and AR_FLAGS for libtool). FIXME: Make the AR_FLAGS +# variable obsoleted/removed. +test ${AR_FLAGS+y} || AR_FLAGS=${ARFLAGS-cr} +lt_ar_flags=$AR_FLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else + + +# Make AR_FLAGS overridable by 'make ARFLAGS='. Don't try to run-time override +# by AR_FLAGS because that was never working and AR_FLAGS is about to die. + + + + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -6081,7 +7320,7 @@ if ac_fn_c_try_compile "$LINENO"; then : { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -6090,117 +7329,18 @@ if ac_fn_c_try_compile "$LINENO"; then : rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then - archiver_list_spec= -else - archiver_list_spec=$lt_cv_ar_at_file -fi - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + archiver_list_spec= else - STRIP="$ac_cv_prog_STRIP" + archiver_list_spec=$lt_cv_ar_at_file fi -test -z "$STRIP" && STRIP=: @@ -6208,25 +7348,30 @@ test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6235,38 +7380,43 @@ IFS=$as_save_IFS fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6275,30 +7425,38 @@ IFS=$as_save_IFS fi fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + STRIP=$ac_ct_STRIP fi else - RANLIB="$ac_cv_prog_RANLIB" + STRIP="$ac_cv_prog_STRIP" fi +test -z "$STRIP" && STRIP=: + + + + + + + test -z "$RANLIB" && RANLIB=: @@ -6312,15 +7470,8 @@ old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then - case $host_os in - bitrig* | openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" - ;; - esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in @@ -6379,11 +7530,12 @@ compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -6399,7 +7551,7 @@ case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) @@ -6414,7 +7566,7 @@ osf*) symcode='[BCDEGQRST]' ;; solaris*) - symcode='[BDRT]' + symcode='[BCDRT]' ;; sco3.2v5*) symcode='[DT]' @@ -6438,7 +7590,7 @@ esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. - lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" + lt_cv_sys_global_symbol_to_import="$SED -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" @@ -6456,20 +7608,20 @@ fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n"\ +lt_cv_sys_global_symbol_to_cdecl="$SED -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address="$SED -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="$SED -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ @@ -6478,7 +7630,7 @@ $lt_c_name_lib_hook\ # Handle CRLF in mingw tool chain opt_cr= case $build_os in -mingw*) +mingw* | windows*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac @@ -6493,7 +7645,7 @@ for ac_symprfx in "" "_"; do if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. - # Also find C++ and __fastcall symbols from MSVC++, + # Also find C++ and __fastcall symbols from MSVC++ or ICC, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ @@ -6511,9 +7663,9 @@ for ac_symprfx in "" "_"; do " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + lt_cv_sys_global_symbol_pipe="$SED -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi - lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | $SED '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no @@ -6529,20 +7681,20 @@ void nm_test_func(void){} #ifdef __cplusplus } #endif -int main(){nm_test_var='a';nm_test_func();return(0);} +int main(void){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -6611,7 +7763,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -6646,11 +7798,11 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -6696,13 +7848,14 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -6711,33 +7864,36 @@ lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then - lt_sysroot=`$CC --print-sysroot 2>/dev/null` + # Trim trailing / since we'll always append absolute paths and we want + # to avoid //, if only for less confusing output for the user. + lt_sysroot=`$CC --print-sysroot 2>/dev/null | $SED 's:/\+$::'` fi ;; #( /*) - lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` + lt_sysroot=`echo "$with_sysroot" | $SED -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -6748,10 +7904,15 @@ if test -z "$lt_DD"; then for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -6771,15 +7932,16 @@ fi rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -6790,8 +7952,8 @@ fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -6814,7 +7976,8 @@ func_cc_basename () } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -6830,9 +7993,9 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; @@ -6850,10 +8013,10 @@ ia64-*-hpux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; @@ -6865,7 +8028,7 @@ ia64-*-hpux*) ;; esac else - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; @@ -6888,10 +8051,10 @@ mips64*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; @@ -6899,7 +8062,7 @@ mips64*-*linux*) emul="${emul}64" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; @@ -6907,7 +8070,7 @@ mips64*-*linux*) emul="${emul}ltsmip" ;; esac - case `/usr/bin/file conftest.$ac_objext` in + case `$FILECMD conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; @@ -6918,7 +8081,7 @@ mips64*-*linux*) ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) +s390*-*linux*|s390*-*tpf*|sparc*-*linux*|x86_64-gnu*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when @@ -6929,16 +8092,16 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; - x86_64-*linux*) - case `/usr/bin/file conftest.o` in + x86_64-*linux*|x86_64-gnu*) + case `$FILECMD conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; @@ -6966,7 +8129,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; - x86_64-*linux*) + x86_64-*linux*|x86_64-gnu*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*|powerpc64le-*linux*) @@ -6992,11 +8155,12 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -7007,19 +8171,20 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -7028,8 +8193,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -7042,9 +8207,9 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in + case `$FILECMD conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) @@ -7079,11 +8244,12 @@ need_locks=$enable_libtool_lock if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -7091,11 +8257,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7106,11 +8276,11 @@ fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7119,11 +8289,12 @@ if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -7131,11 +8302,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7146,11 +8321,11 @@ fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -7158,8 +8333,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -7169,23 +8344,24 @@ else fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_path_mainfest_tool=no +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_manifest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop + lt_cv_path_manifest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then - lt_cv_path_mainfest_tool=yes + lt_cv_path_manifest_tool=yes fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } -if test yes != "$lt_cv_path_mainfest_tool"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_manifest_tool" >&5 +printf "%s\n" "$lt_cv_path_manifest_tool" >&6; } +if test yes != "$lt_cv_path_manifest_tool"; then MANIFEST_TOOL=: fi @@ -7199,11 +8375,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -7211,11 +8388,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7226,11 +8407,11 @@ fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7239,11 +8420,12 @@ if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -7251,11 +8433,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7266,11 +8452,11 @@ fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -7278,8 +8464,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -7291,11 +8477,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -7303,11 +8490,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7318,11 +8509,11 @@ fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7331,11 +8522,12 @@ if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -7343,11 +8535,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7358,11 +8554,11 @@ fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -7370,8 +8566,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -7383,11 +8579,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -7395,11 +8592,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7410,11 +8611,11 @@ fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7423,11 +8624,12 @@ if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -7435,11 +8637,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7450,11 +8656,11 @@ fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -7462,8 +8668,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -7475,11 +8681,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -7487,11 +8694,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7502,11 +8713,11 @@ fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7515,11 +8726,12 @@ if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -7527,11 +8739,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7542,11 +8758,11 @@ fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -7554,8 +8770,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -7567,11 +8783,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -7579,11 +8796,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7594,11 +8815,11 @@ fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -7607,11 +8828,12 @@ if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -7619,11 +8841,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7634,11 +8860,11 @@ fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -7646,8 +8872,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -7682,11 +8908,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -7715,14 +8942,52 @@ else rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } + + # Feature test to disable chained fixups since it is not + # compatible with '-undefined dynamic_lookup' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -no_fixup_chains linker flag" >&5 +printf %s "checking for -no_fixup_chains linker flag... " >&6; } +if test ${lt_cv_support_no_fixup_chains+y} +then : + printf %s "(cached) " >&6 +else $as_nop + save_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-no_fixup_chains" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + lt_cv_support_no_fixup_chains=yes +else $as_nop + lt_cv_support_no_fixup_chains=no + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_support_no_fixup_chains" >&5 +printf "%s\n" "$lt_cv_support_no_fixup_chains" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -7731,43 +8996,45 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 + echo "$AR $AR_FLAGS libconftest.a conftest.o" >&5 + $AR $AR_FLAGS libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF -int main() { return 0;} +int main(void) { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err @@ -7783,24 +9050,23 @@ _LT_EOF rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) - _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + darwin*) + case $MACOSX_DEPLOYMENT_TARGET,$host in + 10.[012],*|,*powerpc*-darwin[5-8]*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; + *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' + if test yes = "$lt_cv_support_no_fixup_chains"; then + as_fn_append _lt_dar_allow_undefined ' $wl-no_fixup_chains' + fi + ;; esac ;; esac @@ -7852,289 +9118,46 @@ func_munge_path_list () *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; - esac -} - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi + esac +} -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h -fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi -done +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +fi +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - @@ -8143,15 +9166,16 @@ done enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else @@ -8159,11 +9183,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8174,11 +9202,11 @@ fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 +printf "%s\n" "$AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8187,11 +9215,12 @@ if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AS+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else @@ -8199,11 +9228,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8214,11 +9247,11 @@ fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 +printf "%s\n" "$ac_ct_AS" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AS" = x; then @@ -8226,8 +9259,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS @@ -8239,11 +9272,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -8251,11 +9285,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8266,11 +9304,11 @@ fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8279,11 +9317,12 @@ if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -8291,11 +9330,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8306,11 +9349,11 @@ fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -8318,8 +9361,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -8331,11 +9374,12 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -8343,11 +9387,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8358,11 +9406,11 @@ fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8371,11 +9419,12 @@ if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -8383,11 +9432,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8398,11 +9451,11 @@ fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -8410,8 +9463,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -8448,7 +9501,8 @@ test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -8466,7 +9520,7 @@ if test "${enable_shared+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -8479,7 +9533,8 @@ fi # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -8497,7 +9552,7 @@ if test "${enable_static+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -8509,30 +9564,53 @@ fi - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : + # Check whether --enable-pic was given. +if test ${enable_pic+y} +then : + enableval=$enable_pic; lt_p=${PACKAGE-default} + case $enableval in + yes|no) pic_mode=$enableval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $enableval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop + # Check whether --with-pic was given. +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} - case $withval in - yes|no) pic_mode=$withval ;; - *) - pic_mode=default - # Look at the argument we got. We use all the common list separators. - lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, - for lt_pkg in $withval; do - IFS=$lt_save_ifs - if test "X$lt_pkg" = "X$lt_p"; then - pic_mode=yes - fi - done - IFS=$lt_save_ifs - ;; - esac -else + case $withval in + yes|no) pic_mode=$withval ;; + *) + pic_mode=default + # Look at the argument we got. We use all the common list separators. + lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR, + for lt_pkg in $withval; do + IFS=$lt_save_ifs + if test "X$lt_pkg" = "X$lt_p"; then + pic_mode=yes + fi + done + IFS=$lt_save_ifs + ;; + esac +else $as_nop pic_mode=default fi +fi + + @@ -8540,7 +9618,8 @@ fi # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -8558,7 +9637,7 @@ if test "${enable_fast_install+set}" = set; then : IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -8572,31 +9651,47 @@ fi shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } - -# Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } + # Check whether --enable-aix-soname was given. +if test ${enable_aix_soname+y} +then : + enableval=$enable_aix_soname; case $enableval in + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --enable-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$enable_aix_soname +else $as_nop + # Check whether --with-aix-soname was given. +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in - aix|svr4|both) - ;; - *) - as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 - ;; - esac - lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else + aix|svr4|both) + ;; + *) + as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 + ;; + esac + lt_cv_with_aix_soname=$with_aix_soname +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi - with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + enable_aix_soname=$lt_cv_with_aix_soname +fi + + with_aix_soname=$enable_aix_soname + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -8678,11 +9773,12 @@ if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -8693,17 +9789,15 @@ else fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -8724,8 +9818,8 @@ esac ofile=libtool can_build_shared=yes -# All known linkers require a '.a' archive for static linking (except MSVC, -# which needs '.lib'). +# All known linkers require a '.a' archive for static linking (except MSVC and +# ICC, which need '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld @@ -8749,11 +9843,12 @@ test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -8802,11 +9897,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8815,11 +9910,12 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -8868,11 +9964,11 @@ fi MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -8906,7 +10002,7 @@ objext=$objext lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' +lt_simple_link_test_code='int main(void){return(0);}' @@ -8957,11 +10053,12 @@ if test yes = "$GCC"; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -8992,8 +10089,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -9046,7 +10143,7 @@ lt_prog_compiler_static= # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -9149,7 +10246,7 @@ lt_prog_compiler_static= esac ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | windows* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -9190,6 +10287,12 @@ lt_prog_compiler_static= lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; + *flang* | ftn) + # Flang compiler. + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) @@ -9234,7 +10337,7 @@ lt_prog_compiler_static= lt_prog_compiler_static='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' @@ -9350,26 +10453,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -9400,8 +10505,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -9429,11 +10534,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -9457,8 +10563,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -9472,11 +10578,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9519,19 +10626,20 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -9574,8 +10682,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -9583,19 +10691,19 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -9607,8 +10715,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -9651,19 +10759,19 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time + cygwin* | mingw* | windows* | pw32* | cegcc*) + # FIXME: the MSVC++ and ICC port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) + # we just hope/assume this is gcc and not c89 (= MSVC++ or ICC) with_gnu_ld=yes ;; - openbsd* | bitrig*) + openbsd*) with_gnu_ld=no ;; esac @@ -9712,7 +10820,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie whole_archive_flag_spec= fi supports_anon_versioning=no - case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in + case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... @@ -9766,7 +10874,7 @@ _LT_EOF fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' @@ -9822,8 +10930,9 @@ _LT_EOF cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; interix[3-9]*) @@ -9838,7 +10947,7 @@ _LT_EOF # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) @@ -9881,7 +10990,7 @@ _LT_EOF compiler_needs_object=yes ;; esac - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' compiler_needs_object=yes @@ -9893,7 +11002,7 @@ _LT_EOF if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi @@ -9909,7 +11018,7 @@ _LT_EOF archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi @@ -10041,7 +11150,7 @@ _LT_EOF if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no @@ -10163,21 +11272,23 @@ _LT_EOF if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10192,7 +11303,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10216,21 +11327,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -10245,7 +11358,7 @@ if ac_fn_c_try_link "$LINENO"; then : lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -10306,14 +11419,14 @@ fi export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. + # Microsoft Visual C++ or Intel C++ Compiler. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in - cl*) - # Native MSVC + cl* | icl*) + # Native MSVC or ICC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes @@ -10323,14 +11436,14 @@ fi # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' + archive_cmds='$CC -Fe $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ - $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ + $CC -Fe $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' @@ -10354,7 +11467,7 @@ fi fi' ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. @@ -10395,8 +11508,8 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" else ld_shlibs=no @@ -10430,7 +11543,7 @@ fi ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes @@ -10496,11 +11609,12 @@ fi # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -10524,8 +11638,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -10565,28 +11679,30 @@ fi # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -10633,7 +11749,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } *nto* | *qnx*) ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no @@ -10676,8 +11792,9 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes + file_list_spec='@' ;; osf3*) @@ -10866,8 +11983,8 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -10903,18 +12020,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -10932,7 +12050,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -10946,8 +12064,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -11106,8 +12224,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -11115,7 +12233,7 @@ if test yes = "$GCC"; then *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in - mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; + mingw* | windows* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` @@ -11173,7 +12291,7 @@ BEGIN {RS = " "; FS = "/|\n";} { # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + mingw* | windows* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([A-Za-z]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` @@ -11247,7 +12365,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -11341,7 +12459,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -11352,6 +12470,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -11361,6 +12492,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -11369,30 +12501,30 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -11405,7 +12537,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -11442,7 +12574,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -11475,7 +12607,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -11512,7 +12644,27 @@ freebsd* | dragonfly*) need_version=no ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -11653,7 +12805,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -11665,8 +12817,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -11681,9 +12834,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -11693,19 +12847,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -11719,7 +12875,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -11776,7 +12932,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -11937,8 +13093,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -12059,8 +13215,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -12084,8 +13240,8 @@ else # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -12117,7 +13273,7 @@ else lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | windows* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; @@ -12129,11 +13285,12 @@ else darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12141,33 +13298,38 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -12187,14 +13349,16 @@ fi *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12202,42 +13366,49 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char shl_load (); +char shl_load (void); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12245,38 +13416,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12284,38 +13461,44 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char dlopen (void); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -12323,31 +13506,36 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char dld_link (); +char dld_link (void); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -12386,11 +13574,12 @@ fi save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -12441,11 +13630,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -12469,7 +13658,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12487,16 +13676,17 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -12547,11 +13737,11 @@ else /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -int fnord () __attribute__((visibility("default"))); +int fnord (void) __attribute__((visibility("default"))); #endif -int fnord () { return 42; } -int main () +int fnord (void) { return 42; } +int main (void) { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; @@ -12575,7 +13765,7 @@ _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -12593,8 +13783,8 @@ rm -fr conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -12632,32 +13822,43 @@ fi striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP"; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } +if test -z "$STRIP"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else + if $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + case $host_os in + darwin*) + # FIXME - insert some real tests, host_os isn't really good enough striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ;; + freebsd*) + if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then + old_striplib="$STRIP --strip-debug" + striplib="$STRIP --strip-unneeded" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + ;; + esac + fi fi @@ -12672,13 +13873,13 @@ fi # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -12702,15 +13903,15 @@ $as_echo_n "checking whether to build shared libraries... " >&6; } fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -12738,215 +13939,46 @@ CC=$lt_save_CC - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); + ac_config_commands="$ac_config_commands libtool" - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - ni.number = 58; - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; +# Only expand once: + + - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : -fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GCC" = yes; then : +if test "${ac_cv_prog_cc_c99}" = no +then : + as_fn_error $? "Expat requires a C99 compiler." "$LINENO" 5 +fi + +if test "$GCC" = yes +then : for flag in -Wall -Wextra; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -12954,51 +13986,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13009,12 +14044,13 @@ done for flag in -fexceptions; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13022,51 +14058,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13077,12 +14116,13 @@ done for flag in -fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13090,51 +14130,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13145,12 +14188,13 @@ done for flag in -pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13158,51 +14202,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13213,12 +14260,13 @@ done for flag in -Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13226,51 +14274,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13280,13 +14331,14 @@ done -for flag in -Wshadow -Wformat=2 -Wmisleading-indentation; do - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 -$as_echo_n "checking whether C compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +for flag in -Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation; do + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5 +printf %s "checking whether C compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Werror $flag" @@ -13294,51 +14346,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains \$flag"; } >&5 (: AM_CFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -13352,6 +14407,12 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13362,15 +14423,16 @@ if test -z "$CXX"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else @@ -13378,11 +14440,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -13393,11 +14459,11 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +printf "%s\n" "$CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -13406,15 +14472,16 @@ fi fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else @@ -13422,11 +14489,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -13437,11 +14508,11 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +printf "%s\n" "$ac_ct_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -13453,8 +14524,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX @@ -13464,7 +14535,7 @@ fi fi fi # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do @@ -13474,7 +14545,7 @@ case "(($ac_try" in *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -13484,20 +14555,21 @@ $as_echo "$ac_try_echo"; } >&5 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if ${ac_cv_cxx_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 +printf %s "checking whether the compiler supports GNU C++... " >&6; } +if test ${ac_cv_cxx_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -13507,29 +14579,33 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi -ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if ${ac_cv_prog_cxx_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +printf %s "checking whether $CXX accepts -g... " >&6; } +if test ${ac_cv_prog_cxx_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no @@ -13538,57 +14614,60 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes -else +else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : -else +else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : ac_cv_prog_cxx_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } +if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then @@ -13603,6 +14682,100 @@ else CXXFLAGS= fi fi +ac_prog_cxx_stdcxx=no +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 +printf %s "checking for $CXX option to enable C++11 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx11=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx11_program +_ACEOF +for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx11" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx11" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 + ac_prog_cxx_stdcxx=cxx11 +fi +fi +if test x$ac_prog_cxx_stdcxx = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 +printf %s "checking for $CXX option to enable C++98 features... " >&6; } +if test ${ac_cv_prog_cxx_cxx98+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cxx_cxx98=no +ac_save_CXX=$CXX +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_cxx_conftest_cxx98_program +_ACEOF +for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA +do + CXX="$ac_save_CXX $ac_arg" + if ac_fn_cxx_try_compile "$LINENO" +then : + ac_cv_prog_cxx_cxx98=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cxx_cxx98" != "xno" && break +done +rm -f conftest.$ac_ext +CXX=$ac_save_CXX +fi + +if test "x$ac_cv_prog_cxx_cxx98" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cxx_cxx98" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 +printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } + CXX="$CXX $ac_cv_prog_cxx_cxx98" +fi + ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 + ac_prog_cxx_stdcxx=cxx98 +fi +fi + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -13611,11 +14784,12 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu depcc="$CXX" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CXX_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CXX_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -13722,8 +14896,8 @@ else fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if @@ -13755,36 +14929,32 @@ ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +printf %s "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if ${ac_cv_prog_CXXCPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CXXCPP needs to be expanded - for CXXCPP in "$CXX -E" "/lib/cpp" + if test ${ac_cv_prog_CXXCPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CXX needs to be expanded + for CXXCPP in "$CXX -E" cpp /lib/cpp do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13796,10 +14966,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13809,7 +14980,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -13821,29 +14993,24 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +printf "%s\n" "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -13855,10 +15022,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if ac_fn_cxx_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -13868,11 +15036,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -14008,19 +15177,20 @@ cc_basename=$func_cc_basename_result # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in - *-*-mingw*) + *-*-mingw* | *-*-windows*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -14047,15 +15217,16 @@ $as_echo_n "checking for ld used by $CC... " >&6; } ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -14084,18 +15255,19 @@ fi LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -14131,8 +15303,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | - $GREP 'no-whole-archive' > /dev/null; then + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_CXX= @@ -14152,7 +15323,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else GXX=no @@ -14161,8 +15332,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld fi # PORTME: fill in a description of your system's C++ link characteristics - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) @@ -14300,21 +15471,23 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14329,7 +15502,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -14354,21 +15527,23 @@ fi if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath__CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath__CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +if ac_fn_cxx_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14383,7 +15558,7 @@ if ac_fn_cxx_try_link "$LINENO"; then : lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=/usr/lib:/lib @@ -14446,10 +15621,10 @@ fi esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $GXX,$cc_basename in - ,cl* | no,cl*) - # Native MSVC + ,cl* | no,cl* | ,icl* | no,icl*) + # Native MSVC or ICC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' @@ -14540,11 +15715,11 @@ fi output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" - module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" + module_expsym_cmds_CXX="$SED -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" if test yes != "$lt_cv_apple_cc_single_mod"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" - archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" + archive_expsym_cmds_CXX="$SED 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi else @@ -14577,8 +15752,9 @@ fi cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' - old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' + old_archive_from_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes + file_list_spec_CXX='@' ;; dgux*) @@ -14609,7 +15785,7 @@ fi archive_cmds_need_lc_CXX=no ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes @@ -14644,7 +15820,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14709,7 +15885,7 @@ fi # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "[-]L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then @@ -14746,7 +15922,7 @@ fi # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='$SED "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in @@ -14886,13 +16062,13 @@ fi archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' @@ -14957,7 +16133,7 @@ fi ld_shlibs_CXX=yes ;; - openbsd* | bitrig*) + openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no @@ -15048,7 +16224,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # FIXME: insert proper C++ library support @@ -15132,7 +16308,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. @@ -15143,7 +16319,7 @@ fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "[-]L"' fi hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir' @@ -15234,8 +16410,8 @@ fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no GCC_CXX=$GXX @@ -15273,7 +16449,7 @@ esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. @@ -15286,10 +16462,11 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 case $prev$p in -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. + # Some compilers place space between "-{L,R,l}" and the path. # Remove the space. - if test x-L = "$p" || - test x-R = "$p"; then + if test x-L = x"$p" || + test x-R = x"$p" || + test x-l = x"$p"; then prev=$p continue fi @@ -15456,7 +16633,7 @@ lt_prog_compiler_static_CXX= beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style @@ -15531,7 +16708,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | windows* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' @@ -15549,7 +16726,7 @@ lt_prog_compiler_static_CXX= ;; esac ;; - freebsd* | dragonfly*) + freebsd* | dragonfly* | midnightbsd*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) @@ -15632,7 +16809,7 @@ lt_prog_compiler_static_CXX= lt_prog_compiler_static_CXX='-qstaticlink' ;; *) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' @@ -15754,26 +16931,28 @@ case $host_os in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } -if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -15804,8 +16983,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then case $lt_prog_compiler_pic_CXX in @@ -15827,11 +17006,12 @@ fi # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -15855,8 +17035,8 @@ else LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then : @@ -15867,11 +17047,12 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15914,16 +17095,17 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest @@ -15966,8 +17148,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o_CXX" >&6; } @@ -15975,19 +17157,19 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -15996,8 +17178,8 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' @@ -16014,15 +17196,15 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else - export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' + export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX=$ltdll_cmds ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw* | windows* | cegcc*) case $cc_basename in - cl*) + cl* | icl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) @@ -16036,8 +17218,8 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 -$as_echo "$ld_shlibs_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 +printf "%s\n" "$ld_shlibs_CXX" >&6; } test no = "$ld_shlibs_CXX" && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld @@ -16064,18 +17246,19 @@ x|xyes) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -16093,7 +17276,7 @@ else if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no @@ -16107,8 +17290,8 @@ else $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac @@ -16177,8 +17360,8 @@ esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' @@ -16247,7 +17430,7 @@ aix[4-9]*) # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl - # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. + # linker flag in LDFLAGS as well, or --enable-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the @@ -16341,7 +17524,7 @@ bsdi[45]*) # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | windows* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no @@ -16352,6 +17535,19 @@ cygwin* | mingw* | pw32* | cegcc*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds + # If user builds GCC with mulitlibs enabled, + # it should just install on $(libdir) + # not on $(libdir)/../bin or 32 bits dlls would override 64 bit ones. + if test yes = $multilib; then + postinstall_cmds='base_file=`basename \$file`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + $install_prog $dir/$dlname $destdir/$dlname~ + chmod a+x $destdir/$dlname~ + if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then + eval '\''$striplib $destdir/$dlname'\'' || exit \$?; + fi' + else postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -16361,6 +17557,7 @@ cygwin* | mingw* | pw32* | cegcc*) if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' + fi postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' @@ -16369,29 +17566,29 @@ cygwin* | mingw* | pw32* | cegcc*) case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + soname_spec='`echo $libname | $SED -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; - mingw* | cegcc*) + mingw* | windows* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' + library_names_spec='`echo $libname | $SED -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; - *,cl*) - # Native MSVC + *,cl* | *,icl*) + # Native MSVC or ICC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in - mingw*) + mingw* | windows*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' @@ -16404,7 +17601,7 @@ cygwin* | mingw* | pw32* | cegcc*) done IFS=$lt_save_ifs # Convert to MSYS style. - sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form @@ -16441,7 +17638,7 @@ cygwin* | mingw* | pw32* | cegcc*) ;; *) - # Assume MSVC wrapper + # Assume MSVC and ICC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; @@ -16473,7 +17670,7 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; -freebsd* | dragonfly*) +freebsd* | dragonfly* | midnightbsd*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then @@ -16510,7 +17707,27 @@ freebsd* | dragonfly*) need_version=no ;; esac + case $host_cpu in + powerpc64) + # On FreeBSD bi-arch platforms, a different variable is used for 32-bit + # binaries. See . + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int test_pointer_size[sizeof (void *) - 5]; + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : shlibpath_var=LD_LIBRARY_PATH +else $as_nop + shlibpath_var=LD_32_LIBRARY_PATH +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; + *) + shlibpath_var=LD_LIBRARY_PATH + ;; + esac case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes @@ -16651,7 +17868,7 @@ linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no - library_names_spec='$libname$release$shared_ext' + library_names_spec='$libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH @@ -16663,8 +17880,9 @@ linux*android*) hardcode_into_libs=yes dynamic_linker='Android linker' - # Don't embed -rpath directories since the linker doesn't support them. - hardcode_libdir_flag_spec_CXX='-L$libdir' + # -rpath works at least for libraries that are not overridden by + # libraries installed in system locations. + hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir' ;; # This must be glibc/ELF. @@ -16679,9 +17897,10 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -16691,19 +17910,21 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_cxx_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -16717,7 +17938,7 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Ideally, we could use ldconfig to report *all* directores which are + # Ideally, we could use ldconfig to report *all* directories which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, @@ -16774,7 +17995,7 @@ newsos6) dynamic_linker='ldqnx.so' ;; -openbsd* | bitrig*) +openbsd*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no @@ -16935,8 +18156,8 @@ uts4*) dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -17000,8 +18221,8 @@ configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || @@ -17025,8 +18246,8 @@ else # directories. hardcode_action_CXX=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 -$as_echo "$hardcode_action_CXX" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 +printf "%s\n" "$hardcode_action_CXX" >&6; } if test relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then @@ -17066,18 +18287,20 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test "$GCC" = yes; then : +if test "$GCC" = yes +then : for flag in -Wall -Wextra; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17085,51 +18308,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17140,12 +18366,13 @@ done for flag in -fexceptions; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17153,51 +18380,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17208,12 +18438,13 @@ done for flag in -fno-strict-aliasing; do - as_CACHEVAR=`$as_echo "ax_cv_check_cxxflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 -$as_echo_n "checking whether C++ compiler accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cxxflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ compiler accepts $flag" >&5 +printf %s "checking whether C++ compiler accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CXXFLAGS CXXFLAGS="$CXXFLAGS -Werror $flag" @@ -17221,51 +18452,54 @@ else /* end confdefs.h. */ int main(void) { return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +if ac_fn_cxx_try_compile "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CXXFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_CXXFLAGS+:} false; then : +if test ${AM_CXXFLAGS+y} +then : case " $AM_CXXFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS already contains \$flag"; } >&5 (: AM_CXXFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CXXFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CXXFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CXXFLAGS=\"\$AM_CXXFLAGS\""; } >&5 (: AM_CXXFLAGS="$AM_CXXFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17279,18 +18513,20 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test "$GCC" = yes; then : +if test "$GCC" = yes +then : for flag in -fno-strict-aliasing; do - as_CACHEVAR=`$as_echo "ax_cv_check_ldflags__$flag" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 -$as_echo_n "checking whether the linker accepts $flag... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else + as_CACHEVAR=`printf "%s\n" "ax_cv_check_ldflags__$flag" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5 +printf %s "checking whether the linker accepts $flag... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS $flag" @@ -17298,59 +18534,62 @@ else /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : -if ${AM_LDFLAGS+:} false; then : +if test ${AM_LDFLAGS+y} +then : case " $AM_LDFLAGS " in #( *" $flag "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5 (: AM_LDFLAGS already contains $flag) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_LDFLAGS " $flag" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_LDFLAGS=$flag - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5 (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } fi -else +else $as_nop : fi @@ -17370,11 +18609,12 @@ esac ;; #( ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5 -$as_echo_n "checking whether compiler supports visibility... " >&6; } -if ${expatcfg_cv_compiler_supports_visibility+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports visibility" >&5 +printf %s "checking whether compiler supports visibility... " >&6; } +if test ${expatcfg_cv_compiler_supports_visibility+y} +then : + printf %s "(cached) " >&6 +else $as_nop expatcfg_cv_compiler_supports_visibility=no OLDFLAGS=$CFLAGS as_fn_append CFLAGS " -fvisibility=hidden -Wall -Werror -Wno-unknown-warning-option" @@ -17385,201 +18625,96 @@ else void foo(void) {} _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : expatcfg_cv_compiler_supports_visibility=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$OLDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5 -$as_echo "$expatcfg_cv_compiler_supports_visibility" >&6; } - if test "$expatcfg_cv_compiler_supports_visibility" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $expatcfg_cv_compiler_supports_visibility" >&5 +printf "%s\n" "$expatcfg_cv_compiler_supports_visibility" >&6; } + if test "$expatcfg_cv_compiler_supports_visibility" = yes +then : -if ${AM_CFLAGS+:} false; then : +if test ${AM_CFLAGS+y} +then : case " $AM_CFLAGS " in #( *" -fvisibility=hidden "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS already contains -fvisibility=hidden"; } >&5 (: AM_CFLAGS already contains -fvisibility=hidden) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; #( *) : as_fn_append AM_CFLAGS " -fvisibility=hidden" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } ;; esac -else +else $as_nop AM_CFLAGS=-fvisibility=hidden - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CFLAGS=\"\$AM_CFLAGS\""; } >&5 (: AM_CFLAGS="$AM_CFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - - -if ${AM_CPPFLAGS+:} false; then : - - case " $AM_CPPFLAGS " in #( - *" -DXML_ENABLE_VISIBILITY=1 "*) : - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5 - (: AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } ;; #( - *) : - - as_fn_append AM_CPPFLAGS " -DXML_ENABLE_VISIBILITY=1" - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - ;; -esac - -else - - AM_CPPFLAGS=-DXML_ENABLE_VISIBILITY=1 - { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 - (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - -fi - -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } -else - ac_cv_header_stdc=no fi -rm -f conftest* -fi + if test "${enable_shared}" = yes +then : -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif +if test ${AM_CPPFLAGS+y} +then : -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + case " $AM_CPPFLAGS " in #( + *" -DXML_ENABLE_VISIBILITY=1 "*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1"; } >&5 + (: AM_CPPFLAGS already contains -DXML_ENABLE_VISIBILITY=1) 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } ;; #( + *) : -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + as_fn_append AM_CPPFLAGS " -DXML_ENABLE_VISIBILITY=1" + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + ;; +esac -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then +else $as_nop -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + AM_CPPFLAGS=-DXML_ENABLE_VISIBILITY=1 + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: : AM_CPPFLAGS=\"\$AM_CPPFLAGS\""; } >&5 + (: AM_CPPFLAGS="$AM_CPPFLAGS") 2>&5 + ac_status=$? + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } fi +fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17590,7 +18725,8 @@ else typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -17614,7 +18750,7 @@ if ac_fn_c_try_compile "$LINENO"; then : fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -17623,7 +18759,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -17635,7 +18771,8 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17643,7 +18780,7 @@ if ac_fn_c_try_compile "$LINENO"; then : #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -17653,14 +18790,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -17669,7 +18807,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -17679,14 +18817,15 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -17696,50 +18835,54 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then +if ac_fn_c_try_link "$LINENO" +then : + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -17748,251 +18891,798 @@ if ac_fn_c_try_compile "$LINENO"; then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + ac_cv_c_bigendian=no +else $as_nop + ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h + + BYTEORDER=4321;; #( + no) + BYTEORDER=1234 ;; #( + universal) + +printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac + + +printf "%s\n" "#define BYTEORDER $BYTEORDER" >>confdefs.h + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +printf %s "checking for an ANSI C-conforming const... " >&6; } +if test ${ac_cv_c_const+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#ifndef __cplusplus + /* Ultrix mips cc rejects this sort of thing. */ + typedef int charset[2]; + const charset cs = { 0, 0 }; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* IBM XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this sort of thing. */ + char tx; + char *t = &tx; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* IBM XL C 1.02.0.0 rejects this sort of thing, saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; } bx; + struct s *b = &bx; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_c_const=yes +else $as_nop + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +printf "%s\n" "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +printf "%s\n" "#define const /**/" >>confdefs.h + +fi + + + +# Check whether --with-xmlwf was given. +if test ${with_xmlwf+y} +then : + withval=$with_xmlwf; +else $as_nop + with_xmlwf=yes +fi + + if test x${with_xmlwf} = xyes; then + WITH_XMLWF_TRUE= + WITH_XMLWF_FALSE='#' +else + WITH_XMLWF_TRUE='#' + WITH_XMLWF_FALSE= +fi + + + +# Check whether --with-examples was given. +if test ${with_examples+y} +then : + withval=$with_examples; +else $as_nop + with_examples=yes +fi + + if test x${with_examples} = xyes; then + WITH_EXAMPLES_TRUE= + WITH_EXAMPLES_FALSE='#' +else + WITH_EXAMPLES_TRUE='#' + WITH_EXAMPLES_FALSE= +fi + + + +# Check whether --with-tests was given. +if test ${with_tests+y} +then : + withval=$with_tests; +else $as_nop + with_tests=yes +fi + + if test x${with_tests} = xyes; then + WITH_TESTS_TRUE= + WITH_TESTS_FALSE='#' +else + WITH_TESTS_TRUE='#' + WITH_TESTS_FALSE= +fi + + +if test x${with_tests} = xyes +then : + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=true + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + switch=-std:c++${alternative} + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_${switch}_MSVC" | $as_tr_sh` + else + cachevar=`printf "%s\n" "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 +printf %s "checking whether $CXX supports C++11 features with $switch... " >&6; } +if eval test \${$cachevar+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - ac_cv_c_bigendian=no -else - ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi + namespace test_type_deduction + { - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; - BYTEORDER=4321;; #( - no) - BYTEORDER=1234 ;; #( - universal) + template < typename T > + struct is_same + { + static const bool value = true; + }; -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } - ;; #( - *) - as_fn_error $? "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + } -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF + namespace test_noexcept + { + int f() { return 0; } + int g() noexcept { return 0; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if ${ac_cv_c_const+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); -int -main () -{ + } -#ifndef __cplusplus - /* Ultrix mips cc rejects this sort of thing. */ - typedef int charset[2]; - const charset cs = { 0, 0 }; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* AIX XL C 1.02.0.0 rejects this. - It does not let you subtract one const X* pointer from another in - an arm of an if-expression whose if-part is not a constant - expression */ - const char *g = "string"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this sort of thing. */ - char tx; - char *t = &tx; - char const *s = 0 ? (char *) 0 : (char const *) 0; + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); - *t++ = 0; - if (s) return 0; } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + } - { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying - "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ - struct s { int j; const int *ap[3]; } bx; - struct s *b = &bx; b->j = 5; + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + } - { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; - if (!foo) return 0; + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + } - return !cs[0] && !zero.x; -#endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { -$as_echo "#define const /**/" >>confdefs.h + struct foo {}; -fi + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : -else -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int _ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + eval $cachevar=yes +else $as_nop + eval $cachevar=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + CXX="$ac_save_CXX" +fi +eval ac_res=\$$cachevar + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -fi + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX11=0 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5 +printf "%s\n" "$as_me: No compiler with C++11 support was found" >&6;} + else + HAVE_CXX11=1 +printf "%s\n" "#define HAVE_CXX11 1" >>confdefs.h + + fi -# Check whether --with-xmlwf was given. -if test "${with_xmlwf+set}" = set; then : - withval=$with_xmlwf; -else - with_xmlwf=yes fi - if test x${with_xmlwf} = xyes; then - WITH_XMLWF_TRUE= - WITH_XMLWF_FALSE='#' +EXPATCFG_ON_MINGW=no +case "${host_os}" in #( + mingw*) : + EXPATCFG_ON_MINGW=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5 +printf "%s\n" "$as_me: detected OS: MinGW" >&6;} ;; #( + *) : + ;; +esac + if test x${EXPATCFG_ON_MINGW} = xyes; then + MINGW_TRUE= + MINGW_FALSE='#' else - WITH_XMLWF_TRUE='#' - WITH_XMLWF_FALSE= + MINGW_TRUE='#' + MINGW_FALSE= fi + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null; then + UNICODE_TRUE= + UNICODE_FALSE='#' +else + UNICODE_TRUE='#' + UNICODE_FALSE= +fi -# Check whether --with-examples was given. -if test "${with_examples+set}" = set; then : - withval=$with_examples; + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null; then + _INTERNAL_UNICODE_WCHAR_T_TRUE= + _INTERNAL_UNICODE_WCHAR_T_FALSE='#' else - with_examples=yes + _INTERNAL_UNICODE_WCHAR_T_TRUE='#' + _INTERNAL_UNICODE_WCHAR_T_FALSE= fi - if test x${with_examples} = xyes; then - WITH_EXAMPLES_TRUE= - WITH_EXAMPLES_FALSE='#' + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null; then + _INTERNAL_MIN_SIZE_TRUE= + _INTERNAL_MIN_SIZE_FALSE='#' else - WITH_EXAMPLES_TRUE='#' - WITH_EXAMPLES_FALSE= + _INTERNAL_MIN_SIZE_TRUE='#' + _INTERNAL_MIN_SIZE_FALSE= fi + if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null; then + _INTERNAL_LARGE_SIZE_TRUE= + _INTERNAL_LARGE_SIZE_FALSE='#' +else + _INTERNAL_LARGE_SIZE_TRUE='#' + _INTERNAL_LARGE_SIZE_FALSE= +fi -# Check whether --with-tests was given. -if test "${with_tests+set}" = set; then : - withval=$with_tests; -else - with_tests=yes +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-mingw* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _mwvalidcheckl in -lmw" >&5 +printf %s "checking for _mwvalidcheckl in -lmw... " >&6; } +if test ${ac_cv_lib_mw__mwvalidcheckl+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _mwvalidcheckl (void); +int +main (void) +{ +return _mwvalidcheckl (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_mw__mwvalidcheckl=yes +else $as_nop + ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +printf "%s\n" "$ac_cv_lib_mw__mwvalidcheckl" >&6; } +if test "x$ac_cv_lib_mw__mwvalidcheckl" = xyes +then : + LIBM=-lmw +fi + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +printf %s "checking for cos in -lm... " >&6; } +if test ${ac_cv_lib_m_cos+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cos (void); +int +main (void) +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_cos=yes +else $as_nop + ac_cv_lib_m_cos=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi - - if test x${with_tests} = xyes; then - WITH_TESTS_TRUE= - WITH_TESTS_FALSE='#' -else - WITH_TESTS_TRUE='#' - WITH_TESTS_FALSE= +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +printf "%s\n" "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes +then : + LIBM="$LIBM -lm" fi + ;; +*) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 +printf %s "checking for cos in -lm... " >&6; } +if test ${ac_cv_lib_m_cos+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ - -EXPATCFG_ON_MINGW=no -case "${host_os}" in #( - mingw*) : - EXPATCFG_ON_MINGW=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: detected OS: MinGW" >&5 -$as_echo "$as_me: detected OS: MinGW" >&6;} ;; #( - *) : - ;; -esac - if test x${EXPATCFG_ON_MINGW} = xyes; then - MINGW_TRUE= - MINGW_FALSE='#' -else - MINGW_TRUE='#' - MINGW_FALSE= +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char cos (void); +int +main (void) +{ +return cos (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_m_cos=yes +else $as_nop + ac_cv_lib_m_cos=no fi - - - if echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null; then - UNICODE_TRUE= - UNICODE_FALSE='#' -else - UNICODE_TRUE='#' - UNICODE_FALSE= +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 +printf "%s\n" "$ac_cv_lib_m_cos" >&6; } +if test "x$ac_cv_lib_m_cos" = xyes +then : + LIBM=-lm fi + ;; +esac + # Check whether --with-libbsd was given. -if test "${with_libbsd+set}" = set; then : +if test ${with_libbsd+y} +then : withval=$with_libbsd; -else +else $as_nop with_libbsd=no fi -if test "x${with_libbsd}" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 -$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } -if ${ac_cv_lib_bsd_arc4random_buf+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x${with_libbsd}" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 +printf %s "checking for arc4random_buf in -lbsd... " >&6; } +if test ${ac_cv_lib_bsd_arc4random_buf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18000,71 +19690,78 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ #ifdef __cplusplus extern "C" #endif -char arc4random_buf (); +char arc4random_buf (void); int -main () +main (void) { return arc4random_buf (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_bsd_arc4random_buf=yes -else +else $as_nop ac_cv_lib_bsd_arc4random_buf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5 -$as_echo "$ac_cv_lib_bsd_arc4random_buf" >&6; } -if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBBSD 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5 +printf "%s\n" "$ac_cv_lib_bsd_arc4random_buf" >&6; } +if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes +then : + printf "%s\n" "#define HAVE_LIBBSD 1" >>confdefs.h LIBS="-lbsd $LIBS" -else - if test "x${with_libbsd}" = xyes; then : +else $as_nop + if test "x${with_libbsd}" = xyes +then : as_fn_error $? "Enforced use of libbsd cannot be satisfied." "$LINENO" 5 fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD or libbsd)" >&5 -$as_echo_n "checking for arc4random_buf (BSD or libbsd)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf (BSD, libbsd or glibc 2.36+)" >&5 +printf %s "checking for arc4random_buf (BSD, libbsd or glibc 2.36+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif - int main() { - arc4random_buf(NULL, 0U); + int main(void) { + char dummy[123]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h +printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS or libbsd)" >&5 -$as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)" >&5 +printf %s "checking for arc4random (BSD, macOS, libbsd or glibc 2.36+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18073,175 +19770,172 @@ $as_echo_n "checking for arc4random (BSD, macOS or libbsd)... " >&6; } #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define HAVE_ARC4RANDOM 1" >>confdefs.h +printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext # Check whether --with-getrandom was given. -if test "${with_getrandom+set}" = set; then : +if test ${with_getrandom+y} +then : withval=$with_getrandom; -else +else $as_nop with_getrandom=check fi -if test "x$with_getrandom" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5 -$as_echo_n "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; } +if test "x$with_getrandom" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getrandom (Linux 3.17+, glibc 2.25+)" >&5 +printf %s "checking for getrandom (Linux 3.17+, glibc 2.25+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_GETRANDOM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_getrandom" = xyes; then : +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "x$with_getrandom" = xyes +then : as_fn_error $? "enforced the use of getrandom --with-getrandom, but not detected" "$LINENO" 5 fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi # Check whether --with-sys_getrandom was given. -if test "${with_sys_getrandom+set}" = set; then : +if test ${with_sys_getrandom+y} +then : withval=$with_sys_getrandom; -else +else $as_nop with_sys_getrandom=check fi -if test "x$with_sys_getrandom" != xno; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5 -$as_echo_n "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; } +if test "x$with_sys_getrandom" != xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for syscall SYS_getrandom (Linux 3.17+)" >&5 +printf %s "checking for syscall SYS_getrandom (Linux 3.17+)... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -$as_echo "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_sys_getrandom" = xyes; then : +if ac_fn_c_try_link "$LINENO" +then : + +printf "%s\n" "#define HAVE_SYSCALL_GETRANDOM 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + if test "x$with_sys_getrandom" = xyes +then : as_fn_error $? "enforced the use of syscall SYS_getrandom --with-sys-getrandom, but not detected" "$LINENO" 5 fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -for ac_header in fcntl.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" +if test "x$ac_cv_header_fcntl_h" = xyes +then : + printf "%s\n" "#define HAVE_FCNTL_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" +if test "x$ac_cv_header_unistd_h" = xyes +then : + printf "%s\n" "#define HAVE_UNISTD_H 1" >>confdefs.h -done +fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : +if test "x$ac_cv_type_off_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF +printf "%s\n" "#define off_t long int" >>confdefs.h fi - - - for ac_header in $ac_header_list -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - +ac_func= +for ac_item in $ac_func_c_list +do + if test $ac_func; then + ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func + if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then + echo "#define $ac_item 1" >> confdefs.h + fi + ac_func= + else + ac_func=$ac_item + fi done - - - - - - -for ac_func in getpagesize -do : - ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -if test "x$ac_cv_func_getpagesize" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETPAGESIZE 1 -_ACEOF - -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -$as_echo_n "checking for working mmap... " >&6; } -if ${ac_cv_func_mmap_fixed_mapped+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - ac_cv_func_mmap_fixed_mapped=no -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 +printf %s "checking for working mmap... " >&6; } +if test ${ac_cv_func_mmap_fixed_mapped+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + case "$host_os" in # (( + # Guess yes on platforms where we know the result. + linux*) ac_cv_func_mmap_fixed_mapped=yes ;; + # If we don't know, assume the worst. + *) ac_cv_func_mmap_fixed_mapped=no ;; + esac +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -18273,10 +19967,6 @@ $ac_includes_default #include #include -#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -char *malloc (); -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE # ifdef _SC_PAGESIZE @@ -18310,7 +20000,7 @@ char *malloc (); #endif /* no HAVE_GETPAGESIZE */ int -main () +main (void) { char *data, *data2, *data3; const char *cdata2; @@ -18378,12 +20068,15 @@ main () if (*(data + i) != *(data3 + i)) return 14; close (fd); + free (data); + free (data3); return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_func_mmap_fixed_mapped=yes -else +else $as_nop ac_cv_func_mmap_fixed_mapped=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18391,84 +20084,96 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 +printf "%s\n" "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then -$as_echo "#define HAVE_MMAP 1" >>confdefs.h +printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h fi rm -f conftest.mmap conftest.txt -if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then : +if test "$ac_cv_func_mmap_fixed_mapped" = "yes" +then : FILEMAP=unixfilemap -else +else $as_nop FILEMAP=readfilemap fi -$as_echo "#define XML_NS 1" >>confdefs.h +printf "%s\n" "#define XML_NS 1" >>confdefs.h + + +printf "%s\n" "#define XML_GE 1" >>confdefs.h -$as_echo "#define XML_DTD 1" >>confdefs.h +printf "%s\n" "#define XML_DTD 1" >>confdefs.h -$as_echo "#define XML_DEV_URANDOM 1" >>confdefs.h +printf "%s\n" "#define XML_DEV_URANDOM 1" >>confdefs.h # Check whether --enable-xml-attr-info was given. -if test "${enable_xml_attr_info+set}" = set; then : +if test ${enable_xml_attr_info+y} +then : enableval=$enable_xml_attr_info; -else +else $as_nop enable_xml_attr_info=no fi -if test "x${enable_xml_attr_info}" = "xyes"; then : +if test "x${enable_xml_attr_info}" = "xyes" +then : -$as_echo "#define XML_ATTR_INFO 1" >>confdefs.h +printf "%s\n" "#define XML_ATTR_INFO 1" >>confdefs.h fi # Check whether --enable-xml-context was given. -if test "${enable_xml_context+set}" = set; then : +if test ${enable_xml_context+y} +then : enableval=$enable_xml_context; enable_xml_context=${enableval} fi -if test "x${enable_xml_context}" != "xno"; then : +if test "x${enable_xml_context}" != "xno" +then : if test "x${enable_xml_context}" = "xyes" \ - -o "x${enable_xml_context}" = "x"; then : + -o "x${enable_xml_context}" = "x" +then : enable_xml_context=1024 fi +else $as_nop + enable_xml_context=0 +fi -cat >>confdefs.h <<_ACEOF -#define XML_CONTEXT_BYTES ${enable_xml_context} -_ACEOF +printf "%s\n" "#define XML_CONTEXT_BYTES ${enable_xml_context}" >>confdefs.h -fi # Check whether --with-docbook was given. -if test "${with_docbook+set}" = set; then : +if test ${with_docbook+y} +then : withval=$with_docbook; -else +else $as_nop with_docbook=check fi -if test "x$with_docbook" != xno; then : +if test "x$with_docbook" != xno +then : for ac_prog in docbook2x-man db2x_docbook2man docbook2man docbook-to-man do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DOCBOOK_TO_MAN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DOCBOOK_TO_MAN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DOCBOOK_TO_MAN"; then ac_cv_prog_DOCBOOK_TO_MAN="$DOCBOOK_TO_MAN" # Let the user override the test. else @@ -18476,11 +20181,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DOCBOOK_TO_MAN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -18491,11 +20200,11 @@ fi fi DOCBOOK_TO_MAN=$ac_cv_prog_DOCBOOK_TO_MAN if test -n "$DOCBOOK_TO_MAN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5 -$as_echo "$DOCBOOK_TO_MAN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DOCBOOK_TO_MAN" >&5 +printf "%s\n" "$DOCBOOK_TO_MAN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -18503,11 +20212,14 @@ fi done fi -if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes; then : +if test "x${DOCBOOK_TO_MAN}" = x -a "x$with_docbook" = xyes +then : as_fn_error $? "Required program 'docbook2x-man' not found." "$LINENO" 5 fi -if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then : - if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase; then : +if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno +then : + if ${DOCBOOK_TO_MAN} --help | grep -i -q -F sgmlbase +then : as_fn_error $? "Your local ${DOCBOOK_TO_MAN} was found to work with SGML rather than XML. Please install docbook2X and use variable DOCBOOK_TO_MAN to point configure to command docbook2x-man of docbook2X. @@ -18517,12 +20229,158 @@ if test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno; then : fi fi - if test "x${DOCBOOK_TO_MAN}" != x; then - WITH_DOCBOOK_TRUE= - WITH_DOCBOOK_FALSE='#' +if test -f "${srcdir}"/doc/xmlwf.1 +then : + if true; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x +then : + if true; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' +else + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + + if false; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +else $as_nop + if false; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' +else + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + + if true; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +fi + +else $as_nop + if test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x +then : + if true; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if true; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +else $as_nop + if false; then + WITH_MANPAGE_TRUE= + WITH_MANPAGE_FALSE='#' +else + WITH_MANPAGE_TRUE='#' + WITH_MANPAGE_FALSE= +fi + + if false; then + WITH_DISTRIBUTABLE_MANPAGE_TRUE= + WITH_DISTRIBUTABLE_MANPAGE_FALSE='#' +else + WITH_DISTRIBUTABLE_MANPAGE_TRUE='#' + WITH_DISTRIBUTABLE_MANPAGE_FALSE= +fi + +fi + if false; then + WITH_PREBUILT_MANPAGE_TRUE= + WITH_PREBUILT_MANPAGE_FALSE='#' else - WITH_DOCBOOK_TRUE='#' - WITH_DOCBOOK_FALSE= + WITH_PREBUILT_MANPAGE_TRUE='#' + WITH_PREBUILT_MANPAGE_FALSE= +fi + +fi + +if test "x${enable_xml_attr_info}" = xyes +then : + EXPAT_ATTR_INFO=ON +else $as_nop + EXPAT_ATTR_INFO=OFF +fi +EXPAT_DTD=ON +if test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x +then : + EXPAT_LARGE_SIZE=ON +else $as_nop + EXPAT_LARGE_SIZE=OFF +fi +if test "x${_INTERNAL_MIN_SIZE_TRUE}" = x +then : + EXPAT_MIN_SIZE=ON +else $as_nop + EXPAT_MIN_SIZE=OFF +fi +EXPAT_NS=ON +if test "x${enable_xml_context}" != xno +then : + EXPAT_CONTEXT_BYTES=${enable_xml_context} +else $as_nop + EXPAT_CONTEXT_BYTES=OFF +fi +if test "x${UNICODE_TRUE}" = x +then : + if test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x +then : + EXPAT_CHAR_TYPE=wchar_t +else $as_nop + EXPAT_CHAR_TYPE=ushort +fi +else $as_nop + EXPAT_CHAR_TYPE=char +fi +PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake +LIBDIR_BASENAME="$(basename "${libdir}")" +SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" +SO_MINOR="${LIBAGE}" +SO_PATCH="${LIBREVISION}" + + + + + + + + + + + + + +if ac_fn_c_compute_int "$LINENO" "sizeof(void *)" "SIZEOF_VOID_P" "" +then : + fi @@ -18531,10 +20389,28 @@ fi -_EXPAT_OUTPUT_NAME="$PACKAGE_NAME" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library name prefix" >&5 +printf %s "checking for shared library name prefix... " >&6; } +case "${host_os}" in #( + cygwin*) : + CMAKE_SHARED_LIBRARY_PREFIX=cyg ;; #( + *) : + CMAKE_SHARED_LIBRARY_PREFIX=lib ;; +esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${CMAKE_SHARED_LIBRARY_PREFIX}" >&5 +printf "%s\n" "${CMAKE_SHARED_LIBRARY_PREFIX}" >&6; } -ac_config_files="$ac_config_files Makefile expat.pc doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile" +case "${host_os}" in #( + darwin*) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in ;; #( + mingw*|cygwin*) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in ;; #( + *) : + CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in ;; +esac +ac_config_files="$ac_config_files Makefile expat.pc cmake/expat-config.cmake cmake/autotools/expat-config-version.cmake cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE} doc/Makefile examples/Makefile lib/Makefile tests/Makefile tests/benchmark/Makefile xmlwf/Makefile" ac_config_files="$ac_config_files run.sh" @@ -18565,8 +20441,8 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -18596,15 +20472,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -18618,8 +20494,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;} fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -18636,7 +20512,7 @@ U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -18647,14 +20523,14 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -18663,6 +20539,10 @@ else am__EXEEXT_FALSE= fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -18696,8 +20576,56 @@ if test -z "${UNICODE_TRUE}" && test -z "${UNICODE_FALSE}"; then as_fn_error $? "conditional \"UNICODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${WITH_DOCBOOK_TRUE}" && test -z "${WITH_DOCBOOK_FALSE}"; then - as_fn_error $? "conditional \"WITH_DOCBOOK\" was never defined. +if test -z "${_INTERNAL_UNICODE_WCHAR_T_TRUE}" && test -z "${_INTERNAL_UNICODE_WCHAR_T_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_UNICODE_WCHAR_T\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${_INTERNAL_MIN_SIZE_TRUE}" && test -z "${_INTERNAL_MIN_SIZE_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_MIN_SIZE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${_INTERNAL_LARGE_SIZE_TRUE}" && test -z "${_INTERNAL_LARGE_SIZE_FALSE}"; then + as_fn_error $? "conditional \"_INTERNAL_LARGE_SIZE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_MANPAGE_TRUE}" && test -z "${WITH_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_DISTRIBUTABLE_MANPAGE_TRUE}" && test -z "${WITH_DISTRIBUTABLE_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_DISTRIBUTABLE_MANPAGE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WITH_PREBUILT_MANPAGE_TRUE}" && test -z "${WITH_PREBUILT_MANPAGE_FALSE}"; then + as_fn_error $? "conditional \"WITH_PREBUILT_MANPAGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -18705,8 +20633,8 @@ fi ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -18729,14 +20657,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -18746,46 +20676,46 @@ esac fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -18794,13 +20724,6 @@ if test "${PATH_SEPARATOR+set}" != set; then fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -18809,8 +20732,12 @@ case $0 in #(( for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -18822,30 +20749,10 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -18858,13 +20765,14 @@ as_fn_error () as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -18891,18 +20799,20 @@ as_fn_unset () { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -18914,12 +20824,13 @@ fi # as_fn_append # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -18950,7 +20861,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -18972,6 +20883,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -18985,6 +20900,12 @@ case `echo -n x` in #((((( ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -19026,7 +20947,7 @@ as_fn_mkdir_p () as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -19035,7 +20956,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -19097,8 +21018,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by expat $as_me 2.2.10, which was -generated by GNU Autoconf 2.69. Invocation command line was +This file was extended by expat $as_me 2.6.4, which was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -19157,17 +21078,19 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -expat config.status 2.2.10 -configured by $0, generated by GNU Autoconf 2.69, +expat config.status 2.6.4 +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -19207,15 +21130,15 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" @@ -19223,7 +21146,7 @@ do --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; @@ -19232,7 +21155,7 @@ do as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -19260,7 +21183,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -19274,7 +21197,7 @@ exec 5>>config.log sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -19329,12 +21252,14 @@ lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_q lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +FILECMD='`$ECHO "$FILECMD" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +lt_ar_flags='`$ECHO "$lt_ar_flags" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' @@ -19512,13 +21437,13 @@ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ +FILECMD \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ sharedlib_from_linklib_cmd \ AR \ -AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ @@ -19680,6 +21605,9 @@ do "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "expat.pc") CONFIG_FILES="$CONFIG_FILES expat.pc" ;; + "cmake/expat-config.cmake") CONFIG_FILES="$CONFIG_FILES cmake/expat-config.cmake" ;; + "cmake/autotools/expat-config-version.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-config-version.cmake" ;; + "cmake/autotools/expat-noconfig.cmake") CONFIG_FILES="$CONFIG_FILES cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; @@ -19698,9 +21626,9 @@ done # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -19735,7 +21663,24 @@ ac_tmp=$tmp # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then - +if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then + ac_cs_awk_getline=: + ac_cs_awk_pipe_init= + ac_cs_awk_read_file=' + while ((getline aline < (F[key])) > 0) + print(aline) + close(F[key])' + ac_cs_awk_pipe_fini= +else + ac_cs_awk_getline=false + ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" + ac_cs_awk_read_file=' + print "|#_!!_#|" + print "cat " F[key] " &&" + '$ac_cs_awk_pipe_init + # The final `:' finishes the AND list. + ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' +fi ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this @@ -19753,6 +21698,17 @@ fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF +# Create commands to substitute file output variables. +{ + echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && + echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && + echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && + echo "_ACAWK" && + echo "_ACEOF" +} >conf$$files.sh && +. ./conf$$files.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +rm -f conf$$files.sh { echo "cat >conf$$subs.awk <<_ACEOF" && @@ -19829,7 +21785,7 @@ _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" - + \$ac_cs_awk_pipe_init } { line = $ 0 @@ -19847,10 +21803,16 @@ cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && } else len += 1 + keylen } - + if (nfields == 3 && !substed) { + key = field[2] + if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { + \$ac_cs_awk_read_file + next + } + } print line } - +\$ac_cs_awk_pipe_fini _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 @@ -20036,7 +21998,7 @@ do esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -20044,17 +22006,17 @@ do # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -20071,7 +22033,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20095,9 +22057,9 @@ $as_echo X"$ac_file" | case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -20159,8 +22121,8 @@ ac_sed_dataroot=' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -20197,16 +22159,21 @@ s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | +if $ac_cs_awk_getline; then + $AWK -f "$ac_tmp/subs.awk" +else + $AWK -f "$ac_tmp/subs.awk" | $SHELL +fi \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -20222,20 +22189,20 @@ which seems to be undefined. Please make sure it is defined" >&2;} # if test x"$ac_file" != x-; then { - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +printf "%s\n" "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else - $as_echo "/* $configure_input */" \ + printf "%s\n" "/* $configure_input */" >&1 \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi @@ -20255,7 +22222,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | +printf "%s\n" X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20275,8 +22242,8 @@ $as_echo X"$_am_arg" | s/.*/./; q'`/stamp-h$_am_stamp_count ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -20302,7 +22269,7 @@ esac for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -20314,7 +22281,7 @@ $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20336,7 +22303,7 @@ $as_echo X"$am_mf" | $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -20361,8 +22328,8 @@ $as_echo X/"$am_mf" | (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. If GNU make was not used, consider re-running the configure script with MAKE=\"gmake\" (or whatever is @@ -20393,19 +22360,18 @@ See \`config.log' for more details" "$LINENO" 5; } cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 -# Copyright (C) 2014 Free Software Foundation, Inc. +# Copyright (C) 2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of of the License, or +# the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you @@ -20522,6 +22488,9 @@ to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd +# A file(cmd) program that detects file types. +FILECMD=$lt_FILECMD + # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -20540,8 +22509,11 @@ sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR +# Flags to create an archive (by configure). +lt_ar_flags=$lt_ar_flags + # Flags to create an archive. -AR_FLAGS=$lt_AR_FLAGS +AR_FLAGS=\${ARFLAGS-"\$lt_ar_flags"} # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec @@ -20783,7 +22755,7 @@ hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute @@ -20923,6 +22895,7 @@ _LT_EOF esac + ltmain=$ac_aux_dir/ltmain.sh @@ -20930,7 +22903,7 @@ ltmain=$ac_aux_dir/ltmain.sh # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" \ + $SED '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || @@ -21025,7 +22998,7 @@ hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary and the resulting library dependency is -# "absolute",i.e impossible to change by setting \$shlibpath_var if the +# "absolute",i.e. impossible to change by setting \$shlibpath_var if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX @@ -21126,13 +23099,13 @@ if test "$no_create" != yes; then $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Automake flags (can be overridden by user flags): AM_CPPFLAGS: ${AM_CPPFLAGS} @@ -21145,7 +23118,7 @@ User flags (override Automake flags on conflict): CFLAGS: ${CFLAGS} CXXFLAGS: ${CXXFLAGS} LDFLAGS: ${LDFLAGS}" >&5 -$as_echo "$as_me: +printf "%s\n" "$as_me: Automake flags (can be overridden by user flags): AM_CPPFLAGS: ${AM_CPPFLAGS} @@ -21158,3 +23131,4 @@ User flags (override Automake flags on conflict): CFLAGS: ${CFLAGS} CXXFLAGS: ${CXXFLAGS} LDFLAGS: ${LDFLAGS}" >&6;} + diff --git a/3rdparty/expat/configure.ac b/3rdparty/expat/configure.ac index 82ec1fdd178a1..5685f73bd64d4 100644 --- a/3rdparty/expat/configure.ac +++ b/3rdparty/expat/configure.ac @@ -1,21 +1,56 @@ dnl configuration script for expat dnl Process this file with autoconf to produce a configure script. +dnl __ __ _ +dnl ___\ \/ /_ __ __ _| |_ +dnl / _ \\ /| '_ \ / _` | __| +dnl | __// \| |_) | (_| | |_ +dnl \___/_/\_\ .__/ \__,_|\__| +dnl |_| XML parser dnl -dnl Copyright 2000 Clark Cooper +dnl Copyright (c) 2000 Clark Cooper +dnl Copyright (c) 2000-2005 Fred L. Drake, Jr. +dnl Copyright (c) 2001-2003 Greg Stein +dnl Copyright (c) 2006-2012 Karl Waclawek +dnl Copyright (c) 2016-2024 Sebastian Pipping +dnl Copyright (c) 2017 S. P. Zeidler +dnl Copyright (c) 2017 Stephen Groat +dnl Copyright (c) 2017-2020 Joe Orton +dnl Copyright (c) 2018 Yury Gribov +dnl Copyright (c) 2018 Benjamin Peterson +dnl Copyright (c) 2018 Marco Maggi +dnl Copyright (c) 2018 KangLin +dnl Copyright (c) 2019 Mohammed Khajapasha +dnl Copyright (c) 2019 Kishore Kunche +dnl Copyright (c) 2020 Jeffrey Walton +dnl Copyright (c) 2024 Ferenc Gczi +dnl Copyright (c) 2024 Dag-Erling Smrgrav +dnl Licensed under the MIT license: dnl -dnl This file is part of EXPAT. +dnl Permission is hereby granted, free of charge, to any person obtaining +dnl a copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, sublicense, and/or sell copies of the Software, and to permit +dnl persons to whom the Software is furnished to do so, subject to the +dnl following conditions: dnl -dnl EXPAT is free software; you can redistribute it and/or modify it -dnl under the terms of the License (based on the MIT/X license) contained -dnl in the file COPYING that comes with this distribution. +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +dnl EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +dnl NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +dnl USE OR OTHER DEALINGS IN THE SOFTWARE. dnl Ensure that Expat is configured with autoconf 2.69 or newer. -AC_PREREQ(2.69) +AC_PREREQ([2.69]) dnl Get the version number of Expat, using m4's esyscmd() command to run dnl the command at m4-generation time. This allows us to create an m4 -dnl symbol holding the correct version number. AC_INIT() requires the +dnl symbol holding the correct version number. AC_INIT requires the dnl version number at m4-time, rather than when ./configure is run, so dnl all this must happen as part of m4, not as part of the shell code dnl contained in ./configure. @@ -27,7 +62,7 @@ m4_define([expat_version], m4_ifdef([__gnu__], [esyscmd(conftools/get-version.sh lib/expat.h)], [2.2.x])) -AC_INIT(expat, expat_version, expat-bugs@libexpat.org) +AC_INIT([expat], expat_version, [https://github.com/libexpat/libexpat/issues]) m4_undefine([expat_version]) AC_CONFIG_SRCDIR([Makefile.in]) @@ -35,6 +70,7 @@ AC_CONFIG_AUX_DIR([conftools]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE +AM_MAINTAINER_MODE([enable]) # to allow argument --disable-maintainer-mode dnl @@ -48,12 +84,14 @@ dnl dnl If the API changes incompatibly set LIBAGE back to 0 dnl -LIBCURRENT=7 # sync -LIBREVISION=12 # with -LIBAGE=6 # CMakeLists.txt! +LIBCURRENT=11 # sync +LIBREVISION=0 # with +LIBAGE=10 # CMakeLists.txt! -AX_APPEND_FLAG([-DHAVE_EXPAT_CONFIG_H], [AM_CPPFLAGS]) -AC_CONFIG_HEADER([expat_config.h]) +AC_CONFIG_HEADERS([expat_config.h]) +AH_TOP([#ifndef EXPAT_CONFIG_H +#define EXPAT_CONFIG_H 1]) +AH_BOTTOM([#endif // ndef EXPAT_CONFIG_H]) AM_PROG_AR AC_PROG_INSTALL @@ -70,6 +108,9 @@ AC_SUBST(LIBAGE) AC_LANG([C]) AC_PROG_CC_C99 +AS_IF([test "${ac_cv_prog_cc_c99}" = no], + [AC_MSG_ERROR([Expat requires a C99 compiler.])]) + AS_IF([test "$GCC" = yes], [AX_APPEND_COMPILE_FLAGS([-Wall -Wextra], [AM_CFLAGS]) dnl Be careful about adding the -fexceptions option; some versions of @@ -79,7 +120,7 @@ AS_IF([test "$GCC" = yes], AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -Wmissing-prototypes -Wstrict-prototypes], [AM_CFLAGS]) AX_APPEND_COMPILE_FLAGS([-pedantic -Wduplicated-cond -Wduplicated-branches -Wlogical-op], [AM_CFLAGS]) AX_APPEND_COMPILE_FLAGS([-Wrestrict -Wnull-dereference -Wjump-misses-init -Wdouble-promotion], [AM_CFLAGS]) - AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wmisleading-indentation], [AM_CFLAGS])]) + AX_APPEND_COMPILE_FLAGS([-Wshadow -Wformat=2 -Wno-pedantic-ms-format -Wmisleading-indentation], [AM_CFLAGS])]) AC_LANG_PUSH([C++]) AC_PROG_CXX @@ -102,11 +143,9 @@ AS_CASE(["$LD"],[*clang*], [*linux*],[archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'])]) EXPATCFG_COMPILER_SUPPORTS_VISIBILITY([ - AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS]) - AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])]) - -dnl Checks for header files. -AC_HEADER_STDC + AX_APPEND_FLAG([-fvisibility=hidden], [AM_CFLAGS]) + AS_IF([test "${enable_shared}" = yes], + [AX_APPEND_FLAG([-DXML_ENABLE_VISIBILITY=1], [AM_CPPFLAGS])])]) dnl Checks for typedefs, structures, and compiler characteristics. @@ -123,7 +162,6 @@ AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1) AC_DEFINE_UNQUOTED([BYTEORDER], $BYTEORDER, [1234 = LILENDIAN, 4321 = BIGENDIAN]) AC_C_CONST -AC_TYPE_SIZE_T AC_ARG_WITH([xmlwf], [AS_HELP_STRING([--without-xmlwf], [do not build xmlwf])], @@ -143,6 +181,8 @@ AC_ARG_WITH([tests], [with_tests=yes]) AM_CONDITIONAL([WITH_TESTS], [test x${with_tests} = xyes]) +AS_IF([test x${with_tests} = xyes], + [AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])]) AS_VAR_SET([EXPATCFG_ON_MINGW],[no]) AS_CASE("${host_os}", @@ -151,8 +191,13 @@ AS_CASE("${host_os}", AC_MSG_NOTICE([detected OS: MinGW])]) AM_CONDITIONAL([MINGW], [test x${EXPATCFG_ON_MINGW} = xyes]) +dnl Note: Prefix "_INTERNAL_" here means exclusive use inside of file configure.ac AM_CONDITIONAL([UNICODE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE >/dev/null]) +AM_CONDITIONAL([_INTERNAL_UNICODE_WCHAR_T], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_UNICODE_WCHAR_T >/dev/null]) +AM_CONDITIONAL([_INTERNAL_MIN_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_MIN_SIZE >/dev/null]) +AM_CONDITIONAL([_INTERNAL_LARGE_SIZE], [echo -- "${CPPFLAGS}${CFLAGS}" | ${FGREP} XML_LARGE_SIZE >/dev/null]) +LT_LIB_M AC_ARG_WITH([libbsd], [AS_HELP_STRING([--with-libbsd], [utilize libbsd (for arc4random_buf)])], @@ -164,14 +209,16 @@ AS_IF([test "x${with_libbsd}" != xno], [], [AS_IF([test "x${with_libbsd}" = xyes], [AC_MSG_ERROR([Enforced use of libbsd cannot be satisfied.])])])]) -AC_MSG_CHECKING([for arc4random_buf (BSD or libbsd)]) +AC_MSG_CHECKING([for arc4random_buf (BSD, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include /* for arc4random_buf on BSD, for NULL */ #if defined(HAVE_LIBBSD) # include + #else + # include /* for arc4random_buf on BSD */ #endif - int main() { - arc4random_buf(NULL, 0U); + int main(void) { + char dummy[[123]]; // double brackets for m4 + arc4random_buf(dummy, 0U); return 0; } ])], @@ -179,14 +226,14 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) - AC_MSG_CHECKING([for arc4random (BSD, macOS or libbsd)]) + AC_MSG_CHECKING([for arc4random (BSD, macOS, libbsd or glibc 2.36+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if defined(HAVE_LIBBSD) # include #else # include #endif - int main() { + int main(void) { arc4random(); return 0; } @@ -208,7 +255,7 @@ AS_IF([test "x$with_getrandom" != xno], AC_LINK_IFELSE([AC_LANG_SOURCE([ #include /* for NULL */ #include - int main() { + int main(void) { return getrandom(NULL, 0U, 0U); } ])], @@ -229,10 +276,11 @@ AS_HELP_STRING([--without-sys-getrandom], AS_IF([test "x$with_sys_getrandom" != xno], [AC_MSG_CHECKING([for syscall SYS_getrandom (Linux 3.17+)]) AC_LINK_IFELSE([AC_LANG_SOURCE([ + #define _GNU_SOURCE #include /* for NULL */ #include /* for syscall */ #include /* for SYS_getrandom */ - int main() { + int main(void) { syscall(SYS_getrandom, NULL, 0, 0); return 0; } @@ -257,6 +305,8 @@ AC_SUBST(FILEMAP) dnl Some basic configuration: AC_DEFINE([XML_NS], 1, [Define to make XML Namespaces functionality available.]) +AC_DEFINE([XML_GE], 1, + [Define as 1/0 to enable/disable support for general entities.]) AC_DEFINE([XML_DTD], 1, [Define to make parameter entity parsing functionality available.]) AC_DEFINE([XML_DEV_URANDOM], 1, @@ -281,9 +331,10 @@ AS_HELP_STRING([--disable-xml-context], AS_IF([test "x${enable_xml_context}" != "xno"], [AS_IF([test "x${enable_xml_context}" = "xyes" \ -o "x${enable_xml_context}" = "x"], - [AS_VAR_SET(enable_xml_context,1024)]) - AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], - [Define to specify how much context to retain around the current parse point.])]) + [AS_VAR_SET(enable_xml_context,1024)])], + [AS_VAR_SET(enable_xml_context,0)]) +AC_DEFINE_UNQUOTED([XML_CONTEXT_BYTES], [${enable_xml_context}], + [Define to specify how much context to retain around the current parse point, 0 to disable.]) AC_ARG_WITH([docbook], [AS_HELP_STRING([--with-docbook], @@ -307,7 +358,72 @@ AS_IF([test "x${DOCBOOK_TO_MAN}" != x -a "x$with_docbook" != xno], You can also configure using --without-docbook if you can do without a man page for xmlwf.])])]) -AM_CONDITIONAL(WITH_DOCBOOK, [test "x${DOCBOOK_TO_MAN}" != x]) +dnl This will make sure that a release tarball shipping a pre-rendered xmlwf man page will +dnl get it installed, when no working flavor of docbook2man is available (or wanted). +dnl This relies on file xmlwf.1 being at least as recent as its source file xmlwf.xml. +AS_IF([test -f "${srcdir}"/doc/xmlwf.1], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AS_IF([test "x$with_docbook" = xno -o "x${DOCBOOK_TO_MAN}" = x], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])], + [AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])]) + ], + [AS_IF([test "x$with_docbook" != xno -a "x${DOCBOOK_TO_MAN}" != x], + [AM_CONDITIONAL(WITH_MANPAGE, [true]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [true])], + [AM_CONDITIONAL(WITH_MANPAGE, [false]) + AM_CONDITIONAL(WITH_DISTRIBUTABLE_MANPAGE, [false])]) + AM_CONDITIONAL(WITH_PREBUILT_MANPAGE, [false])]) + +dnl Configure CMake file templates +dnl NOTE: The *_TRUE variables read here are Automake conditionals +dnl that are either set to "" when enabled or to "#" when disabled +dnl (because they are used to dynamically comment out certain things) +AS_IF([test "x${enable_xml_attr_info}" = xyes], + [EXPAT_ATTR_INFO=ON], + [EXPAT_ATTR_INFO=OFF]) +EXPAT_DTD=ON +AS_IF([test "x${_INTERNAL_LARGE_SIZE_TRUE}" = x], + [EXPAT_LARGE_SIZE=ON], + [EXPAT_LARGE_SIZE=OFF]) +AS_IF([test "x${_INTERNAL_MIN_SIZE_TRUE}" = x], + [EXPAT_MIN_SIZE=ON], + [EXPAT_MIN_SIZE=OFF]) +EXPAT_NS=ON +AS_IF([test "x${enable_xml_context}" != xno], + [EXPAT_CONTEXT_BYTES=${enable_xml_context}], + [EXPAT_CONTEXT_BYTES=OFF]) +AS_IF([test "x${UNICODE_TRUE}" = x], + [AS_IF( + [test "x${_INTERNAL_UNICODE_WCHAR_T_TRUE}" = x], + [EXPAT_CHAR_TYPE=wchar_t], + [EXPAT_CHAR_TYPE=ushort])], + [EXPAT_CHAR_TYPE=char]) +PACKAGE_INIT="${srcdir}"/cmake/autotools/expat-package-init.cmake +LIBDIR_BASENAME="$(basename "${libdir}")" +SO_MAJOR="$(expr "${LIBCURRENT}" - "${LIBAGE}")" +SO_MINOR="${LIBAGE}" +SO_PATCH="${LIBREVISION}" +AC_SUBST([EXPAT_ATTR_INFO]) +AC_SUBST([EXPAT_DTD]) +AC_SUBST([EXPAT_LARGE_SIZE]) +AC_SUBST([EXPAT_MIN_SIZE]) +AC_SUBST([EXPAT_NS]) +AC_SUBST([EXPAT_CONTEXT_BYTES]) +AC_SUBST([EXPAT_CHAR_TYPE]) +AC_SUBST_FILE([PACKAGE_INIT]) +AC_SUBST([LIBDIR_BASENAME]) +AC_SUBST([SO_MAJOR]) +AC_SUBST([SO_MINOR]) +AC_SUBST([SO_PATCH]) + +dnl The canonical way of doing this is AC_CHECK_SIZEOF(void *), but +dnl that adds SIZEOF_VOID_P to expat_config.h.in, making it difficult +dnl to have 32-bit and 64-bit versions of libexpat installed on the +dnl same system with a single, shared copy of the header. +AC_COMPUTE_INT(SIZEOF_VOID_P, [sizeof(void *)]) +AC_SUBST([SIZEOF_VOID_P]) dnl write the Automake flags we set AC_SUBST([AM_CPPFLAGS]) @@ -315,11 +431,23 @@ AC_SUBST([AM_CFLAGS]) AC_SUBST([AM_CXXFLAGS]) AC_SUBST([AM_LDFLAGS]) -dnl updating _EXPAT_OUTPUT_NAME variable to effect the package name in expat.pc file (issue #361) -AC_SUBST(_EXPAT_OUTPUT_NAME, ["$PACKAGE_NAME"]) +dnl Emulate the use of CMAKE_SHARED_LIBRARY_PREFIX under CMake +AC_MSG_CHECKING([for shared library name prefix]) +AS_CASE("${host_os}", + [cygwin*], [CMAKE_SHARED_LIBRARY_PREFIX=cyg], + [CMAKE_SHARED_LIBRARY_PREFIX=lib]) +AC_MSG_RESULT([${CMAKE_SHARED_LIBRARY_PREFIX}]) +AC_SUBST([CMAKE_SHARED_LIBRARY_PREFIX]) +AS_CASE("${host_os}", + [darwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__macos.cmake.in], + [mingw*|cygwin*], [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__windows.cmake.in], + [CMAKE_NOCONFIG_SOURCE=cmake/autotools/expat-noconfig__linux.cmake.in]) AC_CONFIG_FILES([Makefile] [expat.pc] + [cmake/expat-config.cmake] + [cmake/autotools/expat-config-version.cmake] + [cmake/autotools/expat-noconfig.cmake:${CMAKE_NOCONFIG_SOURCE}] [doc/Makefile] [examples/Makefile] [lib/Makefile] diff --git a/3rdparty/expat/conftools/PrintPath b/3rdparty/expat/conftools/PrintPath deleted file mode 100755 index e8559a3d643e5..0000000000000 --- a/3rdparty/expat/conftools/PrintPath +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# Look for program[s] somewhere in $PATH. -# -# Options: -# -s -# Do not print out full pathname. (silent) -# -pPATHNAME -# Look in PATHNAME instead of $PATH -# -# Usage: -# PrintPath [-s] [-pPATHNAME] program [program ...] -# -# Initially written by Jim Jagielski for the Apache configuration mechanism -# (with kudos to Kernighan/Pike) -# -# This script falls under the Apache License. -# See http://www.apache.org/licenses/LICENSE - -## -# Some "constants" -## -pathname=$PATH -echo="yes" - -## -# Find out what OS we are running for later on -## -os=`(uname) 2>/dev/null` - -## -# Parse command line -## -for args in $* -do - case $args in - -s ) echo="no" ;; - -p* ) pathname="`echo $args | sed 's/^..//'`" ;; - * ) programs="$programs $args" ;; - esac -done - -## -# Now we make the adjustments required for OS/2 and everyone -# else :) -# -# First of all, all OS/2 programs have the '.exe' extension. -# Next, we adjust PATH (or what was given to us as PATH) to -# be whitespace separated directories. -# Finally, we try to determine the best flag to use for -# test/[] to look for an executable file. OS/2 just has '-r' -# but with other OSs, we do some funny stuff to check to see -# if test/[] knows about -x, which is the preferred flag. -## - -if [ "x$os" = "xOS/2" ] -then - ext=".exe" - pathname=`echo -E $pathname | - sed 's/^;/.;/ - s/;;/;.;/g - s/;$/;./ - s/;/ /g - s/\\\\/\\//g' ` - test_exec_flag="-r" -else - ext="" # No default extensions - pathname=`echo $pathname | - sed 's/^:/.:/ - s/::/:.:/g - s/:$/:./ - s/:/ /g' ` - # Here is how we test to see if test/[] can handle -x - testfile="pp.t.$$" - - cat > $testfile </dev/null`; then - test_exec_flag="-x" - else - test_exec_flag="-r" - fi - rm -f $testfile -fi - -for program in $programs -do - for path in $pathname - do - if [ $test_exec_flag $path/${program}${ext} ] && \ - [ ! -d $path/${program}${ext} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program}${ext} - fi - exit 0 - fi - -# Next try without extension (if one was used above) - if [ "x$ext" != "x" ]; then - if [ $test_exec_flag $path/${program} ] && \ - [ ! -d $path/${program} ]; then - if [ "x$echo" = "xyes" ]; then - echo $path/${program} - fi - exit 0 - fi - fi - done -done -exit 1 - diff --git a/3rdparty/expat/conftools/ar-lib b/3rdparty/expat/conftools/ar-lib index 1e9388e2ae3ae..c349042c3facd 100755 --- a/3rdparty/expat/conftools/ar-lib +++ b/3rdparty/expat/conftools/ar-lib @@ -4,7 +4,7 @@ me=ar-lib scriptversion=2019-07-04.01; # UTC -# Copyright (C) 2010-2020 Free Software Foundation, Inc. +# Copyright (C) 2010-2021 Free Software Foundation, Inc. # Written by Peter Rosin . # # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 new file mode 100644 index 0000000000000..1733fd85f9595 --- /dev/null +++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx-11.m4 @@ -0,0 +1,39 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++11. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 new file mode 100644 index 0000000000000..8edf5152ec7a9 --- /dev/null +++ b/3rdparty/expat/conftools/ax-cxx-compile-stdcxx.m4 @@ -0,0 +1,1018 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for no added switch, and then for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016, 2018 Krzesimir Nowak +# Copyright (c) 2019 Enji Cooper +# Copyright (c) 2020 Jason Merrill +# Copyright (c) 2021 Jörn Heusipp +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [$1], [20], [ax_cxx_compile_alternatives="20"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + + m4_if([$2], [], [dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi]) + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + dnl MSVC needs -std:c++NN for C++17 and later (default is C++14) + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}" MSVC; do + if test x"$switch" = xMSVC; then + dnl AS_TR_SH maps both `:` and `=` to `_` so -std:c++17 would collide + dnl with -std=c++17. We suffix the cache variable name with _MSVC to + dnl avoid this. + switch=-std:c++${alternative} + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_${switch}_MSVC]) + else + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + fi + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +dnl Test body for checking C++17 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual ~Base() {} + virtual void f() {} + }; + + struct Derived : public Base + { + virtual ~Derived() override {} + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include +#include +#include + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = [](){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + +]]) + + +dnl Tests for new features in C++20 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER + +]]) diff --git a/3rdparty/expat/conftools/compile b/3rdparty/expat/conftools/compile index 23fcba011321a..df363c8fbfbcb 100755 --- a/3rdparty/expat/conftools/compile +++ b/3rdparty/expat/conftools/compile @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/config.guess b/3rdparty/expat/conftools/config.guess index df895493ef7ca..160ecf0951b98 100755 --- a/3rdparty/expat/conftools/config.guess +++ b/3rdparty/expat/conftools/config.guess @@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2019-09-10' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-05-08' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -27,11 +29,19 @@ timestamp='2019-09-10' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -50,7 +60,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,6 +94,9 @@ if test $# != 0; then exit 1 fi +# Just in case it came from the environment. +GUESS= + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -99,8 +112,10 @@ tmp= trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 : "${TMPDIR=/tmp}" - # shellcheck disable=SC2039 + # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || @@ -110,7 +125,7 @@ set_cc_for_build() { ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then - CC_FOR_BUILD="$driver" + CC_FOR_BUILD=$driver break fi done @@ -131,14 +146,12 @@ fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "$UNAME_SYSTEM" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" @@ -147,24 +160,37 @@ Linux|GNU|GNU/*) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -176,12 +202,12 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - "/sbin/$sysctl" 2>/dev/null || \ - "/usr/sbin/$sysctl" 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; @@ -190,13 +216,13 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` - machine="${arch}${endian}"-unknown + machine=${arch}${endian}-unknown ;; - *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; @@ -217,7 +243,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in ;; esac # Determine ABI tags. - case "$UNAME_MACHINE_ARCH" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` @@ -228,7 +254,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "$UNAME_VERSION" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; @@ -239,51 +265,57 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "$machine-${os}${release}${abi-}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; *:MidnightBSD:*:*) - echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; *:OS108:*:*) - echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo "$UNAME_MACHINE"-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; *:Twizzler:*:*) - echo "$UNAME_MACHINE"-unknown-twizzler - exit ;; + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; *:Redox:*:*) - echo "$UNAME_MACHINE"-unknown-redox - exit ;; + GUESS=$UNAME_MACHINE-unknown-redox + ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -297,7 +329,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -334,117 +366,121 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:[Aa]miga[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:[Mm]orph[Oo][Ss]:*:*) - echo "$UNAME_MACHINE"-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix"$UNAME_RELEASE" - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux"$UNAME_RELEASE" - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case `/bin/arch` in sun3) - echo m68k-sun-sunos"$UNAME_RELEASE" + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos"$UNAME_RELEASE" + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -454,41 +490,41 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix"$UNAME_RELEASE" - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix"$UNAME_RELEASE" - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -516,75 +552,76 @@ EOF dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos"$UNAME_RELEASE" - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux"$UNAME_RELEASE" + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs"$UNAME_RELEASE" + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux"$UNAME_RELEASE" + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build @@ -601,16 +638,16 @@ EOF EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then @@ -618,56 +655,56 @@ EOF else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo "$IBM_ARCH"-ibm-aix"$IBM_REV" - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; + GUESS=rs6000-ibm-aix + ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - case "$UNAME_MACHINE" in + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "$sc_cpu_version" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "$sc_kernel_bits" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -706,7 +743,7 @@ EOF test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -727,12 +764,12 @@ EOF HP_ARCH=hppa64 fi fi - echo "$HP_ARCH"-hp-hpux"$HPUX_REV" - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux"$HPUX_REV" - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -762,36 +799,36 @@ EOF EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) - echo hppa1.1-hp-bsd - exit ;; + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo "$UNAME_MACHINE"-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo "$UNAME_MACHINE"-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -799,17 +836,18 @@ EOF fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ @@ -817,114 +855,129 @@ EOF -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi - exit ;; + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case "$UNAME_PROCESSOR" in + case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo "$UNAME_MACHINE"-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo "$UNAME_MACHINE"-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo "$UNAME_MACHINE"-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo "$UNAME_MACHINE"-pc-msys - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo "$UNAME_MACHINE"-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case "$UNAME_MACHINE" in + case $UNAME_MACHINE in x86) - echo i586-pc-interix"$UNAME_RELEASE" - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix"$UNAME_RELEASE" - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; i*:UWIN*:*) - echo "$UNAME_MACHINE"-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-pc-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; *:Minix:*:*) - echo "$UNAME_MACHINE"-unknown-minix - exit ;; + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -935,60 +988,63 @@ EOF esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo "$UNAME_MACHINE"-axis-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 @@ -1033,124 +1089,135 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-"$LIBC" - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-"$LIBC" - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-"$LIBC" - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; - PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; - *) echo hppa-unknown-linux-"$LIBC" ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-"$LIBC" - exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo "$UNAME_MACHINE"-dec-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) set_cc_for_build - X86_64_ABI= - # If there is a compiler, see if it is configured for 32-bit objects. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_X32 >/dev/null - then - X86_64_ABI=x32 - fi + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __i386__ + ABI=x86 + #else + #ifdef __ILP32__ + ABI=x32 + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + x86) CPU=i686 ;; + x32) LIBCABI=${LIBC}x32 ;; + esac fi - echo "$UNAME_MACHINE"-pc-linux-"$LIBC$X86_64_ABI" - exit ;; + GUESS=$CPU-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo "$UNAME_MACHINE"-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo "$UNAME_MACHINE"-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo "$UNAME_MACHINE"-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo "$UNAME_MACHINE"-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo "$UNAME_MACHINE"-pc-msdosdjgpp - exit ;; + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1158,12 +1225,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1173,11 +1240,11 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo "$UNAME_MACHINE"-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1185,31 +1252,31 @@ EOF # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1234,113 +1301,116 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv"$UNAME_RELEASE" - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo "$UNAME_MACHINE"-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo "$UNAME_MACHINE"-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux"$UNAME_RELEASE" - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv"$UNAME_RELEASE" + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv"$UNAME_RELEASE" + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux"$UNAME_RELEASE" - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in @@ -1355,7 +1425,7 @@ EOF else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -1376,109 +1446,119 @@ EOF # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi - echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; + GUESS=i386-pc-qnx + ;; NEO-*:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; NSR-*:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; NSV-*:NONSTOP_KERNEL:*:*) - echo nsv-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; NSX-*:NONSTOP_KERNEL:*:*) - echo nsx-tandem-nsk"$UNAME_RELEASE" - exit ;; + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - # shellcheck disable=SC2154 - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo "$UNAME_MACHINE"-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux"$UNAME_RELEASE" - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "$UNAME_MACHINE" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo "$UNAME_MACHINE"-pc-rdos - exit ;; - i*86:AROS:*:*) - echo "$UNAME_MACHINE"-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo "$UNAME_MACHINE"-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; *:Unleashed:*:*) - echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" - exit ;; + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; esac +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" </dev/null && SYSTEM_NAME=`$dummy` && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1618,7 +1698,7 @@ test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 -case "$UNAME_MACHINE:$UNAME_SYSTEM" in +case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1549,6 +1548,7 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. +kernel= case $cpu-$vendor in score-*) os=elf @@ -1560,7 +1560,8 @@ case $cpu-$vendor in os=riscix1.2 ;; arm*-rebel) - os=linux + kernel=linux + os=gnu ;; arm*-semi) os=aout @@ -1726,84 +1727,180 @@ case $cpu-$vendor in os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* | irx* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) - case $os in - riscix*) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - sunos*) + *-sunos*) vendor=sun ;; - cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - beos*) + *-beos*) vendor=be ;; - hpux*) + *-hpux*) vendor=hp ;; - mpeix*) + *-mpeix*) vendor=hp ;; - hiux*) + *-hiux*) vendor=hitachi ;; - unos*) + *-unos*) vendor=crds ;; - dgux*) + *-dgux*) vendor=dg ;; - luna*) + *-luna*) vendor=omron ;; - genix*) + *-genix*) vendor=ns ;; - clix*) + *-clix*) vendor=intergraph ;; - mvs* | opened*) + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - os400*) + s390-* | s390x-*) vendor=ibm ;; - ptx*) + *-ptx*) vendor=sequent ;; - tpf*) + *-tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - aux*) + *-aux*) vendor=apple ;; - hms*) + *-hms*) vendor=hitachi ;; - mpw* | macos*) + *-mpw* | *-macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - vos*) + *-vos*) vendor=stratus ;; esac ;; esac -echo "$cpu-$vendor-$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff --git a/3rdparty/expat/conftools/depcomp b/3rdparty/expat/conftools/depcomp index 6b391623c4bf0..715e34311ed2d 100755 --- a/3rdparty/expat/conftools/depcomp +++ b/3rdparty/expat/conftools/depcomp @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2020 Free Software Foundation, Inc. +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/3rdparty/expat/conftools/get-version.sh b/3rdparty/expat/conftools/get-version.sh index 2592f10328893..273ed3a3154e0 100755 --- a/3rdparty/expat/conftools/get-version.sh +++ b/3rdparty/expat/conftools/get-version.sh @@ -1,13 +1,39 @@ #!/bin/sh -# # USAGE: get-version.sh path/to/expat.h # # This script will print Expat's version number on stdout. For example: # # $ ./conftools/get-version.sh ./lib/expat.h # 1.95.3 -# $ +# __ __ _ +# ___\ \/ /_ __ __ _| |_ +# / _ \\ /| '_ \ / _` | __| +# | __// \| |_) | (_| | |_ +# \___/_/\_\ .__/ \__,_|\__| +# |_| XML parser +# +# Copyright (c) 2002 Greg Stein +# Copyright (c) 2017 Kerin Millar +# Licensed under the MIT license: +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to permit +# persons to whom the Software is furnished to do so, subject to the +# following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +# USE OR OTHER DEALINGS IN THE SOFTWARE. if test $# = 0; then echo "ERROR: pathname for expat.h was not provided." diff --git a/3rdparty/expat/conftools/install-sh b/3rdparty/expat/conftools/install-sh index 20d8b2eaea9c7..ec298b5374027 100755 --- a/3rdparty/expat/conftools/install-sh +++ b/3rdparty/expat/conftools/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ posix_mkdir= # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ Options: --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ while test $# -ne 0; do -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ do dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ do fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ do then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ do prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -488,6 +493,13 @@ do then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -502,9 +514,9 @@ do # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff --git a/3rdparty/expat/conftools/ltmain.sh b/3rdparty/expat/conftools/ltmain.sh old mode 100644 new mode 100755 index e774ddfe649ed..ff225947570d4 --- a/3rdparty/expat/conftools/ltmain.sh +++ b/3rdparty/expat/conftools/ltmain.sh @@ -1,12 +1,12 @@ -#! /bin/sh +#! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in -## by inline-source v2014-01-03.01 +## by inline-source v2019-02-19.15 -# libtool (GNU libtool) 2.4.6 +# libtool (GNU libtool) 2.5.3 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 -# Copyright (C) 1996-2015 Free Software Foundation, Inc. +# Copyright (C) 1996-2019, 2021-2024 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -31,8 +31,8 @@ PROGRAM=libtool PACKAGE=libtool -VERSION=2.4.6 -package_revision=2.4.6 +VERSION=2.5.3 +package_revision=2.5.3 ## ------ ## @@ -64,34 +64,25 @@ package_revision=2.4.6 # libraries, which are installed to $pkgauxdir. # Set a version string for this script. -scriptversion=2015-10-04.22; # UTC +scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 -# Copyright (C) 2004-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. - -# As a special exception to the GNU General Public License, if you distribute -# this file as part of a program or library that is built using GNU Libtool, -# you may include this file under the same distribution terms that you use -# for the rest of that program. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2004-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# Please report bugs or propose patches to gary@gnu.org. +# Please report bugs or propose patches to: +# ## ------ ## @@ -139,9 +130,12 @@ do _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# These NLS vars are set unconditionally (bootstrap issue #24). Unset those +# in case the environment reset is needed later and the $save_* variant is not +# defined (see the code above). +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' @@ -149,7 +143,7 @@ nl=' ' IFS="$sp $nl" -# There are apparently some retarded systems that use ';' as a PATH separator! +# There are apparently some systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { @@ -159,6 +153,26 @@ if test "${PATH_SEPARATOR+set}" != set; then fi +# func_unset VAR +# -------------- +# Portably unset VAR. +# In some shells, an 'unset VAR' statement leaves a non-zero return +# status if VAR is already unset, which might be problematic if the +# statement is used at the end of a function (thus poisoning its return +# value) or when 'set -e' is active (causing even a spurious abort of +# the script in this case). +func_unset () +{ + { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } +} + + +# Make sure CDPATH doesn't cause `cd` commands to output the target dir. +func_unset CDPATH + +# Make sure ${,E,F}GREP behave sanely. +func_unset GREP_OPTIONS + ## ------------------------- ## ## Locate command utilities. ## @@ -259,7 +273,7 @@ test -z "$SED" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin + func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } @@ -295,7 +309,7 @@ test -z "$GREP" && { rm -f conftest.in conftest.tmp conftest.nl conftest.out } - func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin + func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } @@ -360,6 +374,35 @@ sed_double_backslash="\ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" +# require_check_ifs_backslash +# --------------------------- +# Check if we can use backslash as IFS='\' separator, and set +# $check_ifs_backshlash_broken to ':' or 'false'. +require_check_ifs_backslash=func_require_check_ifs_backslash +func_require_check_ifs_backslash () +{ + _G_save_IFS=$IFS + IFS='\' + _G_check_ifs_backshlash='a\\b' + for _G_i in $_G_check_ifs_backshlash + do + case $_G_i in + a) + check_ifs_backshlash_broken=false + ;; + '') + break + ;; + *) + check_ifs_backshlash_broken=: + break + ;; + esac + done + IFS=$_G_save_IFS + require_check_ifs_backslash=: +} + ## ----------------- ## ## Global variables. ## @@ -580,16 +623,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then { $debug_cmd - func_quote_for_eval "$2" - eval "$1+=\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd - func_quote_for_eval "$2" - eval "$1=\$$1\\ \$func_quote_for_eval_result" + func_quote_arg pretty "$2" + eval "$1=\$$1\\ \$func_quote_arg_result" } fi @@ -1091,132 +1134,203 @@ func_relative_path () } -# func_quote ARG -# -------------- -# Aesthetically quote one ARG, store the result into $func_quote_result. Note -# that we keep attention to performance here (so far O(N) complexity as long as -# func_append is O(1)). -func_quote () +# func_quote_portable EVAL ARG +# ---------------------------- +# Internal function to portably implement func_quote_arg. Note that we still +# keep attention to performance here so we as much as possible try to avoid +# calling sed binary (so far O(N) complexity as long as func_append is O(1)). +func_quote_portable () { $debug_cmd - func_quote_result=$1 + $require_check_ifs_backslash - case $func_quote_result in - *[\\\`\"\$]*) - case $func_quote_result in - *[\[\*\?]*) - func_quote_result=`$ECHO "$func_quote_result" | $SED "$sed_quote_subst"` - return 0 - ;; - esac + func_quote_portable_result=$2 - func_quote_old_IFS=$IFS - for _G_char in '\' '`' '"' '$' - do - # STATE($1) PREV($2) SEPARATOR($3) - set start "" "" - func_quote_result=dummy"$_G_char$func_quote_result$_G_char"dummy - IFS=$_G_char - for _G_part in $func_quote_result - do - case $1 in - quote) - func_append func_quote_result "$3$2" - set quote "$_G_part" "\\$_G_char" - ;; - start) - set first "" "" - func_quote_result= - ;; - first) - set quote "$_G_part" "" + # one-time-loop (easy break) + while true + do + if $1; then + func_quote_portable_result=`$ECHO "$2" | $SED \ + -e "$sed_double_quote_subst" -e "$sed_double_backslash"` + break + fi + + # Quote for eval. + case $func_quote_portable_result in + *[\\\`\"\$]*) + # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string + # contains the shell wildcard characters. + case $check_ifs_backshlash_broken$func_quote_portable_result in + :*|*[\[\*\?]*) + func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ + | $SED "$sed_quote_subst"` + break ;; - esac + esac + + func_quote_portable_old_IFS=$IFS + for _G_char in '\' '`' '"' '$' + do + # STATE($1) PREV($2) SEPARATOR($3) + set start "" "" + func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy + IFS=$_G_char + for _G_part in $func_quote_portable_result + do + case $1 in + quote) + func_append func_quote_portable_result "$3$2" + set quote "$_G_part" "\\$_G_char" + ;; + start) + set first "" "" + func_quote_portable_result= + ;; + first) + set quote "$_G_part" "" + ;; + esac + done done - IFS=$func_quote_old_IFS - done + IFS=$func_quote_portable_old_IFS + ;; + *) ;; + esac + break + done + + func_quote_portable_unquoted_result=$func_quote_portable_result + case $func_quote_portable_result in + # double-quote args containing shell metacharacters to delay + # word splitting, command substitution and variable expansion + # for a subsequent eval. + # many bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_portable_result=\"$func_quote_portable_result\" ;; - *) ;; esac } -# func_quote_for_eval ARG... -# -------------------------- -# Aesthetically quote ARGs to be evaled later. -# This function returns two values: -# i) func_quote_for_eval_result -# double-quoted, suitable for a subsequent eval -# ii) func_quote_for_eval_unquoted_result -# has all characters that are still active within double -# quotes backslashified. -func_quote_for_eval () -{ - $debug_cmd - - func_quote_for_eval_unquoted_result= - func_quote_for_eval_result= - while test 0 -lt $#; do - func_quote "$1" - _G_unquoted_arg=$func_quote_result - if test -n "$func_quote_for_eval_unquoted_result"; then - func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" - else - func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" - fi - - case $_G_unquoted_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and variable expansion - # for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_quoted_arg=\"$_G_unquoted_arg\" +# func_quotefast_eval ARG +# ----------------------- +# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', +# but optimized for speed. Result is stored in $func_quotefast_eval. +if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then + printf -v _GL_test_printf_tilde %q '~' + if test '\~' = "$_GL_test_printf_tilde"; then + func_quotefast_eval () + { + printf -v func_quotefast_eval_result %q "$1" + } + else + # Broken older Bash implementations. Make those faster too if possible. + func_quotefast_eval () + { + case $1 in + '~'*) + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result ;; *) - _G_quoted_arg=$_G_unquoted_arg - ;; + printf -v func_quotefast_eval_result %q "$1" + ;; esac + } + fi +else + func_quotefast_eval () + { + func_quote_portable false "$1" + func_quotefast_eval_result=$func_quote_portable_result + } +fi - if test -n "$func_quote_for_eval_result"; then - func_append func_quote_for_eval_result " $_G_quoted_arg" - else - func_append func_quote_for_eval_result "$_G_quoted_arg" - fi - shift - done -} - - -# func_quote_for_expand ARG -# ------------------------- -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - $debug_cmd - case $1 in - *[\\\`\"]*) - _G_arg=`$ECHO "$1" | $SED \ - -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; - *) - _G_arg=$1 ;; +# func_quote_arg MODEs ARG +# ------------------------ +# Quote one ARG to be evaled later. MODEs argument may contain zero or more +# specifiers listed below separated by ',' character. This function returns two +# values: +# i) func_quote_arg_result +# double-quoted (when needed), suitable for a subsequent eval +# ii) func_quote_arg_unquoted_result +# has all characters that are still active within double +# quotes backslashified. Available only if 'unquoted' is specified. +# +# Available modes: +# ---------------- +# 'eval' (default) +# - escape shell special characters +# 'expand' +# - the same as 'eval'; but do not quote variable references +# 'pretty' +# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might +# be used later in func_quote to get output like: 'echo "a b"' instead +# of 'echo a\ b'. This is slower than default on some shells. +# 'unquoted' +# - produce also $func_quote_arg_unquoted_result which does not contain +# wrapping double-quotes. +# +# Examples for 'func_quote_arg pretty,unquoted string': +# +# string | *_result | *_unquoted_result +# ------------+-----------------------+------------------- +# " | \" | \" +# a b | "a b" | a b +# "a b" | "\"a b\"" | \"a b\" +# * | "*" | * +# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" +# +# Examples for 'func_quote_arg pretty,unquoted,expand string': +# +# string | *_result | *_unquoted_result +# --------------+---------------------+-------------------- +# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" +func_quote_arg () +{ + _G_quote_expand=false + case ,$1, in + *,expand,*) + _G_quote_expand=: + ;; esac - case $_G_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - _G_arg=\"$_G_arg\" + case ,$1, in + *,pretty,*|*,expand,*|*,unquoted,*) + func_quote_portable $_G_quote_expand "$2" + func_quote_arg_result=$func_quote_portable_result + func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result + ;; + *) + # Faster quote-for-eval for some shells. + func_quotefast_eval "$2" + func_quote_arg_result=$func_quotefast_eval_result ;; esac +} + - func_quote_for_expand_result=$_G_arg +# func_quote MODEs ARGs... +# ------------------------ +# Quote all ARGs to be evaled later and join them into single command. See +# func_quote_arg's description for more info. +func_quote () +{ + $debug_cmd + _G_func_quote_mode=$1 ; shift + func_quote_result= + while test 0 -lt $#; do + func_quote_arg "$_G_func_quote_mode" "$1" + if test -n "$func_quote_result"; then + func_append func_quote_result " $func_quote_arg_result" + else + func_append func_quote_result "$func_quote_arg_result" + fi + shift + done } @@ -1262,8 +1376,8 @@ func_show_eval () _G_cmd=$1 _G_fail_exp=${2-':'} - func_quote_for_expand "$_G_cmd" - eval "func_notquiet $func_quote_for_expand_result" + func_quote_arg pretty,expand "$_G_cmd" + eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" @@ -1288,8 +1402,8 @@ func_show_eval_locale () _G_fail_exp=${2-':'} $opt_quiet || { - func_quote_for_expand "$_G_cmd" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$_G_cmd" + eval "func_echo $func_quote_arg_result" } $opt_dry_run || { @@ -1416,30 +1530,26 @@ func_lt_ver () # End: #! /bin/sh -# Set a version string for this script. -scriptversion=2014-01-07.03; # UTC - # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 -# Copyright (C) 2010-2015 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# This is free software. There is NO warranty; not even for +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# +# Copyright (C) 2010-2019, 2021, 2023-2024 Bootstrap Authors +# +# This file is dual licensed under the terms of the MIT license +# , and GPL version 2 or later +# . You must apply one of +# these licenses when using or redistributing this software or any of +# the files within it. See the URLs above, or the file `LICENSE` +# included in the Bootstrap distribution for the full license texts. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# Please report bugs or propose patches to: +# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Please report bugs or propose patches to gary@gnu.org. +# Set a version string for this script. +scriptversion=2019-02-19.15; # UTC ## ------ ## @@ -1462,7 +1572,7 @@ scriptversion=2014-01-07.03; # UTC # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file -# starting with '# Written by ' and ending with '# warranty; '. +# starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the @@ -1474,7 +1584,7 @@ scriptversion=2014-01-07.03; # UTC # to display verbose messages only when your user has specified # '--verbose'. # -# After sourcing this file, you can plug processing for additional +# After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. @@ -1523,8 +1633,8 @@ fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## # This section contains functions for adding, removing, and running hooks -# to the main code. A hook is just a named list of of function, that can -# be run in order later on. +# in the main code. A hook is just a list of function names that can be +# run in order later on. # func_hookable FUNC_NAME # ----------------------- @@ -1557,7 +1667,8 @@ func_add_hook () # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ -# Remove HOOK_FUNC from the list of functions called by FUNC_NAME. +# Remove HOOK_FUNC from the list of hook functions to be called by +# FUNC_NAME. func_remove_hook () { $debug_cmd @@ -1566,10 +1677,28 @@ func_remove_hook () } +# func_propagate_result FUNC_NAME_A FUNC_NAME_B +# --------------------------------------------- +# If the *_result variable of FUNC_NAME_A _is set_, assign its value to +# *_result variable of FUNC_NAME_B. +func_propagate_result () +{ + $debug_cmd + + func_propagate_result_result=: + if eval "test \"\${${1}_result+set}\" = set" + then + eval "${2}_result=\$${1}_result" + else + func_propagate_result_result=false + fi +} + + # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. -# It is assumed that the list of hook functions contains nothing more +# It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. @@ -1579,22 +1708,19 @@ func_run_hooks () case " $hookable_fns " in *" $1 "*) ;; - *) func_fatal_error "'$1' does not support hook funcions.n" ;; + *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do - eval $_G_hook '"$@"' - - # store returned options list back into positional - # parameters for next 'cmd' execution. - eval _G_hook_result=\$${_G_hook}_result - eval set dummy "$_G_hook_result"; shift + func_unset "${_G_hook}_result" + eval $_G_hook '${1+"$@"}' + func_propagate_result $_G_hook func_run_hooks + if $func_propagate_result_result; then + eval set dummy "$func_run_hooks_result"; shift + fi done - - func_quote_for_eval ${1+"$@"} - func_run_hooks_result=$func_quote_for_eval_result } @@ -1604,10 +1730,18 @@ func_run_hooks () ## --------------- ## # In order to add your own option parsing hooks, you must accept the -# full positional parameter list in your hook function, remove any -# options that you action, and then pass back the remaining unprocessed -# options in '_result', escaped suitably for -# 'eval'. Like this: +# full positional parameter list from your hook function. You may remove +# or edit any options that you action, and then pass back the remaining +# unprocessed options in '_result', escaped +# suitably for 'eval'. +# +# The '_result' variable is automatically unset +# before your hook gets called; for best performance, only set the +# *_result variable when necessary (i.e. don't call the 'func_quote' +# function unnecessarily because it can be an expensive operation on some +# machines). +# +# Like this: # # my_options_prep () # { @@ -1617,9 +1751,8 @@ func_run_hooks () # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' -# -# func_quote_for_eval ${1+"$@"} -# my_options_prep_result=$func_quote_for_eval_result +# # No change in '$@' (ignored completely by this hook). Leave +# # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # @@ -1628,25 +1761,36 @@ func_run_hooks () # { # $debug_cmd # -# # Note that for efficiency, we parse as many options as we can +# args_changed=false +# +# # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in -# --silent|-s) opt_silent=: ;; +# --silent|-s) opt_silent=: +# args_changed=: +# ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift +# args_changed=: # ;; -# *) set dummy "$_G_opt" "$*"; shift; break ;; +# *) # Make sure the first unrecognised option "$_G_opt" +# # is added back to "$@" in case we need it later, +# # if $args_changed was set to 'true'. +# set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # -# func_quote_for_eval ${1+"$@"} -# my_silent_option_result=$func_quote_for_eval_result +# # Only call 'func_quote' here if we processed at least one argument. +# if $args_changed; then +# func_quote eval ${1+"$@"} +# my_silent_option_result=$func_quote_result +# fi # } # func_add_hook func_parse_options my_silent_option # @@ -1657,17 +1801,26 @@ func_run_hooks () # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." -# -# func_quote_for_eval ${1+"$@"} -# my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # -# You'll alse need to manually amend $usage_message to reflect the extra +# You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. +# func_options_finish [ARG]... +# ---------------------------- +# Finishing the option parse loop (call 'func_options' hooks ATM). +func_options_finish () +{ + $debug_cmd + + func_run_hooks func_options ${1+"$@"} + func_propagate_result func_run_hooks func_options_finish +} + + # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the @@ -1677,17 +1830,27 @@ func_options () { $debug_cmd - func_options_prep ${1+"$@"} - eval func_parse_options \ - ${func_options_prep_result+"$func_options_prep_result"} - eval func_validate_options \ - ${func_parse_options_result+"$func_parse_options_result"} + _G_options_quoted=false - eval func_run_hooks func_options \ - ${func_validate_options_result+"$func_validate_options_result"} + for my_func in options_prep parse_options validate_options options_finish + do + func_unset func_${my_func}_result + func_unset func_run_hooks_result + eval func_$my_func '${1+"$@"}' + func_propagate_result func_$my_func func_options + if $func_propagate_result_result; then + eval set dummy "$func_options_result"; shift + _G_options_quoted=: + fi + done - # save modified positional parameters for caller - func_options_result=$func_run_hooks_result + $_G_options_quoted || { + # As we (func_options) are top-level options-parser function and + # nobody quoted "$@" for us yet, we need to do it explicitly for + # caller. + func_quote eval ${1+"$@"} + func_options_result=$func_quote_result + } } @@ -1696,9 +1859,8 @@ func_options () # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and -# needs to propogate that back to rest of this script, then the complete -# modified list must be put in 'func_run_hooks_result' before -# returning. +# needs to propagate that back to rest of this script, then the complete +# modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { @@ -1709,9 +1871,7 @@ func_options_prep () opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} - - # save modified positional parameters for caller - func_options_prep_result=$func_run_hooks_result + func_propagate_result func_run_hooks func_options_prep } @@ -1723,25 +1883,32 @@ func_parse_options () { $debug_cmd - func_parse_options_result= - + _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} - - # Adjust func_parse_options positional parameters to match - eval set dummy "$func_run_hooks_result"; shift + func_propagate_result func_run_hooks func_parse_options + if $func_propagate_result_result; then + eval set dummy "$func_parse_options_result"; shift + # Even though we may have changed "$@", we passed the "$@" array + # down into the hook and it quoted it for us (because we are in + # this if-branch). No need to quote it again. + _G_parse_options_requote=false + fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break + # We expect that one of the options parsed in this function matches + # and thus we remove _G_opt from "$@" and need to re-quote. + _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' - func_echo "enabling shell trace mode" + func_echo "enabling shell trace mode" >&2 $debug_cmd ;; @@ -1751,7 +1918,10 @@ func_parse_options () ;; --warnings|--warning|-W) - test $# = 0 && func_missing_arg $_G_opt && break + if test $# = 0 && func_missing_arg $_G_opt; then + _G_parse_options_requote=: + break + fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above @@ -1804,15 +1974,24 @@ func_parse_options () shift ;; - --) break ;; + --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + *) set dummy "$_G_opt" ${1+"$@"}; shift + _G_match_parse_options=false + break + ;; esac + + if $_G_match_parse_options; then + _G_parse_options_requote=: + fi done - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - func_parse_options_result=$func_quote_for_eval_result + if $_G_parse_options_requote; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + func_parse_options_result=$func_quote_result + fi } @@ -1829,12 +2008,10 @@ func_validate_options () test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} + func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE - - # save modified positional parameters for caller - func_validate_options_result=$func_run_hooks_result } @@ -1890,8 +2067,8 @@ func_missing_arg () # func_split_equals STRING # ------------------------ -# Set func_split_equals_lhs and func_split_equals_rhs shell variables after -# splitting STRING at the '=' sign. +# Set func_split_equals_lhs and func_split_equals_rhs shell variables +# after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ @@ -1906,8 +2083,9 @@ then func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} - test "x$func_split_equals_lhs" = "x$1" \ - && func_split_equals_rhs= + if test "x$func_split_equals_lhs" = "x$1"; then + func_split_equals_rhs= + fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. @@ -1917,7 +2095,7 @@ else func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= - test "x$func_split_equals_lhs" = "x$1" \ + test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals @@ -1943,7 +2121,7 @@ else { $debug_cmd - func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` + func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt @@ -1985,31 +2163,44 @@ func_usage_message () # func_version # ------------ # Echo version message to standard output and exit. +# The version message is extracted from the calling file's header +# comments, with leading '# ' stripped: +# 1. First display the progname and version +# 2. Followed by the header comment line matching /^# Written by / +# 3. Then a blank line followed by the first following line matching +# /^# Copyright / +# 4. Immediately followed by any lines between the previous matches, +# except lines preceding the intervening completely blank line. +# For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' - /(C)/!b go - :more - /\./!{ - N - s|\n# | | - b more - } - :go - /^# Written by /,/# warranty; / { - s|^# || - s|^# *$|| - s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| - p + /^# Written by /!b + s|^# ||; p; n + + :fwd2blnk + /./ { + n + b fwd2blnk } - /^# Written by / { - s|^# || - p + p; n + + :holdwrnt + s|^# || + s|^# *$|| + /^Copyright /!{ + /./H + n + b holdwrnt } - /^warranty; /q' < "$progpath" + + s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| + G + s|\(\n\)\n*|\1|g + p; q' < "$progpath" exit $? } @@ -2019,12 +2210,12 @@ func_version () # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) -# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" +# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.5.3' # func_echo ARG... @@ -2115,13 +2306,13 @@ include the following information: compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname (GNU libtool) 2.5.3 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . -GNU libtool home page: . -General help using GNU software: ." +GNU libtool home page: . +General help using GNU software: ." exit 0 } @@ -2171,7 +2362,7 @@ fi # a configuration failure hint, and exit. func_fatal_configuration () { - func__fatal_error ${1+"$@"} \ + func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } @@ -2317,6 +2508,8 @@ libtool_options_prep () nonopt= preserve_args= + _G_rc_lt_options_prep=: + # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) @@ -2340,11 +2533,16 @@ libtool_options_prep () uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; + *) + _G_rc_lt_options_prep=false + ;; esac - # Pass back the list of options. - func_quote_for_eval ${1+"$@"} - libtool_options_prep_result=$func_quote_for_eval_result + if $_G_rc_lt_options_prep; then + # Pass back the list of options. + func_quote eval ${1+"$@"} + libtool_options_prep_result=$func_quote_result + fi } func_add_hook func_options_prep libtool_options_prep @@ -2356,9 +2554,12 @@ libtool_parse_options () { $debug_cmd + _G_rc_lt_parse_options=false + # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do + _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in @@ -2433,15 +2634,20 @@ libtool_parse_options () func_append preserve_args " $_G_opt" ;; - # An option not handled by this hook function: - *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; + # An option not handled by this hook function: + *) set dummy "$_G_opt" ${1+"$@"} ; shift + _G_match_lt_parse_options=false + break + ;; esac + $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done - - # save modified positional parameters for caller - func_quote_for_eval ${1+"$@"} - libtool_parse_options_result=$func_quote_for_eval_result + if $_G_rc_lt_parse_options; then + # save modified positional parameters for caller + func_quote eval ${1+"$@"} + libtool_parse_options_result=$func_quote_result + fi } func_add_hook func_parse_options libtool_parse_options @@ -2462,10 +2668,10 @@ libtool_validate_options () # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" - case $host in + case $host_os in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 - *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) + cygwin* | mingw* | windows* | pw32* | cegcc* | solaris2* | os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; @@ -2498,8 +2704,8 @@ libtool_validate_options () } # Pass back the unparsed argument list - func_quote_for_eval ${1+"$@"} - libtool_validate_options_result=$func_quote_for_eval_result + func_quote eval ${1+"$@"} + libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options @@ -2797,7 +3003,7 @@ EOF # func_convert_core_file_wine_to_w32 ARG # Helper function used by file name conversion functions when $build is *nix, -# and $host is mingw, cygwin, or some other w32 environment. Relies on a +# and $host is mingw, windows, cygwin, or some other w32 environment. Relies on a # correctly configured wine environment available, with the winepath program # in $build's $PATH. # @@ -2829,9 +3035,10 @@ func_convert_core_file_wine_to_w32 () # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. +# $host is mingw, windows, cygwin, or some other w32 environment. Relies on a +# correctly configured wine environment available, with the winepath program +# in $build's $PATH. Assumes ARG has no leading or trailing path separator +# characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. @@ -3465,8 +3672,8 @@ func_mode_compile () esac done - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ + func_quote_arg pretty "$libobj" + test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" @@ -3486,7 +3693,7 @@ func_mode_compile () # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | mingw* | windows* | pw32* | os2* | cegcc*) pic_mode=default ;; esac @@ -3539,8 +3746,8 @@ compiler." func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result + func_quote_arg pretty "$srcfile" + qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then @@ -3695,7 +3902,8 @@ This mode accepts the following additional options: -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler + -Wc,FLAG + -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. @@ -3801,6 +4009,8 @@ The following components of LINK-COMMAND are treated specially: -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wa,FLAG + -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) @@ -4143,8 +4353,8 @@ func_mode_install () case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " + func_quote_arg pretty "$nonopt" + install_prog="$func_quote_arg_result " arg=$1 shift else @@ -4154,8 +4364,8 @@ func_mode_install () # The real first argument should be the name of the installation program. # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; @@ -4212,12 +4422,12 @@ func_mode_install () esac # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" + func_quote_arg pretty "$arg" + func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then - func_quote_for_eval "$arg2" + func_quote_arg pretty "$arg2" fi - func_append install_shared_prog " $func_quote_for_eval_result" + func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ @@ -4228,8 +4438,8 @@ func_mode_install () if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" + func_quote_arg pretty "$install_override_mode" + func_append install_shared_prog " -m $func_quote_arg_result" fi fi @@ -4360,7 +4570,7 @@ func_mode_install () 'exit $?' tstripme=$stripme case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | windows* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= @@ -4473,7 +4683,7 @@ func_mode_install () # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin* | *mingw* | *windows*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result @@ -4525,8 +4735,8 @@ func_mode_install () relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" + func_quote_arg expand,pretty "$relink_command" + eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else @@ -4701,7 +4911,7 @@ extern \"C\" { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; @@ -4713,7 +4923,7 @@ extern \"C\" { eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; @@ -4727,7 +4937,7 @@ extern \"C\" { func_basename "$dlprefile" name=$func_basename_result case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" @@ -4753,8 +4963,16 @@ extern \"C\" { eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + case $host in + i[3456]86-*-mingw32*) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" + ;; + *) + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/__nm_//' >> '$nlist'" + ;; + esac } else # not an import lib $opt_dry_run || { @@ -4902,7 +5120,7 @@ static const void *lt_preloaded_setup() { # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` @@ -4978,7 +5196,7 @@ func_win32_libid () *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64|pe-aarch64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || @@ -5245,7 +5463,7 @@ func_extract_archives () # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw +# incorporate the script contents within a cygwin/mingw/windows # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. @@ -5253,7 +5471,7 @@ func_extract_archives () # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is -# the $objdir directory. This is a cygwin/mingw-specific +# the $objdir directory. This is a cygwin/mingw/windows-specific # behavior. func_emit_wrapper () { @@ -5305,8 +5523,8 @@ else if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" - func_quote "$ECHO" - qECHO=$func_quote_result + func_quote_arg pretty "$ECHO" + qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. @@ -5316,7 +5534,7 @@ func_fallback_echo () \$1 _LTECHO_EOF' } - ECHO=\"$qECHO\" + ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to @@ -5378,7 +5596,7 @@ func_exec_program_core () " case $host in # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) + *-*-mingw* | *-*-windows* | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 @@ -5446,7 +5664,7 @@ func_exec_program () file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done - # Usually 'no', except on cygwin/mingw when embedded into + # Usually 'no', except on cygwin/mingw/windows when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then @@ -5578,7 +5796,7 @@ EOF #endif #include #include -#ifdef _MSC_VER +#if defined _WIN32 && !defined __GNUC__ # include # include # include @@ -5603,7 +5821,7 @@ EOF /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ -int _putenv (const char *); +_CRTIMP int __cdecl _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ @@ -5801,7 +6019,7 @@ main (int argc, char *argv[]) { EOF case $host in - *mingw* | *cygwin* ) + *mingw* | *windows* | *cygwin* ) # make stdout use "unix" line endings echo " setmode(1,_O_BINARY);" ;; @@ -5820,7 +6038,7 @@ EOF { /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX namespace, but it is not one of the ones we know about and - have already dealt with, above (inluding dump-script), then + have already dealt with, above (including dump-script), then report an error. Otherwise, targets might begin to believe they are allowed to use options in the LTWRAPPER_OPTION_PREFIX namespace. The first time any user complains about this, we'll @@ -5904,7 +6122,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" { char* p; @@ -5946,7 +6164,7 @@ EOF EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ newargz = prepare_spawn (newargz); @@ -6365,7 +6583,7 @@ lt_update_lib_path (const char *name, const char *value) EOF case $host_os in - mingw*) + mingw* | windows*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). @@ -6540,7 +6758,7 @@ func_mode_link () $debug_cmd case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra @@ -6604,10 +6822,12 @@ func_mode_link () xrpath= perm_rpath= temp_rpath= + temp_rpath_tail= thread_safe=no vinfo= vinfo_number=no weak_libs= + rpath_arg= single_module=$wl-single_module func_infer_tag $base_compile @@ -6659,9 +6879,9 @@ func_mode_link () while test "$#" -gt 0; do arg=$1 shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" + func_quote_arg pretty,unquoted "$arg" + qarg=$func_quote_arg_unquoted_result + func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then @@ -6870,7 +7090,7 @@ func_mode_link () case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) - func_fatal_error "only absolute run-paths are allowed" + func_fatal_error "argument to -rpath is not absolute: $arg" ;; esac if test rpath = "$prev"; then @@ -6897,6 +7117,13 @@ func_mode_link () prev= continue ;; + xassembler) + func_append compiler_flags " -Xassembler $qarg" + prev= + func_append compile_command " -Xassembler $qarg" + func_append finalize_command " -Xassembler $qarg" + continue + ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" @@ -7039,7 +7266,7 @@ func_mode_link () ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; @@ -7059,7 +7286,7 @@ func_mode_link () -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; @@ -7067,7 +7294,7 @@ func_mode_link () # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; @@ -7087,7 +7314,7 @@ func_mode_link () esac elif test X-lc_r = "X$arg"; then case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; @@ -7117,9 +7344,21 @@ func_mode_link () prev=xcompiler continue ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. + -pthread) + case $host in + *solaris2*) ;; + *) + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac + ;; + esac + continue + ;; + -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" @@ -7152,7 +7391,7 @@ func_mode_link () -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" @@ -7212,7 +7451,7 @@ func_mode_link () dir=$lt_sysroot$func_stripname_result ;; *) - func_fatal_error "only absolute run-paths are allowed" + func_fatal_error "argument ($arg) to '-R' is not an absolute path: $dir" ;; esac case "$xrpath " in @@ -7269,9 +7508,9 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $func_quote_arg_result" + func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" @@ -7285,16 +7524,21 @@ func_mode_link () save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" + func_quote_arg pretty "$flag" + func_append arg " $wl$func_quote_arg_result" + func_append compiler_flags " $wl$func_quote_arg_result" + func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; + -Xassembler) + prev=xassembler + continue + ;; + -Xcompiler) prev=xcompiler continue @@ -7312,8 +7556,8 @@ func_mode_link () # -msg_* for osf cc -msg_*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: @@ -7332,14 +7576,31 @@ func_mode_link () # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang + # -fdiagnostics-color* simply affects output + # -frecord-gcc-switches used to verify flags were respected # -fsanitize=* Clang/GCC memory and address sanitizer + # -fno-sanitize* Clang/GCC memory and address sanitizer + # -shared-libsan Link with shared sanitizer runtimes (Clang) + # -static-libsan Link with static sanitizer runtimes (Clang) + # -no-canonical-prefixes Do not expand any symbolic links # -fuse-ld=* Linker select flags for GCC + # -static-* direct GCC to link specific libraries statically + # -fcilkplus Cilk Plus language extension features for C/C++ + # -rtlib=* select c runtime lib with clang + # --unwindlib=* select unwinder library with clang + # -f{file|debug|macro|profile}-prefix-map=* needed for lto linking + # -Wa,* Pass flags directly to the assembler + # -Werror, -Werror=* Report (specified) warnings as errors -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ - -specs=*|-fsanitize=*|-fuse-ld=*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-no-canonical-prefixes| \ + -stdlib=*|-rtlib=*|--unwindlib=*| \ + -specs=*|-fsanitize=*|-fno-sanitize*|-shared-libsan|-static-libsan| \ + -ffile-prefix-map=*|-fdebug-prefix-map=*|-fmacro-prefix-map=*|-fprofile-prefix-map=*| \ + -fdiagnostics-color*|-frecord-gcc-switches| \ + -fuse-ld=*|-static-*|-fcilkplus|-Wa,*|-Werror|-Werror=*) + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" @@ -7360,15 +7621,15 @@ func_mode_link () continue else # Otherwise treat like 'Some other compiler flag' below - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; *.$objext) @@ -7488,15 +7749,27 @@ func_mode_link () *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg=$func_quote_for_eval_result + func_quote_arg pretty "$arg" + arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" + if test -n "$rpath_arg"; then + func_append finalize_rpath " ${arg##*,}" + unset rpath_arg + else + case $arg in + -Wl,-rpath,*) + func_append finalize_rpath " ${arg##*,}";; + -Wl,-rpath) + rpath_arg=1;; + *) + func_append compile_command " $arg" + func_append finalize_command " $arg" + esac + fi fi done # argument parsing loop @@ -7667,7 +7940,7 @@ func_mode_link () found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) + |-threads|-fopenmp|-fopenmp=*|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" @@ -7844,18 +8117,15 @@ func_mode_link () ;; esac if $valid_a_lib; then - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" + func_warning "Linking the shared library $output against the static library $deplib is not portable!" deplibs="$deplib $deplibs" else - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." + func_warning "Trying to link with static lib archive $deplib." + func_warning "I have the capability to make that library automatically link in when" + func_warning "you link to this library. But I can only do this if you have a" + func_warning "shared version of the library, which you do not appear to have" + func_warning "because the file extensions .$libext of this argument makes me believe" + func_warning "that it is just a static archive that I should not use here." fi ;; esac @@ -8050,7 +8320,7 @@ func_mode_link () fi case $host in # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* | *windows* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present @@ -8150,7 +8420,10 @@ func_mode_link () # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; + *) case $absdir in + "$progdir/"*) func_append temp_rpath "$absdir:" ;; + *) func_append temp_rpath_tail "$absdir:" ;; + esac esac fi @@ -8162,7 +8435,9 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) case $absdir in + "$progdir/"*) func_append compile_rpath " $absdir" ;; + esac esac ;; esac @@ -8193,8 +8468,8 @@ func_mode_link () fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc* | *os2*) + case $host_os in + cygwin* | mingw* | windows* | cegcc* | os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no @@ -8220,11 +8495,11 @@ func_mode_link () if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" + func_warning "Linking the executable $output against the loadable module" else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" + func_warning "Linking the shared library $output against the loadable module" fi - $ECHO "*** $linklib is not portable!" + func_warning "$linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then @@ -8236,7 +8511,9 @@ func_mode_link () *) case "$compile_rpath " in *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; + *) case $absdir in + "$progdir/"*) func_append compile_rpath " $absdir" ;; + esac esac ;; esac @@ -8263,8 +8540,8 @@ func_mode_link () soname=$dlname elif test -n "$soname_spec"; then # bleh windows - case $host in - *cygwin* | mingw* | *cegcc* | *os2*) + case $host_os in + cygwin* | mingw* | windows* | cegcc* | os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major @@ -8319,11 +8596,10 @@ func_mode_link () if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" + func_warning "lib $linklib is a module, not a shared library" if test -z "$old_library"; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" + func_warning "And there doesn't seem to be a static archive available" + func_warning "The link will probably fail, sorry" else add=$dir/$old_library fi @@ -8406,7 +8682,7 @@ func_mode_link () test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in @@ -8423,7 +8699,7 @@ func_mode_link () fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir=-L$lt_sysroot$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in @@ -8463,21 +8739,19 @@ func_mode_link () # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system cannot link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." + func_warning "This system cannot link to static lib archive $lib." + func_warning "I have the capability to make that library automatically link in when" + func_warning "you link to this library. But I can only do this if you have a" + func_warning "shared version of the library, which you do not appear to have." if test yes = "$module"; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." + func_warning "But as you try to build a module library, libtool will still create " + func_warning "a static module, that should work as long as the dlopening application" + func_warning "is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using 'nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** 'nm' from GNU binutils and a full rebuild may help." + func_warning "However, this would only work if libtool was able to extract symbol" + func_warning "lists from a program, using 'nm' or equivalent, but libtool could" + func_warning "not find such a program. So, this module is probably useless." + func_warning "'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module @@ -8600,6 +8874,8 @@ func_mode_link () fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs + + func_append temp_rpath "$temp_rpath_tail" if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" @@ -8637,42 +8913,46 @@ func_mode_link () # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: new_libs="$deplib $new_libs" for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; + if $opt_preserve_dup_deps; then + new_libs="$deplib $new_libs" + else + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. And if not possible for portability + # reasons, then --preserve-dup-deps should be used. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; esac - ;; - esac + fi done tmp_libs= for deplib in $new_libs; do @@ -8694,7 +8974,7 @@ func_mode_link () test CXX = "$tagname" && { case $host_os in linux*) - case `$CC -V 2>&1 | sed 5q` in + case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi @@ -8804,9 +9084,7 @@ func_mode_link () if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" + func_warning "Linking the shared library $output against the non-libtool objects $objs is not portable!" func_append libobjs " $objs" fi fi @@ -8867,13 +9145,13 @@ func_mode_link () # case $version_type in # correct linux to gnu/linux during the next big refactor - darwin|freebsd-elf|linux|osf|windows|none) + darwin|freebsd-elf|linux|midnightbsd-elf|osf|qnx|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; - freebsd-aout|qnx|sunos) + freebsd-aout|sco|sunos) current=$number_major revision=$number_minor age=0 @@ -8958,7 +9236,7 @@ func_mode_link () versuffix=.$current.$revision ;; - freebsd-elf) + freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision @@ -9020,8 +9298,9 @@ func_mode_link () ;; qnx) - major=.$current - versuffix=.$current + func_arith $current - $age + major=.$func_arith_result + versuffix=$major.$age.$revision ;; sco) @@ -9174,7 +9453,7 @@ func_mode_link () if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) + *-*-cygwin* | *-*-mingw* | *-*-windows* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) @@ -9184,7 +9463,7 @@ func_mode_link () *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) @@ -9225,108 +9504,6 @@ func_mode_link () # implementing what was already the behavior. newdeplibs=$deplibs ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c <, 1996. # This program is free software; you can redistribute it and/or modify diff --git a/3rdparty/expat/conftools/test-driver b/3rdparty/expat/conftools/test-driver index 89dba1e075cd3..be73b80adf955 100755 --- a/3rdparty/expat/conftools/test-driver +++ b/3rdparty/expat/conftools/test-driver @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2020 Free Software Foundation, Inc. +# Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ print_usage () { cat <$log_file 2>&1 +# Test script is run here. We create the file first, then append to it, +# to ameliorate tests themselves also writing to the log file. Our tests +# don't, but others can (automake bug#35762). +: >"$log_file" +"$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then @@ -126,7 +131,7 @@ esac # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). -echo "$res $test_name (exit status: $estatus)" >>$log_file +echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" diff --git a/3rdparty/expat/doc/Makefile.am b/3rdparty/expat/doc/Makefile.am index e2f029837a410..3bea96e9aa6f6 100644 --- a/3rdparty/expat/doc/Makefile.am +++ b/3rdparty/expat/doc/Makefile.am @@ -6,7 +6,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2024 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -30,30 +33,27 @@ .PHONY: dist-hook # not inside conditional to avoid automake warning -if WITH_DOCBOOK +if WITH_MANPAGE dist_man_MANS = xmlwf.1 xmlwf.1: xmlwf.xml -rm -f $@ - $(DOCBOOK_TO_MAN) $< + test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< test -f $@ || mv XMLWF.1 $@ -else +endif + +if !WITH_DISTRIBUTABLE_MANPAGE dist-hook: @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 @false endif -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +if !WITH_PREBUILT_MANPAGE +CLEANFILES = xmlwf.1 +endif EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ - valid-xhtml10.png \ xmlwf.xml diff --git a/3rdparty/expat/doc/Makefile.in b/3rdparty/expat/doc/Makefile.in index 94550becf3948..72deb0565d947 100644 --- a/3rdparty/expat/doc/Makefile.in +++ b/3rdparty/expat/doc/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.2 from Makefile.am. +# Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2020 Free Software Foundation, Inc. +# Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -22,7 +22,10 @@ # \___/_/\_\ .__/ \__,_|\__| # |_| XML parser # -# Copyright (c) 2017 Expat development team +# Copyright (c) 2017-2024 Sebastian Pipping +# Copyright (c) 2017 Stephen Groat +# Copyright (c) 2017 Joe Orton +# Copyright (c) 2024 Tomas Korbar # Licensed under the MIT license: # # Permission is hereby granted, free of charge, to any person obtaining @@ -130,6 +133,8 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/conftools/ax-append-compile-flags.m4 \ $(top_srcdir)/conftools/ax-append-link-flags.m4 \ $(top_srcdir)/conftools/expatcfg-compiler-supports-visibility.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx.m4 \ + $(top_srcdir)/conftools/ax-cxx-compile-stdcxx-11.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -207,8 +212,10 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CPP = @CPP@ +CMAKE_SHARED_LIBRARY_PREFIX = @CMAKE_SHARED_LIBRARY_PREFIX@ CPPFLAGS = @CPPFLAGS@ +CSCOPE = @CSCOPE@ +CTAGS = @CTAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ @@ -224,10 +231,20 @@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ +ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ +EXPAT_ATTR_INFO = @EXPAT_ATTR_INFO@ +EXPAT_CHAR_TYPE = @EXPAT_CHAR_TYPE@ +EXPAT_CONTEXT_BYTES = @EXPAT_CONTEXT_BYTES@ +EXPAT_DTD = @EXPAT_DTD@ +EXPAT_LARGE_SIZE = @EXPAT_LARGE_SIZE@ +EXPAT_MIN_SIZE = @EXPAT_MIN_SIZE@ +EXPAT_NS = @EXPAT_NS@ FGREP = @FGREP@ +FILECMD = @FILECMD@ FILEMAP = @FILEMAP@ GREP = @GREP@ +HAVE_CXX11 = @HAVE_CXX11@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -237,6 +254,8 @@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBAGE = @LIBAGE@ LIBCURRENT = @LIBCURRENT@ +LIBDIR_BASENAME = @LIBDIR_BASENAME@ +LIBM = @LIBM@ LIBOBJS = @LIBOBJS@ LIBREVISION = @LIBREVISION@ LIBS = @LIBS@ @@ -245,6 +264,7 @@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ +MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ @@ -266,9 +286,12 @@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_VOID_P = @SIZEOF_VOID_P@ +SO_MAJOR = @SO_MAJOR@ +SO_MINOR = @SO_MINOR@ +SO_PATCH = @SO_PATCH@ STRIP = @STRIP@ VERSION = @VERSION@ -_EXPAT_OUTPUT_NAME = @_EXPAT_OUTPUT_NAME@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -323,18 +346,18 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@WITH_DOCBOOK_TRUE@dist_man_MANS = xmlwf.1 +@WITH_MANPAGE_TRUE@dist_man_MANS = xmlwf.1 +@WITH_PREBUILT_MANPAGE_FALSE@CLEANFILES = xmlwf.1 EXTRA_DIST = \ - expat.png \ + ok.min.css \ reference.html \ style.css \ - valid-xhtml10.png \ xmlwf.xml all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -358,9 +381,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: $(am__configure_deps) +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -418,8 +441,7 @@ ctags CTAGS: cscope cscopelist: -@WITH_DOCBOOK_TRUE@dist-hook: - +@WITH_DISTRIBUTABLE_MANPAGE_TRUE@dist-hook: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am @@ -485,6 +507,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -495,7 +518,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-local mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile @@ -564,38 +587,31 @@ uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local cscopelist-am ctags-am dist-hook distclean \ - distclean-generic distclean-libtool distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-man1 install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ - uninstall-am uninstall-man uninstall-man1 + cscopelist-am ctags-am dist-hook distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man1 install-pdf install-pdf-am install-ps \ + install-ps-am install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags-am uninstall uninstall-am uninstall-man \ + uninstall-man1 .PRECIOUS: Makefile .PHONY: dist-hook # not inside conditional to avoid automake warning -@WITH_DOCBOOK_TRUE@xmlwf.1: xmlwf.xml -@WITH_DOCBOOK_TRUE@ -rm -f $@ -@WITH_DOCBOOK_TRUE@ $(DOCBOOK_TO_MAN) $< -@WITH_DOCBOOK_TRUE@ test -f $@ || mv XMLWF.1 $@ -@WITH_DOCBOOK_FALSE@dist-hook: -@WITH_DOCBOOK_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 -@WITH_DOCBOOK_FALSE@ @false - -# https://www.gnu.org/software/automake/manual/automake.html#What-Gets-Cleaned -.PHONY: clean-local -clean-local: clean-local-check - -.PHONY: clean-local-check -clean-local-check: - $(RM) xmlwf.1 +@WITH_MANPAGE_TRUE@xmlwf.1: xmlwf.xml +@WITH_MANPAGE_TRUE@ -rm -f $@ +@WITH_MANPAGE_TRUE@ test "x$(DOCBOOK_TO_MAN)" != x && $(DOCBOOK_TO_MAN) $< +@WITH_MANPAGE_TRUE@ test -f $@ || mv XMLWF.1 $@ + +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@dist-hook: +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @echo 'ERROR: Configure with --with-docbook for "make dist".' 1>&2 +@WITH_DISTRIBUTABLE_MANPAGE_FALSE@ @false # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/3rdparty/expat/doc/expat.png b/3rdparty/expat/doc/expat.png deleted file mode 100644 index 7d7c3dbaebcbacccbf8f2cc7fa900ebd6fc0eab2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 920 zcmV;J184k+P)--e8A4h+iU`?VXFn!uvUSU1_h)k)dJbHP#~S9vOpSIo&UCT+}-DnF_UCAzt#)@VIE(`HqD0q*l%{e^{$xJVV4|~gkUl|kjxkhvq{|LMiaa~a7 z&eK>EAV_*@A}uU@#^yf%FK?Zy{og|8n3JsST1-!3gA<8SeC`u45D&M2vEs)gx5pUG z^7y+5cqO+XKpck7p-=ly4hKz+@ADrQV2}&&4zBb}(cu`4fn30t+f98@d`3G}CS;|u z0-SaIl%FI&gwOmLPW-9(Oi1yMvC>V1QI3D(>I{+ao6g{xe;3<+hQH)fr(T{9+jo3D z+8af*WS0M#4$JT-&}WPz=tp=A;OkKjHxpVi!}r;IS$?R1ZzS1#fxo-8sE_uh$xhYv zok^1cL*Xm?P`bR@pw2-dpteUG>I?^06ZN ziUG&$uXFePov>o%$D6E<4A#)DL(80poCW4fzP)EC2E^KOB^(=>g$V=s2A3VrQXTT! z(q3G4*Bud^lo!ckAB-4*eu%j&A4B2uNx7yh)JMoRMsjq{SycMxPCjewuYi}-img:not(:last-child){margin-bottom:var(--ok-s-1)}figure>figcaption{text-align:center}figcaption,time{font-size:var(--ok-fs-5);color:var(--ok-tc-1)}mark{padding:.2em .4em;background:var(--ok-t-hl);color:#000;border-radius:var(--ok-br)}iframe{border:var(--ok-b-0);border-radius:var(--ok-br);width:100%}hr{border:none;border-bottom:var(--ok-b-0)}footer{font-size:var(--ok-fs-5)}blockquote,footer{color:var(--ok-tc-1)}blockquote{position:relative;margin-left:0;margin-right:0;padding-left:var(--ok-s-5)}blockquote:before{position:absolute;height:100%;content:"";width:4px;left:0;border-radius:var(--ok-br);background-color:var(--ok-bg-1)}dd{padding-left:var(--ok-s-5)}abbr{cursor:help}@media (hover:hover){a:hover{text-decoration:underline}input:hover:not(:disabled):not(:focus):not([type=submit]):not([type=button]):not([type=reset]):not([type=range]),select:hover:not(:disabled):not(:focus),textarea:hover:not(:disabled):not(:focus){border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-webkit-slider-runnable-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-moz-range-track{border:var(--ok-b-1)}input[type=range]:hover:not(:disabled)::-ms-track{border:var(--ok-b-1)}select:not([multiple]):not(:disabled):hover{cursor:pointer}button:hover:not(:disabled),input[type=button]:hover:not(:disabled),input[type=reset]:hover:not(:disabled),input[type=submit]:hover:not(:disabled){background-color:var(--ok-accent-1)}input:not(:disabled):hover::-webkit-file-upload-button{background-color:var(--ok-accent-1)}} \ No newline at end of file diff --git a/3rdparty/expat/doc/reference.html b/3rdparty/expat/doc/reference.html index 1e4780ed70c63..450fea84c29f5 100644 --- a/3rdparty/expat/doc/reference.html +++ b/3rdparty/expat/doc/reference.html @@ -3,26 +3,58 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Expat XML Parser + - - - - - - - - - -
      (Expat logo)
      Release 2.0.1
      +
      +

      + The Expat XML Parser + Release 2.6.4 +

      +

      Expat is a library, written in C, for parsing XML documents. It's @@ -38,11 +70,11 @@

      This is free software, licensed under the MIT/X Consortium license. You may download it -from the Expat home page. +from the Expat home page.

      The bulk of this document was originally commissioned as an article -by XML.com. They graciously allowed +by XML.com. They graciously allowed Clark Cooper to retain copyright and to distribute it with Expat. This version has been substantially extended to include documentation on features which have been added since the original article was @@ -120,6 +152,14 @@

      Table of Contents

    3. XML_GetInputContext
    4. +
    5. + Attack Protection + +
    6. Miscellaneous Functions
      • XML_SetUserData
      • @@ -268,7 +308,7 @@

        Building and Installing Expat

        The Expat distribution comes as a compressed (with GNU gzip) tar file. You may download the latest version from Source Forge. After +"https://sourceforge.net/projects/expat/" >Source Forge. After unpacking this, cd into the directory. Then follow either the Win32 directions or Unix directions below.

        @@ -279,7 +319,7 @@

        Building under Win32

        Developer Studio installed, you can use CMake to generate a .sln file, e.g. -cmake -G"Visual Studio 15 2017" -DCMAKE_BUILD_TYPE=RelWithDebInfo . +cmake -G"Visual Studio 16 2019" -DCMAKE_BUILD_TYPE=RelWithDebInfo . , and build Expat using msbuild /m expat.sln after.

        Alternatively, you may download the Win32 binary package that @@ -316,39 +356,67 @@

        Building under Unix (or GNU)

        Configuring Expat Using the Pre-Processor

        Expat's feature set can be configured using a small number of -pre-processor definitions. The definition of this symbols does not -affect the set of entry points for Expat, only the behavior of the API -and the definition of character types in the case of -XML_UNICODE_WCHAR_T. The symbols are:

        +pre-processor definitions. The symbols are:

        -
        XML_DTD
        +
        XML_GE
        +
        +Added in Expat 2.6.0. +Include support for +general entities +(syntax &e1; to reference and +syntax <!ENTITY e1 'value1'> (an internal general entity) or +<!ENTITY e2 SYSTEM 'file2'> (an external general entity) to declare). +With XML_GE enabled, general entities will be replaced by their declared replacement text; +for this to work for external general entities, in addition an +XML_ExternalEntityRefHandler must be set using +XML_SetExternalEntityRefHandler. +Also, enabling XML_GE makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. +
        +With XML_GE disabled, Expat has a smaller memory footprint and can be faster, but will +not load external general entities and will replace all general entities +(except the predefined five: +amp, apos, gt, lt, quot) +with a self-reference: +for example, referencing an entity e1 via &e1; will be replaced +by text &e1;. +
        + +
        XML_DTD
        Include support for using and reporting DTD-based content. If this is defined, default attribute values from an external DTD subset are reported and attribute value normalization occurs based on the type of attributes defined in the external subset. Without this, Expat has a smaller memory footprint and can be faster, but will -not load external entities or process conditional sections. This does -not affect the set of functions available in the API.
        - -
        XML_NS
        +not load external parameter entities or process conditional sections. If defined, makes +the functions +XML_SetBillionLaughsAttackProtectionMaximumAmplification and + +XML_SetBillionLaughsAttackProtectionActivationThreshold available. + +
        XML_NS
        When defined, support for the Namespaces in XML +"https://www.w3.org/TR/REC-xml-names/" >Namespaces in XML specification is included.
        -
        XML_UNICODE
        +
        XML_UNICODE
        When defined, character data reported to the application is encoded in UTF-16 using wide characters of the type XML_Char. This is implied if XML_UNICODE_WCHAR_T is defined.
        -
        XML_UNICODE_WCHAR_T
        +
        XML_UNICODE_WCHAR_T
        If defined, causes the XML_Char character type to be defined using the wchar_t type; otherwise, unsigned short is used. Defining this implies XML_UNICODE.
        -
        XML_LARGE_SIZE
        +
        XML_LARGE_SIZE
        If defined, causes the XML_Size and XML_Index integer types to be at least 64 bits in size. This is intended to support processing of very large input streams, where the return values of @@ -358,23 +426,23 @@

        Configuring Expat Using the Pre-Processor

        could overflow. It may not be supported by all compilers, and is turned off by default.
        -
        XML_CONTEXT_BYTES
        +
        XML_CONTEXT_BYTES
        The number of input bytes of markup context which the parser will ensure are available for reporting via XML_GetInputContext. This is -normally set to 1024, and must be set to a positive integer. If this -is not defined, the input context will not be available and XML_GetInputContext will -always report NULL. Without this, Expat has a smaller memory +always report NULL. Without this, Expat has a smaller memory footprint and can be faster.
        -
        XML_STATIC
        +
        XML_STATIC
        On Windows, this should be set if Expat is going to be linked statically with the code that calls it; this is required to get all the right MSVC magic annotations correct. This is ignored on other platforms.
        -
        XML_ATTR_INFO
        +
        XML_ATTR_INFO
        If defined, makes the additional function XML_GetAttributeInfo available for reporting attribute byte offsets.
        @@ -628,8 +696,9 @@

        Namespace Processing

        tag handler and the EndNamespaceDeclHandler is called after the corresponding end tag that ends the namespace's scope. The namespace start handler gets passed the prefix and URI for the namespace. For a -default namespace declaration (xmlns='...'), the prefix will be null. -The URI will be null for the case where the default namespace is being +default namespace declaration (xmlns='...'), the prefix will be +NULL. +The URI will be NULL for the case where the default namespace is being unset. The namespace end handler just gets the prefix for the closing scope.

        @@ -758,7 +827,7 @@

        Temporarily Stopping Parsing

        include

          -
        • Supporting the Supporting the XInclude specification.
        • Delaying further processing until additional information is @@ -900,24 +969,30 @@

          Expat Reference

          Parser Creation

          -
          +

          XML_ParserCreate

          +
           XML_Parser XMLCALL
           XML_ParserCreate(const XML_Char *encoding);
           
          -Construct a new parser. If encoding is non-null, it specifies a +

          +Construct a new parser. If encoding is non-NULL, it specifies a character encoding to use for the document. This overrides the document encoding declaration. There are four built-in encodings: +

          • US-ASCII
          • UTF-8
          • UTF-16
          • ISO-8859-1
          +

          Any other value will invoke a call to the UnknownEncodingHandler. +

          -
          +

          XML_ParserCreateNS

          +
           XML_Parser XMLCALL
           XML_ParserCreateNS(const XML_Char *encoding,
                              XML_Char sep);
          @@ -936,7 +1011,16 @@ 

          Parser Creation

          to support RDF processors. It is a programming error to use the null separator with namespace triplets. -
          +

          Note: +Expat does not validate namespace URIs (beyond encoding) +against RFC 3986 today (and is not required to do so with regard to +the XML 1.0 namespaces specification) but it may start doing that +in future releases. Before that, an application using Expat must +be ready to receive namespace URIs containing non-URI characters. +

          + +

          XML_ParserCreate_MM

          +
           XML_Parser XMLCALL
           XML_ParserCreate_MM(const XML_Char *encoding,
                               const XML_Memory_Handling_Suite *ms,
          @@ -951,14 +1035,15 @@ 

          Parser Creation

          Construct a new parser using the suite of memory handling functions -specified in ms. If ms is NULL, then use the +specified in ms. If ms is NULL, then use the standard set of memory management functions. If sep is -non NULL, then namespace processing is enabled in the created parser +non-NULL, then namespace processing is enabled in the created parser and the character pointed at by sep is used as the separator between the namespace URI and the local part of the name.

          -
          +

          XML_ExternalEntityParserCreate

          +
           XML_Parser XMLCALL
           XML_ExternalEntityParserCreate(XML_Parser p,
                                          const XML_Char *context,
          @@ -974,7 +1059,8 @@ 

          Parser Creation

          differently than the parent parser). -
          +

          XML_ParserFree

          +
           void XMLCALL
           XML_ParserFree(XML_Parser p);
           
          @@ -983,7 +1069,8 @@

          Parser Creation

          freeing any memory associated with user data. -
          +

          XML_ParserReset

          +
           XML_Bool XMLCALL
           XML_ParserReset(XML_Parser p,
                           const XML_Char *encoding);
          @@ -1014,7 +1101,7 @@ 

          Parsing

          XML_ExternalEntityParserCreate.

          -

          Note: the len argument passed to these functions +

          Note: The len argument passed to these functions should be considerably less than the maximum value for an integer, as it could create an integer overflow situation if the added lengths of a buffer and the unprocessed portion of the previous buffer @@ -1022,7 +1109,13 @@

          Parsing

          will remain unprocessed if it is part of an XML token for which the end is not part of that buffer.

          -
          +

          The application must make a concluding +XML_Parse or +XML_ParseBuffer call +with isFinal set to XML_TRUE.

          + +

          XML_Parse

          +
           enum XML_Status XMLCALL
           XML_Parse(XML_Parser p,
                     const char *s,
          @@ -1036,42 +1129,86 @@ 

          Parsing

          };
          +

          Parse some more of the document. The string s is a buffer containing part (or perhaps all) of the document. The number of bytes of s that are part of the document is indicated by len. This means -that s doesn't have to be null terminated. It also means that +that s doesn't have to be null-terminated. It also means that if len is larger than the number of bytes in the block of -memory that s points at, then a memory fault is likely. The +memory that s points at, then a memory fault is likely. +Negative values for len are rejected since Expat 2.2.1. +The isFinal parameter informs the parser that this is the last piece of the document. Frequently, the last piece is empty (i.e. len is zero.) +

          + +

          If a parse error occurred, it returns XML_STATUS_ERROR. Otherwise it returns XML_STATUS_OK value. +Note that regardless of the return value, there is no guarantee that all +provided input has been parsed; only after the +concluding call will all handler callbacks and parsing errors have +happened. +

          + +

          +Simplified, XML_Parse can be considered a convenience wrapper +that is pairing calls +to XML_GetBuffer +and XML_ParseBuffer +(when Expat is built with macro XML_CONTEXT_BYTES +defined to a positive value, which is both common and default). +XML_Parse is then functionally equivalent to calling +XML_GetBuffer, +memcpy, and +XML_ParseBuffer. +

          + +

          +To avoid double copying of the input, direct use of functions +XML_GetBuffer and +XML_ParseBuffer is advised +for most production use, e.g. +if you're using read or similar functionality to fill your +buffers, fill directly into the buffer from +XML_GetBuffer, +then parse with XML_ParseBuffer. +

          -
          +

          XML_ParseBuffer

          +
           enum XML_Status XMLCALL
           XML_ParseBuffer(XML_Parser p,
                           int len,
                           int isFinal);
           
          +

          This is just like XML_Parse, except in this case Expat provides the buffer. By obtaining the buffer from Expat with the XML_GetBuffer function, the application can avoid double copying of the input. +

          + +

          +Negative values for len are rejected since Expat 2.6.3. +

          -
          +

          XML_GetBuffer

          +
           void * XMLCALL
           XML_GetBuffer(XML_Parser p,
                         int len);
           
          Obtain a buffer of size len to read a piece of the document -into. A NULL value is returned if Expat can't allocate enough memory for -this buffer. This has to be called prior to every call to +into. A NULL value is returned if Expat can't allocate enough memory for +this buffer. A NULL value may also be returned if len is zero. +This has to be called prior to every call to XML_ParseBuffer. A typical use would look like this: @@ -1098,7 +1235,8 @@

          Parsing

          -
          +

          XML_StopParser

          +
           enum XML_Status XMLCALL
           XML_StopParser(XML_Parser p,
                          XML_Bool resumable);
          @@ -1111,7 +1249,7 @@ 

          Parsing

          call-back handler, except when aborting (when resumable is XML_FALSE) an already suspended parser. Some call-backs may still follow because they would otherwise get -lost, including +lost, including

          • the end element handler for empty elements when stopped in the start element handler,
          • @@ -1120,7 +1258,7 @@

            Parsing

          • the character data handler when stopped in the character data handler while making multiple call-backs on a contiguous chunk of characters,
          -and possibly others.

          +

          and possibly others.

          This can be called from most handlers, including DTD related call-backs, except when parsing an external parameter entity and @@ -1166,7 +1304,8 @@

          Parsing

          New in Expat 1.95.8.

          -
          +

          XML_ResumeParser

          +
           enum XML_Status XMLCALL
           XML_ResumeParser(XML_Parser p);
           
          @@ -1191,7 +1330,8 @@

          Parsing

          New in Expat 1.95.8.

          -
          +

          XML_GetParsingStatus

          +
           void XMLCALL
           XML_GetParsingStatus(XML_Parser p,
                                XML_ParsingStatus *status);
          @@ -1213,7 +1353,7 @@ 

          Parsing

          Returns status of parser with respect to being initialized, parsing, finished, or suspended, and whether the final buffer is being processed. The status parameter must not be -NULL.

          +NULL.

          New in Expat 1.95.8.

          @@ -1228,7 +1368,7 @@

          Handler Setting

          way it could do this is to set the character handler when a para start tag is seen, and unset it for the corresponding end tag.

          -

          A handler may be unset by providing a NULL pointer to the +

          A handler may be unset by providing a NULL pointer to the appropriate handler setter. None of the handler setting functions have a return value.

          @@ -1240,7 +1380,8 @@

          Handler Setting

          encoding of the document.

          -
          +

          XML_SetStartElementHandler

          +
           void XMLCALL
           XML_SetStartElementHandler(XML_Parser p,
                                      XML_StartElementHandler start);
          @@ -1255,13 +1396,14 @@ 

          Handler Setting

          handler as a pointer to a vector of char pointers. Each attribute seen in a start (or empty) tag occupies 2 consecutive places in this vector: the attribute name followed by the attribute value. These pairs are terminated -by a null pointer.

          +by a NULL pointer.

          Note that an empty tag generates a call to both start and end handlers (in that order).

          -
          +

          XML_SetEndElementHandler

          +
           void XMLCALL
           XML_SetEndElementHandler(XML_Parser p,
                                    XML_EndElementHandler);
          @@ -1276,7 +1418,8 @@ 

          Handler Setting

          -
          +

          XML_SetElementHandler

          +
           void XMLCALL
           XML_SetElementHandler(XML_Parser p,
                                 XML_StartElementHandler start,
          @@ -1286,7 +1429,8 @@ 

          Handler Setting

          -
          +

          XML_SetCharacterDataHandler

          +
           void XMLCALL
           XML_SetCharacterDataHandler(XML_Parser p,
                                       XML_CharacterDataHandler charhndl)
          @@ -1302,14 +1446,15 @@ 

          Handler Setting

          to deal with the end of the string. A single block of contiguous text free of markup may still result in a sequence of calls to this handler. In other words, if you're searching for a pattern in the text, it may -be split across calls to this handler. Note: Setting this handler to NULL +be split across calls to this handler. Note: Setting this handler to NULL may NOT immediately terminate call-backs if the parser is currently processing such a single block of contiguous markup-free text, as the parser will continue calling back until the end of the block is reached.

          -
          +

          XML_SetProcessingInstructionHandler

          +
           void XMLCALL
           XML_SetProcessingInstructionHandler(XML_Parser p,
                                               XML_ProcessingInstructionHandler proc)
          @@ -1327,7 +1472,8 @@ 

          Handler Setting

          -
          +

          XML_SetCommentHandler

          +
           void XMLCALL
           XML_SetCommentHandler(XML_Parser p,
                                 XML_CommentHandler cmnt)
          @@ -1342,7 +1488,8 @@ 

          Handler Setting

          -
          +

          XML_SetStartCdataSectionHandler

          +
           void XMLCALL
           XML_SetStartCdataSectionHandler(XML_Parser p,
                                           XML_StartCdataSectionHandler start);
          @@ -1355,7 +1502,8 @@ 

          Handler Setting

          -
          +

          XML_SetEndCdataSectionHandler

          +
           void XMLCALL
           XML_SetEndCdataSectionHandler(XML_Parser p,
                                         XML_EndCdataSectionHandler end);
          @@ -1368,7 +1516,8 @@ 

          Handler Setting

          -
          +

          XML_SetCdataSectionHandler

          +
           void XMLCALL
           XML_SetCdataSectionHandler(XML_Parser p,
                                      XML_StartCdataSectionHandler start,
          @@ -1378,7 +1527,8 @@ 

          Handler Setting

          -
          +

          XML_SetDefaultHandler

          +
           void XMLCALL
           XML_SetDefaultHandler(XML_Parser p,
                                 XML_DefaultHandler hndl)
          @@ -1409,7 +1559,8 @@ 

          Handler Setting

          -
          +

          XML_SetDefaultHandlerExpand

          +
           void XMLCALL
           XML_SetDefaultHandlerExpand(XML_Parser p,
                                       XML_DefaultHandler hndl)
          @@ -1429,7 +1580,8 @@ 

          Handler Setting

          -
          +

          XML_SetExternalEntityRefHandler

          +
           void XMLCALL
           XML_SetExternalEntityRefHandler(XML_Parser p,
                                           XML_ExternalEntityRefHandler hndl)
          @@ -1452,16 +1604,16 @@ 

          Handler Setting

          href="#XML_ExternalEntityParserCreate" >XML_ExternalEntityParserCreate. code is valid only until the handler returns, so if the referenced entity is -to be parsed later, it must be copied. context is NULL +to be parsed later, it must be copied. context is NULL only when the entity is a parameter entity, which is how one can differentiate between general and parameter entities.

          The base parameter is the base to use for relative system identifiers. It is set by XML_SetBase and may be NULL. The +href="#XML_SetBase">XML_SetBase and may be NULL. The publicId parameter is the public id given in the entity -declaration and may be NULL. systemId is the system -identifier specified in the entity declaration and is never NULL.

          +declaration and may be NULL. systemId is the system +identifier specified in the entity declaration and is never NULL.

          There are a couple of ways in which this handler differs from others. First, this handler returns a status indicator (an @@ -1482,17 +1634,18 @@

          Handler Setting

          information into global or static variables.

          -
          +

          XML_SetExternalEntityRefHandlerArg

          +
           void XMLCALL
           XML_SetExternalEntityRefHandlerArg(XML_Parser p,
                                              void *arg)
           

          Set the argument passed to the ExternalEntityRefHandler. If -arg is not NULL, it is the new value passed to the +arg is not NULL, it is the new value passed to the handler set using XML_SetExternalEntityRefHandler; if arg is -NULL, the argument passed to the handler function will be the parser +NULL, the argument passed to the handler function will be the parser object itself.

          Note: @@ -1508,7 +1661,8 @@

          Handler Setting

          -
          +

          XML_SetSkippedEntityHandler

          +
           void XMLCALL
           XML_SetSkippedEntityHandler(XML_Parser p,
                                       XML_SkippedEntityHandler handler)
          @@ -1528,14 +1682,15 @@ 

          Handler Setting

          has been called.

    The is_parameter_entity argument will be non-zero for -a parameter entity and zero for a general entity.

    Note: skipped +a parameter entity and zero for a general entity.

    Note: Skipped parameter entities in declarations and skipped general entities in attribute values cannot be reported, because the event would be out of sync with the reporting of the declarations or attribute values

    -
    +

    XML_SetUnknownEncodingHandler

    +
     void XMLCALL
     XML_SetUnknownEncodingHandler(XML_Parser p,
                                   XML_UnknownEncodingHandler enchandler,
    @@ -1573,18 +1728,19 @@ 

    Handler Setting

    If the value is -n, where n is an integer > 1, then n is the number of bytes in the sequence and the actual conversion is accomplished by a call to the function pointed at by convert. This function may return -1 -if the sequence itself is invalid. The convert pointer may be null if +if the sequence itself is invalid. The convert pointer may be NULL if there are only single byte codes. The data parameter passed to the convert function is the data pointer from XML_Encoding. The string s is NOT null-terminated and points at the sequence of bytes to be converted.

    The function pointed at by release is called by the -parser when it is finished with the encoding. It may be NULL.

    +parser when it is finished with the encoding. It may be NULL.

    -
    +

    XML_SetStartNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetStartNamespaceDeclHandler(XML_Parser p,
     			         XML_StartNamespaceDeclHandler start);
    @@ -1602,7 +1758,8 @@ 

    Handler Setting

    -
    +

    XML_SetEndNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetEndNamespaceDeclHandler(XML_Parser p,
     			       XML_EndNamespaceDeclHandler end);
    @@ -1619,7 +1776,8 @@ 

    Handler Setting

    -
    +

    XML_SetNamespaceDeclHandler

    +
     void XMLCALL
     XML_SetNamespaceDeclHandler(XML_Parser p,
                                 XML_StartNamespaceDeclHandler start,
    @@ -1629,7 +1787,8 @@ 

    Handler Setting

    -
    +

    XML_SetXmlDeclHandler

    +
     void XMLCALL
     XML_SetXmlDeclHandler(XML_Parser p,
     		      XML_XmlDeclHandler xmldecl);
    @@ -1643,8 +1802,8 @@ 

    Handler Setting

    Sets a handler that is called for XML declarations and also for text declarations discovered in external entities. The way to -distinguish is that the version parameter will be NULL -for text declarations. The encoding parameter may be NULL +distinguish is that the version parameter will be NULL +for text declarations. The encoding parameter may be NULL for an XML declaration. The standalone argument will contain -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or @@ -1652,7 +1811,8 @@

    Handler Setting

    -
    +

    XML_SetStartDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetStartDoctypeDeclHandler(XML_Parser p,
     			       XML_StartDoctypeDeclHandler start);
    @@ -1667,12 +1827,13 @@ 

    Handler Setting

    Set a handler that is called at the start of a DOCTYPE declaration, before any external or internal subset is parsed. Both sysid -and pubid may be NULL. The has_internal_subset +and pubid may be NULL. The has_internal_subset will be non-zero if the DOCTYPE declaration has an internal subset.

    -
    +

    XML_SetEndDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetEndDoctypeDeclHandler(XML_Parser p,
     			     XML_EndDoctypeDeclHandler end);
    @@ -1686,7 +1847,8 @@ 

    Handler Setting

    -
    +

    XML_SetDoctypeDeclHandler

    +
     void XMLCALL
     XML_SetDoctypeDeclHandler(XML_Parser p,
     			  XML_StartDoctypeDeclHandler start,
    @@ -1696,7 +1858,8 @@ 

    Handler Setting

    -
    +

    XML_SetElementDeclHandler

    +
     void XMLCALL
     XML_SetElementDeclHandler(XML_Parser p,
     			  XML_ElementDeclHandler eldecl);
    @@ -1736,16 +1899,17 @@ 

    Handler Setting

    Sets a handler for element declarations in a DTD. The handler gets called with the name of the element in the declaration and a pointer -to a structure that contains the element model. It is the -application's responsibility to free this data structure using -XML_FreeContentModel.

    +to a structure that contains the element model. It's the user code's +responsibility to free model when finished with it. See +XML_FreeContentModel. +There is no need to free the model from the handler, it can be kept +around and freed at a later stage.

    The model argument is the root of a tree of XML_Content nodes. If type equals XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other -fields will be zero or NULL. If type is +fields will be zero or NULL. If type is XML_CTYPE_MIXED, then quant will be XML_CQUANT_NONE or XML_CQUANT_REP and numchildren will contain the number of elements that are @@ -1757,7 +1921,7 @@

    Handler Setting

    For type XML_CTYPE_NAME, the name field points to the name and the numchildren and -children fields will be zero and NULL. The +children fields will be zero and NULL. The quant field will indicate any quantifiers placed on the name.

    @@ -1768,7 +1932,8 @@

    Handler Setting

    -
    +

    XML_SetAttlistDeclHandler

    +
     void XMLCALL
     XML_SetAttlistDeclHandler(XML_Parser p,
                               XML_AttlistDeclHandler attdecl);
    @@ -1792,16 +1957,17 @@ 

    Handler Setting

    type in the declaration with whitespace removed.

    The dflt parameter holds the default value. It will be -NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can +NULL in the case of "#IMPLIED" or "#REQUIRED" attributes. You can distinguish these two cases by checking the isrequired parameter, which will be true in the case of "#REQUIRED" attributes. Attributes which are "#FIXED" will have also have a true -isrequired, but they will have the non-NULL fixed value +isrequired, but they will have the non-NULL fixed value in the dflt parameter.

    -
    +

    XML_SetEntityDeclHandler

    +
     void XMLCALL
     XML_SetEntityDeclHandler(XML_Parser p,
     			 XML_EntityDeclHandler handler);
    @@ -1823,19 +1989,20 @@ 

    Handler Setting

    case of parameter entities and zero otherwise.

    For internal entities (<!ENTITY foo "bar">), -value will be non-NULL and systemId, -publicId, and notationName will all be NULL. -The value string is not NULL terminated; the length is +value will be non-NULL and systemId, +publicId, and notationName will all be NULL. +The value string is not null-terminated; the length is provided in the value_length parameter. Do not use value_length to test for internal entities, since it is legal to have zero-length values. Instead check for whether or not -value is NULL.

    The notationName -argument will have a non-NULL value only for unparsed entity +value is NULL.

    The notationName +argument will have a non-NULL value only for unparsed entity declarations.

    -
    +

    XML_SetUnparsedEntityDeclHandler

    +
     void XMLCALL
     XML_SetUnparsedEntityDeclHandler(XML_Parser p,
                                      XML_UnparsedEntityDeclHandler h)
    @@ -1861,7 +2028,8 @@ 

    Handler Setting

    -
    +

    XML_SetNotationDeclHandler

    +
     void XMLCALL
     XML_SetNotationDeclHandler(XML_Parser p,
                                XML_NotationDeclHandler h)
    @@ -1878,7 +2046,8 @@ 

    Handler Setting

    -
    +

    XML_SetNotStandaloneHandler

    +
     void XMLCALL
     XML_SetNotStandaloneHandler(XML_Parser p,
                                 XML_NotStandaloneHandler h)
    @@ -1913,7 +2082,8 @@ 

    Parse position and error reporting functions

    DTD. In other words, they usually return bogus information when called from within a DTD declaration handler.

    -
    +

    XML_GetErrorCode

    +
     enum XML_Error XMLCALL
     XML_GetErrorCode(XML_Parser p);
     
    @@ -1921,7 +2091,8 @@

    Parse position and error reporting functions

    Return what type of error has occurred.
    -
    +

    XML_ErrorString

    +
     const XML_LChar * XMLCALL
     XML_ErrorString(enum XML_Error code);
     
    @@ -1931,7 +2102,8 @@

    Parse position and error reporting functions

    XML_GetErrorCode. -
    +

    XML_GetCurrentByteIndex

    +
     XML_Index XMLCALL
     XML_GetCurrentByteIndex(XML_Parser p);
     
    @@ -1942,7 +2114,8 @@

    Parse position and error reporting functions

    "#XML_GetCurrentColumnNumber" >XML_GetCurrentColumnNumber. -
    +

    XML_GetCurrentLineNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentLineNumber(XML_Parser p);
     
    @@ -1951,7 +2124,8 @@

    Parse position and error reporting functions

    1. -
    +

    XML_GetCurrentColumnNumber

    +
     XML_Size XMLCALL
     XML_GetCurrentColumnNumber(XML_Parser p);
     
    @@ -1960,7 +2134,8 @@

    Parse position and error reporting functions

    the position. -
    +

    XML_GetCurrentByteCount

    +
     int XMLCALL
     XML_GetCurrentByteCount(XML_Parser p);
     
    @@ -1972,7 +2147,8 @@

    Parse position and error reporting functions

    separate start and end tags). -
    +

    XML_GetInputContext

    +
     const char * XMLCALL
     XML_GetInputContext(XML_Parser p,
                         int *offset,
    @@ -1994,8 +2170,117 @@ 

    Parse position and error reporting functions

    triggering a call spans over a very large amount of input, the actual parse position may be before the beginning of the buffer.

    -

    If XML_CONTEXT_BYTES is not defined, this will always -return NULL.

    +

    If XML_CONTEXT_BYTES is zero, this will always +return NULL.

    + + +

    Attack Protection

    + +

    XML_SetBillionLaughsAttackProtectionMaximumAmplification

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionMaximumAmplification(XML_Parser p,
    +                                                         float maximumAmplificationFactor);
    +
    +
    +

    + Sets the maximum tolerated amplification factor + for protection against + billion laughs attacks + (default: 100.0) + of parser p to maximumAmplificationFactor, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + + The amplification factor is calculated as .. +
    +    amplification := (direct + indirect) / direct
    +  
    + .. while parsing, whereas + direct is the number of bytes read from the primary document in parsing and + indirect is the number of bytes added by expanding entities and reading of external DTD files, combined. + +

    For a call to XML_SetBillionLaughsAttackProtectionMaximumAmplification to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers) and
    • +
    • maximumAmplificationFactor must be non-NaN and greater than or equal to 1.0.
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Peak amplifications + of factor 15,000 for the entire payload and + of factor 30,000 in the middle of parsing + have been observed with small benign files in practice. + + So if you do reduce the maximum allowed amplification, + please make sure that the activation threshold is still big enough + to not end up with undesired false positives (i.e. benign files being rejected). +

    +
    + +

    XML_SetBillionLaughsAttackProtectionActivationThreshold

    +
    +/* Added in Expat 2.4.0. */
    +XML_Bool XMLCALL
    +XML_SetBillionLaughsAttackProtectionActivationThreshold(XML_Parser p,
    +                                                        unsigned long long activationThresholdBytes);
    +
    +
    +

    + Sets number of output bytes (including amplification from entity expansion and reading DTD files) + needed to activate protection against + billion laughs attacks + (default: 8 MiB) + of parser p to activationThresholdBytes, and + returns XML_TRUE upon success and XML_FALSE upon error. +

    + +

    For a call to XML_SetBillionLaughsAttackProtectionActivationThreshold to succeed:

    +
      +
    • parser p must be a non-NULL root parser (without any parent parsers).
    • +
    + +

    + Note: + If you ever need to increase this value for non-attack payload, + please file a bug report. +

    + +

    + Note: + Activation thresholds below 4 MiB are known to break support for + DITA 1.3 payload + and are hence not recommended. +

    +
    + +

    XML_SetReparseDeferralEnabled

    +
    +/* Added in Expat 2.6.0. */
    +XML_Bool XMLCALL
    +XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
    +
    +
    +

    + Large tokens may require many parse calls before enough data is available for Expat to parse it in full. + If Expat retried parsing the token on every parse call, parsing could take quadratic time. + To avoid this, Expat only retries once a significant amount of new data is available. + This function allows disabling this behavior. +

    +

    + The enabled argument should be XML_TRUE or XML_FALSE. +

    +

    + Returns XML_TRUE on success, and XML_FALSE on error. +

    Miscellaneous functions

    @@ -2003,7 +2288,8 @@

    Miscellaneous functions

    The functions in this section either obtain state information from the parser or can be used to dynamically set parser options.

    -
    +

    XML_SetUserData

    +
     void XMLCALL
     XML_SetUserData(XML_Parser p,
                     void *userData);
    @@ -2018,7 +2304,8 @@ 

    Miscellaneous functions

    memory. -
    +

    XML_GetUserData

    +
     void * XMLCALL
     XML_GetUserData(XML_Parser p);
     
    @@ -2027,7 +2314,8 @@

    Miscellaneous functions

    It is actually implemented as a macro. -
    +

    XML_UseParserAsHandlerArg

    +
     void XMLCALL
     XML_UseParserAsHandlerArg(XML_Parser p);
     
    @@ -2038,7 +2326,8 @@

    Miscellaneous functions

    >XML_GetUserData function. -
    +

    XML_SetBase

    +
     enum XML_Status XMLCALL
     XML_SetBase(XML_Parser p,
                 const XML_Char *base);
    @@ -2050,7 +2339,8 @@ 

    Miscellaneous functions

    XML_STATUS_OK. -
    +

    XML_GetBase

    +
     const XML_Char * XMLCALL
     XML_GetBase(XML_Parser p);
     
    @@ -2058,7 +2348,8 @@

    Miscellaneous functions

    Return the base for resolving relative URIs. -
    +

    XML_GetSpecifiedAttributeCount

    +
     int XMLCALL
     XML_GetSpecifiedAttributeCount(XML_Parser p);
     
    @@ -2074,7 +2365,8 @@

    Miscellaneous functions

    means the current call. -
    +

    XML_GetIdAttributeIndex

    +
     int XMLCALL
     XML_GetIdAttributeIndex(XML_Parser p);
     
    @@ -2086,7 +2378,8 @@

    Miscellaneous functions

    current call. -
    +

    XML_GetAttributeInfo

    +
     const XML_AttrInfo * XMLCALL
     XML_GetAttributeInfo(XML_Parser parser);
     
    @@ -2107,14 +2400,15 @@

    Miscellaneous functions

    XML_GetSpecifiedAttributeCount(parser) / 2. -
    +

    XML_SetEncoding

    +
     enum XML_Status XMLCALL
     XML_SetEncoding(XML_Parser p,
                     const XML_Char *encoding);
     
    Set the encoding to be used by the parser. It is equivalent to -passing a non-null encoding argument to the parser creation functions. +passing a non-NULL encoding argument to the parser creation functions. It must not be called after XML_Parse or XML_ParseBuffer have been called on the given parser. @@ -2122,7 +2416,8 @@

    Miscellaneous functions

    XML_STATUS_ERROR on error.
    -
    +

    XML_SetParamEntityParsing

    +
     int XMLCALL
     XML_SetParamEntityParsing(XML_Parser p,
                               enum XML_ParamEntityParsing code);
    @@ -2142,7 +2437,8 @@ 

    Miscellaneous functions

    no effect and will always return 0. -
    +

    XML_SetHashSalt

    +
     int XMLCALL
     XML_SetHashSalt(XML_Parser p,
                     unsigned long hash_salt);
    @@ -2153,15 +2449,16 @@ 

    Miscellaneous functions

    function behavior. In order to have an effect this must be called before parsing has started. Returns 1 if successful, 0 when called after XML_Parse or XML_ParseBuffer. -

    Note:This call is optional, as the parser will auto-generate +

    Note: This call is optional, as the parser will auto-generate a new random salt value if no value has been set at the start of parsing.

    -

    Note:One should not call XML_SetHashSalt with a +

    Note: One should not call XML_SetHashSalt with a hash salt value of 0, as this value is used as sentinel value to indicate that XML_SetHashSalt has not been called. Consequently such a call will have no effect, even if it returns 1.

    -
    +

    XML_UseForeignDTD

    +
     enum XML_Error XMLCALL
     XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
     
    @@ -2183,7 +2480,7 @@

    Miscellaneous functions

    external entity reference handler set via XML_SetExternalEntityRefHandler with both -publicId and systemId set to NULL.

    +publicId and systemId set to NULL.

    If this function is called after parsing has begun, it returns XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING and ignores @@ -2198,7 +2495,8 @@

    Miscellaneous functions

    the external entity reference handler returns without action.

    -
    +

    XML_SetReturnNSTriplet

    +
     void XMLCALL
     XML_SetReturnNSTriplet(XML_Parser parser,
                            int        do_nst);
    @@ -2220,7 +2518,8 @@ 

    Miscellaneous functions

    separator.

    -
    +

    XML_DefaultCurrent

    +
     void XMLCALL
     XML_DefaultCurrent(XML_Parser parser);
     
    @@ -2234,7 +2533,8 @@

    Miscellaneous functions

    not a default handler. -
    +

    XML_ExpatVersion

    +
     XML_LChar * XMLCALL
     XML_ExpatVersion();
     
    @@ -2242,7 +2542,8 @@

    Miscellaneous functions

    Return the library version as a string (e.g. "expat_1.95.1"). -
    +

    XML_ExpatVersionInfo

    +
     struct XML_Expat_Version XMLCALL
     XML_ExpatVersionInfo();
     
    @@ -2266,7 +2567,8 @@

    Miscellaneous functions

    particular parts of the Expat API are available. -
    +

    XML_GetFeatureList

    +
     const XML_Feature * XMLCALL
     XML_GetFeatureList();
     
    @@ -2299,7 +2601,7 @@

    Miscellaneous functions

    The return value is an array of XML_Feature, terminated by a record with a feature of -XML_FEATURE_END and name of NULL, +XML_FEATURE_END and name of NULL, identifying the feature-test macros Expat was compiled with. Since an application that requires this kind of information needs to determine the type of character the name points to, records for the @@ -2327,7 +2629,8 @@

    Miscellaneous functions

    -
    +

    XML_FreeContentModel

    +
     void XMLCALL
     XML_FreeContentModel(XML_Parser parser, XML_Content *model);
     
    @@ -2346,19 +2649,21 @@

    Miscellaneous functions

    libraries which use different C standard libraries (this can happen on Windows, at least).

    -
    +

    XML_MemMalloc

    +
     void * XMLCALL
     XML_MemMalloc(XML_Parser parser, size_t size);
     
    Allocate size bytes of memory using the allocator the parser object has been configured to use. Returns a -pointer to the memory or NULL on failure. Memory allocated in this +pointer to the memory or NULL on failure. Memory allocated in this way must be freed using XML_MemFree.
    -
    +

    XML_MemRealloc

    +
     void * XMLCALL
     XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
     
    @@ -2367,9 +2672,9 @@

    Miscellaneous functions

    parser object has been configured to use. ptr must point to a block of memory allocated by XML_MemMalloc or -XML_MemRealloc, or be NULL. This function tries to +XML_MemRealloc, or be NULL. This function tries to expand the block pointed to by ptr if possible. Returns -a pointer to the memory or NULL on failure. On success, the original +a pointer to the memory or NULL on failure. On success, the original block has either been expanded or freed. On failure, the original block has not been freed; the caller is responsible for freeing the original block. Memory allocated in this way must be freed using @@ -2377,20 +2682,24 @@

    Miscellaneous functions

    >XML_MemFree. -
    +

    XML_MemFree

    +
     void XMLCALL
     XML_MemFree(XML_Parser parser, void *ptr);
     
    Free a block of memory pointed to by ptr. The block must have been allocated by XML_MemMalloc or XML_MemRealloc, or be NULL. +>XML_MemMalloc or XML_MemRealloc, or be NULL.

    -

    Valid XHTML 1.0!

    + + + diff --git a/3rdparty/expat/doc/style.css b/3rdparty/expat/doc/style.css index 69df30bcecb29..1b8cd10dffa4f 100644 --- a/3rdparty/expat/doc/style.css +++ b/3rdparty/expat/doc/style.css @@ -1,101 +1,47 @@ +/* + __ __ _ + ___\ \/ /_ __ __ _| |_ + / _ \\ /| '_ \ / _` | __| + | __// \| |_) | (_| | |_ + \___/_/\_\ .__/ \__,_|\__| + |_| XML parser + + Copyright (c) 2000 Clark Cooper + Copyright (c) 2000-2004 Fred L. Drake, Jr. + Copyright (c) 2021 Sebastian Pipping + Licensed under the MIT license: + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to permit + persons to whom the Software is furnished to do so, subject to the + following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/* Stop not using half the screen */ body { - background-color: white; - border: 0px; - margin: 0px; - padding: 0px; -} - -.corner { - width: 200px; - height: 80px; - text-align: center; -} - -.banner { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-left: 2em; -} - -.banner h1 { - font-size: 200%; -} - -.content { - padding: 0em 2em 1em 2em; -} - -.releaseno { - background-color: rgb(110,139,61); - color: rgb(255,236,176); - padding-bottom: 0.3em; - padding-top: 0.5em; - text-align: center; - font-weight: bold; -} - -.noborder { - border-width: 0px; -} - -.eg { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: tan; - margin-left: 2em; - margin-right: 10%; -} - -.pseudocode { - padding-left: 1em; - padding-top: .5em; - padding-bottom: .5em; - border: solid thin; - margin: 1em 0; - background-color: rgb(250,220,180); - margin-left: 2em; - margin-right: 10%; -} - -.handler { - width: 100%; - border-top-width: thin; - margin-bottom: 1em; -} - -.handler p { - margin-left: 2em; -} - -.setter { - font-weight: bold; -} - -.signature { - color: navy; -} - -.fcndec { - width: 100%; - border-top-width: thin; - font-weight: bold; -} - -.fcndef { - margin-left: 2em; - margin-bottom: 2em; -} - -dd { - margin-bottom: 2em; + max-width: none; /* was: 80ch */ } .cpp-symbols dt { font-family: monospace; } -.cpp-symbols dd { - margin-bottom: 1em; + +/* Resemble style of