trunk/src/mame/drivers/galaxi.cpp
| r252936 | r252937 | |
| 57 | 57 | m_bg3_ram(*this, "bg3_ram"), |
| 58 | 58 | m_bg4_ram(*this, "bg4_ram"), |
| 59 | 59 | m_fg_ram(*this, "fg_ram"), |
| 60 | m_bg3_xscroll(8), |
| 61 | m_bg3_yscroll(0), |
| 60 | 62 | m_maincpu(*this, "maincpu"), |
| 61 | 63 | m_gfxdecode(*this, "gfxdecode"), |
| 62 | 64 | m_screen(*this, "screen"), |
| 63 | | m_palette(*this, "palette") { } |
| 65 | m_palette(*this, "palette") |
| 66 | { } |
| 64 | 67 | |
| 65 | 68 | /* memory pointers */ |
| 66 | 69 | required_shared_ptr<UINT16> m_bg1_ram; |
| r252936 | r252937 | |
| 77 | 80 | tilemap_t *m_bg4_tmap; |
| 78 | 81 | tilemap_t *m_fg_tmap; |
| 79 | 82 | |
| 83 | UINT16 m_bg3_xscroll; |
| 84 | UINT16 m_bg3_yscroll; |
| 85 | |
| 80 | 86 | /* misc */ |
| 81 | 87 | int m_hopper; |
| 82 | 88 | int m_ticket; |
| 83 | | UINT16 m_out[3]; |
| 89 | UINT16 m_out; |
| 90 | |
| 84 | 91 | DECLARE_WRITE16_MEMBER(galaxi_bg1_w); |
| 85 | 92 | DECLARE_WRITE16_MEMBER(galaxi_bg2_w); |
| 86 | 93 | DECLARE_WRITE16_MEMBER(galaxi_bg3_w); |
| r252936 | r252937 | |
| 187 | 194 | m_bg4_tmap->set_transparent_pen(0); |
| 188 | 195 | |
| 189 | 196 | m_fg_tmap->set_transparent_pen(0); |
| 190 | | |
| 191 | | m_bg3_tmap->set_scrolldx(-8, 0); |
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 195 | 200 | { |
| 201 | m_bg3_tmap->set_scrollx(m_bg3_xscroll); |
| 202 | m_bg3_tmap->set_scrolly(m_bg3_yscroll); |
| 203 | |
| 196 | 204 | int layers_ctrl = -1; |
| 197 | 205 | |
| 198 | 206 | #ifdef MAME_DEBUG |
| r252936 | r252937 | |
| 208 | 216 | } |
| 209 | 217 | #endif |
| 210 | 218 | |
| 219 | |
| 211 | 220 | if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); |
| 212 | 221 | else bitmap.fill(m_palette->black_pen(), cliprect); |
| 213 | 222 | if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0); |
| r252936 | r252937 | |
| 225 | 234 | |
| 226 | 235 | void galaxi_state::show_out( ) |
| 227 | 236 | { |
| 228 | | // popmessage("%04x %04x %04x", m_out[0], m_out[1], m_out[2]); |
| 237 | // popmessage("%04x", m_out); |
| 229 | 238 | } |
| 230 | 239 | |
| 231 | 240 | WRITE16_MEMBER(galaxi_state::galaxi_500000_w) |
| 232 | 241 | { |
| 233 | | COMBINE_DATA(&m_out[0]); |
| 242 | COMBINE_DATA(&m_bg3_yscroll); |
| 234 | 243 | show_out(); |
| 235 | 244 | } |
| 236 | 245 | |
| 237 | 246 | WRITE16_MEMBER(galaxi_state::galaxi_500002_w) |
| 238 | 247 | { |
| 239 | | COMBINE_DATA(&m_out[1]); |
| 248 | COMBINE_DATA(&m_bg3_xscroll); |
| 240 | 249 | show_out(); |
| 241 | 250 | } |
| 242 | 251 | |
| r252936 | r252937 | |
| 271 | 280 | machine().bookkeeping().coin_counter_w(0, data & 0x2000); // coins |
| 272 | 281 | } |
| 273 | 282 | |
| 274 | | COMBINE_DATA(&m_out[2]); |
| 283 | COMBINE_DATA(&m_out); |
| 275 | 284 | show_out(); |
| 276 | 285 | } |
| 277 | 286 | |
| r252936 | r252937 | |
| 295 | 304 | AM_RANGE(0x100c00, 0x100fff) AM_RAM_WRITE(galaxi_bg4_w) AM_SHARE("bg4_ram") |
| 296 | 305 | |
| 297 | 306 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(galaxi_fg_w ) AM_SHARE("fg_ram") |
| 298 | | AM_RANGE(0x102000, 0x1047ff) AM_READNOP // unknown |
| 307 | AM_RANGE(0x102000, 0x107fff) AM_READNOP // unknown |
| 299 | 308 | |
| 300 | 309 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 301 | 310 | |
| r252936 | r252937 | |
| 309 | 318 | AM_RANGE(0x600000, 0x607fff) AM_RAM AM_SHARE("nvram") // 2x DS1230Y (non volatile SRAM) |
| 310 | 319 | ADDRESS_MAP_END |
| 311 | 320 | |
| 321 | |
| 322 | static ADDRESS_MAP_START( lastfour_map, AS_PROGRAM, 16, galaxi_state ) |
| 323 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 324 | |
| 325 | // bg3+4 / 1+2 seem to be swapped, order, palettes, scroll register etc. all suggest this |
| 326 | AM_RANGE(0x100000, 0x1003ff) AM_RAM_WRITE(galaxi_bg3_w) AM_SHARE("bg3_ram") |
| 327 | AM_RANGE(0x100400, 0x1007ff) AM_RAM_WRITE(galaxi_bg4_w) AM_SHARE("bg4_ram") |
| 328 | AM_RANGE(0x100800, 0x100bff) AM_RAM_WRITE(galaxi_bg1_w) AM_SHARE("bg1_ram") |
| 329 | AM_RANGE(0x100c00, 0x100fff) AM_RAM_WRITE(galaxi_bg2_w) AM_SHARE("bg2_ram") |
| 330 | |
| 331 | AM_RANGE(0x101000, 0x101fff) AM_RAM_WRITE(galaxi_fg_w ) AM_SHARE("fg_ram") |
| 332 | AM_RANGE(0x102000, 0x107fff) AM_READNOP // unknown |
| 333 | |
| 334 | AM_RANGE(0x300000, 0x3007ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 335 | |
| 336 | AM_RANGE(0x500000, 0x500001) AM_READ_PORT("INPUTS") |
| 337 | AM_RANGE(0x500000, 0x500001) AM_WRITE(galaxi_500000_w) |
| 338 | AM_RANGE(0x500002, 0x500003) AM_WRITE(galaxi_500002_w) |
| 339 | AM_RANGE(0x500004, 0x500005) AM_WRITE(galaxi_500004_w) |
| 340 | |
| 341 | AM_RANGE(0x700000, 0x700001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 342 | |
| 343 | AM_RANGE(0x600000, 0x607fff) AM_RAM AM_SHARE("nvram") // 2x DS1230Y (non volatile SRAM) |
| 344 | ADDRESS_MAP_END |
| 345 | |
| 312 | 346 | /*************************************************************************** |
| 313 | 347 | Input Ports |
| 314 | 348 | ***************************************************************************/ |
| r252936 | r252937 | |
| 401 | 435 | { |
| 402 | 436 | m_hopper = 0; |
| 403 | 437 | m_ticket = 0; |
| 404 | | m_out[0] = 0; |
| 405 | | m_out[1] = 0; |
| 406 | | m_out[2] = 0; |
| 438 | m_out = 0; |
| 407 | 439 | } |
| 408 | 440 | |
| 409 | 441 | static MACHINE_CONFIG_START( galaxi, galaxi_state ) |
| r252936 | r252937 | |
| 449 | 481 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 4.0) |
| 450 | 482 | MACHINE_CONFIG_END |
| 451 | 483 | |
| 484 | static MACHINE_CONFIG_DERIVED( lastfour, galaxi ) |
| 485 | MCFG_CPU_MODIFY("maincpu") |
| 486 | MCFG_CPU_PROGRAM_MAP(lastfour_map) |
| 487 | MACHINE_CONFIG_END |
| 452 | 488 | |
| 453 | 489 | /*************************************************************************** |
| 454 | 490 | ROMs Loading |
| r252936 | r252937 | |
| 480 | 516 | ROM_LOAD( "21.u38", 0x00000, 0x40000, CRC(199baf33) SHA1(006708d955481fe1ae44555d27896d18e1ff8440) ) |
| 481 | 517 | ROM_END |
| 482 | 518 | |
| 519 | ROM_START( lastfour ) |
| 520 | ROM_REGION( 0x40000, "maincpu", 0 ) |
| 521 | ROM_LOAD16_BYTE( "15.u48", 0x00000, 0x20000, CRC(9168e19c) SHA1(4a2f0d100e457bd33691ba084a0f0549e8bf0790) ) |
| 522 | ROM_LOAD16_BYTE( "14.u47", 0x00001, 0x20000, CRC(b10ce31a) SHA1(8d51ead24319ff775fc873957e6b4de748432a8d) ) |
| 483 | 523 | |
| 524 | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 525 | ROM_LOAD16_BYTE( "13.u34", 0x00000, 0x80000, CRC(d595d4c4) SHA1(7fe8c9f36b03d763965abf325d1ff6d754342100) ) |
| 526 | ROM_LOAD16_BYTE( "12.u33", 0x00001, 0x80000, CRC(5ee5568b) SHA1(6384e5dfa24b5ad4e4419fa3bbffb4d552867465) ) |
| 527 | |
| 528 | ROM_REGION( 0x40000, "oki", 0 ) /* 4-bit ADPCM mono @ 6 kHz.*/ |
| 529 | ROM_LOAD( "21.u38", 0x00000, 0x20000, CRC(e48523dd) SHA1(47bc2e5c2164b93d685fa134397845e0ed7aaa5f) ) |
| 530 | ROM_END |
| 531 | |
| 484 | 532 | /*************************************************************************** |
| 485 | 533 | Game Drivers |
| 486 | 534 | ***************************************************************************/ |
| r252936 | r252937 | |
| 488 | 536 | /* YEAR NAME PARENT MACHINE INPUT INIT ROT COMPANY FULLNAME FLAGS LAYOUT */ |
| 489 | 537 | GAMEL( 2000, galaxi, 0, galaxi, galaxi, driver_device, 0, ROT0, "B.R.L.", "Galaxi (v2.0)", MACHINE_SUPPORTS_SAVE, layout_galaxi ) |
| 490 | 538 | GAMEL( 2000, magjoker, 0, magjoker, magjoker, driver_device, 0, ROT0, "B.R.L.", "Magic Joker (v1.25.10.2000)", MACHINE_SUPPORTS_SAVE, layout_galaxi ) |
| 539 | GAMEL( 2001, lastfour, 0, lastfour, magjoker, driver_device, 0, ROT0, "B.R.L.", "Last Four (09:12 16/01/2001)",MACHINE_SUPPORTS_SAVE, layout_galaxi ) |