summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/flstory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/flstory.cpp')
-rw-r--r--src/mame/drivers/flstory.cpp211
1 files changed, 7 insertions, 204 deletions
diff --git a/src/mame/drivers/flstory.cpp b/src/mame/drivers/flstory.cpp
index 18650cac317..8c5fd46ff7a 100644
--- a/src/mame/drivers/flstory.cpp
+++ b/src/mame/drivers/flstory.cpp
@@ -156,191 +156,11 @@ static ADDRESS_MAP_START( victnine_map, AS_PROGRAM, 8, flstory_state )
AM_RANGE(0xe000, 0xe7ff) AM_RAM AM_SHARE("workram") /* work RAM */
ADDRESS_MAP_END
-
-READ8_MEMBER(flstory_state::rumba_mcu_r)
-{
- //printf("PC=%04x R %02x\n",space.device().safe_pc(),m_mcu_cmd);
-
- if((m_mcu_cmd & 0xf0) == 0x00) // end packet cmd, value returned is meaningless (probably used for main <-> mcu comms syncronization)
- return 0;
-
- switch(m_mcu_cmd)
- {
- case 0x73: return 0xa4; //initial MCU check
- case 0x33: return m_mcu_b2_res; //0xb2 result
- case 0x31: return m_mcu_b1_res; //0xb1 result
-
- case 0x35: m_mcu_b5_res = 1; m_mcu_b6_res = 1; return 0;
- case 0x36: return m_mcu_b4_cmd; //0xb4 command, extra protection for lives (first play only), otherwise game gives one extra life at start-up (!)
- case 0x37: return m_mcu_b5_res; //0xb4 / 0xb5 / 0xb6 result y value
- case 0x38: return m_mcu_b6_res; //x value
-
- case 0x3b: return m_mcu_bb_res; //0xbb result
- case 0x40: return 0;
- case 0x41: return 0;
- case 0x42:
- {
- /* TODO: subtle behaviour for transitioning from level 16 to level 17 (loop clear?). Command is:
- 0xc0 -> param -> 0xc1 -> param -> ... 0xc7 -> param -> 0x0e (end of packet) then reads at 0x40 -> 0x41 and 0x42
-
- Params written doesn't make any sense, they are copies from RAM addresses at 0xe450-7 and they looks like ... garbage.
- It's possible that all of this it just increments by one an internal RAM address in the MCU and then it sends a six when this counter
- has bits 0-3 == 0 (BCD operation?), but then the question is ... how it determines game over?
-
- According to a PCB test, game should roll back to level 1 layout but level counter should say "17" instead of current "11". Some of these ports also appears to control
- game-play speed and who is playing between player 1 and 2.
- */
- //static uint8_t level_val;
-
- //level_val = read_byte(0xe247);
-
- //popmessage("%02x",level_val);
-
- //if((level_val & 0x0f) == 0x00)
- // return 0; //6
-
- return 0;
- }
- //case 0x42: return 0x06;
- //default: printf("PC=%04x R %02x\n",space.device().safe_pc(),m_mcu_cmd); break;
- }
-
- return 0;
-}
-
-WRITE8_MEMBER(flstory_state::rumba_mcu_w)
-{
- //if((m_mcu_cmd & 0xf0) == 0xc0)
- // printf("%02x ",data);
-
- //if(m_mcu_cmd == 0x42)
- // printf("\n");
-
- if(m_mcu_param)
- {
- m_mcu_param = 0; // clear param
-
- //printf("%02x %02x\n",m_mcu_cmd,data);
-
- switch(m_mcu_cmd)
- {
- case 0xb0: // counter, used by command 0xb1 (and something else?
- {
- /*
- sends 0xb0 -> param then 0xb1 -> param -> 0x01 (end of cmd packet?) finally 0x31 for reply
- */
-
- m_mcu_counter = data;
-
- break;
- }
- case 0xb1: // player death sequence, controls X position
- {
- m_mcu_b1_res = data;
-
- /* TODO: this is pretty hard to simulate ... */
- if(m_mcu_counter >= 0x10)
- m_mcu_b1_res++; // left
- else if(m_mcu_counter >= 0x08)
- m_mcu_b1_res--; // right
- else
- m_mcu_b1_res++; // left again
-
- break;
- }
- case 0xb2: // player sprite hook-up param when he throws the wheel
- {
- /*
- sends 0xb2 -> param -> 0x02 (end of cmd packet?) then 0x33 for reply
- */
-
- switch(data)
- {
- case 1: m_mcu_b2_res = 0xaa; break; //left
- case 2: m_mcu_b2_res = 0xaa; break; //right
- case 4: m_mcu_b2_res = 0xab; break; //down
- case 8: m_mcu_b2_res = 0xa9; break; //up
- }
- break;
- }
- case 0xbb: // when you start a level, lives
- {
- /*
- sends 0xbb -> param -> 0x04 (end of cmd packet?) then 0x3b for reply
- */
-
- m_mcu_bb_res = data;
- //printf("PC=%04x W %02x -> %02x\n",space.device().safe_pc(),m_mcu_cmd,data);
- break;
- }
- case 0xb4: // when the bird touches the top / bottom / left / right of the screen, for correct repositioning
- {
- m_mcu_b4_cmd = data;
-
- //popmessage("%02x",m_mcu_b4_cmd);
-
- /*
- sends 0xb4 -> param -> 0xb5 -> param (bird X coord) -> 0xb6 -> param (bird Y coord) ->
- */
-
- #if 0
- switch(data)
- {
- case 1: break; // from up to down
- case 2: break; // from left to right
- case 3: break; // from right to left
- case 4: break; // from down to up
- }
- #endif
- break;
- }
- case 0xb5: // bird X coord
- {
- /* TODO: values might be off by one */
- m_mcu_b5_res = data;
-
- if(m_mcu_b4_cmd == 3) // from right to left
- m_mcu_b5_res = 0x0d;
-
- if(m_mcu_b4_cmd == 2) // from left to right
- m_mcu_b5_res = 0xe4;
-
- break;
- }
- case 0xb6: // bird Y coord
- {
- m_mcu_b6_res = data;
-
- if(m_mcu_b4_cmd == 1) // from up to down
- m_mcu_b6_res = 0x04;
-
- if(m_mcu_b4_cmd == 4) // from down to up
- m_mcu_b6_res = 0xdc;
-
- break;
- }
- }
-
- //if((m_mcu_cmd & 0xf0) == 0xc0)
- // printf("%02x ",data);
-
- //if(m_mcu_cmd == 0xc7)
- // printf("\n");
-
- return;
- }
-
- m_mcu_cmd = data;
-
- if(((data & 0xf0) == 0xb0 || (data & 0xf0) == 0xc0) && m_mcu_param == 0)
- m_mcu_param = 1;
-}
-
static ADDRESS_MAP_START( rumba_map, AS_PROGRAM, 8, flstory_state )
AM_RANGE(0x0000, 0xbfff) AM_ROM
AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(flstory_videoram_w) AM_SHARE("videoram")
// AM_RANGE(0xc800, 0xcfff) AM_RAM /* unknown */
- AM_RANGE(0xd000, 0xd000) AM_READWRITE(rumba_mcu_r, rumba_mcu_w)
+ AM_RANGE(0xd000, 0xd000) AM_DEVREADWRITE("bmcu", taito68705_mcu_device, data_r, data_w)
AM_RANGE(0xd001, 0xd001) AM_WRITENOP /* watchdog? */
// AM_RANGE(0xd002, 0xd002) AM_NOP /* unknown read & coin lock out? */
AM_RANGE(0xd400, 0xd400) AM_READWRITE(from_snd_r, sound_command_w)
@@ -351,7 +171,7 @@ static ADDRESS_MAP_START( rumba_map, AS_PROGRAM, 8, flstory_state )
AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSW2")
AM_RANGE(0xd803, 0xd803) AM_READ_PORT("SYSTEM")
AM_RANGE(0xd804, 0xd804) AM_READ_PORT("P1")
- AM_RANGE(0xd805, 0xd805) AM_READ_PORT("EXTRA_P1") /* also mcu */
+ AM_RANGE(0xd805, 0xd805) AM_READ(flstory_mcu_status_r)
AM_RANGE(0xd806, 0xd806) AM_READ_PORT("P2")
AM_RANGE(0xd807, 0xd807) AM_READ_PORT("EXTRA_P2")
// AM_RANGE(0xda00, 0xda00) AM_WRITEONLY
@@ -904,18 +724,6 @@ static INPUT_PORTS_START( rumba )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_START("EXTRA_P1") /* D805 */
- /* bits 0,1 are MCU related:
- - bit 0: mcu is ready to receive data from main cpu
- - bit 1: mcu has sent data to the main cpu */
- PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, flstory_state,victnine_mcu_status_bit01_r, nullptr)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
-
PORT_START("P2") /* D806 */
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_COCKTAIL // A
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_COCKTAIL // C
@@ -1201,11 +1009,6 @@ static MACHINE_CONFIG_START( victnine )
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac", -1.0, DAC_VREF_NEG_INPUT)
MACHINE_CONFIG_END
-MACHINE_RESET_MEMBER(flstory_state,rumba)
-{
- MACHINE_RESET_CALL_MEMBER(flstory);
- m_mcu_cmd = 0;
-}
static MACHINE_CONFIG_START( rumba )
@@ -1219,12 +1022,12 @@ static MACHINE_CONFIG_START( rumba )
MCFG_CPU_PERIODIC_INT_DRIVER(flstory_state, irq0_line_hold, 2*60) /* IRQ generated by ??? */
/* NMI generated by the main CPU */
-// MCFG_CPU_ADD("mcu", M68705, XTAL_18_432MHz/6) /* verified on pcb */
-// MCFG_CPU_PROGRAM_MAP(m68705_map)
+ MCFG_DEVICE_ADD("bmcu", TAITO68705_MCU, XTAL_18_432MHz/6) /* ? */
MCFG_QUANTUM_TIME(attotime::from_hz(6000)) /* 100 CPU slices per frame - an high value to ensure proper */
/* synchronization of the CPUs */
- MCFG_MACHINE_RESET_OVERRIDE(flstory_state,rumba)
+
+ MCFG_MACHINE_RESET_OVERRIDE(flstory_state,flstory)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
@@ -1549,7 +1352,7 @@ ROM_START( rumba )
ROM_LOAD( "a23_10.bin", 0x4000, 0x2000, CRC(f9447bd4) SHA1(68c02249ca0e5b923cddb4bff8d090963b9c78e4) )
ROM_REGION( 0x0800, "bmcu:mcu", 0 ) /* 2k for the microcontroller */
- ROM_LOAD( "a23-11.mc68705p5s", 0x0000, 0x0800, NO_DUMP )
+ ROM_LOAD( "a23_11.bin", 0x0000, 0x0800, CRC(fddc99ce) SHA1(a9c7f76752ce74a780ca74004106c969d78ba931) )
ROM_REGION( 0x8000, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "a23_07.bin", 0x02000, 0x2000, CRC(c98fbea6) SHA1(edd1e0b2551f726018ca6e0b2cf629046a482711) )
@@ -1564,4 +1367,4 @@ GAME( 1985, flstoryj, flstory, flstory, flstory, flstory_state, 0, ROT180, "
GAME( 1985, onna34ro, 0, onna34ro, onna34ro, flstory_state, 0, ROT0, "Taito", "Onna Sansirou - Typhoon Gal (set 1)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1985, onna34roa, onna34ro, onna34ro, onna34ro, flstory_state, 0, ROT0, "Taito", "Onna Sansirou - Typhoon Gal (set 2)", MACHINE_UNEMULATED_PROTECTION | MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
GAME( 1984, victnine, 0, victnine, victnine, flstory_state, 0, ROT0, "Taito", "Victorious Nine", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE )
-GAME( 1984, rumba, 0, rumba, rumba, flstory_state, 0, ROT270, "Taito", "Rumba Lumber", MACHINE_IMPERFECT_SOUND | MACHINE_UNEMULATED_PROTECTION )
+GAME( 1984, rumba, 0, rumba, rumba, flstory_state, 0, ROT270, "Taito", "Rumba Lumber", MACHINE_IMPERFECT_SOUND )