mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
gba.cpp: several improvements [Fabio Priuli]
- Implemented emulation of the "General Purpose I/O" port (GPIO) of GBA. - Hooked up S-3511 RTC emulation through the GPIO port. This allows to avoid the "Internal battery has run dry [...] clock-based events will no longer occur" messages in Pokémon Emerald / Ruby / Sapphire. This also promotes Sennen Kazoku to working state. - Hooked up Boktai Light Sensor emulation through the GPIO port. This allows to avoid the "Solar Sensor is broken" message in Boktai / Bokura no Taiyou, which is now playable and to recharge your weapons in all three games of the series. Light level has to be chosen via the "Machine Configuration" menu, until we get some kind of camera input. - Hooked up Warioware Twist Gyroscope emulation through the GPIO port. This allows to play the minigames, even if in some case the input sensibility might need a few tweaks. - Hooked up Warioware Twist & Drill Dozer Rumble emulation through the GPIO port. MAME will now output a "Rumble" output bit (0 for Rumble=OFF and 1 for Rumble=ON) whenever the games try to access the Rumble component… third party applications can now listen to the output and redirect it to some hardware that can "rumble" in sync with the gameplay. gba.cpp: implemented emulation of the Tilt sensor used by Yoshi’s Universal Gravitation / Yoshi Topsy-Turvy / Yoshi no Banyuuinryoku (and by Koro Koro Puzzle). Note that the calibration can seem a bit tricky at first, because the emulated screen does not turn as the GBA would... In order to properly calibrate the sensor, just keep pressed right for a few seconds when requested to calibrate right inclination (first calibration screen in Yoshi Universal Gravitation) so to get the full right range; then keep pressed for left for a few seconds when requested to calibrate left inclination (second calibration screen in Yoshi Universal Gravitation) so to get the full left range. [Fabio Priuli]
This commit is contained in:
parent
1bacfb4716
commit
0169416ae3
110
hash/gba.xml
110
hash/gba.xml
@ -3221,7 +3221,7 @@
|
||||
<feature name="u4" value="U4 74LV4040 [37C7E1K]" />
|
||||
<feature name="u5" value="U5 TLV272" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-u3ip-0.u1" size="16777216" crc="9686c36b" sha1="64f7bf0f0560f6e94da33b549d3206678b29f557" offset="000000" />
|
||||
</dataarea>
|
||||
@ -3233,7 +3233,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Konami</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="bokura no taiyou - taiyou action rpg - kabunushi go-yuutai ban (japan) (demo).bin" size="16777216" crc="cf692572" sha1="f91126cd3a1bf7bf5f770d3a70229171d0d5a6ee" offset="000000" />
|
||||
</dataarea>
|
||||
@ -3246,7 +3246,7 @@
|
||||
<publisher>Konami</publisher>
|
||||
<info name="serial" value="AGB-U3IE-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="boktai - the sun is in your hand (usa).bin" size="16777216" crc="e715ac45" sha1="7164326283df46a3941ec7b6ceca889cbc40e660" offset="000000" />
|
||||
</dataarea>
|
||||
@ -3259,7 +3259,7 @@
|
||||
<publisher>Konami</publisher>
|
||||
<info name="serial" value="AGB-U32P"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="boktai 2 - solar boy django (europe) (en,fr,de,es,it).bin" size="16777216" crc="748189b5" sha1="eeacdf5a9d3d2173a4a96689b72dc6b7ad92153c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -3272,7 +3272,7 @@
|
||||
<publisher>Konami</publisher>
|
||||
<info name="serial" value="AGB-U32E-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="boktai 2 - solar boy django (usa).bin" size="16777216" crc="e1ffb2d1" sha1="cd10d8ed82f4daf4072774f70d015e39a5d32d0b" offset="000000" />
|
||||
</dataarea>
|
||||
@ -3339,7 +3339,7 @@
|
||||
<feature name="u4" value="U4 74LV4040 [34FV1KK]" />
|
||||
<feature name="u5" value="U5 TLV272" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-u3ij-0.u1" size="16777216" crc="a09c0807" sha1="c51ad84e9403db94cd18a14ac72f8367b52a0d7f" offset="000000" />
|
||||
</dataarea>
|
||||
@ -8504,7 +8504,7 @@
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-V49E-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_sram" />
|
||||
<feature name="slot" value="gba_drilldoz" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="drill dozer (usa).bin" size="8388608" crc="e60ec183" sha1="c1058cc2482b91204100cc8515da99aeb06773f5" offset="000000" />
|
||||
</dataarea>
|
||||
@ -17557,7 +17557,7 @@
|
||||
<info name="release" value="20020308"/>
|
||||
<info name="alt_title" value="コロコロパズル ハッピィパネッチュ!"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_4k" />
|
||||
<feature name="slot" value="gba_yoshiug" />
|
||||
<dataarea name="rom" size="4194304">
|
||||
<rom name="koro koro puzzle - happy panechu! (japan).bin" size="4194304" crc="0bfe46e9" sha1="40cb751d119a49be0cd44cf0491c93ebc8795ef0" offset="000000" />
|
||||
</dataarea>
|
||||
@ -20131,7 +20131,7 @@
|
||||
<info name="release" value="20041014"/>
|
||||
<info name="alt_title" value="まわるメイドインワリオ"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_sram" />
|
||||
<feature name="slot" value="gba_wariotws" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="mawaru - made in wario (japan).bin" size="16777216" crc="e69964f1" sha1="a389fa50e2e842b264b980cbe30e980c69d93a5b" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25144,7 +25144,7 @@
|
||||
<info name="release" value="20040916"/>
|
||||
<info name="alt_title" value="ポケットモンスター エメラルド"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pocket monsters - emerald (japan).bin" size="16777216" crc="4881f3f8" sha1="d7cf8f156ba9c455d164e1ea780a6bf1945465c2" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25222,7 +25222,7 @@
|
||||
<info name="release" value="20021121"/>
|
||||
<info name="alt_title" value="ポケットモンスター ルビー"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="pocket monsters - ruby (japan).bin" size="8388608" crc="cee9471a" sha1="5c5e546720300b99ae45d2aa35c646c8b8ff5c56" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25242,7 +25242,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [LE26FV10N1TS]" />
|
||||
<feature name="u3" value="U3 RTC [S3516]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="agb-axpj-0.u1" size="8388608" crc="fd1eeb78" sha1="3233342c2f3087e6ffe6c1791cd5867db07df842" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25319,7 +25319,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [MX29L010TC-15A1]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-bpep-0.u1" size="16777216" crc="1f1c08fb" sha1="f3ae088181bf583e55daf962a92bb46f4f1d07b7" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25331,7 +25331,7 @@
|
||||
<year>2004</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - smaragd-edition (germany).bin" size="16777216" crc="34c9df89" sha1="61c2eb2b380b1a75f0c94b767a2d4c26cd7ce4e3" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25343,7 +25343,7 @@
|
||||
<year>2004</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - version emeraude (france).bin" size="16777216" crc="a3fdccb1" sha1="ca666651374d89ca439007bed54d839eb7bd14d0" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25355,7 +25355,7 @@
|
||||
<year>2004</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - versione smeraldo (italy).bin" size="16777216" crc="a0aec80a" sha1="1692db322400c3141c5de2db38469913ceb1f4d4" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25373,7 +25373,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [MX29L010TC-15A1]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-bpes-0.u1" size="16777216" crc="8c4d3108" sha1="fe1558a3dcb0360ab558969e09b690888b846dd9" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25546,7 +25546,7 @@
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-AXVE-USA, AGB-AXVP"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - ruby version (usa, europe) (rev 2).bin" size="16777216" crc="aeac73e6" sha1="5b64eacf892920518db4ec664e62a086dd5f5bc8" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25564,7 +25564,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [LE26FV10N1TS-10]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-axvp-1.u1" size="16777216" crc="61641576" sha1="610b96a9c9a7d03d2bafb655e7560ccff1a6d894" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25577,7 +25577,7 @@
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-AXVE-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - ruby version (usa).bin" size="16777216" crc="f0815ee7" sha1="f28b6ffc97847e94a6c21a63cacf633ee5c8df1e" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25589,7 +25589,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - rubin-edition (germany) (rev 1).bin" size="16777216" crc="cae89464" sha1="424740be1fc67a5ddb954794443646e6aeee2c1b" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25601,7 +25601,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - rubin-edition (germany).bin" size="16777216" crc="15e1e280" sha1="1c2a53332382e14dab8815e3a6dd81ad89534050" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25613,7 +25613,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon_ruby_german_final_d.bin" size="16777216" crc="40686c47" sha1="ca5e3d415c4b47353a73a616878ba833f3648b7a" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25625,7 +25625,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - edicion rubi (spain) (rev 1).bin" size="16777216" crc="b980fff5" sha1="9ac73481d7f5d150a018309bba91d185ce99fb7c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25643,7 +25643,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [MX29L010TC-15A1]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-axvs-0.u1" size="16777216" crc="eb0729cf" sha1="1f49f7289253dcbfecbc4c5ba3e67aa0652ec83c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25655,7 +25655,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - version rubis (france) (rev 1).bin" size="16777216" crc="9f981f72" sha1="ba888dfba231a231cbd60fe228e894b54fb1ed79" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25667,7 +25667,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - version rubis (france).bin" size="16777216" crc="690fd310" sha1="a6ee94202bec0641c55d242757e84dc89336d4cb" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25679,7 +25679,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - versione rubino (italy) (rev 1).bin" size="16777216" crc="9305e793" sha1="015a5d380afe316a2a6fcc561798ebff9dfb3009" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25691,7 +25691,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - versione rubino (italy).bin" size="16777216" crc="c18231a9" sha1="2b3134224392f58da00f802faa1bf4b5cf6270be" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25704,7 +25704,7 @@
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-AXPE-USA, AGB-AXPP"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - sapphire version (usa, europe) (rev 2).bin" size="16777216" crc="9cc4410e" sha1="89b45fb172e6b55d51fc0e61989775187f6fe63c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25722,7 +25722,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [MX29L010TC-15A1]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-axpp-1.u1" size="16777216" crc="bafedae5" sha1="4722efb8cd45772ca32555b98fd3b9719f8e60a9" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25735,7 +25735,7 @@
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-AXPE-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - sapphire version (usa).bin" size="16777216" crc="554dedc4" sha1="3ccbbd45f8553c36463f13b938e833f652b793e4" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25747,7 +25747,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - saphir-edition (germany) (rev 1).bin" size="16777216" crc="b0c40c7c" sha1="7e6e034f9cdca6d2c4a270fdb50a94def5883d17" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25759,7 +25759,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - saphir-edition (germany).bin" size="16777216" crc="6fcd7a98" sha1="5a087835009d552d4c5c1f96be3be3206e378153" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25771,7 +25771,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - edicion zafiro (spain) (rev 1).bin" size="16777216" crc="f2c88931" sha1="0fe9ad1e602e2fafa090aee25e43d6980625173c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25783,7 +25783,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - edicion zafiro (spain).bin" size="16777216" crc="a04f5f0b" sha1="3a6489189e581c4b29914071b79207883b8c16d8" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25795,7 +25795,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - version saphir (france) (rev 1).bin" size="16777216" crc="2ae49146" sha1="860e93f5ea44f4278132f6c1ee5650d07b852fd8" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25807,7 +25807,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - version saphir (france).bin" size="16777216" crc="3581a05f" sha1="c269b5692b2d0e5800ba1ddf117fda95ac648634" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25819,7 +25819,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - versione zaffiro (italy) (rev 1).bin" size="16777216" crc="5efe4493" sha1="73edf67b9b82ff12795622dca412733755d2c0fe" offset="000000" />
|
||||
</dataarea>
|
||||
@ -25831,7 +25831,7 @@
|
||||
<year>2003</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="pokemon - versione zaffiro (italy).bin" size="16777216" crc="0c7992a9" sha1="f729dd571fb2c09e72c5c1d68fe0a21e72713d34" offset="000000" />
|
||||
</dataarea>
|
||||
@ -27789,7 +27789,7 @@
|
||||
<info name="release" value="20040806"/>
|
||||
<info name="alt_title" value="ロックマン エグゼ4.5 リアルオペレーション"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_flash" />
|
||||
<feature name="slot" value="gba_flash_rtc" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="rockman exe 4.5 - real operation (japan).bin" size="8388608" crc="a646601b" sha1="f89ef4ca8ec1823eb75fa184f2d0f9e66cc78a59" offset="000000" />
|
||||
</dataarea>
|
||||
@ -28594,7 +28594,7 @@
|
||||
<feature name="u1" value="U1 GPIO MASKROM" />
|
||||
<feature name="u2" value="U2 256K FRAM [MB85R256S]" />
|
||||
<feature name="u3" value="U3 [empty]" />
|
||||
<feature name="slot" value="gba_sram" />
|
||||
<feature name="slot" value="gba_drilldoz" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="agb-v49j-0.u1" size="8388608" crc="b17532ee" sha1="84afa7108e4d604e7b1a6d105df5760869a247fa" offset="000000" />
|
||||
</dataarea>
|
||||
@ -28824,7 +28824,7 @@
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="sennenkz" supported="no">
|
||||
<software name="sennenkz">
|
||||
<description>Sennen Kazoku (Jpn)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
@ -28837,7 +28837,7 @@
|
||||
<feature name="u2" value="U2 1M/512K FLASH [MX29L010TC-15A1]" />
|
||||
<feature name="u3" value="U3 RTC [S3511]" />
|
||||
<feature name="bt1" value="CR1616" />
|
||||
<feature name="slot" value="gba_flash_1m" />
|
||||
<feature name="slot" value="gba_flash_1m_rtc" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-bkaj-0.u1" size="16777216" crc="a2f6976c" sha1="4dcd7cee46d3a5e848a22eb371bebbbc2fb8d488" offset="000000" />
|
||||
</dataarea>
|
||||
@ -29181,7 +29181,7 @@
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="sboktai" supported="partial">
|
||||
<software name="sboktai">
|
||||
<description>Shin Bokura no Taiyou - Gyakushuu no Sabata (Jpn)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Konami</publisher>
|
||||
@ -29189,7 +29189,7 @@
|
||||
<info name="release" value="20050728"/>
|
||||
<info name="alt_title" value="新ボクらの太陽 逆襲のサバタ"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="shin bokura no taiyou - gyakushuu no sabata (japan).bin" size="16777216" crc="af453162" sha1="2651c5e6875ac60abff734510d152166d211c87c" offset="000000" />
|
||||
</dataarea>
|
||||
@ -36155,7 +36155,7 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
<feature name="u3" value="U3 [X01A]" />
|
||||
<feature name="u4" value="U4 [empty]" />
|
||||
<feature name="p1" value="P1 [AGB-MOG-01]" />
|
||||
<feature name="slot" value="gba_sram" />
|
||||
<feature name="slot" value="gba_wariotws" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="agb-rzwe-0.u1" size="16777216" crc="cb4e844b" sha1="f0102d0d6f7596fe853d5d0a94682718278e083a" offset="000000" />
|
||||
</dataarea>
|
||||
@ -37054,20 +37054,20 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="yoshitt" cloneof="yoshiug" supported="partial">
|
||||
<software name="yoshitt" cloneof="yoshiug">
|
||||
<description>Yoshi - Topsy-Turvy (USA)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
<info name="serial" value="AGB-KYGE-USA"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_4k" />
|
||||
<feature name="slot" value="gba_yoshiug" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="yoshi - topsy-turvy (usa).bin" size="8388608" crc="e64c265c" sha1="947498cb1db918d305500257e8223deeaddf561d" offset="000000" />
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="yoshiban" cloneof="yoshiug" supported="partial">
|
||||
<software name="yoshiban" cloneof="yoshiug">
|
||||
<description>Yoshi no Banyuuinryoku (Jpn)</description>
|
||||
<year>2004</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
@ -37075,14 +37075,14 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
<info name="release" value="20041209"/>
|
||||
<info name="alt_title" value="ヨッシーの万有引力"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_4k" />
|
||||
<feature name="slot" value="gba_yoshiug" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="yoshi no banyuuinryoku (japan).bin" size="8388608" crc="31594b7a" sha1="a3f2035ca2bdc2bc59e9e46efbb6187705ebe3d1" offset="000000" />
|
||||
</dataarea>
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="yoshiug" supported="partial">
|
||||
<software name="yoshiug">
|
||||
<description>Yoshi's Universal Gravitation (Euro)</description>
|
||||
<year>2005</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
@ -37094,7 +37094,7 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
<feature name="u3" value="U3 4K/64K EEPROM [9853]" />
|
||||
<feature name="u4" value="U4 ADXL202JE [202JE]" />
|
||||
<feature name="u5" value="U5 ADXL202JQC [empty]" />
|
||||
<feature name="slot" value="gba_eeprom_4k" />
|
||||
<feature name="slot" value="gba_yoshiug" />
|
||||
<dataarea name="rom" size="8388608">
|
||||
<rom name="agb-kygp-0.u2" size="8388608" crc="05f4d0aa" sha1="045be1369964f141009f3701839ec0a8dccb25c1" offset="000000" />
|
||||
</dataarea>
|
||||
@ -37972,7 +37972,7 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
<info name="release" value="20040722"/>
|
||||
<info name="alt_title" value="続ボクらの太陽 太陽少年ジャンゴ"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="zoku bokura no taiyou - taiyou shounen django (japan) (rev 1).bin" size="16777216" crc="71e2cd01" sha1="1a81843c3070decea4cbca20c4563541400b2437" offset="000000" />
|
||||
</dataarea>
|
||||
@ -37986,7 +37986,7 @@ The cart also contained a non-empty SRAM save which we currently include in the
|
||||
<info name="serial" value="AGB-U32J-JPN (RK363-J1)"/>
|
||||
<info name="release" value="20040722"/>
|
||||
<part name="cart" interface="gba_cart">
|
||||
<feature name="slot" value="gba_eeprom_64k" />
|
||||
<feature name="slot" value="gba_boktai" />
|
||||
<dataarea name="rom" size="16777216">
|
||||
<rom name="zoku bokura no taiyou - taiyou shounen django (japan).bin" size="16777216" crc="2804e589" sha1="54a4dcdeca2ee9a22559eb104b88586386639097" offset="000000" />
|
||||
</dataarea>
|
||||
|
@ -134,12 +134,18 @@ static const gba_slot slot_list[] =
|
||||
{
|
||||
{ GBA_STD, "gba_rom" },
|
||||
{ GBA_SRAM, "gba_sram" },
|
||||
{ GBA_DRILLDOZ, "gba_drilldoz" },
|
||||
{ GBA_WARIOTWS, "gba_wariotws" },
|
||||
{ GBA_EEPROM, "gba_eeprom" },
|
||||
{ GBA_EEPROM4, "gba_eeprom_4k" },
|
||||
{ GBA_YOSHIUG, "gba_yoshiug" },
|
||||
{ GBA_EEPROM64, "gba_eeprom_64k" },
|
||||
{ GBA_BOKTAI, "gba_boktai" },
|
||||
{ GBA_FLASH, "gba_flash" },
|
||||
{ GBA_FLASH_RTC, "gba_flash_rtc" },
|
||||
{ GBA_FLASH512, "gba_flash_512" },
|
||||
{ GBA_FLASH1M, "gba_flash_1m" },
|
||||
{ GBA_FLASH1M_RTC, "gba_flash_1m_rtc" },
|
||||
{ GBA_3DMATRIX, "gba_3dmatrix" },
|
||||
};
|
||||
|
||||
@ -204,7 +210,7 @@ bool gba_cart_slot_device::call_load()
|
||||
osd_printf_info("GBA: Detected (XML) %s\n", pcb_name ? pcb_name : "NONE");
|
||||
}
|
||||
|
||||
if (m_type == GBA_SRAM)
|
||||
if (m_type == GBA_SRAM || m_type == GBA_DRILLDOZ || m_type == GBA_WARIOTWS)
|
||||
m_cart->nvram_alloc(0x10000);
|
||||
|
||||
// mirror the ROM
|
||||
@ -300,6 +306,8 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
|
||||
{
|
||||
UINT32 chip = 0;
|
||||
int type = GBA_STD;
|
||||
bool has_rtc = false;
|
||||
bool has_rumble = false;
|
||||
|
||||
// first detect nvram type based on strings inside the file
|
||||
for (int i = 0; i < len; i++)
|
||||
@ -359,19 +367,30 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
|
||||
|
||||
for (auto & elem : gba_chip_fix_eeprom_list)
|
||||
{
|
||||
const gba_chip_fix_eeprom_item *item = &elem;
|
||||
const gba_chip_fix_item *item = &elem;
|
||||
if (!strcmp(game_code, item->game_code))
|
||||
{
|
||||
chip = (chip & ~GBA_CHIP_EEPROM) | GBA_CHIP_EEPROM_64K;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto & elem : gba_chip_fix_rumble_list)
|
||||
{
|
||||
const gba_chip_fix_item *item = &elem;
|
||||
if (!strcmp(game_code, item->game_code))
|
||||
{
|
||||
has_rumble = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chip & GBA_CHIP_RTC)
|
||||
{
|
||||
osd_printf_info("game has RTC - not emulated at the moment\n");
|
||||
//osd_printf_info("game has RTC - not emulated at the moment\n");
|
||||
chip &= ~GBA_CHIP_RTC;
|
||||
has_rtc = true;
|
||||
}
|
||||
|
||||
osd_printf_info("GBA: Emulate %s\n", gba_chip_string(chip).c_str());
|
||||
@ -383,21 +402,29 @@ int gba_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
|
||||
break;
|
||||
case GBA_CHIP_EEPROM:
|
||||
type = GBA_EEPROM;
|
||||
if (has_rumble)
|
||||
type = GBA_YOSHIUG;
|
||||
break;
|
||||
case GBA_CHIP_EEPROM_4K:
|
||||
type = GBA_EEPROM4;
|
||||
break;
|
||||
case GBA_CHIP_EEPROM_64K:
|
||||
type = GBA_EEPROM64;
|
||||
if (has_rtc)
|
||||
type = GBA_BOKTAI;
|
||||
break;
|
||||
case GBA_CHIP_FLASH:
|
||||
type = GBA_FLASH;
|
||||
if (has_rtc)
|
||||
type = GBA_FLASH_RTC;
|
||||
break;
|
||||
case GBA_CHIP_FLASH_512:
|
||||
type = GBA_FLASH512;
|
||||
break;
|
||||
case GBA_CHIP_FLASH_1M:
|
||||
type = GBA_FLASH1M;
|
||||
if (has_rtc)
|
||||
type = GBA_FLASH1M_RTC;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -455,6 +482,14 @@ READ32_MEMBER(gba_cart_slot_device::read_ram)
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
READ32_MEMBER(gba_cart_slot_device::read_gpio)
|
||||
{
|
||||
if (m_cart)
|
||||
return m_cart->read_gpio(space, offset, mem_mask);
|
||||
else
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
write
|
||||
@ -466,6 +501,12 @@ WRITE32_MEMBER(gba_cart_slot_device::write_ram)
|
||||
m_cart->write_ram(space, offset, data, mem_mask);
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(gba_cart_slot_device::write_gpio)
|
||||
{
|
||||
if (m_cart)
|
||||
m_cart->write_gpio(space, offset, data, mem_mask);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Internal header logging
|
||||
|
@ -13,12 +13,18 @@ enum
|
||||
{
|
||||
GBA_STD = 0,
|
||||
GBA_SRAM,
|
||||
GBA_DRILLDOZ,
|
||||
GBA_WARIOTWS,
|
||||
GBA_EEPROM,
|
||||
GBA_EEPROM4,
|
||||
GBA_YOSHIUG,
|
||||
GBA_EEPROM64,
|
||||
GBA_BOKTAI,
|
||||
GBA_FLASH,
|
||||
GBA_FLASH_RTC,
|
||||
GBA_FLASH512,
|
||||
GBA_FLASH1M,
|
||||
GBA_FLASH1M_RTC,
|
||||
GBA_3DMATRIX
|
||||
};
|
||||
|
||||
@ -35,7 +41,11 @@ public:
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_rom) { return 0xffffffff; }
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) { return 0xffffffff; }
|
||||
virtual DECLARE_READ32_MEMBER(read_gpio) { return 0; }
|
||||
virtual DECLARE_READ32_MEMBER(read_tilt) { return 0xffffffff; }
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) {};
|
||||
virtual DECLARE_WRITE32_MEMBER(write_gpio) {};
|
||||
virtual DECLARE_WRITE32_MEMBER(write_tilt) {};
|
||||
virtual DECLARE_WRITE32_MEMBER(write_mapper) {};
|
||||
|
||||
void rom_alloc(UINT32 size, const char *tag);
|
||||
@ -103,8 +113,12 @@ public:
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_rom);
|
||||
virtual DECLARE_READ32_MEMBER(read_ram);
|
||||
virtual DECLARE_READ32_MEMBER(read_gpio);
|
||||
virtual DECLARE_READ32_MEMBER(read_tilt) { if (m_cart) return m_cart->read_tilt(space, offset, mem_mask); else return 0xffffffff; }
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram);
|
||||
virtual DECLARE_WRITE32_MEMBER(write_mapper) { if (m_cart) return m_cart->write_mapper(space, offset, data, mem_mask); };
|
||||
virtual DECLARE_WRITE32_MEMBER(write_gpio);
|
||||
virtual DECLARE_WRITE32_MEMBER(write_tilt) { if (m_cart) m_cart->write_tilt(space, offset, data, mem_mask); }
|
||||
virtual DECLARE_WRITE32_MEMBER(write_mapper) { if (m_cart) m_cart->write_mapper(space, offset, data, mem_mask); }
|
||||
|
||||
|
||||
protected:
|
||||
@ -193,12 +207,12 @@ static const gba_chip_fix_conflict_item gba_chip_fix_conflict_list[] =
|
||||
{ "BYUJ", GBA_CHIP_EEPROM_64K }, // 2322 - Yggdra Union (JPN)
|
||||
};
|
||||
|
||||
struct gba_chip_fix_eeprom_item
|
||||
struct gba_chip_fix_item
|
||||
{
|
||||
char game_code[5];
|
||||
};
|
||||
|
||||
static const gba_chip_fix_eeprom_item gba_chip_fix_eeprom_list[] =
|
||||
static const gba_chip_fix_item gba_chip_fix_eeprom_list[] =
|
||||
{
|
||||
// gba scan no. 7
|
||||
{ "AKTJ" }, // 0145 - Hello Kitty Collection - Miracle Fashion Maker (JPN)
|
||||
@ -588,4 +602,13 @@ static const gba_chip_fix_eeprom_item gba_chip_fix_eeprom_list[] =
|
||||
{ "A3IJ" }, // bokura no taiyou - taiyou action rpg - kabunushi go-yuutai ban (japan) (demo)
|
||||
};
|
||||
|
||||
static const gba_chip_fix_item gba_chip_fix_rumble_list[] =
|
||||
{
|
||||
{ "KYGP" }, // Yoshi's Universal Gravitation (EUR)
|
||||
{ "KYGE" }, // Yoshi - Topsy-Turvy (USA)
|
||||
{ "KYGJ" }, // Yoshi no Banyuuinryoku (JPN)
|
||||
{ "KHPJ" } // Koro Koro Puzzle - Happy Panechu! (JPN)
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -23,10 +23,16 @@
|
||||
|
||||
const device_type GBA_ROM_STD = &device_creator<gba_rom_device>;
|
||||
const device_type GBA_ROM_SRAM = &device_creator<gba_rom_sram_device>;
|
||||
const device_type GBA_ROM_DRILLDOZ = &device_creator<gba_rom_drilldoz_device>;
|
||||
const device_type GBA_ROM_WARIOTWS = &device_creator<gba_rom_wariotws_device>;
|
||||
const device_type GBA_ROM_EEPROM = &device_creator<gba_rom_eeprom_device>;
|
||||
const device_type GBA_ROM_YOSHIUG = &device_creator<gba_rom_yoshiug_device>;
|
||||
const device_type GBA_ROM_EEPROM64 = &device_creator<gba_rom_eeprom64_device>;
|
||||
const device_type GBA_ROM_BOKTAI = &device_creator<gba_rom_boktai_device>;
|
||||
const device_type GBA_ROM_FLASH = &device_creator<gba_rom_flash_device>;
|
||||
const device_type GBA_ROM_FLASH_RTC = &device_creator<gba_rom_flash_rtc_device>;
|
||||
const device_type GBA_ROM_FLASH1M = &device_creator<gba_rom_flash1m_device>;
|
||||
const device_type GBA_ROM_FLASH1M_RTC = &device_creator<gba_rom_flash1m_rtc_device>;
|
||||
const device_type GBA_ROM_3DMATRIX = &device_creator<gba_rom_3dmatrix_device>;
|
||||
|
||||
|
||||
@ -42,33 +48,98 @@ gba_rom_device::gba_rom_device(const machine_config &mconfig, const char *tag, d
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_sram_device::gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_SRAM, "GBA Carts + SRAM", tag, owner, clock, "gba_sram", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_drilldoz_device::gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_sram_device(mconfig, GBA_ROM_DRILLDOZ, "GBA Carts + SRAM + Rumble", tag, owner, clock, "gba_drilldoz", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_wariotws_device::gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_sram_device(mconfig, GBA_ROM_WARIOTWS, "GBA Carts + SRAM + Rumble + Gyroscope", tag, owner, clock, "gba_wariotws", __FILE__),
|
||||
m_gyro_z(*this, "GYROZ")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_eeprom_device::gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_EEPROM, "GBA Carts + EEPROM", tag, owner, clock, "gba_eeprom", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_yoshiug_device::gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_eeprom_device(mconfig, GBA_ROM_YOSHIUG, "GBA Carts + EEPROM + Tilt Sensor", tag, owner, clock, "gba_yoshiug", __FILE__),
|
||||
m_tilt_x(*this, "TILTX"),
|
||||
m_tilt_y(*this, "TILTY")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_eeprom64_device::gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_EEPROM64, "GBA Carts + EEPROM 64K", tag, owner, clock, "gba_eeprom64", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_boktai_device::gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_eeprom64_device(mconfig, GBA_ROM_BOKTAI, "GBA Carts + EEPROM 64K + RTC", tag, owner, clock, "gba_boktai", __FILE__),
|
||||
m_sensor(*this, "LIGHTSENSE")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
m_flash_mask(0),
|
||||
m_flash(*this, "flash")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash_device::gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_FLASH, "GBA Carts + Panasonic Flash", tag, owner, clock, "gba_flash", __FILE__), m_flash_mask(0),
|
||||
: gba_rom_device(mconfig, GBA_ROM_FLASH, "GBA Carts + Panasonic Flash", tag, owner, clock, "gba_flash", __FILE__),
|
||||
m_flash_mask(0),
|
||||
m_flash(*this, "flash")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash_rtc_device::gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_flash_device(mconfig, GBA_ROM_FLASH_RTC, "GBA Carts + Panasonic Flash + RTC", tag, owner, clock, "gba_flash_rtc", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
|
||||
: gba_rom_device(mconfig, type, name, tag, owner, clock, shortname, source),
|
||||
m_flash_mask(0),
|
||||
m_flash(*this, "flash")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash1m_device::gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_FLASH1M, "GBA Carts + Sanyo Flash", tag, owner, clock, "gba_flash1m", __FILE__), m_flash_mask(0),
|
||||
: gba_rom_device(mconfig, GBA_ROM_FLASH1M, "GBA Carts + Sanyo Flash", tag, owner, clock, "gba_flash1m", __FILE__),
|
||||
m_flash_mask(0),
|
||||
m_flash(*this, "flash")
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_flash1m_rtc_device::gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_flash1m_device(mconfig, GBA_ROM_FLASH1M_RTC, "GBA Carts + Sanyo Flash + RTC", tag, owner, clock, "gba_flash1m_rtc", __FILE__)
|
||||
{
|
||||
}
|
||||
|
||||
gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: gba_rom_device(mconfig, GBA_ROM_3DMATRIX, "GBA Carts + 3D Matrix Memory Mapper", tag, owner, clock, "gba_3dmatrix", __FILE__)
|
||||
{
|
||||
@ -81,10 +152,31 @@ gba_rom_3dmatrix_device::gba_rom_3dmatrix_device(const machine_config &mconfig,
|
||||
|
||||
void gba_rom_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_gpio_regs));
|
||||
save_item(NAME(m_gpio_write_only));
|
||||
save_item(NAME(m_gpio_dirs));
|
||||
}
|
||||
|
||||
void gba_rom_device::device_reset()
|
||||
{
|
||||
m_gpio_regs[0] = 0;
|
||||
m_gpio_regs[1] = 0;
|
||||
m_gpio_regs[2] = 0;
|
||||
m_gpio_regs[3] = 0;
|
||||
m_gpio_write_only = 0;
|
||||
m_gpio_dirs = 0;
|
||||
}
|
||||
|
||||
void gba_rom_wariotws_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_last_val));
|
||||
save_item(NAME(m_counter));
|
||||
}
|
||||
|
||||
void gba_rom_wariotws_device::device_reset()
|
||||
{
|
||||
m_last_val = 0;
|
||||
m_counter = 0;
|
||||
}
|
||||
|
||||
void gba_rom_flash_device::device_reset()
|
||||
@ -105,6 +197,22 @@ void gba_rom_eeprom_device::device_start()
|
||||
m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 6);
|
||||
}
|
||||
|
||||
void gba_rom_yoshiug_device::device_start()
|
||||
{
|
||||
gba_rom_eeprom_device::device_start();
|
||||
save_item(NAME(m_tilt_ready));
|
||||
save_item(NAME(m_xpos));
|
||||
save_item(NAME(m_ypos));
|
||||
}
|
||||
|
||||
void gba_rom_yoshiug_device::device_reset()
|
||||
{
|
||||
m_tilt_ready = 0;
|
||||
m_xpos = 0;
|
||||
m_ypos = 0;
|
||||
}
|
||||
|
||||
|
||||
void gba_rom_eeprom64_device::device_start()
|
||||
{
|
||||
// for the moment we use a custom eeprom implementation, so we alloc/save it as nvram
|
||||
@ -112,6 +220,31 @@ void gba_rom_eeprom64_device::device_start()
|
||||
m_eeprom = std::make_unique<gba_eeprom_device>(machine(), (UINT8*)get_nvram_base(), get_nvram_size(), 14);
|
||||
}
|
||||
|
||||
void gba_rom_boktai_device::device_start()
|
||||
{
|
||||
gba_rom_eeprom64_device::device_start();
|
||||
m_rtc = std::make_unique<gba_s3511_device>(machine());
|
||||
|
||||
save_item(NAME(m_last_val));
|
||||
save_item(NAME(m_counter));
|
||||
}
|
||||
|
||||
void gba_rom_boktai_device::device_reset()
|
||||
{
|
||||
m_last_val = 0;
|
||||
m_counter = 0;
|
||||
}
|
||||
|
||||
void gba_rom_flash_rtc_device::device_start()
|
||||
{
|
||||
m_rtc = std::make_unique<gba_s3511_device>(machine());
|
||||
}
|
||||
|
||||
void gba_rom_flash1m_rtc_device::device_start()
|
||||
{
|
||||
m_rtc = std::make_unique<gba_s3511_device>(machine());
|
||||
}
|
||||
|
||||
void gba_rom_3dmatrix_device::device_start()
|
||||
{
|
||||
save_item(NAME(m_src));
|
||||
@ -131,6 +264,75 @@ void gba_rom_3dmatrix_device::device_reset()
|
||||
mapper specific handlers
|
||||
-------------------------------------------------*/
|
||||
|
||||
/*-------------------------------------------------
|
||||
This is a preliminary implementation of the
|
||||
General Purpose I/O Port embedded in the GBA PCBs
|
||||
as described at : http://problemkaputt.de/gbatek.htm#gbacartioportgpio
|
||||
|
||||
Functions read_gpio/write_gpio only give the
|
||||
I/O interface while the actual on-cart devices
|
||||
are read and written through gpio_dev_read/gpio_dev_write
|
||||
which are virtual methods defined in the specific
|
||||
cart types.
|
||||
-------------------------------------------------*/
|
||||
|
||||
READ32_MEMBER(gba_rom_device::read_gpio)
|
||||
{
|
||||
logerror("read GPIO offs %X\n", offset);
|
||||
if (!m_gpio_write_only)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
UINT16 ret = gpio_dev_read(m_gpio_dirs);
|
||||
return ret;
|
||||
}
|
||||
if (ACCESSING_BITS_16_31)
|
||||
return m_gpio_regs[1] << 16;
|
||||
case 1:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
return m_gpio_regs[2];
|
||||
if (ACCESSING_BITS_16_31)
|
||||
return m_gpio_regs[3] << 16;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
return m_rom[offset + 0xc4/4];
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(gba_rom_device::write_gpio)
|
||||
{
|
||||
logerror("write GPIO offs %X data %X\n", offset, data);
|
||||
switch (offset)
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
gpio_dev_write(data & 0xffff, m_gpio_dirs);
|
||||
}
|
||||
if (ACCESSING_BITS_16_31)
|
||||
{
|
||||
m_gpio_dirs = (data >> 16) & 0x0f;
|
||||
m_gpio_regs[1] = (data >> 16) & 0xffff;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
m_gpio_write_only = BIT(data, 0) ? 0 : 1;
|
||||
m_gpio_regs[2] = data & 0xffff;
|
||||
}
|
||||
if (ACCESSING_BITS_16_31)
|
||||
m_gpio_regs[3] = (data >> 16) & 0xffff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with SRAM
|
||||
@ -151,6 +353,60 @@ WRITE32_MEMBER(gba_rom_sram_device::write_ram)
|
||||
}
|
||||
|
||||
|
||||
// SRAM cart variant with additional Rumble motor (used by Drill Dozer)
|
||||
|
||||
void gba_rom_drilldoz_device::gpio_dev_write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
if ((gpio_dirs & 0x08))
|
||||
{
|
||||
// send impulse to Rumble sensor
|
||||
machine().output().set_value("Rumble", BIT(data, 3));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// SRAM cart variant with additional Rumble motor + Gyroscope (used by Warioware Twist)
|
||||
|
||||
static INPUT_PORTS_START( wariotws_gyroscope )
|
||||
PORT_START("GYROZ")
|
||||
PORT_BIT( 0xfff, 0x6c0, IPT_AD_STICK_Z ) PORT_MINMAX(0x354,0x9e3) PORT_SENSITIVITY(0x10) PORT_KEYDELTA(0x50)
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor gba_rom_wariotws_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( wariotws_gyroscope );
|
||||
}
|
||||
|
||||
UINT16 gba_rom_wariotws_device::gpio_dev_read(int gpio_dirs)
|
||||
{
|
||||
int gyro = 0;
|
||||
if (gpio_dirs == 0x0b)
|
||||
gyro = BIT(m_gyro_z->read(), m_counter);
|
||||
return (gyro << 2);
|
||||
}
|
||||
|
||||
void gba_rom_wariotws_device::gpio_dev_write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
if ((gpio_dirs & 0x08))
|
||||
{
|
||||
// send impulse to Rumble sensor
|
||||
machine().output().set_value("Rumble", BIT(data, 3));
|
||||
}
|
||||
|
||||
if (gpio_dirs == 0x0b)
|
||||
{
|
||||
if ((data & 2) && (m_counter > 0))
|
||||
m_counter--;
|
||||
|
||||
if (data & 1)
|
||||
m_counter = 15;
|
||||
|
||||
m_last_val = data & 0x0b;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with Flash RAM
|
||||
-------------------------------------------------*/
|
||||
@ -257,164 +513,34 @@ WRITE32_MEMBER(gba_rom_flash1m_device::write_ram)
|
||||
}
|
||||
}
|
||||
|
||||
// cart variants with additional S3511 RTC
|
||||
|
||||
UINT16 gba_rom_flash_rtc_device::gpio_dev_read(int gpio_dirs)
|
||||
{
|
||||
return 5 | (m_rtc->read_line() << 1);
|
||||
}
|
||||
|
||||
void gba_rom_flash_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
m_rtc->write(data, gpio_dirs);
|
||||
}
|
||||
|
||||
|
||||
UINT16 gba_rom_flash1m_rtc_device::gpio_dev_read(int gpio_dirs)
|
||||
{
|
||||
return 5 | (m_rtc->read_line() << 1);
|
||||
}
|
||||
|
||||
void gba_rom_flash1m_rtc_device::gpio_dev_write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
m_rtc->write(data, gpio_dirs);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with EEPROM
|
||||
|
||||
TODO: can this sketchy EEPROM device be merged
|
||||
with the core implementation?
|
||||
-------------------------------------------------*/
|
||||
|
||||
// GBA EEPROM Device
|
||||
|
||||
gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits) :
|
||||
m_state(EEP_IDLE),
|
||||
m_machine(machine)
|
||||
{
|
||||
m_data = eeprom;
|
||||
m_data_size = size;
|
||||
m_addr_bits = addr_bits;
|
||||
|
||||
m_machine.save().save_item(m_state, "GBA_EEPROM/m_state");
|
||||
m_machine.save().save_item(m_command, "GBA_EEPROM/m_command");
|
||||
m_machine.save().save_item(m_count, "GBA_EEPROM/m_count");
|
||||
m_machine.save().save_item(m_addr, "GBA_EEPROM/m_addr");
|
||||
m_machine.save().save_item(m_bits, "GBA_EEPROM/m_bits");
|
||||
m_machine.save().save_item(m_eep_data, "GBA_EEPROM/m_eep_data");
|
||||
}
|
||||
|
||||
UINT32 gba_eeprom_device::read()
|
||||
{
|
||||
UINT32 out;
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case EEP_IDLE:
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, activecpu_get_pc(), 1);
|
||||
return 0x00010001; // "ready"
|
||||
|
||||
case EEP_READFIRST:
|
||||
m_count--;
|
||||
|
||||
if (!m_count)
|
||||
{
|
||||
m_count = 64;
|
||||
m_bits = 0;
|
||||
m_eep_data = 0;
|
||||
m_state = EEP_READ;
|
||||
}
|
||||
break;
|
||||
case EEP_READ:
|
||||
if ((m_bits == 0) && (m_count))
|
||||
{
|
||||
if (m_addr >= m_data_size)
|
||||
{
|
||||
fatalerror("eeprom: invalid address (%x)\n", m_addr);
|
||||
}
|
||||
m_eep_data = m_data[m_addr];
|
||||
//printf("EEPROM read @ %x = %x (%x)\n", m_addr, m_eep_data, (m_eep_data & 0x80) ? 1 : 0);
|
||||
m_addr++;
|
||||
m_bits = 8;
|
||||
}
|
||||
|
||||
out = (m_eep_data & 0x80) ? 1 : 0;
|
||||
out |= (out<<16);
|
||||
m_eep_data <<= 1;
|
||||
|
||||
m_bits--;
|
||||
m_count--;
|
||||
|
||||
if (!m_count)
|
||||
{
|
||||
m_state = EEP_IDLE;
|
||||
}
|
||||
|
||||
// printf("out = %08x\n", out);
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %08x\n", offset, ~mem_mask, m_state, activecpu_get_pc(), out);
|
||||
return out;
|
||||
}
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, space.device().safe_pc(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void gba_eeprom_device::write(UINT32 data)
|
||||
{
|
||||
// printf("eeprom_w: %x @ %x (state %d) (PC=%x)\n", data, offset, m_state, space.device().safe_pc());
|
||||
switch (m_state)
|
||||
{
|
||||
case EEP_IDLE:
|
||||
if (data == 1)
|
||||
m_state++;
|
||||
break;
|
||||
|
||||
case EEP_COMMAND:
|
||||
if (data == 1)
|
||||
m_command = EEP_READFIRST;
|
||||
else
|
||||
m_command = EEP_WRITE;
|
||||
m_state = EEP_ADDR;
|
||||
m_count = m_addr_bits;
|
||||
m_addr = 0;
|
||||
break;
|
||||
|
||||
case EEP_ADDR:
|
||||
m_addr <<= 1;
|
||||
m_addr |= (data & 1);
|
||||
m_count--;
|
||||
if (!m_count)
|
||||
{
|
||||
m_addr *= 8; // each address points to 8 bytes
|
||||
if (m_command == EEP_READFIRST)
|
||||
m_state = EEP_AFTERADDR;
|
||||
else
|
||||
{
|
||||
m_count = 64;
|
||||
m_bits = 8;
|
||||
m_state = EEP_WRITE;
|
||||
m_eep_data = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EEP_AFTERADDR:
|
||||
m_state = m_command;
|
||||
m_count = 64;
|
||||
m_bits = 0;
|
||||
m_eep_data = 0;
|
||||
if (m_state == EEP_READFIRST)
|
||||
m_count = 4;
|
||||
break;
|
||||
|
||||
case EEP_WRITE:
|
||||
m_eep_data <<= 1;
|
||||
m_eep_data |= (data & 1);
|
||||
m_bits--;
|
||||
m_count--;
|
||||
|
||||
if (m_bits == 0)
|
||||
{
|
||||
osd_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr);
|
||||
if (m_addr >= m_data_size)
|
||||
fatalerror("eeprom: invalid address (%x)\n", m_addr);
|
||||
|
||||
m_data[m_addr] = m_eep_data;
|
||||
m_addr++;
|
||||
m_eep_data = 0;
|
||||
m_bits = 8;
|
||||
}
|
||||
|
||||
if (!m_count)
|
||||
m_state = EEP_AFTERWRITE;
|
||||
break;
|
||||
|
||||
case EEP_AFTERWRITE:
|
||||
m_state = EEP_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
READ32_MEMBER(gba_rom_eeprom_device::read_ram)
|
||||
{
|
||||
// Larger games have smaller access to EERPOM content
|
||||
@ -458,6 +584,137 @@ WRITE32_MEMBER(gba_rom_eeprom64_device::write_ram)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with EEPROM + Tilt Sensor
|
||||
|
||||
Note about the calibration: this can seem a bit
|
||||
tricky at first, because the emulated screen
|
||||
does not turn as the GBA would...
|
||||
In order to properly calibrate the sensor, just
|
||||
keep pressed right for a few seconds when requested
|
||||
to calibrate right inclination (first calibration
|
||||
screen in Yoshi Universal Gravitation) so to get the
|
||||
full right range; then keep pressed for left for a
|
||||
few seconds when requested to calibrate left
|
||||
inclination (second calibration screen in Yoshi
|
||||
Universal Gravitation) so to get the full left range
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( yoshiug_tilt )
|
||||
PORT_START("TILTX")
|
||||
PORT_BIT( 0xfff, 0x3a0, IPT_AD_STICK_X ) PORT_MINMAX(0x2af,0x477) PORT_SENSITIVITY(0x30) PORT_KEYDELTA(0x50)
|
||||
PORT_START("TILTY")
|
||||
PORT_BIT( 0xfff, 0x3a0, IPT_AD_STICK_Y ) PORT_MINMAX(0x2c3,0x480) PORT_SENSITIVITY(0x30) PORT_KEYDELTA(0x50)
|
||||
INPUT_PORTS_END
|
||||
|
||||
ioport_constructor gba_rom_yoshiug_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( yoshiug_tilt );
|
||||
}
|
||||
|
||||
|
||||
READ32_MEMBER(gba_rom_yoshiug_device::read_tilt)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x200/4:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
return (m_xpos & 0xff);
|
||||
break;
|
||||
case 0x300/4:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
return ((m_xpos >> 8) & 0x0f) | 0x80;
|
||||
break;
|
||||
case 0x400/4:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
return (m_ypos & 0xff);
|
||||
break;
|
||||
case 0x500/4:
|
||||
if (ACCESSING_BITS_0_15)
|
||||
return ((m_ypos >> 8) & 0x0f);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
WRITE32_MEMBER(gba_rom_yoshiug_device::write_tilt)
|
||||
{
|
||||
switch (offset)
|
||||
{
|
||||
case 0x000/4:
|
||||
if (data == 0x55) m_tilt_ready = 1;
|
||||
break;
|
||||
case 0x100/4:
|
||||
if (data == 0xaa)
|
||||
{
|
||||
m_xpos = m_tilt_x->read();
|
||||
m_ypos = m_tilt_y->read();
|
||||
m_tilt_ready = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with EEPROM + S3511 RTC + Light Sensor
|
||||
-------------------------------------------------*/
|
||||
|
||||
static INPUT_PORTS_START( boktai_sensor )
|
||||
PORT_START("LIGHTSENSE")
|
||||
PORT_CONFNAME( 0xff, 0xe8, "Light Sensor" )
|
||||
PORT_CONFSETTING( 0xe8, "Complete Darkness" )
|
||||
PORT_CONFSETTING( 0xe4, "10%" )
|
||||
PORT_CONFSETTING( 0xdc, "20%" )
|
||||
PORT_CONFSETTING( 0xd4, "30%" )
|
||||
PORT_CONFSETTING( 0xc8, "40%" )
|
||||
PORT_CONFSETTING( 0xb8, "50%" )
|
||||
PORT_CONFSETTING( 0xa8, "60%" )
|
||||
PORT_CONFSETTING( 0x98, "70%" )
|
||||
PORT_CONFSETTING( 0x88, "80%" )
|
||||
PORT_CONFSETTING( 0x68, "90%" )
|
||||
PORT_CONFSETTING( 0x48, "Very Bright" )
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
ioport_constructor gba_rom_boktai_device::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME( boktai_sensor );
|
||||
}
|
||||
|
||||
UINT16 gba_rom_boktai_device::gpio_dev_read(int gpio_dirs)
|
||||
{
|
||||
int light = (gpio_dirs == 7 && m_counter >= m_sensor->read()) ? 1 : 0;
|
||||
return 5 | (m_rtc->read_line() << 1) | (light << 3);
|
||||
}
|
||||
|
||||
void gba_rom_boktai_device::gpio_dev_write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
m_rtc->write(data, gpio_dirs);
|
||||
if (gpio_dirs == 7)
|
||||
{
|
||||
if (data & 2)
|
||||
m_counter = 0;
|
||||
|
||||
if ((data & 1) && !(m_last_val & 1))
|
||||
{
|
||||
m_counter++;
|
||||
if (m_counter == 0x100)
|
||||
m_counter = 0;
|
||||
}
|
||||
|
||||
m_last_val = data & 7;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
Carts with 3D Matrix Memory controller
|
||||
|
||||
@ -511,3 +768,328 @@ WRITE32_MEMBER(gba_rom_3dmatrix_device::write_mapper)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Additional devices, to be moved to separate source files at a later stage
|
||||
|
||||
/*-------------------------------------------------
|
||||
Seiko S-3511 RTC implementation
|
||||
|
||||
TODO: transform this into a separate device, using
|
||||
also dirtc.cpp!
|
||||
-------------------------------------------------*/
|
||||
|
||||
gba_s3511_device::gba_s3511_device(running_machine &machine) :
|
||||
m_phase(S3511_RTC_IDLE),
|
||||
m_machine(machine)
|
||||
{
|
||||
m_last_val = 0;
|
||||
m_bits = 0;
|
||||
m_command = 0;
|
||||
m_data_len = 1;
|
||||
m_data[0] = 0;
|
||||
|
||||
m_machine.save().save_item(m_phase, "GBA_RTC/m_phase");
|
||||
m_machine.save().save_item(m_data, "GBA_RTC/m_data");
|
||||
m_machine.save().save_item(m_last_val, "GBA_RTC/m_last_val");
|
||||
m_machine.save().save_item(m_bits, "GBA_RTC/m_bits");
|
||||
m_machine.save().save_item(m_command, "GBA_RTC/m_command");
|
||||
m_machine.save().save_item(m_data_len, "GBA_RTC/m_data_len");
|
||||
}
|
||||
|
||||
|
||||
UINT8 gba_s3511_device::convert_to_bcd(int val)
|
||||
{
|
||||
return (((val % 100) / 10) << 4) | (val % 10);
|
||||
}
|
||||
|
||||
void gba_s3511_device::update_time(int len)
|
||||
{
|
||||
system_time curtime;
|
||||
m_machine.current_datetime(curtime);
|
||||
|
||||
if (len == 7)
|
||||
{
|
||||
m_data[0] = convert_to_bcd(curtime.local_time.year);
|
||||
m_data[1] = convert_to_bcd(curtime.local_time.month + 1);
|
||||
m_data[2] = convert_to_bcd(curtime.local_time.mday);
|
||||
m_data[3] = convert_to_bcd(curtime.local_time.weekday);
|
||||
m_data[4] = convert_to_bcd(curtime.local_time.hour);
|
||||
m_data[5] = convert_to_bcd(curtime.local_time.minute);
|
||||
m_data[6] = convert_to_bcd(curtime.local_time.second);
|
||||
}
|
||||
else if (len == 3)
|
||||
{
|
||||
m_data[0] = convert_to_bcd(curtime.local_time.hour);
|
||||
m_data[1] = convert_to_bcd(curtime.local_time.minute);
|
||||
m_data[2] = convert_to_bcd(curtime.local_time.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int gba_s3511_device::read_line()
|
||||
{
|
||||
int pin = 0;
|
||||
switch (m_phase)
|
||||
{
|
||||
case S3511_RTC_DATAOUT:
|
||||
//printf("mmm %d - %X - %d - %d\n", m_bits, m_data[m_bits >> 3], m_bits >> 3, BIT(m_data[m_bits >> 3], (m_bits & 7)));
|
||||
pin = BIT(m_data[m_bits >> 3], (m_bits & 7));
|
||||
m_bits++;
|
||||
if (m_bits == 8 * m_data_len)
|
||||
{
|
||||
//for (int i = 0; i < m_data_len; i++)
|
||||
// printf("RTC DATA OUT COMPLETE %X (reg %d) \n", m_data[i], i);
|
||||
m_bits = 0;
|
||||
m_phase = S3511_RTC_IDLE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return pin;
|
||||
}
|
||||
|
||||
|
||||
void gba_s3511_device::write(UINT16 data, int gpio_dirs)
|
||||
{
|
||||
// printf("gpio_dev_write data %X\n", data);
|
||||
if (m_phase == S3511_RTC_IDLE && (m_last_val & 5) == 1 && (data & 5) == 5)
|
||||
{
|
||||
m_phase = S3511_RTC_COMMAND;
|
||||
m_bits = 0;
|
||||
m_command = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// if (m_phase == 3)
|
||||
// printf("RTC command OK\n");
|
||||
if (!(m_last_val & 1) & (data & 1))
|
||||
{
|
||||
// bit transfer
|
||||
m_last_val = data & 0xff;
|
||||
switch (m_phase)
|
||||
{
|
||||
case S3511_RTC_DATAIN:
|
||||
if (!BIT(gpio_dirs, 1))
|
||||
{
|
||||
m_data[m_bits >> 3] = (m_data[m_bits >> 3] >> 1) | ((data << 6) & 0x80);
|
||||
m_bits++;
|
||||
if (m_bits == 8 * m_data_len)
|
||||
{
|
||||
//for (int i = 0; i < m_data_len; i++)
|
||||
// printf("RTC DATA IN COMPLETE %X (reg %d) \n", m_data[i], i);
|
||||
m_bits = 0;
|
||||
m_phase = S3511_RTC_IDLE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case S3511_RTC_DATAOUT:
|
||||
break;
|
||||
case S3511_RTC_COMMAND:
|
||||
m_command |= (BIT(data, 1) << (7 - m_bits));
|
||||
m_bits++;
|
||||
if (m_bits == 8)
|
||||
{
|
||||
m_bits = 0;
|
||||
//printf("RTC command %X ENTERED!!!\n", m_command);
|
||||
switch (m_command)
|
||||
{
|
||||
case 0x60:
|
||||
// reset?
|
||||
m_phase = S3511_RTC_IDLE;
|
||||
m_bits = 0;
|
||||
break;
|
||||
case 0x62:
|
||||
m_phase = S3511_RTC_DATAIN;
|
||||
m_data_len = 1;
|
||||
break;
|
||||
case 0x63:
|
||||
m_data_len = 1;
|
||||
m_data[0] = 0x40;
|
||||
m_phase = S3511_RTC_DATAOUT;
|
||||
break;
|
||||
case 0x64:
|
||||
break;
|
||||
case 0x65:
|
||||
m_data_len = 7;
|
||||
update_time(m_data_len);
|
||||
m_phase = S3511_RTC_DATAOUT;
|
||||
break;
|
||||
case 0x67:
|
||||
m_data_len = 3;
|
||||
update_time(m_data_len);
|
||||
m_phase = S3511_RTC_DATAOUT;
|
||||
break;
|
||||
default:
|
||||
printf("Unknown RTC command %02X\n", m_command);
|
||||
m_phase = S3511_RTC_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case S3511_RTC_IDLE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
m_last_val = data & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
GBA EEPROM Device
|
||||
|
||||
TODO: can this sketchy EEPROM device be merged
|
||||
with the core implementation?
|
||||
-------------------------------------------------*/
|
||||
|
||||
//
|
||||
|
||||
gba_eeprom_device::gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits) :
|
||||
m_state(EEP_IDLE),
|
||||
m_machine(machine)
|
||||
{
|
||||
m_data = eeprom;
|
||||
m_data_size = size;
|
||||
m_addr_bits = addr_bits;
|
||||
|
||||
m_machine.save().save_item(m_state, "GBA_EEPROM/m_state");
|
||||
m_machine.save().save_item(m_command, "GBA_EEPROM/m_command");
|
||||
m_machine.save().save_item(m_count, "GBA_EEPROM/m_count");
|
||||
m_machine.save().save_item(m_addr, "GBA_EEPROM/m_addr");
|
||||
m_machine.save().save_item(m_bits, "GBA_EEPROM/m_bits");
|
||||
m_machine.save().save_item(m_eep_data, "GBA_EEPROM/m_eep_data");
|
||||
}
|
||||
|
||||
UINT32 gba_eeprom_device::read()
|
||||
{
|
||||
UINT32 out;
|
||||
|
||||
switch (m_state)
|
||||
{
|
||||
case EEP_IDLE:
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, activecpu_get_pc(), 1);
|
||||
return 0x00010001; // "ready"
|
||||
|
||||
case EEP_READFIRST:
|
||||
m_count--;
|
||||
|
||||
if (!m_count)
|
||||
{
|
||||
m_count = 64;
|
||||
m_bits = 0;
|
||||
m_eep_data = 0;
|
||||
m_state = EEP_READ;
|
||||
}
|
||||
break;
|
||||
case EEP_READ:
|
||||
if ((m_bits == 0) && (m_count))
|
||||
{
|
||||
if (m_addr >= m_data_size)
|
||||
{
|
||||
fatalerror("eeprom: invalid address (%x)\n", m_addr);
|
||||
}
|
||||
m_eep_data = m_data[m_addr];
|
||||
//printf("EEPROM read @ %x = %x (%x)\n", m_addr, m_eep_data, (m_eep_data & 0x80) ? 1 : 0);
|
||||
m_addr++;
|
||||
m_bits = 8;
|
||||
}
|
||||
|
||||
out = (m_eep_data & 0x80) ? 1 : 0;
|
||||
out |= (out<<16);
|
||||
m_eep_data <<= 1;
|
||||
|
||||
m_bits--;
|
||||
m_count--;
|
||||
|
||||
if (!m_count)
|
||||
{
|
||||
m_state = EEP_IDLE;
|
||||
}
|
||||
|
||||
// printf("out = %08x\n", out);
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %08x\n", offset, ~mem_mask, m_state, activecpu_get_pc(), out);
|
||||
return out;
|
||||
}
|
||||
// printf("eeprom_r: @ %x, mask %08x (state %d) (PC=%x) = %d\n", offset, ~mem_mask, m_state, space.device().safe_pc(), 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void gba_eeprom_device::write(UINT32 data)
|
||||
{
|
||||
// printf("eeprom_w: %x @ %x (state %d) (PC=%x)\n", data, offset, m_state, space.device().safe_pc());
|
||||
switch (m_state)
|
||||
{
|
||||
case EEP_IDLE:
|
||||
if (data == 1)
|
||||
m_state++;
|
||||
break;
|
||||
|
||||
case EEP_COMMAND:
|
||||
if (data == 1)
|
||||
m_command = EEP_READFIRST;
|
||||
else
|
||||
m_command = EEP_WRITE;
|
||||
m_state = EEP_ADDR;
|
||||
m_count = m_addr_bits;
|
||||
m_addr = 0;
|
||||
break;
|
||||
|
||||
case EEP_ADDR:
|
||||
m_addr <<= 1;
|
||||
m_addr |= (data & 1);
|
||||
m_count--;
|
||||
if (!m_count)
|
||||
{
|
||||
m_addr *= 8; // each address points to 8 bytes
|
||||
if (m_command == EEP_READFIRST)
|
||||
m_state = EEP_AFTERADDR;
|
||||
else
|
||||
{
|
||||
m_count = 64;
|
||||
m_bits = 8;
|
||||
m_state = EEP_WRITE;
|
||||
m_eep_data = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EEP_AFTERADDR:
|
||||
m_state = m_command;
|
||||
m_count = 64;
|
||||
m_bits = 0;
|
||||
m_eep_data = 0;
|
||||
if (m_state == EEP_READFIRST)
|
||||
m_count = 4;
|
||||
break;
|
||||
|
||||
case EEP_WRITE:
|
||||
m_eep_data <<= 1;
|
||||
m_eep_data |= (data & 1);
|
||||
m_bits--;
|
||||
m_count--;
|
||||
|
||||
if (m_bits == 0)
|
||||
{
|
||||
osd_printf_verbose("%08x: EEPROM: %02x to %x\n", machine().device("maincpu")->safe_pc(), m_eep_data, m_addr);
|
||||
if (m_addr >= m_data_size)
|
||||
fatalerror("eeprom: invalid address (%x)\n", m_addr);
|
||||
|
||||
m_data[m_addr] = m_eep_data;
|
||||
m_addr++;
|
||||
m_eep_data = 0;
|
||||
m_bits = 8;
|
||||
}
|
||||
|
||||
if (!m_count)
|
||||
m_state = EEP_AFTERWRITE;
|
||||
break;
|
||||
|
||||
case EEP_AFTERWRITE:
|
||||
m_state = EEP_IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,81 +6,37 @@
|
||||
#include "gba_slot.h"
|
||||
#include "machine/intelfsh.h"
|
||||
|
||||
// GBA RTC device
|
||||
|
||||
// ======================> gba_rom_device
|
||||
|
||||
class gba_rom_device : public device_t,
|
||||
public device_gba_cart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_rom) override { return m_rom[offset]; }
|
||||
enum {
|
||||
S3511_RTC_IDLE = 0,
|
||||
S3511_RTC_DATAOUT,
|
||||
S3511_RTC_DATAIN,
|
||||
S3511_RTC_COMMAND
|
||||
};
|
||||
|
||||
// ======================> gba_rom_sram_device
|
||||
|
||||
class gba_rom_sram_device : public gba_rom_device
|
||||
class gba_s3511_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
gba_s3511_device(running_machine &machine);
|
||||
running_machine &machine() const { return m_machine; }
|
||||
|
||||
void update_time(int len);
|
||||
UINT8 convert_to_bcd(int val);
|
||||
|
||||
int read_line();
|
||||
void write(UINT16 data, int gpio_dirs);
|
||||
|
||||
protected:
|
||||
int m_phase;
|
||||
UINT8 m_last_val, m_bits, m_command;
|
||||
int m_data_len;
|
||||
UINT8 m_data[7];
|
||||
|
||||
running_machine& m_machine;
|
||||
};
|
||||
|
||||
// ======================> gba_rom_flash_device
|
||||
|
||||
class gba_rom_flash_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
|
||||
private:
|
||||
//UINT32 m_flash_size;
|
||||
UINT32 m_flash_mask;
|
||||
required_device<intelfsh8_device> m_flash;
|
||||
};
|
||||
|
||||
// ======================> gba_rom_flash1m_device
|
||||
|
||||
class gba_rom_flash1m_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
|
||||
private:
|
||||
//UINT32 m_flash_size;
|
||||
UINT32 m_flash_mask;
|
||||
required_device<intelfsh8_device> m_flash;
|
||||
};
|
||||
|
||||
// GBA EEPROM device
|
||||
// TODO: is it possible to merge this with the standard EEPROM devices in the core?
|
||||
@ -102,10 +58,10 @@ class gba_eeprom_device
|
||||
public:
|
||||
gba_eeprom_device(running_machine &machine, UINT8 *eeprom, UINT32 size, int addr_bits);
|
||||
running_machine &machine() const { return m_machine; }
|
||||
|
||||
|
||||
UINT32 read();
|
||||
void write(UINT32 data);
|
||||
|
||||
|
||||
protected:
|
||||
UINT8 *m_data;
|
||||
UINT32 m_data_size;
|
||||
@ -116,17 +72,184 @@ protected:
|
||||
int m_bits;
|
||||
int m_addr_bits;
|
||||
UINT8 m_eep_data;
|
||||
|
||||
|
||||
running_machine& m_machine;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// ======================> gba_rom_device
|
||||
|
||||
class gba_rom_device : public device_t,
|
||||
public device_gba_cart_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_rom) override { return m_rom[offset]; }
|
||||
|
||||
virtual DECLARE_READ32_MEMBER(read_gpio) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_gpio) override;
|
||||
|
||||
virtual UINT16 gpio_dev_read(int gpio_dirs) { return 0; }
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) {}
|
||||
|
||||
private:
|
||||
UINT16 m_gpio_regs[4];
|
||||
UINT8 m_gpio_write_only, m_gpio_dirs;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_sram_device
|
||||
|
||||
class gba_rom_sram_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_sram_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_sram_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_drilldoz_device
|
||||
|
||||
class gba_rom_drilldoz_device : public gba_rom_sram_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_drilldoz_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_wariotws_device
|
||||
|
||||
class gba_rom_wariotws_device : public gba_rom_sram_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_wariotws_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual UINT16 gpio_dev_read(int gpio_dirs) override;
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
|
||||
|
||||
private:
|
||||
UINT8 m_last_val;
|
||||
int m_counter;
|
||||
required_ioport m_gyro_z;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_flash_device
|
||||
|
||||
class gba_rom_flash_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_flash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
|
||||
protected:
|
||||
//UINT32 m_flash_size;
|
||||
UINT32 m_flash_mask;
|
||||
required_device<intelfsh8_device> m_flash;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_flash_rtc_device
|
||||
|
||||
class gba_rom_flash_rtc_device : public gba_rom_flash_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual UINT16 gpio_dev_read(int gpio_dirs) override;
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<gba_s3511_device> m_rtc;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_flash1m_device
|
||||
|
||||
class gba_rom_flash1m_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash1m_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_flash1m_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual machine_config_constructor device_mconfig_additions() const override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
|
||||
protected:
|
||||
//UINT32 m_flash_size;
|
||||
UINT32 m_flash_mask;
|
||||
required_device<intelfsh8_device> m_flash;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_flash1m_rtc_device
|
||||
|
||||
class gba_rom_flash1m_rtc_device : public gba_rom_flash1m_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_flash1m_rtc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual UINT16 gpio_dev_read(int gpio_dirs) override;
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<gba_s3511_device> m_rtc;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_eeprom_device
|
||||
|
||||
class gba_rom_eeprom_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_eeprom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
@ -141,12 +264,38 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_yoshiug_device
|
||||
|
||||
class gba_rom_yoshiug_device : public gba_rom_eeprom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_yoshiug_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
// reading and writing
|
||||
virtual DECLARE_READ32_MEMBER(read_tilt) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_tilt) override;
|
||||
|
||||
private:
|
||||
int m_tilt_ready;
|
||||
UINT16 m_xpos, m_ypos;
|
||||
required_ioport m_tilt_x;
|
||||
required_ioport m_tilt_y;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_eeprom64_device
|
||||
|
||||
class gba_rom_eeprom64_device : public gba_rom_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_eeprom64_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
|
||||
gba_rom_eeprom64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
@ -156,11 +305,35 @@ public:
|
||||
virtual DECLARE_READ32_MEMBER(read_ram) override;
|
||||
virtual DECLARE_WRITE32_MEMBER(write_ram) override;
|
||||
|
||||
private:
|
||||
protected:
|
||||
std::unique_ptr<gba_eeprom_device> m_eeprom;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_boktai_device
|
||||
|
||||
class gba_rom_boktai_device : public gba_rom_eeprom64_device
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
gba_rom_boktai_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
|
||||
|
||||
// device-level overrides
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
virtual UINT16 gpio_dev_read(int gpio_dirs) override;
|
||||
virtual void gpio_dev_write(UINT16 data, int gpio_dirs) override;
|
||||
|
||||
private:
|
||||
std::unique_ptr<gba_s3511_device> m_rtc;
|
||||
required_ioport m_sensor;
|
||||
UINT8 m_last_val;
|
||||
int m_counter;
|
||||
};
|
||||
|
||||
|
||||
// ======================> gba_rom_3dmatrix_device
|
||||
|
||||
class gba_rom_3dmatrix_device : public gba_rom_device
|
||||
@ -184,10 +357,16 @@ private:
|
||||
// device type definition
|
||||
extern const device_type GBA_ROM_STD;
|
||||
extern const device_type GBA_ROM_SRAM;
|
||||
extern const device_type GBA_ROM_DRILLDOZ;
|
||||
extern const device_type GBA_ROM_WARIOTWS;
|
||||
extern const device_type GBA_ROM_EEPROM;
|
||||
extern const device_type GBA_ROM_YOSHIUG;
|
||||
extern const device_type GBA_ROM_EEPROM64;
|
||||
extern const device_type GBA_ROM_BOKTAI;
|
||||
extern const device_type GBA_ROM_FLASH;
|
||||
extern const device_type GBA_ROM_FLASH_RTC;
|
||||
extern const device_type GBA_ROM_FLASH1M;
|
||||
extern const device_type GBA_ROM_FLASH1M_RTC;
|
||||
extern const device_type GBA_ROM_3DMATRIX;
|
||||
|
||||
|
||||
|
@ -2118,29 +2118,40 @@ void gba_state::machine_start()
|
||||
membank("rom2")->set_base(cart_rom->base());
|
||||
membank("rom3")->set_base(cart_rom->base());
|
||||
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0x80000c4, 0x80000cb, read32_delegate(FUNC(gba_cart_slot_device::read_gpio),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0x80000c4, 0x80000cb, write32_delegate(FUNC(gba_cart_slot_device::write_gpio),(gba_cart_slot_device*)m_cart));
|
||||
|
||||
// add nvram to save state
|
||||
m_cart->save_nvram();
|
||||
|
||||
// install the cart NVRAM handlers if necessary
|
||||
if (m_cart->get_type() == GBA_SRAM)
|
||||
if (m_cart->get_type() == GBA_SRAM || m_cart->get_type() == GBA_DRILLDOZ || m_cart->get_type() == GBA_WARIOTWS)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
if (m_cart->get_type() == GBA_EEPROM || m_cart->get_type() == GBA_EEPROM4 || m_cart->get_type() == GBA_EEPROM64)
|
||||
if (m_cart->get_type() == GBA_EEPROM || m_cart->get_type() == GBA_EEPROM4 || m_cart->get_type() == GBA_EEPROM64 || m_cart->get_type() == GBA_BOKTAI)
|
||||
{
|
||||
// for games larger than 16MB the actual range is smaller but read_ram/write_ram handles that!
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
if (m_cart->get_type() == GBA_YOSHIUG)
|
||||
{
|
||||
// EEPROM
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xd000000, 0xdffffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xd000000, 0xdffffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
// Tilt Sensor
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe008000, 0xe0085ff, read32_delegate(FUNC(gba_cart_slot_device::read_tilt),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe008000, 0xe0085ff, write32_delegate(FUNC(gba_cart_slot_device::write_tilt),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
// merge the two flash and mask accesses in read_ram?!?
|
||||
if (m_cart->get_type() == GBA_FLASH || m_cart->get_type() == GBA_FLASH512)
|
||||
if (m_cart->get_type() == GBA_FLASH || m_cart->get_type() == GBA_FLASH512 || m_cart->get_type() == GBA_FLASH_RTC)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe00ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe00ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
}
|
||||
if (m_cart->get_type() == GBA_FLASH1M)
|
||||
if (m_cart->get_type() == GBA_FLASH1M || m_cart->get_type() == GBA_FLASH1M_RTC)
|
||||
{
|
||||
m_maincpu->space(AS_PROGRAM).install_read_handler(0xe000000, 0xe01ffff, read32_delegate(FUNC(gba_cart_slot_device::read_ram),(gba_cart_slot_device*)m_cart));
|
||||
m_maincpu->space(AS_PROGRAM).install_write_handler(0xe000000, 0xe01ffff, write32_delegate(FUNC(gba_cart_slot_device::write_ram),(gba_cart_slot_device*)m_cart));
|
||||
@ -2245,15 +2256,21 @@ void gba_state::machine_start()
|
||||
|
||||
|
||||
static SLOT_INTERFACE_START(gba_cart)
|
||||
SLOT_INTERFACE_INTERNAL("gba_rom", GBA_ROM_STD)
|
||||
SLOT_INTERFACE_INTERNAL("gba_sram", GBA_ROM_SRAM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom", GBA_ROM_EEPROM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom_4k", GBA_ROM_EEPROM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom_64k", GBA_ROM_EEPROM64)
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash", GBA_ROM_FLASH) // Panasonic
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_512", GBA_ROM_FLASH) // Panasonic
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_1m", GBA_ROM_FLASH1M) // Sanyo
|
||||
SLOT_INTERFACE_INTERNAL("gba_3dmatrix", GBA_ROM_3DMATRIX)
|
||||
SLOT_INTERFACE_INTERNAL("gba_rom", GBA_ROM_STD)
|
||||
SLOT_INTERFACE_INTERNAL("gba_sram", GBA_ROM_SRAM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_drilldoz", GBA_ROM_DRILLDOZ) // Rumble output unemulated
|
||||
SLOT_INTERFACE_INTERNAL("gba_wariotws", GBA_ROM_WARIOTWS) // Rumble output unemulated
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom", GBA_ROM_EEPROM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom_4k", GBA_ROM_EEPROM)
|
||||
SLOT_INTERFACE_INTERNAL("gba_yoshiug", GBA_ROM_YOSHIUG)
|
||||
SLOT_INTERFACE_INTERNAL("gba_eeprom_64k", GBA_ROM_EEPROM64)
|
||||
SLOT_INTERFACE_INTERNAL("gba_boktai", GBA_ROM_BOKTAI)
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash", GBA_ROM_FLASH) // Panasonic
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_rtc", GBA_ROM_FLASH_RTC) // Panasonic
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_512", GBA_ROM_FLASH) // Panasonic
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_1m", GBA_ROM_FLASH1M) // Sanyo
|
||||
SLOT_INTERFACE_INTERNAL("gba_flash_1m_rtc", GBA_ROM_FLASH1M_RTC) // Sanyo
|
||||
SLOT_INTERFACE_INTERNAL("gba_3dmatrix", GBA_ROM_3DMATRIX)
|
||||
SLOT_INTERFACE_END
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user