diff options
-rw-r--r-- | hash/c2color_cart.xml | 60 | ||||
-rw-r--r-- | hash/monon_color.xml | 49 | ||||
-rw-r--r-- | src/mame/misc/monon_color.cpp | 239 | ||||
-rw-r--r-- | src/mame/skeleton/c2color.cpp | 37 |
4 files changed, 263 insertions, 122 deletions
diff --git a/hash/c2color_cart.xml b/hash/c2color_cart.xml index 6c212cdc5e9..ab6370bc751 100644 --- a/hash/c2color_cart.xml +++ b/hash/c2color_cart.xml @@ -6,28 +6,66 @@ license:CC0 <softwarelist name="c2color_cart" description="C2 Color cartridges"> <!-- - Chinese name Pinyin English Translation Released? Dumped? Year Released Cartridge # Publisher Notes Note 2: - 带龙王封印 Dài Lóngwáng Fēngyìn The Agreement with the Dragon King Y N 2015 1 Baiyi Animation Not a separate game, an extension for the built in game - 之翼王的试炼 Zhī Yìwáng De Shì Liàn The Trials of King Wing Y N 2015 2 Baiyi Animation Not a separate game, an extension for the built in game - 之英雄岛之烈焰魔 Zhī Yīngxióng Dǎo Zhī Lièyàn Mó The Fire Devil of Hero Island Y N 2015 3 Baiyi Animation Not a separate game, an extension for the built in game - 暗黑势力再临 Ànhēi Shìlì Zài Lín The Dark Ones Come Again Y Y 2015 4 Baiyi Animation Not a separate game, an extension for the built in game - 神秘的龙族之王 Shénmì De Lóngzú Zhī Wáng The Mysterious King of the Dragon Land Y Y 2015 5 Baiyi Animation Not a separate game, an extension for the built in game - 植物大战僵尸2 Zhíwù Dàzhàn Jiāngshī 2 Plants vs. Zombies 2 N N N/A 6 PopCap Games Supposed to be the only standalone game for the C2 Supposed to be released Q1 2016, but never was - ? ? Locke Kingdom search N N N/A 7 Baiyi Animation Not a separate game, an extension for the built in game Mentioned as coming soon in a promotional booklet + Pinyin English Translation Released? Dumped? Year Released Cartridge # Publisher Chinese Name + + These are not standalone games, but extensions for the built in game + Dài Lóngwáng Fēngyìn The Agreement with the Dragon King Y Y 2015 1 Baiyi Animation 带龙王封印 + Zhī Yìwáng De Shì Liàn The Trials of King Wing Y Y 2015 2 Baiyi Animation 之翼王的试炼 + Zhī Yīngxióng Dǎo Zhī Lièyàn Mó The Fire Devil of Hero Island Y N 2015 3 Baiyi Animation 之英雄岛之烈焰魔 + Ànhēi Shìlì Zài Lín The Dark Ones Come Again Y Y 2015 4 Baiyi Animation 暗黑势力再临 + Shénmì De Lóngzú Zhī Wáng The Mysterious King of the Dragon Land Y Y 2015 5 Baiyi Animation 神秘的龙族之王 + + unreleased games: + + Supposed to be the only standalone game for the C2 Supposed to be released Q1 2016, but never was + Zhíwù Dàzhàn Jiāngshī 2 Plants vs. Zombies 2 N N N/A 6 PopCap Games 植物大战僵尸2 + + Mentioned as coming soon in a promotional booklet (another extension?) + ? Locke Kingdom search N N N/A 7 Baiyi Animation ? --> + <!-- see driver for notes about the structure of these, the game ID is at 0x20000 for example --> + + <!-- Green package --> + <software name="agree" supported="no"> + <description>Dì 1 dàn: Dài Lóngwáng Fēngyìn</description> + <year>2015</year> + <publisher>Baiyi Animation</publisher> + <info name="alt_title" value="第4弹:暗黑势力再临"/> + <part name="cart" interface="c2color_cart"> + <dataarea name="rom" size="0x800000"> + <rom name="game1_agree.bin" size="0x800000" crc="e520140f" sha1="4059f9a142238c7976ae59008e92e86170c2eed5" /> + </dataarea> + </part> + </software> + + <!-- Red package --> + <software name="kingwing" supported="no"> + <description>Dì 2 dàn: Zhī Yìwáng De Shì Liàn</description> + <year>2015</year> + <publisher>Baiyi Animation</publisher> + <info name="alt_title" value="第4弹:暗黑势力再临"/> + <part name="cart" interface="c2color_cart"> + <dataarea name="rom" size="0x400000"> + <rom name="game2_kingwing.bin" size="0x400000" crc="64bd94ca" sha1="7da9bfddb48c83ade523850c1e714d3e6310b5f3" /> + </dataarea> + </part> + </software> + + <!-- Yellow package --> <software name="darkones" supported="no"> <description>Dì 4 dàn: Ànhēi Shìlì Zài Lín</description> <year>2015</year> <publisher>Baiyi Animation</publisher> <info name="alt_title" value="第4弹:暗黑势力再临"/> <part name="cart" interface="c2color_cart"> - <dataarea name="rom" size="0x800000"> - <rom name="darkones.bin" size="0x800000" crc="d2735c91" sha1="f71c1cd300893a22e52d046bc9c489e0236c6b88" /> + <dataarea name="rom" size="0x400000"> + <rom name="game4_darkones.bin" size="0x400000" crc="74acb584" sha1="8c7e8b551dcd801c16bc6db159f0d6c5bf20906a" /> </dataarea> </part> </software> + <!-- Black package --> <software name="kingdlnd" supported="no"> <description>Dì 5 dàn: Shénmì De Lóngzú Zhī Wáng</description> <year>2015</year> @@ -35,7 +73,7 @@ license:CC0 <info name="alt_title" value="第5弹:神秘的龙族之王"/> <part name="cart" interface="c2color_cart"> <dataarea name="rom" size="0x800000"> - <rom name="kingdlnd.bin" size="0x800000" crc="1e20d906" sha1="323df1ce05ff4fc1aaefe3e0e2b929aec40cc230" /> + <rom name="game5_kingdlnd.bin" size="0x800000" crc="1e20d906" sha1="323df1ce05ff4fc1aaefe3e0e2b929aec40cc230" /> </dataarea> </part> </software> diff --git a/hash/monon_color.xml b/hash/monon_color.xml index 52e45b109d0..344be821701 100644 --- a/hash/monon_color.xml +++ b/hash/monon_color.xml @@ -19,15 +19,15 @@ license:CC0 Seer: Energy Battle Sài ěr hào-néngyuán dà zuòzhàn Y Y NO. 105 PUZ 赛尔号-能源大作战 Iron Man: Hero Strike Gāngtiě xiá-yīngxióng fǎnjí zhàn Y Y NO. 106 ACT 钢铁侠-英雄反击战 Zombie Hunter Jiāngshī lièrén Y Y NO. 107 ACT 僵尸猎人 - IELTS Adventure Yǎsī tǎ dà màoxiǎn N Y NO. 108 PUZ/EDU 雅思塔大冒险 - Ultimate Brain Power Nǎolì liánlián kàn N Y NO. 109 PUZ/EDU 脑力连连看 + IELTS Adventure Yǎsī tǎ dà màoxiǎn Y Y NO. 108 PUZ/EDU 雅思塔大冒险 + Ultimate Brain Power Nǎolì liánlián kàn Y Y NO. 109 PUZ/EDU 脑力连连看 Roco Kingdom: Big Adventure Luòkè wángguó-dà màoxiǎn Y Y NO. 201 ACT 洛克王国-大冒险 Roco Kingdom RPG: Ice Blue Luòkè wángguó-bīng zhī lán Y Y NO. 202 RPG 洛克王国-冰之蓝 Roco Kingdom RPG: Black Flame Luòkè wángguó-hēi zhī yán Y Y NO. 203 RPG 洛克王国-黑之炎 Roco Kingdom: Card Wars Luòkè wángguó-kǎ pái zhàn jì Y Y NO. 204 RPG 洛克王国-卡牌战纪 Armor Warrior Kǎijiǎ yǒngshì dàluàn dòu Y Y NO. 205 ACT 铠甲勇士大乱斗 Roco Kingdom: The King's Badge Luòkè wángguó-wángzhě huīzhāng Y Y NO. 206 RPG 洛克王国-王者徽章 - Laboratory Mathematica Olympiad Àoshù shíyàn shì N Y NO. 207 PUZ/EDU 奥数实验室 + Laboratory Mathematica Olympiad Àoshù shíyàn shì Y Y NO. 207 PUZ/EDU 奥数实验室 Logic Fight Luójí pīn yī pīn Y Y NO. 301 PUZ/EDU 逻辑拼一拼 Pleasant Goat and Big Big Wolf's comet battle Xǐyángyáng yǔ huītàiláng-juézhàn miē xīng Y Y NO. 302 PUZ/EDU 喜羊羊与灰太狼-决战咩星 Dragon Ball: Budokai Lóngzhū-wǔdào dàhuì Y Y NO. 303 ACT 龙珠-武道大会 @@ -136,6 +136,30 @@ license:CC0 </part> </software> + <software name="ielts"> <!-- 108 - IELTS Adventure --> + <description>Yǎsī tǎ dà màoxiǎn</description> + <year>2014</year> + <publisher>M&D</publisher> + <info name="alt_title" value="雅思塔大冒险"/> + <part name="cart" interface="monon_color_cart"> + <dataarea name="rom" size="0x0800000"> + <rom name="108.bin" size="0x0800000" crc="73c5d04b" sha1="e4fd91d8b86860c2ed973bc6114099a5cea41555"/> + </dataarea> + </part> + </software> + + <software name="ultbrain"> <!-- 109 - Ultimate Brain Power --> + <description>Nǎolì liánlián kàn</description> + <year>2014</year> + <publisher>M&D</publisher> + <info name="alt_title" value="脑力连连看"/> + <part name="cart" interface="monon_color_cart"> + <dataarea name="rom" size="0x0400000"> + <rom name="109.bin" size="0x0400000" crc="7e78ed72" sha1="cd2ce46b60fd2d76671e43d69e7fc1938422bd2a"/> + </dataarea> + </part> + </software> + <software name="rocoba"> <!-- 201 - Roco Kingdom: Big Adventure --> <description>Luòkè wángguó-dà màoxiǎn</description> <year>2014</year> @@ -152,7 +176,7 @@ license:CC0 <description>Luòkè wángguó-bīng zhī lán</description> <year>2014</year> <publisher>M&D</publisher> - <info name="alt_title" value="冰之蓝"/> + <info name="alt_title" value="洛克王国-冰之蓝"/> <part name="cart" interface="monon_color_cart"> <dataarea name="rom" size="0x1000000"> <rom name="202.bin" size="0x1000000" crc="e5f1e94f" sha1="ca95171b8b01367f05156656397789c66f0e0ffb"/> @@ -198,7 +222,7 @@ license:CC0 </software> <!-- there is a second glob in the cartridge, presumably for the badge reader --> - <software name="rocobadg" supported="no"> <!-- Roco Kingdom: The King's Badge --> + <software name="rocobadg" supported="no"> <!-- 206 - Roco Kingdom: The King's Badge --> <description>Luòkè wángguó-wángzhě huīzhāng</description> <year>2015</year> <publisher>M&D</publisher> @@ -210,6 +234,21 @@ license:CC0 </part> </software> + <!-- 207 wasn't printed anywhere on the box or the cartridge, number taken from list in header --> + <software name="labmath"> <!-- 207 - Laboratory Mathematica Olympiad --> + <description>Àoshù shíyàn shì</description> + <year>2014</year> + <publisher>M&D</publisher> + <info name="alt_title" value="奥数实验室"/> + <part name="cart" interface="monon_color_cart"> + <dataarea name="rom" size="0x0400000"> + <!--<rom name="207.bin" size="0x0400000" crc="6db7936d" sha1="09d52653bc41976de9ad0e424cf9cbfb58e711dc"/>--> + <!-- the above ROM is cleaned of save data, but the ROM below, with the save area populated, was from a cartridge that had never been removed from packaging --> + <rom name="207.bin" size="0x0400000" crc="51728461" sha1="aad4bb82c20ab4706c64826c2f09bf59286255f0"/> + </dataarea> + </part> + </software> + <software name="logicft"> <!-- 301 - Logic Fight --> <description>Luójí pīn yī pīn</description> <year>2015</year> diff --git a/src/mame/misc/monon_color.cpp b/src/mame/misc/monon_color.cpp index a3518b3c3ca..177654a34b6 100644 --- a/src/mame/misc/monon_color.cpp +++ b/src/mame/misc/monon_color.cpp @@ -61,10 +61,11 @@ #include "bus/mononcol/carts.h" #include "cpu/axc51/axc51.h" +#include "cpu/m6502/m65ce02.h" #include "sound/dac.h" #define LOG_VDP (1U << 1) -#define LOG_SOUNDMCUCOMMS (1U << 2) +#define LOG_MUSICMCUCOMMS (1U << 2) //#define VERBOSE (LOG_VDP) #define VERBOSE (0) @@ -78,6 +79,8 @@ public: : driver_device(mconfig, type, tag), m_cart(*this, "cartslot"), m_maincpu(*this, "maincpu"), + m_musicmcu(*this, "musicmcu"), + m_musicrom(*this, "musicmcu"), m_screen(*this, "screen"), m_palette(*this, "palette"), m_dac(*this, "dac"), @@ -98,12 +101,17 @@ private: required_device<mononcol_cartslot_device> m_cart; required_device<ax208_cpu_device> m_maincpu; + required_device<m65ce02_device> m_musicmcu; + required_region_ptr<uint8_t> m_musicrom; required_device<screen_device> m_screen; required_device<palette_device> m_palette; required_device<dac_8bit_r2r_twos_complement_device> m_dac; required_ioport_array<4> m_debugin; required_ioport_array<4> m_controls; + void music_mem(address_map &map); + uint8_t music_rts_r(); + uint8_t in0_r(); uint8_t in1_r(); uint8_t in2_r(); @@ -128,12 +136,6 @@ private: return m_cart->read(); } - uint8_t spibuf_direct_r() - { - m_lastspi = m_cart->read(); - return m_lastspi; - } - DECLARE_WRITE_LINE_MEMBER(spidir_w) { m_cart->dir_w(state); @@ -144,12 +146,12 @@ private: m_cart->write(data); } - void get_sound_command_bit(uint8_t bit); - bool m_sound_direction_iswrite; - uint16_t m_sound_latch; - uint8_t m_sound_bitpos; - uint8_t m_sound_response_bit; - uint8_t m_sound_bits_in_needed; + void get_music_command_bit(uint8_t bit); + bool m_music_direction_iswrite; + uint16_t m_music_latch; + uint8_t m_music_bitpos; + uint8_t m_music_response_bit; + uint8_t m_music_bits_in_needed; void do_draw_inner(int pal_to_use, int start, int step, int pixmask, int amount); void do_draw(int amount, int pal_to_use); @@ -168,8 +170,6 @@ private: uint8_t m_out1data; uint8_t m_out0data; - uint8_t m_lastspi; - uint8_t m_curpal[0x800 * 3]; }; @@ -190,11 +190,11 @@ void monon_color_state::machine_start() save_item(NAME(m_curpal)); save_item(NAME(m_storeregs)); - save_item(NAME(m_sound_direction_iswrite)); - save_item(NAME(m_sound_latch)); - save_item(NAME(m_sound_bitpos)); - save_item(NAME(m_sound_response_bit)); - save_item(NAME(m_sound_bits_in_needed)); + save_item(NAME(m_music_direction_iswrite)); + save_item(NAME(m_music_latch)); + save_item(NAME(m_music_bitpos)); + save_item(NAME(m_music_response_bit)); + save_item(NAME(m_music_bits_in_needed)); } @@ -226,13 +226,16 @@ void monon_color_state::machine_reset() m_bufpos_y = 239; std::fill(std::begin(m_storeregs), std::end(m_storeregs), 0); - std::fill(std::begin(m_linebuf), std::end(m_linebuf), 0); + std::fill(std::begin(m_linebuf), std::end(m_linebuf), 0); + + m_music_direction_iswrite = true; + m_music_latch = 0; + m_music_bitpos = 0; + m_music_response_bit = 0; + m_music_bits_in_needed = 0; - m_sound_direction_iswrite = true; - m_sound_latch = 0; - m_sound_bitpos = 0; - m_sound_response_bit = 0; - m_sound_bits_in_needed = 0; + // don't need it running for now as the program is incomplete + m_musicmcu->suspend(SUSPEND_REASON_DISABLE, 1); } @@ -370,12 +373,12 @@ static INPUT_PORTS_START( monon_color ) INPUT_PORTS_END /* - muxselect = p1 & 0x18; + muxselect = p1 & 0x18; - 0x30 input bits in p0 - 0x04 input bits in p2 + 0x30 input bits in p0 + 0x04 input bits in p2 - 0x04 in port 4 combine inputs? + 0x04 in port 4 combine inputs? */ uint8_t monon_color_state::read_current_inputs() @@ -432,7 +435,7 @@ uint8_t monon_color_state::in2_r() { uint8_t in = read_current_inputs(); uint8_t ret = m_out2data & 0x7b; - ret |= m_sound_response_bit << 7; + ret |= m_music_response_bit << 7; if (in & 0x04) ret |= 0x04; return ret; @@ -491,90 +494,88 @@ void monon_color_state::out1_w(uint8_t data) } -void monon_color_state::get_sound_command_bit(uint8_t bit) +void monon_color_state::get_music_command_bit(uint8_t bit) { bit &= 1; - if (m_sound_bitpos == 0) + if (m_music_bitpos == 0) { // first bit isn't part of the data? but isn't 0/1 depending on if it's a read/write either? - //LOGMASKED(LOG_SOUNDMCUCOMMS, "%s: started read/write command\n", machine().describe_context()); - m_sound_bitpos++; - - if (!m_sound_direction_iswrite) - { - // There is a protection check involving the axxx commands - // The game expects to read a byte from the sound MCU and - // compares it with a byte in the SPI ROM from e000 - efff - // - // This data in the SPI ROM is 65ec02 code that maps at - // 0x2000, so the check is presumably checking a random byte - // from part of the internal sound MCU ROM against the table - // stored in ROM. Sadly the internal program is larger than - // the 0x1000 bytes of it that have been duplicated in the - // SPI ROM for this check. - // - // If it doesn't get this, it will loop until by chance it gets the same - // value, which results in random delays (eg. when moving the volume - // slider from 0 to any other value) - // - // mechcycla (the game with the earliest firmware) will jump to an infinite - // loop if this is wrong, this doesn't happen with mechcycl, which uses a - // later firmware. - - m_sound_latch = m_lastspi; - //logerror("m_sound_latch set to %02x\n", m_sound_latch); - - } + //LOGMASKED(LOG_MUSICMCUCOMMS, "%s: started read/write command\n", machine().describe_context()); + m_music_bitpos++; } else { - if (m_sound_direction_iswrite) + if (m_music_direction_iswrite) { - m_sound_latch = m_sound_latch << 1; - m_sound_latch |= bit; + m_music_latch = m_music_latch << 1; + m_music_latch |= bit; - m_sound_bitpos++; + m_music_bitpos++; - if (m_sound_bitpos == 17) + if (m_music_bitpos == 17) { - //LOGMASKED(LOG_SOUNDMCUCOMMS, "%s: sent sound word %04x to MCU\n", machine().describe_context(), m_sound_latch); - m_sound_bitpos = 0; + //LOGMASKED(LOG_MUSICMCUCOMMS, "%s: sent sound word %04x to MCU\n", machine().describe_context(), m_music_latch); + m_music_bitpos = 0; - switch (m_sound_latch & 0xf000) + switch (m_music_latch & 0xf000) { case 0x0000: - LOGMASKED(LOG_SOUNDMCUCOMMS, "0-00x set volume to %04x\n", m_sound_latch & 0x0fff); - m_sound_latch = 0; + LOGMASKED(LOG_MUSICMCUCOMMS, "0-00x set volume to %04x\n", m_music_latch & 0x0fff); + m_music_latch = 0; break; case 0x2000: - LOGMASKED(LOG_SOUNDMCUCOMMS, "2-00x play music %04x\n", m_sound_latch & 0x0fff); - m_sound_latch = 0; + LOGMASKED(LOG_MUSICMCUCOMMS, "2-00x play music %04x\n", m_music_latch & 0x0fff); + m_music_latch = 0; break; case 0x3000: - LOGMASKED(LOG_SOUNDMCUCOMMS, "3-000 stop all %04x\n", m_sound_latch & 0x0fff); - m_sound_latch = 0; + LOGMASKED(LOG_MUSICMCUCOMMS, "3-000 stop all %04x\n", m_music_latch & 0x0fff); + m_music_latch = 0; break; case 0x4000: - LOGMASKED(LOG_SOUNDMCUCOMMS, "4-000 reset? %04x\n", m_sound_latch & 0x0fff); - m_sound_latch = 0; + LOGMASKED(LOG_MUSICMCUCOMMS, "4-000 reset? %04x\n", m_music_latch & 0x0fff); + m_music_latch = 0; break; case 0xa000: - // spams a variable amount of this between scenes - // This appears to be for copy protection purposes, see note above - LOGMASKED(LOG_SOUNDMCUCOMMS, "a-xxx status return wanted %04x\n", m_sound_latch & 0x0fff); - m_sound_direction_iswrite = false; - m_sound_bits_in_needed = 9; + // Spams this command a variable amount of this between scenes + + // There is a protection check involving the axxx commands + // The game expects to read a byte from the music MCU and + // compares it with a byte in the SPI ROM from e000 - efff + // + // This data in the SPI ROM is 65ce02 code that maps at + // 0x2000, so the check is presumably checking a random byte + // from part of the internal music MCU ROM against the table + // stored in ROM. Sadly the internal program is larger than + // the 0x1000 bytes of it that have been duplicated in the + // SPI ROM for this check. + // + // If it doesn't get this, it will loop until by chance it gets the same + // value, which results in random delays (eg. when moving the volume + // slider from 0 to any other value) + // + // mechcycla (the game with the earliest firmware) will jump to an infinite + // loop if this is wrong, this doesn't happen with mechcycl, which uses a + // later firmware. + // + // unfortunately no way of getting the MCU to read out anytihng + // other than the single 0x1000 range it checks using the axxx commands + // has been found. + + LOGMASKED(LOG_MUSICMCUCOMMS, "a-xxx status return wanted %04x\n", m_music_latch & 0x0fff); + m_music_direction_iswrite = false; + m_music_bits_in_needed = 9; + m_music_latch = m_musicrom[m_music_latch & 0xfff]; break; default: - LOGMASKED(LOG_SOUNDMCUCOMMS, "x-xxx unknown MCU write %04x\n", m_sound_latch); - m_sound_latch = 0; + LOGMASKED(LOG_MUSICMCUCOMMS, "x-xxx unknown MCU write %04x\n", m_music_latch); + m_music_latch = 0; break; } @@ -583,16 +584,16 @@ void monon_color_state::get_sound_command_bit(uint8_t bit) } else { - m_sound_response_bit = (m_sound_latch & 0x80)>>7; - m_sound_latch <<= 1; + m_music_response_bit = (m_music_latch & 0x80)>>7; + m_music_latch <<= 1; - m_sound_bitpos++; + m_music_bitpos++; - if (m_sound_bitpos == m_sound_bits_in_needed) + if (m_music_bitpos == m_music_bits_in_needed) { - //LOGMASKED(LOG_SOUNDMCUCOMMS, "%s: finished clocking in MCU response to read?\n", machine().describe_context()); - m_sound_bitpos = 0; - m_sound_direction_iswrite = true; + //LOGMASKED(LOG_MUSICMCUCOMMS, "%s: finished clocking in MCU response to read?\n", machine().describe_context()); + m_music_bitpos = 0; + m_music_direction_iswrite = true; } } } @@ -600,7 +601,7 @@ void monon_color_state::get_sound_command_bit(uint8_t bit) void monon_color_state::out2_w(uint8_t data) { - // on the cartridge PCB the connections to the sound MCU glob are marked P21, P25 and P27 + // on the cartridge PCB the connections to the music MCU glob are marked P21, P25 and P27 // This is where the signals go on the AX208 (Port 2 bit 1, Port 2 bit 5, Port 2 bit 7) // m-C- --Ms @@ -631,8 +632,8 @@ void monon_color_state::out2_w(uint8_t data) else { // sends m_out2data & 0x02 to external device / latches a read bit into m_out2data & 0x80 - //logerror("%s: send / receive sound MCU, bit written %d\n", machine().describe_context(), (data & 0x02) >> 1); - get_sound_command_bit((data & 0x02) >> 1); + //logerror("%s: send / receive music MCU, bit written %d\n", machine().describe_context(), (data & 0x02) >> 1); + get_music_command_bit((data & 0x02) >> 1); } } @@ -700,7 +701,7 @@ void monon_color_state::do_draw_inner(int pal_to_use, int start, int step, int p else { m_linebuf[real_ypos] = rgb; - + } } } @@ -716,15 +717,15 @@ void monon_color_state::do_draw(int amount, int pal_to_use) } else if (m_storeregs[0x12] == 0x12) // 4bpp mode { - do_draw_inner(pal_to_use, 4, 4, 0xf, amount); + do_draw_inner(pal_to_use, 4, 4, 0xf, amount); } else if (m_storeregs[0x12] == 0x11) // 2bpp mode { - do_draw_inner(pal_to_use, 6, 2, 0x3, amount); + do_draw_inner(pal_to_use, 6, 2, 0x3, amount); } else if (m_storeregs[0x12] == 0x10) // 1bpp mode { - do_draw_inner(pal_to_use, 7, 1, 1, amount); + do_draw_inner(pal_to_use, 7, 1, 1, amount); } m_bufpos_y = 239; @@ -741,7 +742,7 @@ void monon_color_state::do_palette(int amount, int pal_to_use) m_curpal[address] = romdat; int entry = address / 3; - m_palette->set_pen_color(entry, rgb_t(m_curpal[(entry * 3) + 2], m_curpal[(entry * 3) + 1], m_curpal[(entry * 3) + 0])); + m_palette->set_pen_color(entry, rgb_t(m_curpal[(entry * 3) + 2], m_curpal[(entry * 3) + 1], m_curpal[(entry * 3) + 0])); } } @@ -795,8 +796,8 @@ void monon_color_state::write_to_video_device(uint8_t data) m_storeregs[m_out0data] = data; } - // popmessage("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x | %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", m_storeregs[0x00], m_storeregs[0x01], m_storeregs[0x02], m_storeregs[0x03], m_storeregs[0x04], m_storeregs[0x05], m_storeregs[0x06], m_storeregs[0x07], m_storeregs[0x08], m_storeregs[0x09], m_storeregs[0x0a], m_storeregs[0x0b], m_storeregs[0x0c], m_storeregs[0x0d], m_storeregs[0x0e], m_storeregs[0x0f], - // m_storeregs[0x10], m_storeregs[0x11], m_storeregs[0x12], m_storeregs[0x13], m_storeregs[0x14], m_storeregs[0x15], m_storeregs[0x16], m_storeregs[0x17], m_storeregs[0x18], m_storeregs[0x19], m_storeregs[0x1a], m_storeregs[0x1b], m_storeregs[0x1c], m_storeregs[0x1d], m_storeregs[0x1e], m_storeregs[0x1f]); + // popmessage("%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x | %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", m_storeregs[0x00], m_storeregs[0x01], m_storeregs[0x02], m_storeregs[0x03], m_storeregs[0x04], m_storeregs[0x05], m_storeregs[0x06], m_storeregs[0x07], m_storeregs[0x08], m_storeregs[0x09], m_storeregs[0x0a], m_storeregs[0x0b], m_storeregs[0x0c], m_storeregs[0x0d], m_storeregs[0x0e], m_storeregs[0x0f], + // m_storeregs[0x10], m_storeregs[0x11], m_storeregs[0x12], m_storeregs[0x13], m_storeregs[0x14], m_storeregs[0x15], m_storeregs[0x16], m_storeregs[0x17], m_storeregs[0x18], m_storeregs[0x19], m_storeregs[0x1a], m_storeregs[0x1b], m_storeregs[0x1c], m_storeregs[0x1d], m_storeregs[0x1e], m_storeregs[0x1f]); } else if (m_out4data == 0x09) @@ -901,6 +902,25 @@ void monon_color_state::out4_w(uint8_t data) m_out4data = data; } + +uint8_t monon_color_state::music_rts_r() +{ + return 0x60; +} + +void monon_color_state::music_mem(address_map &map) +{ + map(0x0000, 0x01ff).ram(); + + map(0x2000, 0x2fff).rom().region("musicmcu", 0x0000); + map(0x3000, 0x3fff).r(FUNC(monon_color_state::music_rts_r)); // likely ROM here, lots of JSR calls + + map(0xa000, 0xafff).r(FUNC(monon_color_state::music_rts_r)); // likely ROM here, lots of JSR calls + + map(0xfff0, 0xffff).rom().region("musicmcu", 0x1ff0); +} + + void monon_color_state::monon_color(machine_config &config) { /* basic machine hardware */ @@ -915,12 +935,15 @@ void monon_color_state::monon_color(machine_config &config) m_maincpu->port_out_cb<2>().set(FUNC(monon_color_state::out2_w)); m_maincpu->port_out_cb<3>().set(FUNC(monon_color_state::out3_w)); m_maincpu->port_out_cb<4>().set(FUNC(monon_color_state::out4_w)); - m_maincpu->spi_in_cb().set(FUNC(monon_color_state::spibuf_direct_r)); + m_maincpu->spi_in_cb().set(FUNC(monon_color_state::spibuf_r)); m_maincpu->spi_out_cb().set(FUNC(monon_color_state::spibuf_w)); m_maincpu->spi_out_dir_cb().set(FUNC(monon_color_state::spidir_w)); m_maincpu->dac_out_cb<0>().set(FUNC(monon_color_state::dacout0_w)); m_maincpu->dac_out_cb<1>().set(FUNC(monon_color_state::dacout1_w)); + M65CE02(config, m_musicmcu, 4000000); + m_musicmcu->set_addrmap(AS_PROGRAM, &monon_color_state::music_mem); + /* video hardware */ // is this a 3:4 (true vertical) 240x320 screen rotated on its side? @@ -938,7 +961,7 @@ void monon_color_state::monon_color(machine_config &config) SPEAKER(config, "mono").front_center(); DAC_8BIT_R2R_TWOS_COMPLEMENT(config, m_dac, 0).add_route(ALL_OUTPUTS, "mono", 0.500); // should this be in the AX208 device? - + mononcol_cartslot_device &cartslot(MONONCOL_CARTSLOT(config, "cartslot", mononcol_plain_slot)); cartslot.set_must_be_loaded(true); @@ -947,6 +970,16 @@ void monon_color_state::monon_color(machine_config &config) } ROM_START( mononcol ) + // TODO: each cartridge has a music MCU inside of it. This data appears to be 0x1000 bytes of the + // program that is checked as 'security' and can be found in the SPI ROMs. A way to dump + // the full ROM is needed, at which point the game specific music MCU ROMs should be + // moved into the software list. This just allows us to study what exists of this sound + // program until then. + ROM_REGION( 0x2000, "musicmcu", ROMREGION_ERASEFF ) + ROM_LOAD( "music_mcu.bin", 0x0000, 0x1000, BAD_DUMP CRC(54224c67) SHA1(4a4e1d6995e6c8a36e3979bc22b8e9a1ea8f954f) ) + // fake boot vector, as we don't have one, but the code above expects to boot at 0x2000 + ROM_FILL( 0x1ffc, 0x1, 0x00 ) + ROM_FILL( 0x1ffd, 0x1, 0x20 ) ROM_END CONS( 2014, mononcol, 0, 0, monon_color, monon_color, monon_color_state, empty_init, "M&D", "Monon Color", MACHINE_IMPERFECT_TIMING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) diff --git a/src/mame/skeleton/c2color.cpp b/src/mame/skeleton/c2color.cpp index fb386ae8bcc..3efa00c721d 100644 --- a/src/mame/skeleton/c2color.cpp +++ b/src/mame/skeleton/c2color.cpp @@ -20,7 +20,10 @@ https://www.youtube.com/watch?v=D3XO4aTZEko TODO: - identify CPU type, and if the system ROM is needed to run carts or not + identify CPU type - It's an i8051 derived CPU, and seems to be "Mars Semiconductor Corp" related, there is a MARS-PCCAM string + amongst other things, this is a known USB identifier for the "Discovery Kids Digital Camera" + Possibly a MR97327B, which is listed as RISC-51 in places, but little information can be found in English + *******************************************************************************/ @@ -145,8 +148,36 @@ void c2_color_state::c2_color(machine_config &config) } ROM_START( c2color ) - ROM_REGION( 0x800000, "maincpu", ROMREGION_ERASEFF ) - ROM_LOAD( "system.rom", 0x000000, 0x400000, NO_DUMP ) // must have an internal rom for the built in game, unknown size etc. + ROM_REGION( 0x4000, "maincpu", ROMREGION_ERASEFF ) + ROM_LOAD( "bootloader", 0x0000, 0x4000, NO_DUMP ) + + // As with the cartridges, each of these has a 0x20 byte header before the i8051 + // code starts. This suggests it is unlikely the game runs directly from the SPI + // ROM and more likely a bootloader copies the code into RAM. + // The Mainboard has a 2MByte DRAM on it + + // This, the larger of the 2 ROMs contains unique code, it appears to be the base + // game, and system functions. It also has some 16-bit signed PCM samples. + ROM_REGION( 0x800000, "spi1", ROMREGION_ERASEFF ) + ROM_LOAD( "spi.u7", 0x000000, 0x800000, CRC(6a4d2cd2) SHA1(46e109bbd5db206911716919ad13efc080cbdf34) ) + + // The smaller ROM is much more similar to the cartridges (actually identical up + // until the first MRDB resource block at 0x26000 aside from a few bytes in the + // 0x20 header, and the game number at the 0x20000 mark being 0) + // + // This ROM also has a 2nd MRDB resource block, whereas the cartridges only have + // a single block + // + // The code still contains a lot of generic 'firmware' like functions, but it is + // unclear if any of the code is used, or if these ROMs are used more like skins + // for the base game, accessing the resource table only + // + // A large number of graphics, which are assumed to be JPEG compressed are indexed + // by the MRDB tables, no sound effects or non-graphical resources have been + // identified + + ROM_REGION( 0x400000, "spi2", ROMREGION_ERASEFF ) + ROM_LOAD( "spi.u16", 0x000000, 0x400000, CRC(9101b02a) SHA1(8c31e7641f4667bd8d5d7cc991cd5976828a0628) ) ROM_END // year, name, parent, compat, machine, input, class, init, company, fullname, flags |