Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Mar 14, 2024
2 parents a1ea56d + 663464d commit 28722e6
Show file tree
Hide file tree
Showing 121 changed files with 5,901 additions and 1,459 deletions.
8 changes: 7 additions & 1 deletion 3rdparty/bx/src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,13 @@ namespace bx
// NativeClient: NaCl module load failed: Validation failure. File violates Native Client safety rules.
__asm__ ("int $3");
#elif BX_PLATFORM_EMSCRIPTEN
emscripten_log(EM_LOG_CONSOLE | EM_LOG_ERROR | EM_LOG_C_STACK | EM_LOG_JS_STACK | EM_LOG_DEMANGLE, "debugBreak!");
emscripten_log(0
| EM_LOG_CONSOLE
| EM_LOG_ERROR
| EM_LOG_C_STACK
| EM_LOG_JS_STACK
, "debugBreak!"
);
// Doing emscripten_debugger() disables asm.js validation due to an emscripten bug
//emscripten_debugger();
EM_ASM({ debugger; });
Expand Down
6 changes: 3 additions & 3 deletions docs/source/commandline/commandline-all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3989,7 +3989,7 @@ Core Misc Options
Specifies the type of UI to use, either ``simple`` or ``cabinet``.
The default is Cabinet (**-ui cabinet**).
The default is cabinet (**-ui cabinet**).
Example:
.. code-block:: bash
Expand Down Expand Up @@ -4025,9 +4025,9 @@ Core Misc Options
**\-[no]ui_mouse**
Displays a mouse cursor when using the built-in UI for MAME.
Displays a mouse cursor when using the built-in MAME user interface.
The default is (**-noui_mouse**).
The default is ON (**-ui_mouse**).
.. _mame-commandline-language:
Expand Down
5 changes: 3 additions & 2 deletions docs/source/initialsetup/compilingmame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,9 @@ TOOLS
Set to **1** to build additional tools along with the emulator, including
**unidasm**, **chdman**, **romcmp**, and **srcclean**.
EMULATOR
Set to **0** along with **TOOLS=1** to build *only* the tools and not the
main MAME emulator itself.
When set to **0**, the main emulator target will not be created. This is
intended to be used in conjunction with setting **TOOLS** to **1** to build
the additional tools without building the emulator.
NO_OPENGL
Set to **1** to disable building the OpenGL video output module.
NO_USE_PORTAUDIO
Expand Down
16 changes: 16 additions & 0 deletions hash/cdi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,22 @@ license:CC0-1.0
</part>
</software>

<software name="hotmariop" cloneof="hotmario">
<!--
Origin: Redump
<rom name="Hotel Mario (USA) (Beta) (1993-11-23).bin" size="367217760" crc="05ccadda" md5="8fb67e208d6ca91d83415566db5b7d15" sha1="183b2efd1f5b926757a8fb514cc861fdf7a244c5" />
<rom name="Hotel Mario (USA) (Beta) (1993-11-23).cue" size="101" crc="e577f8e3" md5="83f41478963317af4e44bdd2dcb89c0c" sha1="6d3a84b2333dd6f3ebb382ce896c067ddaf077aa" />
-->
<description>Hotel Mario (prototype v0.09, 19931123)</description>
<year>1994</year>
<publisher>Philips</publisher>
<part name="cdrom" interface="cdi_cdrom">
<diskarea name="cdrom">
<disk name="hotel mario (prototype v 0.09, 19931123)" sha1="3f0375fb2c74b9abc7c4eb8ef0b3f907b70307cb"/>
</diskarea>
</part>
</software>

<software name="hotmariou" cloneof="hotmario">
<!--
Origin: TOSEC
Expand Down
3 changes: 3 additions & 0 deletions scripts/genie.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,9 @@ configuration { "asmjs" }
"-std=c++17",
"-s EXCEPTION_CATCHING_ALLOWED=\"['_ZN15running_machine17start_all_devicesEv','_ZN12cli_frontend7executeEiPPc','_ZN8chd_file11open_commonEb','_ZN8chd_file13read_metadataEjjRNSt3__212basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE','_ZN8chd_file13read_metadataEjjRNSt3__26vectorIhNS0_9allocatorIhEEEE','_ZNK19netlist_mame_device19base_validity_checkER16validity_checker']\"",
}
defines {
"ASIO_HAS_PTHREADS",
}
linkoptions {
"-Wl,--start-group",
"-O" .. _OPTIONS["OPTIMIZE"],
Expand Down
4 changes: 4 additions & 0 deletions scripts/src/bus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2992,6 +2992,8 @@ if (BUSES["A2BUS"]~=null) then
MAME_DIR .. "src/devices/bus/a2bus/romcard.h",
MAME_DIR .. "src/devices/bus/a2bus/sider.cpp",
MAME_DIR .. "src/devices/bus/a2bus/sider.h",
MAME_DIR .. "src/devices/bus/a2bus/snesmax.cpp",
MAME_DIR .. "src/devices/bus/a2bus/snesmax.h",
MAME_DIR .. "src/devices/bus/a2bus/softcard3.cpp",
MAME_DIR .. "src/devices/bus/a2bus/softcard3.h",
MAME_DIR .. "src/devices/bus/a2bus/ssbapple.cpp",
Expand Down Expand Up @@ -5522,6 +5524,8 @@ if (BUSES["PCI"]~=null) then
MAME_DIR .. "src/devices/bus/pci/rtl8029as_pci.h",
MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.cpp",
MAME_DIR .. "src/devices/bus/pci/rtl8139_pci.h",
MAME_DIR .. "src/devices/bus/pci/sis6326.cpp",
MAME_DIR .. "src/devices/bus/pci/sis6326.h",
MAME_DIR .. "src/devices/bus/pci/sonicvibes.cpp",
MAME_DIR .. "src/devices/bus/pci/sonicvibes.h",
MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp",
Expand Down
2 changes: 2 additions & 0 deletions scripts/src/cpu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2953,6 +2953,8 @@ local want_disasm_z80 = opt_tool(CPUS, "Z80")
local want_disasm_kc80 = opt_tool(CPUS, "KC80")

if want_disasm_z80 or want_disasm_kc80 then
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/z80/r800dasm.cpp")
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/z80/r800dasm.h")
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/z80/z80dasm.cpp")
table.insert(disasm_files , MAME_DIR .. "src/devices/cpu/z80/z80dasm.h")
end
Expand Down
12 changes: 12 additions & 0 deletions scripts/src/machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4475,6 +4475,18 @@ if (MACHINES["FDC37C93X"]~=null) then
}
end

---------------------------------------------------
--
--@src/devices/machine/it8705f.h,MACHINES["IT8705F"] = true
---------------------------------------------------

if (MACHINES["IT8705F"]~=null) then
files {
MAME_DIR .. "src/devices/machine/it8705f.cpp",
MAME_DIR .. "src/devices/machine/it8705f.h",
}
end

---------------------------------------------------
--
--@src/devices/machine/pc87306.h,MACHINES["PC87306"] = true
Expand Down
4 changes: 4 additions & 0 deletions src/devices/bus/a2bus/cards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
#include "ramcard16k.h"
#include "romcard.h"
#include "sider.h"
#include "snesmax.h"
#include "softcard3.h"
#include "ssbapple.h"
#include "ssprite.h"
Expand Down Expand Up @@ -136,6 +137,7 @@ void apple2_cards(device_slot_interface &device)
device.option_add("ssprite", A2BUS_SSPRITE); // Synetix SuperSprite Board
device.option_add("ssbapple", A2BUS_SSBAPPLE); // SSB Apple speech board
device.option_add("4play", A2BUS_4PLAY); // 4Play Joystick Card (Rev. B)
device.option_add("snesmax", A2BUS_SNES_MAX); // SNES MAX controller adapter
device.option_add("ceyes2", A2BUS_COMPUTEREYES2); // ComputerEyes/2 Video Digitizer
device.option_add("twarp", A2BUS_TRANSWARP); // AE TransWarp accelerator
device.option_add("applesurance", A2BUS_APPLESURANCE); // Applesurance Diagnostic Controller
Expand Down Expand Up @@ -212,6 +214,7 @@ void apple2e_cards(device_slot_interface &device)
device.option_add("twarp", A2BUS_TRANSWARP); // AE TransWarp accelerator
device.option_add("vulcan", A2BUS_VULCANIIE); // Applied Engineering Vulcan IDE drive
device.option_add("4play", A2BUS_4PLAY); // 4Play Joystick Card (Rev. B)
device.option_add("snesmax", A2BUS_SNES_MAX); // SNES MAX controller adapter
device.option_add("ceyes2", A2BUS_COMPUTEREYES2); // ComputerEyes/2 Video Digitizer
device.option_add("applesurance", A2BUS_APPLESURANCE); // Applesurance Diagnostic Controller
device.option_add("byte8251", A2BUS_BYTE8251); // BYTE Magazine 8251 serial card
Expand Down Expand Up @@ -286,6 +289,7 @@ void apple2gs_cards(device_slot_interface &device)
device.option_add("vulcan", A2BUS_VULCAN); // Applied Engineering Vulcan IDE drive
device.option_add("vulcangold", A2BUS_VULCANGOLD); // Applied Engineering Vulcan Gold IDE drive
device.option_add("4play", A2BUS_4PLAY); // 4Play Joystick Card (Rev. B)
device.option_add("snesmax", A2BUS_SNES_MAX); // SNES MAX controller adapter
// device.option_add("magicmusician", A2BUS_MAGICMUSICIAN); // Magic Musician Card
// device.option_add("pcxport", A2BUS_PCXPORTER); // Applied Engineering PC Transporter
device.option_add("byte8251", A2BUS_BYTE8251); // BYTE Magazine 8251 serial card
Expand Down
97 changes: 97 additions & 0 deletions src/devices/bus/a2bus/snesmax.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#include "emu.h"
#include "snesmax.h"

#include "bus/snes_ctrl/ctrl.h"

namespace {

class a2bus_snes_max_device : public device_t, public device_a2bus_card_interface
{
public:
a2bus_snes_max_device(
machine_config const &mconfig,
char const *tag,
device_t *owner,
u32 clock) :
device_t(mconfig, A2BUS_SNES_MAX, tag, owner, clock),
device_a2bus_card_interface(mconfig, *this),
m_controllers(*this, "%u", 1U),
m_latch_timer(nullptr),
m_data(0xff)
{
}

virtual u8 read_c0nx(u8 offset) override
{
return m_data;
}

virtual void write_c0nx(u8 offset, u8 data) override
{
if (BIT(offset, 0))
{
m_data =
(m_controllers[0]->read_pin4() ? 0x00 : 0x80) |
(m_controllers[1]->read_pin4() ? 0x00 : 0x40) |
0x3f;
}
else
{
machine().scheduler().synchronize(timer_expired_delegate(FUNC(a2bus_snes_max_device::set_latch), this), 0);
}
}

virtual bool take_c800() override
{
return false;
}

protected:
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD
{
SNES_CONTROL_PORT(config, m_controllers[0], snes_control_port_devices, "joypad");
SNES_CONTROL_PORT(config, m_controllers[1], snes_control_port_devices, "joypad");
}

virtual void device_start() override ATTR_COLD
{
m_latch_timer = timer_alloc(FUNC(a2bus_snes_max_device::reset_latch), this);

m_data = 0xff;

save_item(NAME(m_data));

m_controllers[0]->write_strobe(0);
m_controllers[1]->write_strobe(0);
}

private:
TIMER_CALLBACK_MEMBER(set_latch)
{
m_controllers[0]->write_strobe(1);
m_controllers[1]->write_strobe(1);
m_latch_timer->adjust(attotime::from_ticks(7, clock()));
}

TIMER_CALLBACK_MEMBER(reset_latch)
{
m_controllers[0]->write_strobe(0);
m_controllers[1]->write_strobe(0);

m_data =
(m_controllers[0]->read_pin4() ? 0x00 : 0x80) |
(m_controllers[1]->read_pin4() ? 0x00 : 0x40) |
0x3f;
}

required_device_array<snes_control_port_device, 2> m_controllers;
emu_timer *m_latch_timer;
u8 m_data;
};

} // anonymous namespace


DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_SNES_MAX, device_a2bus_card_interface, a2bus_snes_max_device, "a2snesmax", "SNES MAX Game Controller Interface")
20 changes: 20 additions & 0 deletions src/devices/bus/a2bus/snesmax.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
/***********************************************************************
Homebrew dual SNES controller interface by Lukazi
https://lukazi.blogspot.com/2021/06/game-controller-snes-max-snes.html
***********************************************************************/
#ifndef MAME_BUS_A2BUS_SNESMAX_H
#define MAME_BUS_A2BUS_SNESMAX_H

#pragma once

#include "a2bus.h"


DECLARE_DEVICE_TYPE(A2BUS_SNES_MAX, device_a2bus_card_interface)

#endif // MAME_BUS_A2BUS_SNESMAX_H
32 changes: 3 additions & 29 deletions src/devices/bus/cpc/cpc_ssa1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ uint8_t cpc_ssa1_device::ssa1_r()
{
uint8_t ret = 0xff;

if(get_sby() == 0)
if(!m_sp0256_device->sby_r())
ret &= ~0x80;

if(get_lrq() != 0)
if(m_sp0256_device->lrq_r())
ret &= ~0x40;

return ret;
Expand All @@ -50,7 +50,7 @@ uint8_t cpc_dkspeech_device::dkspeech_r()

// SBY is not connected

if(get_lrq() != 0)
if(m_sp0256_device->lrq_r())
ret &= ~0x80;

return ret;
Expand All @@ -61,26 +61,6 @@ void cpc_dkspeech_device::dkspeech_w(uint8_t data)
m_sp0256_device->ald_w(data & 0x3f);
}

void cpc_ssa1_device::lrq_cb(int state)
{
set_lrq(state);
}

void cpc_ssa1_device::sby_cb(int state)
{
set_sby(state);
}

void cpc_dkspeech_device::lrq_cb(int state)
{
set_lrq(state);
}

void cpc_dkspeech_device::sby_cb(int state)
{
set_sby(state);
}

//-------------------------------------------------
// Device ROM definition
//-------------------------------------------------
Expand Down Expand Up @@ -119,8 +99,6 @@ void cpc_ssa1_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "mono").front_center();
SP0256(config, m_sp0256_device, XTAL(3'120'000));
m_sp0256_device->data_request_callback().set(FUNC(cpc_ssa1_device::lrq_cb));
m_sp0256_device->standby_callback().set(FUNC(cpc_ssa1_device::sby_cb));
m_sp0256_device->add_route(ALL_OUTPUTS, "mono", 1.00);

// pass-through
Expand All @@ -134,8 +112,6 @@ void cpc_dkspeech_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "mono").front_center();
SP0256(config, m_sp0256_device, DERIVED_CLOCK(1, 1)); // uses the CPC's clock from pin 50 of the expansion port
m_sp0256_device->data_request_callback().set(FUNC(cpc_dkspeech_device::lrq_cb));
m_sp0256_device->standby_callback().set(FUNC(cpc_dkspeech_device::sby_cb));
m_sp0256_device->add_route(ALL_OUTPUTS, "mono", 1.00);

// pass-through
Expand All @@ -153,15 +129,13 @@ void cpc_dkspeech_device::device_add_mconfig(machine_config &config)
cpc_ssa1_device::cpc_ssa1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CPC_SSA1, tag, owner, clock),
device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rom(nullptr),
m_lrq(1), m_sby(0),
m_sp0256_device(*this,"sp0256")
{
}

cpc_dkspeech_device::cpc_dkspeech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, CPC_DKSPEECH, tag, owner, clock),
device_cpc_expansion_card_interface(mconfig, *this), m_slot(nullptr), m_rom(nullptr),
m_lrq(1), m_sby(0),
m_sp0256_device(*this,"sp0256")
{
}
Expand Down
Loading

0 comments on commit 28722e6

Please sign in to comment.