trunk/src/mame/drivers/punchout.c
| r31519 | r31520 | |
| 7 | 7 | with scrolling, while Arm Wrestling has an additional FG tilemap displayed on |
| 8 | 8 | the bottom screen. |
| 9 | 9 | |
| 10 | | - money bag placement might not be 100% correct in Arm Wrestling, however |
| 11 | | the more serious part of armwrest35b9yel (unplayable bonus round after rounds |
| 12 | | 5 and 9) is now fixed. |
| 13 | | |
| 14 | 10 | driver by Nicola Salmoria |
| 15 | 11 | |
| 16 | 12 | TODO: |
| 17 | 13 | - add useless driver config to choose between pink and white color proms |
| 18 | | - Finish emulation of RP5C01 and RP5H01 for spnchout. The RP5C01 features don't |
| 19 | | seem to be used at all except for very basic protection e.g. relying on the |
| 20 | | masking done by the internal registers. |
| 14 | - video raw params - pixel clock is derived from 20.16mhz xtal |
| 15 | - finish spnchout protection emulation |
| 16 | - money bag placement might not be 100% correct in Arm Wrestling |
| 21 | 17 | |
| 22 | 18 | |
| 23 | 19 | main CPU: |
| r31519 | r31520 | |
| 126 | 122 | #include "includes/punchout.h" |
| 127 | 123 | |
| 128 | 124 | |
| 129 | | CUSTOM_INPUT_MEMBER(punchout_state::punchout_vlm5030_busy_r) |
| 130 | | { |
| 131 | | /* bit 4 of DSW1 is busy pin level */ |
| 132 | | return (m_vlm->bsy()) ? 0x00 : 0x01; |
| 133 | | } |
| 125 | /*************************************************************************** |
| 134 | 126 | |
| 127 | I/O, Memory Maps |
| 128 | |
| 129 | ***************************************************************************/ |
| 130 | |
| 131 | // Z80 (main) |
| 132 | |
| 135 | 133 | WRITE8_MEMBER(punchout_state::punchout_speech_reset_w) |
| 136 | 134 | { |
| 137 | 135 | m_vlm->rst( data & 0x01 ); |
| r31519 | r31520 | |
| 155 | 153 | m_audiocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| 156 | 154 | } |
| 157 | 155 | |
| 158 | | |
| 159 | | READ8_MEMBER(punchout_state::spunchout_rp5c01_r) |
| 156 | WRITE8_MEMBER(punchout_state::nmi_mask_w) |
| 160 | 157 | { |
| 161 | | logerror("%04x: prot_r %x\n", space.device().safe_pcbase(), offset); |
| 162 | | |
| 163 | | if (offset <= 0x0c) |
| 164 | | { |
| 165 | | switch (m_rp5c01_mode_sel & 3) |
| 166 | | { |
| 167 | | case 0: // time |
| 168 | | switch ( offset ) |
| 169 | | { |
| 170 | | case 0x00: // 1-second counter |
| 171 | | return m_rp5c01_mem[0x00]; |
| 172 | | |
| 173 | | case 0x01: // 10-second counter |
| 174 | | return m_rp5c01_mem[0x01] & 0x7; |
| 175 | | |
| 176 | | case 0x02: // 1-minute counter |
| 177 | | return m_rp5c01_mem[0x02]; |
| 178 | | |
| 179 | | case 0x03: // 10-minute counter |
| 180 | | return m_rp5c01_mem[0x03] & 0x07; |
| 181 | | |
| 182 | | case 0x04: // 1-hour counter |
| 183 | | return m_rp5c01_mem[0x04]; |
| 184 | | |
| 185 | | case 0x05: // 10-hour counter |
| 186 | | return m_rp5c01_mem[0x05] & 0x03; |
| 187 | | |
| 188 | | case 0x06: // day-of-the-week counter |
| 189 | | return m_rp5c01_mem[0x06] & 0x07; |
| 190 | | |
| 191 | | case 0x07: // 1-day counter |
| 192 | | return m_rp5c01_mem[0x07]; |
| 193 | | |
| 194 | | case 0x08: // 10-day counter |
| 195 | | return m_rp5c01_mem[0x08] & 0x03; |
| 196 | | |
| 197 | | case 0x09: // 1-month counter |
| 198 | | return m_rp5c01_mem[0x09]; |
| 199 | | |
| 200 | | case 0x0a: // 10-month counter |
| 201 | | return m_rp5c01_mem[0x0a] & 0x01; |
| 202 | | |
| 203 | | case 0x0b: // 1-year counter |
| 204 | | return m_rp5c01_mem[0x0b]; |
| 205 | | |
| 206 | | case 0x0c: // 10-year counter |
| 207 | | return m_rp5c01_mem[0x0c]; |
| 208 | | } |
| 209 | | break; |
| 210 | | |
| 211 | | case 1: // alarm |
| 212 | | switch ( offset ) |
| 213 | | { |
| 214 | | case 0x00: // n/a |
| 215 | | return 0x00; |
| 216 | | |
| 217 | | case 0x01: // n/a |
| 218 | | return 0x00; |
| 219 | | |
| 220 | | case 0x02: // 1-minute alarm register |
| 221 | | return m_rp5c01_mem[0x12]; |
| 222 | | |
| 223 | | case 0x03: // 10-minute alarm register |
| 224 | | return m_rp5c01_mem[0x13] & 0x07; |
| 225 | | |
| 226 | | case 0x04: // 1-hour alarm register |
| 227 | | return m_rp5c01_mem[0x14]; |
| 228 | | |
| 229 | | case 0x05: // 10-hour alarm register |
| 230 | | return m_rp5c01_mem[0x15] & 0x03; |
| 231 | | |
| 232 | | case 0x06: // day-of-the-week alarm register |
| 233 | | return m_rp5c01_mem[0x16] & 0x07; |
| 234 | | |
| 235 | | case 0x07: // 1-day alarm register |
| 236 | | return m_rp5c01_mem[0x17]; |
| 237 | | |
| 238 | | case 0x08: // 10-day alarm register |
| 239 | | return m_rp5c01_mem[0x18] & 0x03; |
| 240 | | |
| 241 | | case 0x09: // n/a |
| 242 | | return 0x00; |
| 243 | | |
| 244 | | case 0x0a: // /12/24 select register |
| 245 | | return m_rp5c01_mem[0x1a] & 0x01; |
| 246 | | |
| 247 | | case 0x0b: // leap year count |
| 248 | | return m_rp5c01_mem[0x1b] & 0x03; |
| 249 | | |
| 250 | | case 0x0c: // n/a |
| 251 | | return 0x00; |
| 252 | | } |
| 253 | | break; |
| 254 | | |
| 255 | | case 2: // RAM BLOCK 10 |
| 256 | | case 3: // RAM BLOCK 11 |
| 257 | | return m_rp5c01_mem[0x10 * (m_rp5c01_mode_sel & 3) + offset]; |
| 258 | | } |
| 259 | | } |
| 260 | | else if (offset == 0x0d) |
| 261 | | { |
| 262 | | return m_rp5c01_mode_sel; |
| 263 | | } |
| 264 | | |
| 265 | | logerror("Read from unknown protection? port %02x ( selector = %02x )\n", offset, m_rp5c01_mode_sel ); |
| 266 | | return 0; |
| 158 | m_nmi_mask = data & 1; |
| 267 | 159 | } |
| 268 | 160 | |
| 269 | | WRITE8_MEMBER(punchout_state::spunchout_rp5c01_w) |
| 270 | | { |
| 271 | | data &= 0x0f; |
| 272 | | |
| 273 | | logerror("%04x: prot_w %x = %02x\n",space.device().safe_pcbase(),offset,data); |
| 274 | | |
| 275 | | if (offset <= 0x0c) |
| 276 | | { |
| 277 | | m_rp5c01_mem[0x10 * (m_rp5c01_mode_sel & 3) + offset] = data; |
| 278 | | } |
| 279 | | else if (offset == 0x0d) |
| 280 | | { |
| 281 | | m_rp5c01_mode_sel = data; |
| 282 | | logerror("MODE: Timer EN = %d Alarm EN = %d MODE %d\n",BIT(data,3),BIT(data,2),data&3); |
| 283 | | } |
| 284 | | else if (offset == 0x0e) |
| 285 | | { |
| 286 | | logerror("TEST = %d",data); |
| 287 | | } |
| 288 | | else if (offset == 0x0f) |
| 289 | | { |
| 290 | | logerror("RESET: /1Hz = %d /16Hz = %d Timer = %d Timer = %d\n",BIT(data,3),BIT(data,2),BIT(data,1),BIT(data,0)); |
| 291 | | } |
| 292 | | } |
| 293 | | |
| 294 | | READ8_MEMBER(punchout_state::spunchout_exp_r) |
| 295 | | { |
| 296 | | // bit 7 = DATA OUT from RP5H01 |
| 297 | | // bit 6 = COUNTER OUT from RP5H01 |
| 298 | | // bit 5 = /ALARM from RP5C01 |
| 299 | | // bit 4 = n.c. |
| 300 | | // bits 3-0 = D3-D0 from RP5C01 |
| 301 | | |
| 302 | | UINT8 ret = spunchout_rp5c01_r( space, offset >> 4 ); |
| 303 | | |
| 304 | | // FIXME hack |
| 305 | | /* PC = 0x0313 */ |
| 306 | | /* (ret or 0x10) -> (D7DF),(D7A0) - (D7DF),(D7A0) = 0d0h(ret nc) */ |
| 307 | | |
| 308 | | if (space.device().safe_pcbase() == 0x0313) |
| 309 | | ret |= 0xc0; |
| 310 | | |
| 311 | | return ret; |
| 312 | | } |
| 313 | | |
| 314 | | WRITE8_MEMBER(punchout_state::spunchout_exp_w) |
| 315 | | { |
| 316 | | spunchout_rp5c01_w( space, offset >> 4, data ); |
| 317 | | } |
| 318 | | |
| 319 | | |
| 320 | | |
| 321 | 161 | static ADDRESS_MAP_START( punchout_map, AS_PROGRAM, 8, punchout_state ) |
| 322 | 162 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 323 | 163 | AM_RANGE(0xc000, 0xc3ff) AM_RAM AM_SHARE("nvram") |
| r31519 | r31520 | |
| 346 | 186 | AM_RANGE(0xf800, 0xffff) AM_RAM_WRITE(punchout_bg_top_videoram_w) AM_SHARE("bg_top_videoram") |
| 347 | 187 | ADDRESS_MAP_END |
| 348 | 188 | |
| 349 | | WRITE8_MEMBER(punchout_state::nmi_mask_w) |
| 350 | | { |
| 351 | | m_nmi_mask = data & 1; |
| 352 | | } |
| 353 | 189 | |
| 354 | 190 | static ADDRESS_MAP_START( punchout_io_map, AS_IO, 8, punchout_state ) |
| 355 | 191 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| r31519 | r31520 | |
| 369 | 205 | AM_RANGE(0x0d, 0x0d) AM_WRITE(punchout_speech_st_w) /* VLM5030 */ |
| 370 | 206 | AM_RANGE(0x0e, 0x0e) AM_WRITE(punchout_speech_vcu_w) /* VLM5030 */ |
| 371 | 207 | AM_RANGE(0x0f, 0x0f) AM_WRITENOP /* enable NVRAM ? */ |
| 208 | ADDRESS_MAP_END |
| 372 | 209 | |
| 373 | | /* protection ports - Super Punchout only (move to install handler?) */ |
| 374 | | AM_RANGE(0x07, 0x07) AM_MIRROR(0xf0) AM_MASK(0xf0) AM_READWRITE(spunchout_exp_r, spunchout_exp_w) |
| 210 | |
| 211 | // Super Punch-Out!! comes with an extra security PCB that plugs into the Z80 socket |
| 212 | // CHS1-01-EXP, has Z80 CPU, RP5C01, RP5H01 |
| 213 | |
| 214 | // The RP5C01 features don't seem to be used at all except for very basic protection |
| 215 | // e.g. relying on the masking done by the internal registers. |
| 216 | |
| 217 | READ8_MEMBER(punchout_state::spunchout_exp_r) |
| 218 | { |
| 219 | // d0-d3: D0-D3 from RP5C01 |
| 220 | // d4: N/C |
| 221 | // d5: /ALARM from RP5C01 |
| 222 | // d6: COUNTER OUT from RP5H01 |
| 223 | // d7: DATA OUT from RP5H01 |
| 224 | |
| 225 | UINT8 ret = m_rtc->read(space, offset >> 4 & 0xf) & 0xf; |
| 226 | ret |= 0x10; |
| 227 | ret |= m_rtc->alarm_r() ? 0x00 : 0x20; |
| 228 | ret |= m_rp5h01->counter_r() ? 0x40 : 0x00; |
| 229 | ret |= m_rp5h01->data_r() ? 0x80 : 0x00; |
| 230 | |
| 231 | // FIXME - hack d6/d7 state until we have a dump of RP5H01 and know the connections for spunchout_exp_w |
| 232 | /* PC = 0x0313 */ |
| 233 | /* (ret or 0x10) -> (D7DF),(D7A0) - (D7DF),(D7A0) = 0d0h(ret nc) */ |
| 234 | ret &= 0x3f; |
| 235 | if (space.device().safe_pcbase() == 0x0313) |
| 236 | { |
| 237 | ret |= 0xc0; |
| 238 | } |
| 239 | |
| 240 | return ret; |
| 241 | } |
| 242 | |
| 243 | WRITE8_MEMBER(punchout_state::spunchout_exp_w) |
| 244 | { |
| 245 | // d0-d3: D0-D3 to RP5C01 |
| 246 | // d4-d7: ? to RP5H01? |
| 247 | |
| 248 | m_rtc->write(space, offset >> 4 & 0xf, data & 0xf); |
| 249 | } |
| 250 | |
| 251 | static ADDRESS_MAP_START( spnchout_io_map, AS_IO, 8, punchout_state ) |
| 252 | AM_RANGE(0x07, 0x07) AM_MIRROR(0xf0) AM_MASK(0xf0) AM_READWRITE(spunchout_exp_r, spunchout_exp_w) /* protection ports */ |
| 253 | AM_IMPORT_FROM( punchout_io_map ) |
| 375 | 254 | ADDRESS_MAP_END |
| 376 | 255 | |
| 256 | // 2A03 (sound) |
| 257 | |
| 377 | 258 | static ADDRESS_MAP_START( punchout_sound_map, AS_PROGRAM, 8, punchout_state ) |
| 378 | 259 | AM_RANGE(0x0000, 0x07ff) AM_RAM |
| 379 | 260 | AM_RANGE(0x4016, 0x4016) AM_READ(soundlatch_byte_r) |
| r31519 | r31520 | |
| 384 | 265 | |
| 385 | 266 | |
| 386 | 267 | |
| 268 | /*************************************************************************** |
| 269 | |
| 270 | Inputs |
| 271 | |
| 272 | ***************************************************************************/ |
| 273 | |
| 274 | CUSTOM_INPUT_MEMBER(punchout_state::punchout_vlm5030_busy_r) |
| 275 | { |
| 276 | /* bit 4 of DSW1 is vlm busy pin level */ |
| 277 | return (m_vlm->bsy()) ? 0x00 : 0x01; |
| 278 | } |
| 279 | |
| 387 | 280 | static INPUT_PORTS_START( punchout ) |
| 388 | 281 | PORT_START("IN0") |
| 389 | 282 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| r31519 | r31520 | |
| 432 | 325 | PORT_DIPSETTING( 0x0c, DEF_STR( 3C_1C ) ) |
| 433 | 326 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 434 | 327 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 435 | | // PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) /* Not documented */ |
| 328 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) /* dupe, Not documented */ |
| 436 | 329 | PORT_DIPSETTING( 0x08, "1 Coin/2 Credits (2 Credits/1 Play)" ) /* Not documented */ |
| 437 | 330 | PORT_DIPSETTING( 0x0d, "1 Coin/3 Credits (2 Credits/1 Play)" ) /* Not documented */ |
| 438 | 331 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) |
| 439 | | // PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) /* Not documented */ |
| 440 | | // PORT_DIPSETTING( 0x09, DEF_STR( 1C_2C ) ) /* Not documented */ |
| 332 | PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) /* dupe, Not documented */ |
| 333 | PORT_DIPSETTING( 0x09, DEF_STR( 1C_2C ) ) /* dupe, Not documented */ |
| 441 | 334 | PORT_DIPSETTING( 0x05, DEF_STR( 1C_3C ) ) |
| 442 | 335 | PORT_DIPSETTING( 0x06, DEF_STR( 1C_4C ) ) |
| 443 | 336 | PORT_DIPSETTING( 0x0a, DEF_STR( 1C_5C ) ) |
| r31519 | r31520 | |
| 463 | 356 | PORT_DIPSETTING( 0x08, DEF_STR( 6C_1C ) ) /* Not documented */ |
| 464 | 357 | PORT_DIPSETTING( 0x04, DEF_STR( 5C_1C ) ) /* Not documented */ |
| 465 | 358 | PORT_DIPSETTING( 0x03, DEF_STR( 4C_1C ) ) /* Not documented */ |
| 466 | | // PORT_DIPSETTING( 0x09, DEF_STR( 4C_1C ) ) /* Not documented */ |
| 359 | PORT_DIPSETTING( 0x09, DEF_STR( 4C_1C ) ) /* dupe, Not documented */ |
| 467 | 360 | PORT_DIPSETTING( 0x0c, DEF_STR( 3C_1C ) ) |
| 468 | 361 | PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) |
| 469 | 362 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) |
| 470 | | // PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) /* Not documented */ |
| 363 | PORT_DIPSETTING( 0x0e, DEF_STR( 1C_1C ) ) /* dupe, Not documented */ |
| 471 | 364 | PORT_DIPSETTING( 0x0d, "1 Coin/3 Credits (2 Credits/1 Play)" ) /* Not documented */ |
| 472 | 365 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) |
| 473 | 366 | PORT_DIPSETTING( 0x0b, "1 Coin/2 Credits (3 Credits/1 Play)" ) /* Not documented */ |
| r31519 | r31520 | |
| 882 | 775 | INPUT_PORTS_END |
| 883 | 776 | |
| 884 | 777 | |
| 778 | |
| 779 | /*************************************************************************** |
| 780 | |
| 781 | Machine Configs |
| 782 | |
| 783 | ***************************************************************************/ |
| 784 | |
| 885 | 785 | static const gfx_layout charlayout_2bpp = |
| 886 | 786 | { |
| 887 | 787 | 8,8, |
| r31519 | r31520 | |
| 919 | 819 | GFXDECODE_END |
| 920 | 820 | |
| 921 | 821 | |
| 922 | | void punchout_state::machine_reset() |
| 923 | | { |
| 924 | | m_rp5c01_mode_sel = 0; |
| 925 | | memset(m_rp5c01_mem, 0, sizeof(m_rp5c01_mem)); |
| 926 | | } |
| 927 | | |
| 928 | 822 | INTERRUPT_GEN_MEMBER(punchout_state::vblank_irq) |
| 929 | 823 | { |
| 930 | | if(m_nmi_mask) |
| 824 | if (m_nmi_mask) |
| 931 | 825 | device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 932 | 826 | } |
| 933 | 827 | |
| 934 | 828 | |
| 829 | MACHINE_RESET_MEMBER(punchout_state, spnchout) |
| 830 | { |
| 831 | /* reset the security chip */ |
| 832 | m_rp5h01->enable_w(1); |
| 833 | m_rp5h01->enable_w(0); |
| 834 | m_rp5h01->reset_w(0); |
| 835 | m_rp5h01->reset_w(1); |
| 836 | } |
| 935 | 837 | |
| 838 | |
| 936 | 839 | static MACHINE_CONFIG_START( punchout, punchout_state ) |
| 937 | 840 | |
| 938 | 841 | /* basic machine hardware */ |
| 939 | | MCFG_CPU_ADD("maincpu", Z80, 8000000/2) /* 4 MHz */ |
| 842 | MCFG_CPU_ADD("maincpu", Z80, XTAL_8MHz/2) |
| 940 | 843 | MCFG_CPU_PROGRAM_MAP(punchout_map) |
| 941 | 844 | MCFG_CPU_IO_MAP(punchout_io_map) |
| 942 | | MCFG_CPU_VBLANK_INT_DRIVER("top", punchout_state, vblank_irq) |
| 845 | MCFG_CPU_VBLANK_INT_DRIVER("top", punchout_state, vblank_irq) |
| 943 | 846 | |
| 944 | | MCFG_CPU_ADD("audiocpu", N2A03, N2A03_DEFAULTCLOCK) |
| 847 | MCFG_CPU_ADD("audiocpu", N2A03, XTAL_21_4772MHz/12) |
| 945 | 848 | MCFG_CPU_PROGRAM_MAP(punchout_sound_map) |
| 946 | | MCFG_CPU_VBLANK_INT_DRIVER("top", punchout_state, nmi_line_pulse) |
| 849 | MCFG_CPU_VBLANK_INT_DRIVER("top", punchout_state, nmi_line_pulse) |
| 947 | 850 | |
| 948 | 851 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 949 | 852 | |
| r31519 | r31520 | |
| 968 | 871 | MCFG_SCREEN_UPDATE_DRIVER(punchout_state, screen_update_punchout_bottom) |
| 969 | 872 | MCFG_SCREEN_PALETTE("palette") |
| 970 | 873 | |
| 971 | | |
| 972 | 874 | /* sound hardware */ |
| 973 | 875 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 974 | 876 | |
| 975 | | MCFG_SOUND_ADD("nesapu", NES_APU, N2A03_DEFAULTCLOCK) |
| 877 | MCFG_SOUND_ADD("nesapu", NES_APU, XTAL_21_4772MHz/12) |
| 976 | 878 | MCFG_NES_APU_CPU("audiocpu") |
| 977 | 879 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 978 | 880 | |
| 979 | | MCFG_SOUND_ADD("vlm", VLM5030, 3580000) |
| 881 | MCFG_SOUND_ADD("vlm", VLM5030, XTAL_21_4772MHz/6) |
| 980 | 882 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 981 | 883 | MACHINE_CONFIG_END |
| 982 | 884 | |
| 983 | 885 | |
| 984 | | static MACHINE_CONFIG_DERIVED( armwrest, punchout ) |
| 886 | static MACHINE_CONFIG_DERIVED( spnchout, punchout ) |
| 985 | 887 | |
| 986 | 888 | /* basic machine hardware */ |
| 889 | MCFG_CPU_MODIFY("maincpu") |
| 890 | MCFG_CPU_IO_MAP(spnchout_io_map) |
| 987 | 891 | |
| 892 | MCFG_DEVICE_ADD("rtc", RP5C01, XTAL_32_768kHz) // frequency guessed |
| 893 | MCFG_RP5H01_ADD("rp5h01") |
| 894 | |
| 895 | MCFG_MACHINE_RESET_OVERRIDE(punchout_state, spnchout) |
| 896 | MACHINE_CONFIG_END |
| 897 | |
| 898 | |
| 899 | static MACHINE_CONFIG_DERIVED( armwrest, punchout ) |
| 900 | |
| 901 | /* basic machine hardware */ |
| 988 | 902 | MCFG_CPU_MODIFY("maincpu") |
| 989 | 903 | MCFG_CPU_PROGRAM_MAP(armwrest_map) |
| 990 | 904 | |
| 991 | 905 | /* video hardware */ |
| 992 | 906 | MCFG_GFXDECODE_MODIFY("gfxdecode", armwrest) |
| 993 | 907 | |
| 994 | | MCFG_VIDEO_START_OVERRIDE(punchout_state,armwrest) |
| 908 | MCFG_VIDEO_START_OVERRIDE(punchout_state, armwrest) |
| 995 | 909 | MCFG_SCREEN_MODIFY("top") |
| 996 | 910 | MCFG_SCREEN_UPDATE_DRIVER(punchout_state, screen_update_armwrest_top) |
| 997 | 911 | MCFG_SCREEN_MODIFY("bottom") |
| r31519 | r31520 | |
| 1002 | 916 | |
| 1003 | 917 | /*************************************************************************** |
| 1004 | 918 | |
| 1005 | | Game driver(s) |
| 919 | Game drivers |
| 1006 | 920 | |
| 1007 | 921 | ***************************************************************************/ |
| 1008 | 922 | |
| r31519 | r31520 | |
| 1417 | 1331 | |
| 1418 | 1332 | ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */ |
| 1419 | 1333 | ROM_LOAD( "chs1-c.6p", 0x0000, 0x4000, CRC(ad8b64b8) SHA1(0f1232a10faf71b782f9f6653cca8570243c17e0) ) |
| 1334 | |
| 1335 | ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard |
| 1336 | ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP ) |
| 1420 | 1337 | ROM_END |
| 1421 | 1338 | |
| 1422 | 1339 | ROM_START( spnchouta ) |
| r31519 | r31520 | |
| 1481 | 1398 | |
| 1482 | 1399 | ROM_REGION( 0x4000, "vlm", 0 ) /* 16k for the VLM5030 data */ |
| 1483 | 1400 | ROM_LOAD( "chs1-c.6p", 0x0000, 0x4000, CRC(ad8b64b8) SHA1(0f1232a10faf71b782f9f6653cca8570243c17e0) ) |
| 1401 | |
| 1402 | ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard |
| 1403 | ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP ) |
| 1484 | 1404 | ROM_END |
| 1485 | 1405 | |
| 1486 | 1406 | ROM_START( spnchoutj ) |
| r31519 | r31520 | |
| 1563 | 1483 | |
| 1564 | 1484 | ROM_REGION( 0x10000, "vlm", 0 ) /* 64k for the VLM5030 data */ |
| 1565 | 1485 | ROM_LOAD( "chs1c6pa.bin", 0x0000, 0x4000, CRC(d05fb730) SHA1(9f4c4c7e5113739312558eff4d3d3e42d513aa31) ) |
| 1486 | |
| 1487 | ROM_REGION( 0x10, "rp5h01", ROMREGION_ERASE00 ) // security prom on daughterboard |
| 1488 | ROM_LOAD( "rp5h01.exp", 0x00, 0x10, NO_DUMP ) |
| 1566 | 1489 | ROM_END |
| 1567 | 1490 | |
| 1568 | 1491 | ROM_START( armwrest ) |
| r31519 | r31520 | |
| 1627 | 1550 | GAME( 1984, punchouta, punchout, punchout, punchout, driver_device, 0, ROT0, "Nintendo", "Punch-Out!! (Rev A)", 0 ) /* CHP1-01 boards */ |
| 1628 | 1551 | GAME( 1984, punchoutj, punchout, punchout, punchout, driver_device, 0, ROT0, "Nintendo", "Punch-Out!! (Japan)", 0 ) |
| 1629 | 1552 | GAME( 1984, punchita, punchout, punchout, punchout, driver_device, 0, ROT0, "bootleg", "Punch-Out!! (Italian bootleg)", 0 ) |
| 1630 | | GAME( 1984, spnchout, 0, punchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Rev B)", 0 ) /* CHP1-02 boards */ |
| 1631 | | GAME( 1984, spnchouta, spnchout, punchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Rev A)", 0 ) /* CHP1-01 boards */ |
| 1632 | | GAME( 1984, spnchoutj, spnchout, punchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Japan)", 0 ) |
| 1553 | GAME( 1984, spnchout, 0, spnchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Rev B)", 0 ) /* CHP1-02 boards */ |
| 1554 | GAME( 1984, spnchouta, spnchout, spnchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Rev A)", 0 ) /* CHP1-01 boards */ |
| 1555 | GAME( 1984, spnchoutj, spnchout, spnchout, spnchout, driver_device, 0, ROT0, "Nintendo", "Super Punch-Out!! (Japan)", 0 ) |
| 1633 | 1556 | GAME( 1985, armwrest, 0, armwrest, armwrest, driver_device, 0, ROT0, "Nintendo", "Arm Wrestling", 0 ) |
trunk/src/mame/includes/punchout.h
| r31519 | r31520 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Punch Out / Super Punch Out / Arm Wrestling |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "machine/rp5c01.h" |
| 8 | #include "machine/rp5h01.h" |
| 1 | 9 | #include "sound/vlm5030.h" |
| 2 | 10 | |
| 3 | 11 | class punchout_state : public driver_device |
| r31519 | r31520 | |
| 5 | 13 | public: |
| 6 | 14 | punchout_state(const machine_config &mconfig, device_type type, const char *tag) |
| 7 | 15 | : driver_device(mconfig, type, tag), |
| 16 | m_maincpu(*this, "maincpu"), |
| 17 | m_audiocpu(*this, "audiocpu"), |
| 18 | m_rtc(*this, "rtc"), |
| 19 | m_rp5h01(*this, "rp5h01"), |
| 20 | m_vlm(*this, "vlm"), |
| 21 | m_gfxdecode(*this, "gfxdecode"), |
| 22 | m_palette(*this, "palette"), |
| 8 | 23 | m_bg_top_videoram(*this, "bg_top_videoram"), |
| 9 | 24 | m_spr1_ctrlram(*this, "spr1_ctrlram"), |
| 10 | 25 | m_spr2_ctrlram(*this, "spr2_ctrlram"), |
| r31519 | r31520 | |
| 12 | 27 | m_spr1_videoram(*this, "spr1_videoram"), |
| 13 | 28 | m_spr2_videoram(*this, "spr2_videoram"), |
| 14 | 29 | m_bg_bot_videoram(*this, "bg_bot_videoram"), |
| 15 | | m_armwrest_fg_videoram(*this, "armwrest_fgram"), |
| 16 | | m_maincpu(*this, "maincpu"), |
| 17 | | m_audiocpu(*this, "audiocpu"), |
| 18 | | m_vlm(*this, "vlm"), |
| 19 | | m_gfxdecode(*this, "gfxdecode"), |
| 20 | | m_palette(*this, "palette") |
| 30 | m_armwrest_fg_videoram(*this, "armwrest_fgram") |
| 21 | 31 | { } |
| 22 | 32 | |
| 23 | | int m_rp5c01_mode_sel; |
| 24 | | int m_rp5c01_mem[16*4]; |
| 33 | required_device<cpu_device> m_maincpu; |
| 34 | required_device<cpu_device> m_audiocpu; |
| 35 | optional_device<rp5c01_device> m_rtc; |
| 36 | optional_device<rp5h01_device> m_rp5h01; |
| 37 | required_device<vlm5030_device> m_vlm; |
| 38 | required_device<gfxdecode_device> m_gfxdecode; |
| 39 | required_device<palette_device> m_palette; |
| 40 | |
| 25 | 41 | required_shared_ptr<UINT8> m_bg_top_videoram; |
| 26 | 42 | required_shared_ptr<UINT8> m_spr1_ctrlram; |
| 27 | 43 | required_shared_ptr<UINT8> m_spr2_ctrlram; |
| r31519 | r31520 | |
| 31 | 47 | required_shared_ptr<UINT8> m_bg_bot_videoram; |
| 32 | 48 | optional_shared_ptr<UINT8> m_armwrest_fg_videoram; |
| 33 | 49 | |
| 34 | | required_device<cpu_device> m_maincpu; |
| 35 | | required_device<cpu_device> m_audiocpu; |
| 36 | | required_device<vlm5030_device> m_vlm; |
| 37 | | required_device<gfxdecode_device> m_gfxdecode; |
| 38 | | required_device<palette_device> m_palette; |
| 39 | | |
| 40 | 50 | tilemap_t *m_bg_top_tilemap; |
| 41 | 51 | tilemap_t *m_bg_bot_tilemap; |
| 42 | 52 | tilemap_t *m_fg_tilemap; |
| r31519 | r31520 | |
| 46 | 56 | |
| 47 | 57 | UINT8 m_nmi_mask; |
| 48 | 58 | DECLARE_WRITE8_MEMBER(punchout_2a03_reset_w); |
| 49 | | DECLARE_READ8_MEMBER(spunchout_rp5c01_r); |
| 50 | | DECLARE_WRITE8_MEMBER(spunchout_rp5c01_w); |
| 51 | 59 | DECLARE_READ8_MEMBER(spunchout_exp_r); |
| 52 | 60 | DECLARE_WRITE8_MEMBER(spunchout_exp_w); |
| 53 | 61 | DECLARE_WRITE8_MEMBER(nmi_mask_w); |
| r31519 | r31520 | |
| 69 | 77 | TILE_GET_INFO_MEMBER(armwrest_fg_get_info); |
| 70 | 78 | TILEMAP_MAPPER_MEMBER(armwrest_bs1_scan); |
| 71 | 79 | TILEMAP_MAPPER_MEMBER(armwrest_bs1_scan_flipx); |
| 72 | | virtual void machine_reset(); |
| 73 | 80 | virtual void video_start(); |
| 74 | 81 | DECLARE_VIDEO_START(armwrest); |
| 82 | DECLARE_MACHINE_RESET(spnchout); |
| 75 | 83 | UINT32 screen_update_punchout_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 76 | 84 | UINT32 screen_update_punchout_bottom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 77 | 85 | UINT32 screen_update_armwrest_top(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |