trunk/src/mame/drivers/bmcpokr.c
| r31668 | r31669 | |
| 1 | | /* |
| 1 | /************************************************************************************************************ |
| 2 | 2 | |
| 3 | | similar to koftball.c? |
| 3 | Dongfang Shenlong ("Eastern Dragon") |
| 4 | BMC 1999 |
| 4 | 5 | |
| 6 | driver by Luca Elia |
| 7 | Similar to bmcbowl, koftball, popobear |
| 5 | 8 | |
| 6 | | An (unknown) gambling / poker game with sub-games |
| 7 | | BMC 1999 |
| 8 | | |
| 9 | 9 | PCB Layout |
| 10 | 10 | ---------- |
| 11 | 11 | |
| r31668 | r31669 | |
| 38 | 38 | HSync - 15.440kHz |
| 39 | 39 | VSync - 58.935Hz |
| 40 | 40 | |
| 41 | | */ |
| 41 | ************************************************************************************************************/ |
| 42 | 42 | |
| 43 | 43 | #include "emu.h" |
| 44 | 44 | #include "cpu/m68000/m68000.h" |
| 45 | #include "sound/2413intf.h" |
| 46 | #include "sound/okim6295.h" |
| 47 | #include "video/ramdac.h" |
| 48 | #include "machine/nvram.h" |
| 49 | #include "machine/ticket.h" |
| 45 | 50 | |
| 46 | 51 | class bmcpokr_state : public driver_device |
| 47 | 52 | { |
| r31668 | r31669 | |
| 49 | 54 | bmcpokr_state(const machine_config &mconfig, device_type type, const char *tag) |
| 50 | 55 | : driver_device(mconfig, type, tag), |
| 51 | 56 | m_maincpu(*this,"maincpu"), |
| 52 | | m_videoram(*this, "videoram"), |
| 57 | m_hopper(*this,"hopper"), |
| 58 | m_videoram_1(*this, "videoram_1"), |
| 59 | m_videoram_2(*this, "videoram_2"), |
| 60 | m_scrollram_1(*this, "scrollram_1"), |
| 61 | m_scrollram_2(*this, "scrollram_2"), |
| 62 | m_scrollram_3(*this, "scrollram_3"), |
| 63 | m_pixram(*this, "pixram"), |
| 64 | m_priority(*this, "priority"), |
| 65 | m_layerctrl(*this, "layerctrl"), |
| 53 | 66 | m_gfxdecode(*this, "gfxdecode"), |
| 54 | 67 | m_palette(*this, "palette") |
| 55 | 68 | { } |
| 56 | 69 | |
| 57 | | DECLARE_READ16_MEMBER( bmcpokr_unk_r ) |
| 58 | | { |
| 59 | | return space.machine().rand(); |
| 60 | | } |
| 61 | | |
| 62 | 70 | required_device<cpu_device> m_maincpu; |
| 63 | | required_shared_ptr<UINT16> m_videoram; |
| 71 | required_device<ticket_dispenser_device> m_hopper; |
| 72 | required_shared_ptr<UINT16> m_videoram_1; |
| 73 | required_shared_ptr<UINT16> m_videoram_2; |
| 74 | required_shared_ptr<UINT16> m_scrollram_1; |
| 75 | required_shared_ptr<UINT16> m_scrollram_2; |
| 76 | required_shared_ptr<UINT16> m_scrollram_3; |
| 77 | required_shared_ptr<UINT16> m_pixram; |
| 78 | required_shared_ptr<UINT16> m_priority; |
| 79 | required_shared_ptr<UINT16> m_layerctrl; |
| 64 | 80 | required_device<gfxdecode_device> m_gfxdecode; |
| 65 | 81 | required_device<palette_device> m_palette; |
| 82 | |
| 83 | tilemap_t *m_tilemap_1; |
| 84 | tilemap_t *m_tilemap_2; |
| 85 | TILE_GET_INFO_MEMBER(get_t1_tile_info); |
| 86 | TILE_GET_INFO_MEMBER(get_t2_tile_info); |
| 87 | TILE_GET_INFO_MEMBER(get_t3_tile_info); |
| 88 | DECLARE_WRITE16_MEMBER(videoram_1_w); |
| 89 | DECLARE_WRITE16_MEMBER(videoram_2_w); |
| 90 | |
| 91 | UINT16 m_prot_val; |
| 92 | DECLARE_READ16_MEMBER(prot_r); |
| 93 | DECLARE_WRITE16_MEMBER(prot_w); |
| 94 | DECLARE_READ16_MEMBER(unk_r); |
| 95 | |
| 96 | UINT16 m_mux; |
| 97 | DECLARE_WRITE16_MEMBER(mux_w); |
| 98 | DECLARE_READ16_MEMBER(dsw_r); |
| 99 | DECLARE_CUSTOM_INPUT_MEMBER(hopper_r); |
| 100 | |
| 101 | UINT16 m_irq_enable; |
| 102 | DECLARE_WRITE16_MEMBER(irq_enable_w); |
| 103 | DECLARE_WRITE16_MEMBER(irq_ack_w); |
| 104 | |
| 105 | bitmap_ind16 *m_pixbitmap; |
| 106 | void pixbitmap_redraw(); |
| 107 | UINT16 m_pixpal; |
| 108 | DECLARE_WRITE16_MEMBER(pixram_w); |
| 109 | DECLARE_WRITE16_MEMBER(pixpal_w); |
| 110 | |
| 66 | 111 | virtual void video_start(); |
| 112 | void draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer); |
| 67 | 113 | UINT32 screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 114 | |
| 115 | TIMER_DEVICE_CALLBACK_MEMBER(interrupt); |
| 116 | |
| 117 | void save_state() |
| 118 | { |
| 119 | save_item(NAME(m_prot_val)); |
| 120 | save_item(NAME(m_mux)); |
| 121 | save_item(NAME(m_irq_enable)); |
| 122 | save_item(NAME(m_pixpal)); |
| 123 | machine().save().register_postload(save_prepost_delegate(FUNC(bmcpokr_state::pixbitmap_redraw), this)); |
| 124 | } |
| 68 | 125 | }; |
| 69 | 126 | |
| 127 | /*************************************************************************** |
| 128 | Video Hardware |
| 129 | ***************************************************************************/ |
| 70 | 130 | |
| 131 | // Tilemaps |
| 71 | 132 | |
| 133 | WRITE16_MEMBER(bmcpokr_state::videoram_1_w) |
| 134 | { |
| 135 | COMBINE_DATA(&m_videoram_1[offset]); |
| 136 | m_tilemap_1->mark_tile_dirty(offset); |
| 137 | } |
| 138 | |
| 139 | WRITE16_MEMBER(bmcpokr_state::videoram_2_w) |
| 140 | { |
| 141 | COMBINE_DATA(&m_videoram_2[offset]); |
| 142 | m_tilemap_2->mark_tile_dirty(offset); |
| 143 | } |
| 144 | |
| 145 | TILE_GET_INFO_MEMBER(bmcpokr_state::get_t1_tile_info) |
| 146 | { |
| 147 | UINT16 data = m_videoram_1[tile_index]; |
| 148 | SET_TILE_INFO_MEMBER(0, data, 0, (data & 0x8000) ? TILE_FLIPX : 0); |
| 149 | } |
| 150 | |
| 151 | TILE_GET_INFO_MEMBER(bmcpokr_state::get_t2_tile_info) |
| 152 | { |
| 153 | UINT16 data = m_videoram_2[tile_index]; |
| 154 | SET_TILE_INFO_MEMBER(0, data, 0, (data & 0x8000) ? TILE_FLIPX : 0); |
| 155 | } |
| 156 | |
| 157 | void bmcpokr_state::video_start() |
| 158 | { |
| 159 | m_tilemap_1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(bmcpokr_state::get_t1_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,128); |
| 160 | m_tilemap_2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(bmcpokr_state::get_t2_tile_info),this),TILEMAP_SCAN_ROWS,8,8,128,128); |
| 161 | |
| 162 | m_tilemap_1->set_transparent_pen(0); |
| 163 | m_tilemap_2->set_transparent_pen(0); |
| 164 | |
| 165 | m_tilemap_1->set_scroll_rows(1); |
| 166 | m_tilemap_2->set_scroll_rows(1); |
| 167 | |
| 168 | m_tilemap_1->set_scroll_cols(1); |
| 169 | m_tilemap_2->set_scroll_cols(1); |
| 170 | |
| 171 | m_pixbitmap = auto_bitmap_ind16_alloc(machine(), 0x400, 0x200); |
| 172 | |
| 173 | save_state(); |
| 174 | } |
| 175 | |
| 176 | // 1024 x 512 bitmap. 4 bits per pixel (every byte encodes 2 pixels) + palette register |
| 177 | |
| 178 | WRITE16_MEMBER(bmcpokr_state::pixram_w) |
| 179 | { |
| 180 | COMBINE_DATA(&m_pixram[offset]); |
| 181 | |
| 182 | int x = (offset & 0xff) << 2; |
| 183 | int y = (offset >> 8); |
| 184 | |
| 185 | UINT16 pixpal = (m_pixpal & 0xf) * 0x10; |
| 186 | |
| 187 | UINT16 pen; |
| 188 | if (ACCESSING_BITS_8_15) |
| 189 | { |
| 190 | pen = (data >> 12) & 0xf; m_pixbitmap->pix16(y, x + 0) = pen ? pixpal + pen : 0; |
| 191 | pen = (data >> 8) & 0xf; m_pixbitmap->pix16(y, x + 1) = pen ? pixpal + pen : 0; |
| 192 | } |
| 193 | if (ACCESSING_BITS_0_7) |
| 194 | { |
| 195 | pen = (data >> 4) & 0xf; m_pixbitmap->pix16(y, x + 2) = pen ? pixpal + pen : 0; |
| 196 | pen = (data >> 0) & 0xf; m_pixbitmap->pix16(y, x + 3) = pen ? pixpal + pen : 0; |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | void bmcpokr_state::pixbitmap_redraw() |
| 201 | { |
| 202 | UINT16 pixpal = (m_pixpal & 0xf) * 0x10; |
| 203 | int offset = 0; |
| 204 | for (int y = 0; y < 512; y++) |
| 205 | { |
| 206 | for (int x = 0; x < 1024; x += 4) |
| 207 | { |
| 208 | UINT16 data = m_pixram[offset++]; |
| 209 | UINT16 pen; |
| 210 | pen = (data >> 12) & 0xf; m_pixbitmap->pix16(y, x + 0) = pen ? pixpal + pen : 0; |
| 211 | pen = (data >> 8) & 0xf; m_pixbitmap->pix16(y, x + 1) = pen ? pixpal + pen : 0; |
| 212 | pen = (data >> 4) & 0xf; m_pixbitmap->pix16(y, x + 2) = pen ? pixpal + pen : 0; |
| 213 | pen = (data >> 0) & 0xf; m_pixbitmap->pix16(y, x + 3) = pen ? pixpal + pen : 0; |
| 214 | } |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | WRITE16_MEMBER(bmcpokr_state::pixpal_w) |
| 219 | { |
| 220 | UINT16 old = m_pixpal; |
| 221 | if (old != COMBINE_DATA(&m_pixpal)) |
| 222 | pixbitmap_redraw(); |
| 223 | } |
| 224 | |
| 225 | // Screen update |
| 226 | |
| 227 | void bmcpokr_state::draw_layer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer) |
| 228 | { |
| 229 | tilemap_t *tmap; |
| 230 | UINT16 *scroll; |
| 231 | UINT16 ctrl; |
| 232 | |
| 233 | switch (layer) |
| 234 | { |
| 235 | case 1: tmap = m_tilemap_1; scroll = m_scrollram_1; ctrl = (m_layerctrl[0] >> 8) & 0xff; break; |
| 236 | case 2: tmap = m_tilemap_2; scroll = m_scrollram_2; ctrl = (m_layerctrl[0] >> 0) & 0xff; break; |
| 237 | default: tmap = 0; scroll = m_scrollram_3; ctrl = (m_layerctrl[1] >> 8) & 0xff; break; |
| 238 | } |
| 239 | |
| 240 | if (ctrl == 0x00) |
| 241 | return; |
| 242 | |
| 243 | bool linescroll = (ctrl == 0x1f); |
| 244 | |
| 245 | rectangle clip = cliprect; |
| 246 | for (int y = 0; y < 0x100; y++) |
| 247 | { |
| 248 | if (linescroll) |
| 249 | { |
| 250 | if ( (y < cliprect.min_y) || (y > cliprect.max_y) ) |
| 251 | continue; |
| 252 | |
| 253 | clip.min_y = y; |
| 254 | clip.max_y = y; |
| 255 | } |
| 256 | |
| 257 | int sx = (scroll[y] & 0xff) * 4; |
| 258 | int sy = ((scroll[y] >> 8) & 0xff) - y; |
| 259 | |
| 260 | if (tmap) |
| 261 | { |
| 262 | tmap->set_scrollx(0, sx); |
| 263 | tmap->set_scrolly(0, sy); |
| 264 | tmap->draw(screen, bitmap, clip, 0, 0); |
| 265 | } |
| 266 | else |
| 267 | { |
| 268 | sx = -sx; |
| 269 | sy = -sy; |
| 270 | copyscrollbitmap_trans(bitmap, *m_pixbitmap, 1, &sx, 1, &sy, cliprect, 0); |
| 271 | } |
| 272 | |
| 273 | if (!linescroll) |
| 274 | return; |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | UINT32 bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 279 | { |
| 280 | int layers_ctrl = -1; |
| 281 | |
| 282 | #ifdef MAME_DEBUG |
| 283 | if (screen.machine().input().code_pressed(KEYCODE_Z)) |
| 284 | { |
| 285 | int msk = 0; |
| 286 | if (screen.machine().input().code_pressed(KEYCODE_Q)) msk |= 1; |
| 287 | if (screen.machine().input().code_pressed(KEYCODE_W)) msk |= 2; |
| 288 | if (screen.machine().input().code_pressed(KEYCODE_A)) msk |= 4; |
| 289 | if (msk != 0) layers_ctrl &= msk; |
| 290 | } |
| 291 | #endif |
| 292 | |
| 293 | bitmap.fill(m_palette->black_pen(), cliprect); |
| 294 | |
| 295 | if (layers_ctrl & 2) draw_layer(screen, bitmap, cliprect, 2); |
| 296 | /* |
| 297 | title: 17, 13/17 |
| 298 | dogs: 1b, 13, 17 |
| 299 | service: 17 |
| 300 | game: 17 |
| 301 | */ |
| 302 | if (*m_priority & 0x0008) |
| 303 | { |
| 304 | if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3); |
| 305 | if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1); |
| 306 | } |
| 307 | else |
| 308 | { |
| 309 | if (layers_ctrl & 1) draw_layer(screen, bitmap, cliprect, 1); |
| 310 | if (layers_ctrl & 4) draw_layer(screen, bitmap, cliprect, 3); |
| 311 | } |
| 312 | return 0; |
| 313 | } |
| 314 | |
| 315 | /*************************************************************************** |
| 316 | Protection |
| 317 | ***************************************************************************/ |
| 318 | |
| 319 | READ16_MEMBER(bmcpokr_state::unk_r) |
| 320 | { |
| 321 | return space.machine().rand(); |
| 322 | } |
| 323 | |
| 324 | // Hack! |
| 325 | READ16_MEMBER(bmcpokr_state::prot_r) |
| 326 | { |
| 327 | switch (m_prot_val >> 8) |
| 328 | { |
| 329 | case 0x00: return 0x1d << 8; |
| 330 | case 0x94: return 0x81 << 8; |
| 331 | } |
| 332 | return 0x00 << 8; |
| 333 | } |
| 334 | WRITE16_MEMBER(bmcpokr_state::prot_w) |
| 335 | { |
| 336 | COMBINE_DATA(&m_prot_val); |
| 337 | // logerror("%s: prot val = %04x\n", machine().describe_context(), m_prot_val); |
| 338 | } |
| 339 | |
| 340 | /*************************************************************************** |
| 341 | Memory Maps |
| 342 | ***************************************************************************/ |
| 343 | |
| 344 | WRITE16_MEMBER(bmcpokr_state::mux_w) |
| 345 | { |
| 346 | COMBINE_DATA(&m_mux); |
| 347 | if (ACCESSING_BITS_0_7) |
| 348 | { |
| 349 | m_hopper->write(space, 0, (data & 0x0001) ? 0x80 : 0x00); // hopper motor |
| 350 | coin_counter_w(machine(), 1, data & 0x0002); // coin-in / key-in |
| 351 | coin_counter_w(machine(), 2, data & 0x0004); // pay-out |
| 352 | // data & 0x0060 // DSW mux |
| 353 | // data & 0x0080 // ? always on |
| 354 | } |
| 355 | |
| 356 | // popmessage("mux %04x", m_mux); |
| 357 | } |
| 358 | READ16_MEMBER(bmcpokr_state::dsw_r) |
| 359 | { |
| 360 | switch ((m_mux >> 5) & 3) |
| 361 | { |
| 362 | case 0: return ioport("DSW4")->read() << 8; |
| 363 | case 1: return ioport("DSW3")->read() << 8; |
| 364 | case 2: return ioport("DSW2")->read() << 8; |
| 365 | case 3: return ioport("DSW1")->read() << 8; |
| 366 | } |
| 367 | return 0xff << 8; |
| 368 | } |
| 369 | |
| 370 | CUSTOM_INPUT_MEMBER(bmcpokr_state::hopper_r) |
| 371 | { |
| 372 | // motor off should clear the sense bit (I guess ticket.c should actually do this). |
| 373 | // Otherwise a hopper bit stuck low will prevent several keys from being registered. |
| 374 | return (m_mux & 0x0001) ? m_hopper->line_r() : 1; |
| 375 | } |
| 376 | |
| 377 | WRITE16_MEMBER(bmcpokr_state::irq_enable_w) |
| 378 | { |
| 379 | COMBINE_DATA(&m_irq_enable); |
| 380 | } |
| 381 | WRITE16_MEMBER(bmcpokr_state::irq_ack_w) |
| 382 | { |
| 383 | if (ACCESSING_BITS_0_7) |
| 384 | { |
| 385 | for (int i = 1; i < 8; i++) |
| 386 | { |
| 387 | if (data & (1 << i)) |
| 388 | { |
| 389 | m_maincpu->set_input_line(i, CLEAR_LINE); |
| 390 | } |
| 391 | } |
| 392 | } |
| 393 | } |
| 394 | |
| 72 | 395 | static ADDRESS_MAP_START( bmcpokr_mem, AS_PROGRAM, 16, bmcpokr_state ) |
| 73 | 396 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 74 | | AM_RANGE(0x210000, 0x21ffff) AM_RAM |
| 397 | AM_RANGE(0x210000, 0x21ffff) AM_RAM AM_SHARE("nvram") |
| 75 | 398 | |
| 76 | | AM_RANGE(0x2c0000, 0x2dffff) AM_RAM AM_SHARE("videoram") |
| 399 | AM_RANGE(0x280000, 0x287fff) AM_RAM_WRITE(videoram_1_w) AM_SHARE("videoram_1") |
| 400 | AM_RANGE(0x288000, 0x28ffff) AM_RAM_WRITE(videoram_2_w) AM_SHARE("videoram_2") |
| 401 | AM_RANGE(0x290000, 0x297fff) AM_RAM |
| 77 | 402 | |
| 78 | | AM_RANGE(0x2FF800, 0x2FFFFF) AM_RAM |
| 79 | | AM_RANGE(0x34001A, 0x34001B) AM_READ(bmcpokr_unk_r) |
| 403 | AM_RANGE(0x2a0000, 0x2dffff) AM_RAM_WRITE(pixram_w) AM_SHARE("pixram") |
| 80 | 404 | |
| 405 | AM_RANGE(0x2ff800, 0x2ff9ff) AM_RAM AM_SHARE("scrollram_1") |
| 406 | AM_RANGE(0x2ffa00, 0x2ffbff) AM_RAM AM_SHARE("scrollram_2") |
| 407 | AM_RANGE(0x2ffc00, 0x2ffdff) AM_RAM AM_SHARE("scrollram_3") |
| 408 | AM_RANGE(0x2ffe00, 0x2fffff) AM_RAM |
| 409 | |
| 410 | AM_RANGE(0x320000, 0x320003) AM_RAM AM_SHARE("layerctrl") |
| 411 | |
| 412 | AM_RANGE(0x330000, 0x330001) AM_READWRITE(prot_r, prot_w) |
| 413 | |
| 414 | AM_RANGE(0x340000, 0x340001) AM_RAM // 340001.b, rw |
| 415 | AM_RANGE(0x340002, 0x340003) AM_RAM // 340003.b, w(9d) |
| 416 | AM_RANGE(0x340006, 0x340007) AM_WRITE(irq_ack_w) |
| 417 | AM_RANGE(0x340008, 0x340009) AM_WRITE(irq_enable_w) |
| 418 | AM_RANGE(0x34000e, 0x34000f) AM_RAM AM_SHARE("priority") // 34000f.b, w (priority?) |
| 419 | AM_RANGE(0x340016, 0x340017) AM_WRITE(pixpal_w) |
| 420 | AM_RANGE(0x340018, 0x340019) AM_RAM // 340019.b, w |
| 421 | AM_RANGE(0x34001a, 0x34001b) AM_READ(unk_r) AM_WRITENOP |
| 422 | AM_RANGE(0x34001c, 0x34001d) AM_RAM // 34001d.b, w(0) |
| 423 | |
| 424 | AM_RANGE(0x350000, 0x350001) AM_DEVWRITE8("ramdac",ramdac_device, index_w, 0x00ff ) |
| 425 | AM_RANGE(0x350002, 0x350003) AM_DEVWRITE8("ramdac",ramdac_device, pal_w, 0x00ff ) |
| 426 | AM_RANGE(0x350004, 0x350005) AM_DEVWRITE8("ramdac",ramdac_device, mask_w, 0x00ff ) |
| 427 | |
| 428 | AM_RANGE(0x360000, 0x360001) AM_READ(dsw_r) |
| 429 | |
| 430 | AM_RANGE(0x370000, 0x370001) AM_READ_PORT("INPUTS") |
| 431 | |
| 432 | AM_RANGE(0x380000, 0x380001) AM_WRITE(mux_w) |
| 433 | |
| 434 | AM_RANGE(0x390000, 0x390003) AM_DEVWRITE8("ymsnd", ym2413_device, write, 0x00ff) |
| 435 | AM_RANGE(0x398000, 0x398001) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff) |
| 436 | |
| 437 | AM_RANGE(0x3b0000, 0x3b0001) AM_READ_PORT("INPUTS2") |
| 81 | 438 | ADDRESS_MAP_END |
| 82 | 439 | |
| 440 | /*************************************************************************** |
| 441 | Input Ports |
| 442 | ***************************************************************************/ |
| 443 | |
| 83 | 444 | static INPUT_PORTS_START( bmcpokr ) |
| 445 | PORT_START("INPUTS") |
| 446 | // Poker controls: |
| 447 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // KEY-IN [KEY-IN, credit +500] |
| 448 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_POKER_HOLD5 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // HOLD 5 |
| 449 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_POKER_HOLD4 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // HOLD 4 |
| 450 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_POKER_HOLD2 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // HOLD 2 |
| 451 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // HOLD 1 [INSTRUCTIONS] |
| 452 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_POKER_HOLD3 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // HOLD 3 |
| 453 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // n.a. [START, ESC in service mode] |
| 454 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // SCORE |
| 455 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // BET [BET, credit -1] |
| 456 | PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100] |
| 457 | PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // ACCOUNT [SERVICE MODE] |
| 458 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // KEY-OUT [KEY-OUT, no hopper] |
| 459 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // DOUBLE-UP |
| 460 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_GAMBLE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // SMALL |
| 461 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_GAMBLE_HIGH ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) // BIG |
| 462 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x80) PORT_IMPULSE(5) // COIN-IN [COIN-IN, credit +100, coin-jam] |
| 463 | |
| 464 | // Joystick controls: |
| 465 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // B2 [KEY-IN, credit +500] |
| 466 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // C1 |
| 467 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // B1 |
| 468 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(1) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Right>1 (4th) |
| 469 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_POKER_HOLD1 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Left>1 (3rd) [INSTRUCTIONS] |
| 470 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // A1 |
| 471 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // n.a. [START, ESC in service mode] |
| 472 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Left>2 (3rd) |
| 473 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_POKER_BET ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Down>1 (2nd) [BET, credit -1] |
| 474 | // PORT_BIT( 0x0200, IP_ACTIVE_HIGH,IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, bmcpokr_state,hopper_r, NULL) // HP [HOPPER, credit -100] |
| 475 | PORT_SERVICE_NO_TOGGLE( 0x0400, IP_ACTIVE_LOW ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // A2 [SERVICE MODE] |
| 476 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // C2 [KEY-OUT, no hopper] |
| 477 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_GAMBLE_D_UP ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // S1 [START, ESC in service mode] |
| 478 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_PLAYER(2) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Right>2 (4th) |
| 479 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) // <Up>1 (1st) |
| 480 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CONDITION("DSW4",0x80,EQUALS,0x00) PORT_IMPULSE(5) // <coin-in> (1st) [COIN-IN, credit +100, coin-jam] |
| 481 | |
| 482 | PORT_START("INPUTS2") |
| 483 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT ) // <coin-out> (2nd) [COIN-OUT, hopper (otherwise pay-error)] |
| 484 | |
| 84 | 485 | PORT_START("DSW1") |
| 85 | | PORT_DIPNAME( 0x01, 0x00, "DSW1:1" ) |
| 86 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 87 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 88 | | PORT_DIPNAME( 0x02, 0x00, "DSW1:2" ) |
| 89 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 90 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 91 | | PORT_DIPNAME( 0x04, 0x00, "DSW1:3" ) |
| 92 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 93 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 94 | | PORT_DIPNAME( 0x08, 0x00, "DSW1:4" ) |
| 95 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 96 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 97 | | PORT_DIPNAME( 0x10, 0x00, "DSW1:5" ) |
| 98 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 99 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 100 | | PORT_DIPNAME( 0x20, 0x00, "DSW1:6" ) |
| 101 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 102 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 103 | | PORT_DIPNAME( 0x40, 0x00, "DSW1:7" ) |
| 104 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 105 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 106 | | PORT_DIPNAME( 0x80, 0x00, "DSW1:8" ) |
| 107 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 108 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 486 | PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DIP1:1") |
| 487 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 488 | PORT_DIPSETTING( 0x01, DEF_STR( No ) ) |
| 489 | PORT_DIPNAME( 0x02, 0x00, "Doube-Up Game" ) PORT_DIPLOCATION("DIP1:2") |
| 490 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 491 | PORT_DIPSETTING( 0x02, DEF_STR( No ) ) |
| 492 | PORT_DIPNAME( 0x04, 0x00, "Slot Machine" ) PORT_DIPLOCATION("DIP1:3") |
| 493 | PORT_DIPSETTING( 0x00, "Machinery" ) |
| 494 | PORT_DIPSETTING( 0x04, "??" ) |
| 495 | PORT_DIPNAME( 0x08, 0x00, "Poker Game" ) PORT_DIPLOCATION("DIP1:4") |
| 496 | PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) |
| 497 | PORT_DIPSETTING( 0x08, DEF_STR( No ) ) |
| 498 | PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DIP1:5" ) |
| 499 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIP1:6" ) |
| 500 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIP1:7" ) |
| 501 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP1:8" ) |
| 109 | 502 | |
| 110 | 503 | PORT_START("DSW2") |
| 111 | | PORT_DIPNAME( 0x01, 0x00, "DSW2:1" ) |
| 112 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 113 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 114 | | PORT_DIPNAME( 0x02, 0x00, "DSW2:2" ) |
| 115 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 116 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 117 | | PORT_DIPNAME( 0x04, 0x00, "DSW2:3" ) |
| 118 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 119 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 120 | | PORT_DIPNAME( 0x08, 0x00, "DSW2:4" ) |
| 121 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 122 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 123 | | PORT_DIPNAME( 0x10, 0x00, "DSW2:5" ) |
| 124 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 125 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 126 | | PORT_DIPNAME( 0x20, 0x00, "DSW2:6" ) |
| 127 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 128 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 129 | | PORT_DIPNAME( 0x40, 0x00, "DSW2:7" ) |
| 130 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 131 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 132 | | PORT_DIPNAME( 0x80, 0x00, "DSW2:8" ) |
| 133 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 134 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 504 | PORT_DIPNAME( 0x03, 0x03, "Credit Limit" ) PORT_DIPLOCATION("DIP2:1,2") |
| 505 | PORT_DIPSETTING( 0x03, "5k" ) |
| 506 | PORT_DIPSETTING( 0x02, "10k" ) |
| 507 | PORT_DIPSETTING( 0x01, "50k" ) |
| 508 | PORT_DIPSETTING( 0x00, "100k" ) |
| 509 | PORT_DIPNAME( 0x0c, 0x0c, "Key-In Limit" ) PORT_DIPLOCATION("DIP2:3,4") |
| 510 | PORT_DIPSETTING( 0x0c, "5k" ) |
| 511 | PORT_DIPSETTING( 0x08, "10k" ) |
| 512 | PORT_DIPSETTING( 0x04, "20k" ) |
| 513 | PORT_DIPSETTING( 0x00, "50k" ) |
| 514 | PORT_DIPNAME( 0x10, 0x10, "Open Cards Mode" ) PORT_DIPLOCATION("DIP2:5") |
| 515 | PORT_DIPSETTING( 0x10, "Reels" ) |
| 516 | PORT_DIPSETTING( 0x00, "Turn Over" ) |
| 517 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIP2:6" ) |
| 518 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIP2:7" ) |
| 519 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP2:8" ) |
| 135 | 520 | |
| 136 | 521 | PORT_START("DSW3") |
| 137 | | PORT_DIPNAME( 0x01, 0x00, "DSW3:1" ) |
| 138 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 139 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 140 | | PORT_DIPNAME( 0x02, 0x00, "DSW3:2" ) |
| 141 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 142 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 143 | | PORT_DIPNAME( 0x04, 0x00, "DSW3:3" ) |
| 144 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 145 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 146 | | PORT_DIPNAME( 0x08, 0x00, "DSW3:4" ) |
| 147 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 148 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 149 | | PORT_DIPNAME( 0x10, 0x00, "DSW3:5" ) |
| 150 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 151 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 152 | | PORT_DIPNAME( 0x20, 0x00, "DSW3:6" ) |
| 153 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 154 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 155 | | PORT_DIPNAME( 0x40, 0x00, "DSW3:7" ) |
| 156 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 157 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 158 | | PORT_DIPNAME( 0x80, 0x00, "DSW3:8" ) |
| 159 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 160 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 522 | PORT_DIPNAME( 0x03, 0x03, "Win Rate" ) PORT_DIPLOCATION("DIP3:1,2") |
| 523 | PORT_DIPSETTING( 0x02, "96" ) |
| 524 | PORT_DIPSETTING( 0x01, "97" ) |
| 525 | PORT_DIPSETTING( 0x03, "98" ) |
| 526 | PORT_DIPSETTING( 0x00, "99" ) |
| 527 | PORT_DIPNAME( 0x0c, 0x0c, "Double-Up Rate" ) PORT_DIPLOCATION("DIP3:3,4") |
| 528 | PORT_DIPSETTING( 0x08, "93" ) |
| 529 | PORT_DIPSETTING( 0x04, "94" ) |
| 530 | PORT_DIPSETTING( 0x00, "95" ) |
| 531 | PORT_DIPSETTING( 0x0c, "96" ) |
| 532 | PORT_DIPNAME( 0x10, 0x10, "Bonus Bet" ) PORT_DIPLOCATION("DIP3:5") |
| 533 | PORT_DIPSETTING( 0x10, "30" ) |
| 534 | PORT_DIPSETTING( 0x00, "48" ) |
| 535 | PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIP3:6" ) |
| 536 | PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIP3:7" ) |
| 537 | PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "DIP3:8" ) |
| 161 | 538 | |
| 162 | 539 | PORT_START("DSW4") |
| 163 | | PORT_DIPNAME( 0x01, 0x00, "DSW4:1" ) |
| 164 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 165 | | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 166 | | PORT_DIPNAME( 0x02, 0x00, "DSW4:2" ) |
| 167 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 168 | | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 169 | | PORT_DIPNAME( 0x04, 0x00, "DSW4:3" ) |
| 170 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 171 | | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 172 | | PORT_DIPNAME( 0x08, 0x00, "DSW4:4" ) |
| 173 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 174 | | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 175 | | PORT_DIPNAME( 0x10, 0x00, "DSW4:5" ) |
| 176 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 177 | | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 178 | | PORT_DIPNAME( 0x20, 0x00, "DSW4:6" ) |
| 179 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 180 | | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 181 | | PORT_DIPNAME( 0x40, 0x00, "DSW4:7" ) |
| 182 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 183 | | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 184 | | PORT_DIPNAME( 0x80, 0x00, "DSW4:8" ) |
| 185 | | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 186 | | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 187 | | |
| 540 | PORT_DIPNAME( 0x01, 0x01, "Max Bet" ) PORT_DIPLOCATION("DIP4:1") |
| 541 | PORT_DIPSETTING( 0x01, "48" ) |
| 542 | PORT_DIPSETTING( 0x00, "96" ) |
| 543 | PORT_DIPNAME( 0x06, 0x06, "Min Bet" ) PORT_DIPLOCATION("DIP4:2,3") |
| 544 | PORT_DIPSETTING( 0x06, "6" ) |
| 545 | PORT_DIPSETTING( 0x04, "12" ) |
| 546 | PORT_DIPSETTING( 0x02, "18" ) |
| 547 | PORT_DIPSETTING( 0x00, "30" ) |
| 548 | PORT_DIPNAME( 0x18, 0x18, "Credits Per Coin" ) PORT_DIPLOCATION("DIP4:4,5") |
| 549 | PORT_DIPSETTING( 0x10, "10" ) |
| 550 | PORT_DIPSETTING( 0x08, "20" ) |
| 551 | PORT_DIPSETTING( 0x18, "50" ) |
| 552 | PORT_DIPSETTING( 0x00, "100" ) |
| 553 | PORT_DIPNAME( 0x60, 0x60, "Credits Per Key-In" ) PORT_DIPLOCATION("DIP4:6,7") |
| 554 | PORT_DIPSETTING( 0x40, "10" ) |
| 555 | PORT_DIPSETTING( 0x20, "50" ) |
| 556 | PORT_DIPSETTING( 0x60, "100" ) |
| 557 | PORT_DIPSETTING( 0x00, "500" ) |
| 558 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Controls ) ) PORT_DIPLOCATION("DIP4:8") |
| 559 | PORT_DIPSETTING( 0x80, "Poker" ) |
| 560 | PORT_DIPSETTING( 0x00, DEF_STR( Joystick ) ) |
| 188 | 561 | INPUT_PORTS_END |
| 189 | 562 | |
| 563 | /*************************************************************************** |
| 564 | Graphics Layout |
| 565 | ***************************************************************************/ |
| 190 | 566 | |
| 191 | 567 | static const gfx_layout tiles8x8_layout = |
| 192 | 568 | { |
| 193 | 569 | 8,8, |
| 194 | 570 | RGN_FRAC(1,2), |
| 195 | 571 | 8, |
| 196 | | { 0, 1, 2, 3, RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+1, RGN_FRAC(1,2)+2, RGN_FRAC(1,2)+3 }, |
| 197 | | { 0, 4, 8, 12, 16, 20, 24, 28 }, |
| 198 | | { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32 }, |
| 199 | | 32*8 |
| 572 | { RGN_FRAC(1,2)+0, RGN_FRAC(1,2)+1, RGN_FRAC(1,2)+2, RGN_FRAC(1,2)+3, 0, 1, 2, 3 }, |
| 573 | { STEP8(0, 4) }, |
| 574 | { STEP8(0, 4*8) }, |
| 575 | 8*8*4 |
| 200 | 576 | }; |
| 201 | 577 | |
| 202 | 578 | static GFXDECODE_START( bmcpokr ) |
| 203 | | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) |
| 579 | GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 1 ) |
| 204 | 580 | GFXDECODE_END |
| 205 | 581 | |
| 206 | | UINT32 bmcpokr_state::screen_update_bmcpokr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 582 | /*************************************************************************** |
| 583 | Machine Drivers |
| 584 | ***************************************************************************/ |
| 585 | |
| 586 | TIMER_DEVICE_CALLBACK_MEMBER(bmcpokr_state::interrupt) |
| 207 | 587 | { |
| 208 | | gfx_element *gfx = m_gfxdecode->gfx(0); |
| 588 | int scanline = param; |
| 209 | 589 | |
| 210 | | int count = 0; |
| 211 | | for (int y=0;y<32;y++) |
| 212 | | { |
| 213 | | for (int x=0;x<64;x++) |
| 214 | | { |
| 215 | | UINT16 data = m_videoram[count]; |
| 216 | | count++; |
| 590 | if (scanline == 240) |
| 591 | if (m_irq_enable & (1<<2)) m_maincpu->set_input_line(2, ASSERT_LINE); |
| 217 | 592 | |
| 218 | | gfx->opaque(bitmap,cliprect,data,0,0,0,x*8,y*8); |
| 593 | if (scanline == 128) |
| 594 | if (m_irq_enable & (1<<3)) m_maincpu->set_input_line(3, ASSERT_LINE); |
| 219 | 595 | |
| 220 | | } |
| 221 | | } |
| 222 | | |
| 223 | | |
| 224 | | |
| 225 | | return 0; |
| 596 | if (scanline == 64) |
| 597 | if (m_irq_enable & (1<<6)) m_maincpu->set_input_line(6, ASSERT_LINE); |
| 226 | 598 | } |
| 227 | 599 | |
| 228 | | void bmcpokr_state::video_start() |
| 229 | | { |
| 230 | | } |
| 600 | static ADDRESS_MAP_START( ramdac_map, AS_0, 8, bmcpokr_state ) |
| 601 | AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac",ramdac_device,ramdac_pal_r,ramdac_rgb666_w) |
| 602 | ADDRESS_MAP_END |
| 231 | 603 | |
| 232 | | |
| 233 | 604 | static MACHINE_CONFIG_START( bmcpokr, bmcpokr_state ) |
| 234 | | MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz/4) |
| 605 | MCFG_CPU_ADD("maincpu", M68000, XTAL_42MHz / 4) // 68000 @10.50MHz (42/4) |
| 235 | 606 | MCFG_CPU_PROGRAM_MAP(bmcpokr_mem) |
| 236 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", bmcpokr_state, irq3_line_hold) |
| 607 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bmcpokr_state, interrupt, "screen", 0, 1) |
| 237 | 608 | |
| 238 | 609 | MCFG_SCREEN_ADD("screen", RASTER) |
| 239 | | MCFG_SCREEN_REFRESH_RATE(60) |
| 610 | MCFG_SCREEN_REFRESH_RATE(58.935) // HSync - 15.440kHz, VSync - 58.935Hz |
| 611 | |
| 240 | 612 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 241 | 613 | MCFG_SCREEN_UPDATE_DRIVER(bmcpokr_state, screen_update_bmcpokr) |
| 242 | 614 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 243 | | MCFG_SCREEN_VISIBLE_AREA(0*8, 64*8-1, 0*8, 32*8-1) |
| 615 | MCFG_SCREEN_VISIBLE_AREA(0*8, 60*8-1, 0*8, 30*8-1) |
| 244 | 616 | MCFG_SCREEN_PALETTE("palette") |
| 245 | 617 | |
| 246 | 618 | MCFG_PALETTE_ADD("palette", 256) |
| 619 | MCFG_RAMDAC_ADD("ramdac", ramdac_map, "palette") |
| 247 | 620 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", bmcpokr) |
| 248 | 621 | |
| 622 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 623 | |
| 624 | MCFG_TICKET_DISPENSER_ADD("hopper", attotime::from_msec(10), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_LOW) // hopper stuck low if too slow |
| 625 | |
| 626 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 627 | |
| 628 | MCFG_SOUND_ADD("ymsnd", YM2413, XTAL_42MHz / 12) // UM3567 @3.50MHz (42/12) |
| 629 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 630 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 631 | |
| 632 | MCFG_OKIM6295_ADD("oki", XTAL_42MHz / 40, OKIM6295_PIN7_HIGH) // M6295 @1.05MHz (42/40), pin 7 not verified |
| 633 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 634 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 249 | 635 | MACHINE_CONFIG_END |
| 250 | 636 | |
| 637 | /*************************************************************************** |
| 638 | ROMs Loading |
| 639 | ***************************************************************************/ |
| 251 | 640 | |
| 252 | 641 | ROM_START( bmcpokr ) |
| 253 | | ROM_REGION( 0x400000, "maincpu", 0 ) /* 68000 Code */ |
| 642 | ROM_REGION( 0x40000, "maincpu", 0 ) /* 68000 Code */ |
| 643 | ROM_LOAD16_BYTE( "ch-m-605.u13", 0x000000, 0x20000, CRC(c5c3fcd1) SHA1(b77fef734c290d52ae877a24bb3ee42b24eb5cb8) ) |
| 254 | 644 | ROM_LOAD16_BYTE( "ch-m-505.u12", 0x000001, 0x20000, CRC(d6effaf1) SHA1(b446d3beb3393bc8b3bcd0d543945e6fb6a375b9) ) |
| 255 | | ROM_LOAD16_BYTE( "ch-m-605.u13", 0x000000, 0x20000, CRC(c5c3fcd1) SHA1(b77fef734c290d52ae877a24bb3ee42b24eb5cb8) ) |
| 256 | 645 | |
| 257 | 646 | ROM_REGION( 0x200000, "gfx1", 0 ) |
| 258 | | ROM_LOAD16_BYTE( "ch-m-101.u39", 0x000000, 0x80000, CRC(f4b82e0a) SHA1(f545c6ab1375518de06900f02a0eb5af1edeeb47) ) |
| 259 | | ROM_LOAD16_BYTE( "ch-m-201.u40", 0x000001, 0x80000, CRC(520571cb) SHA1(5c006f10d6192939003f8197e8bb64908a826fc1) ) |
| 260 | | ROM_LOAD16_BYTE( "ch-m-301.u45", 0x100000, 0x80000, CRC(daba09c3) SHA1(e5d2f92b63288c36faa367a3306d1999264843e8) ) |
| 261 | | ROM_LOAD16_BYTE( "ch-a-401.u29", 0x100001, 0x80000, CRC(5ee5d39f) SHA1(f6881aa5c755831d885f7adf35a5a094f7302205) ) |
| 647 | ROM_LOAD16_BYTE( "ch-m-101.u39", 0x000000, 0x80000, CRC(f4b82e0a) SHA1(f545c6ab1375518de06900f02a0eb5af1edeeb47) ) |
| 648 | ROM_LOAD16_BYTE( "ch-m-201.u40", 0x000001, 0x80000, CRC(520571cb) SHA1(5c006f10d6192939003f8197e8bb64908a826fc1) ) |
| 649 | ROM_LOAD16_BYTE( "ch-m-301.u45", 0x100000, 0x80000, CRC(daba09c3) SHA1(e5d2f92b63288c36faa367a3306d1999264843e8) ) |
| 650 | ROM_LOAD16_BYTE( "ch-a-401.u29", 0x100001, 0x80000, CRC(5ee5d39f) SHA1(f6881aa5c755831d885f7adf35a5a094f7302205) ) |
| 262 | 651 | |
| 263 | | ROM_REGION( 0x040000, "oki", 0 ) /* Samples */ |
| 652 | ROM_REGION( 0x40000, "oki", 0 ) /* Samples */ |
| 264 | 653 | ROM_LOAD( "ch-m-701.u10", 0x00000, 0x40000, CRC(e01be644) SHA1(b68682786d5b40cb5672cfd7f717adcfb8fac7d3) ) |
| 265 | 654 | ROM_END |
| 266 | 655 | |
| 267 | | |
| 268 | | |
| 269 | | |
| 270 | | GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, driver_device, 0, ROT0, "BMC", "unknown BMC poker game", GAME_NOT_WORKING | GAME_IS_SKELETON ) |
| 656 | GAME( 1999, bmcpokr, 0, bmcpokr, bmcpokr, driver_device, 0, ROT0, "BMC", "Dongfang Shenlong", GAME_SUPPORTS_SAVE ) |