From ce27172609ba56b3da0bf123478ff7fa80eefbfa Mon Sep 17 00:00:00 2001 From: David Haywood Date: Sat, 19 Mar 2016 15:02:30 +0000 Subject: [PATCH 1/6] new Software List entry gamate.xml: GP Race [Peter Wilhelmsen] --- hash/gamate.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hash/gamate.xml b/hash/gamate.xml index 45f60522c88..ee0400f09e4 100644 --- a/hash/gamate.xml +++ b/hash/gamate.xml @@ -520,6 +520,18 @@ C1066 - ?? + + GP Race + 1992 + Bit Corporation + + + + + + + + Fantasy Travel 1993 From d2fe9e454bac716fb5f61ae2cbc2f776ed9daedb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 19 Mar 2016 14:39:10 +0100 Subject: [PATCH 2/6] Revert "Don't invoke VLA unnecessarily" This reverts commit 9a299f35f3d01113756a425561c4ed041f19ed39. --- src/osd/modules/font/font_sdl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osd/modules/font/font_sdl.cpp b/src/osd/modules/font/font_sdl.cpp index 31ba1f13ba3..c6f45635623 100644 --- a/src/osd/modules/font/font_sdl.cpp +++ b/src/osd/modules/font/font_sdl.cpp @@ -199,7 +199,7 @@ osd_font_sdl::TTF_Font_ptr osd_font_sdl::TTF_OpenFont_Magic(std::string const &n unsigned char const ttf_magic[] = { 0x00, 0x01, 0x00, 0x00, 0x00 }; unsigned char const ttc1_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x01, 0x00, 0x00 }; unsigned char const ttc2_magic[] = { 0x74, 0x74, 0x63, 0x66, 0x00, 0x02, 0x00, 0x00 }; - constexpr auto buffer_size = std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) }); + auto buffer_size = std::max({ sizeof(ttf_magic), sizeof(ttc1_magic), sizeof(ttc2_magic) }); unsigned char buffer[buffer_size]; auto const bytes_read = file.read(buffer, buffer_size); file.close(); From 65906009904604247c3b0a5d09afdc1ba7432a43 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 19 Mar 2016 14:47:10 +0100 Subject: [PATCH 3/6] Added support for Raspberry Pi cross-compile (nw) --- makefile | 25 +++++++++++++++++++++++++ scripts/genie.lua | 9 ++++++++- scripts/toolchain.lua | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/makefile b/makefile index b065c4480c8..4f88a0403d2 100644 --- a/makefile +++ b/makefile @@ -844,6 +844,7 @@ FULLTARGET := $(TARGET)$(SUBTARGET) endif PROJECTDIR := $(BUILDDIR)/projects/$(OSD)/$(FULLTARGET) PROJECTDIR_MINI := $(BUILDDIR)/projects/osdmini/$(FULLTARGET) +PROJECTDIR_SDL := $(BUILDDIR)/projects/sdl/$(FULLTARGET) PROJECTDIR_WIN := $(BUILDDIR)/projects/windows/$(FULLTARGET) .PHONY: all clean regenie generate @@ -1306,6 +1307,30 @@ steamlink: generate $(PROJECTDIR)/gmake-steamlink/Makefile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-steamlink config=$(CONFIG) precompile $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR)/gmake-steamlink config=$(CONFIG) +#------------------------------------------------- +# gmake-rpi +#------------------------------------------------- + +$(PROJECTDIR_SDL)/gmake-rpi/Makefile: makefile $(SCRIPTS) $(GENIE) +ifndef RASPBERRY_SDK_PATH + $(error RASPBERRY_SDK_PATH is not set) +endif +ifndef RASPBERRY_SYSROOT + $(error RASPBERRY_SYSROOT is not set) +endif + $(SILENT) $(GENIE) $(PARAMS) --gcc=rpi --gcc_version=4.9.2 --osd=sdl --targetos=rpi --targetos=rpi --NO_USE_MIDI=1 --PLATFORM=arm --NOASM=1 --USE_QTDEBUG=0 --SDL_INSTALL_ROOT=$(RASPBERRY_SYSROOT)/usr gmake + +.PHONY: rpi +ifndef RASPBERRY_SDK_PATH + $(error RASPBERRY_SDK_PATH is not set) +endif +ifndef RASPBERRY_SYSROOT + $(error RASPBERRY_SYSROOT is not set) +endif +rpi: generate $(PROJECTDIR_SDL)/gmake-rpi/Makefile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-rpi config=$(CONFIG) precompile + $(SILENT) $(MAKE) $(MAKEPARAMS) -C $(PROJECTDIR_SDL)/gmake-rpi config=$(CONFIG) + #------------------------------------------------- # cmake #------------------------------------------------- diff --git a/scripts/genie.lua b/scripts/genie.lua index 0a7c79d5825..ff6872a5f36 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -114,6 +114,7 @@ newoption { { "haiku", "Haiku" }, { "solaris", "Solaris SunOS" }, { "steamlink", "Steam Link" }, + { "rpi", "Raspberry Pi" }, }, } @@ -1098,7 +1099,7 @@ configuration { "pnacl" } } archivesplit_size "20" -configuration { "linux-*" } +configuration { "linux-* or rpi"} links { "dl", "rt", @@ -1123,6 +1124,12 @@ configuration { "steamlink" } "EGL_API_FB", } +configuration { "rpi" } + links { + "SDL2", + "fontconfig", + } + configuration { "osx* or xcode4" } links { "pthread", diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 0181f14616f..072f4b214ea 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -245,6 +245,16 @@ function toolchain(_buildDir, _subDir) location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-steamlink") end + if "rpi" == _OPTIONS["gcc"] then + if not os.getenv("RASPBERRY_SDK_PATH") then + print("Set RASPBERRY_SDK_PATH envrionment variable.") + end + premake.gcc.cc = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-gcc" + premake.gcc.cxx = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-g++" + premake.gcc.ar = "$(RASPBERRY_SDK_PATH)/bin/arm-linux-gnueabihf-ar" + location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-rpi") + end + if "mingw32-gcc" == _OPTIONS["gcc"] then if not os.getenv("MINGW32") then print("Set MINGW32 envrionment variable.") @@ -511,6 +521,37 @@ function toolchain(_buildDir, _subDir) configuration { "steamlink", "Debug" } targetdir (_buildDir .. "steamlink/bin/Debug") + configuration { "rpi" } + objdir ( _buildDir .. "rpi/obj") + libdirs { + "$(RASPBERRY_SYSROOT)/opt/vc/lib", + } + includedirs { + "$(RASPBERRY_SYSROOT)/opt/vc/include", + "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vcos/pthreads", + "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vmcs_host/linux", + } + links { + "rt", + } + linkoptions { + "-Wl,--gc-sections", + } + buildoptions { + "--sysroot=$(RASPBERRY_SYSROOT)", + } + linkoptions { + "-static-libgcc", + "-static-libstdc++", + "--sysroot=$(RASPBERRY_SYSROOT)", + } + + configuration { "rpi", "Release" } + targetdir (_buildDir .. "rpi/bin/Release") + + configuration { "rpi", "Debug" } + targetdir (_buildDir .. "rpi/bin/Debug") + configuration { "mingw-clang" } linkoptions { "-Wl,--allow-multiple-definition", From 95a2e4c2c6b8bfa4262a4659ce3647aafaa323fb Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 19 Mar 2016 16:09:00 +0100 Subject: [PATCH 4/6] compile BGFX for RPI as well (nw) --- scripts/genie.lua | 7 +++++++ scripts/src/3rdparty.lua | 8 ++++++++ scripts/src/main.lua | 3 +++ scripts/toolchain.lua | 6 +++--- src/osd/modules/render/drawbgfx.cpp | 2 +- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/genie.lua b/scripts/genie.lua index ff6872a5f36..44339afb921 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1128,6 +1128,13 @@ configuration { "rpi" } links { "SDL2", "fontconfig", + "X11", + "GLESv2", + "EGL", + "bcm_host", + "vcos", + "vchiq_arm", + "pthread", } configuration { "osx* or xcode4" } diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 525789a92f1..c4d93c73348 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -726,6 +726,14 @@ end "-Wno-uninitialized", "-Wno-unused-function", } + configuration { "rpi" } + buildoptions { + "-Wno-unused-but-set-variable", + "-Wno-unused-variable", + } + defines { + "__STDC_VERSION__=199901L", + } configuration { } diff --git a/scripts/src/main.lua b/scripts/src/main.lua index 18a5b28210f..a517c39092b 100644 --- a/scripts/src/main.lua +++ b/scripts/src/main.lua @@ -103,6 +103,9 @@ end configuration { "mingw*" or "vs*" } targetextension ".exe" + configuration { "rpi" } + targetextension "" + configuration { "asmjs" } targetextension ".bc" if os.getenv("EMSCRIPTEN") then diff --git a/scripts/toolchain.lua b/scripts/toolchain.lua index 072f4b214ea..408237d783e 100644 --- a/scripts/toolchain.lua +++ b/scripts/toolchain.lua @@ -531,9 +531,9 @@ function toolchain(_buildDir, _subDir) "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vcos/pthreads", "$(RASPBERRY_SYSROOT)/opt/vc/include/interface/vmcs_host/linux", } - links { - "rt", - } + defines { + "__VCCOREVER__=0x04000000", -- There is no special prefedined compiler symbol to detect RaspberryPi, faking it. + } linkoptions { "-Wl,--gc-sections", } diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp index b9e3c2626e6..88257150abd 100644 --- a/src/osd/modules/render/drawbgfx.cpp +++ b/src/osd/modules/render/drawbgfx.cpp @@ -84,7 +84,7 @@ static void* sdlNativeWindowHandle(SDL_Window* _window) return nullptr; } -# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD +# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD || BX_PLATFORM_RPI return (void*)wmi.info.x11.window; # elif BX_PLATFORM_OSX return wmi.info.cocoa.window; From 0be0eb6d5f3ef5f67629e6fc2944047952d9e07c Mon Sep 17 00:00:00 2001 From: Cowering Date: Sat, 19 Mar 2016 10:20:30 -0500 Subject: [PATCH 5/6] A few info updates for A7800 (nw) --- src/devices/bus/a7800/a78_slot.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/devices/bus/a7800/a78_slot.cpp b/src/devices/bus/a7800/a78_slot.cpp index 53541560fa4..65b32272820 100644 --- a/src/devices/bus/a7800/a78_slot.cpp +++ b/src/devices/bus/a7800/a78_slot.cpp @@ -275,7 +275,7 @@ int a78_cart_slot_device::validate_header(int head, bool log) { if (log) { - osd_printf_info("Unsupported mapper, please contact MESSdevs (Header 0x%X)\n", head); + osd_printf_info("Unsupported mapper, please contact MAMEdevs (Header 0x%X)\n", head); osd_printf_info("Disabling special bits\n"); } head &= 0x00ff; @@ -414,7 +414,7 @@ bool a78_cart_slot_device::call_load() break; } - // check if cart has a POKEY at $0450 (typically a VersaBoard variant)! + // check if cart has a POKEY at $0450 (typically a VersaBoard variant) if (mapper & 0x40) { if (m_type != A78_TYPE2) @@ -434,13 +434,13 @@ bool a78_cart_slot_device::call_load() if (head[58] == 1) { - osd_printf_info("This cart support external NVRAM savings, using HSC.\n"); + osd_printf_info("This cart supports external NVRAM using HSC.\n"); osd_printf_info("Run it with the High Score Cart mounted to exploit this feature.\n"); } else if (head[58] == 2) { - osd_printf_info("This cart support external NVRAM savings, using SaveKey.\n"); - osd_printf_info("This is not supported in MESS currently.\n"); + osd_printf_info("This cart supports external NVRAM using SaveKey.\n"); + osd_printf_info("This is not supported in MAME currently.\n"); } if (head[63]) @@ -714,12 +714,12 @@ WRITE8_MEMBER(a78_cart_slot_device::write_40xx) bit 3 [0x08] - bank 0 of 144K ROM at $4000 bit 4 [0x10] - bank 6 at $4000 bit 5 [0x20] - banked RAM at $4000 + bit 6 [0x40] - POKEY at $0450 bit 8-15 - Special values - 0 = Normal cart + 0 = Normal cart // normal compared to what? perhaps this should be 'unused' 1 = Absolute (F18 Hornet) 2 = Activision (Double Dragon & Rampage) - 3 = POKEY at $0450 -------------------------------------------------*/ @@ -817,6 +817,7 @@ void a78_cart_slot_device::internal_header_logging(UINT8 *header, UINT32 len) logerror( "\t\tbank0 at $4000: %s\n", BIT(head_mapper, 3) ? "Yes" : "No"); logerror( "\t\tbank6 at $4000: %s\n", BIT(head_mapper, 4) ? "Yes" : "No"); logerror( "\t\tbanked RAM: %s\n", BIT(head_mapper, 5) ? "Yes" : "No"); + logerror( "\t\tPOKEY at $450: %s\n", BIT(head_mapper, 6) ? "Yes" : "No"); logerror( "\t\tSpecial: %s ", (head_mapper & 0xff00) ? "Yes" : "No"); if (head_mapper & 0xff00) { From 030f37b94c9ff8f62aaa5d745b301c4cfb1c26d8 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 19 Mar 2016 16:25:10 +0100 Subject: [PATCH 6/6] The patch mainly adds software list support for the Master Gear adapter, used by the Game Gear driver, and removes two entries of the SMS software list that are just homebrew hacks [Enik] --- hash/gamegear.xml | 4 ++-- hash/sms.xml | 22 ---------------------- src/devices/bus/sega8/mgear.cpp | 11 +++++++++-- src/devices/bus/sms_ctrl/rfu.cpp | 5 ++++- src/devices/bus/sms_ctrl/sports.cpp | 12 +++++++++--- src/devices/bus/sms_ctrl/sportsjp.cpp | 2 +- src/devices/bus/sms_ctrl/sportsjp.h | 5 ----- src/devices/bus/sms_exp/gender.cpp | 7 +++++++ 8 files changed, 32 insertions(+), 36 deletions(-) diff --git a/hash/gamegear.xml b/hash/gamegear.xml index 1caac2b5e7c..415ca0f4d42 100644 --- a/hash/gamegear.xml +++ b/hash/gamegear.xml @@ -9993,14 +9993,14 @@ a certain item) --> - Master Gear Adapter + Master Gear Converter 1991 Sega - + diff --git a/hash/sms.xml b/hash/sms.xml index d855b7d69d9..4a5e8e0bc2d 100644 --- a/hash/sms.xml +++ b/hash/sms.xml @@ -2376,17 +2376,6 @@ - - Felipe em Acao (Bra) - 19?? - Tec Toy - - - - - - - Férias Frustradas do Pica-Pau (Bra) 1996 @@ -6720,17 +6709,6 @@ - - Treinamento Do Mymo (Bra) - 19?? - Tec Toy - - - - - - - Trivial Pursuit - Genus Edition (Euro) 1992 diff --git a/src/devices/bus/sega8/mgear.cpp b/src/devices/bus/sega8/mgear.cpp index d6b8c91c6cf..c579f1439d4 100644 --- a/src/devices/bus/sega8/mgear.cpp +++ b/src/devices/bus/sega8/mgear.cpp @@ -2,10 +2,16 @@ // copyright-holders:Fabio Priuli /*********************************************************************************************************** - Master Gear Adapter emulation + Master Gear Converter emulation ***********************************************************************************************************/ +// The Master Gear Converter, also known as Master Gear, Gear Master Converter +// or (in Brazil) as Master Gear Adaptor, allows to plug western SMS cartridges +// on the Game Gear, by enabling the SMS compatibility mode on the Game Gear +// cartridge slot. Some SMS games have compatibility issues, confirmed on the +// real hardware, when run on the Game Gear. + #include "emu.h" #include "mgear.h" @@ -18,7 +24,7 @@ const device_type SEGA8_ROM_MGEAR = &device_creator; sega8_mgear_device::sega8_mgear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sega8_rom_device(mconfig, SEGA8_ROM_MGEAR, "Master Gear Adapter", tag, owner, clock, "sega8_mgear", __FILE__), + : sega8_rom_device(mconfig, SEGA8_ROM_MGEAR, "Master Gear Converter", tag, owner, clock, "sega8_mgear", __FILE__), m_subslot(*this, "subslot") { } @@ -38,6 +44,7 @@ void sega8_mgear_device::device_reset() static MACHINE_CONFIG_FRAGMENT( sub_slot ) MCFG_SMS_CARTRIDGE_ADD("subslot", sms_cart, nullptr) + MCFG_SOFTWARE_LIST_ADD("cart_list","sms") MACHINE_CONFIG_END machine_config_constructor sega8_mgear_device::device_mconfig_additions() const diff --git a/src/devices/bus/sms_ctrl/rfu.cpp b/src/devices/bus/sms_ctrl/rfu.cpp index 2b43b31a6b8..0ccc5ae4e9c 100644 --- a/src/devices/bus/sms_ctrl/rfu.cpp +++ b/src/devices/bus/sms_ctrl/rfu.cpp @@ -6,6 +6,9 @@ **********************************************************************/ +// This emulated device is the version released by Sega. In Brazil, Tec Toy +// released a version that does not have any switch to turn on/off auto-repeat. + #include "rfu.h" @@ -16,7 +19,7 @@ const device_type SMS_RAPID_FIRE = &device_creator; - +// time interval not verified #define RAPID_FIRE_INTERVAL attotime::from_hz(10) diff --git a/src/devices/bus/sms_ctrl/sports.cpp b/src/devices/bus/sms_ctrl/sports.cpp index 68a2b142eec..77356cec41f 100644 --- a/src/devices/bus/sms_ctrl/sports.cpp +++ b/src/devices/bus/sms_ctrl/sports.cpp @@ -7,11 +7,17 @@ **********************************************************************/ // The games designed for the US model of the Sports Pad controller use the -// TH line of the controller port as output, to select which nibble, of the -// two axis bytes, will be read at a time. The Japanese cartridge Sports Pad -// Soccer uses a different mode, because the Sega Mark III lacks TH output, so +// TH line of the controller port to select which nibble, of the two axis +// bytes, will be read at a time. The Japanese cartridge Sports Pad Soccer +// uses a different mode, because the Sega Mark III lacks the TH line, so // there is a different Sports Pad model released in Japan (see sportsjp.c). +// The Japanese SMS has the TH line connected, but doesn't report TH input +// on port 0xDD. However, a magazine raffled the US Sports Pad along with a +// Great Ice Hockey cartridge, in Japanese format, to owners of that console. +// So, Great Ice Hockey seems to just need TH pin as output to work, while +// other games designed for the US Sports Pad don't work on the Japanese SMS. + // It was discovered that games designed for the Paddle Controller, released // in Japan, switch to a mode incompatible with the original Paddle when // detect the system region as Export. Similar to how the US model of the diff --git a/src/devices/bus/sms_ctrl/sportsjp.cpp b/src/devices/bus/sms_ctrl/sportsjp.cpp index 260654c7dac..16c5198721c 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.cpp +++ b/src/devices/bus/sms_ctrl/sportsjp.cpp @@ -8,7 +8,7 @@ // The Japanese Sports Pad controller is only required to play the cartridge // Sports Pad Soccer, released in Japan. It uses a different mode than the -// used by the US model, due to missing output lines on Sega Mark III +// used by the US model, due to the missing TH line on Sega Mark III // controller ports. #include "sportsjp.h" diff --git a/src/devices/bus/sms_ctrl/sportsjp.h b/src/devices/bus/sms_ctrl/sportsjp.h index c20f15bd845..ad438d12bb1 100644 --- a/src/devices/bus/sms_ctrl/sportsjp.h +++ b/src/devices/bus/sms_ctrl/sportsjp.h @@ -6,11 +6,6 @@ **********************************************************************/ -// The Japanese Sports Pad controller is only required to play the cartridge -// Sports Pad Soccer, released in Japan. It uses a different mode than the -// used by the US model, due to missing output lines on Sega Mark III -// controller ports. - #pragma once #ifndef __SMS_SPORTS_PAD_JP__ diff --git a/src/devices/bus/sms_exp/gender.cpp b/src/devices/bus/sms_exp/gender.cpp index 7ca7ff48a47..3de8961050c 100644 --- a/src/devices/bus/sms_exp/gender.cpp +++ b/src/devices/bus/sms_exp/gender.cpp @@ -6,6 +6,13 @@ **********************************************************************/ +// The Gender Adapter is not an official Sega product. It is produced by the +// SMSPower website to permit to plug a cartridge on the expansion slot on any +// SMS 1 model. This includes the Japanese SMS, which has FM sound, so it is +// a way to get FM music of western cartridges that have FM code but were not +// released in Japan. Some games have compatibility issues, confirmed on the +// real hardware, when run plugged-in to the SMS expansion slot. + #include "gender.h"