src/mame/drivers/magicard.c
| r14899 | r14900 | |
| 174 | 174 | : driver_device(mconfig, type, tag) , |
| 175 | 175 | m_magicram(*this, "magicram"), |
| 176 | 176 | m_pcab_vregs(*this, "pcab_vregs"), |
| 177 | | m_scc68070_ext_irqc_regs(*this, "scc68070_ext_irqc_regs"), |
| 178 | | m_scc68070_iic_regs(*this, "scc68070_iic_regs"), |
| 179 | | m_scc68070_uart_regs(*this, "scc68070_uart_regs"), |
| 180 | | m_scc68070_timer_regs(*this, "scc68070_timer_regs"), |
| 181 | | m_scc68070_int_irqc_regs(*this, "scc68070_int_irqc_regs"), |
| 182 | | m_scc68070_dma_ch1_regs(*this, "scc68070_dma_ch1_regs"), |
| 183 | | m_scc68070_dma_ch2_regs(*this, "scc68070_dma_ch2_regs"), |
| 184 | | m_scc68070_mmu_regs(*this, "scc68070_mmu_regs"){ } |
| 177 | m_scc68070_ext_irqc_regs(*this, "scc_xirqc_regs"), |
| 178 | m_scc68070_iic_regs(*this, "scc_iic_regs"), |
| 179 | m_scc68070_uart_regs(*this, "scc_uart_regs"), |
| 180 | m_scc68070_timer_regs(*this, "scc_timer_regs"), |
| 181 | m_scc68070_int_irqc_regs(*this, "scc_iirqc_regs"), |
| 182 | m_scc68070_dma_ch1_regs(*this, "scc_dma1_regs"), |
| 183 | m_scc68070_dma_ch2_regs(*this, "scc_dma2_regs"), |
| 184 | m_scc68070_mmu_regs(*this, "scc_mmu_regs"){ } |
| 185 | 185 | |
| 186 | 186 | required_shared_ptr<UINT16> m_magicram; |
| 187 | 187 | required_shared_ptr<UINT16> m_pcab_vregs; |
| r14899 | r14900 | |
| 248 | 248 | */ |
| 249 | 249 | |
| 250 | 250 | /*63 at post test,6d all the time.*/ |
| 251 | | #define SCC_CSR_VREG (state->m_pcab_vregs.target()[0x00/2] & 0xffff) |
| 251 | #define SCC_CSR_VREG (state->m_pcab_vregs[0x00/2] & 0xffff) |
| 252 | 252 | #define SCC_CG_VREG ((SCC_CSR_VREG & 0x10)>>4) |
| 253 | 253 | |
| 254 | 254 | /* |
| r14899 | r14900 | |
| 274 | 274 | w ........ ....aaaa VSR:H = video start address (MSB's) |
| 275 | 275 | */ |
| 276 | 276 | |
| 277 | | #define SCC_DCR_VREG (state->m_pcab_vregs.target()[0x02/2] & 0xffff) |
| 277 | #define SCC_DCR_VREG (state->m_pcab_vregs[0x02/2] & 0xffff) |
| 278 | 278 | #define SCC_DE_VREG ((SCC_DCR_VREG & 0x8000)>>15) |
| 279 | 279 | #define SCC_FG_VREG ((SCC_DCR_VREG & 0x0080)>>7) |
| 280 | 280 | #define SCC_VSR_VREG_H ((SCC_DCR_VREG & 0xf)>>0) |
| r14899 | r14900 | |
| 284 | 284 | w aaaaaaaa aaaaaaaa VSR:L = video start address (LSB's) |
| 285 | 285 | */ |
| 286 | 286 | |
| 287 | | #define SCC_VSR_VREG_L (state->m_pcab_vregs.target()[0x04/2] & 0xffff) |
| 287 | #define SCC_VSR_VREG_L (state->m_pcab_vregs[0x04/2] & 0xffff) |
| 288 | 288 | #define SCC_VSR_VREG ((SCC_VSR_VREG_H)<<16) | (SCC_VSR_VREG_L) |
| 289 | 289 | |
| 290 | 290 | /* |
| r14899 | r14900 | |
| 303 | 303 | w ........ xxxx.... not used |
| 304 | 304 | w ........ ....aaaa "data" (dunno the purpose...) |
| 305 | 305 | */ |
| 306 | | #define SCC_DCR2_VREG (state->m_pcab_vregs.target()[0x08/2] & 0xffff) |
| 306 | #define SCC_DCR2_VREG (state->m_pcab_vregs[0x08/2] & 0xffff) |
| 307 | 307 | |
| 308 | 308 | /* |
| 309 | 309 | (Note: not present on the original vreg listing) |
| r14899 | r14900 | |
| 324 | 324 | 1ffff0 a = source register a |
| 325 | 325 | w nnnnnnnn nnnnnnnn source |
| 326 | 326 | */ |
| 327 | | #define SCC_SRCA_VREG (state->m_pcab_vregs.target()[0x10/2] & 0xffff) |
| 327 | #define SCC_SRCA_VREG (state->m_pcab_vregs[0x10/2] & 0xffff) |
| 328 | 328 | |
| 329 | 329 | /* |
| 330 | 330 | 1ffff2 b = destination register b |
| 331 | 331 | rw nnnnnnnn nnnnnnnn destination |
| 332 | 332 | */ |
| 333 | 333 | |
| 334 | | #define SCC_DSTB_VREG (state->m_pcab_vregs.target()[0x12/2] & 0xffff) |
| 334 | #define SCC_DSTB_VREG (state->m_pcab_vregs[0x12/2] & 0xffff) |
| 335 | 335 | |
| 336 | 336 | /* |
| 337 | 337 | 1ffff4 pcr = pixac command register |
| r14899 | r14900 | |
| 378 | 378 | w ........ .......0 |
| 379 | 379 | */ |
| 380 | 380 | |
| 381 | | #define SCC_PCR_VREG (state->m_pcab_vregs.target()[0x14/2] & 0xffff) |
| 381 | #define SCC_PCR_VREG (state->m_pcab_vregs[0x14/2] & 0xffff) |
| 382 | 382 | |
| 383 | 383 | /* |
| 384 | 384 | 1ffff6 mask = mask register |
| r14899 | r14900 | |
| 430 | 430 | { |
| 431 | 431 | UINT32 color; |
| 432 | 432 | |
| 433 | | color = ((state->m_magicram.target()[count]) & 0x000f)>>0; |
| 433 | color = ((state->m_magicram[count]) & 0x000f)>>0; |
| 434 | 434 | |
| 435 | 435 | if(cliprect.contains((x*4)+3, y)) |
| 436 | 436 | bitmap.pix32(y, (x*4)+3) = screen.machine().pens[color]; |
| 437 | 437 | |
| 438 | | color = ((state->m_magicram.target()[count]) & 0x00f0)>>4; |
| 438 | color = ((state->m_magicram[count]) & 0x00f0)>>4; |
| 439 | 439 | |
| 440 | 440 | if(cliprect.contains((x*4)+2, y)) |
| 441 | 441 | bitmap.pix32(y, (x*4)+2) = screen.machine().pens[color]; |
| 442 | 442 | |
| 443 | | color = ((state->m_magicram.target()[count]) & 0x0f00)>>8; |
| 443 | color = ((state->m_magicram[count]) & 0x0f00)>>8; |
| 444 | 444 | |
| 445 | 445 | if(cliprect.contains((x*4)+1, y)) |
| 446 | 446 | bitmap.pix32(y, (x*4)+1) = screen.machine().pens[color]; |
| 447 | 447 | |
| 448 | | color = ((state->m_magicram.target()[count]) & 0xf000)>>12; |
| 448 | color = ((state->m_magicram[count]) & 0xf000)>>12; |
| 449 | 449 | |
| 450 | 450 | if(cliprect.contains((x*4)+0, y)) |
| 451 | 451 | bitmap.pix32(y, (x*4)+0) = screen.machine().pens[color]; |
| r14899 | r14900 | |
| 462 | 462 | { |
| 463 | 463 | UINT32 color; |
| 464 | 464 | |
| 465 | | color = ((state->m_magicram.target()[count]) & 0x00ff)>>0; |
| 465 | color = ((state->m_magicram[count]) & 0x00ff)>>0; |
| 466 | 466 | |
| 467 | 467 | if(cliprect.contains((x*2)+1, y)) |
| 468 | 468 | bitmap.pix32(y, (x*2)+1) = screen.machine().pens[color]; |
| 469 | 469 | |
| 470 | | color = ((state->m_magicram.target()[count]) & 0xff00)>>8; |
| 470 | color = ((state->m_magicram[count]) & 0xff00)>>8; |
| 471 | 471 | |
| 472 | 472 | if(cliprect.contains((x*2)+0, y)) |
| 473 | 473 | bitmap.pix32(y, (x*2)+0) = screen.machine().pens[color]; |
| r14899 | r14900 | |
| 534 | 534 | //printf("[%04x]\n",offset*2); |
| 535 | 535 | |
| 536 | 536 | |
| 537 | | return m_pcab_vregs.target()[offset]; |
| 537 | return m_pcab_vregs[offset]; |
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | WRITE16_MEMBER(magicard_state::philips_66470_w) |
| 541 | 541 | { |
| 542 | | COMBINE_DATA(&m_pcab_vregs.target()[offset]); |
| 542 | COMBINE_DATA(&m_pcab_vregs[offset]); |
| 543 | 543 | |
| 544 | 544 | // if(offset == 0x10/2) |
| 545 | 545 | // { |
| 546 | | //printf("%04x %04x %04x\n",data,m_pcab_vregs.target()[0x12/2],m_pcab_vregs.target()[0x14/2]); |
| 547 | | //m_pcab_vregs.target()[0x12/2] = m_pcab_vregs.target()[0x10/2]; |
| 546 | //printf("%04x %04x %04x\n",data,m_pcab_vregs[0x12/2],m_pcab_vregs[0x14/2]); |
| 547 | //m_pcab_vregs[0x12/2] = m_pcab_vregs[0x10/2]; |
| 548 | 548 | // } |
| 549 | 549 | } |
| 550 | 550 | |
| r14899 | r14900 | |
| 552 | 552 | |
| 553 | 553 | READ16_MEMBER(magicard_state::scc68070_ext_irqc_r) |
| 554 | 554 | { |
| 555 | | return m_scc68070_ext_irqc_regs.target()[offset]; |
| 555 | return m_scc68070_ext_irqc_regs[offset]; |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | WRITE16_MEMBER(magicard_state::scc68070_ext_irqc_w) |
| 559 | 559 | { |
| 560 | | m_scc68070_ext_irqc_regs.target()[offset] = data; |
| 560 | m_scc68070_ext_irqc_regs[offset] = data; |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | READ16_MEMBER(magicard_state::scc68070_iic_r) |
| r14899 | r14900 | |
| 566 | 566 | |
| 567 | 567 | switch(offset) |
| 568 | 568 | { |
| 569 | | case 0x04/2: return m_scc68070_iic_regs.target()[offset] & 0xef; //iic status register, bit 4 = pending irq |
| 569 | case 0x04/2: return m_scc68070_iic_regs[offset] & 0xef; //iic status register, bit 4 = pending irq |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | | return m_scc68070_iic_regs.target()[offset]; |
| 572 | return m_scc68070_iic_regs[offset]; |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | WRITE16_MEMBER(magicard_state::scc68070_iic_w) |
| 576 | 576 | { |
| 577 | | m_scc68070_iic_regs.target()[offset] = data; |
| 577 | m_scc68070_iic_regs[offset] = data; |
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | READ16_MEMBER(magicard_state::scc68070_uart_r) |
| r14899 | r14900 | |
| 586 | 586 | case 0x02/2: return machine().rand(); //uart mode register |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | | return m_scc68070_uart_regs.target()[offset]; |
| 589 | return m_scc68070_uart_regs[offset]; |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | WRITE16_MEMBER(magicard_state::scc68070_uart_w) |
| 593 | 593 | { |
| 594 | | m_scc68070_uart_regs.target()[offset] = data; |
| 594 | m_scc68070_uart_regs[offset] = data; |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | READ16_MEMBER(magicard_state::scc68070_timer_r) |
| 598 | 598 | { |
| 599 | | return m_scc68070_timer_regs.target()[offset]; |
| 599 | return m_scc68070_timer_regs[offset]; |
| 600 | 600 | } |
| 601 | 601 | |
| 602 | 602 | WRITE16_MEMBER(magicard_state::scc68070_timer_w) |
| 603 | 603 | { |
| 604 | | m_scc68070_timer_regs.target()[offset] = data; |
| 604 | m_scc68070_timer_regs[offset] = data; |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | 607 | READ16_MEMBER(magicard_state::scc68070_int_irqc_r) |
| 608 | 608 | { |
| 609 | | return m_scc68070_int_irqc_regs.target()[offset]; |
| 609 | return m_scc68070_int_irqc_regs[offset]; |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | WRITE16_MEMBER(magicard_state::scc68070_int_irqc_w) |
| 613 | 613 | { |
| 614 | | m_scc68070_int_irqc_regs.target()[offset] = data; |
| 614 | m_scc68070_int_irqc_regs[offset] = data; |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | READ16_MEMBER(magicard_state::scc68070_dma_ch1_r) |
| 618 | 618 | { |
| 619 | | return m_scc68070_dma_ch1_regs.target()[offset]; |
| 619 | return m_scc68070_dma_ch1_regs[offset]; |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | 622 | WRITE16_MEMBER(magicard_state::scc68070_dma_ch1_w) |
| 623 | 623 | { |
| 624 | | m_scc68070_dma_ch1_regs.target()[offset] = data; |
| 624 | m_scc68070_dma_ch1_regs[offset] = data; |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | READ16_MEMBER(magicard_state::scc68070_dma_ch2_r) |
| 628 | 628 | { |
| 629 | | return m_scc68070_dma_ch2_regs.target()[offset]; |
| 629 | return m_scc68070_dma_ch2_regs[offset]; |
| 630 | 630 | } |
| 631 | 631 | |
| 632 | 632 | WRITE16_MEMBER(magicard_state::scc68070_dma_ch2_w) |
| 633 | 633 | { |
| 634 | | m_scc68070_dma_ch2_regs.target()[offset] = data; |
| 634 | m_scc68070_dma_ch2_regs[offset] = data; |
| 635 | 635 | } |
| 636 | 636 | |
| 637 | 637 | READ16_MEMBER(magicard_state::scc68070_mmu_r) |
| 638 | 638 | { |
| 639 | | return m_scc68070_mmu_regs.target()[offset]; |
| 639 | return m_scc68070_mmu_regs[offset]; |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | 642 | WRITE16_MEMBER(magicard_state::scc68070_mmu_w) |
| 643 | 643 | { |
| 644 | | m_scc68070_mmu_regs.target()[offset] = data; |
| 644 | m_scc68070_mmu_regs[offset] = data; |
| 645 | 645 | |
| 646 | 646 | switch(offset) |
| 647 | 647 | { |
| r14899 | r14900 | |
| 671 | 671 | AM_RANGE(0x001ffd80, 0x001ffd81) AM_MIRROR(0x7fe00000) AM_WRITENOP //? |
| 672 | 672 | AM_RANGE(0x001fff80, 0x001fffbf) AM_MIRROR(0x7fe00000) AM_RAM //DRAM I/O, not accessed by this game, CD buffer? |
| 673 | 673 | AM_RANGE(0x001fffe0, 0x001fffff) AM_MIRROR(0x7fe00000) AM_READWRITE(philips_66470_r,philips_66470_w) AM_SHARE("pcab_vregs") //video registers |
| 674 | | AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_SHARE("scc68070_ext_irqc_regs") //lir |
| 675 | | AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_SHARE("scc68070_iic_regs") //i2c |
| 676 | | AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_SHARE("scc68070_uart_regs") |
| 677 | | AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_SHARE("scc68070_timer_regs") |
| 678 | | AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_SHARE("scc68070_int_irqc_regs") |
| 679 | | AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_SHARE("scc68070_dma_ch1_regs") |
| 680 | | AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_SHARE("scc68070_dma_ch2_regs") |
| 681 | | AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_SHARE("scc68070_mmu_regs") |
| 674 | AM_RANGE(0x80001000, 0x8000100f) AM_READWRITE(scc68070_ext_irqc_r,scc68070_ext_irqc_w) AM_SHARE("scc_xirqc_regs") //lir |
| 675 | AM_RANGE(0x80002000, 0x8000200f) AM_READWRITE(scc68070_iic_r,scc68070_iic_w) AM_SHARE("scc_iic_regs") //i2c |
| 676 | AM_RANGE(0x80002010, 0x8000201f) AM_READWRITE(scc68070_uart_r,scc68070_uart_w) AM_SHARE("scc_uart_regs") |
| 677 | AM_RANGE(0x80002020, 0x8000202f) AM_READWRITE(scc68070_timer_r,scc68070_timer_w) AM_SHARE("scc_timer_regs") |
| 678 | AM_RANGE(0x80002040, 0x8000204f) AM_READWRITE(scc68070_int_irqc_r,scc68070_int_irqc_w) AM_SHARE("scc_iirqc_regs") |
| 679 | AM_RANGE(0x80004000, 0x8000403f) AM_READWRITE(scc68070_dma_ch1_r,scc68070_dma_ch1_w) AM_SHARE("scc_dma1_regs") |
| 680 | AM_RANGE(0x80004040, 0x8000407f) AM_READWRITE(scc68070_dma_ch2_r,scc68070_dma_ch2_w) AM_SHARE("scc_dma2_regs") |
| 681 | AM_RANGE(0x80008000, 0x8000807f) AM_READWRITE(scc68070_mmu_r,scc68070_mmu_w) AM_SHARE("scc_mmu_regs") |
| 682 | 682 | ADDRESS_MAP_END |
| 683 | 683 | |
| 684 | 684 | |
| r14899 | r14900 | |
| 694 | 694 | { |
| 695 | 695 | magicard_state *state = machine.driver_data<magicard_state>(); |
| 696 | 696 | UINT16 *src = (UINT16*)machine.region("maincpu" )->base(); |
| 697 | | UINT16 *dst = state->m_magicram.target(); |
| 697 | UINT16 *dst = state->m_magicram; |
| 698 | 698 | memcpy (dst, src, 0x80000); |
| 699 | 699 | machine.device("maincpu")->reset(); |
| 700 | 700 | } |
src/mame/drivers/cntsteer.c
| r14899 | r14900 | |
| 112 | 112 | static TILE_GET_INFO( get_bg_tile_info ) |
| 113 | 113 | { |
| 114 | 114 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 115 | | int code = state->m_videoram2.target()[tile_index]; |
| 115 | int code = state->m_videoram2[tile_index]; |
| 116 | 116 | |
| 117 | 117 | SET_TILE_INFO(2, code + state->m_bg_bank, state->m_bg_color_bank, 0); |
| 118 | 118 | } |
| r14899 | r14900 | |
| 120 | 120 | static TILE_GET_INFO( get_fg_tile_info ) |
| 121 | 121 | { |
| 122 | 122 | cntsteer_state *state = machine.driver_data<cntsteer_state>(); |
| 123 | | int code = state->m_videoram.target()[tile_index]; |
| 124 | | int attr = state->m_colorram.target()[tile_index]; |
| 123 | int code = state->m_videoram[tile_index]; |
| 124 | int attr = state->m_colorram[tile_index]; |
| 125 | 125 | |
| 126 | 126 | code |= (attr & 0x01) << 8; |
| 127 | 127 | |
| r14899 | r14900 | |
| 172 | 172 | { |
| 173 | 173 | int multi, fx, fy, sx, sy, code, color; |
| 174 | 174 | |
| 175 | | if ((state->m_spriteram.target()[offs + 1] & 1) == 1) |
| 175 | if ((state->m_spriteram[offs + 1] & 1) == 1) |
| 176 | 176 | continue; |
| 177 | 177 | |
| 178 | | code = state->m_spriteram.target()[offs + 3] + ((state->m_spriteram.target()[offs + 1] & 0xc0) << 2); |
| 179 | | sx = (state->m_spriteram.target()[offs + 2]); |
| 180 | | sy = 0xf0 - state->m_spriteram.target()[offs]; |
| 181 | | color = 0x10 + ((state->m_spriteram.target()[offs + 1] & 0x20) >> 4) + ((state->m_spriteram.target()[offs + 1] & 0x8)>>3); |
| 178 | code = state->m_spriteram[offs + 3] + ((state->m_spriteram[offs + 1] & 0xc0) << 2); |
| 179 | sx = (state->m_spriteram[offs + 2]); |
| 180 | sy = 0xf0 - state->m_spriteram[offs]; |
| 181 | color = 0x10 + ((state->m_spriteram[offs + 1] & 0x20) >> 4) + ((state->m_spriteram[offs + 1] & 0x8)>>3); |
| 182 | 182 | |
| 183 | | fx = !(state->m_spriteram.target()[offs + 1] & 0x04); |
| 184 | | fy = (state->m_spriteram.target()[offs + 1] & 0x02); |
| 183 | fx = !(state->m_spriteram[offs + 1] & 0x04); |
| 184 | fy = (state->m_spriteram[offs + 1] & 0x02); |
| 185 | 185 | |
| 186 | | multi = state->m_spriteram.target()[offs + 1] & 0x10; |
| 186 | multi = state->m_spriteram[offs + 1] & 0x10; |
| 187 | 187 | |
| 188 | 188 | if (state->m_flipscreen) |
| 189 | 189 | { |
| r14899 | r14900 | |
| 230 | 230 | { |
| 231 | 231 | int multi, fx, fy, sx, sy, code, color; |
| 232 | 232 | |
| 233 | | if ((state->m_spriteram.target()[offs + 0] & 1) == 0) |
| 233 | if ((state->m_spriteram[offs + 0] & 1) == 0) |
| 234 | 234 | continue; |
| 235 | 235 | |
| 236 | | code = state->m_spriteram.target()[offs + 1] + ((state->m_spriteram.target()[offs + 0x80] & 0x03) << 8); |
| 237 | | sx = 0x100 - state->m_spriteram.target()[offs + 3]; |
| 238 | | sy = 0x100 - state->m_spriteram.target()[offs + 2]; |
| 239 | | color = 0x10 + ((state->m_spriteram.target()[offs + 0x80] & 0x70) >> 4); |
| 236 | code = state->m_spriteram[offs + 1] + ((state->m_spriteram[offs + 0x80] & 0x03) << 8); |
| 237 | sx = 0x100 - state->m_spriteram[offs + 3]; |
| 238 | sy = 0x100 - state->m_spriteram[offs + 2]; |
| 239 | color = 0x10 + ((state->m_spriteram[offs + 0x80] & 0x70) >> 4); |
| 240 | 240 | |
| 241 | | fx = (state->m_spriteram.target()[offs + 0] & 0x04); |
| 242 | | fy = (state->m_spriteram.target()[offs + 0] & 0x02); |
| 241 | fx = (state->m_spriteram[offs + 0] & 0x04); |
| 242 | fy = (state->m_spriteram[offs + 0] & 0x02); |
| 243 | 243 | |
| 244 | | multi = state->m_spriteram.target()[offs + 0] & 0x10; |
| 244 | multi = state->m_spriteram[offs + 0] & 0x10; |
| 245 | 245 | |
| 246 | 246 | if (state->m_flipscreen) |
| 247 | 247 | { |
| r14899 | r14900 | |
| 433 | 433 | |
| 434 | 434 | WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_vram_w) |
| 435 | 435 | { |
| 436 | | m_videoram.target()[offset] = data; |
| 436 | m_videoram[offset] = data; |
| 437 | 437 | m_fg_tilemap->mark_tile_dirty(offset); |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | 440 | WRITE8_MEMBER(cntsteer_state::cntsteer_foreground_attr_w) |
| 441 | 441 | { |
| 442 | | m_colorram.target()[offset] = data; |
| 442 | m_colorram[offset] = data; |
| 443 | 443 | m_fg_tilemap->mark_tile_dirty(offset); |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | WRITE8_MEMBER(cntsteer_state::cntsteer_background_w) |
| 447 | 447 | { |
| 448 | | m_videoram2.target()[offset] = data; |
| 448 | m_videoram2[offset] = data; |
| 449 | 449 | m_bg_tilemap->mark_tile_dirty(offset); |
| 450 | 450 | } |
| 451 | 451 | |
| r14899 | r14900 | |
| 566 | 566 | |
| 567 | 567 | static ADDRESS_MAP_START( cntsteer_cpu2_map, AS_PROGRAM, 8, cntsteer_state ) |
| 568 | 568 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 569 | | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2") AM_SHARE("share3") |
| 570 | | AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("share3") |
| 569 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2") |
| 570 | AM_RANGE(0x2000, 0x2fff) AM_RAM_WRITE(cntsteer_background_w) AM_SHARE("videoram2") |
| 571 | 571 | AM_RANGE(0x3000, 0x3000) AM_READ_PORT("DSW0") |
| 572 | 572 | AM_RANGE(0x3001, 0x3001) AM_READ(cntsteer_adx_r) |
| 573 | 573 | AM_RANGE(0x3002, 0x3002) AM_READ_PORT("P1") |
src/mame/drivers/hornet.c
| r14899 | r14900 | |
| 327 | 327 | { |
| 328 | 328 | public: |
| 329 | 329 | hornet_state(const machine_config &mconfig, device_type type, const char *tag) |
| 330 | | : driver_device(mconfig, type, tag) { } |
| 330 | : driver_device(mconfig, type, tag), |
| 331 | m_workram(*this, "workram"), |
| 332 | m_sharc_dataram0(*this, "share_dataram0"), |
| 333 | m_sharc_dataram1(*this, "share_dataram1") { } |
| 331 | 334 | |
| 332 | 335 | UINT8 m_led_reg0; |
| 333 | 336 | UINT8 m_led_reg1; |
| 334 | | UINT32 *m_workram; |
| 335 | | UINT32 *m_sharc_dataram[2]; |
| 337 | required_shared_ptr<UINT32> m_workram; |
| 338 | required_shared_ptr<UINT32> m_sharc_dataram0; |
| 339 | required_shared_ptr<UINT32> m_sharc_dataram1; |
| 336 | 340 | UINT8 *m_jvs_sdata; |
| 337 | 341 | UINT32 m_jvs_sdata_ptr; |
| 338 | 342 | emu_timer *m_sound_irq_timer; |
| r14899 | r14900 | |
| 622 | 626 | /*****************************************************************************/ |
| 623 | 627 | |
| 624 | 628 | static ADDRESS_MAP_START( hornet_map, AS_PROGRAM, 32, hornet_state ) |
| 625 | | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_BASE(m_workram) /* Work RAM */ |
| 629 | AM_RANGE(0x00000000, 0x003fffff) AM_RAM AM_SHARE("workram") /* Work RAM */ |
| 626 | 630 | AM_RANGE(0x74000000, 0x740000ff) AM_READWRITE(hornet_k037122_reg_r, hornet_k037122_reg_w) |
| 627 | 631 | AM_RANGE(0x74020000, 0x7403ffff) AM_READWRITE(hornet_k037122_sram_r, hornet_k037122_sram_w) |
| 628 | 632 | AM_RANGE(0x74040000, 0x7407ffff) AM_READWRITE(hornet_k037122_char_r, hornet_k037122_char_w) |
| r14899 | r14900 | |
| 699 | 703 | |
| 700 | 704 | READ32_MEMBER(hornet_state::dsp_dataram0_r) |
| 701 | 705 | { |
| 702 | | return m_sharc_dataram[0][offset] & 0xffff; |
| 706 | return m_sharc_dataram0[offset] & 0xffff; |
| 703 | 707 | } |
| 704 | 708 | |
| 705 | 709 | WRITE32_MEMBER(hornet_state::dsp_dataram0_w) |
| 706 | 710 | { |
| 707 | | m_sharc_dataram[0][offset] = data; |
| 711 | m_sharc_dataram0[offset] = data; |
| 708 | 712 | } |
| 709 | 713 | |
| 710 | 714 | READ32_MEMBER(hornet_state::dsp_dataram1_r) |
| 711 | 715 | { |
| 712 | | return m_sharc_dataram[1][offset] & 0xffff; |
| 716 | return m_sharc_dataram1[offset] & 0xffff; |
| 713 | 717 | } |
| 714 | 718 | |
| 715 | 719 | WRITE32_MEMBER(hornet_state::dsp_dataram1_w) |
| 716 | 720 | { |
| 717 | | m_sharc_dataram[1][offset] = data; |
| 721 | m_sharc_dataram1[offset] = data; |
| 718 | 722 | } |
| 719 | 723 | |
| 720 | 724 | static ADDRESS_MAP_START( sharc0_map, AS_DATA, 32, hornet_state ) |
| 721 | 725 | AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE_LEGACY(cgboard_0_shared_sharc_r, cgboard_0_shared_sharc_w) |
| 722 | | AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w) AM_BASE(m_sharc_dataram[0]) |
| 726 | AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram0_r, dsp_dataram0_w) AM_SHARE("sharc_dataram0") |
| 723 | 727 | AM_RANGE(0x1400000, 0x14fffff) AM_RAM |
| 724 | 728 | AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE_LEGACY("voodoo0", voodoo_r, voodoo_w) |
| 725 | 729 | AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE_LEGACY(cgboard_0_comm_sharc_r, cgboard_0_comm_sharc_w) |
| r14899 | r14900 | |
| 729 | 733 | |
| 730 | 734 | static ADDRESS_MAP_START( sharc1_map, AS_DATA, 32, hornet_state ) |
| 731 | 735 | AM_RANGE(0x0400000, 0x041ffff) AM_READWRITE_LEGACY(cgboard_1_shared_sharc_r, cgboard_1_shared_sharc_w) |
| 732 | | AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w) AM_BASE(m_sharc_dataram[1]) |
| 736 | AM_RANGE(0x0500000, 0x05fffff) AM_READWRITE(dsp_dataram1_r, dsp_dataram1_w) AM_SHARE("sharc_dataram1") |
| 733 | 737 | AM_RANGE(0x1400000, 0x14fffff) AM_RAM |
| 734 | 738 | AM_RANGE(0x2400000, 0x27fffff) AM_DEVREADWRITE_LEGACY("voodoo1", voodoo_r, voodoo_w) |
| 735 | 739 | AM_RANGE(0x3400000, 0x34000ff) AM_READWRITE_LEGACY(cgboard_1_comm_sharc_r, cgboard_1_comm_sharc_w) |
src/mame/drivers/mwarr.c
| r14899 | r14900 | |
| 103 | 103 | WRITE16_MEMBER(mwarr_state::bg_videoram_w) |
| 104 | 104 | { |
| 105 | 105 | |
| 106 | | COMBINE_DATA(&m_bg_videoram.target()[offset]); |
| 106 | COMBINE_DATA(&m_bg_videoram[offset]); |
| 107 | 107 | m_bg_tilemap->mark_tile_dirty(offset); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE16_MEMBER(mwarr_state::mlow_videoram_w) |
| 111 | 111 | { |
| 112 | 112 | |
| 113 | | COMBINE_DATA(&m_mlow_videoram.target()[offset]); |
| 113 | COMBINE_DATA(&m_mlow_videoram[offset]); |
| 114 | 114 | m_mlow_tilemap->mark_tile_dirty(offset); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | WRITE16_MEMBER(mwarr_state::mhigh_videoram_w) |
| 118 | 118 | { |
| 119 | 119 | |
| 120 | | COMBINE_DATA(&m_mhigh_videoram.target()[offset]); |
| 120 | COMBINE_DATA(&m_mhigh_videoram[offset]); |
| 121 | 121 | m_mhigh_tilemap->mark_tile_dirty(offset); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | WRITE16_MEMBER(mwarr_state::tx_videoram_w) |
| 125 | 125 | { |
| 126 | 126 | |
| 127 | | COMBINE_DATA(&m_tx_videoram.target()[offset]); |
| 127 | COMBINE_DATA(&m_tx_videoram[offset]); |
| 128 | 128 | m_tx_tilemap->mark_tile_dirty(offset); |
| 129 | 129 | } |
| 130 | 130 | |
| r14899 | r14900 | |
| 157 | 157 | /* refresh sprites on screen */ |
| 158 | 158 | for (i = 0; i < 0x800; i++) |
| 159 | 159 | { |
| 160 | | m_sprites_buffer[i] = m_spriteram.target()[i]; |
| 160 | m_sprites_buffer[i] = m_spriteram[i]; |
| 161 | 161 | } |
| 162 | 162 | break; |
| 163 | 163 | |
| r14899 | r14900 | |
| 175 | 175 | int i; |
| 176 | 176 | double brightness; |
| 177 | 177 | |
| 178 | | COMBINE_DATA(&m_mwarr_ram.target()[0x14 / 2]); |
| 178 | COMBINE_DATA(&m_mwarr_ram[0x14 / 2]); |
| 179 | 179 | |
| 180 | 180 | brightness = (double)(data & 0xff); |
| 181 | 181 | for (i = 0; i < 0x800; i++) |
| r14899 | r14900 | |
| 352 | 352 | static TILE_GET_INFO( get_bg_tile_info ) |
| 353 | 353 | { |
| 354 | 354 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 355 | | int tileno = state->m_bg_videoram.target()[tile_index] & 0x1fff; |
| 356 | | int colour = (state->m_bg_videoram.target()[tile_index] & 0xe000) >> 13; |
| 355 | int tileno = state->m_bg_videoram[tile_index] & 0x1fff; |
| 356 | int colour = (state->m_bg_videoram[tile_index] & 0xe000) >> 13; |
| 357 | 357 | |
| 358 | 358 | SET_TILE_INFO(4, tileno, colour, 0); |
| 359 | 359 | } |
| r14899 | r14900 | |
| 361 | 361 | static TILE_GET_INFO( get_mlow_tile_info ) |
| 362 | 362 | { |
| 363 | 363 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 364 | | int tileno = state->m_mlow_videoram.target()[tile_index] & 0x1fff; |
| 365 | | int colour = (state->m_mlow_videoram.target()[tile_index] & 0xe000) >> 13; |
| 364 | int tileno = state->m_mlow_videoram[tile_index] & 0x1fff; |
| 365 | int colour = (state->m_mlow_videoram[tile_index] & 0xe000) >> 13; |
| 366 | 366 | |
| 367 | 367 | SET_TILE_INFO(3, tileno, colour, 0); |
| 368 | 368 | } |
| r14899 | r14900 | |
| 370 | 370 | static TILE_GET_INFO( get_mhigh_tile_info ) |
| 371 | 371 | { |
| 372 | 372 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 373 | | int tileno = state->m_mhigh_videoram.target()[tile_index] & 0x1fff; |
| 374 | | int colour = (state->m_mhigh_videoram.target()[tile_index] & 0xe000) >> 13; |
| 373 | int tileno = state->m_mhigh_videoram[tile_index] & 0x1fff; |
| 374 | int colour = (state->m_mhigh_videoram[tile_index] & 0xe000) >> 13; |
| 375 | 375 | |
| 376 | 376 | SET_TILE_INFO(2, tileno, colour, 0); |
| 377 | 377 | } |
| r14899 | r14900 | |
| 379 | 379 | static TILE_GET_INFO( get_tx_tile_info ) |
| 380 | 380 | { |
| 381 | 381 | mwarr_state *state = machine.driver_data<mwarr_state>(); |
| 382 | | int tileno = state->m_tx_videoram.target()[tile_index] & 0x1fff; |
| 383 | | int colour = (state->m_tx_videoram.target()[tile_index] & 0xe000) >> 13; |
| 382 | int tileno = state->m_tx_videoram[tile_index] & 0x1fff; |
| 383 | int colour = (state->m_tx_videoram[tile_index] & 0xe000) >> 13; |
| 384 | 384 | |
| 385 | 385 | SET_TILE_INFO(1, tileno, colour, 0); |
| 386 | 386 | } |
| r14899 | r14900 | |
| 483 | 483 | |
| 484 | 484 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 485 | 485 | |
| 486 | | if (BIT(state->m_vidattrram.target()[6], 0)) |
| 486 | if (BIT(state->m_vidattrram[6], 0)) |
| 487 | 487 | { |
| 488 | 488 | for (i = 0; i < 256; i++) |
| 489 | | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[i] + 20); |
| 489 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[i] + 20); |
| 490 | 490 | } |
| 491 | 491 | else |
| 492 | 492 | { |
| 493 | 493 | for (i = 0; i < 256; i++) |
| 494 | | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram.target()[0] + 19); |
| 494 | state->m_bg_tilemap->set_scrollx(i, state->m_bg_scrollram[0] + 19); |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | | if (BIT(state->m_vidattrram.target()[6], 2)) |
| 497 | if (BIT(state->m_vidattrram[6], 2)) |
| 498 | 498 | { |
| 499 | 499 | for (i = 0; i < 256; i++) |
| 500 | | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[i] + 19); |
| 500 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[i] + 19); |
| 501 | 501 | } |
| 502 | 502 | else |
| 503 | 503 | { |
| 504 | 504 | for (i = 0; i < 256; i++) |
| 505 | | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram.target()[0] + 19); |
| 505 | state->m_mlow_tilemap->set_scrollx(i, state->m_mlow_scrollram[0] + 19); |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | | if (BIT(state->m_vidattrram.target()[6], 4)) |
| 508 | if (BIT(state->m_vidattrram[6], 4)) |
| 509 | 509 | { |
| 510 | 510 | for (i = 0; i < 256; i++) |
| 511 | | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[i] + 19); |
| 511 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[i] + 19); |
| 512 | 512 | } |
| 513 | 513 | else |
| 514 | 514 | { |
| 515 | 515 | for (i = 0; i < 256; i++) |
| 516 | | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram.target()[0] + 19); |
| 516 | state->m_mhigh_tilemap->set_scrollx(i, state->m_mhigh_scrollram[0] + 19); |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | | state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram.target()[1] + 1); |
| 520 | | state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram.target()[2] + 1); |
| 521 | | state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram.target()[3] + 1); |
| 519 | state->m_bg_tilemap->set_scrolly(0, state->m_vidattrram[1] + 1); |
| 520 | state->m_mlow_tilemap->set_scrolly(0, state->m_vidattrram[2] + 1); |
| 521 | state->m_mhigh_tilemap->set_scrolly(0, state->m_vidattrram[3] + 1); |
| 522 | 522 | |
| 523 | | state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram.target()[0] + 16); |
| 524 | | state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram.target()[4] + 1); |
| 523 | state->m_tx_tilemap->set_scrollx(0, state->m_vidattrram[0] + 16); |
| 524 | state->m_tx_tilemap->set_scrolly(0, state->m_vidattrram[4] + 1); |
| 525 | 525 | |
| 526 | 526 | state->m_bg_tilemap->draw(bitmap, cliprect, 0, 0x01); |
| 527 | 527 | state->m_mlow_tilemap->draw(bitmap, cliprect, 0, 0x02); |
src/mame/drivers/bestleag.c
| r14899 | r14900 | |
| 54 | 54 | static TILE_GET_INFO( get_tx_tile_info ) |
| 55 | 55 | { |
| 56 | 56 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 57 | | int code = state->m_txram.target()[tile_index]; |
| 57 | int code = state->m_txram[tile_index]; |
| 58 | 58 | |
| 59 | 59 | SET_TILE_INFO( |
| 60 | 60 | 0, |
| r14899 | r14900 | |
| 66 | 66 | static TILE_GET_INFO( get_bg_tile_info ) |
| 67 | 67 | { |
| 68 | 68 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 69 | | int code = state->m_bgram.target()[tile_index]; |
| 69 | int code = state->m_bgram[tile_index]; |
| 70 | 70 | |
| 71 | 71 | SET_TILE_INFO( |
| 72 | 72 | 1, |
| r14899 | r14900 | |
| 78 | 78 | static TILE_GET_INFO( get_fg_tile_info ) |
| 79 | 79 | { |
| 80 | 80 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 81 | | int code = state->m_fgram.target()[tile_index]; |
| 81 | int code = state->m_fgram[tile_index]; |
| 82 | 82 | |
| 83 | 83 | SET_TILE_INFO( |
| 84 | 84 | 1, |
| r14899 | r14900 | |
| 117 | 117 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 118 | 118 | { |
| 119 | 119 | bestleag_state *state = machine.driver_data<bestleag_state>(); |
| 120 | | UINT16 *spriteram16 = state->m_spriteram.target(); |
| 120 | UINT16 *spriteram16 = state->m_spriteram; |
| 121 | 121 | |
| 122 | 122 | /* |
| 123 | 123 | |
| r14899 | r14900 | |
| 140 | 140 | return; |
| 141 | 141 | |
| 142 | 142 | /* it can change sprites color mask like the original set */ |
| 143 | | if(state->m_vregs.target()[0x00/2] & 0x1000) |
| 143 | if(state->m_vregs[0x00/2] & 0x1000) |
| 144 | 144 | color &= 7; |
| 145 | 145 | |
| 146 | 146 | drawgfx_transpen(bitmap,cliprect,machine.gfx[2], |
| r14899 | r14900 | |
| 173 | 173 | static SCREEN_UPDATE_IND16(bestleag) |
| 174 | 174 | { |
| 175 | 175 | bestleag_state *state = screen.machine().driver_data<bestleag_state>(); |
| 176 | | state->m_bg_tilemap->set_scrollx(0,(state->m_vregs.target()[0x00/2] & 0xfff) + (state->m_vregs.target()[0x08/2] & 0x7) - 3); |
| 177 | | state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]); |
| 178 | | state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]); |
| 179 | | state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]); |
| 180 | | state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2] & 0xfff8); |
| 181 | | state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]); |
| 176 | state->m_bg_tilemap->set_scrollx(0,(state->m_vregs[0x00/2] & 0xfff) + (state->m_vregs[0x08/2] & 0x7) - 3); |
| 177 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x02/2]); |
| 178 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x04/2]); |
| 179 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x06/2]); |
| 180 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x08/2] & 0xfff8); |
| 181 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]); |
| 182 | 182 | |
| 183 | 183 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 184 | 184 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| r14899 | r14900 | |
| 190 | 190 | static SCREEN_UPDATE_IND16(bestleaw) |
| 191 | 191 | { |
| 192 | 192 | bestleag_state *state = screen.machine().driver_data<bestleag_state>(); |
| 193 | | state->m_bg_tilemap->set_scrollx(0,state->m_vregs.target()[0x08/2]); |
| 194 | | state->m_bg_tilemap->set_scrolly(0,state->m_vregs.target()[0x0a/2]); |
| 195 | | state->m_tx_tilemap->set_scrollx(0,state->m_vregs.target()[0x00/2]); |
| 196 | | state->m_tx_tilemap->set_scrolly(0,state->m_vregs.target()[0x02/2]); |
| 197 | | state->m_fg_tilemap->set_scrollx(0,state->m_vregs.target()[0x04/2]); |
| 198 | | state->m_fg_tilemap->set_scrolly(0,state->m_vregs.target()[0x06/2]); |
| 193 | state->m_bg_tilemap->set_scrollx(0,state->m_vregs[0x08/2]); |
| 194 | state->m_bg_tilemap->set_scrolly(0,state->m_vregs[0x0a/2]); |
| 195 | state->m_tx_tilemap->set_scrollx(0,state->m_vregs[0x00/2]); |
| 196 | state->m_tx_tilemap->set_scrolly(0,state->m_vregs[0x02/2]); |
| 197 | state->m_fg_tilemap->set_scrollx(0,state->m_vregs[0x04/2]); |
| 198 | state->m_fg_tilemap->set_scrolly(0,state->m_vregs[0x06/2]); |
| 199 | 199 | |
| 200 | 200 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 201 | 201 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,0); |
| r14899 | r14900 | |
| 206 | 206 | |
| 207 | 207 | WRITE16_MEMBER(bestleag_state::bestleag_txram_w) |
| 208 | 208 | { |
| 209 | | m_txram.target()[offset] = data; |
| 209 | m_txram[offset] = data; |
| 210 | 210 | m_tx_tilemap->mark_tile_dirty(offset); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | WRITE16_MEMBER(bestleag_state::bestleag_bgram_w) |
| 214 | 214 | { |
| 215 | | m_bgram.target()[offset] = data; |
| 215 | m_bgram[offset] = data; |
| 216 | 216 | m_bg_tilemap->mark_tile_dirty(offset); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | WRITE16_MEMBER(bestleag_state::bestleag_fgram_w) |
| 220 | 220 | { |
| 221 | | m_fgram.target()[offset] = data; |
| 221 | m_fgram[offset] = data; |
| 222 | 222 | m_fg_tilemap->mark_tile_dirty(offset); |
| 223 | 223 | } |
| 224 | 224 | |
src/mame/drivers/cybertnk.c
| r14899 | r14900 | |
| 201 | 201 | static TILE_GET_INFO( get_tx_tile_info ) |
| 202 | 202 | { |
| 203 | 203 | cybertnk_state *state = machine.driver_data<cybertnk_state>(); |
| 204 | | int code = state->m_tx_vram.target()[tile_index]; |
| 204 | int code = state->m_tx_vram[tile_index]; |
| 205 | 205 | SET_TILE_INFO( |
| 206 | 206 | 0, |
| 207 | 207 | code & 0x1fff, |
| r14899 | r14900 | |
| 238 | 238 | |
| 239 | 239 | for (i=0;i<0x1000/4;i+=4) |
| 240 | 240 | { |
| 241 | | UINT16 param1 = state->m_roadram.target()[i+2]; |
| 242 | | UINT16 param2 = state->m_roadram.target()[i+0]; |
| 241 | UINT16 param1 = state->m_roadram[i+2]; |
| 242 | UINT16 param2 = state->m_roadram[i+0]; |
| 243 | 243 | |
| 244 | 244 | drawgfx_transpen(bitmap,cliprect,gfx,param1,0x23,0,0,-param2+screen_shift,i/4,0); |
| 245 | 245 | |
| r14899 | r14900 | |
| 259 | 259 | { |
| 260 | 260 | for (x=0;x<128;x++) |
| 261 | 261 | { |
| 262 | | UINT16 tile = state->m_bg_vram.target()[count] & 0x1fff; |
| 263 | | UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13; |
| 262 | UINT16 tile = state->m_bg_vram[count] & 0x1fff; |
| 263 | UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13; |
| 264 | 264 | |
| 265 | 265 | drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x194,0,0,(x*8)+screen_shift,(y*8),0); |
| 266 | 266 | |
| r14899 | r14900 | |
| 280 | 280 | { |
| 281 | 281 | for (x=0;x<128;x++) |
| 282 | 282 | { |
| 283 | | UINT16 tile = state->m_fg_vram.target()[count] & 0x1fff; |
| 284 | | UINT16 color = (state->m_fg_vram.target()[count] & 0xe000) >> 13; |
| 283 | UINT16 tile = state->m_fg_vram[count] & 0x1fff; |
| 284 | UINT16 color = (state->m_fg_vram[count] & 0xe000) >> 13; |
| 285 | 285 | |
| 286 | 286 | drawgfx_transpen(bitmap,cliprect,gfx,tile,color+0x1c0,0,0,(x*8)+screen_shift,(y*8),0); |
| 287 | 287 | |
| r14899 | r14900 | |
| 301 | 301 | |
| 302 | 302 | for(offs=0;offs<0x1000/2;offs+=8) |
| 303 | 303 | { |
| 304 | | z = (state->m_spr_ram.target()[offs+(0x6/2)] & 0xffff); |
| 305 | | if(z == 0xffff || state->m_spr_ram.target()[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit |
| 304 | z = (state->m_spr_ram[offs+(0x6/2)] & 0xffff); |
| 305 | if(z == 0xffff || state->m_spr_ram[offs+(0x0/2)] == 0x0000) //TODO: check the correct bit |
| 306 | 306 | continue; |
| 307 | | x = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x3ff); |
| 308 | | y = (state->m_spr_ram.target()[offs+(0x4/2)] & 0xff); |
| 309 | | if(state->m_spr_ram.target()[offs+(0x4/2)] & 0x100) |
| 307 | x = (state->m_spr_ram[offs+(0xa/2)] & 0x3ff); |
| 308 | y = (state->m_spr_ram[offs+(0x4/2)] & 0xff); |
| 309 | if(state->m_spr_ram[offs+(0x4/2)] & 0x100) |
| 310 | 310 | y = 0x100 - y; |
| 311 | | spr_offs = (((state->m_spr_ram.target()[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram.target()[offs+(0x2/2)])) << 2; |
| 312 | | xsize = ((state->m_spr_ram.target()[offs+(0xc/2)] & 0x000f)+1) << 3; |
| 313 | | ysize = (state->m_spr_ram.target()[offs+(0x8/2)] & 0x00ff)+1; |
| 314 | | fx = (state->m_spr_ram.target()[offs+(0xa/2)] & 0x8000) >> 15; |
| 315 | | zoom = (state->m_spr_ram.target()[offs+(0xc/2)] & 0xff00) >> 8; |
| 311 | spr_offs = (((state->m_spr_ram[offs+(0x0/2)] & 7) << 16) | (state->m_spr_ram[offs+(0x2/2)])) << 2; |
| 312 | xsize = ((state->m_spr_ram[offs+(0xc/2)] & 0x000f)+1) << 3; |
| 313 | ysize = (state->m_spr_ram[offs+(0x8/2)] & 0x00ff)+1; |
| 314 | fx = (state->m_spr_ram[offs+(0xa/2)] & 0x8000) >> 15; |
| 315 | zoom = (state->m_spr_ram[offs+(0xc/2)] & 0xff00) >> 8; |
| 316 | 316 | |
| 317 | | col_bank = (state->m_spr_ram.target()[offs+(0x0/2)] & 0xff00) >> 8; |
| 317 | col_bank = (state->m_spr_ram[offs+(0x0/2)] & 0xff00) >> 8; |
| 318 | 318 | |
| 319 | 319 | xf = 0; |
| 320 | 320 | yf = 0; |
| r14899 | r14900 | |
| 522 | 522 | |
| 523 | 523 | WRITE16_MEMBER(cybertnk_state::tx_vram_w) |
| 524 | 524 | { |
| 525 | | COMBINE_DATA(&m_tx_vram.target()[offset]); |
| 525 | COMBINE_DATA(&m_tx_vram[offset]); |
| 526 | 526 | m_tx_tilemap->mark_tile_dirty(offset); |
| 527 | 527 | } |
| 528 | 528 | |
| r14899 | r14900 | |
| 537 | 537 | // 0x001100D5 is controller data |
| 538 | 538 | // 0x00110004 low is controller data ready |
| 539 | 539 | case 4/2: |
| 540 | | switch( (m_io_ram.target()[6/2]) & 0xff ) |
| 540 | switch( (m_io_ram[6/2]) & 0xff ) |
| 541 | 541 | { |
| 542 | 542 | case 0: |
| 543 | | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "TRAVERSE"); |
| 543 | m_io_ram[0xd4/2] = input_port_read(machine(), "TRAVERSE"); |
| 544 | 544 | break; |
| 545 | 545 | |
| 546 | 546 | case 0x20: |
| 547 | | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ELEVATE"); |
| 547 | m_io_ram[0xd4/2] = input_port_read(machine(), "ELEVATE"); |
| 548 | 548 | break; |
| 549 | 549 | |
| 550 | 550 | case 0x40: |
| 551 | | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "ACCEL"); |
| 551 | m_io_ram[0xd4/2] = input_port_read(machine(), "ACCEL"); |
| 552 | 552 | break; |
| 553 | 553 | |
| 554 | 554 | case 0x42: |
| r14899 | r14900 | |
| 556 | 556 | // controller return value is stored in $42(a6) |
| 557 | 557 | // but I don't see it referenced again. |
| 558 | 558 | //popmessage("unknown controller device 0x42"); |
| 559 | | m_io_ram.target()[0xd4/2] = 0; |
| 559 | m_io_ram[0xd4/2] = 0; |
| 560 | 560 | break; |
| 561 | 561 | |
| 562 | 562 | case 0x60: |
| 563 | | m_io_ram.target()[0xd4/2] = input_port_read(machine(), "HANDLE"); |
| 563 | m_io_ram[0xd4/2] = input_port_read(machine(), "HANDLE"); |
| 564 | 564 | break; |
| 565 | 565 | |
| 566 | 566 | //default: |
| r14899 | r14900 | |
| 578 | 578 | return input_port_read(machine(), "DSW2"); |
| 579 | 579 | |
| 580 | 580 | case 0xd4/2: |
| 581 | | return m_io_ram.target()[offset]; // controller data |
| 581 | return m_io_ram[offset]; // controller data |
| 582 | 582 | |
| 583 | 583 | default: |
| 584 | 584 | { |
| 585 | 585 | //popmessage("unknown io read 0x%08x", offset); |
| 586 | | return m_io_ram.target()[offset]; |
| 586 | return m_io_ram[offset]; |
| 587 | 587 | } |
| 588 | 588 | } |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | WRITE16_MEMBER(cybertnk_state::io_w) |
| 592 | 592 | { |
| 593 | | COMBINE_DATA(&m_io_ram.target()[offset]); |
| 593 | COMBINE_DATA(&m_io_ram[offset]); |
| 594 | 594 | |
| 595 | 595 | switch( offset ) |
| 596 | 596 | { |
| r14899 | r14900 | |
| 651 | 651 | case 0x80/2: |
| 652 | 652 | case 0x82/2: |
| 653 | 653 | case 0x84/2: |
| 654 | | popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram.target()[0x40/2],m_io_ram.target()[0x42/2],m_io_ram.target()[0x44/2],m_io_ram.target()[0x46/2],m_io_ram.target()[0x48/2],m_io_ram.target()[0x4a/2],m_io_ram.target()[0x4c/2]); |
| 654 | popmessage("%02x %02x %02x %02x %02x %02x %02x",m_io_ram[0x40/2],m_io_ram[0x42/2],m_io_ram[0x44/2],m_io_ram[0x46/2],m_io_ram[0x48/2],m_io_ram[0x4a/2],m_io_ram[0x4c/2]); |
| 655 | 655 | break; |
| 656 | 656 | |
| 657 | 657 | default: |
| r14899 | r14900 | |
| 662 | 662 | |
| 663 | 663 | READ8_MEMBER(cybertnk_state::soundport_r) |
| 664 | 664 | { |
| 665 | | return m_io_ram.target()[0] & 0xff; |
| 665 | return m_io_ram[0] & 0xff; |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | 668 | static ADDRESS_MAP_START( master_mem, AS_PROGRAM, 16, cybertnk_state ) |
src/mame/drivers/pinkiri8.c
| r14899 | r14900 | |
| 40 | 40 | public: |
| 41 | 41 | pinkiri8_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | 42 | : driver_device(mconfig, type, tag) , |
| 43 | | m_janshi_back_vram(*this, "janshi_back_vram"), |
| 44 | | m_janshi_vram1(*this, "janshi_vram1"), |
| 45 | | m_janshi_unk1(*this, "janshi_unk1"), |
| 46 | | m_janshi_widthflags(*this, "janshi_widthflags"), |
| 47 | | m_janshi_unk2(*this, "janshi_unk2"), |
| 48 | | m_janshi_vram2(*this, "janshi_vram2"), |
| 49 | | m_janshi_crtc_regs(*this, "janshi_crtc_regs"){ } |
| 43 | m_janshi_back_vram(*this, "back_vram"), |
| 44 | m_janshi_vram1(*this, "vram1"), |
| 45 | m_janshi_unk1(*this, "unk1"), |
| 46 | m_janshi_widthflags(*this, "widthflags"), |
| 47 | m_janshi_unk2(*this, "unk2"), |
| 48 | m_janshi_vram2(*this, "vram2"), |
| 49 | m_janshi_crtc_regs(*this, "crtc_regs"){ } |
| 50 | 50 | |
| 51 | 51 | required_shared_ptr<UINT8> m_janshi_back_vram; |
| 52 | 52 | required_shared_ptr<UINT8> m_janshi_vram1; |
| r14899 | r14900 | |
| 75 | 75 | |
| 76 | 76 | static ADDRESS_MAP_START( janshi_vdp_map8, AS_0, 8, pinkiri8_state ) |
| 77 | 77 | |
| 78 | | AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("janshi_back_vram") // bg tilemap? |
| 79 | | AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("janshi_vram1") // xpos, colour, tile number etc. |
| 78 | AM_RANGE(0xfc0000, 0xfc1fff) AM_RAM AM_SHARE("back_vram") // bg tilemap? |
| 79 | AM_RANGE(0xfc2000, 0xfc2fff) AM_RAM AM_SHARE("vram1") // xpos, colour, tile number etc. |
| 80 | 80 | |
| 81 | | AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_SHARE("janshi_unk1") // ?? height related? |
| 82 | | AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_SHARE("janshi_widthflags") |
| 83 | | AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_SHARE("janshi_unk2") // 2x increasing tables 00 10 20 30 etc. |
| 81 | AM_RANGE(0xfc3700, 0xfc377f) AM_RAM AM_SHARE("unk1") // ?? height related? |
| 82 | AM_RANGE(0xfc3780, 0xfc37bf) AM_RAM AM_SHARE("widthflags") |
| 83 | AM_RANGE(0xfc37c0, 0xfc37ff) AM_RAM AM_SHARE("unk2") // 2x increasing tables 00 10 20 30 etc. |
| 84 | 84 | |
| 85 | | AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_SHARE("janshi_vram2") // y pos + unknown |
| 85 | AM_RANGE(0xfc3800, 0xfc3fff) AM_RAM AM_SHARE("vram2") // y pos + unknown |
| 86 | 86 | |
| 87 | 87 | AM_RANGE(0xff0000, 0xff07ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 88 | 88 | AM_RANGE(0xff2000, 0xff27ff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 89 | 89 | |
| 90 | | AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_SHARE("janshi_crtc_regs") |
| 90 | AM_RANGE(0xff6000, 0xff601f) AM_RAM AM_SHARE("crtc_regs") |
| 91 | 91 | ADDRESS_MAP_END |
| 92 | 92 | |
| 93 | 93 | |
| r14899 | r14900 | |
| 205 | 205 | for (i=0x00;i<0x40;i+=2) |
| 206 | 206 | { |
| 207 | 207 | |
| 208 | | printf("%02x, ", state->m_janshi_widthflags.target()[i+1]); |
| 208 | printf("%02x, ", state->m_janshi_widthflags[i+1]); |
| 209 | 209 | |
| 210 | 210 | count2++; |
| 211 | 211 | |
| r14899 | r14900 | |
| 223 | 223 | |
| 224 | 224 | |
| 225 | 225 | |
| 226 | | //popmessage("%02x",state->m_janshi_crtc_regs.target()[0x0a]); |
| 227 | | col_bank = (state->m_janshi_crtc_regs.target()[0x0a] & 0x40) >> 6; |
| 226 | //popmessage("%02x",state->m_janshi_crtc_regs[0x0a]); |
| 227 | col_bank = (state->m_janshi_crtc_regs[0x0a] & 0x40) >> 6; |
| 228 | 228 | |
| 229 | 229 | bitmap.fill(get_black_pen(screen.machine()), cliprect); |
| 230 | 230 | |
| r14899 | r14900 | |
| 238 | 238 | { |
| 239 | 239 | for(x=0;x<32;x++) |
| 240 | 240 | { |
| 241 | | tile = state->m_janshi_back_vram.target()[count+1]<<8 | state->m_janshi_back_vram.target()[count+0]; |
| 242 | | attr = state->m_janshi_back_vram.target()[count+2] ^ 0xf0; |
| 241 | tile = state->m_janshi_back_vram[count+1]<<8 | state->m_janshi_back_vram[count+0]; |
| 242 | attr = state->m_janshi_back_vram[count+2] ^ 0xf0; |
| 243 | 243 | col = (attr >> 4) | 0x10; |
| 244 | 244 | |
| 245 | 245 | drawgfx_transpen(bitmap,cliprect,gfx,tile,col,0,0,x*16,y*8,0); |
| r14899 | r14900 | |
| 275 | 275 | |
| 276 | 276 | */ |
| 277 | 277 | |
| 278 | | spr_offs = ((state->m_janshi_vram1.target()[(i*4)+0] & 0xff) | (state->m_janshi_vram1.target()[(i*4)+1]<<8)) & 0xffff; |
| 279 | | col = (state->m_janshi_vram1.target()[(i*4)+2] & 0xf8) >> 3; |
| 280 | | x = state->m_janshi_vram1.target()[(i*4)+3]; |
| 278 | spr_offs = ((state->m_janshi_vram1[(i*4)+0] & 0xff) | (state->m_janshi_vram1[(i*4)+1]<<8)) & 0xffff; |
| 279 | col = (state->m_janshi_vram1[(i*4)+2] & 0xf8) >> 3; |
| 280 | x = state->m_janshi_vram1[(i*4)+3]; |
| 281 | 281 | |
| 282 | 282 | x &= 0xff; |
| 283 | 283 | x *= 2; |
| 284 | 284 | |
| 285 | | // unk2 = state->m_janshi_vram2.target()[(i*2)+1]; |
| 286 | | y = (state->m_janshi_vram2.target()[(i*2)+0]); |
| 285 | // unk2 = state->m_janshi_vram2[(i*2)+1]; |
| 286 | y = (state->m_janshi_vram2[(i*2)+0]); |
| 287 | 287 | |
| 288 | 288 | y = 0x100-y; |
| 289 | 289 | |
| r14899 | r14900 | |
| 296 | 296 | |
| 297 | 297 | |
| 298 | 298 | // these bits seem to somehow determine the sprite height / widths for the sprite ram region? |
| 299 | | int bit = state->m_janshi_widthflags.target()[(i/0x20)*2 + 1]; |
| 299 | int bit = state->m_janshi_widthflags[(i/0x20)*2 + 1]; |
| 300 | 300 | |
| 301 | 301 | if (bit) |
| 302 | 302 | { |
src/mame/drivers/chanbara.c
| r14899 | r14900 | |
| 103 | 103 | WRITE8_MEMBER(chanbara_state::chanbara_videoram_w) |
| 104 | 104 | { |
| 105 | 105 | |
| 106 | | m_videoram.target()[offset] = data; |
| 106 | m_videoram[offset] = data; |
| 107 | 107 | m_bg_tilemap->mark_tile_dirty(offset); |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | WRITE8_MEMBER(chanbara_state::chanbara_colorram_w) |
| 111 | 111 | { |
| 112 | 112 | |
| 113 | | m_colorram.target()[offset] = data; |
| 113 | m_colorram[offset] = data; |
| 114 | 114 | m_bg_tilemap->mark_tile_dirty(offset); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | WRITE8_MEMBER(chanbara_state::chanbara_videoram2_w) |
| 118 | 118 | { |
| 119 | 119 | |
| 120 | | m_videoram2.target()[offset] = data; |
| 120 | m_videoram2[offset] = data; |
| 121 | 121 | m_bg2_tilemap->mark_tile_dirty(offset); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | WRITE8_MEMBER(chanbara_state::chanbara_colorram2_w) |
| 125 | 125 | { |
| 126 | 126 | |
| 127 | | m_colorram2.target()[offset] = data; |
| 127 | m_colorram2[offset] = data; |
| 128 | 128 | m_bg2_tilemap->mark_tile_dirty(offset); |
| 129 | 129 | } |
| 130 | 130 | |
| r14899 | r14900 | |
| 132 | 132 | static TILE_GET_INFO( get_bg_tile_info ) |
| 133 | 133 | { |
| 134 | 134 | chanbara_state *state = machine.driver_data<chanbara_state>(); |
| 135 | | int code = state->m_videoram.target()[tile_index] + ((state->m_colorram.target()[tile_index] & 1) << 8); |
| 136 | | int color = (state->m_colorram.target()[tile_index] >> 1) & 0x1f; |
| 135 | int code = state->m_videoram[tile_index] + ((state->m_colorram[tile_index] & 1) << 8); |
| 136 | int color = (state->m_colorram[tile_index] >> 1) & 0x1f; |
| 137 | 137 | |
| 138 | 138 | SET_TILE_INFO(0, code, color, 0); |
| 139 | 139 | } |
| r14899 | r14900 | |
| 141 | 141 | static TILE_GET_INFO( get_bg2_tile_info ) |
| 142 | 142 | { |
| 143 | 143 | chanbara_state *state = machine.driver_data<chanbara_state>(); |
| 144 | | int code = state->m_videoram2.target()[tile_index]; |
| 145 | | int color = (state->m_colorram2.target()[tile_index] >> 1) & 0x1f; |
| 144 | int code = state->m_videoram2[tile_index]; |
| 145 | int color = (state->m_colorram2[tile_index] >> 1) & 0x1f; |
| 146 | 146 | |
| 147 | 147 | SET_TILE_INFO(2, code, color, 0); |
| 148 | 148 | } |
| r14899 | r14900 | |
| 162 | 162 | |
| 163 | 163 | for (offs = 0; offs < 0x80; offs += 4) |
| 164 | 164 | { |
| 165 | | if (state->m_spriteram.target()[offs + 0x80] & 0x80) |
| 165 | if (state->m_spriteram[offs + 0x80] & 0x80) |
| 166 | 166 | { |
| 167 | | int attr = state->m_spriteram.target()[offs + 0]; |
| 168 | | int code = state->m_spriteram.target()[offs + 1]; |
| 169 | | int color = state->m_spriteram.target()[offs + 0x80] & 0x1f; |
| 167 | int attr = state->m_spriteram[offs + 0]; |
| 168 | int code = state->m_spriteram[offs + 1]; |
| 169 | int color = state->m_spriteram[offs + 0x80] & 0x1f; |
| 170 | 170 | int flipx = 0; |
| 171 | 171 | int flipy = attr & 2; |
| 172 | | int sx = 240 - state->m_spriteram.target()[offs + 3]; |
| 173 | | int sy = 232 - state->m_spriteram.target()[offs + 2]; |
| 172 | int sx = 240 - state->m_spriteram[offs + 3]; |
| 173 | int sy = 232 - state->m_spriteram[offs + 2]; |
| 174 | 174 | |
| 175 | 175 | sy+=16; |
| 176 | 176 | |
| 177 | | if (state->m_spriteram.target()[offs + 0x80] & 0x10) code += 0x200; |
| 178 | | if (state->m_spriteram.target()[offs + 0x80] & 0x20) code += 0x400; |
| 179 | | if (state->m_spriteram.target()[offs + 0x80] & 0x40) code += 0x100; |
| 177 | if (state->m_spriteram[offs + 0x80] & 0x10) code += 0x200; |
| 178 | if (state->m_spriteram[offs + 0x80] & 0x20) code += 0x400; |
| 179 | if (state->m_spriteram[offs + 0x80] & 0x40) code += 0x100; |
| 180 | 180 | |
| 181 | 181 | if (attr & 0x10) |
| 182 | 182 | { |
src/mame/drivers/gstream.c
| r14899 | r14900 | |
| 211 | 211 | |
| 212 | 212 | WRITE32_MEMBER(gstream_state::gstream_palette_w) |
| 213 | 213 | { |
| 214 | | COMBINE_DATA(&m_paletteram.target()[offset]); |
| 214 | COMBINE_DATA(&m_paletteram[offset]); |
| 215 | 215 | |
| 216 | | palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram.target()[offset] >> (0 + 16)), |
| 217 | | pal5bit(m_paletteram.target()[offset] >> (6 + 16)), |
| 218 | | pal5bit(m_paletteram.target()[offset] >> (11 + 16))); |
| 216 | palette_set_color_rgb(machine(), offset * 2, pal5bit(m_paletteram[offset] >> (0 + 16)), |
| 217 | pal5bit(m_paletteram[offset] >> (6 + 16)), |
| 218 | pal5bit(m_paletteram[offset] >> (11 + 16))); |
| 219 | 219 | |
| 220 | 220 | |
| 221 | | palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram.target()[offset] >> (0)), |
| 222 | | pal5bit(m_paletteram.target()[offset] >> (6)), |
| 223 | | pal5bit(m_paletteram.target()[offset] >> (11))); |
| 221 | palette_set_color_rgb(machine(),offset * 2 + 1,pal5bit(m_paletteram[offset] >> (0)), |
| 222 | pal5bit(m_paletteram[offset] >> (6)), |
| 223 | pal5bit(m_paletteram[offset] >> (11))); |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | WRITE32_MEMBER(gstream_state::gstream_vram_w) |
| 227 | 227 | { |
| 228 | | COMBINE_DATA(&m_vram.target()[offset]); |
| 228 | COMBINE_DATA(&m_vram[offset]); |
| 229 | 229 | |
| 230 | 230 | if (ACCESSING_BITS_24_31) |
| 231 | 231 | { |
| r14899 | r14900 | |
| 447 | 447 | static TILE_GET_INFO( get_gs1_tile_info ) |
| 448 | 448 | { |
| 449 | 449 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 450 | | int tileno = (state->m_vram.target()[tile_index + 0x000 / 4] & 0x0fff0000) >> 16; |
| 451 | | int palette = (state->m_vram.target()[tile_index + 0x000 / 4] & 0xc0000000) >> 30; |
| 450 | int tileno = (state->m_vram[tile_index + 0x000 / 4] & 0x0fff0000) >> 16; |
| 451 | int palette = (state->m_vram[tile_index + 0x000 / 4] & 0xc0000000) >> 30; |
| 452 | 452 | SET_TILE_INFO(0, tileno, palette + 0x10, 0); |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | static TILE_GET_INFO( get_gs2_tile_info ) |
| 456 | 456 | { |
| 457 | 457 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 458 | | int tileno = (state->m_vram.target()[tile_index + 0x400 / 4] & 0x0fff0000) >> 16; |
| 459 | | int palette = (state->m_vram.target()[tile_index + 0x400 / 4] & 0xc0000000) >> 30; |
| 458 | int tileno = (state->m_vram[tile_index + 0x400 / 4] & 0x0fff0000) >> 16; |
| 459 | int palette = (state->m_vram[tile_index + 0x400 / 4] & 0xc0000000) >> 30; |
| 460 | 460 | SET_TILE_INFO(0, tileno + 0x1000, palette + 0x14, 0); |
| 461 | 461 | } |
| 462 | 462 | |
| r14899 | r14900 | |
| 464 | 464 | static TILE_GET_INFO( get_gs3_tile_info ) |
| 465 | 465 | { |
| 466 | 466 | gstream_state *state = machine.driver_data<gstream_state>(); |
| 467 | | int tileno = (state->m_vram.target()[tile_index + 0x800 / 4] & 0x0fff0000) >> 16; |
| 468 | | int palette = (state->m_vram.target()[tile_index + 0x800 / 4] & 0xc0000000) >> 30; |
| 467 | int tileno = (state->m_vram[tile_index + 0x800 / 4] & 0x0fff0000) >> 16; |
| 468 | int palette = (state->m_vram[tile_index + 0x800 / 4] & 0xc0000000) >> 30; |
| 469 | 469 | SET_TILE_INFO(0, tileno + 0x2000, palette + 0x18, 0); |
| 470 | 470 | } |
| 471 | 471 | |
| r14899 | r14900 | |
| 518 | 518 | for (i = 0x0000 / 4; i < 0x4000 / 4; i += 4) |
| 519 | 519 | { |
| 520 | 520 | /* Upper bits are used by the tilemaps */ |
| 521 | | int code = state->m_vram.target()[i + 0] & 0xffff; |
| 522 | | int x = state->m_vram.target()[i + 1] & 0xffff; |
| 523 | | int y = state->m_vram.target()[i + 2] & 0xffff; |
| 524 | | int col = state->m_vram.target()[i + 3] & 0x1f; |
| 521 | int code = state->m_vram[i + 0] & 0xffff; |
| 522 | int x = state->m_vram[i + 1] & 0xffff; |
| 523 | int y = state->m_vram[i + 2] & 0xffff; |
| 524 | int col = state->m_vram[i + 3] & 0x1f; |
| 525 | 525 | |
| 526 | 526 | /* co-ordinates are signed */ |
| 527 | 527 | if (x & 0x8000) x -= 0x10000; |
| r14899 | r14900 | |
| 642 | 642 | m_maincpu->eat_cycles(50); |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | | return m_workram.target()[0xd1ee0 / 4]; |
| 645 | return m_workram[0xd1ee0 / 4]; |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | static DRIVER_INIT( gstream ) |
src/mame/drivers/dmndrby.c
| r14899 | r14900 | |
| 63 | 63 | : driver_device(mconfig, type, tag) , |
| 64 | 64 | m_scroll_ram(*this, "scroll_ram"), |
| 65 | 65 | m_sprite_ram(*this, "sprite_ram"), |
| 66 | | m_dderby_vidchars(*this, "dderby_vidchars"), |
| 67 | | m_dderby_vidattribs(*this, "dderby_vidattribs"){ } |
| 66 | m_dderby_vidchars(*this, "vidchars"), |
| 67 | m_dderby_vidattribs(*this, "vidattribs"){ } |
| 68 | 68 | |
| 69 | 69 | required_shared_ptr<UINT8> m_scroll_ram; |
| 70 | 70 | required_shared_ptr<UINT8> m_sprite_ram; |
| r14899 | r14900 | |
| 134 | 134 | AM_RANGE(0xca03, 0xca03) AM_WRITENOP//(timer_irq_w) //??? |
| 135 | 135 | AM_RANGE(0xcc00, 0xcc05) AM_RAM AM_SHARE("scroll_ram") |
| 136 | 136 | AM_RANGE(0xce08, 0xce1f) AM_RAM AM_SHARE("sprite_ram") // horse sprites |
| 137 | | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("dderby_vidchars") // char ram |
| 138 | | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE("dderby_vidattribs") // colours/ attrib ram |
| 137 | AM_RANGE(0xd000, 0xd3ff) AM_RAM AM_SHARE("vidchars") // char ram |
| 138 | AM_RANGE(0xd400, 0xd7ff) AM_RAM AM_SHARE("vidattribs") // colours/ attrib ram |
| 139 | 139 | ADDRESS_MAP_END |
| 140 | 140 | |
| 141 | 141 | static ADDRESS_MAP_START( dderby_sound_map, AS_PROGRAM, 8, dmndrby_state ) |
| r14899 | r14900 | |
| 362 | 362 | can we draw it with the tilemap? maybe not, the layout is a litle strange |
| 363 | 363 | |
| 364 | 364 | */ |
| 365 | | // base = state->m_scroll_ram.target()[0]; |
| 365 | // base = state->m_scroll_ram[0]; |
| 366 | 366 | |
| 367 | | off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram.target()[1])*0x100; |
| 368 | | scrolly = 0xff-(state->m_scroll_ram.target()[0]); |
| 369 | | if(state->m_scroll_ram.target()[1]==0xff) off=0x1800; |
| 367 | off=0x1900-(state->m_bg*0x100)+(state->m_scroll_ram[1])*0x100; |
| 368 | scrolly = 0xff-(state->m_scroll_ram[0]); |
| 369 | if(state->m_scroll_ram[1]==0xff) off=0x1800; |
| 370 | 370 | for(x=0;x<16;x++) { |
| 371 | 371 | for(y=0;y<16;y++) { |
| 372 | 372 | int chr = state->m_racetrack_tilemap_rom[off]; |
| r14899 | r14900 | |
| 398 | 398 | int a=0; |
| 399 | 399 | int b=0; |
| 400 | 400 | int base = count*4; |
| 401 | | int sprx=state->m_sprite_ram.target()[base+3]; |
| 402 | | int spry=state->m_sprite_ram.target()[base+2]; |
| 403 | | //state->m_sprite_ram.target()[base+1]; |
| 404 | | int col = (state->m_sprite_ram.target()[base+1]&0x1f); |
| 405 | | int anim = (state->m_sprite_ram.target()[base]&0x3)*0x40; // animation frame - probably wrong but seems right |
| 406 | | int horse = (state->m_sprite_ram.target()[base+1]&0x7)*8+7; // horse label from 1 - 6 |
| 401 | int sprx=state->m_sprite_ram[base+3]; |
| 402 | int spry=state->m_sprite_ram[base+2]; |
| 403 | //state->m_sprite_ram[base+1]; |
| 404 | int col = (state->m_sprite_ram[base+1]&0x1f); |
| 405 | int anim = (state->m_sprite_ram[base]&0x3)*0x40; // animation frame - probably wrong but seems right |
| 406 | int horse = (state->m_sprite_ram[base+1]&0x7)*8+7; // horse label from 1 - 6 |
| 407 | 407 | |
| 408 | 408 | for (a=0;a<8 ;a++) |
| 409 | 409 | { |
| r14899 | r14900 | |
| 426 | 426 | for(x=0;x<32;x++) |
| 427 | 427 | { |
| 428 | 428 | int tileno,bank,color; |
| 429 | | tileno=state->m_dderby_vidchars.target()[count]; |
| 430 | | bank=(state->m_dderby_vidattribs.target()[count]&0x20)>>5; |
| 429 | tileno=state->m_dderby_vidchars[count]; |
| 430 | bank=(state->m_dderby_vidattribs[count]&0x20)>>5; |
| 431 | 431 | tileno|=(bank<<8); |
| 432 | | color=((state->m_dderby_vidattribs.target()[count])&0x1f); |
| 432 | color=((state->m_dderby_vidattribs[count])&0x1f); |
| 433 | 433 | |
| 434 | 434 | drawgfx_transpen(bitmap,cliprect,gfx,tileno,color,0,0,x*8,y*8,(tileno == 0x38) ? 0 : -1); |
| 435 | 435 | |
src/mame/drivers/vamphalf.c
| r14899 | r14900 | |
| 529 | 529 | // 16bit version |
| 530 | 530 | if(state->m_tiles != NULL) |
| 531 | 531 | { |
| 532 | | if(state->m_tiles.target()[offs] & 0x0100) continue; |
| 532 | if(state->m_tiles[offs] & 0x0100) continue; |
| 533 | 533 | |
| 534 | | code = state->m_tiles.target()[offs+1]; |
| 535 | | color = (state->m_tiles.target()[offs+2] >> state->m_palshift) & 0x7f; |
| 534 | code = state->m_tiles[offs+1]; |
| 535 | color = (state->m_tiles[offs+2] >> state->m_palshift) & 0x7f; |
| 536 | 536 | |
| 537 | 537 | // boonggab |
| 538 | 538 | if(state->m_has_extra_gfx) |
| 539 | 539 | { |
| 540 | | code |= ((state->m_tiles.target()[offs+2] & 0x100) << 8); |
| 540 | code |= ((state->m_tiles[offs+2] & 0x100) << 8); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | | x = state->m_tiles.target()[offs+3] & 0x01ff; |
| 544 | | y = 256 - (state->m_tiles.target()[offs] & 0x00ff); |
| 543 | x = state->m_tiles[offs+3] & 0x01ff; |
| 544 | y = 256 - (state->m_tiles[offs] & 0x00ff); |
| 545 | 545 | |
| 546 | | fx = state->m_tiles.target()[offs] & 0x8000; |
| 547 | | fy = state->m_tiles.target()[offs] & 0x4000; |
| 546 | fx = state->m_tiles[offs] & 0x8000; |
| 547 | fy = state->m_tiles[offs] & 0x4000; |
| 548 | 548 | } |
| 549 | 549 | // 32bit version |
| 550 | 550 | else |
| 551 | 551 | { |
| 552 | 552 | offs /= 2; |
| 553 | 553 | |
| 554 | | if(state->m_tiles32.target()[offs] & 0x01000000) continue; |
| 554 | if(state->m_tiles32[offs] & 0x01000000) continue; |
| 555 | 555 | |
| 556 | | code = state->m_tiles32.target()[offs] & 0xffff; |
| 557 | | color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; |
| 556 | code = state->m_tiles32[offs] & 0xffff; |
| 557 | color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; |
| 558 | 558 | |
| 559 | | x = state->m_tiles32.target()[offs+1] & 0x01ff; |
| 560 | | y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16); |
| 559 | x = state->m_tiles32[offs+1] & 0x01ff; |
| 560 | y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16); |
| 561 | 561 | |
| 562 | | fx = state->m_tiles32.target()[offs] & 0x80000000; |
| 563 | | fy = state->m_tiles32.target()[offs] & 0x40000000; |
| 562 | fx = state->m_tiles32[offs] & 0x80000000; |
| 563 | fy = state->m_tiles32[offs] & 0x40000000; |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | if(state->m_flipscreen) |
| r14899 | r14900 | |
| 607 | 607 | offs = (block + cnt) / 2; |
| 608 | 608 | { |
| 609 | 609 | offs /= 2; |
| 610 | | code = (state->m_tiles32.target()[offs] & 0xffff) | ((state->m_tiles32.target()[offs] & 0x3000000) >> 8); |
| 611 | | color = ((state->m_tiles32.target()[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; |
| 610 | code = (state->m_tiles32[offs] & 0xffff) | ((state->m_tiles32[offs] & 0x3000000) >> 8); |
| 611 | color = ((state->m_tiles32[offs+1] >> state->m_palshift) & 0x7f0000) >> 16; |
| 612 | 612 | |
| 613 | | x = state->m_tiles32.target()[offs+1] & 0x01ff; |
| 614 | | y = 256 - ((state->m_tiles32.target()[offs] & 0x00ff0000) >> 16); |
| 613 | x = state->m_tiles32[offs+1] & 0x01ff; |
| 614 | y = 256 - ((state->m_tiles32[offs] & 0x00ff0000) >> 16); |
| 615 | 615 | |
| 616 | | fx = state->m_tiles32.target()[offs] & 0x4000000; |
| 617 | | fy = 0; // not used ? or it's state->m_tiles32.target()[offs] & 0x8000000? |
| 616 | fx = state->m_tiles32[offs] & 0x4000000; |
| 617 | fy = 0; // not used ? or it's state->m_tiles32[offs] & 0x8000000? |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | if(state->m_flipscreen) |
| r14899 | r14900 | |
| 2088 | 2088 | device_eat_cycles(&space.device(), 50); |
| 2089 | 2089 | } |
| 2090 | 2090 | |
| 2091 | | return m_wram.target()[(0x4a840/2)+offset]; |
| 2091 | return m_wram[(0x4a840/2)+offset]; |
| 2092 | 2092 | } |
| 2093 | 2093 | |
| 2094 | 2094 | READ16_MEMBER(vamphalf_state::vamphafk_speedup_r) |
| r14899 | r14900 | |
| 2101 | 2101 | device_eat_cycles(&space.device(), 50); |
| 2102 | 2102 | } |
| 2103 | 2103 | |
| 2104 | | return m_wram.target()[(0x4a6d0/2)+offset]; |
| 2104 | return m_wram[(0x4a6d0/2)+offset]; |
| 2105 | 2105 | } |
| 2106 | 2106 | |
| 2107 | 2107 | READ16_MEMBER(vamphalf_state::misncrft_speedup_r) |
| r14899 | r14900 | |
| 2114 | 2114 | device_eat_cycles(&space.device(), 50); |
| 2115 | 2115 | } |
| 2116 | 2116 | |
| 2117 | | return m_wram.target()[(0x72eb4/2)+offset]; |
| 2117 | return m_wram[(0x72eb4/2)+offset]; |
| 2118 | 2118 | } |
| 2119 | 2119 | |
| 2120 | 2120 | READ16_MEMBER(vamphalf_state::coolmini_speedup_r) |
| r14899 | r14900 | |
| 2127 | 2127 | device_eat_cycles(&space.device(), 50); |
| 2128 | 2128 | } |
| 2129 | 2129 | |
| 2130 | | return m_wram.target()[(0xd2e80/2)+offset]; |
| 2130 | return m_wram[(0xd2e80/2)+offset]; |
| 2131 | 2131 | } |
| 2132 | 2132 | |
| 2133 | 2133 | READ16_MEMBER(vamphalf_state::suplup_speedup_r) |
| r14899 | r14900 | |
| 2140 | 2140 | device_eat_cycles(&space.device(), 50); |
| 2141 | 2141 | } |
| 2142 | 2142 | |
| 2143 | | return m_wram.target()[(0x11605c/2)+offset]; |
| 2143 | return m_wram[(0x11605c/2)+offset]; |
| 2144 | 2144 | } |
| 2145 | 2145 | |
| 2146 | 2146 | READ16_MEMBER(vamphalf_state::luplup_speedup_r) |
| r14899 | r14900 | |
| 2153 | 2153 | device_eat_cycles(&space.device(), 50); |
| 2154 | 2154 | } |
| 2155 | 2155 | |
| 2156 | | return m_wram.target()[(0x115e84/2)+offset]; |
| 2156 | return m_wram[(0x115e84/2)+offset]; |
| 2157 | 2157 | } |
| 2158 | 2158 | |
| 2159 | 2159 | READ16_MEMBER(vamphalf_state::luplup29_speedup_r) |
| r14899 | r14900 | |
| 2166 | 2166 | device_eat_cycles(&space.device(), 50); |
| 2167 | 2167 | } |
| 2168 | 2168 | |
| 2169 | | return m_wram.target()[(0x113f08/2)+offset]; |
| 2169 | return m_wram[(0x113f08/2)+offset]; |
| 2170 | 2170 | } |
| 2171 | 2171 | |
| 2172 | 2172 | READ16_MEMBER(vamphalf_state::puzlbang_speedup_r) |
| r14899 | r14900 | |
| 2179 | 2179 | device_eat_cycles(&space.device(), 50); |
| 2180 | 2180 | } |
| 2181 | 2181 | |
| 2182 | | return m_wram.target()[(0x113ecc/2)+offset]; |
| 2182 | return m_wram[(0x113ecc/2)+offset]; |
| 2183 | 2183 | } |
| 2184 | 2184 | |
| 2185 | 2185 | READ32_MEMBER(vamphalf_state::wyvernwg_speedup_r) |
| r14899 | r14900 | |
| 2194 | 2194 | device_eat_cycles(&space.device(), 50); |
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | | return m_wram32.target()[0x00b56fc/4]; |
| 2197 | return m_wram32[0x00b56fc/4]; |
| 2198 | 2198 | } |
| 2199 | 2199 | |
| 2200 | 2200 | READ32_MEMBER(vamphalf_state::wyvernwga_speedup_r) |
| r14899 | r14900 | |
| 2209 | 2209 | device_eat_cycles(&space.device(), 50); |
| 2210 | 2210 | } |
| 2211 | 2211 | |
| 2212 | | return m_wram32.target()[0x00b74f8/4]; |
| 2212 | return m_wram32[0x00b74f8/4]; |
| 2213 | 2213 | } |
| 2214 | 2214 | |
| 2215 | 2215 | |
| r14899 | r14900 | |
| 2224 | 2224 | device_eat_cycles(&space.device(), 50); |
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | | return m_wram32.target()[0x005e874/4]; |
| 2227 | return m_wram32[0x005e874/4]; |
| 2228 | 2228 | } |
| 2229 | 2229 | |
| 2230 | 2230 | READ32_MEMBER(vamphalf_state::mrkicker_speedup_r) |
| r14899 | r14900 | |
| 2238 | 2238 | device_eat_cycles(&space.device(), 50); |
| 2239 | 2239 | } |
| 2240 | 2240 | |
| 2241 | | return m_wram32.target()[0x00701a4/4]; |
| 2241 | return m_wram32[0x00701a4/4]; |
| 2242 | 2242 | } |
| 2243 | 2243 | |
| 2244 | 2244 | |
| r14899 | r14900 | |
| 2252 | 2252 | device_eat_cycles(&space.device(), 50); |
| 2253 | 2253 | } |
| 2254 | 2254 | |
| 2255 | | return m_wram.target()[(0xcde70/2)+offset]; |
| 2255 | return m_wram[(0xcde70/2)+offset]; |
| 2256 | 2256 | } |
| 2257 | 2257 | |
| 2258 | 2258 | READ32_MEMBER(vamphalf_state::aoh_speedup_r) |
| r14899 | r14900 | |
| 2267 | 2267 | } |
| 2268 | 2268 | |
| 2269 | 2269 | |
| 2270 | | return m_wram32.target()[0x28a09c/4]; |
| 2270 | return m_wram32[0x28a09c/4]; |
| 2271 | 2271 | } |
| 2272 | 2272 | |
| 2273 | 2273 | READ16_MEMBER(vamphalf_state::jmpbreak_speedup_r) |
| r14899 | r14900 | |
| 2280 | 2280 | device_eat_cycles(&space.device(), 50); |
| 2281 | 2281 | } |
| 2282 | 2282 | |
| 2283 | | return m_wram.target()[(0x00906fc / 2)+offset]; |
| 2283 | return m_wram[(0x00906fc / 2)+offset]; |
| 2284 | 2284 | } |
| 2285 | 2285 | |
| 2286 | 2286 | READ16_MEMBER(vamphalf_state::mrdig_speedup_r) |
| r14899 | r14900 | |
| 2293 | 2293 | device_eat_cycles(&space.device(), 50); |
| 2294 | 2294 | } |
| 2295 | 2295 | |
| 2296 | | return m_wram.target()[(0x00a99c / 2)+offset]; |
| 2296 | return m_wram[(0x00a99c / 2)+offset]; |
| 2297 | 2297 | } |
| 2298 | 2298 | |
| 2299 | 2299 | READ16_MEMBER(vamphalf_state::dtfamily_speedup_r) |
| r14899 | r14900 | |
| 2304 | 2304 | if (pc == 0x12fa6) |
| 2305 | 2305 | device_spin_until_interrupt(&space.device()); |
| 2306 | 2306 | |
| 2307 | | return m_wram.target()[0xcc2a8 / 2]; |
| 2307 | return m_wram[0xcc2a8 / 2]; |
| 2308 | 2308 | |
| 2309 | 2309 | } |
| 2310 | 2310 | |
| r14899 | r14900 | |
| 2314 | 2314 | if (cpu_get_pc(&space.device()) == 0x130c2) |
| 2315 | 2315 | device_spin_until_interrupt(&space.device()); |
| 2316 | 2316 | |
| 2317 | | return m_wram.target()[0x780d8 / 2]; |
| 2317 | return m_wram[0x780d8 / 2]; |
| 2318 | 2318 | |
| 2319 | 2319 | } |
| 2320 | 2320 | |
| r14899 | r14900 | |
| 2326 | 2326 | device_spin_until_interrupt(&space.device()); |
| 2327 | 2327 | } |
| 2328 | 2328 | |
| 2329 | | return m_wram.target()[(0xf1b7c / 2)+offset]; |
| 2329 | return m_wram[(0xf1b7c / 2)+offset]; |
| 2330 | 2330 | } |
| 2331 | 2331 | |
| 2332 | 2332 | static DRIVER_INIT( vamphalf ) |
src/mame/drivers/bnstars.c
| r14899 | r14900 | |
| 98 | 98 | { |
| 99 | 99 | public: |
| 100 | 100 | bnstars_state(const machine_config &mconfig, device_type type, const char *tag) |
| 101 | | : driver_device(mconfig, type, tag) { } |
| 101 | : driver_device(mconfig, type, tag), |
| 102 | m_ms32_tx0_ram(*this, "tx0_ram"), |
| 103 | m_ms32_tx1_ram(*this, "tx1_ram"), |
| 104 | m_ms32_bg0_ram(*this, "bg0_ram"), |
| 105 | m_ms32_bg1_ram(*this, "bg1_ram"), |
| 106 | m_ms32_roz0_ram(*this, "roz0_ram"), |
| 107 | m_ms32_roz1_ram(*this, "roz1_ram"), |
| 108 | m_ms32_pal_ram(*this, "pal_ram"), |
| 109 | m_ms32_roz_ctrl(*this, "roz_ctrl"), |
| 110 | m_ms32_spram(*this, "spram"), |
| 111 | m_ms32_tx0_scroll(*this, "tx0_scroll"), |
| 112 | m_ms32_bg0_scroll(*this, "bg0_scroll"), |
| 113 | m_ms32_tx1_scroll(*this, "tx1_scroll"), |
| 114 | m_ms32_bg1_scroll(*this, "bg1_scroll") { } |
| 102 | 115 | |
| 103 | 116 | tilemap_t *m_ms32_tx_tilemap[2]; |
| 104 | 117 | tilemap_t *m_ms32_bg_tilemap[2]; |
| 105 | 118 | tilemap_t *m_ms32_roz_tilemap[2]; |
| 106 | | UINT32 *m_ms32_tx0_ram; |
| 107 | | UINT32 *m_ms32_tx1_ram; |
| 108 | | UINT32 *m_ms32_bg0_ram; |
| 109 | | UINT32 *m_ms32_bg1_ram; |
| 110 | | UINT32 *m_ms32_roz0_ram; |
| 111 | | UINT32 *m_ms32_roz1_ram; |
| 112 | | UINT32 *m_ms32_pal_ram[2]; |
| 113 | | UINT32 *m_ms32_roz_ctrl[2]; |
| 114 | | UINT32 *m_ms32_spram; |
| 115 | | UINT32 *m_ms32_tx0_scroll; |
| 116 | | UINT32 *m_ms32_bg0_scroll; |
| 117 | | UINT32 *m_ms32_tx1_scroll; |
| 118 | | UINT32 *m_ms32_bg1_scroll; |
| 119 | required_shared_ptr<UINT32> m_ms32_tx0_ram; |
| 120 | required_shared_ptr<UINT32> m_ms32_tx1_ram; |
| 121 | required_shared_ptr<UINT32> m_ms32_bg0_ram; |
| 122 | required_shared_ptr<UINT32> m_ms32_bg1_ram; |
| 123 | required_shared_ptr<UINT32> m_ms32_roz0_ram; |
| 124 | required_shared_ptr<UINT32> m_ms32_roz1_ram; |
| 125 | required_shared_ptr_array<UINT32, 2> m_ms32_pal_ram; |
| 126 | required_shared_ptr_array<UINT32, 2> m_ms32_roz_ctrl; |
| 127 | required_shared_ptr<UINT32> m_ms32_spram; |
| 128 | required_shared_ptr<UINT32> m_ms32_tx0_scroll; |
| 129 | required_shared_ptr<UINT32> m_ms32_bg0_scroll; |
| 130 | required_shared_ptr<UINT32> m_ms32_tx1_scroll; |
| 131 | required_shared_ptr<UINT32> m_ms32_bg1_scroll; |
| 119 | 132 | UINT32 m_bnstars1_mahjong_select; |
| 120 | 133 | int m_ms32_reverse_sprite_order; |
| 121 | 134 | int m_flipscreen; |
| r14899 | r14900 | |
| 1276 | 1289 | AM_RANGE(0xfce00058, 0xfce0005b) AM_WRITENOP |
| 1277 | 1290 | AM_RANGE(0xfce0005c, 0xfce0005f) AM_WRITENOP |
| 1278 | 1291 | |
| 1279 | | AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITEONLY AM_BASE(m_ms32_roz_ctrl[0]) |
| 1280 | | AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITEONLY AM_BASE(m_ms32_roz_ctrl[1]) // guess |
| 1281 | | AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITEONLY AM_BASE(m_ms32_tx0_scroll) |
| 1282 | | AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITEONLY AM_BASE(m_ms32_bg0_scroll) |
| 1283 | | AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITEONLY AM_BASE(m_ms32_tx1_scroll) |
| 1284 | | AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITEONLY AM_BASE(m_ms32_bg1_scroll) |
| 1292 | AM_RANGE(0xfce00400, 0xfce0045f) AM_WRITEONLY AM_SHARE("roz_ctrl.0") |
| 1293 | AM_RANGE(0xfce00700, 0xfce0075f) AM_WRITEONLY AM_SHARE("roz_ctrl.1") // guess |
| 1294 | AM_RANGE(0xfce00a00, 0xfce00a17) AM_WRITEONLY AM_SHARE("tx0_scroll") |
| 1295 | AM_RANGE(0xfce00a20, 0xfce00a37) AM_WRITEONLY AM_SHARE("bg0_scroll") |
| 1296 | AM_RANGE(0xfce00c00, 0xfce00c17) AM_WRITEONLY AM_SHARE("tx1_scroll") |
| 1297 | AM_RANGE(0xfce00c20, 0xfce00c37) AM_WRITEONLY AM_SHARE("bg1_scroll") |
| 1285 | 1298 | |
| 1286 | 1299 | AM_RANGE(0xfce00e00, 0xfce00e03) AM_WRITE(bnstars1_mahjong_select_w) // ? |
| 1287 | 1300 | |
| 1288 | 1301 | /* wrote together */ |
| 1289 | 1302 | AM_RANGE(0xfd040000, 0xfd047fff) AM_RAM // priority ram |
| 1290 | 1303 | AM_RANGE(0xfd080000, 0xfd087fff) AM_RAM |
| 1291 | | AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM_WRITE(ms32_pal1_ram_w) AM_BASE(m_ms32_pal_ram[1]) |
| 1292 | | AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM_WRITE(ms32_pal0_ram_w) AM_BASE(m_ms32_pal_ram[0]) |
| 1293 | | AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM_WRITE(ms32_roz1_ram_w) AM_BASE(m_ms32_roz1_ram) |
| 1294 | | AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM_WRITE(ms32_roz0_ram_w) AM_BASE(m_ms32_roz0_ram) |
| 1295 | | AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM_WRITE(ms32_spramx_w) AM_BASE(m_ms32_spram) |
| 1296 | | AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM_WRITE(ms32_tx1_ram_w) AM_BASE(m_ms32_tx1_ram) |
| 1297 | | AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM_WRITE(ms32_bg1_ram_w) AM_BASE(m_ms32_bg1_ram) |
| 1298 | | AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM_WRITE(ms32_tx0_ram_w) AM_BASE(m_ms32_tx0_ram) |
| 1299 | | AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_BASE(m_ms32_bg0_ram) |
| 1304 | AM_RANGE(0xfd200000, 0xfd237fff) AM_RAM_WRITE(ms32_pal1_ram_w) AM_SHARE("pal_ram.1") |
| 1305 | AM_RANGE(0xfd400000, 0xfd437fff) AM_RAM_WRITE(ms32_pal0_ram_w) AM_SHARE("pal_ram.0") |
| 1306 | AM_RANGE(0xfe000000, 0xfe01ffff) AM_RAM_WRITE(ms32_roz1_ram_w) AM_SHARE("roz1_ram") |
| 1307 | AM_RANGE(0xfe400000, 0xfe41ffff) AM_RAM_WRITE(ms32_roz0_ram_w) AM_SHARE("roz0_ram") |
| 1308 | AM_RANGE(0xfe800000, 0xfe83ffff) AM_RAM_WRITE(ms32_spramx_w) AM_SHARE("spram") |
| 1309 | AM_RANGE(0xfea00000, 0xfea07fff) AM_RAM_WRITE(ms32_tx1_ram_w) AM_SHARE("tx1_ram") |
| 1310 | AM_RANGE(0xfea08000, 0xfea0ffff) AM_RAM_WRITE(ms32_bg1_ram_w) AM_SHARE("bg1_ram") |
| 1311 | AM_RANGE(0xfec00000, 0xfec07fff) AM_RAM_WRITE(ms32_tx0_ram_w) AM_SHARE("tx0_ram") |
| 1312 | AM_RANGE(0xfec08000, 0xfec0ffff) AM_RAM_WRITE(ms32_bg0_ram_w) AM_SHARE("bg0_ram") |
| 1300 | 1313 | |
| 1301 | 1314 | AM_RANGE(0xfee00000, 0xfee1ffff) AM_RAM |
| 1302 | 1315 | AM_RANGE(0xffe00000, 0xffffffff) AM_ROMBANK("bank1") |
src/mame/drivers/igs_m027.c
| r14899 | r14900 | |
| 63 | 63 | /* CGLayer */ |
| 64 | 64 | WRITE32_MEMBER(igs_m027_state::igs_cg_videoram_w) |
| 65 | 65 | { |
| 66 | | COMBINE_DATA(&m_igs_cg_videoram.target()[offset]); |
| 66 | COMBINE_DATA(&m_igs_cg_videoram[offset]); |
| 67 | 67 | //if(data!=0) |
| 68 | | logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram.target()[offset]); |
| 68 | logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(&space.device()),offset ,m_igs_cg_videoram[offset]); |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | |
| r14899 | r14900 | |
| 106 | 106 | /* TX Layer */ |
| 107 | 107 | WRITE32_MEMBER(igs_m027_state::igs_tx_videoram_w) |
| 108 | 108 | { |
| 109 | | COMBINE_DATA(&m_igs_tx_videoram.target()[offset]); |
| 109 | COMBINE_DATA(&m_igs_tx_videoram[offset]); |
| 110 | 110 | m_igs_tx_tilemap->mark_tile_dirty(offset); |
| 111 | 111 | //if(data!=0) |
| 112 | | //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram.target()[offset]); |
| 112 | //logerror( "TX VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_tx_videoram[offset]); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | static TILE_GET_INFO( get_tx_tilemap_tile_info ) |
| r14899 | r14900 | |
| 117 | 117 | igs_m027_state *state = machine.driver_data<igs_m027_state>(); |
| 118 | 118 | //ppppppppNNNNNNNN |
| 119 | 119 | int tileno,colour; |
| 120 | | tileno = state->m_igs_tx_videoram.target()[tile_index] & 0xffff; |
| 121 | | colour = (state->m_igs_tx_videoram.target()[tile_index]>>0x10) & 0xffff; |
| 120 | tileno = state->m_igs_tx_videoram[tile_index] & 0xffff; |
| 121 | colour = (state->m_igs_tx_videoram[tile_index]>>0x10) & 0xffff; |
| 122 | 122 | |
| 123 | 123 | SET_TILE_INFO(0,tileno,colour,0); |
| 124 | 124 | } |
| r14899 | r14900 | |
| 126 | 126 | /* BG Layer */ |
| 127 | 127 | WRITE32_MEMBER(igs_m027_state::igs_bg_videoram_w) |
| 128 | 128 | { |
| 129 | | COMBINE_DATA(&m_igs_bg_videoram.target()[offset]); |
| 129 | COMBINE_DATA(&m_igs_bg_videoram[offset]); |
| 130 | 130 | m_igs_bg_tilemap->mark_tile_dirty(offset); |
| 131 | 131 | //if(data!=0) |
| 132 | | logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram.target()[offset]); |
| 132 | logerror("BG VIDEO RAM OFFSET %x ,data %x!\n",offset ,m_igs_bg_videoram[offset]); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static TILE_GET_INFO( get_bg_tilemap_tile_info ) |
| r14899 | r14900 | |
| 137 | 137 | igs_m027_state *state = machine.driver_data<igs_m027_state>(); |
| 138 | 138 | //ppppppppNNNNNNNN |
| 139 | 139 | int tileno,colour; |
| 140 | | tileno = state->m_igs_bg_videoram.target()[tile_index] & 0xffff; |
| 141 | | colour = (state->m_igs_bg_videoram.target()[tile_index]>>0x10) & 0xffff; |
| 140 | tileno = state->m_igs_bg_videoram[tile_index] & 0xffff; |
| 141 | colour = (state->m_igs_bg_videoram[tile_index]>>0x10) & 0xffff; |
| 142 | 142 | |
| 143 | 143 | SET_TILE_INFO(0,tileno,colour,0); |
| 144 | 144 | } |
| r14899 | r14900 | |
| 147 | 147 | /* Palette Layer */ |
| 148 | 148 | WRITE32_MEMBER(igs_m027_state::igs_palette32_w) |
| 149 | 149 | { |
| 150 | | m_generic_paletteram_16.set_target((UINT16 *)m_igs_palette32.target(), 0x800); |
| 151 | | COMBINE_DATA(&m_igs_palette32.target()[offset]); |
| 150 | m_generic_paletteram_16.set_target(reinterpret_cast<UINT16 *>(m_igs_palette32.target()), 0x800); |
| 151 | COMBINE_DATA(&m_igs_palette32[offset]); |
| 152 | 152 | //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2,m_generic_paletteram_16[offset*2],0); |
| 153 | 153 | //paletteram_xGGGGGRRRRRBBBBB_word_w(offset*2+1,m_generic_paletteram_16[offset*2+1],0); |
| 154 | 154 | //if(data!=0) |
| 155 | | //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32.target()[offset]); |
| 155 | //fprintf(stdout,"PALETTE RAM OFFSET %x ,data %x!\n",offset ,m_igs_palette32[offset]); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
src/mame/drivers/subsino2.c
| r14899 | r14900 | |
| 832 | 832 | |
| 833 | 833 | READ8_MEMBER(subsino2_state::am188em_regs_r) |
| 834 | 834 | { |
| 835 | | return m_am188em_regs.target()[offset]; |
| 835 | return m_am188em_regs[offset]; |
| 836 | 836 | } |
| 837 | 837 | |
| 838 | 838 | WRITE8_MEMBER(subsino2_state::am188em_regs_w) |
| 839 | 839 | { |
| 840 | | m_am188em_regs.target()[offset] = data; |
| 840 | m_am188em_regs[offset] = data; |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | 843 | static MACHINE_RESET( am188em ) |
| 844 | 844 | { |
| 845 | 845 | subsino2_state *state = machine.driver_data<subsino2_state>(); |
| 846 | 846 | // start with masked interrupts |
| 847 | | state->m_am188em_regs.target()[AM188EM_IMASK+0] = 0xfd; |
| 848 | | state->m_am188em_regs.target()[AM188EM_IMASK+1] = 0x07; |
| 849 | | state->m_am188em_regs.target()[AM188EM_I0CON+0] = 0x0f; |
| 850 | | state->m_am188em_regs.target()[AM188EM_I0CON+1] = 0x00; |
| 847 | state->m_am188em_regs[AM188EM_IMASK+0] = 0xfd; |
| 848 | state->m_am188em_regs[AM188EM_IMASK+1] = 0x07; |
| 849 | state->m_am188em_regs[AM188EM_I0CON+0] = 0x0f; |
| 850 | state->m_am188em_regs[AM188EM_I0CON+1] = 0x00; |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | static INTERRUPT_GEN( am188em_int0_irq ) |
| 854 | 854 | { |
| 855 | 855 | subsino2_state *state = device->machine().driver_data<subsino2_state>(); |
| 856 | | if ( ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x10) == 0) || // IMASK.I0 mask |
| 857 | | ((state->m_am188em_regs.target()[AM188EM_I0CON+0] & 0x08) == 0) ) // I0CON.MSK mask |
| 856 | if ( ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x10) == 0) || // IMASK.I0 mask |
| 857 | ((state->m_am188em_regs[AM188EM_I0CON+0] & 0x08) == 0) ) // I0CON.MSK mask |
| 858 | 858 | device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x0c); // INT0 (background scrolling in xplan) |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | static TIMER_DEVICE_CALLBACK( am188em_timer2_irq ) |
| 862 | 862 | { |
| 863 | 863 | subsino2_state *state = timer.machine().driver_data<subsino2_state>(); |
| 864 | | if ((state->m_am188em_regs.target()[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask |
| 864 | if ((state->m_am188em_regs[AM188EM_IMASK+0] & 0x01) == 0) // TMR mask |
| 865 | 865 | cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0x4c/4); |
| 866 | 866 | } |
| 867 | 867 | |
| r14899 | r14900 | |
| 925 | 925 | |
| 926 | 926 | WRITE16_MEMBER(subsino2_state::bishjan_outputs_w) |
| 927 | 927 | { |
| 928 | | m_outputs16.target()[offset] = data; |
| 928 | m_outputs16[offset] = data; |
| 929 | 929 | |
| 930 | 930 | switch (offset) |
| 931 | 931 | { |
| r14899 | r14900 | |
| 939 | 939 | break; |
| 940 | 940 | } |
| 941 | 941 | |
| 942 | | // popmessage("0: %04x", m_outputs16.target()[0]); |
| 942 | // popmessage("0: %04x", m_outputs16[0]); |
| 943 | 943 | } |
| 944 | 944 | |
| 945 | 945 | |
| r14899 | r14900 | |
| 997 | 997 | |
| 998 | 998 | WRITE8_MEMBER(subsino2_state::expcard_outputs_w) |
| 999 | 999 | { |
| 1000 | | m_outputs.target()[offset] = data; |
| 1000 | m_outputs[offset] = data; |
| 1001 | 1001 | |
| 1002 | 1002 | switch (offset) |
| 1003 | 1003 | { |
| r14899 | r14900 | |
| 1024 | 1024 | break; |
| 1025 | 1025 | } |
| 1026 | 1026 | |
| 1027 | | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); |
| 1027 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); |
| 1028 | 1028 | } |
| 1029 | 1029 | |
| 1030 | 1030 | /*************************************************************************** |
| r14899 | r14900 | |
| 1033 | 1033 | |
| 1034 | 1034 | WRITE8_MEMBER(subsino2_state::mtrain_outputs_w) |
| 1035 | 1035 | { |
| 1036 | | m_outputs.target()[offset] = data; |
| 1036 | m_outputs[offset] = data; |
| 1037 | 1037 | |
| 1038 | 1038 | switch (offset) |
| 1039 | 1039 | { |
| r14899 | r14900 | |
| 1059 | 1059 | break; |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); |
| 1062 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); |
| 1063 | 1063 | } |
| 1064 | 1064 | |
| 1065 | 1065 | WRITE8_MEMBER(subsino2_state::mtrain_videoram_w) |
| r14899 | r14900 | |
| 1163 | 1163 | |
| 1164 | 1164 | WRITE8_MEMBER(subsino2_state::saklove_outputs_w) |
| 1165 | 1165 | { |
| 1166 | | m_outputs.target()[offset] = data; |
| 1166 | m_outputs[offset] = data; |
| 1167 | 1167 | |
| 1168 | 1168 | switch (offset) |
| 1169 | 1169 | { |
| r14899 | r14900 | |
| 1183 | 1183 | break; |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); |
| 1186 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); |
| 1187 | 1187 | } |
| 1188 | 1188 | |
| 1189 | 1189 | static ADDRESS_MAP_START( saklove_map, AS_PROGRAM, 8, subsino2_state ) |
| r14899 | r14900 | |
| 1245 | 1245 | |
| 1246 | 1246 | WRITE8_MEMBER(subsino2_state::xplan_outputs_w) |
| 1247 | 1247 | { |
| 1248 | | m_outputs.target()[offset] = data; |
| 1248 | m_outputs[offset] = data; |
| 1249 | 1249 | |
| 1250 | 1250 | switch (offset) |
| 1251 | 1251 | { |
| r14899 | r14900 | |
| 1273 | 1273 | break; |
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); |
| 1276 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); |
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | 1279 | static ADDRESS_MAP_START( xplan_map, AS_PROGRAM, 8, subsino2_state ) |
| r14899 | r14900 | |
| 1347 | 1347 | |
| 1348 | 1348 | WRITE8_MEMBER(subsino2_state::xtrain_outputs_w) |
| 1349 | 1349 | { |
| 1350 | | m_outputs.target()[offset] = data; |
| 1350 | m_outputs[offset] = data; |
| 1351 | 1351 | |
| 1352 | 1352 | switch (offset) |
| 1353 | 1353 | { |
| r14899 | r14900 | |
| 1376 | 1376 | break; |
| 1377 | 1377 | } |
| 1378 | 1378 | |
| 1379 | | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs.target()[0], m_outputs.target()[1], m_outputs.target()[2], m_outputs.target()[3]); |
| 1379 | // popmessage("0: %02x - 1: %02x - 2: %02x - 3: %02x", m_outputs[0], m_outputs[1], m_outputs[2], m_outputs[3]); |
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | static ADDRESS_MAP_START( expcard_io, AS_IO, 8, subsino2_state ) |
src/mame/drivers/acommand.c
| r14899 | r14900 | |
| 101 | 101 | static TILE_GET_INFO( ac_get_bg_tile_info ) |
| 102 | 102 | { |
| 103 | 103 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 104 | | int code = state->m_ac_bgvram.target()[tile_index]; |
| 104 | int code = state->m_ac_bgvram[tile_index]; |
| 105 | 105 | SET_TILE_INFO( |
| 106 | 106 | 1, |
| 107 | 107 | code & 0xfff, |
| r14899 | r14900 | |
| 112 | 112 | static TILE_GET_INFO( ac_get_tx_tile_info ) |
| 113 | 113 | { |
| 114 | 114 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 115 | | int code = state->m_ac_txvram.target()[tile_index]; |
| 115 | int code = state->m_ac_txvram[tile_index]; |
| 116 | 116 | SET_TILE_INFO( |
| 117 | 117 | 0, |
| 118 | 118 | code & 0xfff, |
| r14899 | r14900 | |
| 123 | 123 | static void draw_sprites(running_machine &machine, bitmap_ind16 &bitmap, const rectangle &cliprect, int priority, int pri_mask) |
| 124 | 124 | { |
| 125 | 125 | acommand_state *state = machine.driver_data<acommand_state>(); |
| 126 | | UINT16 *spriteram16 = state->m_spriteram.target(); |
| 126 | UINT16 *spriteram16 = state->m_spriteram; |
| 127 | 127 | int offs; |
| 128 | 128 | |
| 129 | 129 | for (offs = 0;offs < state->m_spriteram.bytes()/2;offs += 8) |
| r14899 | r14900 | |
| 269 | 269 | |
| 270 | 270 | WRITE16_MEMBER(acommand_state::ac_bgvram_w) |
| 271 | 271 | { |
| 272 | | COMBINE_DATA(&m_ac_bgvram.target()[offset]); |
| 272 | COMBINE_DATA(&m_ac_bgvram[offset]); |
| 273 | 273 | m_bg_tilemap->mark_tile_dirty(offset); |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | WRITE16_MEMBER(acommand_state::ac_txvram_w) |
| 277 | 277 | { |
| 278 | | COMBINE_DATA(&m_ac_txvram.target()[offset]); |
| 278 | COMBINE_DATA(&m_ac_txvram[offset]); |
| 279 | 279 | m_tx_tilemap->mark_tile_dirty(offset); |
| 280 | 280 | } |
| 281 | 281 | |
| r14899 | r14900 | |
| 345 | 345 | */ |
| 346 | 346 | //22dc8 |
| 347 | 347 | { |
| 348 | | m_ufo_sw1 = m_ac_devram.target()[offset] & 3; |
| 349 | | if(m_ac_devram.target()[offset] & 0x10) |
| 348 | m_ufo_sw1 = m_ac_devram[offset] & 3; |
| 349 | if(m_ac_devram[offset] & 0x10) |
| 350 | 350 | m_ufo_sw1|= 0x10; |
| 351 | | if(m_ac_devram.target()[offset] & 0x40) |
| 351 | if(m_ac_devram[offset] & 0x40) |
| 352 | 352 | m_ufo_sw1|= 0x20; |
| 353 | | if(m_ac_devram.target()[offset] & 0x100) |
| 353 | if(m_ac_devram[offset] & 0x100) |
| 354 | 354 | m_ufo_sw1|=0x100; |
| 355 | | if(m_ac_devram.target()[offset] & 0x400) |
| 355 | if(m_ac_devram[offset] & 0x400) |
| 356 | 356 | m_ufo_sw1|=0x200; |
| 357 | | if(m_ac_devram.target()[offset] & 0x1000) |
| 357 | if(m_ac_devram[offset] & 0x1000) |
| 358 | 358 | m_ufo_sw1|=0x1000; |
| 359 | | if(m_ac_devram.target()[offset] & 0x4000) |
| 359 | if(m_ac_devram[offset] & 0x4000) |
| 360 | 360 | m_ufo_sw1|=0x2000; |
| 361 | | // if(m_ac_devram.target()[0x0048/2] & 0x0001) |
| 361 | // if(m_ac_devram[0x0048/2] & 0x0001) |
| 362 | 362 | // m_ufo_sw1|=0x0040; |
| 363 | | // if(m_ac_devram.target()[0x0048/2] & 0x0004) |
| 363 | // if(m_ac_devram[0x0048/2] & 0x0004) |
| 364 | 364 | // m_ufo_sw1|=0x0400; |
| 365 | | // if(m_ac_devram.target()[0x0048/2] & 0x0100) |
| 365 | // if(m_ac_devram[0x0048/2] & 0x0100) |
| 366 | 366 | // m_ufo_sw1|=0x4000; |
| 367 | 367 | return m_ufo_sw1; |
| 368 | 368 | } |
| r14899 | r14900 | |
| 375 | 375 | */ |
| 376 | 376 | { |
| 377 | 377 | m_ufo_sw2 = 0; |
| 378 | | if(m_ac_devram.target()[offset] & 0x01) |
| 378 | if(m_ac_devram[offset] & 0x01) |
| 379 | 379 | m_ufo_sw2|= 1; |
| 380 | | if(m_ac_devram.target()[offset] & 0x04) |
| 380 | if(m_ac_devram[offset] & 0x04) |
| 381 | 381 | m_ufo_sw2|= 2; |
| 382 | | if(m_ac_devram.target()[offset] & 0x10) |
| 382 | if(m_ac_devram[offset] & 0x10) |
| 383 | 383 | m_ufo_sw2|=0x10; |
| 384 | | if(m_ac_devram.target()[offset] & 0x40) |
| 384 | if(m_ac_devram[offset] & 0x40) |
| 385 | 385 | m_ufo_sw2|=0x20; |
| 386 | 386 | return m_ufo_sw2; |
| 387 | 387 | } |
| 388 | 388 | case 0x0048/2: |
| 389 | | return m_ac_devram.target()[offset]; |
| 389 | return m_ac_devram[offset]; |
| 390 | 390 | case 0x005c/2: |
| 391 | 391 | /* |
| 392 | 392 | xxxx xxxx ---- ---- DIPSW4 |
| r14899 | r14900 | |
| 394 | 394 | */ |
| 395 | 395 | return input_port_read(machine(), "IN1"); |
| 396 | 396 | } |
| 397 | | return m_ac_devram.target()[offset]; |
| 397 | return m_ac_devram[offset]; |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | WRITE16_MEMBER(acommand_state::ac_devices_w) |
| 401 | 401 | { |
| 402 | | COMBINE_DATA(&m_ac_devram.target()[offset]); |
| 402 | COMBINE_DATA(&m_ac_devram[offset]); |
| 403 | 403 | switch(offset) |
| 404 | 404 | { |
| 405 | 405 | case 0x00/2: |
| r14899 | r14900 | |
| 437 | 437 | case 0x48/2: |
| 438 | 438 | break; |
| 439 | 439 | case 0x50/2: |
| 440 | | m_led0 = m_ac_devram.target()[offset]; |
| 440 | m_led0 = m_ac_devram[offset]; |
| 441 | 441 | //popmessage("%04x",m_led0); |
| 442 | 442 | break; |
| 443 | 443 | case 0x54/2: |
| 444 | | m_led1 = m_ac_devram.target()[offset]; |
| 444 | m_led1 = m_ac_devram[offset]; |
| 445 | 445 | //popmessage("%04x",m_led0); |
| 446 | 446 | break; |
| 447 | 447 | } |
src/mame/drivers/segald.c
| r14899 | r14900 | |
| 30 | 30 | segald_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | 31 | : driver_device(mconfig, type, tag), |
| 32 | 32 | m_laserdisc(*this, "laserdisc") , |
| 33 | | m_obj_RAM(*this, "obj_RAM"), |
| 34 | | m_out_RAM(*this, "out_RAM"), |
| 35 | | m_color_RAM(*this, "color_RAM"), |
| 36 | | m_fix_RAM(*this, "fix_RAM"){ } |
| 33 | m_obj_ram(*this, "obj_ram"), |
| 34 | m_out_ram(*this, "out_ram"), |
| 35 | m_color_ram(*this, "color_ram"), |
| 36 | m_fix_ram(*this, "fix_ram"){ } |
| 37 | 37 | |
| 38 | 38 | UINT8 m_nmi_enable; |
| 39 | 39 | |
| 40 | 40 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 41 | | required_shared_ptr<UINT8> m_obj_RAM; |
| 42 | | required_shared_ptr<UINT8> m_out_RAM; |
| 43 | | required_shared_ptr<UINT8> m_color_RAM; |
| 44 | | required_shared_ptr<UINT8> m_fix_RAM; |
| 41 | required_shared_ptr<UINT8> m_obj_ram; |
| 42 | required_shared_ptr<UINT8> m_out_ram; |
| 43 | required_shared_ptr<UINT8> m_color_ram; |
| 44 | required_shared_ptr<UINT8> m_fix_ram; |
| 45 | 45 | |
| 46 | 46 | UINT8 m_ldv1000_input_latch; |
| 47 | 47 | UINT8 m_ldv1000_output_latch; |
| r14899 | r14900 | |
| 69 | 69 | for (characterY = 0; characterY < 32; characterY++) |
| 70 | 70 | { |
| 71 | 71 | int current_screen_character = (characterY*32) + characterX; |
| 72 | | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_RAM.target()[current_screen_character], |
| 72 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_fix_ram[current_screen_character], |
| 73 | 73 | 1, 0, 0, characterX*8, characterY*8, 0); |
| 74 | 74 | } |
| 75 | 75 | } |
| r14899 | r14900 | |
| 95 | 95 | for (spr_number = 0; spr_number < 32; spr_number++) |
| 96 | 96 | { |
| 97 | 97 | spr_base = 0x10 * spr_number; |
| 98 | | sy = state->m_obj_RAM.target()[spr_base + SPR_Y_TOP]; |
| 99 | | sx = state->m_obj_RAM.target()[spr_base + SPR_X_LO]; |
| 98 | sy = state->m_obj_ram[spr_base + SPR_Y_TOP]; |
| 99 | sx = state->m_obj_ram[spr_base + SPR_X_LO]; |
| 100 | 100 | |
| 101 | 101 | if (sx != 0 || sy != 0) |
| 102 | 102 | logerror("Hey! A sprite's not at 0,0 : %d %d", sx, sy); |
| r14899 | r14900 | |
| 132 | 132 | READ8_MEMBER(segald_state::astron_OUT_read) |
| 133 | 133 | { |
| 134 | 134 | |
| 135 | | logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_RAM.target()[offset], offset, cpu_get_pc(&space.device())); |
| 136 | | return m_out_RAM.target()[offset]; |
| 135 | logerror("OUT read (0x%04x) @ 0x%04x [0x%x]\n", m_out_ram[offset], offset, cpu_get_pc(&space.device())); |
| 136 | return m_out_ram[offset]; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | READ8_MEMBER(segald_state::astron_OBJ_read) |
| 140 | 140 | { |
| 141 | 141 | |
| 142 | | logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_RAM.target()[offset], offset, cpu_get_pc(&space.device())); |
| 143 | | return m_obj_RAM.target()[offset]; |
| 142 | logerror("OBJ read (0x%04x) @ 0x%04x [0x%x]\n", m_obj_ram[offset], offset, cpu_get_pc(&space.device())); |
| 143 | return m_obj_ram[offset]; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | READ8_MEMBER(segald_state::astron_COLOR_read) |
| 147 | 147 | { |
| 148 | 148 | |
| 149 | | logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_RAM.target()[offset], offset, cpu_get_pc(&space.device())); |
| 150 | | return m_color_RAM.target()[offset]; |
| 149 | logerror("COLOR read (0x%04x) @ 0x%04x [0x%x]\n", m_color_ram[offset], offset, cpu_get_pc(&space.device())); |
| 150 | return m_color_ram[offset]; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| r14899 | r14900 | |
| 197 | 197 | break; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | | m_out_RAM.target()[offset] = data; |
| 200 | m_out_ram[offset] = data; |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | WRITE8_MEMBER(segald_state::astron_OBJ_write) |
| 204 | 204 | { |
| 205 | 205 | |
| 206 | | m_obj_RAM.target()[offset] = data; |
| 206 | m_obj_ram[offset] = data; |
| 207 | 207 | logerror("OBJ write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); |
| 208 | 208 | } |
| 209 | 209 | |
| r14899 | r14900 | |
| 214 | 214 | const UINT8 palIndex = offset >> 1; |
| 215 | 215 | |
| 216 | 216 | /* Combine */ |
| 217 | | m_color_RAM.target()[offset] = data; |
| 217 | m_color_ram[offset] = data; |
| 218 | 218 | |
| 219 | 219 | /* Easy access */ |
| 220 | | highBits = m_color_RAM.target()[(palIndex<<1)+1] & 0x0f; |
| 221 | | lowBits = m_color_RAM.target()[(palIndex<<1)]; |
| 220 | highBits = m_color_ram[(palIndex<<1)+1] & 0x0f; |
| 221 | lowBits = m_color_ram[(palIndex<<1)]; |
| 222 | 222 | |
| 223 | 223 | /* 4-bit RGB */ |
| 224 | 224 | r = (lowBits & 0x0f); |
| r14899 | r14900 | |
| 233 | 233 | WRITE8_MEMBER(segald_state::astron_FIX_write) |
| 234 | 234 | { |
| 235 | 235 | |
| 236 | | m_fix_RAM.target()[offset] = data; |
| 236 | m_fix_ram[offset] = data; |
| 237 | 237 | /* logerror("FIX write : 0x%04x @ 0x%04x [0x%x]\n", data, offset, cpu_get_pc(&space.device())); */ |
| 238 | 238 | } |
| 239 | 239 | |
| r14899 | r14900 | |
| 251 | 251 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 252 | 252 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 253 | 253 | |
| 254 | | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_SHARE("obj_RAM") /* OBJ according to the schematics (sprite) */ |
| 254 | AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(astron_OBJ_read, astron_OBJ_write) AM_SHARE("obj_ram") /* OBJ according to the schematics (sprite) */ |
| 255 | 255 | AM_RANGE(0xc800, 0xcfff) AM_READWRITE(astron_DISC_read, astron_DISC_write) /* DISC interface according to schematics */ |
| 256 | 256 | AM_RANGE(0xd000, 0xd000) AM_READ_PORT("DSWA") /* SW bank 2 (DIPs) */ |
| 257 | 257 | AM_RANGE(0xd001, 0xd001) AM_READ_PORT("DSWB") /* SW bank 3 (DIPs) */ |
| 258 | 258 | AM_RANGE(0xd002, 0xd002) AM_READ_PORT("IN0") /* SW bank 0 (IO) */ |
| 259 | 259 | AM_RANGE(0xd003, 0xd003) AM_READ_PORT("IN1") /* SW bank 1 (IO) */ |
| 260 | | AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_SHARE("out_RAM") /* OUT according to schematics (output port) */ |
| 261 | | AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_SHARE("color_RAM") /* COLOR according to the schematics */ |
| 262 | | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_SHARE("fix_RAM") /* FIX according to schematics (characters) */ |
| 260 | AM_RANGE(0xd800, 0xd803) AM_READWRITE(astron_OUT_read, astron_OUT_write) AM_SHARE("out_ram") /* OUT according to schematics (output port) */ |
| 261 | AM_RANGE(0xe000, 0xe1ff) AM_READWRITE(astron_COLOR_read, astron_COLOR_write) AM_SHARE("color_ram") /* COLOR according to the schematics */ |
| 262 | AM_RANGE(0xf000, 0xf7ff) AM_WRITE(astron_FIX_write) AM_SHARE("fix_ram") /* FIX according to schematics (characters) */ |
| 263 | 263 | AM_RANGE(0xf800, 0xffff) AM_RAM /* RAM according to schematics */ |
| 264 | 264 | ADDRESS_MAP_END |
| 265 | 265 | |
src/mame/drivers/tickee.c
| r14899 | r14900 | |
| 113 | 113 | state->m_setup_gun_timer->adjust(machine.primary_screen->time_until_pos(0)); |
| 114 | 114 | |
| 115 | 115 | /* only do work if the palette is flashed */ |
| 116 | | if (state->m_control.target()) |
| 117 | | if (!state->m_control.target()[2]) |
| 116 | if (state->m_control) |
| 117 | if (!state->m_control[2]) |
| 118 | 118 | return; |
| 119 | 119 | |
| 120 | 120 | /* generate interrupts for player 1's gun */ |
| r14899 | r14900 | |
| 155 | 155 | static void scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) |
| 156 | 156 | { |
| 157 | 157 | tickee_state *state = screen.machine().driver_data<tickee_state>(); |
| 158 | | UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00]; |
| 158 | UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00]; |
| 159 | 159 | UINT32 *dest = &bitmap.pix32(scanline); |
| 160 | 160 | const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 161 | 161 | int coladdr = params->coladdr << 1; |
| 162 | 162 | int x; |
| 163 | 163 | |
| 164 | 164 | /* blank palette: fill with pen 255 */ |
| 165 | | if (state->m_control.target()[2]) |
| 165 | if (state->m_control[2]) |
| 166 | 166 | { |
| 167 | 167 | for (x = params->heblnk; x < params->hsblnk; x++) |
| 168 | 168 | dest[x] = pens[0xff]; |
| r14899 | r14900 | |
| 181 | 181 | static void rapidfir_scanline_update(screen_device &screen, bitmap_rgb32 &bitmap, int scanline, const tms34010_display_params *params) |
| 182 | 182 | { |
| 183 | 183 | tickee_state *state = screen.machine().driver_data<tickee_state>(); |
| 184 | | UINT16 *src = &state->m_vram.target()[(params->rowaddr << 8) & 0x3ff00]; |
| 184 | UINT16 *src = &state->m_vram[(params->rowaddr << 8) & 0x3ff00]; |
| 185 | 185 | UINT32 *dest = &bitmap.pix32(scanline); |
| 186 | 186 | const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076")); |
| 187 | 187 | int coladdr = params->coladdr << 1; |
| r14899 | r14900 | |
| 240 | 240 | { |
| 241 | 241 | if (!(data & 0xff00)) mem_mask &= 0x00ff; |
| 242 | 242 | if (!(data & 0x00ff)) mem_mask &= 0xff00; |
| 243 | | COMBINE_DATA(&m_vram.target()[offset]); |
| 243 | COMBINE_DATA(&m_vram[offset]); |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| 247 | 247 | READ16_MEMBER(tickee_state::rapidfir_transparent_r) |
| 248 | 248 | { |
| 249 | | return m_vram.target()[offset]; |
| 249 | return m_vram[offset]; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| r14899 | r14900 | |
| 254 | 254 | { |
| 255 | 255 | tickee_state *state = space->machine().driver_data<tickee_state>(); |
| 256 | 256 | if (address < 0x800000) |
| 257 | | memcpy(shiftreg, &state->m_vram.target()[TOWORD(address)], TOBYTE(0x2000)); |
| 257 | memcpy(shiftreg, &state->m_vram[TOWORD(address)], TOBYTE(0x2000)); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| r14899 | r14900 | |
| 262 | 262 | { |
| 263 | 263 | tickee_state *state = space->machine().driver_data<tickee_state>(); |
| 264 | 264 | if (address < 0x800000) |
| 265 | | memcpy(&state->m_vram.target()[TOWORD(address)], shiftreg, TOBYTE(0x2000)); |
| 265 | memcpy(&state->m_vram[TOWORD(address)], shiftreg, TOBYTE(0x2000)); |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | |
| r14899 | r14900 | |
| 275 | 275 | |
| 276 | 276 | WRITE16_MEMBER(tickee_state::tickee_control_w) |
| 277 | 277 | { |
| 278 | | UINT16 olddata = m_control.target()[offset]; |
| 278 | UINT16 olddata = m_control[offset]; |
| 279 | 279 | |
| 280 | 280 | /* offsets: |
| 281 | 281 | |
| r14899 | r14900 | |
| 284 | 284 | 6 = lamps? (changing all the time) |
| 285 | 285 | */ |
| 286 | 286 | |
| 287 | | COMBINE_DATA(&m_control.target()[offset]); |
| 287 | COMBINE_DATA(&m_control[offset]); |
| 288 | 288 | |
| 289 | 289 | if (offset == 3) |
| 290 | 290 | { |
| r14899 | r14900 | |
| 292 | 292 | machine().device<ticket_dispenser_device>("ticket2")->write(space, 0, (data & 4) << 5); |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | | if (olddata != m_control.target()[offset]) |
| 296 | | logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control.target()[offset], olddata); |
| 295 | if (olddata != m_control[offset]) |
| 296 | logerror("%08X:tickee_control_w(%d) = %04X (was %04X)\n", cpu_get_pc(&space.device()), offset, m_control[offset], olddata); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
src/mame/drivers/vcombat.c
| r14899 | r14900 | |
| 95 | 95 | public: |
| 96 | 96 | vcombat_state(const machine_config &mconfig, device_type type, const char *tag) |
| 97 | 97 | : driver_device(mconfig, type, tag) , |
| 98 | | m_vid_0_shared_RAM(*this, "vid_0_shared_RAM"), |
| 99 | | m_vid_1_shared_RAM(*this, "vid_1_shared_RAM"), |
| 100 | | m_framebuffer_ctrl(*this, "framebuffer_ctrl"){ } |
| 98 | m_vid_0_shared_ram(*this, "vid_0_ram"), |
| 99 | m_vid_1_shared_ram(*this, "vid_1_ram"), |
| 100 | m_framebuffer_ctrl(*this, "fb_control"){ } |
| 101 | 101 | |
| 102 | 102 | UINT16* m_m68k_framebuffer[2]; |
| 103 | 103 | UINT16* m_i860_framebuffer[2][2]; |
| 104 | | required_shared_ptr<UINT16> m_vid_0_shared_RAM; |
| 105 | | required_shared_ptr<UINT16> m_vid_1_shared_RAM; |
| 104 | required_shared_ptr<UINT16> m_vid_0_shared_ram; |
| 105 | required_shared_ptr<UINT16> m_vid_1_shared_ram; |
| 106 | 106 | required_shared_ptr<UINT16> m_framebuffer_ctrl; |
| 107 | 107 | int m_crtc_select; |
| 108 | 108 | DECLARE_WRITE16_MEMBER(main_video_write); |
| r14899 | r14900 | |
| 332 | 332 | AM_RANGE(0x200000, 0x20ffff) AM_RAM |
| 333 | 333 | AM_RANGE(0x300000, 0x30ffff) AM_WRITE(main_video_write) |
| 334 | 334 | |
| 335 | | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("vid_0_shared_RAM") AM_SHARE("share2") /* First i860 shared RAM */ |
| 335 | AM_RANGE(0x400000, 0x43ffff) AM_RAM AM_SHARE("vid_0_ram") /* First i860 shared RAM */ |
| 336 | 336 | AM_RANGE(0x440000, 0x440003) AM_RAM AM_SHARE("share6") /* M0->P0 i860 #1 com 1 */ |
| 337 | 337 | AM_RANGE(0x480000, 0x480003) AM_RAM AM_SHARE("share7") /* M0<-P0 i860 #1 com 2 */ |
| 338 | 338 | AM_RANGE(0x4c0000, 0x4c0003) AM_WRITE(wiggle_i860p0_pins_w) /* i860 #1 stop/start/reset */ |
| 339 | 339 | |
| 340 | | AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("vid_1_shared_RAM") AM_SHARE("share3") /* Second i860 shared RAM */ |
| 340 | AM_RANGE(0x500000, 0x53ffff) AM_RAM AM_SHARE("vid_1_ram") /* Second i860 shared RAM */ |
| 341 | 341 | AM_RANGE(0x540000, 0x540003) AM_RAM AM_SHARE("share8") /* M0->P1 i860 #2 com 1 */ |
| 342 | 342 | AM_RANGE(0x580000, 0x580003) AM_RAM AM_SHARE("share9") /* M0<-P1 i860 #2 com 2 */ |
| 343 | 343 | AM_RANGE(0x5c0000, 0x5c0003) AM_WRITE(wiggle_i860p1_pins_w) /* i860 #2 stop/start/reset */ |
| r14899 | r14900 | |
| 348 | 348 | AM_RANGE(0x60001c, 0x60001d) AM_NOP |
| 349 | 349 | |
| 350 | 350 | AM_RANGE(0x60000c, 0x60000d) AM_WRITE(crtc_w) |
| 351 | | AM_RANGE(0x600010, 0x600011) AM_RAM AM_SHARE("framebuffer_ctrl") |
| 351 | AM_RANGE(0x600010, 0x600011) AM_RAM AM_SHARE("fb_control") |
| 352 | 352 | AM_RANGE(0x700000, 0x7007ff) AM_RAM AM_SHARE("nvram") |
| 353 | 353 | AM_RANGE(0x701000, 0x701001) AM_READ(main_irqiack_r) |
| 354 | 354 | AM_RANGE(0x702000, 0x702001) AM_READ(control_3_r) |
| r14899 | r14900 | |
| 368 | 368 | AM_RANGE(0x40000000, 0x401fffff) AM_ROM AM_REGION("gfx", 0) |
| 369 | 369 | AM_RANGE(0x80000000, 0x80000007) AM_RAM AM_SHARE("share7") /* M0->P0 com 2 (0x480000 in 68k-land) */ |
| 370 | 370 | AM_RANGE(0xc0000000, 0xc0000fff) AM_NOP /* Dummy D$ flush page. */ |
| 371 | | AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("share2") /* Shared RAM with main */ |
| 371 | AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("vid_0_ram") /* Shared RAM with main */ |
| 372 | 372 | ADDRESS_MAP_END |
| 373 | 373 | |
| 374 | 374 | |
| r14899 | r14900 | |
| 379 | 379 | AM_RANGE(0x40000000, 0x401fffff) AM_ROM AM_REGION("gfx", 0) |
| 380 | 380 | AM_RANGE(0x80000000, 0x80000007) AM_RAM AM_SHARE("share9") /* M0<-P1 com 2 (0x580000 in 68k-land) */ |
| 381 | 381 | AM_RANGE(0xc0000000, 0xc0000fff) AM_NOP /* Dummy D$ flush page. */ |
| 382 | | AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("share3") /* Shared RAM with main */ |
| 382 | AM_RANGE(0xfffc0000, 0xffffffff) AM_RAM AM_SHARE("vid_1_ram") /* Shared RAM with main */ |
| 383 | 383 | ADDRESS_MAP_END |
| 384 | 384 | |
| 385 | 385 | |
| r14899 | r14900 | |
| 418 | 418 | vcombat_state *state = machine.driver_data<vcombat_state>(); |
| 419 | 419 | if (address >= 0xfffc0000 && address <= 0xffffffff) |
| 420 | 420 | { |
| 421 | | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_RAM.target()); |
| 421 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_0_shared_ram); |
| 422 | 422 | return ~0; |
| 423 | 423 | } |
| 424 | 424 | return address; |
| r14899 | r14900 | |
| 429 | 429 | vcombat_state *state = machine.driver_data<vcombat_state>(); |
| 430 | 430 | if (address >= 0xfffc0000 && address <= 0xffffffff) |
| 431 | 431 | { |
| 432 | | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_RAM.target()); |
| 432 | direct.explicit_configure(0xfffc0000, 0xffffffff, 0x3ffff, state->m_vid_1_shared_ram); |
| 433 | 433 | return ~0; |
| 434 | 434 | } |
| 435 | 435 | return address; |
src/mame/drivers/pkscram.c
| r14899 | r14900 | |
| 22 | 22 | public: |
| 23 | 23 | pkscram_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | 24 | : driver_device(mconfig, type, tag) , |
| 25 | | m_pkscramble_fgtilemap_ram(*this, "pkscramble_fgtilemap_ram"), |
| 26 | | m_pkscramble_mdtilemap_ram(*this, "pkscramble_mdtilemap_ram"), |
| 27 | | m_pkscramble_bgtilemap_ram(*this, "pkscramble_bgtilemap_ram"){ } |
| 25 | m_pkscramble_fgtilemap_ram(*this, "fgtilemap_ram"), |
| 26 | m_pkscramble_mdtilemap_ram(*this, "mdtilemap_ram"), |
| 27 | m_pkscramble_bgtilemap_ram(*this, "bgtilemap_ram"){ } |
| 28 | 28 | |
| 29 | 29 | UINT16 m_out; |
| 30 | 30 | UINT8 m_interrupt_line_active; |
| r14899 | r14900 | |
| 46 | 46 | |
| 47 | 47 | WRITE16_MEMBER(pkscram_state::pkscramble_fgtilemap_w) |
| 48 | 48 | { |
| 49 | | COMBINE_DATA(&m_pkscramble_fgtilemap_ram.target()[offset]); |
| 49 | COMBINE_DATA(&m_pkscramble_fgtilemap_ram[offset]); |
| 50 | 50 | m_fg_tilemap->mark_tile_dirty(offset >> 1); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | WRITE16_MEMBER(pkscram_state::pkscramble_mdtilemap_w) |
| 54 | 54 | { |
| 55 | | COMBINE_DATA(&m_pkscramble_mdtilemap_ram.target()[offset]); |
| 55 | COMBINE_DATA(&m_pkscramble_mdtilemap_ram[offset]); |
| 56 | 56 | m_md_tilemap->mark_tile_dirty(offset >> 1); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | WRITE16_MEMBER(pkscram_state::pkscramble_bgtilemap_w) |
| 60 | 60 | { |
| 61 | | COMBINE_DATA(&m_pkscramble_bgtilemap_ram.target()[offset]); |
| 61 | COMBINE_DATA(&m_pkscramble_bgtilemap_ram[offset]); |
| 62 | 62 | m_bg_tilemap->mark_tile_dirty(offset >> 1); |
| 63 | 63 | } |
| 64 | 64 | |
| r14899 | r14900 | |
| 102 | 102 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 103 | 103 | AM_RANGE(0x040000, 0x0400ff) AM_RAM AM_SHARE("nvram") |
| 104 | 104 | AM_RANGE(0x041000, 0x043fff) AM_RAM // main ram |
| 105 | | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_SHARE("pkscramble_fgtilemap_ram") // fg tilemap |
| 106 | | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_SHARE("pkscramble_mdtilemap_ram") // md tilemap (just a copy of fg?) |
| 107 | | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_SHARE("pkscramble_bgtilemap_ram") // bg tilemap |
| 105 | AM_RANGE(0x044000, 0x044fff) AM_RAM_WRITE(pkscramble_fgtilemap_w) AM_SHARE("fgtilemap_ram") // fg tilemap |
| 106 | AM_RANGE(0x045000, 0x045fff) AM_RAM_WRITE(pkscramble_mdtilemap_w) AM_SHARE("mdtilemap_ram") // md tilemap (just a copy of fg?) |
| 107 | AM_RANGE(0x046000, 0x046fff) AM_RAM_WRITE(pkscramble_bgtilemap_w) AM_SHARE("bgtilemap_ram") // bg tilemap |
| 108 | 108 | AM_RANGE(0x047000, 0x047fff) AM_RAM // unused |
| 109 | 109 | AM_RANGE(0x048000, 0x048fff) AM_RAM_WRITE(paletteram_xRRRRRGGGGGBBBBB_word_w) AM_SHARE("paletteram") |
| 110 | 110 | AM_RANGE(0x049000, 0x049001) AM_READ_PORT("DSW") |
| r14899 | r14900 | |
| 187 | 187 | static TILE_GET_INFO( get_bg_tile_info ) |
| 188 | 188 | { |
| 189 | 189 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 190 | | int tile = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2]; |
| 191 | | int color = state->m_pkscramble_bgtilemap_ram.target()[tile_index*2 + 1] & 0x7f; |
| 190 | int tile = state->m_pkscramble_bgtilemap_ram[tile_index*2]; |
| 191 | int color = state->m_pkscramble_bgtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 192 | 192 | |
| 193 | 193 | SET_TILE_INFO(0,tile,color,0); |
| 194 | 194 | } |
| r14899 | r14900 | |
| 196 | 196 | static TILE_GET_INFO( get_md_tile_info ) |
| 197 | 197 | { |
| 198 | 198 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 199 | | int tile = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2]; |
| 200 | | int color = state->m_pkscramble_mdtilemap_ram.target()[tile_index*2 + 1] & 0x7f; |
| 199 | int tile = state->m_pkscramble_mdtilemap_ram[tile_index*2]; |
| 200 | int color = state->m_pkscramble_mdtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 201 | 201 | |
| 202 | 202 | SET_TILE_INFO(0,tile,color,0); |
| 203 | 203 | } |
| r14899 | r14900 | |
| 205 | 205 | static TILE_GET_INFO( get_fg_tile_info ) |
| 206 | 206 | { |
| 207 | 207 | pkscram_state *state = machine.driver_data<pkscram_state>(); |
| 208 | | int tile = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2]; |
| 209 | | int color = state->m_pkscramble_fgtilemap_ram.target()[tile_index*2 + 1] & 0x7f; |
| 208 | int tile = state->m_pkscramble_fgtilemap_ram[tile_index*2]; |
| 209 | int color = state->m_pkscramble_fgtilemap_ram[tile_index*2 + 1] & 0x7f; |
| 210 | 210 | |
| 211 | 211 | SET_TILE_INFO(0,tile,color,0); |
| 212 | 212 | } |
src/mame/drivers/backfire.c
| r14899 | r14900 | |
| 119 | 119 | screen.machine().priority_bitmap.fill(0); |
| 120 | 120 | bitmap.fill(0x100, cliprect); |
| 121 | 121 | |
| 122 | | if (state->m_left_priority.target()[0] == 0) |
| 122 | if (state->m_left_priority[0] == 0) |
| 123 | 123 | { |
| 124 | 124 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 125 | 125 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 126 | 126 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800); |
| 127 | 127 | } |
| 128 | | else if (state->m_left_priority.target()[0] == 2) |
| 128 | else if (state->m_left_priority[0] == 2) |
| 129 | 129 | { |
| 130 | 130 | deco16ic_tilemap_1_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 131 | 131 | deco16ic_tilemap_1_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 132 | 132 | screen.machine().device<decospr_device>("spritegen")->draw_sprites(bitmap, cliprect, state->m_spriteram_1, 0x800); |
| 133 | 133 | } |
| 134 | 134 | else |
| 135 | | popmessage( "unknown left priority %08x", state->m_left_priority.target()[0]); |
| 135 | popmessage( "unknown left priority %08x", state->m_left_priority[0]); |
| 136 | 136 | |
| 137 | 137 | return 0; |
| 138 | 138 | } |
| r14899 | r14900 | |
| 152 | 152 | screen.machine().priority_bitmap.fill(0); |
| 153 | 153 | bitmap.fill(0x500, cliprect); |
| 154 | 154 | |
| 155 | | if (state->m_right_priority.target()[0] == 0) |
| 155 | if (state->m_right_priority[0] == 0) |
| 156 | 156 | { |
| 157 | 157 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 1); |
| 158 | 158 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 159 | 159 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800); |
| 160 | 160 | } |
| 161 | | else if (state->m_right_priority.target()[0] == 2) |
| 161 | else if (state->m_right_priority[0] == 2) |
| 162 | 162 | { |
| 163 | 163 | deco16ic_tilemap_2_draw(state->m_deco_tilegen1, bitmap, cliprect, 0, 2); |
| 164 | 164 | deco16ic_tilemap_2_draw(state->m_deco_tilegen2, bitmap, cliprect, 0, 4); |
| 165 | 165 | screen.machine().device<decospr_device>("spritegen2")->draw_sprites(bitmap, cliprect, state->m_spriteram_2, 0x800); |
| 166 | 166 | } |
| 167 | 167 | else |
| 168 | | popmessage( "unknown right priority %08x", state->m_right_priority.target()[0]); |
| 168 | popmessage( "unknown right priority %08x", state->m_right_priority[0]); |
| 169 | 169 | |
| 170 | 170 | return 0; |
| 171 | 171 | } |
| r14899 | r14900 | |
| 699 | 699 | if (cpu_get_pc(&space.device() )== 0xce44) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfire |
| 700 | 700 | if (cpu_get_pc(&space.device()) == 0xcee4) device_spin_until_time(&space.device(), attotime::from_usec(400)); // backfirea |
| 701 | 701 | |
| 702 | | return m_mainram.target()[0x18/4]; |
| 702 | return m_mainram[0x18/4]; |
| 703 | 703 | } |
| 704 | 704 | |
| 705 | 705 | |
src/mame/drivers/coolridr.c
| r14899 | r14900 | |
| 271 | 271 | m_soundcpu(*this,"soundcpu"), |
| 272 | 272 | m_h1_vram(*this, "h1_vram"), |
| 273 | 273 | m_h1_charram(*this, "h1_charram"), |
| 274 | | m_framebuffer_vram(*this, "framebuffer_vram"), |
| 274 | m_framebuffer_vram(*this, "fb_vram"), |
| 275 | 275 | m_txt_vram(*this, "txt_vram"), |
| 276 | 276 | m_sysh1_txt_blit(*this, "sysh1_txt_blit"), |
| 277 | 277 | m_sysh1_workram_h(*this, "sysh1_workrah"), |
| r14899 | r14900 | |
| 375 | 375 | { |
| 376 | 376 | int tile; |
| 377 | 377 | |
| 378 | | tile = (state->m_h1_vram.target()[count] & 0x0fff0000) >> 16; |
| 378 | tile = (state->m_h1_vram[count] & 0x0fff0000) >> 16; |
| 379 | 379 | drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+0)*16,y*16); |
| 380 | 380 | |
| 381 | | tile = (state->m_h1_vram.target()[count] & 0x00000fff) >> 0; |
| 381 | tile = (state->m_h1_vram[count] & 0x00000fff) >> 0; |
| 382 | 382 | drawgfx_opaque(bitmap,cliprect,gfx,tile,state->m_color,0,0,(x+1)*16,y*16); |
| 383 | 383 | |
| 384 | 384 | count++; |
| r14899 | r14900 | |
| 404 | 404 | |
| 405 | 405 | m_vblank^=1; |
| 406 | 406 | |
| 407 | | return (m_h1_unk.target()[offset] & 0xfdffffff) | (m_vblank<<25); |
| 407 | return (m_h1_unk[offset] & 0xfdffffff) | (m_vblank<<25); |
| 408 | 408 | } |
| 409 | 409 | case 0x14/4: |
| 410 | | return m_h1_unk.target()[offset]; |
| 410 | return m_h1_unk[offset]; |
| 411 | 411 | //case 0x20/4: |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | | return 0xffffffff;//m_h1_unk.target()[offset]; |
| 414 | return 0xffffffff;//m_h1_unk[offset]; |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | WRITE32_MEMBER(coolridr_state::sysh1_unk_w) |
| 418 | 418 | { |
| 419 | | COMBINE_DATA(&m_h1_unk.target()[offset]); |
| 419 | COMBINE_DATA(&m_h1_unk[offset]); |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | /* According to Guru, this is actually the same I/O chip of Sega Model 2 HW */ |
| r14899 | r14900 | |
| 438 | 438 | WRITE32_MEMBER(coolridr_state::sysh1_txt_blit_w) |
| 439 | 439 | { |
| 440 | 440 | |
| 441 | | COMBINE_DATA(&m_sysh1_txt_blit.target()[offset]); |
| 441 | COMBINE_DATA(&m_sysh1_txt_blit[offset]); |
| 442 | 442 | |
| 443 | 443 | switch(offset) |
| 444 | 444 | { |
| r14899 | r14900 | |
| 600 | 600 | end_dma_mark = 0; |
| 601 | 601 | |
| 602 | 602 | do{ |
| 603 | | src = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0x0fffffff); |
| 604 | | dst = (state->m_framebuffer_vram.target()[(4+dma_index)/4]); |
| 605 | | size = state->m_framebuffer_vram.target()[(8+dma_index)/4]; |
| 606 | | type = (state->m_framebuffer_vram.target()[(0+dma_index)/4] & 0xf0000000) >> 28; |
| 603 | src = (state->m_framebuffer_vram[(0+dma_index)/4] & 0x0fffffff); |
| 604 | dst = (state->m_framebuffer_vram[(4+dma_index)/4]); |
| 605 | size = state->m_framebuffer_vram[(8+dma_index)/4]; |
| 606 | type = (state->m_framebuffer_vram[(0+dma_index)/4] & 0xf0000000) >> 28; |
| 607 | 607 | |
| 608 | 608 | #if 0 |
| 609 | 609 | if(type == 0xc || type == 0xd || type == 0xe) |
| r14899 | r14900 | |
| 669 | 669 | |
| 670 | 670 | WRITE32_MEMBER(coolridr_state::sysh1_dma_w) |
| 671 | 671 | { |
| 672 | | COMBINE_DATA(&m_framebuffer_vram.target()[offset]); |
| 672 | COMBINE_DATA(&m_framebuffer_vram[offset]); |
| 673 | 673 | |
| 674 | 674 | if(offset*4 == 0x000) |
| 675 | 675 | { |
| 676 | | if((m_framebuffer_vram.target()[offset] & 0xff00000) == 0xfe00000) |
| 677 | | sysh1_dma_transfer(&space, m_framebuffer_vram.target()[offset] & 0xffff); |
| 676 | if((m_framebuffer_vram[offset] & 0xff00000) == 0xfe00000) |
| 677 | sysh1_dma_transfer(&space, m_framebuffer_vram[offset] & 0xffff); |
| 678 | 678 | } |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | WRITE32_MEMBER(coolridr_state::sysh1_char_w) |
| 682 | 682 | { |
| 683 | | COMBINE_DATA(&m_h1_charram.target()[offset]); |
| 683 | COMBINE_DATA(&m_h1_charram[offset]); |
| 684 | 684 | |
| 685 | 685 | { |
| 686 | 686 | UINT8 *gfx = machine().region("ram_gfx")->base(); |
| 687 | 687 | |
| 688 | | gfx[offset*4+0] = (m_h1_charram.target()[offset] & 0xff000000) >> 24; |
| 689 | | gfx[offset*4+1] = (m_h1_charram.target()[offset] & 0x00ff0000) >> 16; |
| 690 | | gfx[offset*4+2] = (m_h1_charram.target()[offset] & 0x0000ff00) >> 8; |
| 691 | | gfx[offset*4+3] = (m_h1_charram.target()[offset] & 0x000000ff) >> 0; |
| 688 | gfx[offset*4+0] = (m_h1_charram[offset] & 0xff000000) >> 24; |
| 689 | gfx[offset*4+1] = (m_h1_charram[offset] & 0x00ff0000) >> 16; |
| 690 | gfx[offset*4+2] = (m_h1_charram[offset] & 0x0000ff00) >> 8; |
| 691 | gfx[offset*4+3] = (m_h1_charram[offset] & 0x000000ff) >> 0; |
| 692 | 692 | |
| 693 | 693 | gfx_element_mark_dirty(machine().gfx[2], offset/64); //*4/256 |
| 694 | 694 | } |
| r14899 | r14900 | |
| 701 | 701 | AM_RANGE(0x03000000, 0x030fffff) AM_RAM AM_SHARE("h1_vram")//bg vram |
| 702 | 702 | AM_RANGE(0x03c00000, 0x03c0ffff) AM_RAM_WRITE(sysh1_pal_w) AM_SHARE("paletteram") |
| 703 | 703 | AM_RANGE(0x03d00000, 0x03dfffff) AM_RAM_WRITE(sysh1_char_w) AM_SHARE("h1_charram") //FIXME: half size |
| 704 | | AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("framebuffer_vram") //FIXME: not all of it |
| 704 | AM_RANGE(0x03e00000, 0x03efffff) AM_RAM_WRITE(sysh1_dma_w) AM_SHARE("fb_vram") //FIXME: not all of it |
| 705 | 705 | |
| 706 | 706 | AM_RANGE(0x03f00000, 0x03f0ffff) AM_RAM AM_SHARE("share3") /*Communication area RAM*/ |
| 707 | 707 | AM_RANGE(0x03f40000, 0x03f4ffff) AM_RAM AM_SHARE("txt_vram")//text tilemap + "lineram" |
| r14899 | r14900 | |
| 1235 | 1235 | if(pc == 0x6012374 || pc == 0x6012392) |
| 1236 | 1236 | return 0; |
| 1237 | 1237 | |
| 1238 | | return m_sysh1_workram_h.target()[0xd88a4/4]; |
| 1238 | return m_sysh1_workram_h[0xd88a4/4]; |
| 1239 | 1239 | } |
| 1240 | 1240 | #endif |
| 1241 | 1241 | |
| r14899 | r14900 | |
| 1246 | 1246 | if(pc == 0x6002cba || pc == 0x6002d42) |
| 1247 | 1247 | return 0; |
| 1248 | 1248 | |
| 1249 | | return m_sysh1_workram_h.target()[0xd8894/4]; |
| 1249 | return m_sysh1_workram_h[0xd8894/4]; |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | static DRIVER_INIT( coolridr ) |
src/mame/drivers/sfbonus.c
| r14899 | r14900 | |
| 808 | 808 | UINT8* selectbase = &state->m_videoram[0x600]; |
| 809 | 809 | UINT8* bg_scroll = &state->m_videoram[0x000]; |
| 810 | 810 | UINT8* reels_rowscroll = &state->m_videoram[0x400]; |
| 811 | | int globalyscrollreels = (state->m_vregs.target()[6] | state->m_vregs.target()[7]<<8); |
| 812 | | int globalxscrollreels = (state->m_vregs.target()[4] | state->m_vregs.target()[5]<<8); |
| 811 | int globalyscrollreels = (state->m_vregs[6] | state->m_vregs[7]<<8); |
| 812 | int globalxscrollreels = (state->m_vregs[4] | state->m_vregs[5]<<8); |
| 813 | 813 | globalyscrollreels += 8; |
| 814 | 814 | globalxscrollreels += 8; |
| 815 | 815 | |
| r14899 | r14900 | |
| 938 | 938 | { |
| 939 | 939 | sfbonus_state *state = screen.machine().driver_data<sfbonus_state>(); |
| 940 | 940 | |
| 941 | | int globalyscroll = (state->m_vregs.target()[2] | state->m_vregs.target()[3]<<8); |
| 942 | | int globalxscroll = (state->m_vregs.target()[0] | state->m_vregs.target()[1]<<8); |
| 941 | int globalyscroll = (state->m_vregs[2] | state->m_vregs[3]<<8); |
| 942 | int globalxscroll = (state->m_vregs[0] | state->m_vregs[1]<<8); |
| 943 | 943 | UINT8* front_rowscroll = &state->m_videoram[0x200]; |
| 944 | 944 | ioport_constructor ipt; |
| 945 | 945 | int i; |
| r14899 | r14900 | |
| 997 | 997 | } |
| 998 | 998 | #if 0 |
| 999 | 999 | 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 %02x %02x %02x", |
| 1000 | | state->m_3800_regs.target()[0], |
| 1001 | | state->m_3800_regs.target()[1], |
| 1002 | | state->m_3800_regs.target()[2], |
| 1003 | | state->m_3800_regs.target()[3], |
| 1004 | | state->m_3800_regs.target()[4], |
| 1005 | | state->m_3800_regs.target()[5], |
| 1006 | | state->m_3800_regs.target()[6], |
| 1007 | | state->m_3800_regs.target()[7], |
| 1008 | | state->m_3000_regs.target()[0], |
| 1009 | | state->m_2801_regs.target()[0], |
| 1010 | | state->m_2c01_regs.target()[0], |
| 1011 | | state->m_vregs.target()[8], |
| 1012 | | state->m_vregs.target()[0], |
| 1013 | | state->m_vregs.target()[10], |
| 1014 | | state->m_vregs.target()[11], |
| 1015 | | state->m_vregs.target()[12], |
| 1016 | | state->m_vregs.target()[13], |
| 1017 | | state->m_vregs.target()[14], |
| 1018 | | state->m_vregs.target()[15], |
| 1019 | | state->m_vregs.target()[16], |
| 1020 | | state->m_vregs.target()[17], |
| 1021 | | state->m_vregs.target()[18], |
| 1022 | | state->m_vregs.target()[19], |
| 1023 | | state->m_vregs.target()[20], |
| 1024 | | state->m_vregs.target()[21], |
| 1025 | | state->m_vregs.target()[22], |
| 1026 | | state->m_vregs.target()[23], |
| 1027 | | state->m_vregs.target()[24], |
| 1028 | | state->m_vregs.target()[25], |
| 1029 | | state->m_vregs.target()[26], |
| 1030 | | state->m_vregs.target()[27], |
| 1031 | | state->m_vregs.target()[28], |
| 1032 | | state->m_vregs.target()[29], |
| 1033 | | state->m_vregs.target()[30], |
| 1034 | | state->m_vregs.target()[31] |
| 1000 | state->m_3800_regs[0], |
| 1001 | state->m_3800_regs[1], |
| 1002 | state->m_3800_regs[2], |
| 1003 | state->m_3800_regs[3], |
| 1004 | state->m_3800_regs[4], |
| 1005 | state->m_3800_regs[5], |
| 1006 | state->m_3800_regs[6], |
| 1007 | state->m_3800_regs[7], |
| 1008 | state->m_3000_regs[0], |
| 1009 | state->m_2801_regs[0], |
| 1010 | state->m_2c01_regs[0], |
| 1011 | state->m_vregs[8], |
| 1012 | state->m_vregs[0], |
| 1013 | state->m_vregs[10], |
| 1014 | state->m_vregs[11], |
| 1015 | state->m_vregs[12], |
| 1016 | state->m_vregs[13], |
| 1017 | state->m_vregs[14], |
| 1018 | state->m_vregs[15], |
| 1019 | state->m_vregs[16], |
| 1020 | state->m_vregs[17], |
| 1021 | state->m_vregs[18], |
| 1022 | state->m_vregs[19], |
| 1023 | state->m_vregs[20], |
| 1024 | state->m_vregs[21], |
| 1025 | state->m_vregs[22], |
| 1026 | state->m_vregs[23], |
| 1027 | state->m_vregs[24], |
| 1028 | state->m_vregs[25], |
| 1029 | state->m_vregs[26], |
| 1030 | state->m_vregs[27], |
| 1031 | state->m_vregs[28], |
| 1032 | state->m_vregs[29], |
| 1033 | state->m_vregs[30], |
| 1034 | state->m_vregs[31] |
| 1035 | 1035 | ); |
| 1036 | 1036 | |
| 1037 | 1037 | popmessage("-- %02x %02x %02x %02x %02x %02x %02x %02x", |
| 1038 | | state->m_1800_regs.target()[0], |
| 1039 | | state->m_1800_regs.target()[1], |
| 1040 | | state->m_1800_regs.target()[2], |
| 1041 | | state->m_1800_regs.target()[3], |
| 1042 | | state->m_1800_regs.target()[4], |
| 1043 | | state->m_1800_regs.target()[5], |
| 1044 | | state->m_1800_regs.target()[6], |
| 1045 | | state->m_1800_regs.target()[7]); |
| 1038 | state->m_1800_regs[0], |
| 1039 | state->m_1800_regs[1], |
| 1040 | state->m_1800_regs[2], |
| 1041 | state->m_1800_regs[3], |
| 1042 | state->m_1800_regs[4], |
| 1043 | state->m_1800_regs[5], |
| 1044 | state->m_1800_regs[6], |
| 1045 | state->m_1800_regs[7]); |
| 1046 | 1046 | #endif |
| 1047 | 1047 | |
| 1048 | 1048 | ipt = screen.machine().system().ipt; |
| r14899 | r14900 | |
| 1050 | 1050 | || (ipt == INPUT_PORTS_NAME(amcoe2_poker))) |
| 1051 | 1051 | { |
| 1052 | 1052 | // based on pirpok2 |
| 1053 | | output_set_lamp_value(0, (state->m_1800_regs.target()[6] & 0x1) >> 0); |
| 1054 | | output_set_lamp_value(1, (state->m_1800_regs.target()[6] & 0x4) >> 2); |
| 1055 | | output_set_lamp_value(2, (state->m_1800_regs.target()[5] & 0x4) >> 2); |
| 1056 | | output_set_lamp_value(3, (state->m_1800_regs.target()[5] & 0x1) >> 0); |
| 1057 | | output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2); |
| 1058 | | output_set_lamp_value(5, (state->m_1800_regs.target()[4] & 0x1) >> 0); |
| 1053 | output_set_lamp_value(0, (state->m_1800_regs[6] & 0x1) >> 0); |
| 1054 | output_set_lamp_value(1, (state->m_1800_regs[6] & 0x4) >> 2); |
| 1055 | output_set_lamp_value(2, (state->m_1800_regs[5] & 0x4) >> 2); |
| 1056 | output_set_lamp_value(3, (state->m_1800_regs[5] & 0x1) >> 0); |
| 1057 | output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2); |
| 1058 | output_set_lamp_value(5, (state->m_1800_regs[4] & 0x1) >> 0); |
| 1059 | 1059 | } |
| 1060 | 1060 | else if ((ipt == INPUT_PORTS_NAME(amcoe1_reels3)) || (ipt == INPUT_PORTS_NAME(amcoe1_reels4)) |
| 1061 | 1061 | || (ipt == INPUT_PORTS_NAME(amcoe1_poker))) |
| 1062 | 1062 | { |
| 1063 | | output_set_lamp_value(0, (state->m_1800_regs.target()[0] & 0x2) >> 1); |
| 1064 | | output_set_lamp_value(1, (state->m_1800_regs.target()[4] & 0x2) >> 1); |
| 1065 | | output_set_lamp_value(2, (state->m_1800_regs.target()[3] & 0x2) >> 1); |
| 1066 | | output_set_lamp_value(3, (state->m_1800_regs.target()[6] & 0x4) >> 2); |
| 1067 | | output_set_lamp_value(4, (state->m_1800_regs.target()[4] & 0x4) >> 2); |
| 1068 | | output_set_lamp_value(5, (state->m_1800_regs.target()[3] & 0x4) >> 2); |
| 1063 | output_set_lamp_value(0, (state->m_1800_regs[0] & 0x2) >> 1); |
| 1064 | output_set_lamp_value(1, (state->m_1800_regs[4] & 0x2) >> 1); |
| 1065 | output_set_lamp_value(2, (state->m_1800_regs[3] & 0x2) >> 1); |
| 1066 | output_set_lamp_value(3, (state->m_1800_regs[6] & 0x4) >> 2); |
| 1067 | output_set_lamp_value(4, (state->m_1800_regs[4] & 0x4) >> 2); |
| 1068 | output_set_lamp_value(5, (state->m_1800_regs[3] & 0x4) >> 2); |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | return 0; |
| r14899 | r14900 | |
| 1119 | 1119 | // lamps and coin counters |
| 1120 | 1120 | WRITE8_MEMBER(sfbonus_state::sfbonus_1800_w) |
| 1121 | 1121 | { |
| 1122 | | m_1800_regs.target()[offset] = data; |
| 1122 | m_1800_regs[offset] = data; |
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | WRITE8_MEMBER(sfbonus_state::sfbonus_3800_w) |
| 1126 | 1126 | { |
| 1127 | | m_3800_regs.target()[offset] = data; |
| 1127 | m_3800_regs[offset] = data; |
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | WRITE8_MEMBER(sfbonus_state::sfbonus_3000_w) |
| 1131 | 1131 | { |
| 1132 | | m_3000_regs.target()[offset] = data; |
| 1132 | m_3000_regs[offset] = data; |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | WRITE8_MEMBER(sfbonus_state::sfbonus_2801_w) |
| 1136 | 1136 | { |
| 1137 | | m_2801_regs.target()[offset] = data; |
| 1137 | m_2801_regs[offset] = data; |
| 1138 | 1138 | } |
| 1139 | 1139 | |
| 1140 | 1140 | WRITE8_MEMBER(sfbonus_state::sfbonus_2c01_w) |
| 1141 | 1141 | { |
| 1142 | | m_2c01_regs.target()[offset] = data; |
| 1142 | m_2c01_regs[offset] = data; |
| 1143 | 1143 | } |
| 1144 | 1144 | |
| 1145 | 1145 | |
src/mame/drivers/crystal.c
| r14899 | r14900 | |
| 135 | 135 | m_vidregs(*this, "vidregs"), |
| 136 | 136 | m_textureram(*this, "textureram"), |
| 137 | 137 | m_frameram(*this, "frameram"), |
| 138 | | m_ResetPatch(*this, "ResetPatch"){ } |
| 138 | m_reset_patch(*this, "reset_patch"){ } |
| 139 | 139 | |
| 140 | 140 | /* memory pointers */ |
| 141 | 141 | required_shared_ptr<UINT32> m_sysregs; |
| r14899 | r14900 | |
| 143 | 143 | required_shared_ptr<UINT32> m_vidregs; |
| 144 | 144 | required_shared_ptr<UINT32> m_textureram; |
| 145 | 145 | required_shared_ptr<UINT32> m_frameram; |
| 146 | | required_shared_ptr<UINT32> m_ResetPatch; |
| 146 | required_shared_ptr<UINT32> m_reset_patch; |
| 147 | 147 | // UINT32 * m_nvram; // currently this uses generic nvram handling |
| 148 | 148 | |
| 149 | 149 | #ifdef IDLE_LOOP_SPEEDUP |
| r14899 | r14900 | |
| 508 | 508 | AM_RANGE(0x05000000, 0x05000003) AM_READWRITE(FlashCmd_r, FlashCmd_w) |
| 509 | 509 | AM_RANGE(0x05000000, 0x05ffffff) AM_ROMBANK("bank1") |
| 510 | 510 | |
| 511 | | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_SHARE("ResetPatch") |
| 511 | AM_RANGE(0x44414F4C, 0x44414F7F) AM_RAM AM_SHARE("reset_patch") |
| 512 | 512 | |
| 513 | 513 | ADDRESS_MAP_END |
| 514 | 514 | |
| r14899 | r14900 | |
| 549 | 549 | 0xdef4d4fa |
| 550 | 550 | }; |
| 551 | 551 | |
| 552 | | memcpy(state->m_ResetPatch, Patch, sizeof(Patch)); |
| 552 | memcpy(state->m_reset_patch, Patch, sizeof(Patch)); |
| 553 | 553 | #else |
| 554 | 554 | static const UINT8 Patch[] = |
| 555 | 555 | { |
| r14899 | r14900 | |
| 558 | 558 | 0x20,0x3A,0xD0,0xA1,0xFA,0xD4,0xF4,0xDE |
| 559 | 559 | }; |
| 560 | 560 | |
| 561 | | memcpy(state->m_ResetPatch, Patch, sizeof(Patch)); |
| 561 | memcpy(state->m_reset_patch, Patch, sizeof(Patch)); |
| 562 | 562 | #endif |
| 563 | 563 | } |
| 564 | 564 | |
| r14899 | r14900 | |
| 626 | 626 | state->m_Timer[i]->adjust(attotime::never); |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | | vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram.target()); |
| 629 | vr0_snd_set_areas(machine.device("vrender"), state->m_textureram, state->m_frameram); |
| 630 | 630 | #ifdef IDLE_LOOP_SPEEDUP |
| 631 | 631 | state->m_FlipCntRead = 0; |
| 632 | 632 | #endif |
| r14899 | r14900 | |
| 672 | 672 | } |
| 673 | 673 | |
| 674 | 674 | Visible = (UINT16*) Front; |
| 675 | | DrawDest = (UINT16 *) state->m_frameram.target(); |
| 675 | // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros! |
| 676 | DrawDest = reinterpret_cast<UINT16 *>(state->m_frameram.target()); |
| 676 | 677 | |
| 677 | 678 | |
| 678 | 679 | if (GetVidReg(space, 0x8c) & 0x80) |
| r14899 | r14900 | |
| 689 | 690 | tail = GetVidReg(space, 0x80); |
| 690 | 691 | while ((head & 0x7ff) != (tail & 0x7ff)) |
| 691 | 692 | { |
| 692 | | DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, (UINT8*)state->m_textureram.target()); |
| 693 | // ERROR: This cast is NOT endian-safe without the use of BYTE/WORD/DWORD_XOR_* macros! |
| 694 | DoFlip = vrender0_ProcessPacket(state->m_vr0video, 0x03800000 + head * 64, DrawDest, reinterpret_cast<UINT8*>(state->m_textureram.target())); |
| 693 | 695 | head++; |
| 694 | 696 | head &= 0x7ff; |
| 695 | 697 | if (DoFlip) |
src/mame/drivers/tmmjprd.c
| r14899 | r14900 | |
| 39 | 39 | { |
| 40 | 40 | public: |
| 41 | 41 | tmmjprd_state(const machine_config &mconfig, device_type type, const char *tag) |
| 42 | | : driver_device(mconfig, type, tag) { } |
| 42 | : driver_device(mconfig, type, tag), |
| 43 | m_tilemap_regs(*this, "tilemap_regs"), |
| 44 | m_spriteregs(*this, "spriteregs"), |
| 45 | m_spriteram(*this, "spriteram") { } |
| 43 | 46 | |
| 44 | | UINT32 *m_tilemap_regs[4]; |
| 45 | | UINT32 *m_spriteregs; |
| 47 | required_shared_ptr_array<UINT32, 4> m_tilemap_regs; |
| 48 | required_shared_ptr<UINT32> m_spriteregs; |
| 46 | 49 | UINT32 *m_tilemap_ram[4]; |
| 47 | | UINT32 *m_spriteram; |
| 50 | required_shared_ptr<UINT32> m_spriteram; |
| 48 | 51 | UINT8 m_mux_data; |
| 49 | 52 | UINT8 m_system_in; |
| 50 | 53 | double m_old_brt1; |
| r14899 | r14900 | |
| 672 | 675 | AM_RANGE(0x200984, 0x200987) AM_READ(randomtmmjprds) // sound chip status? |
| 673 | 676 | /* check these are used .. */ |
| 674 | 677 | // AM_RANGE(0x200010, 0x200013) AM_WRITEONLY AM_BASE_LEGACY(&tmmjprd_viewregs0 ) |
| 675 | | AM_RANGE(0x200100, 0x200117) AM_WRITEONLY AM_BASE(m_tilemap_regs[0] ) // tilemap regs1 |
| 676 | | AM_RANGE(0x200120, 0x200137) AM_WRITEONLY AM_BASE(m_tilemap_regs[1] ) // tilemap regs2 |
| 677 | | AM_RANGE(0x200140, 0x200157) AM_WRITEONLY AM_BASE(m_tilemap_regs[2] ) // tilemap regs3 |
| 678 | | AM_RANGE(0x200160, 0x200177) AM_WRITEONLY AM_BASE(m_tilemap_regs[3] ) // tilemap regs4 |
| 679 | | AM_RANGE(0x200200, 0x20021b) AM_WRITEONLY AM_BASE(m_spriteregs ) // sprregs? |
| 678 | AM_RANGE(0x200100, 0x200117) AM_WRITEONLY AM_SHARE("tilemap_regs.0" ) // tilemap regs1 |
| 679 | AM_RANGE(0x200120, 0x200137) AM_WRITEONLY AM_SHARE("tilemap_regs.1" ) // tilemap regs2 |
| 680 | AM_RANGE(0x200140, 0x200157) AM_WRITEONLY AM_SHARE("tilemap_regs.2" ) // tilemap regs3 |
| 681 | AM_RANGE(0x200160, 0x200177) AM_WRITEONLY AM_SHARE("tilemap_regs.3" ) // tilemap regs4 |
| 682 | AM_RANGE(0x200200, 0x20021b) AM_WRITEONLY AM_SHARE("spriteregs" ) // sprregs? |
| 680 | 683 | // AM_RANGE(0x200300, 0x200303) AM_WRITE_LEGACY(tmmjprd_rombank_w) // used during rom testing, rombank/area select + something else? |
| 681 | 684 | AM_RANGE(0x20040c, 0x20040f) AM_WRITE(tmmjprd_brt_1_w) |
| 682 | 685 | AM_RANGE(0x200410, 0x200413) AM_WRITE(tmmjprd_brt_2_w) |
| r14899 | r14900 | |
| 692 | 695 | AM_RANGE(0x288000, 0x28bfff) AM_READWRITE(tmmjprd_tilemap2_r,tmmjprd_tilemap2_w) |
| 693 | 696 | AM_RANGE(0x28c000, 0x28ffff) AM_READWRITE(tmmjprd_tilemap3_r,tmmjprd_tilemap3_w) |
| 694 | 697 | /* ?? is palette ram shared with sprites in this case or just a different map */ |
| 695 | | AM_RANGE(0x290000, 0x29bfff) AM_RAM AM_BASE(m_spriteram) |
| 698 | AM_RANGE(0x290000, 0x29bfff) AM_RAM AM_SHARE("spriteram") |
| 696 | 699 | AM_RANGE(0x29c000, 0x29ffff) AM_RAM_WRITE(tmmjprd_paletteram_dword_w) AM_SHARE("paletteram") |
| 697 | 700 | |
| 698 | 701 | AM_RANGE(0x400000, 0x400003) AM_READ(tmmjprd_mux_r) AM_DEVWRITE_LEGACY("eeprom", tmmjprd_eeprom_write) |
src/mame/drivers/witch.c
| r14899 | r14900 | |
| 239 | 239 | static TILE_GET_INFO( get_gfx0b_tile_info ) |
| 240 | 240 | { |
| 241 | 241 | witch_state *state = machine.driver_data<witch_state>(); |
| 242 | | int code = state->m_gfx0_vram.target()[tile_index]; |
| 243 | | int color = state->m_gfx0_cram.target()[tile_index]; |
| 242 | int code = state->m_gfx0_vram[tile_index]; |
| 243 | int color = state->m_gfx0_cram[tile_index]; |
| 244 | 244 | |
| 245 | 245 | code=code | ((color & 0xe0) << 3); |
| 246 | 246 | |
| r14899 | r14900 | |
| 259 | 259 | static TILE_GET_INFO( get_gfx0a_tile_info ) |
| 260 | 260 | { |
| 261 | 261 | witch_state *state = machine.driver_data<witch_state>(); |
| 262 | | int code = state->m_gfx0_vram.target()[tile_index]; |
| 263 | | int color = state->m_gfx0_cram.target()[tile_index]; |
| 262 | int code = state->m_gfx0_vram[tile_index]; |
| 263 | int color = state->m_gfx0_cram[tile_index]; |
| 264 | 264 | |
| 265 | 265 | code=code | ((color & 0xe0) << 3); |
| 266 | 266 | |
| r14899 | r14900 | |
| 279 | 279 | static TILE_GET_INFO( get_gfx1_tile_info ) |
| 280 | 280 | { |
| 281 | 281 | witch_state *state = machine.driver_data<witch_state>(); |
| 282 | | int code = state->m_gfx1_vram.target()[tile_index]; |
| 283 | | int color = state->m_gfx1_cram.target()[tile_index]; |
| 282 | int code = state->m_gfx1_vram[tile_index]; |
| 283 | int color = state->m_gfx1_cram[tile_index]; |
| 284 | 284 | |
| 285 | 285 | SET_TILE_INFO( |
| 286 | 286 | 0, |
| r14899 | r14900 | |
| 291 | 291 | |
| 292 | 292 | WRITE8_MEMBER(witch_state::gfx0_vram_w) |
| 293 | 293 | { |
| 294 | | m_gfx0_vram.target()[offset] = data; |
| 294 | m_gfx0_vram[offset] = data; |
| 295 | 295 | m_gfx0a_tilemap->mark_tile_dirty(offset); |
| 296 | 296 | m_gfx0b_tilemap->mark_tile_dirty(offset); |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | WRITE8_MEMBER(witch_state::gfx0_cram_w) |
| 300 | 300 | { |
| 301 | | m_gfx0_cram.target()[offset] = data; |
| 301 | m_gfx0_cram[offset] = data; |
| 302 | 302 | m_gfx0a_tilemap->mark_tile_dirty(offset); |
| 303 | 303 | m_gfx0b_tilemap->mark_tile_dirty(offset); |
| 304 | 304 | } |
| 305 | 305 | READ8_MEMBER(witch_state::gfx0_vram_r) |
| 306 | 306 | { |
| 307 | | return m_gfx0_vram.target()[offset]; |
| 307 | return m_gfx0_vram[offset]; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | READ8_MEMBER(witch_state::gfx0_cram_r) |
| 311 | 311 | { |
| 312 | | return m_gfx0_cram.target()[offset]; |
| 312 | return m_gfx0_cram[offset]; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | #define FIX_OFFSET() do { \ |
| r14899 | r14900 | |
| 318 | 318 | WRITE8_MEMBER(witch_state::gfx1_vram_w) |
| 319 | 319 | { |
| 320 | 320 | FIX_OFFSET(); |
| 321 | | m_gfx1_vram.target()[offset] = data; |
| 321 | m_gfx1_vram[offset] = data; |
| 322 | 322 | m_gfx1_tilemap->mark_tile_dirty(offset); |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | WRITE8_MEMBER(witch_state::gfx1_cram_w) |
| 326 | 326 | { |
| 327 | 327 | FIX_OFFSET(); |
| 328 | | m_gfx1_cram.target()[offset] = data; |
| 328 | m_gfx1_cram[offset] = data; |
| 329 | 329 | m_gfx1_tilemap->mark_tile_dirty(offset); |
| 330 | 330 | } |
| 331 | 331 | READ8_MEMBER(witch_state::gfx1_vram_r) |
| 332 | 332 | { |
| 333 | 333 | FIX_OFFSET(); |
| 334 | | return m_gfx1_vram.target()[offset]; |
| 334 | return m_gfx1_vram[offset]; |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | READ8_MEMBER(witch_state::gfx1_cram_r) |
| 338 | 338 | { |
| 339 | 339 | FIX_OFFSET(); |
| 340 | | return m_gfx1_cram.target()[offset]; |
| 340 | return m_gfx1_cram[offset]; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | READ8_MEMBER(witch_state::read_a00x) |
| r14899 | r14900 | |
| 724 | 724 | for(i=0;i<0x800;i+=0x20) { |
| 725 | 725 | |
| 726 | 726 | |
| 727 | | sx = state->m_sprite_ram.target()[i+1]; |
| 727 | sx = state->m_sprite_ram[i+1]; |
| 728 | 728 | if(sx!=0xF8) { |
| 729 | | tileno = (state->m_sprite_ram.target()[i]<<2) | (( state->m_sprite_ram.target()[i+0x800] & 0x07 ) << 10 ); |
| 729 | tileno = (state->m_sprite_ram[i]<<2) | (( state->m_sprite_ram[i+0x800] & 0x07 ) << 10 ); |
| 730 | 730 | |
| 731 | | sy = state->m_sprite_ram.target()[i+2]; |
| 732 | | flags = state->m_sprite_ram.target()[i+3]; |
| 731 | sy = state->m_sprite_ram[i+2]; |
| 732 | flags = state->m_sprite_ram[i+3]; |
| 733 | 733 | |
| 734 | 734 | flipx = (flags & 0x10 ) ? 1 : 0; |
| 735 | 735 | flipy = (flags & 0x20 ) ? 1 : 0; |
src/mame/drivers/luckgrln.c
| r14899 | r14900 | |
| 149 | 149 | |
| 150 | 150 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_ram_w) |
| 151 | 151 | { |
| 152 | | m_reel1_ram.target()[offset] = data; |
| 152 | m_reel1_ram[offset] = data; |
| 153 | 153 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel1_attr_w) |
| 157 | 157 | { |
| 158 | | m_reel1_attr.target()[offset] = data; |
| 158 | m_reel1_attr[offset] = data; |
| 159 | 159 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 160 | 160 | } |
| 161 | 161 | |
| r14899 | r14900 | |
| 164 | 164 | static TILE_GET_INFO( get_luckgrln_reel1_tile_info ) |
| 165 | 165 | { |
| 166 | 166 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 167 | | int code = state->m_reel1_ram.target()[tile_index]; |
| 168 | | int attr = state->m_reel1_attr.target()[tile_index]; |
| 167 | int code = state->m_reel1_ram[tile_index]; |
| 168 | int attr = state->m_reel1_attr[tile_index]; |
| 169 | 169 | int col = (attr & 0x1f); |
| 170 | 170 | |
| 171 | 171 | code |= (attr & 0xe0)<<3; |
| r14899 | r14900 | |
| 181 | 181 | |
| 182 | 182 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_ram_w) |
| 183 | 183 | { |
| 184 | | m_reel2_ram.target()[offset] = data; |
| 184 | m_reel2_ram[offset] = data; |
| 185 | 185 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel2_attr_w) |
| 189 | 189 | { |
| 190 | | m_reel2_attr.target()[offset] = data; |
| 190 | m_reel2_attr[offset] = data; |
| 191 | 191 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 192 | 192 | } |
| 193 | 193 | |
| r14899 | r14900 | |
| 195 | 195 | static TILE_GET_INFO( get_luckgrln_reel2_tile_info ) |
| 196 | 196 | { |
| 197 | 197 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 198 | | int code = state->m_reel2_ram.target()[tile_index]; |
| 199 | | int attr = state->m_reel2_attr.target()[tile_index]; |
| 198 | int code = state->m_reel2_ram[tile_index]; |
| 199 | int attr = state->m_reel2_attr[tile_index]; |
| 200 | 200 | int col = (attr & 0x1f); |
| 201 | 201 | |
| 202 | 202 | code |= (attr & 0xe0)<<3; |
| r14899 | r14900 | |
| 211 | 211 | |
| 212 | 212 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_ram_w) |
| 213 | 213 | { |
| 214 | | m_reel3_ram.target()[offset] = data; |
| 214 | m_reel3_ram[offset] = data; |
| 215 | 215 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel3_attr_w) |
| 219 | 219 | { |
| 220 | | m_reel3_attr.target()[offset] = data; |
| 220 | m_reel3_attr[offset] = data; |
| 221 | 221 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 222 | 222 | } |
| 223 | 223 | |
| r14899 | r14900 | |
| 225 | 225 | static TILE_GET_INFO( get_luckgrln_reel3_tile_info ) |
| 226 | 226 | { |
| 227 | 227 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 228 | | int code = state->m_reel3_ram.target()[tile_index]; |
| 229 | | int attr = state->m_reel3_attr.target()[tile_index]; |
| 228 | int code = state->m_reel3_ram[tile_index]; |
| 229 | int attr = state->m_reel3_attr[tile_index]; |
| 230 | 230 | int col = (attr & 0x1f); |
| 231 | 231 | |
| 232 | 232 | code |= (attr & 0xe0)<<3; |
| r14899 | r14900 | |
| 240 | 240 | |
| 241 | 241 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_ram_w) |
| 242 | 242 | { |
| 243 | | m_reel4_ram.target()[offset] = data; |
| 243 | m_reel4_ram[offset] = data; |
| 244 | 244 | m_reel4_tilemap->mark_tile_dirty(offset); |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | WRITE8_MEMBER(luckgrln_state::luckgrln_reel4_attr_w) |
| 248 | 248 | { |
| 249 | | m_reel4_attr.target()[offset] = data; |
| 249 | m_reel4_attr[offset] = data; |
| 250 | 250 | m_reel4_tilemap->mark_tile_dirty(offset); |
| 251 | 251 | } |
| 252 | 252 | |
| r14899 | r14900 | |
| 254 | 254 | static TILE_GET_INFO( get_luckgrln_reel4_tile_info ) |
| 255 | 255 | { |
| 256 | 256 | luckgrln_state *state = machine.driver_data<luckgrln_state>(); |
| 257 | | int code = state->m_reel4_ram.target()[tile_index]; |
| 258 | | int attr = state->m_reel4_attr.target()[tile_index]; |
| 257 | int code = state->m_reel4_ram[tile_index]; |
| 258 | int attr = state->m_reel4_attr[tile_index]; |
| 259 | 259 | int col = (attr & 0x1f); |
| 260 | 260 | |
| 261 | 261 | code |= (attr & 0xe0)<<3; |
| r14899 | r14900 | |
| 300 | 300 | |
| 301 | 301 | for (i= 0;i < 64;i++) |
| 302 | 302 | { |
| 303 | | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); |
| 304 | | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); |
| 305 | | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); |
| 306 | | state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll.target()[i]); |
| 303 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); |
| 304 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); |
| 305 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); |
| 306 | state->m_reel4_tilemap->set_scrolly(i, state->m_reel4_scroll[i]); |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
| r14899 | r14900 | |
| 317 | 317 | |
| 318 | 318 | for (x=0;x<64;x++) |
| 319 | 319 | { |
| 320 | | UINT16 tile = (state->m_luck_vram1.target()[count] & 0xff); |
| 321 | | UINT16 tile_high = (state->m_luck_vram2.target()[count]); |
| 322 | | UINT16 tileattr = (state->m_luck_vram3.target()[count]); |
| 320 | UINT16 tile = (state->m_luck_vram1[count] & 0xff); |
| 321 | UINT16 tile_high = (state->m_luck_vram2[count]); |
| 322 | UINT16 tileattr = (state->m_luck_vram3[count]); |
| 323 | 323 | UINT8 col = 0; |
| 324 | 324 | UINT8 region = 0; |
| 325 | 325 | UINT8 bgenable; |
src/mame/drivers/vegas.c
| r14899 | r14900 | |
| 546 | 546 | mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY + MIPS3DRC_FLUSH_PC); |
| 547 | 547 | |
| 548 | 548 | /* configure fast RAM regions for DRC */ |
| 549 | | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_rambase.bytes() - 1, FALSE, state->m_rambase.target()); |
| 550 | | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target()); |
| 549 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, state->m_rambase.bytes() - 1, FALSE, state->m_rambase); |
| 550 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase); |
| 551 | 551 | |
| 552 | 552 | /* register for save states */ |
| 553 | 553 | state_save_register_global(machine, state->m_nile_irq_state); |
| r14899 | r14900 | |
| 845 | 845 | static void update_nile_irqs(running_machine &machine) |
| 846 | 846 | { |
| 847 | 847 | vegas_state *state = machine.driver_data<vegas_state>(); |
| 848 | | UINT32 intctll = state->m_nile_regs.target()[NREG_INTCTRL+0]; |
| 849 | | UINT32 intctlh = state->m_nile_regs.target()[NREG_INTCTRL+1]; |
| 848 | UINT32 intctll = state->m_nile_regs[NREG_INTCTRL+0]; |
| 849 | UINT32 intctlh = state->m_nile_regs[NREG_INTCTRL+1]; |
| 850 | 850 | UINT8 irq[6]; |
| 851 | 851 | int i; |
| 852 | 852 | |
| 853 | 853 | /* check for UART transmit IRQ enable and synthsize one */ |
| 854 | | if (state->m_nile_regs.target()[NREG_UARTIER] & 2) |
| 854 | if (state->m_nile_regs[NREG_UARTIER] & 2) |
| 855 | 855 | state->m_nile_irq_state |= 0x0010; |
| 856 | 856 | else |
| 857 | 857 | state->m_nile_irq_state &= ~0x0010; |
| 858 | 858 | |
| 859 | 859 | irq[0] = irq[1] = irq[2] = irq[3] = irq[4] = irq[5] = 0; |
| 860 | | state->m_nile_regs.target()[NREG_INTSTAT0+0] = 0; |
| 861 | | state->m_nile_regs.target()[NREG_INTSTAT0+1] = 0; |
| 862 | | state->m_nile_regs.target()[NREG_INTSTAT1+0] = 0; |
| 863 | | state->m_nile_regs.target()[NREG_INTSTAT1+1] = 0; |
| 860 | state->m_nile_regs[NREG_INTSTAT0+0] = 0; |
| 861 | state->m_nile_regs[NREG_INTSTAT0+1] = 0; |
| 862 | state->m_nile_regs[NREG_INTSTAT1+0] = 0; |
| 863 | state->m_nile_regs[NREG_INTSTAT1+1] = 0; |
| 864 | 864 | |
| 865 | 865 | /* handle the lower interrupts */ |
| 866 | 866 | for (i = 0; i < 8; i++) |
| r14899 | r14900 | |
| 871 | 871 | if (vector < 6) |
| 872 | 872 | { |
| 873 | 873 | irq[vector] = 1; |
| 874 | | state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1)); |
| 874 | state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 16*(vector&1)); |
| 875 | 875 | } |
| 876 | 876 | } |
| 877 | 877 | |
| r14899 | r14900 | |
| 884 | 884 | if (vector < 6) |
| 885 | 885 | { |
| 886 | 886 | irq[vector] = 1; |
| 887 | | state->m_nile_regs.target()[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1)); |
| 887 | state->m_nile_regs[NREG_INTSTAT0 + vector/2] |= 1 << (i + 8 + 16*(vector&1)); |
| 888 | 888 | } |
| 889 | 889 | } |
| 890 | 890 | |
| r14899 | r14900 | |
| 911 | 911 | { |
| 912 | 912 | vegas_state *state = machine.driver_data<vegas_state>(); |
| 913 | 913 | int which = param; |
| 914 | | UINT32 *regs = &state->m_nile_regs.target()[NREG_T0CTRL + which * 4]; |
| 914 | UINT32 *regs = &state->m_nile_regs[NREG_T0CTRL + which * 4]; |
| 915 | 915 | if (LOG_TIMERS) logerror("timer %d fired\n", which); |
| 916 | 916 | |
| 917 | 917 | /* adjust the timer to fire again */ |
| r14899 | r14900 | |
| 943 | 943 | static READ32_HANDLER( nile_r ) |
| 944 | 944 | { |
| 945 | 945 | vegas_state *state = space->machine().driver_data<vegas_state>(); |
| 946 | | UINT32 result = state->m_nile_regs.target()[offset]; |
| 946 | UINT32 result = state->m_nile_regs[offset]; |
| 947 | 947 | int logit = 1, which; |
| 948 | 948 | |
| 949 | 949 | switch (offset) |
| r14899 | r14900 | |
| 1000 | 1000 | case NREG_T2CNTR: /* general purpose timer control (counter) */ |
| 1001 | 1001 | case NREG_T3CNTR: /* watchdog timer control (counter) */ |
| 1002 | 1002 | which = (offset - NREG_T0CTRL) / 4; |
| 1003 | | if (state->m_nile_regs.target()[offset - 1] & 1) |
| 1003 | if (state->m_nile_regs[offset - 1] & 1) |
| 1004 | 1004 | { |
| 1005 | | if (state->m_nile_regs.target()[offset] & 2) |
| 1005 | if (state->m_nile_regs[offset] & 2) |
| 1006 | 1006 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1007 | | result = state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK; |
| 1007 | result = state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * (double)SYSTEM_CLOCK; |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | if (LOG_TIMERS) logerror("%08X:NILE READ: timer %d counter(%03X) = %08X\n", cpu_get_pc(&space->device()), which, offset*4, result); |
| r14899 | r14900 | |
| 1012 | 1012 | break; |
| 1013 | 1013 | |
| 1014 | 1014 | case NREG_UARTIIR: /* serial port interrupt ID */ |
| 1015 | | if (state->m_nile_regs.target()[NREG_UARTIER] & 2) |
| 1015 | if (state->m_nile_regs[NREG_UARTIER] & 2) |
| 1016 | 1016 | result = 0x02; /* transmitter buffer IRQ pending */ |
| 1017 | 1017 | else |
| 1018 | 1018 | result = 0x01; /* no IRQ pending */ |
| r14899 | r14900 | |
| 1056 | 1056 | static WRITE32_HANDLER( nile_w ) |
| 1057 | 1057 | { |
| 1058 | 1058 | vegas_state *state = space->machine().driver_data<vegas_state>(); |
| 1059 | | UINT32 olddata = state->m_nile_regs.target()[offset]; |
| 1059 | UINT32 olddata = state->m_nile_regs[offset]; |
| 1060 | 1060 | int logit = 1, which; |
| 1061 | 1061 | |
| 1062 | | COMBINE_DATA(&state->m_nile_regs.target()[offset]); |
| 1062 | COMBINE_DATA(&state->m_nile_regs[offset]); |
| 1063 | 1063 | |
| 1064 | 1064 | switch (offset) |
| 1065 | 1065 | { |
| r14899 | r14900 | |
| 1094 | 1094 | case NREG_INTCLR+1: /* Interrupt clear */ |
| 1095 | 1095 | if (LOG_NILE) logerror("%08X:NILE WRITE: interrupt clear(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), offset*4, data, mem_mask); |
| 1096 | 1096 | logit = 0; |
| 1097 | | state->m_nile_irq_state &= ~(state->m_nile_regs.target()[offset] & ~0xf00); |
| 1097 | state->m_nile_irq_state &= ~(state->m_nile_regs[offset] & ~0xf00); |
| 1098 | 1098 | update_nile_irqs(space->machine()); |
| 1099 | 1099 | break; |
| 1100 | 1100 | |
| r14899 | r14900 | |
| 1115 | 1115 | break; |
| 1116 | 1116 | |
| 1117 | 1117 | case NREG_PCIINIT1+0: /* PCI master */ |
| 1118 | | if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs.target()[offset] & 0xe) == 0xa)) |
| 1118 | if (((olddata & 0xe) == 0xa) != ((state->m_nile_regs[offset] & 0xe) == 0xa)) |
| 1119 | 1119 | remap_dynamic_addresses(space->machine()); |
| 1120 | 1120 | logit = 0; |
| 1121 | 1121 | break; |
| r14899 | r14900 | |
| 1129 | 1129 | logit = 0; |
| 1130 | 1130 | |
| 1131 | 1131 | /* timer just enabled? */ |
| 1132 | | if (!(olddata & 1) && (state->m_nile_regs.target()[offset] & 1)) |
| 1132 | if (!(olddata & 1) && (state->m_nile_regs[offset] & 1)) |
| 1133 | 1133 | { |
| 1134 | | UINT32 scale = state->m_nile_regs.target()[offset + 1]; |
| 1135 | | if (state->m_nile_regs.target()[offset] & 2) |
| 1134 | UINT32 scale = state->m_nile_regs[offset + 1]; |
| 1135 | if (state->m_nile_regs[offset] & 2) |
| 1136 | 1136 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1137 | 1137 | if (scale != 0) |
| 1138 | 1138 | state->m_timer[which]->adjust(TIMER_PERIOD * scale, which); |
| 1139 | | if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs.target()[offset + 1] + 1)).attoseconds)); |
| 1139 | if (LOG_TIMERS) logerror("Starting timer %d at a rate of %d Hz\n", which, (int)ATTOSECONDS_TO_HZ((TIMER_PERIOD * (state->m_nile_regs[offset + 1] + 1)).attoseconds)); |
| 1140 | 1140 | } |
| 1141 | 1141 | |
| 1142 | 1142 | /* timer disabled? */ |
| 1143 | | else if ((olddata & 1) && !(state->m_nile_regs.target()[offset] & 1)) |
| 1143 | else if ((olddata & 1) && !(state->m_nile_regs[offset] & 1)) |
| 1144 | 1144 | { |
| 1145 | | if (state->m_nile_regs.target()[offset] & 2) |
| 1145 | if (state->m_nile_regs[offset] & 2) |
| 1146 | 1146 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1147 | | state->m_nile_regs.target()[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK; |
| 1147 | state->m_nile_regs[offset + 1] = state->m_timer[which]->remaining().as_double() * SYSTEM_CLOCK; |
| 1148 | 1148 | state->m_timer[which]->adjust(attotime::never, which); |
| 1149 | 1149 | } |
| 1150 | 1150 | break; |
| r14899 | r14900 | |
| 1157 | 1157 | if (LOG_TIMERS) logerror("%08X:NILE WRITE: timer %d counter(%03X) = %08X & %08X\n", cpu_get_pc(&space->device()), which, offset*4, data, mem_mask); |
| 1158 | 1158 | logit = 0; |
| 1159 | 1159 | |
| 1160 | | if (state->m_nile_regs.target()[offset - 1] & 1) |
| 1160 | if (state->m_nile_regs[offset - 1] & 1) |
| 1161 | 1161 | { |
| 1162 | | if (state->m_nile_regs.target()[offset - 1] & 2) |
| 1162 | if (state->m_nile_regs[offset - 1] & 2) |
| 1163 | 1163 | logerror("Unexpected value: timer %d is prescaled\n", which); |
| 1164 | | state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs.target()[offset], which); |
| 1164 | state->m_timer[which]->adjust(TIMER_PERIOD * state->m_nile_regs[offset], which); |
| 1165 | 1165 | } |
| 1166 | 1166 | break; |
| 1167 | 1167 | |
| r14899 | r14900 | |
| 1560 | 1560 | state->m_dynamic_count = 0; |
| 1561 | 1561 | |
| 1562 | 1562 | /* DCS2 */ |
| 1563 | | base = state->m_nile_regs.target()[NREG_DCS2] & 0x1fffff00; |
| 1563 | base = state->m_nile_regs[NREG_DCS2] & 0x1fffff00; |
| 1564 | 1564 | if (base >= state->m_rambase.bytes()) |
| 1565 | 1565 | { |
| 1566 | 1566 | add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_irq_clear_r, sio_irq_clear_w); |
| r14899 | r14900 | |
| 1574 | 1574 | } |
| 1575 | 1575 | |
| 1576 | 1576 | /* DCS3 */ |
| 1577 | | base = state->m_nile_regs.target()[NREG_DCS3] & 0x1fffff00; |
| 1577 | base = state->m_nile_regs[NREG_DCS3] & 0x1fffff00; |
| 1578 | 1578 | if (base >= state->m_rambase.bytes()) |
| 1579 | 1579 | add_dynamic_address(state, base + 0x0000, base + 0x0003, analog_port_r, analog_port_w); |
| 1580 | 1580 | |
| 1581 | 1581 | /* DCS4 */ |
| 1582 | | base = state->m_nile_regs.target()[NREG_DCS4] & 0x1fffff00; |
| 1582 | base = state->m_nile_regs[NREG_DCS4] & 0x1fffff00; |
| 1583 | 1583 | if (base >= state->m_rambase.bytes()) |
| 1584 | 1584 | add_dynamic_address(state, base + 0x0000, base + 0x7fff, timekeeper_r, timekeeper_w); |
| 1585 | 1585 | |
| 1586 | 1586 | /* DCS5 */ |
| 1587 | | base = state->m_nile_regs.target()[NREG_DCS5] & 0x1fffff00; |
| 1587 | base = state->m_nile_regs[NREG_DCS5] & 0x1fffff00; |
| 1588 | 1588 | if (base >= state->m_rambase.bytes()) |
| 1589 | 1589 | add_dynamic_address(state, base + 0x0000, base + 0x0003, sio_r, sio_w); |
| 1590 | 1590 | |
| 1591 | 1591 | /* DCS6 */ |
| 1592 | | base = state->m_nile_regs.target()[NREG_DCS6] & 0x1fffff00; |
| 1592 | base = state->m_nile_regs[NREG_DCS6] & 0x1fffff00; |
| 1593 | 1593 | if (base >= state->m_rambase.bytes()) |
| 1594 | 1594 | { |
| 1595 | 1595 | add_dynamic_address(state, base + 0x0000, base + 0x003f, midway_ioasic_packed_r, midway_ioasic_packed_w); |
| r14899 | r14900 | |
| 1604 | 1604 | } |
| 1605 | 1605 | |
| 1606 | 1606 | /* DCS7 */ |
| 1607 | | base = state->m_nile_regs.target()[NREG_DCS7] & 0x1fffff00; |
| 1607 | base = state->m_nile_regs[NREG_DCS7] & 0x1fffff00; |
| 1608 | 1608 | if (base >= state->m_rambase.bytes()) |
| 1609 | 1609 | { |
| 1610 | 1610 | add_dynamic_device_address(state, ethernet, base + 0x1000, base + 0x100f, ethernet_r, ethernet_w); |
| r14899 | r14900 | |
| 1616 | 1616 | } |
| 1617 | 1617 | |
| 1618 | 1618 | /* PCI config space */ |
| 1619 | | if ((state->m_nile_regs.target()[NREG_PCIINIT1] & 0xe) == 0xa) |
| 1619 | if ((state->m_nile_regs[NREG_PCIINIT1] & 0xe) == 0xa) |
| 1620 | 1620 | { |
| 1621 | | base = state->m_nile_regs.target()[NREG_PCIW1] & 0x1fffff00; |
| 1621 | base = state->m_nile_regs[NREG_PCIW1] & 0x1fffff00; |
| 1622 | 1622 | if (base >= state->m_rambase.bytes()) |
| 1623 | 1623 | { |
| 1624 | 1624 | add_dynamic_address(state, base + (1 << (21 + 4)) + 0x0000, base + (1 << (21 + 4)) + 0x00ff, pci_3dfx_r, pci_3dfx_w); |
src/mame/drivers/mazerbla.c
| r14899 | r14900 | |
| 395 | 395 | m_vcu_gfx_param_addr = offset; |
| 396 | 396 | |
| 397 | 397 | /* offset = 0 is not known */ |
| 398 | | m_xpos = m_cfb_ram.target()[m_vcu_gfx_param_addr + 1] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 2]<<8); |
| 399 | | m_ypos = m_cfb_ram.target()[m_vcu_gfx_param_addr + 3] | (m_cfb_ram.target()[m_vcu_gfx_param_addr + 4]<<8); |
| 400 | | m_color1 = m_cfb_ram.target()[m_vcu_gfx_param_addr + 5]; |
| 401 | | m_color2 = m_cfb_ram.target()[m_vcu_gfx_param_addr + 6]; |
| 402 | | m_mode = m_cfb_ram.target()[m_vcu_gfx_param_addr + 7]; |
| 403 | | m_pix_xsize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 8]; |
| 404 | | m_pix_ysize = m_cfb_ram.target()[m_vcu_gfx_param_addr + 9]; |
| 398 | m_xpos = m_cfb_ram[m_vcu_gfx_param_addr + 1] | (m_cfb_ram[m_vcu_gfx_param_addr + 2]<<8); |
| 399 | m_ypos = m_cfb_ram[m_vcu_gfx_param_addr + 3] | (m_cfb_ram[m_vcu_gfx_param_addr + 4]<<8); |
| 400 | m_color1 = m_cfb_ram[m_vcu_gfx_param_addr + 5]; |
| 401 | m_color2 = m_cfb_ram[m_vcu_gfx_param_addr + 6]; |
| 402 | m_mode = m_cfb_ram[m_vcu_gfx_param_addr + 7]; |
| 403 | m_pix_xsize = m_cfb_ram[m_vcu_gfx_param_addr + 8]; |
| 404 | m_pix_ysize = m_cfb_ram[m_vcu_gfx_param_addr + 9]; |
| 405 | 405 | |
| 406 | 406 | m_plane = m_mode & 3; |
| 407 | 407 | |
| r14899 | r14900 | |
| 428 | 428 | logerror("paradr="); |
| 429 | 429 | logerror("%3x ", m_vcu_gfx_param_addr ); |
| 430 | 430 | |
| 431 | | logerror("%02x ", m_cfb_ram.target()[vcu_gfx_param_addr + 0] ); |
| 431 | logerror("%02x ", m_cfb_ram[vcu_gfx_param_addr + 0] ); |
| 432 | 432 | logerror("x=%04x ", m_xpos ); //1,2 |
| 433 | 433 | logerror("y=%04x ", m_ypos ); //3,4 |
| 434 | 434 | logerror("color1=%02x ", m_color1); //5 |
| r14899 | r14900 | |
| 571 | 571 | logerror("paladr="); |
| 572 | 572 | logerror("%3x ", m_vcu_gfx_param_addr ); |
| 573 | 573 | |
| 574 | | logerror("%02x ", m_cfb_ram.target()[m_vcu_gfx_param_addr + 0] ); |
| 574 | logerror("%02x ", m_cfb_ram[m_vcu_gfx_param_addr + 0] ); |
| 575 | 575 | logerror("x=%04x ", m_xpos ); //1,2 |
| 576 | 576 | logerror("y=%04x ", m_ypos ); //3,4 |
| 577 | 577 | logerror("color1=%02x ", m_color1); //5 |
| r14899 | r14900 | |
| 587 | 587 | logerror("%04x: ", offset + y * 16); |
| 588 | 588 | for (x = 0; x < 16; x++) |
| 589 | 589 | { |
| 590 | | logerror("%02x ", m_cfb_ram.target()[offset + x + y * 16]); |
| 590 | logerror("%02x ", m_cfb_ram[offset + x + y * 16]); |
| 591 | 591 | } |
| 592 | 592 | logerror("\n"); |
| 593 | 593 | } |
| r14899 | r14900 | |
| 664 | 664 | { |
| 665 | 665 | for (x = 0; x < 16; x++) |
| 666 | 666 | { |
| 667 | | UINT8 colour = m_cfb_ram.target()[offs + x + y * 16]; |
| 667 | UINT8 colour = m_cfb_ram[offs + x + y * 16]; |
| 668 | 668 | |
| 669 | 669 | /* red component */ |
| 670 | 670 | bit1 = (colour >> 7) & 0x01; |
| r14899 | r14900 | |
| 699 | 699 | { |
| 700 | 700 | for (x = 0; x < 16; x++) |
| 701 | 701 | { |
| 702 | | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; |
| 702 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; |
| 703 | 703 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 704 | 704 | } |
| 705 | 705 | } |
| r14899 | r14900 | |
| 713 | 713 | { |
| 714 | 714 | for (x = 0; x < 16; x++) |
| 715 | 715 | { |
| 716 | | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; |
| 716 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; |
| 717 | 717 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 718 | 718 | } |
| 719 | 719 | } |
| r14899 | r14900 | |
| 727 | 727 | { |
| 728 | 728 | for (x = 0; x < 16; x++) |
| 729 | 729 | { |
| 730 | | UINT8 dat = m_cfb_ram.target()[offs + x + y * 16]; |
| 730 | UINT8 dat = m_cfb_ram[offs + x + y * 16]; |
| 731 | 731 | m_lookup_ram[lookup_offs + x + y * 16] = dat; |
| 732 | 732 | } |
| 733 | 733 | } |
src/mame/drivers/skylncr.c
| r14899 | r14900 | |
| 110 | 110 | |
| 111 | 111 | WRITE8_MEMBER(skylncr_state::skylncr_videoram_w) |
| 112 | 112 | { |
| 113 | | m_videoram.target()[offset] = data; |
| 113 | m_videoram[offset] = data; |
| 114 | 114 | m_tmap->mark_tile_dirty(offset); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | WRITE8_MEMBER(skylncr_state::skylncr_colorram_w) |
| 118 | 118 | { |
| 119 | | m_colorram.target()[offset] = data; |
| 119 | m_colorram[offset] = data; |
| 120 | 120 | m_tmap->mark_tile_dirty(offset); |
| 121 | 121 | } |
| 122 | 122 | |
| r14899 | r14900 | |
| 124 | 124 | static TILE_GET_INFO( get_tile_info ) |
| 125 | 125 | { |
| 126 | 126 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 127 | | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); |
| 127 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); |
| 128 | 128 | SET_TILE_INFO(0, code, 0, TILE_FLIPYX( 0 )); |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | static TILE_GET_INFO( get_reel_1_tile_info ) |
| 132 | 132 | { |
| 133 | 133 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 134 | | UINT16 code = state->m_reeltiles_1_ram.target()[ tile_index ] + (state->m_reeltileshigh_1_ram.target()[ tile_index ] << 8); |
| 134 | UINT16 code = state->m_reeltiles_1_ram[ tile_index ] + (state->m_reeltileshigh_1_ram[ tile_index ] << 8); |
| 135 | 135 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | static TILE_GET_INFO( get_reel_2_tile_info ) |
| 139 | 139 | { |
| 140 | 140 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 141 | | UINT16 code = state->m_reeltiles_2_ram.target()[ tile_index ] + (state->m_reeltileshigh_2_ram.target()[ tile_index ] << 8); |
| 141 | UINT16 code = state->m_reeltiles_2_ram[ tile_index ] + (state->m_reeltileshigh_2_ram[ tile_index ] << 8); |
| 142 | 142 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | static TILE_GET_INFO( get_reel_3_tile_info ) |
| 146 | 146 | { |
| 147 | 147 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 148 | | UINT16 code = state->m_reeltiles_3_ram.target()[ tile_index ] + (state->m_reeltileshigh_3_ram.target()[ tile_index ] << 8); |
| 148 | UINT16 code = state->m_reeltiles_3_ram[ tile_index ] + (state->m_reeltileshigh_3_ram[ tile_index ] << 8); |
| 149 | 149 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | static TILE_GET_INFO( get_reel_4_tile_info ) |
| 153 | 153 | { |
| 154 | 154 | skylncr_state *state = machine.driver_data<skylncr_state>(); |
| 155 | | UINT16 code = state->m_reeltiles_4_ram.target()[ tile_index ] + (state->m_reeltileshigh_4_ram.target()[ tile_index ] << 8); |
| 155 | UINT16 code = state->m_reeltiles_4_ram[ tile_index ] + (state->m_reeltileshigh_4_ram[ tile_index ] << 8); |
| 156 | 156 | SET_TILE_INFO(1, code, 0, TILE_FLIPYX( 0 )); |
| 157 | 157 | } |
| 158 | 158 | |
| r14899 | r14900 | |
| 196 | 196 | |
| 197 | 197 | for (i= 0;i < 64;i++) |
| 198 | 198 | { |
| 199 | | state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2.target()[i]); |
| 200 | | state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3.target()[i]); |
| 201 | | state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4.target()[i]); |
| 199 | state->m_reel_2_tilemap->set_scrolly(i, state->m_reelscroll2[i]); |
| 200 | state->m_reel_3_tilemap->set_scrolly(i, state->m_reelscroll3[i]); |
| 201 | state->m_reel_4_tilemap->set_scrolly(i, state->m_reelscroll4[i]); |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | state->m_reel_2_tilemap->draw(bitmap, visible1, 0, 0); |
| r14899 | r14900 | |
| 212 | 212 | |
| 213 | 213 | WRITE8_MEMBER(skylncr_state::reeltiles_1_w) |
| 214 | 214 | { |
| 215 | | m_reeltiles_1_ram.target()[offset] = data; |
| 215 | m_reeltiles_1_ram[offset] = data; |
| 216 | 216 | m_reel_1_tilemap->mark_tile_dirty(offset); |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | WRITE8_MEMBER(skylncr_state::reeltiles_2_w) |
| 220 | 220 | { |
| 221 | | m_reeltiles_2_ram.target()[offset] = data; |
| 221 | m_reeltiles_2_ram[offset] = data; |
| 222 | 222 | m_reel_2_tilemap->mark_tile_dirty(offset); |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | WRITE8_MEMBER(skylncr_state::reeltiles_3_w) |
| 226 | 226 | { |
| 227 | | m_reeltiles_3_ram.target()[offset] = data; |
| 227 | m_reeltiles_3_ram[offset] = data; |
| 228 | 228 | m_reel_3_tilemap->mark_tile_dirty(offset); |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | WRITE8_MEMBER(skylncr_state::reeltiles_4_w) |
| 232 | 232 | { |
| 233 | | m_reeltiles_4_ram.target()[offset] = data; |
| 233 | m_reeltiles_4_ram[offset] = data; |
| 234 | 234 | m_reel_4_tilemap->mark_tile_dirty(offset); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | WRITE8_MEMBER(skylncr_state::reeltileshigh_1_w) |
| 238 | 238 | { |
| 239 | | m_reeltileshigh_1_ram.target()[offset] = data; |
| 239 | m_reeltileshigh_1_ram[offset] = data; |
| 240 | 240 | m_reel_1_tilemap->mark_tile_dirty(offset); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | WRITE8_MEMBER(skylncr_state::reeltileshigh_2_w) |
| 244 | 244 | { |
| 245 | | m_reeltileshigh_2_ram.target()[offset] = data; |
| 245 | m_reeltileshigh_2_ram[offset] = data; |
| 246 | 246 | m_reel_2_tilemap->mark_tile_dirty(offset); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | WRITE8_MEMBER(skylncr_state::reeltileshigh_3_w) |
| 250 | 250 | { |
| 251 | | m_reeltileshigh_3_ram.target()[offset] = data; |
| 251 | m_reeltileshigh_3_ram[offset] = data; |
| 252 | 252 | m_reel_3_tilemap->mark_tile_dirty(offset); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | WRITE8_MEMBER(skylncr_state::reeltileshigh_4_w) |
| 256 | 256 | { |
| 257 | | m_reeltileshigh_4_ram.target()[offset] = data; |
| 257 | m_reeltileshigh_4_ram[offset] = data; |
| 258 | 258 | m_reel_4_tilemap->mark_tile_dirty(offset); |
| 259 | 259 | } |
| 260 | 260 | |
| r14899 | r14900 | |
| 309 | 309 | |
| 310 | 310 | WRITE8_MEMBER(skylncr_state::reelscroll1_w) |
| 311 | 311 | { |
| 312 | | m_reelscroll1.target()[offset] = data; |
| 312 | m_reelscroll1[offset] = data; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | WRITE8_MEMBER(skylncr_state::reelscroll2_w) |
| 316 | 316 | { |
| 317 | | m_reelscroll2.target()[offset] = data; |
| 317 | m_reelscroll2[offset] = data; |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | WRITE8_MEMBER(skylncr_state::reelscroll3_w) |
| 321 | 321 | { |
| 322 | | m_reelscroll3.target()[offset] = data; |
| 322 | m_reelscroll3[offset] = data; |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | WRITE8_MEMBER(skylncr_state::reelscroll4_w) |
| 326 | 326 | { |
| 327 | | m_reelscroll4.target()[offset] = data; |
| 327 | m_reelscroll4[offset] = data; |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | |
src/mame/drivers/limenko.c
| r14899 | r14900 | |
| 107 | 107 | |
| 108 | 108 | WRITE32_MEMBER(limenko_state::bg_videoram_w) |
| 109 | 109 | { |
| 110 | | COMBINE_DATA(&m_bg_videoram.target()[offset]); |
| 110 | COMBINE_DATA(&m_bg_videoram[offset]); |
| 111 | 111 | m_bg_tilemap->mark_tile_dirty(offset); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | WRITE32_MEMBER(limenko_state::md_videoram_w) |
| 115 | 115 | { |
| 116 | | COMBINE_DATA(&m_md_videoram.target()[offset]); |
| 116 | COMBINE_DATA(&m_md_videoram[offset]); |
| 117 | 117 | m_md_tilemap->mark_tile_dirty(offset); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | WRITE32_MEMBER(limenko_state::fg_videoram_w) |
| 121 | 121 | { |
| 122 | | COMBINE_DATA(&m_fg_videoram.target()[offset]); |
| 122 | COMBINE_DATA(&m_fg_videoram[offset]); |
| 123 | 123 | m_fg_tilemap->mark_tile_dirty(offset); |
| 124 | 124 | } |
| 125 | 125 | |
| r14899 | r14900 | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // buffer the next number of sprites to draw |
| 158 | | m_prev_sprites_count = (m_videoreg.target()[0] & 0x1ff0000) >> 16; |
| 158 | m_prev_sprites_count = (m_videoreg[0] & 0x1ff0000) >> 16; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | /***************************************************************************************************** |
| r14899 | r14900 | |
| 245 | 245 | static TILE_GET_INFO( get_bg_tile_info ) |
| 246 | 246 | { |
| 247 | 247 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 248 | | int tile = state->m_bg_videoram.target()[tile_index] & 0x7ffff; |
| 249 | | int color = (state->m_bg_videoram.target()[tile_index]>>28) & 0xf; |
| 248 | int tile = state->m_bg_videoram[tile_index] & 0x7ffff; |
| 249 | int color = (state->m_bg_videoram[tile_index]>>28) & 0xf; |
| 250 | 250 | SET_TILE_INFO(0,tile,color,0); |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | static TILE_GET_INFO( get_md_tile_info ) |
| 254 | 254 | { |
| 255 | 255 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 256 | | int tile = state->m_md_videoram.target()[tile_index] & 0x7ffff; |
| 257 | | int color = (state->m_md_videoram.target()[tile_index]>>28) & 0xf; |
| 256 | int tile = state->m_md_videoram[tile_index] & 0x7ffff; |
| 257 | int color = (state->m_md_videoram[tile_index]>>28) & 0xf; |
| 258 | 258 | SET_TILE_INFO(0,tile,color,0); |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | static TILE_GET_INFO( get_fg_tile_info ) |
| 262 | 262 | { |
| 263 | 263 | limenko_state *state = machine.driver_data<limenko_state>(); |
| 264 | | int tile = state->m_fg_videoram.target()[tile_index] & 0x7ffff; |
| 265 | | int color = (state->m_fg_videoram.target()[tile_index]>>28) & 0xf; |
| 264 | int tile = state->m_fg_videoram[tile_index] & 0x7ffff; |
| 265 | int color = (state->m_fg_videoram[tile_index]>>28) & 0xf; |
| 266 | 266 | SET_TILE_INFO(0,tile,color,0); |
| 267 | 267 | } |
| 268 | 268 | |
| r14899 | r14900 | |
| 465 | 465 | static SCREEN_UPDATE_IND16( limenko ) |
| 466 | 466 | { |
| 467 | 467 | limenko_state *state = screen.machine().driver_data<limenko_state>(); |
| 468 | | // state->m_videoreg.target()[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) |
| 468 | // state->m_videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?) |
| 469 | 469 | |
| 470 | 470 | screen.machine().priority_bitmap.fill(0, cliprect); |
| 471 | 471 | |
| 472 | | state->m_bg_tilemap->enable(state->m_videoreg.target()[0] & 4); |
| 473 | | state->m_md_tilemap->enable(state->m_videoreg.target()[0] & 2); |
| 474 | | state->m_fg_tilemap->enable(state->m_videoreg.target()[0] & 1); |
| 472 | state->m_bg_tilemap->enable(state->m_videoreg[0] & 4); |
| 473 | state->m_md_tilemap->enable(state->m_videoreg[0] & 2); |
| 474 | state->m_fg_tilemap->enable(state->m_videoreg[0] & 1); |
| 475 | 475 | |
| 476 | | state->m_bg_tilemap->set_scrolly(0, state->m_videoreg.target()[3] & 0xffff); |
| 477 | | state->m_md_tilemap->set_scrolly(0, state->m_videoreg.target()[2] & 0xffff); |
| 478 | | state->m_fg_tilemap->set_scrolly(0, state->m_videoreg.target()[1] & 0xffff); |
| 476 | state->m_bg_tilemap->set_scrolly(0, state->m_videoreg[3] & 0xffff); |
| 477 | state->m_md_tilemap->set_scrolly(0, state->m_videoreg[2] & 0xffff); |
| 478 | state->m_fg_tilemap->set_scrolly(0, state->m_videoreg[1] & 0xffff); |
| 479 | 479 | |
| 480 | | state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg.target()[3] & 0xffff0000) >> 16); |
| 481 | | state->m_md_tilemap->set_scrollx(0, (state->m_videoreg.target()[2] & 0xffff0000) >> 16); |
| 482 | | state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg.target()[1] & 0xffff0000) >> 16); |
| 480 | state->m_bg_tilemap->set_scrollx(0, (state->m_videoreg[3] & 0xffff0000) >> 16); |
| 481 | state->m_md_tilemap->set_scrollx(0, (state->m_videoreg[2] & 0xffff0000) >> 16); |
| 482 | state->m_fg_tilemap->set_scrollx(0, (state->m_videoreg[1] & 0xffff0000) >> 16); |
| 483 | 483 | |
| 484 | 484 | state->m_bg_tilemap->draw(bitmap, cliprect, 0,0); |
| 485 | 485 | state->m_md_tilemap->draw(bitmap, cliprect, 0,0); |
| 486 | 486 | state->m_fg_tilemap->draw(bitmap, cliprect, 0,1); |
| 487 | 487 | |
| 488 | | if(state->m_videoreg.target()[0] & 8) |
| 488 | if(state->m_videoreg[0] & 8) |
| 489 | 489 | copy_sprites(screen.machine(), bitmap, state->m_sprites_bitmap, screen.machine().priority_bitmap, cliprect); |
| 490 | 490 | |
| 491 | 491 | return 0; |
| r14899 | r14900 | |
| 1006 | 1006 | machine().firstcpu->eat_cycles(50); |
| 1007 | 1007 | } |
| 1008 | 1008 | |
| 1009 | | return m_mainram.target()[0xe2784/4]; |
| 1009 | return m_mainram[0xe2784/4]; |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | READ32_MEMBER(limenko_state::legendoh_speedup_r) |
| r14899 | r14900 | |
| 1016 | 1016 | machine().firstcpu->eat_cycles(50); |
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | | return m_mainram.target()[0x32ab0/4]; |
| 1019 | return m_mainram[0x32ab0/4]; |
| 1020 | 1020 | } |
| 1021 | 1021 | |
| 1022 | 1022 | READ32_MEMBER(limenko_state::sb2003_speedup_r) |
| r14899 | r14900 | |
| 1026 | 1026 | machine().firstcpu->eat_cycles(50); |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| 1029 | | return m_mainram.target()[0x135800/4]; |
| 1029 | return m_mainram[0x135800/4]; |
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | READ32_MEMBER(limenko_state::spotty_speedup_r) |
| r14899 | r14900 | |
| 1036 | 1036 | machine().firstcpu->eat_cycles(50); |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | | return m_mainram.target()[0x6626c/4]; |
| 1039 | return m_mainram[0x6626c/4]; |
| 1040 | 1040 | } |
| 1041 | 1041 | |
| 1042 | 1042 | static DRIVER_INIT( dynabomb ) |
src/mame/drivers/ddealer.c
| r14899 | r14900 | |
| 121 | 121 | m_vregs(*this, "vregs"), |
| 122 | 122 | m_left_fg_vram_top(*this, "left_fg_vratop"), |
| 123 | 123 | m_right_fg_vram_top(*this, "right_fg_vratop"), |
| 124 | | m_left_fg_vram_bottom(*this, "left_fg_vrabottom"), |
| 125 | | m_right_fg_vram_bottom(*this, "right_fg_vrabottom"), |
| 124 | m_left_fg_vram_bottom(*this, "left_fg_vrabot"), |
| 125 | m_right_fg_vram_bottom(*this, "right_fg_vrabot"), |
| 126 | 126 | m_back_vram(*this, "back_vram"), |
| 127 | 127 | m_work_ram(*this, "work_ram"), |
| 128 | 128 | m_mcu_shared_ram(*this, "mcu_shared_ram"){ } |
| r14899 | r14900 | |
| 163 | 163 | static TILE_GET_INFO( get_back_tile_info ) |
| 164 | 164 | { |
| 165 | 165 | ddealer_state *state = machine.driver_data<ddealer_state>(); |
| 166 | | int code = state->m_back_vram.target()[tile_index]; |
| 166 | int code = state->m_back_vram[tile_index]; |
| 167 | 167 | SET_TILE_INFO( |
| 168 | 168 | 0, |
| 169 | 169 | code & 0xfff, |
| r14899 | r14900 | |
| 276 | 276 | |
| 277 | 277 | if (!state->m_flipscreen) |
| 278 | 278 | { |
| 279 | | if (state->m_vregs.target()[0xcc / 2] & 0x80) |
| 279 | if (state->m_vregs[0xcc / 2] & 0x80) |
| 280 | 280 | { |
| 281 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 282 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 281 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 282 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 283 | 283 | } |
| 284 | 284 | else |
| 285 | 285 | { |
| 286 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 286 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | else |
| 290 | 290 | { |
| 291 | | if (state->m_vregs.target()[0xcc / 2] & 0x80) |
| 291 | if (state->m_vregs[0xcc / 2] & 0x80) |
| 292 | 292 | { |
| 293 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 294 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 293 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0xcc / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 294 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_right_fg_vram_top, state->m_right_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 295 | 295 | } |
| 296 | 296 | else |
| 297 | 297 | { |
| 298 | | ddealer_draw_video_layer(screen.machine(), &state->m_vregs.target()[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 298 | ddealer_draw_video_layer(screen.machine(), &state->m_vregs[0x1e0 / 2], state->m_left_fg_vram_top, state->m_left_fg_vram_bottom, bitmap, cliprect, state->m_flipscreen); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | } |
| r14899 | r14900 | |
| 314 | 314 | if (state->m_coin_input & 0x01)//coin 1 |
| 315 | 315 | { |
| 316 | 316 | if((state->m_input_pressed & 0x01) == 0) |
| 317 | | state->m_mcu_shared_ram.target()[0x000 / 2]++; |
| 317 | state->m_mcu_shared_ram[0x000 / 2]++; |
| 318 | 318 | state->m_input_pressed = (state->m_input_pressed & 0xfe) | 1; |
| 319 | 319 | } |
| 320 | 320 | else |
| r14899 | r14900 | |
| 323 | 323 | if (state->m_coin_input & 0x02)//coin 2 |
| 324 | 324 | { |
| 325 | 325 | if ((state->m_input_pressed & 0x02) == 0) |
| 326 | | state->m_mcu_shared_ram.target()[0x000 / 2]++; |
| 326 | state->m_mcu_shared_ram[0x000 / 2]++; |
| 327 | 327 | state->m_input_pressed = (state->m_input_pressed & 0xfd) | 2; |
| 328 | 328 | } |
| 329 | 329 | else |
| r14899 | r14900 | |
| 332 | 332 | if (state->m_coin_input & 0x04)//service 1 |
| 333 | 333 | { |
| 334 | 334 | if ((state->m_input_pressed & 0x04) == 0) |
| 335 | | state->m_mcu_shared_ram.target()[0x000 / 2]++; |
| 335 | state->m_mcu_shared_ram[0x000 / 2]++; |
| 336 | 336 | state->m_input_pressed = (state->m_input_pressed & 0xfb) | 4; |
| 337 | 337 | } |
| 338 | 338 | else |
| r14899 | r14900 | |
| 340 | 340 | |
| 341 | 341 | /*0x104/2 is some sort of "start-lock",i.e. used on the girl selection. |
| 342 | 342 | Without it,the game "steals" one credit if you press the start button on that.*/ |
| 343 | | if (state->m_mcu_shared_ram.target()[0x000 / 2] > 0 && state->m_work_ram.target()[0x104 / 2] & 1) |
| 343 | if (state->m_mcu_shared_ram[0x000 / 2] > 0 && state->m_work_ram[0x104 / 2] & 1) |
| 344 | 344 | { |
| 345 | 345 | if (state->m_coin_input & 0x08)//start 1 |
| 346 | 346 | { |
| 347 | | if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 1))) |
| 348 | | state->m_mcu_shared_ram.target()[0x000 / 2]--; |
| 347 | if ((state->m_input_pressed & 0x08) == 0 && (~(state->m_work_ram[0x100 / 2] & 1))) |
| 348 | state->m_mcu_shared_ram[0x000 / 2]--; |
| 349 | 349 | state->m_input_pressed = (state->m_input_pressed & 0xf7) | 8; |
| 350 | 350 | } |
| 351 | 351 | else |
| r14899 | r14900 | |
| 353 | 353 | |
| 354 | 354 | if (state->m_coin_input & 0x10)//start 2 |
| 355 | 355 | { |
| 356 | | if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram.target()[0x100 / 2] & 2))) |
| 357 | | state->m_mcu_shared_ram.target()[0x000 / 2]--; |
| 356 | if((state->m_input_pressed & 0x10) == 0 && (~(state->m_work_ram[0x100 / 2] & 2))) |
| 357 | state->m_mcu_shared_ram[0x000 / 2]--; |
| 358 | 358 | state->m_input_pressed = (state->m_input_pressed & 0xef) | 0x10; |
| 359 | 359 | } |
| 360 | 360 | else |
| r14899 | r14900 | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | /*random number generators,controls order of cards*/ |
| 365 | | state->m_mcu_shared_ram.target()[0x10 / 2] = timer.machine().rand() & 0xffff; |
| 366 | | state->m_mcu_shared_ram.target()[0x12 / 2] = timer.machine().rand() & 0xffff; |
| 367 | | state->m_mcu_shared_ram.target()[0x14 / 2] = timer.machine().rand() & 0xffff; |
| 368 | | state->m_mcu_shared_ram.target()[0x16 / 2] = timer.machine().rand() & 0xffff; |
| 365 | state->m_mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff; |
| 366 | state->m_mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff; |
| 367 | state->m_mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff; |
| 368 | state->m_mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff; |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | WRITE16_MEMBER(ddealer_state::back_vram_w) |
| 374 | 374 | { |
| 375 | | COMBINE_DATA(&m_back_vram.target()[offset]); |
| 375 | COMBINE_DATA(&m_back_vram[offset]); |
| 376 | 376 | m_back_tilemap->mark_tile_dirty(offset); |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | |
| 380 | 380 | WRITE16_MEMBER(ddealer_state::ddealer_vregs_w) |
| 381 | 381 | { |
| 382 | | COMBINE_DATA(&m_vregs.target()[offset]); |
| 382 | COMBINE_DATA(&m_vregs[offset]); |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /****************************************************************************************************** |
| r14899 | r14900 | |
| 389 | 389 | ******************************************************************************************************/ |
| 390 | 390 | |
| 391 | 391 | #define PROT_JSR(_offs_,_protvalue_,_pc_) \ |
| 392 | | if(m_mcu_shared_ram.target()[(_offs_)/2] == _protvalue_) \ |
| 392 | if(m_mcu_shared_ram[(_offs_)/2] == _protvalue_) \ |
| 393 | 393 | { \ |
| 394 | | m_mcu_shared_ram.target()[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ |
| 395 | | m_mcu_shared_ram.target()[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ |
| 396 | | m_mcu_shared_ram.target()[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ |
| 397 | | m_mcu_shared_ram.target()[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ |
| 394 | m_mcu_shared_ram[(_offs_)/2] = 0xffff; /*(MCU job done)*/ \ |
| 395 | m_mcu_shared_ram[(_offs_+2-0x10)/2] = 0x4ef9;/*JMP*/\ |
| 396 | m_mcu_shared_ram[(_offs_+4-0x10)/2] = 0x0000;/*HI-DWORD*/\ |
| 397 | m_mcu_shared_ram[(_offs_+6-0x10)/2] = _pc_; /*LO-DWORD*/\ |
| 398 | 398 | } \ |
| 399 | 399 | |
| 400 | 400 | #define PROT_INPUT(_offs_,_protvalue_,_protinput_,_input_) \ |
| 401 | | if(m_mcu_shared_ram.target()[_offs_] == _protvalue_) \ |
| 401 | if(m_mcu_shared_ram[_offs_] == _protvalue_) \ |
| 402 | 402 | {\ |
| 403 | | m_mcu_shared_ram.target()[_protinput_] = ((_input_ & 0xffff0000)>>16);\ |
| 404 | | m_mcu_shared_ram.target()[_protinput_+1] = (_input_ & 0x0000ffff);\ |
| 403 | m_mcu_shared_ram[_protinput_] = ((_input_ & 0xffff0000)>>16);\ |
| 404 | m_mcu_shared_ram[_protinput_+1] = (_input_ & 0x0000ffff);\ |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | WRITE16_MEMBER(ddealer_state::ddealer_mcu_shared_w) |
| 408 | 408 | { |
| 409 | | COMBINE_DATA(&m_mcu_shared_ram.target()[offset]); |
| 409 | COMBINE_DATA(&m_mcu_shared_ram[offset]); |
| 410 | 410 | |
| 411 | 411 | switch(offset) |
| 412 | 412 | { |
| r14899 | r14900 | |
| 438 | 438 | case 0x4fe/2: PROT_JSR(0x4fe,0x8018,0x9818); break; |
| 439 | 439 | /*Start-up vector,I think that only the first ram address can be written by the main CPU,or it is a whole sequence.*/ |
| 440 | 440 | case 0x000/2: |
| 441 | | if (m_mcu_shared_ram.target()[0x000 / 2] == 0x60fe) |
| 441 | if (m_mcu_shared_ram[0x000 / 2] == 0x60fe) |
| 442 | 442 | { |
| 443 | | m_mcu_shared_ram.target()[0x000 / 2] = 0x0000;//coin counter |
| 444 | | m_mcu_shared_ram.target()[0x002 / 2] = 0x0000;//coin counter "decimal point" |
| 445 | | m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9; |
| 443 | m_mcu_shared_ram[0x000 / 2] = 0x0000;//coin counter |
| 444 | m_mcu_shared_ram[0x002 / 2] = 0x0000;//coin counter "decimal point" |
| 445 | m_mcu_shared_ram[0x004 / 2] = 0x4ef9; |
| 446 | 446 | } |
| 447 | 447 | break; |
| 448 | 448 | case 0x002/2: |
| 449 | 449 | case 0x004/2: |
| 450 | | if (m_mcu_shared_ram.target()[0x002 / 2] == 0x0000 && m_mcu_shared_ram.target()[0x004 / 2] == 0x0214) |
| 451 | | m_mcu_shared_ram.target()[0x004 / 2] = 0x4ef9; |
| 450 | if (m_mcu_shared_ram[0x002 / 2] == 0x0000 && m_mcu_shared_ram[0x004 / 2] == 0x0214) |
| 451 | m_mcu_shared_ram[0x004 / 2] = 0x4ef9; |
| 452 | 452 | break; |
| 453 | 453 | case 0x008/2: |
| 454 | | if (m_mcu_shared_ram.target()[0x008 / 2] == 0x000f) |
| 455 | | m_mcu_shared_ram.target()[0x008 / 2] = 0x0604; |
| 454 | if (m_mcu_shared_ram[0x008 / 2] == 0x000f) |
| 455 | m_mcu_shared_ram[0x008 / 2] = 0x0604; |
| 456 | 456 | break; |
| 457 | 457 | case 0x00c/2: |
| 458 | | if (m_mcu_shared_ram.target()[0x00c / 2] == 0x000f) |
| 459 | | m_mcu_shared_ram.target()[0x00c / 2] = 0x0000; |
| 458 | if (m_mcu_shared_ram[0x00c / 2] == 0x000f) |
| 459 | m_mcu_shared_ram[0x00c / 2] = 0x0000; |
| 460 | 460 | break; |
| 461 | 461 | } |
| 462 | 462 | } |
| r14899 | r14900 | |
| 474 | 474 | /* this might actually be 1 tilemap with some funky rowscroll / columnscroll enabled, I'm not sure */ |
| 475 | 475 | AM_RANGE(0x090000, 0x090fff) AM_RAM AM_SHARE("left_fg_vratop") |
| 476 | 476 | AM_RANGE(0x091000, 0x091fff) AM_RAM AM_SHARE("right_fg_vratop") |
| 477 | | AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabottom") |
| 478 | | AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabottom") |
| 477 | AM_RANGE(0x092000, 0x092fff) AM_RAM AM_SHARE("left_fg_vrabot") |
| 478 | AM_RANGE(0x093000, 0x093fff) AM_RAM AM_SHARE("right_fg_vrabot") |
| 479 | 479 | //AM_RANGE(0x094000, 0x094001) AM_NOP // always 0? |
| 480 | 480 | AM_RANGE(0x098000, 0x098001) AM_WRITE(ddealer_flipscreen_w) |
| 481 | 481 | AM_RANGE(0x09c000, 0x09cfff) AM_RAM_WRITE(back_vram_w) AM_SHARE("back_vram") // bg tilemap |
src/mame/drivers/igs009.c
| r14899 | r14900 | |
| 80 | 80 | |
| 81 | 81 | WRITE8_MEMBER(igs009_state::gp98_reel1_ram_w) |
| 82 | 82 | { |
| 83 | | m_gp98_reel1_ram.target()[offset] = data; |
| 83 | m_gp98_reel1_ram[offset] = data; |
| 84 | 84 | m_gp98_reel1_tilemap->mark_tile_dirty(offset); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static TILE_GET_INFO( get_jingbell_reel1_tile_info ) |
| 88 | 88 | { |
| 89 | 89 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 90 | | int code = state->m_gp98_reel1_ram.target()[tile_index]; |
| 90 | int code = state->m_gp98_reel1_ram[tile_index]; |
| 91 | 91 | |
| 92 | 92 | SET_TILE_INFO( |
| 93 | 93 | 0, |
| r14899 | r14900 | |
| 100 | 100 | static TILE_GET_INFO( get_gp98_reel1_tile_info ) |
| 101 | 101 | { |
| 102 | 102 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 103 | | int code = state->m_gp98_reel1_ram.target()[tile_index]; |
| 103 | int code = state->m_gp98_reel1_ram[tile_index]; |
| 104 | 104 | |
| 105 | 105 | SET_TILE_INFO( |
| 106 | 106 | 0, |
| r14899 | r14900 | |
| 112 | 112 | |
| 113 | 113 | WRITE8_MEMBER(igs009_state::gp98_reel2_ram_w) |
| 114 | 114 | { |
| 115 | | m_gp98_reel2_ram.target()[offset] = data; |
| 115 | m_gp98_reel2_ram[offset] = data; |
| 116 | 116 | m_gp98_reel2_tilemap->mark_tile_dirty(offset); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | static TILE_GET_INFO( get_jingbell_reel2_tile_info ) |
| 120 | 120 | { |
| 121 | 121 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 122 | | int code = state->m_gp98_reel2_ram.target()[tile_index]; |
| 122 | int code = state->m_gp98_reel2_ram[tile_index]; |
| 123 | 123 | |
| 124 | 124 | SET_TILE_INFO( |
| 125 | 125 | 0, |
| r14899 | r14900 | |
| 131 | 131 | static TILE_GET_INFO( get_gp98_reel2_tile_info ) |
| 132 | 132 | { |
| 133 | 133 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 134 | | int code = state->m_gp98_reel2_ram.target()[tile_index]; |
| 134 | int code = state->m_gp98_reel2_ram[tile_index]; |
| 135 | 135 | |
| 136 | 136 | SET_TILE_INFO( |
| 137 | 137 | 0, |
| r14899 | r14900 | |
| 144 | 144 | |
| 145 | 145 | WRITE8_MEMBER(igs009_state::gp98_reel3_ram_w) |
| 146 | 146 | { |
| 147 | | m_gp98_reel3_ram.target()[offset] = data; |
| 147 | m_gp98_reel3_ram[offset] = data; |
| 148 | 148 | m_gp98_reel3_tilemap->mark_tile_dirty(offset); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | static TILE_GET_INFO( get_jingbell_reel3_tile_info ) |
| 152 | 152 | { |
| 153 | 153 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 154 | | int code = state->m_gp98_reel3_ram.target()[tile_index]; |
| 154 | int code = state->m_gp98_reel3_ram[tile_index]; |
| 155 | 155 | |
| 156 | 156 | SET_TILE_INFO( |
| 157 | 157 | 0, |
| r14899 | r14900 | |
| 163 | 163 | static TILE_GET_INFO( get_gp98_reel3_tile_info ) |
| 164 | 164 | { |
| 165 | 165 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 166 | | int code = state->m_gp98_reel3_ram.target()[tile_index]; |
| 166 | int code = state->m_gp98_reel3_ram[tile_index]; |
| 167 | 167 | |
| 168 | 168 | SET_TILE_INFO( |
| 169 | 169 | 0, |
| r14899 | r14900 | |
| 176 | 176 | |
| 177 | 177 | WRITE8_MEMBER(igs009_state::gp98_reel4_ram_w) |
| 178 | 178 | { |
| 179 | | m_gp98_reel4_ram.target()[offset] = data; |
| 179 | m_gp98_reel4_ram[offset] = data; |
| 180 | 180 | m_gp98_reel4_tilemap->mark_tile_dirty(offset); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | static TILE_GET_INFO( get_jingbell_reel4_tile_info ) |
| 184 | 184 | { |
| 185 | 185 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 186 | | int code = state->m_gp98_reel4_ram.target()[tile_index]; |
| 186 | int code = state->m_gp98_reel4_ram[tile_index]; |
| 187 | 187 | |
| 188 | 188 | SET_TILE_INFO( |
| 189 | 189 | 0, |
| r14899 | r14900 | |
| 195 | 195 | static TILE_GET_INFO( get_gp98_reel4_tile_info ) |
| 196 | 196 | { |
| 197 | 197 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 198 | | int code = state->m_gp98_reel4_ram.target()[tile_index]; |
| 198 | int code = state->m_gp98_reel4_ram[tile_index]; |
| 199 | 199 | |
| 200 | 200 | SET_TILE_INFO( |
| 201 | 201 | 0, |
| r14899 | r14900 | |
| 212 | 212 | |
| 213 | 213 | WRITE8_MEMBER(igs009_state::bg_scroll_w) |
| 214 | 214 | { |
| 215 | | m_bg_scroll.target()[offset] = data; |
| 215 | m_bg_scroll[offset] = data; |
| 216 | 216 | // bg_tilemap->set_scrolly(offset,data); |
| 217 | 217 | } |
| 218 | 218 | |
| r14899 | r14900 | |
| 220 | 220 | static TILE_GET_INFO( get_fg_tile_info ) |
| 221 | 221 | { |
| 222 | 222 | igs009_state *state = machine.driver_data<igs009_state>(); |
| 223 | | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); |
| 223 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); |
| 224 | 224 | SET_TILE_INFO(1, code, (4*(code >> 14)+3), 0); |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | WRITE8_MEMBER(igs009_state::fg_tile_w) |
| 228 | 228 | { |
| 229 | | m_fg_tile_ram.target()[offset] = data; |
| 229 | m_fg_tile_ram[offset] = data; |
| 230 | 230 | m_fg_tilemap->mark_tile_dirty(offset); |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | WRITE8_MEMBER(igs009_state::fg_color_w) |
| 234 | 234 | { |
| 235 | | m_fg_color_ram.target()[offset] = data; |
| 235 | m_fg_color_ram[offset] = data; |
| 236 | 236 | m_fg_tilemap->mark_tile_dirty(offset); |
| 237 | 237 | } |
| 238 | 238 | |
| r14899 | r14900 | |
| 298 | 298 | |
| 299 | 299 | for (i= 0;i < 0x80;i++) |
| 300 | 300 | { |
| 301 | | state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i]*2); |
| 302 | | state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x80]*2); |
| 303 | | state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x100]*2); |
| 304 | | state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x180]*2); |
| 301 | state->m_gp98_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i]*2); |
| 302 | state->m_gp98_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x80]*2); |
| 303 | state->m_gp98_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x100]*2); |
| 304 | state->m_gp98_reel4_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x180]*2); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| r14899 | r14900 | |
| 310 | 310 | for (zz=0;zz<0x80-8;zz++) // -8 because of visible area (2*8 = 16) |
| 311 | 311 | { |
| 312 | 312 | rectangle clip; |
| 313 | | int rowenable = state->m_bg_scroll2.target()[zz]; |
| 313 | int rowenable = state->m_bg_scroll2[zz]; |
| 314 | 314 | |
| 315 | 315 | /* draw top of screen */ |
| 316 | 316 | clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+2); |
src/mame/drivers/blitz68k.c
| r14899 | r14900 | |
| 43 | 43 | public: |
| 44 | 44 | blitz68k_state(const machine_config &mconfig, device_type type, const char *tag) |
| 45 | 45 | : driver_device(mconfig, type, tag), |
| 46 | | m_nvram(*this, "nvram") { } |
| 46 | m_nvram(*this, "nvram"), |
| 47 | m_leds0(*this, "leds0"), |
| 48 | m_leds1(*this, "leds1"), |
| 49 | m_leds2(*this, "leds2") { } |
| 47 | 50 | |
| 48 | 51 | optional_shared_ptr<UINT16> m_nvram; |
| 49 | 52 | UINT8 *m_blit_buffer; |
| r14899 | r14900 | |
| 55 | 58 | UINT16 *m_blit_dst_ram_hiword; |
| 56 | 59 | UINT16 *m_blit_vregs; |
| 57 | 60 | UINT16 *m_blit_transpen; |
| 58 | | UINT16 *m_leds[3]; |
| 61 | required_shared_ptr<UINT16> m_leds0; |
| 62 | required_shared_ptr<UINT16> m_leds1; |
| 63 | optional_shared_ptr<UINT16> m_leds2; |
| 59 | 64 | DECLARE_WRITE16_MEMBER(blit_copy_w); |
| 60 | 65 | DECLARE_READ8_MEMBER(blit_status_r); |
| 61 | 66 | DECLARE_WRITE8_MEMBER(blit_x_w); |
| r14899 | r14900 | |
| 505 | 510 | void blitz68k_state::show_leds123() |
| 506 | 511 | { |
| 507 | 512 | #ifdef MAME_DEBUG |
| 508 | | popmessage("led %02x %02x %02x", m_leds[0][0]>>8, m_leds[1][0]>>8, m_leds[2][0]>>8); |
| 513 | popmessage("led %02x %02x %02x", m_leds0[0]>>8, m_leds1[0]>>8, m_leds2[0]>>8); |
| 509 | 514 | #endif |
| 510 | 515 | } |
| 511 | 516 | void blitz68k_state::show_leds12() |
| 512 | 517 | { |
| 513 | 518 | #ifdef MAME_DEBUG |
| 514 | | popmessage("led %02x %02x", m_leds[0][0]>>8, m_leds[1][0]>>8); |
| 519 | popmessage("led %02x %02x", m_leds0[0]>>8, m_leds1[0]>>8); |
| 515 | 520 | #endif |
| 516 | 521 | } |
| 517 | 522 | |
| r14899 | r14900 | |
| 793 | 798 | |
| 794 | 799 | WRITE16_MEMBER(blitz68k_state::cjffruit_leds1_w) |
| 795 | 800 | { |
| 796 | | data = COMBINE_DATA(m_leds[0]); |
| 801 | data = COMBINE_DATA(m_leds0); |
| 797 | 802 | if (ACCESSING_BITS_8_15) |
| 798 | 803 | { |
| 799 | 804 | coin_counter_w(machine(), 0, data & 0x0100); // coin in |
| r14899 | r14900 | |
| 810 | 815 | |
| 811 | 816 | WRITE16_MEMBER(blitz68k_state::cjffruit_leds2_w) |
| 812 | 817 | { |
| 813 | | data = COMBINE_DATA(m_leds[1]); |
| 818 | data = COMBINE_DATA(m_leds1); |
| 814 | 819 | if (ACCESSING_BITS_8_15) |
| 815 | 820 | { |
| 816 | 821 | set_led_status(machine(), 7, data & 0x0100); // start |
| r14899 | r14900 | |
| 827 | 832 | |
| 828 | 833 | WRITE16_MEMBER(blitz68k_state::cjffruit_leds3_w) |
| 829 | 834 | { |
| 830 | | data = COMBINE_DATA(m_leds[2]); |
| 835 | data = COMBINE_DATA(m_leds2); |
| 831 | 836 | if (ACCESSING_BITS_8_15) |
| 832 | 837 | { |
| 833 | 838 | set_led_status(machine(), 15, data & 0x0100); // hopper coins? |
| r14899 | r14900 | |
| 902 | 907 | |
| 903 | 908 | AM_RANGE(0x8e0000, 0x8e0001) AM_WRITE(cjffruit_mcu_w ) |
| 904 | 909 | |
| 905 | | AM_RANGE(0x8f8000, 0x8f8001) AM_WRITE(cjffruit_leds1_w) AM_BASE(m_leds[0]) |
| 906 | | AM_RANGE(0x8fa000, 0x8fa001) AM_WRITE(cjffruit_leds2_w) AM_BASE(m_leds[1]) |
| 907 | | AM_RANGE(0x8fc000, 0x8fc001) AM_WRITE(cjffruit_leds3_w) AM_BASE(m_leds[2]) |
| 910 | AM_RANGE(0x8f8000, 0x8f8001) AM_WRITE(cjffruit_leds1_w) AM_SHARE("leds0") |
| 911 | AM_RANGE(0x8fa000, 0x8fa001) AM_WRITE(cjffruit_leds2_w) AM_SHARE("leds1") |
| 912 | AM_RANGE(0x8fc000, 0x8fc001) AM_WRITE(cjffruit_leds3_w) AM_SHARE("leds2") |
| 908 | 913 | |
| 909 | 914 | AM_RANGE(0x8fe000, 0x8fe003) AM_WRITE8(blit_flags_w, 0xffff) // flipx,y,solid,trans |
| 910 | 915 | AM_RANGE(0x8fe004, 0x8fe005) AM_WRITEONLY |
| r14899 | r14900 | |
| 932 | 937 | |
| 933 | 938 | WRITE16_MEMBER(blitz68k_state::deucesw2_leds1_w) |
| 934 | 939 | { |
| 935 | | data = COMBINE_DATA(m_leds[0]); |
| 940 | data = COMBINE_DATA(m_leds0); |
| 936 | 941 | if (ACCESSING_BITS_8_15) |
| 937 | 942 | { |
| 938 | 943 | coin_counter_w(machine(), 0, data & 0x0100); // coin in |
| r14899 | r14900 | |
| 949 | 954 | |
| 950 | 955 | WRITE16_MEMBER(blitz68k_state::deucesw2_leds2_w) |
| 951 | 956 | { |
| 952 | | data = COMBINE_DATA(m_leds[1]); |
| 957 | data = COMBINE_DATA(m_leds1); |
| 953 | 958 | if (ACCESSING_BITS_8_15) |
| 954 | 959 | { |
| 955 | 960 | set_led_status(machine(), 7, data & 0x0100); // start |
| r14899 | r14900 | |
| 966 | 971 | |
| 967 | 972 | WRITE16_MEMBER(blitz68k_state::deucesw2_leds3_w) |
| 968 | 973 | { |
| 969 | | data = COMBINE_DATA(m_leds[2]); |
| 974 | data = COMBINE_DATA(m_leds2); |
| 970 | 975 | if (ACCESSING_BITS_8_15) |
| 971 | 976 | { |
| 972 | 977 | set_led_status(machine(), 15, data & 0x0100); // hopper coins? |
| r14899 | r14900 | |
| 1001 | 1006 | |
| 1002 | 1007 | AM_RANGE(0x896000, 0x896001) AM_WRITE(deucesw2_mcu_w ) |
| 1003 | 1008 | |
| 1004 | | AM_RANGE(0x898000, 0x898001) AM_WRITE(deucesw2_leds1_w) AM_BASE(m_leds[0]) |
| 1005 | | AM_RANGE(0x89a000, 0x89a001) AM_WRITE(deucesw2_leds2_w) AM_BASE(m_leds[1]) |
| 1006 | | AM_RANGE(0x89c000, 0x89c001) AM_WRITE(deucesw2_leds3_w) AM_BASE(m_leds[2]) |
| 1009 | AM_RANGE(0x898000, 0x898001) AM_WRITE(deucesw2_leds1_w) AM_SHARE("leds0") |
| 1010 | AM_RANGE(0x89a000, 0x89a001) AM_WRITE(deucesw2_leds2_w) AM_SHARE("leds1") |
| 1011 | AM_RANGE(0x89c000, 0x89c001) AM_WRITE(deucesw2_leds3_w) AM_SHARE("leds2") |
| 1007 | 1012 | |
| 1008 | 1013 | AM_RANGE(0x89e000, 0x89e003) AM_WRITE8(blit_flags_w, 0xffff) // flipx,y,solid,trans |
| 1009 | 1014 | AM_RANGE(0x89e004, 0x89e005) AM_WRITEONLY |
| r14899 | r14900 | |
| 1122 | 1127 | |
| 1123 | 1128 | WRITE16_MEMBER(blitz68k_state::hermit_leds1_w) |
| 1124 | 1129 | { |
| 1125 | | data = COMBINE_DATA(m_leds[0]); |
| 1130 | data = COMBINE_DATA(m_leds0); |
| 1126 | 1131 | if (ACCESSING_BITS_8_15) |
| 1127 | 1132 | { |
| 1128 | 1133 | coin_counter_w(machine(), 0, data & 0x0100); // coin in |
| r14899 | r14900 | |
| 1132 | 1137 | |
| 1133 | 1138 | WRITE16_MEMBER(blitz68k_state::hermit_leds2_w) |
| 1134 | 1139 | { |
| 1135 | | data = COMBINE_DATA(m_leds[1]); |
| 1140 | data = COMBINE_DATA(m_leds1); |
| 1136 | 1141 | if (ACCESSING_BITS_8_15) |
| 1137 | 1142 | { |
| 1138 | 1143 | set_led_status(machine(), 7, data & 0x0100); // button |
| r14899 | r14900 | |
| 1176 | 1181 | AM_RANGE(0x9d0000, 0x9d0001) AM_READ_PORT("IN2") |
| 1177 | 1182 | AM_RANGE(0x9d8000, 0x9d8001) AM_READ_PORT("DSW") |
| 1178 | 1183 | |
| 1179 | | AM_RANGE(0x9e0000, 0x9e0001) AM_WRITE(hermit_leds1_w) AM_BASE(m_leds[0]) |
| 1180 | | AM_RANGE(0x9e8000, 0x9e8001) AM_WRITE(hermit_leds2_w) AM_BASE(m_leds[1]) |
| 1184 | AM_RANGE(0x9e0000, 0x9e0001) AM_WRITE(hermit_leds1_w) AM_SHARE("leds0") |
| 1185 | AM_RANGE(0x9e8000, 0x9e8001) AM_WRITE(hermit_leds2_w) AM_SHARE("leds1") |
| 1181 | 1186 | |
| 1182 | 1187 | AM_RANGE(0x9f0000, 0x9f0003) AM_WRITE8(blit_flags_w, 0xffff) // flipx,y,solid,trans |
| 1183 | 1188 | AM_RANGE(0x9f0004, 0x9f0005) AM_WRITEONLY |
src/mame/drivers/subsino.c
| r14899 | r14900 | |
| 300 | 300 | |
| 301 | 301 | WRITE8_MEMBER(subsino_state::subsino_videoram_w) |
| 302 | 302 | { |
| 303 | | m_videoram.target()[offset] = data; |
| 303 | m_videoram[offset] = data; |
| 304 | 304 | m_tmap->mark_tile_dirty(offset); |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | WRITE8_MEMBER(subsino_state::subsino_colorram_w) |
| 308 | 308 | { |
| 309 | | m_colorram.target()[offset] = data; |
| 309 | m_colorram[offset] = data; |
| 310 | 310 | m_tmap->mark_tile_dirty(offset); |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | static TILE_GET_INFO( get_tile_info ) |
| 314 | 314 | { |
| 315 | 315 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 316 | | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); |
| 316 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); |
| 317 | 317 | UINT16 color = (code >> 8) & 0x0f; |
| 318 | 318 | code = ((code & 0xf000) >> 4) + ((code & 0xff) >> 0); |
| 319 | 319 | code += state->m_tiles_offset; |
| r14899 | r14900 | |
| 323 | 323 | static TILE_GET_INFO( get_stisub_tile_info ) |
| 324 | 324 | { |
| 325 | 325 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 326 | | UINT16 code = state->m_videoram.target()[ tile_index ] + (state->m_colorram.target()[ tile_index ] << 8); |
| 326 | UINT16 code = state->m_videoram[ tile_index ] + (state->m_colorram[ tile_index ] << 8); |
| 327 | 327 | code&= 0x3fff; |
| 328 | 328 | SET_TILE_INFO(0, code, 0, 0); |
| 329 | 329 | } |
| r14899 | r14900 | |
| 341 | 341 | |
| 342 | 342 | WRITE8_MEMBER(subsino_state::subsino_reel1_ram_w) |
| 343 | 343 | { |
| 344 | | m_reel1_ram.target()[offset] = data; |
| 344 | m_reel1_ram[offset] = data; |
| 345 | 345 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | static TILE_GET_INFO( get_subsino_reel1_tile_info ) |
| 349 | 349 | { |
| 350 | 350 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 351 | | int code = state->m_reel1_ram.target()[tile_index]; |
| 351 | int code = state->m_reel1_ram[tile_index]; |
| 352 | 352 | int colour = (state->m_out_c&0x7) + 8; |
| 353 | 353 | |
| 354 | 354 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 361 | 361 | static TILE_GET_INFO( get_stisub_reel1_tile_info ) |
| 362 | 362 | { |
| 363 | 363 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 364 | | int code = state->m_reel1_ram.target()[tile_index]; |
| 364 | int code = state->m_reel1_ram[tile_index]; |
| 365 | 365 | int attr = state->m_reel1_attr[tile_index]; |
| 366 | 366 | |
| 367 | 367 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 374 | 374 | |
| 375 | 375 | WRITE8_MEMBER(subsino_state::subsino_reel2_ram_w) |
| 376 | 376 | { |
| 377 | | m_reel2_ram.target()[offset] = data; |
| 377 | m_reel2_ram[offset] = data; |
| 378 | 378 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | static TILE_GET_INFO( get_subsino_reel2_tile_info ) |
| 382 | 382 | { |
| 383 | 383 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 384 | | int code = state->m_reel2_ram.target()[tile_index]; |
| 384 | int code = state->m_reel2_ram[tile_index]; |
| 385 | 385 | int colour = (state->m_out_c&0x7) + 8; |
| 386 | 386 | |
| 387 | 387 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 394 | 394 | static TILE_GET_INFO( get_stisub_reel2_tile_info ) |
| 395 | 395 | { |
| 396 | 396 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 397 | | int code = state->m_reel2_ram.target()[tile_index]; |
| 397 | int code = state->m_reel2_ram[tile_index]; |
| 398 | 398 | int attr = state->m_reel2_attr[tile_index]; |
| 399 | 399 | |
| 400 | 400 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 406 | 406 | |
| 407 | 407 | WRITE8_MEMBER(subsino_state::subsino_reel3_ram_w) |
| 408 | 408 | { |
| 409 | | m_reel3_ram.target()[offset] = data; |
| 409 | m_reel3_ram[offset] = data; |
| 410 | 410 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | static TILE_GET_INFO( get_subsino_reel3_tile_info ) |
| 414 | 414 | { |
| 415 | 415 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 416 | | int code = state->m_reel3_ram.target()[tile_index]; |
| 416 | int code = state->m_reel3_ram[tile_index]; |
| 417 | 417 | int colour = (state->m_out_c&0x7) + 8; |
| 418 | 418 | |
| 419 | 419 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 426 | 426 | static TILE_GET_INFO( get_stisub_reel3_tile_info ) |
| 427 | 427 | { |
| 428 | 428 | subsino_state *state = machine.driver_data<subsino_state>(); |
| 429 | | int code = state->m_reel3_ram.target()[tile_index]; |
| 429 | int code = state->m_reel3_ram[tile_index]; |
| 430 | 430 | int attr = state->m_reel3_attr[tile_index]; |
| 431 | 431 | |
| 432 | 432 | SET_TILE_INFO( |
| r14899 | r14900 | |
| 486 | 486 | |
| 487 | 487 | for (i= 0;i < 64;i++) |
| 488 | 488 | { |
| 489 | | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); |
| 490 | | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); |
| 491 | | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); |
| 489 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); |
| 490 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); |
| 491 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | if (state->m_out_c&0x08) |
| r14899 | r14900 | |
| 523 | 523 | |
| 524 | 524 | for (i= 0;i < 64;i++) |
| 525 | 525 | { |
| 526 | | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll.target()[i]); |
| 527 | | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll.target()[i]); |
| 528 | | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll.target()[i]); |
| 526 | state->m_reel1_tilemap->set_scrolly(i, state->m_reel1_scroll[i]); |
| 527 | state->m_reel2_tilemap->set_scrolly(i, state->m_reel2_scroll[i]); |
| 528 | state->m_reel3_tilemap->set_scrolly(i, state->m_reel3_scroll[i]); |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | if (state->m_out_c&0x08) |
| r14899 | r14900 | |
| 1107 | 1107 | } |
| 1108 | 1108 | else if (offset<0x80) |
| 1109 | 1109 | { |
| 1110 | | m_reel2_scroll.target()[offset&0x3f] = data; |
| 1110 | m_reel2_scroll[offset&0x3f] = data; |
| 1111 | 1111 | } |
| 1112 | 1112 | else if (offset<0xc0) |
| 1113 | 1113 | { |
| 1114 | | m_reel1_scroll.target()[offset&0x3f] = data; |
| 1114 | m_reel1_scroll[offset&0x3f] = data; |
| 1115 | 1115 | } |
| 1116 | 1116 | else |
| 1117 | 1117 | { |
| 1118 | | m_reel3_scroll.target()[offset&0x3f] = data; |
| 1118 | m_reel3_scroll[offset&0x3f] = data; |
| 1119 | 1119 | } |
| 1120 | 1120 | } |
| 1121 | 1121 | } |
src/mame/drivers/mlanding.c
| r14899 | r14900 | |
| 91 | 91 | |
| 92 | 92 | for (y = cliprect.min_y; y <= cliprect.max_y; ++y) |
| 93 | 93 | { |
| 94 | | UINT16 *src = &state->m_g_ram.target()[y * 512/2 + cliprect.min_x]; |
| 94 | UINT16 *src = &state->m_g_ram[y * 512/2 + cliprect.min_x]; |
| 95 | 95 | UINT16 *dst = &bitmap.pix16(y, cliprect.min_x); |
| 96 | 96 | |
| 97 | 97 | for (x = cliprect.min_x; x <= cliprect.max_x; x += 2) |
| r14899 | r14900 | |
| 124 | 124 | |
| 125 | 125 | int j, k; |
| 126 | 126 | |
| 127 | | UINT16 attr = state->m_dma_ram.target()[offs]; |
| 127 | UINT16 attr = state->m_dma_ram[offs]; |
| 128 | 128 | |
| 129 | 129 | if (attr == 0) |
| 130 | 130 | continue; |
| 131 | 131 | |
| 132 | | x = state->m_dma_ram.target()[offs + 1]; |
| 133 | | y = state->m_dma_ram.target()[offs + 2]; |
| 134 | | colour = state->m_dma_ram.target()[offs + 3]; |
| 132 | x = state->m_dma_ram[offs + 1]; |
| 133 | y = state->m_dma_ram[offs + 2]; |
| 134 | colour = state->m_dma_ram[offs + 3]; |
| 135 | 135 | |
| 136 | 136 | dx = x >> 11; |
| 137 | 137 | dy = y >> 11; |
| r14899 | r14900 | |
| 166 | 166 | // Draw the 8x8 chunk |
| 167 | 167 | for (y1 = 0; y1 < 8; ++y1) |
| 168 | 168 | { |
| 169 | | UINT16 *src = &state->m_ml_tileram.target()[(code * 2 * 8) + y1*2]; |
| 170 | | UINT16 *dst = &state->m_g_ram.target()[(y + k*8+y1)*512/2 + (j*8+x)/2]; |
| 169 | UINT16 *src = &state->m_ml_tileram[(code * 2 * 8) + y1*2]; |
| 170 | UINT16 *dst = &state->m_g_ram[(y + k*8+y1)*512/2 + (j*8+x)/2]; |
| 171 | 171 | |
| 172 | 172 | UINT8 p2 = *src & 0xff; |
| 173 | 173 | UINT8 p1 = *src++ >> 8; |
| r14899 | r14900 | |
| 214 | 214 | for(y1 = 0; y1 < dy*8; y1++) |
| 215 | 215 | { |
| 216 | 216 | int x1; |
| 217 | | UINT16 *dst = &state->m_g_ram.target()[((y + y1) * 512/2) + x/2]; |
| 217 | UINT16 *dst = &state->m_g_ram[((y + y1) * 512/2) + x/2]; |
| 218 | 218 | |
| 219 | 219 | for(x1 = 0; x1 < dx*8; x1+=2) |
| 220 | 220 | { |
| r14899 | r14900 | |
| 228 | 228 | |
| 229 | 229 | WRITE16_MEMBER(mlanding_state::ml_tileram_w) |
| 230 | 230 | { |
| 231 | | COMBINE_DATA(&m_ml_tileram.target()[offset]); |
| 231 | COMBINE_DATA(&m_ml_tileram[offset]); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | READ16_MEMBER(mlanding_state::ml_tileram_r) |
| 235 | 235 | { |
| 236 | | return m_ml_tileram.target()[offset]; |
| 236 | return m_ml_tileram[offset]; |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| r14899 | r14900 | |
| 459 | 459 | |
| 460 | 460 | READ16_MEMBER(mlanding_state::ml_mecha_ram_r) |
| 461 | 461 | { |
| 462 | | return (m_mecha_ram.target()[offset*2]<<8)|m_mecha_ram.target()[offset*2+1]; |
| 462 | return (m_mecha_ram[offset*2]<<8)|m_mecha_ram[offset*2+1]; |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | WRITE16_MEMBER(mlanding_state::ml_mecha_ram_w) |
| r14899 | r14900 | |
| 476 | 476 | |
| 477 | 477 | AM_RANGE(0x100000, 0x17ffff) AM_RAM AM_SHARE("g_ram")// 512kB G RAM - enough here for double buffered 512x400x8 frame |
| 478 | 478 | AM_RANGE(0x180000, 0x1bffff) AM_READWRITE(ml_tileram_r, ml_tileram_w) AM_SHARE("ml_tileram") |
| 479 | | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") AM_SHARE("dma_ram") |
| 479 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("dma_ram") |
| 480 | 480 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 481 | 481 | |
| 482 | 482 | AM_RANGE(0x1d0000, 0x1d0001) AM_WRITE(ml_sub_reset_w) |
| r14899 | r14900 | |
| 512 | 512 | AM_RANGE(0x000000, 0x01ffff) AM_ROM |
| 513 | 513 | AM_RANGE(0x040000, 0x043fff) AM_RAM |
| 514 | 514 | AM_RANGE(0x050000, 0x0503ff) AM_RAM AM_SHARE("share3") |
| 515 | | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("share2") |
| 515 | AM_RANGE(0x1c0000, 0x1c3fff) AM_RAM AM_SHARE("dma_ram") |
| 516 | 516 | AM_RANGE(0x1c4000, 0x1cffff) AM_RAM AM_SHARE("share1") |
| 517 | 517 | AM_RANGE(0x200000, 0x203fff) AM_RAM AM_SHARE("ml_dotram") |
| 518 | 518 | ADDRESS_MAP_END |
| r14899 | r14900 | |
| 549 | 549 | |
| 550 | 550 | READ16_MEMBER(mlanding_state::ml_dotram_r) |
| 551 | 551 | { |
| 552 | | return m_ml_dotram.target()[offset]; |
| 552 | return m_ml_dotram[offset]; |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | WRITE16_MEMBER(mlanding_state::ml_dotram_w) |
| 556 | 556 | { |
| 557 | | m_ml_dotram.target()[offset] = data; |
| 557 | m_ml_dotram[offset] = data; |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | READ16_MEMBER(mlanding_state::dsp_HOLD_signal_r) |
src/mame/drivers/seattle.c
| r14899 | r14900 | |
| 428 | 428 | : driver_device(mconfig, type, tag), |
| 429 | 429 | m_nvram(*this, "nvram") , |
| 430 | 430 | m_rambase(*this, "rambase"), |
| 431 | | m_interrupt_enable(*this, "interrupt_enable"), |
| 432 | | m_interrupt_config(*this, "interrupt_config"), |
| 431 | m_interrupt_enable(*this, "int_enable"), |
| 432 | m_interrupt_config(*this, "int_config"), |
| 433 | 433 | m_asic_reset(*this, "asic_reset"), |
| 434 | 434 | m_rombase(*this, "rombase"){ } |
| 435 | 435 | |
| r14899 | r14900 | |
| 534 | 534 | mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY); |
| 535 | 535 | |
| 536 | 536 | /* configure fast RAM regions for DRC */ |
| 537 | | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase.target()); |
| 538 | | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase.target()); |
| 537 | mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x007fffff, FALSE, state->m_rambase); |
| 538 | mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->m_rombase); |
| 539 | 539 | |
| 540 | 540 | /* register for save states */ |
| 541 | 541 | state_save_register_global_array(machine, state->m_galileo.reg); |
| r14899 | r14900 | |
| 677 | 677 | WRITE32_MEMBER(seattle_state::interrupt_config_w) |
| 678 | 678 | { |
| 679 | 679 | int irq; |
| 680 | | COMBINE_DATA(m_interrupt_config.target()); |
| 680 | COMBINE_DATA(m_interrupt_config); |
| 681 | 681 | |
| 682 | 682 | /* VBLANK: clear anything pending on the old IRQ */ |
| 683 | 683 | if (m_vblank_irq_num != 0) |
| r14899 | r14900 | |
| 719 | 719 | |
| 720 | 720 | WRITE32_MEMBER(seattle_state::seattle_interrupt_enable_w) |
| 721 | 721 | { |
| 722 | | UINT32 old = *m_interrupt_enable.target(); |
| 723 | | COMBINE_DATA(m_interrupt_enable.target()); |
| 724 | | if (old != *m_interrupt_enable.target()) |
| 722 | UINT32 old = *m_interrupt_enable; |
| 723 | COMBINE_DATA(m_interrupt_enable); |
| 724 | if (old != *m_interrupt_enable) |
| 725 | 725 | { |
| 726 | 726 | if (m_vblank_latch) |
| 727 | 727 | update_vblank_irq(machine()); |
| r14899 | r14900 | |
| 1628 | 1628 | |
| 1629 | 1629 | READ32_MEMBER(seattle_state::cmos_r) |
| 1630 | 1630 | { |
| 1631 | | return m_nvram.target()[offset]; |
| 1631 | return m_nvram[offset]; |
| 1632 | 1632 | } |
| 1633 | 1633 | |
| 1634 | 1634 | |
| r14899 | r14900 | |
| 1659 | 1659 | |
| 1660 | 1660 | WRITE32_MEMBER(seattle_state::asic_reset_w) |
| 1661 | 1661 | { |
| 1662 | | COMBINE_DATA(m_asic_reset.target()); |
| 1662 | COMBINE_DATA(m_asic_reset); |
| 1663 | 1663 | if (!(*m_asic_reset & 0x0002)) |
| 1664 | 1664 | midway_ioasic_reset(machine()); |
| 1665 | 1665 | } |
| r14899 | r14900 | |
| 1783 | 1783 | AM_RANGE(0x16100000, 0x1611ffff) AM_READWRITE(cmos_r, cmos_w) AM_SHARE("nvram") |
| 1784 | 1784 | AM_RANGE(0x17000000, 0x17000003) AM_READWRITE(cmos_protect_r, cmos_protect_w) |
| 1785 | 1785 | AM_RANGE(0x17100000, 0x17100003) AM_WRITE(seattle_watchdog_w) |
| 1786 | | AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_SHARE("interrupt_enable") |
| 1787 | | AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_SHARE("interrupt_config") |
| 1786 | AM_RANGE(0x17300000, 0x17300003) AM_RAM_WRITE(seattle_interrupt_enable_w) AM_SHARE("int_enable") |
| 1787 | AM_RANGE(0x17400000, 0x17400003) AM_RAM_WRITE(interrupt_config_w) AM_SHARE("int_config") |
| 1788 | 1788 | AM_RANGE(0x17500000, 0x17500003) AM_READ(interrupt_state_r) |
| 1789 | 1789 | AM_RANGE(0x17600000, 0x17600003) AM_READ(interrupt_state2_r) |
| 1790 | 1790 | AM_RANGE(0x17700000, 0x17700003) AM_WRITE(vblank_clear_w) |
| r14899 | r14900 | |
| 2937 | 2937 | init_common(machine, MIDWAY_IOASIC_BLITZ99, 444/* or 528 */, 80, SEATTLE_CONFIG); |
| 2938 | 2938 | |
| 2939 | 2939 | /* for some reason, the code in the ROM appears buggy; this is a small patch to fix it */ |
| 2940 | | state->m_rombase.target()[0x934/4] += 4; |
| 2940 | state->m_rombase[0x934/4] += 4; |
| 2941 | 2941 | |
| 2942 | 2942 | /* main CPU speedups */ |
| 2943 | 2943 | mips3drc_add_hotspot(machine.device("maincpu"), 0x80135510, 0x3C028024, 250); /* confirmed */ |
src/mame/drivers/jackie.c
| r14899 | r14900 | |
| 111 | 111 | static TILE_GET_INFO( get_fg_tile_info ) |
| 112 | 112 | { |
| 113 | 113 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 114 | | int code = state->m_fg_tile_ram.target()[tile_index] | (state->m_fg_color_ram.target()[tile_index] << 8); |
| 114 | int code = state->m_fg_tile_ram[tile_index] | (state->m_fg_color_ram[tile_index] << 8); |
| 115 | 115 | int tile = code & 0x1fff; |
| 116 | 116 | SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | WRITE8_MEMBER(jackie_state::fg_tile_w) |
| 120 | 120 | { |
| 121 | | m_fg_tile_ram.target()[offset] = data; |
| 121 | m_fg_tile_ram[offset] = data; |
| 122 | 122 | m_fg_tilemap->mark_tile_dirty(offset); |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | WRITE8_MEMBER(jackie_state::fg_color_w) |
| 126 | 126 | { |
| 127 | | m_fg_color_ram.target()[offset] = data; |
| 127 | m_fg_color_ram[offset] = data; |
| 128 | 128 | m_fg_tilemap->mark_tile_dirty(offset); |
| 129 | 129 | } |
| 130 | 130 | |
| r14899 | r14900 | |
| 133 | 133 | |
| 134 | 134 | WRITE8_MEMBER(jackie_state::bg_scroll_w) |
| 135 | 135 | { |
| 136 | | m_bg_scroll.target()[offset] = data; |
| 136 | m_bg_scroll[offset] = data; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | 140 | WRITE8_MEMBER(jackie_state::jackie_reel1_ram_w) |
| 141 | 141 | { |
| 142 | | m_reel1_ram.target()[offset] = data; |
| 142 | m_reel1_ram[offset] = data; |
| 143 | 143 | m_reel1_tilemap->mark_tile_dirty(offset); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | static TILE_GET_INFO( get_jackie_reel1_tile_info ) |
| 147 | 147 | { |
| 148 | 148 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 149 | | int code = state->m_reel1_ram.target()[tile_index]; |
| 149 | int code = state->m_reel1_ram[tile_index]; |
| 150 | 150 | SET_TILE_INFO(1, code, 0, 0); |
| 151 | 151 | } |
| 152 | 152 | |
| r14899 | r14900 | |
| 154 | 154 | |
| 155 | 155 | WRITE8_MEMBER(jackie_state::jackie_reel2_ram_w) |
| 156 | 156 | { |
| 157 | | m_reel2_ram.target()[offset] = data; |
| 157 | m_reel2_ram[offset] = data; |
| 158 | 158 | m_reel2_tilemap->mark_tile_dirty(offset); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static TILE_GET_INFO( get_jackie_reel2_tile_info ) |
| 162 | 162 | { |
| 163 | 163 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 164 | | int code = state->m_reel2_ram.target()[tile_index]; |
| 164 | int code = state->m_reel2_ram[tile_index]; |
| 165 | 165 | SET_TILE_INFO(1, code, 0, 0); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | WRITE8_MEMBER(jackie_state::jackie_reel3_ram_w) |
| 170 | 170 | { |
| 171 | | m_reel3_ram.target()[offset] = data; |
| 171 | m_reel3_ram[offset] = data; |
| 172 | 172 | m_reel3_tilemap->mark_tile_dirty(offset); |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | static TILE_GET_INFO( get_jackie_reel3_tile_info ) |
| 176 | 176 | { |
| 177 | 177 | jackie_state *state = machine.driver_data<jackie_state>(); |
| 178 | | int code = state->m_reel3_ram.target()[tile_index]; |
| 178 | int code = state->m_reel3_ram[tile_index]; |
| 179 | 179 | SET_TILE_INFO(1, code, 0, 0); |
| 180 | 180 | } |
| 181 | 181 | |
| r14899 | r14900 | |
| 206 | 206 | |
| 207 | 207 | for (i=0;i < 0x40;i++) |
| 208 | 208 | { |
| 209 | | state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x000]); |
| 210 | | state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x040]); |
| 211 | | state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll.target()[i+0x080]); |
| 209 | state->m_reel1_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x000]); |
| 210 | state->m_reel2_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x040]); |
| 211 | state->m_reel3_tilemap->set_scrolly(i, state->m_bg_scroll[i+0x080]); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | for (j=0; j < 0x100-1; j++) |
| 215 | 215 | { |
| 216 | 216 | rectangle clip; |
| 217 | | int rowenable = state->m_bg_scroll2.target()[j]; |
| 217 | int rowenable = state->m_bg_scroll2[j]; |
| 218 | 218 | |
| 219 | 219 | /* draw top of screen */ |
| 220 | 220 | clip.set(visarea.min_x, visarea.max_x, startclipmin, startclipmin+1); |
src/mame/drivers/dreamwld.c
| r14899 | r14900 | |
| 229 | 229 | |
| 230 | 230 | WRITE32_MEMBER(dreamwld_state::dreamwld_bg_videoram_w) |
| 231 | 231 | { |
| 232 | | COMBINE_DATA(&m_bg_videoram.target()[offset]); |
| 232 | COMBINE_DATA(&m_bg_videoram[offset]); |
| 233 | 233 | m_bg_tilemap->mark_tile_dirty(offset * 2); |
| 234 | 234 | m_bg_tilemap->mark_tile_dirty(offset * 2 + 1); |
| 235 | 235 | } |
| r14899 | r14900 | |
| 238 | 238 | { |
| 239 | 239 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 240 | 240 | int tileno, colour; |
| 241 | | tileno = (tile_index & 1) ? (state->m_bg_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram.target()[tile_index >> 1] >> 16) & 0xffff); |
| 241 | tileno = (tile_index & 1) ? (state->m_bg_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg_videoram[tile_index >> 1] >> 16) & 0xffff); |
| 242 | 242 | colour = tileno >> 13; |
| 243 | 243 | tileno &= 0x1fff; |
| 244 | 244 | SET_TILE_INFO(1, tileno + state->m_tilebank[0] * 0x2000, 0x80 + colour, 0); |
| r14899 | r14900 | |
| 247 | 247 | |
| 248 | 248 | WRITE32_MEMBER(dreamwld_state::dreamwld_bg2_videoram_w) |
| 249 | 249 | { |
| 250 | | COMBINE_DATA(&m_bg2_videoram.target()[offset]); |
| 250 | COMBINE_DATA(&m_bg2_videoram[offset]); |
| 251 | 251 | m_bg2_tilemap->mark_tile_dirty(offset * 2); |
| 252 | 252 | m_bg2_tilemap->mark_tile_dirty(offset * 2 + 1); |
| 253 | 253 | } |
| r14899 | r14900 | |
| 256 | 256 | { |
| 257 | 257 | dreamwld_state *state = machine.driver_data<dreamwld_state>(); |
| 258 | 258 | UINT16 tileno, colour; |
| 259 | | tileno = (tile_index & 1) ? (state->m_bg2_videoram.target()[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram.target()[tile_index >> 1] >> 16) & 0xffff); |
| 259 | tileno = (tile_index & 1) ? (state->m_bg2_videoram[tile_index >> 1] & 0xffff) : ((state->m_bg2_videoram[tile_index >> 1] >> 16) & 0xffff); |
| 260 | 260 | colour = tileno >> 13; |
| 261 | 261 | tileno &= 0x1fff; |
| 262 | 262 | SET_TILE_INFO(1, tileno + state->m_tilebank[1] * 0x2000, 0xc0 + colour, 0); |
| r14899 | r14900 | |
| 304 | 304 | tmptilemap0 = state->m_bg_tilemap; |
| 305 | 305 | tmptilemap1 = state->m_bg2_tilemap; |
| 306 | 306 | |
| 307 | | int layer0_scrolly = state->m_vregs.target()[(0x400 / 4)] + 32; |
| 308 | | int layer1_scrolly = state->m_vregs.target()[(0x400 / 4) + 2] + 32; |
| 307 | int layer0_scrolly = state->m_vregs[(0x400 / 4)] + 32; |
| 308 | int layer1_scrolly = state->m_vregs[(0x400 / 4) + 2] + 32; |
| 309 | 309 | |
| 310 | | int layer0_scrollx = state->m_vregs.target()[(0x400 / 4) + 1] + 3; |
| 311 | | int layer1_scrollx = state->m_vregs.target()[(0x400 / 4) + 3] + 5; |
| 312 | | UINT32 layer0_ctrl = state->m_vregs.target()[0x412 / 4]; |
| 313 | | UINT32 layer1_ctrl = state->m_vregs.target()[0x416 / 4]; |
| 310 | int layer0_scrollx = state->m_vregs[(0x400 / 4) + 1] + 3; |
| 311 | int layer1_scrollx = state->m_vregs[(0x400 / 4) + 3] + 5; |
| 312 | UINT32 layer0_ctrl = state->m_vregs[0x412 / 4]; |
| 313 | UINT32 layer1_ctrl = state->m_vregs[0x416 / 4]; |
| 314 | 314 | |
| 315 | 315 | tmptilemap0->set_scrolly(0, layer0_scrolly); |
| 316 | 316 | tmptilemap1->set_scrolly(0, layer1_scrolly); |
| r14899 | r14900 | |
| 340 | 340 | int x0 = 0, x1 = 0; |
| 341 | 341 | |
| 342 | 342 | /* layer 0 */ |
| 343 | UINT16 *vregs = reinterpret_cast<UINT16 *>(state->m_vregs.target()); |
| 343 | 344 | if (layer0_ctrl & 0x0300) |
| 344 | 345 | { |
| 345 | 346 | if (layer0_ctrl & 0x0200) |
| 346 | 347 | /* per-tile rowscroll */ |
| 347 | | x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + i/16)]; |
| 348 | x0 = vregs[BYTE_XOR_BE(0x000/2 + i/16)]; |
| 348 | 349 | else |
| 349 | 350 | /* per-line rowscroll */ |
| 350 | | x0 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) |
| 351 | x0 = vregs[BYTE_XOR_BE(0x000/2 + ((i + layer0_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) |
| 351 | 352 | } |
| 352 | 353 | |
| 353 | 354 | |
| r14899 | r14900 | |
| 361 | 362 | { |
| 362 | 363 | if (layer1_ctrl & 0x0200) |
| 363 | 364 | /* per-tile rowscroll */ |
| 364 | | x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + i/16)]; |
| 365 | x1 = vregs[BYTE_XOR_BE(0x200/2 + i/16)]; |
| 365 | 366 | else |
| 366 | 367 | /* per-line rowscroll */ |
| 367 | | x1 = ((UINT16 *)state->m_vregs.target())[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) |
| 368 | x1 = vregs[BYTE_XOR_BE(0x200/2 + ((i + layer1_scrolly)&0xff))]; // different handling to psikyo.c? ( + scrolly ) |
| 368 | 369 | } |
| 369 | 370 | |
| 370 | 371 | |
| r14899 | r14900 | |
| 374 | 375 | } |
| 375 | 376 | |
| 376 | 377 | |
| 377 | | state->m_tilebank[0] = (state->m_vregs.target()[(0x400 / 4) + 4] >> 6) & 1; |
| 378 | | state->m_tilebank[1] = (state->m_vregs.target()[(0x400 / 4) + 5] >> 6) & 1; |
| 378 | state->m_tilebank[0] = (state->m_vregs[(0x400 / 4) + 4] >> 6) & 1; |
| 379 | state->m_tilebank[1] = (state->m_vregs[(0x400 / 4) + 5] >> 6) & 1; |
| 379 | 380 | |
| 380 | 381 | if (state->m_tilebank[0] != state->m_tilebankold[0]) |
| 381 | 382 | { |
| r14899 | r14900 | |
| 445 | 446 | UINT16 dat; |
| 446 | 447 | int color; |
| 447 | 448 | |
| 448 | | COMBINE_DATA(&m_paletteram.target()[offset]); |
| 449 | COMBINE_DATA(&m_paletteram[offset]); |
| 449 | 450 | color = offset * 2; |
| 450 | 451 | |
| 451 | | dat = m_paletteram.target()[offset] & 0x7fff; |
| 452 | dat = m_paletteram[offset] & 0x7fff; |
| 452 | 453 | palette_set_color_rgb(machine(), color+1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0)); |
| 453 | 454 | |
| 454 | | dat = (m_paletteram.target()[offset] >> 16) & 0x7fff; |
| 455 | dat = (m_paletteram[offset] >> 16) & 0x7fff; |
| 455 | 456 | palette_set_color_rgb(machine(), color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0)); |
| 456 | 457 | } |
| 457 | 458 | |
src/mame/drivers/jalmah.c
| r14899 | r14900 | |
| 239 | 239 | static TILE_GET_INFO( get_sc0_tile_info ) |
| 240 | 240 | { |
| 241 | 241 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 242 | | int code = state->m_sc0_vram.target()[tile_index]; |
| 242 | int code = state->m_sc0_vram[tile_index]; |
| 243 | 243 | SET_TILE_INFO( |
| 244 | 244 | 3, |
| 245 | 245 | (code & 0xfff) + ((state->m_sc0bank & 3) << 12), |
| r14899 | r14900 | |
| 250 | 250 | static TILE_GET_INFO( get_sc1_tile_info ) |
| 251 | 251 | { |
| 252 | 252 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 253 | | int code = state->m_sc1_vram.target()[tile_index]; |
| 253 | int code = state->m_sc1_vram[tile_index]; |
| 254 | 254 | SET_TILE_INFO( |
| 255 | 255 | 2, |
| 256 | 256 | code & 0xfff, |
| r14899 | r14900 | |
| 261 | 261 | static TILE_GET_INFO( get_sc2_tile_info ) |
| 262 | 262 | { |
| 263 | 263 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 264 | | int code = state->m_sc2_vram.target()[tile_index]; |
| 264 | int code = state->m_sc2_vram[tile_index]; |
| 265 | 265 | SET_TILE_INFO( |
| 266 | 266 | 1, |
| 267 | 267 | code & 0xfff, |
| r14899 | r14900 | |
| 272 | 272 | static TILE_GET_INFO( get_sc3_tile_info ) |
| 273 | 273 | { |
| 274 | 274 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 275 | | int code = state->m_sc3_vram.target()[tile_index]; |
| 275 | int code = state->m_sc3_vram[tile_index]; |
| 276 | 276 | SET_TILE_INFO( |
| 277 | 277 | 0, |
| 278 | 278 | code & 0xfff, |
| r14899 | r14900 | |
| 502 | 502 | |
| 503 | 503 | WRITE16_MEMBER(jalmah_state::sc0_vram_w) |
| 504 | 504 | { |
| 505 | | COMBINE_DATA(&m_sc0_vram.target()[offset]); |
| 505 | COMBINE_DATA(&m_sc0_vram[offset]); |
| 506 | 506 | /*2048x256 tilemap*/ |
| 507 | 507 | m_sc0_tilemap_0->mark_tile_dirty(offset); |
| 508 | 508 | /*1024x512 tilemap*/ |
| r14899 | r14900 | |
| 515 | 515 | |
| 516 | 516 | WRITE16_MEMBER(jalmah_state::sc3_vram_w) |
| 517 | 517 | { |
| 518 | | COMBINE_DATA(&m_sc3_vram.target()[offset]); |
| 518 | COMBINE_DATA(&m_sc3_vram[offset]); |
| 519 | 519 | /*2048x256 tilemap*/ |
| 520 | 520 | m_sc3_tilemap_0->mark_tile_dirty(offset); |
| 521 | 521 | /*1024x512 tilemap*/ |
| r14899 | r14900 | |
| 526 | 526 | |
| 527 | 527 | WRITE16_MEMBER(jalmah_state::sc1_vram_w) |
| 528 | 528 | { |
| 529 | | COMBINE_DATA(&m_sc1_vram.target()[offset]); |
| 529 | COMBINE_DATA(&m_sc1_vram[offset]); |
| 530 | 530 | /*2048x256 tilemap*/ |
| 531 | 531 | m_sc1_tilemap_0->mark_tile_dirty(offset); |
| 532 | 532 | /*1024x512 tilemap*/ |
| r14899 | r14900 | |
| 539 | 539 | |
| 540 | 540 | WRITE16_MEMBER(jalmah_state::sc2_vram_w) |
| 541 | 541 | { |
| 542 | | COMBINE_DATA(&m_sc2_vram.target()[offset]); |
| 542 | COMBINE_DATA(&m_sc2_vram[offset]); |
| 543 | 543 | /*2048x256 tilemap*/ |
| 544 | 544 | m_sc2_tilemap_0->mark_tile_dirty(offset); |
| 545 | 545 | /*1024x512 tilemap*/ |
| r14899 | r14900 | |
| 617 | 617 | |
| 618 | 618 | WRITE16_MEMBER(jalmah_state::urashima_sc0_vram_w) |
| 619 | 619 | { |
| 620 | | COMBINE_DATA(&m_sc0_vram.target()[offset]); |
| 620 | COMBINE_DATA(&m_sc0_vram[offset]); |
| 621 | 621 | m_sc0_tilemap_0->mark_tile_dirty(offset); |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | WRITE16_MEMBER(jalmah_state::urashima_sc3_vram_w) |
| 625 | 625 | { |
| 626 | | COMBINE_DATA(&m_sc3_vram.target()[offset]); |
| 626 | COMBINE_DATA(&m_sc3_vram[offset]); |
| 627 | 627 | m_sc3_tilemap_0->mark_tile_dirty(offset); |
| 628 | 628 | } |
| 629 | 629 | |
| r14899 | r14900 | |
| 739 | 739 | static void daireika_mcu_run(running_machine &machine) |
| 740 | 740 | { |
| 741 | 741 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 742 | | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); |
| 742 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; |
| 743 | 743 | |
| 744 | 744 | if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != state->m_dma_old)) |
| 745 | 745 | { |
| r14899 | r14900 | |
| 789 | 789 | static void mjzoomin_mcu_run(running_machine &machine) |
| 790 | 790 | { |
| 791 | 791 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 792 | | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); |
| 792 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; |
| 793 | 793 | |
| 794 | 794 | if(state->m_test_mode) //service_mode |
| 795 | 795 | { |
| r14899 | r14900 | |
| 834 | 834 | static void urashima_mcu_run(running_machine &machine) |
| 835 | 835 | { |
| 836 | 836 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 837 | | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); |
| 837 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; |
| 838 | 838 | |
| 839 | 839 | if(state->m_test_mode) //service_mode |
| 840 | 840 | { |
| r14899 | r14900 | |
| 879 | 879 | static void second_mcu_run(running_machine &machine) |
| 880 | 880 | { |
| 881 | 881 | jalmah_state *state = machine.driver_data<jalmah_state>(); |
| 882 | | UINT16 *jm_shared_ram = state->m_jm_shared_ram.target(); |
| 882 | UINT16 *jm_shared_ram = state->m_jm_shared_ram; |
| 883 | 883 | if(state->m_test_mode) //service_mode |
| 884 | 884 | { |
| 885 | 885 | jm_shared_ram[0x200/2] = input_port_read(machine, "KEY0"); |
| r14899 | r14900 | |
| 1759 | 1759 | */ |
| 1760 | 1760 | WRITE16_MEMBER(jalmah_state::urashima_mcu_w) |
| 1761 | 1761 | { |
| 1762 | | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); |
| 1763 | | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); |
| 1762 | UINT16 *jm_shared_ram = m_jm_shared_ram; |
| 1763 | UINT16 *jm_mcu_code = m_jm_mcu_code; |
| 1764 | 1764 | if(ACCESSING_BITS_0_7 && data) |
| 1765 | 1765 | { |
| 1766 | 1766 | /******************************************************* |
| r14899 | r14900 | |
| 1980 | 1980 | |
| 1981 | 1981 | WRITE16_MEMBER(jalmah_state::daireika_mcu_w) |
| 1982 | 1982 | { |
| 1983 | | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); |
| 1984 | | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); |
| 1983 | UINT16 *jm_shared_ram = m_jm_shared_ram; |
| 1984 | UINT16 *jm_mcu_code = m_jm_mcu_code; |
| 1985 | 1985 | UINT16 i; |
| 1986 | 1986 | |
| 1987 | 1987 | if(ACCESSING_BITS_0_7 && data) |
| r14899 | r14900 | |
| 2256 | 2256 | */ |
| 2257 | 2257 | WRITE16_MEMBER(jalmah_state::mjzoomin_mcu_w) |
| 2258 | 2258 | { |
| 2259 | | UINT16 *jm_shared_ram = m_jm_shared_ram.target(); |
| 2260 | | UINT16 *jm_mcu_code = m_jm_mcu_code.target(); |
| 2259 | UINT16 *jm_shared_ram = m_jm_shared_ram; |
| 2260 | UINT16 *jm_mcu_code = m_jm_mcu_code; |
| 2261 | 2261 | if(ACCESSING_BITS_0_7 && data) |
| 2262 | 2262 | { |
| 2263 | 2263 | /****************************************************** |
src/mame/drivers/pzletime.c
| r14899 | r14900 | |
| 57 | 57 | static TILE_GET_INFO( get_mid_tile_info ) |
| 58 | 58 | { |
| 59 | 59 | pzletime_state *state = machine.driver_data<pzletime_state>(); |
| 60 | | int tileno = state->m_mid_videoram.target()[tile_index] & 0x0fff; |
| 61 | | int colour = state->m_mid_videoram.target()[tile_index] & 0xf000; |
| 60 | int tileno = state->m_mid_videoram[tile_index] & 0x0fff; |
| 61 | int colour = state->m_mid_videoram[tile_index] & 0xf000; |
| 62 | 62 | colour = colour >> 12; |
| 63 | 63 | SET_TILE_INFO(2, tileno, colour, 0); |
| 64 | 64 | } |
| r14899 | r14900 | |
| 66 | 66 | static TILE_GET_INFO( get_txt_tile_info ) |
| 67 | 67 | { |
| 68 | 68 | pzletime_state *state = machine.driver_data<pzletime_state>(); |
| 69 | | int tileno = state->m_txt_videoram.target()[tile_index] & 0x0fff; |
| 70 | | int colour = state->m_txt_videoram.target()[tile_index] & 0xf000; |
| 69 | int tileno = state->m_txt_videoram[tile_index] & 0x0fff; |
| 70 | int colour = state->m_txt_videoram[tile_index] & 0xf000; |
| 71 | 71 | colour = colour >> 12; |
| 72 | 72 | |
| 73 | 73 | SET_TILE_INFO(0, tileno, colour, 0); |
| r14899 | r14900 | |
| 94 | 94 | |
| 95 | 95 | bitmap.fill(screen.machine().pens[0], cliprect); //bg pen |
| 96 | 96 | |
| 97 | | state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[0] - 3); |
| 98 | | state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[1]); |
| 97 | state->m_txt_tilemap->set_scrolly(0, state->m_tilemap_regs[0] - 3); |
| 98 | state->m_txt_tilemap->set_scrollx(0, state->m_tilemap_regs[1]); |
| 99 | 99 | |
| 100 | | state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs.target()[2] - 3); |
| 101 | | state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs.target()[3] - 7); |
| 100 | state->m_mid_tilemap->set_scrolly(0, state->m_tilemap_regs[2] - 3); |
| 101 | state->m_mid_tilemap->set_scrollx(0, state->m_tilemap_regs[3] - 7); |
| 102 | 102 | |
| 103 | | if (state->m_video_regs.target()[2] & 1) |
| 103 | if (state->m_video_regs[2] & 1) |
| 104 | 104 | { |
| 105 | 105 | count = 0; |
| 106 | 106 | |
| r14899 | r14900 | |
| 108 | 108 | { |
| 109 | 109 | for (x = 0; x < 512; x++) |
| 110 | 110 | { |
| 111 | | if (state->m_bg_videoram.target()[count] & 0x8000) |
| 112 | | bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram.target()[count] & 0x7fff); |
| 111 | if (state->m_bg_videoram[count] & 0x8000) |
| 112 | bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (state->m_bg_videoram[count] & 0x7fff); |
| 113 | 113 | |
| 114 | 114 | count++; |
| 115 | 115 | } |
| r14899 | r14900 | |
| 119 | 119 | state->m_mid_tilemap->draw(bitmap, cliprect, 0, 0); |
| 120 | 120 | |
| 121 | 121 | { |
| 122 | | UINT16 *spriteram = state->m_spriteram.target(); |
| 122 | UINT16 *spriteram = state->m_spriteram; |
| 123 | 123 | int offs, spr_offs, colour, sx, sy; |
| 124 | 124 | |
| 125 | 125 | for(offs = 0; offs < 0x2000 / 2; offs += 4) |
| r14899 | r14900 | |
| 147 | 147 | |
| 148 | 148 | WRITE16_MEMBER(pzletime_state::mid_videoram_w) |
| 149 | 149 | { |
| 150 | | COMBINE_DATA(&m_mid_videoram.target()[offset]); |
| 150 | COMBINE_DATA(&m_mid_videoram[offset]); |
| 151 | 151 | m_mid_tilemap->mark_tile_dirty(offset); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | WRITE16_MEMBER(pzletime_state::txt_videoram_w) |
| 155 | 155 | { |
| 156 | | COMBINE_DATA(&m_txt_videoram.target()[offset]); |
| 156 | COMBINE_DATA(&m_txt_videoram[offset]); |
| 157 | 157 | m_txt_tilemap->mark_tile_dirty(offset); |
| 158 | 158 | } |
| 159 | 159 | |
| r14899 | r14900 | |
| 179 | 179 | { |
| 180 | 180 | int i; |
| 181 | 181 | |
| 182 | | COMBINE_DATA(&m_video_regs.target()[offset]); |
| 182 | COMBINE_DATA(&m_video_regs[offset]); |
| 183 | 183 | |
| 184 | 184 | if (offset == 0) |
| 185 | 185 | { |
| 186 | | if (m_video_regs.target()[0] > 0) |
| 186 | if (m_video_regs[0] > 0) |
| 187 | 187 | { |
| 188 | 188 | for (i = 0; i < 0x300; i++) |
| 189 | 189 | { |
| 190 | | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[0]); |
| 190 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[0]); |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | } |
| 194 | 194 | else if (offset == 1) |
| 195 | 195 | { |
| 196 | | if (m_video_regs.target()[1] > 0) |
| 196 | if (m_video_regs[1] > 0) |
| 197 | 197 | { |
| 198 | 198 | for (i = 0x300; i < 32768 + 0x300; i++) |
| 199 | 199 | { |
| 200 | | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs.target()[1]); |
| 200 | palette_set_pen_contrast(machine(), i, (double)0x8000/(double)m_video_regs[1]); |
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | } |
src/mame/drivers/peplus.c
| r14899 | r14900 | |
| 371 | 371 | |
| 372 | 372 | WRITE8_MEMBER(peplus_state::peplus_crtc_display_w) |
| 373 | 373 | { |
| 374 | | UINT8 *videoram = m_videoram.target(); |
| 374 | UINT8 *videoram = m_videoram; |
| 375 | 375 | videoram[m_vid_address] = data; |
| 376 | | m_palette_ram[m_vid_address] = m_io_port.target()[1]; |
| 377 | | m_palette_ram2[m_vid_address] = m_io_port.target()[3]; |
| 376 | m_palette_ram[m_vid_address] = m_io_port[1]; |
| 377 | m_palette_ram2[m_vid_address] = m_io_port[3]; |
| 378 | 378 | |
| 379 | 379 | m_bg_tilemap->mark_tile_dirty(m_vid_address); |
| 380 | 380 | |
| r14899 | r14900 | |
| 384 | 384 | |
| 385 | 385 | WRITE8_MEMBER(peplus_state::peplus_io_w) |
| 386 | 386 | { |
| 387 | | m_io_port.target()[offset] = data; |
| 387 | m_io_port[offset] = data; |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | WRITE8_MEMBER(peplus_state::peplus_duart_w) |
| r14899 | r14900 | |
| 403 | 403 | peplus_load_superdata(machine(), bank_name); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | | m_cmos_ram.target()[offset] = data; |
| 406 | m_cmos_ram[offset] = data; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | WRITE8_MEMBER(peplus_state::peplus_s3000_w) |
| 410 | 410 | { |
| 411 | | m_s3000_ram.target()[offset] = data; |
| 411 | m_s3000_ram[offset] = data; |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | WRITE8_MEMBER(peplus_state::peplus_s5000_w) |
| 415 | 415 | { |
| 416 | | m_s5000_ram.target()[offset] = data; |
| 416 | m_s5000_ram[offset] = data; |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | WRITE8_MEMBER(peplus_state::peplus_s7000_w) |
| 420 | 420 | { |
| 421 | | m_s7000_ram.target()[offset] = data; |
| 421 | m_s7000_ram[offset] = data; |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | WRITE8_MEMBER(peplus_state::peplus_sb000_w) |
| 425 | 425 | { |
| 426 | | m_sb000_ram.target()[offset] = data; |
| 426 | m_sb000_ram[offset] = data; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | WRITE8_MEMBER(peplus_state::peplus_sd000_w) |
| 430 | 430 | { |
| 431 | | m_sd000_ram.target()[offset] = data; |
| 431 | m_sd000_ram[offset] = data; |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | WRITE8_MEMBER(peplus_state::peplus_sf000_w) |
| 435 | 435 | { |
| 436 | | m_sf000_ram.target()[offset] = data; |
| 436 | m_sf000_ram[offset] = data; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | WRITE8_MEMBER(peplus_state::peplus_output_bank_a_w) |
| r14899 | r14900 | |
| 491 | 491 | |
| 492 | 492 | READ8_MEMBER(peplus_state::peplus_io_r) |
| 493 | 493 | { |
| 494 | | return m_io_port.target()[offset]; |
| 494 | return m_io_port[offset]; |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | READ8_MEMBER(peplus_state::peplus_duart_r) |
| r14899 | r14900 | |
| 502 | 502 | |
| 503 | 503 | READ8_MEMBER(peplus_state::peplus_cmos_r) |
| 504 | 504 | { |
| 505 | | return m_cmos_ram.target()[offset]; |
| 505 | return m_cmos_ram[offset]; |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | READ8_MEMBER(peplus_state::peplus_s3000_r) |
| 509 | 509 | { |
| 510 | | return m_s3000_ram.target()[offset]; |
| 510 | return m_s3000_ram[offset]; |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | READ8_MEMBER(peplus_state::peplus_s5000_r) |
| 514 | 514 | { |
| 515 | | return m_s5000_ram.target()[offset]; |
| 515 | return m_s5000_ram[offset]; |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | READ8_MEMBER(peplus_state::peplus_s7000_r) |
| 519 | 519 | { |
| 520 | | return m_s7000_ram.target()[offset]; |
| 520 | return m_s7000_ram[offset]; |
| 521 | 521 | } |
| 522 | 522 | |
| 523 | 523 | READ8_MEMBER(peplus_state::peplus_sb000_r) |
| 524 | 524 | { |
| 525 | | return m_sb000_ram.target()[offset]; |
| 525 | return m_sb000_ram[offset]; |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | READ8_MEMBER(peplus_state::peplus_sd000_r) |
| 529 | 529 | { |
| 530 | | return m_sd000_ram.target()[offset]; |
| 530 | return m_sd000_ram[offset]; |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | READ8_MEMBER(peplus_state::peplus_sf000_r) |
| 534 | 534 | { |
| 535 | | return m_sf000_ram.target()[offset]; |
| 535 | return m_sf000_ram[offset]; |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | /* Last Color in Every Palette is bgcolor */ |
| r14899 | r14900 | |
| 662 | 662 | static TILE_GET_INFO( get_bg_tile_info ) |
| 663 | 663 | { |
| 664 | 664 | peplus_state *state = machine.driver_data<peplus_state>(); |
| 665 | | UINT8 *videoram = state->m_videoram.target(); |
| 665 | UINT8 *videoram = state->m_videoram; |
| 666 | 666 | int pr = state->m_palette_ram[tile_index]; |
| 667 | 667 | int pr2 = state->m_palette_ram2[tile_index]; |
| 668 | 668 | int vr = videoram[tile_index]; |
| r14899 | r14900 | |
| 1019 | 1019 | peplus_state *state = machine.driver_data<peplus_state>(); |
| 1020 | 1020 | |
| 1021 | 1021 | // pepp0158 |
| 1022 | | state->m_program_ram.target()[0xa19f] = 0x22; // RET - Disable Memory Test |
| 1023 | | state->m_program_ram.target()[0xddea] = 0x22; // RET - Disable Program Checksum |
| 1022 | state->m_program_ram[0xa19f] = 0x22; // RET - Disable Memory Test |
| 1023 | state->m_program_ram[0xddea] = 0x22; // RET - Disable Program Checksum |
| 1024 | 1024 | state->m_autohold_addr = 0x5ffe; // AutoHold Address |
| 1025 | 1025 | |
| 1026 | 1026 | // pepp0188 |
| 1027 | | state->m_program_ram.target()[0x9a8d] = 0x22; // RET - Disable Memory Test |
| 1028 | | state->m_program_ram.target()[0xf429] = 0x22; // RET - Disable Program Checksum |
| 1027 | state->m_program_ram[0x9a8d] = 0x22; // RET - Disable Memory Test |
| 1028 | state->m_program_ram[0xf429] = 0x22; // RET - Disable Program Checksum |
| 1029 | 1029 | state->m_autohold_addr = 0x742f; // AutoHold Address |
| 1030 | 1030 | |
| 1031 | 1031 | // pepp0516 |
| 1032 | | state->m_program_ram.target()[0x9a24] = 0x22; // RET - Disable Memory Test |
| 1033 | | state->m_program_ram.target()[0xd61d] = 0x22; // RET - Disable Program Checksum |
| 1032 | state->m_program_ram[0x9a24] = 0x22; // RET - Disable Memory Test |
| 1033 | state->m_program_ram[0xd61d] = 0x22; // RET - Disable Program Checksum |
| 1034 | 1034 | state->m_autohold_addr = 0x5e7e; // AutoHold Address |
| 1035 | 1035 | |
| 1036 | 1036 | if (state->m_autohold_addr) |
| 1037 | | state->m_program_ram.target()[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01; |
| 1037 | state->m_program_ram[state->m_autohold_addr] = input_port_read_safe(machine, "AUTOHOLD",0x00) & 0x01; |
| 1038 | 1038 | #endif |
| 1039 | 1039 | } |
| 1040 | 1040 | |
src/mame/drivers/gpworld.c
| r14899 | r14900 | |
| 50 | 50 | gpworld_state(const machine_config &mconfig, device_type type, const char *tag) |
| 51 | 51 | : driver_device(mconfig, type, tag), |
| 52 | 52 | m_laserdisc(*this, "laserdisc") , |
| 53 | | m_sprite_RAM(*this, "sprite_RAM"), |
| 54 | | m_palette_RAM(*this, "palette_RAM"), |
| 55 | | m_tile_RAM(*this, "tile_RAM"){ } |
| 53 | m_sprite_ram(*this, "sprite_ram"), |
| 54 | m_palette_ram(*this, "palette_ram"), |
| 55 | m_tile_ram(*this, "tile_ram"){ } |
| 56 | 56 | |
| 57 | 57 | UINT8 m_nmi_enable; |
| 58 | 58 | UINT8 m_start_lamp; |
| r14899 | r14900 | |
| 60 | 60 | UINT8 m_ldp_write_latch; |
| 61 | 61 | UINT8 m_brake_gas; |
| 62 | 62 | required_device<pioneer_ldv1000_device> m_laserdisc; |
| 63 | | required_shared_ptr<UINT8> m_sprite_RAM; |
| 64 | | required_shared_ptr<UINT8> m_palette_RAM; |
| 65 | | required_shared_ptr<UINT8> m_tile_RAM; |
| 63 | required_shared_ptr<UINT8> m_sprite_ram; |
| 64 | required_shared_ptr<UINT8> m_palette_ram; |
| 65 | required_shared_ptr<UINT8> m_tile_ram; |
| 66 | 66 | DECLARE_READ8_MEMBER(ldp_read); |
| 67 | 67 | DECLARE_READ8_MEMBER(pedal_in); |
| 68 | 68 | DECLARE_WRITE8_MEMBER(ldp_write); |
| r14899 | r14900 | |
| 92 | 92 | { |
| 93 | 93 | int current_screen_character = (characterY*64) + characterX; |
| 94 | 94 | |
| 95 | | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_RAM.target()[current_screen_character], |
| 95 | drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->m_tile_ram[current_screen_character], |
| 96 | 96 | characterY, 0, 0, characterX*8, characterY*8, 0); |
| 97 | 97 | } |
| 98 | 98 | } |
| r14899 | r14900 | |
| 130 | 130 | /* Heisted from Daphne which heisted it from MAME */ |
| 131 | 131 | for (i = 0; i < 0x800; i += 8) |
| 132 | 132 | { |
| 133 | | UINT8 *spr_reg = state->m_sprite_RAM + i; |
| 133 | UINT8 *spr_reg = state->m_sprite_ram + i; |
| 134 | 134 | |
| 135 | 135 | if (spr_reg[SPR_Y_BOTTOM] && spr_reg[SPR_X_LO] != 0xff) |
| 136 | 136 | { |
| r14899 | r14900 | |
| 278 | 278 | /* This is all just a (bad) guess */ |
| 279 | 279 | int pal_index, r, g, b, a; |
| 280 | 280 | |
| 281 | | m_palette_RAM.target()[offset] = data; |
| 281 | m_palette_ram[offset] = data; |
| 282 | 282 | |
| 283 | 283 | /* "Round down" to the nearest palette entry */ |
| 284 | 284 | pal_index = offset & 0xffe; |
| 285 | 285 | |
| 286 | | g = (m_palette_RAM.target()[pal_index] & 0xf0) << 0; |
| 287 | | b = (m_palette_RAM.target()[pal_index] & 0x0f) << 4; |
| 288 | | r = (m_palette_RAM.target()[pal_index+1] & 0x0f) << 4; |
| 289 | | a = (m_palette_RAM.target()[pal_index+1] & 0x80) ? 0 : 255; /* guess */ |
| 286 | g = (m_palette_ram[pal_index] & 0xf0) << 0; |
| 287 | b = (m_palette_ram[pal_index] & 0x0f) << 4; |
| 288 | r = (m_palette_ram[pal_index+1] & 0x0f) << 4; |
| 289 | a = (m_palette_ram[pal_index+1] & 0x80) ? 0 : 255; /* guess */ |
| 290 | 290 | |
| 291 | 291 | /* logerror("PAL WRITE index : %x rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */ |
| 292 | 292 | |
| r14899 | r14900 | |
| 296 | 296 | /* PROGRAM MAP */ |
| 297 | 297 | static ADDRESS_MAP_START( mainmem, AS_PROGRAM, 8, gpworld_state ) |
| 298 | 298 | AM_RANGE(0x0000,0xbfff) AM_ROM |
| 299 | | AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_RAM") |
| 300 | | AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_RAM") /* The memory test reads at 0xc800 */ |
| 301 | | AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_RAM") |
| 299 | AM_RANGE(0xc000,0xc7ff) AM_RAM AM_SHARE("sprite_ram") |
| 300 | AM_RANGE(0xc800,0xcfff) AM_WRITE(palette_write) AM_SHARE("palette_ram") /* The memory test reads at 0xc800 */ |
| 301 | AM_RANGE(0xd000,0xd7ff) AM_RAM AM_SHARE("tile_ram") |
| 302 | 302 | AM_RANGE(0xd800,0xd800) AM_READWRITE(ldp_read,ldp_write) |
| 303 | 303 | /* AM_RANGE(0xd801,0xd801) AM_READ_LEGACY(???) */ |
| 304 | 304 | AM_RANGE(0xda00,0xda00) AM_READ_PORT("INWHEEL") //8255 here.... |
src/mame/drivers/dec8.c
| r14899 | r14900 | |
| 583 | 583 | |
| 584 | 584 | static ADDRESS_MAP_START( lastmisn_map, AS_PROGRAM, 8, dec8_state ) |
| 585 | 585 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 586 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") |
| 587 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") |
| 586 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 587 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 588 | 588 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 589 | 589 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 590 | 590 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14899 | r14900 | |
| 609 | 609 | |
| 610 | 610 | static ADDRESS_MAP_START( lastmisn_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 611 | 611 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 612 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") |
| 613 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") |
| 612 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 613 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 614 | 614 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 615 | 615 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 616 | 616 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14899 | r14900 | |
| 629 | 629 | |
| 630 | 630 | static ADDRESS_MAP_START( shackled_map, AS_PROGRAM, 8, dec8_state ) |
| 631 | 631 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 632 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") |
| 633 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") |
| 632 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 633 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 634 | 634 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 635 | 635 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 636 | 636 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14899 | r14900 | |
| 653 | 653 | |
| 654 | 654 | static ADDRESS_MAP_START( shackled_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 655 | 655 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 656 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") |
| 657 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") |
| 656 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 657 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 658 | 658 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN0") |
| 659 | 659 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN1") |
| 660 | 660 | AM_RANGE(0x1802, 0x1802) AM_READ_PORT("IN2") |
| r14899 | r14900 | |
| 747 | 747 | |
| 748 | 748 | static ADDRESS_MAP_START( csilver_map, AS_PROGRAM, 8, dec8_state ) |
| 749 | 749 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 750 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") AM_SHARE("paletteram") |
| 751 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") AM_SHARE("paletteram2") |
| 750 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 751 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 752 | 752 | AM_RANGE(0x1800, 0x1800) AM_READ_PORT("IN1") |
| 753 | 753 | AM_RANGE(0x1801, 0x1801) AM_READ_PORT("IN0") |
| 754 | 754 | AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2") |
| r14899 | r14900 | |
| 772 | 772 | |
| 773 | 773 | static ADDRESS_MAP_START( csilver_sub_map, AS_PROGRAM, 8, dec8_state ) |
| 774 | 774 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_SHARE("share1") |
| 775 | | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("share3") |
| 776 | | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("share4") |
| 775 | AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_lo_w) AM_SHARE("paletteram") |
| 776 | AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(paletteram_xxxxBBBBGGGGRRRR_byte_split_hi_w) AM_SHARE("paletteram2") |
| 777 | 777 | AM_RANGE(0x1803, 0x1803) AM_READ_PORT("IN2") |
| 778 | 778 | AM_RANGE(0x1804, 0x1804) AM_READ_PORT("DSW1") |
| 779 | 779 | AM_RANGE(0x1800, 0x1804) AM_WRITE(shackled_int_w) |
src/mame/drivers/rabbit.c
| r14899 | r14900 | |
| 93 | 93 | { |
| 94 | 94 | public: |
| 95 | 95 | rabbit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 96 | | : driver_device(mconfig, type, tag) { } |
| 96 | : driver_device(mconfig, type, tag), |
| 97 | m_viewregs0(*this, "viewregs0"), |
| 98 | m_viewregs6(*this, "viewregs6"), |
| 99 | m_viewregs7(*this, "viewregs7"), |
| 100 | m_viewregs9(*this, "viewregs9"), |
| 101 | m_viewregs10(*this, "viewregs10"), |
| 102 | m_tilemap_regs(*this, "tilemap_regs"), |
| 103 | m_spriteregs(*this, "spriteregs"), |
| 104 | m_blitterregs(*this, "blitterregs"), |
| 105 | m_spriteram(*this, "spriteram") { } |
| 97 | 106 | |
| 98 | | UINT32 *m_viewregs0; |
| 99 | | UINT32 *m_viewregs6; |
| 100 | | UINT32 *m_viewregs7; |
| 101 | | UINT32 *m_viewregs9; |
| 102 | | UINT32 *m_viewregs10; |
| 103 | | UINT32 *m_tilemap_regs[4]; |
| 104 | | UINT32 *m_spriteregs; |
| 105 | | UINT32 *m_blitterregs; |
| 107 | required_shared_ptr<UINT32> m_viewregs0; |
| 108 | required_shared_ptr<UINT32> m_viewregs6; |
| 109 | required_shared_ptr<UINT32> m_viewregs7; |
| 110 | required_shared_ptr<UINT32> m_viewregs9; |
| 111 | required_shared_ptr<UINT32> m_viewregs10; |
| 112 | required_shared_ptr_array<UINT32, 4> m_tilemap_regs; |
| 113 | required_shared_ptr<UINT32> m_spriteregs; |
| 114 | required_shared_ptr<UINT32> m_blitterregs; |
| 106 | 115 | bitmap_ind16 *m_sprite_bitmap; |
| 107 | 116 | rectangle m_sprite_clip; |
| 108 | 117 | int m_vblirqlevel; |
| 109 | 118 | int m_bltirqlevel; |
| 110 | 119 | int m_banking; |
| 111 | 120 | UINT32 *m_tilemap_ram[4]; |
| 112 | | UINT32 *m_spriteram; |
| 121 | required_shared_ptr<UINT32> m_spriteram; |
| 113 | 122 | tilemap_t *m_tilemap[4]; |
| 114 | 123 | DECLARE_WRITE32_MEMBER(rabbit_tilemap0_w); |
| 115 | 124 | DECLARE_WRITE32_MEMBER(rabbit_tilemap1_w); |
| r14899 | r14900 | |
| 747 | 756 | AM_RANGE(0x400980, 0x400983) AM_READ(randomrabbits) // sound chip status? |
| 748 | 757 | AM_RANGE(0x400984, 0x400987) AM_READ(randomrabbits) // sound chip status? |
| 749 | 758 | /* this lot are probably gfxchip/blitter etc. related */ |
| 750 | | AM_RANGE(0x400010, 0x400013) AM_WRITEONLY AM_BASE(m_viewregs0 ) |
| 751 | | AM_RANGE(0x400100, 0x400117) AM_WRITEONLY AM_BASE(m_tilemap_regs[0] ) // tilemap regs1 |
| 752 | | AM_RANGE(0x400120, 0x400137) AM_WRITEONLY AM_BASE(m_tilemap_regs[1] ) // tilemap regs2 |
| 753 | | AM_RANGE(0x400140, 0x400157) AM_WRITEONLY AM_BASE(m_tilemap_regs[2] ) // tilemap regs3 |
| 754 | | AM_RANGE(0x400160, 0x400177) AM_WRITEONLY AM_BASE(m_tilemap_regs[3] ) // tilemap regs4 |
| 755 | | AM_RANGE(0x400200, 0x40021b) AM_WRITEONLY AM_BASE(m_spriteregs ) // sprregs? |
| 759 | AM_RANGE(0x400010, 0x400013) AM_WRITEONLY AM_SHARE("viewregs0" ) |
| 760 | AM_RANGE(0x400100, 0x400117) AM_WRITEONLY AM_SHARE("tilemap_regs.0" ) // tilemap regs1 |
| 761 | AM_RANGE(0x400120, 0x400137) AM_WRITEONLY AM_SHARE("tilemap_regs.1" ) // tilemap regs2 |
| 762 | AM_RANGE(0x400140, 0x400157) AM_WRITEONLY AM_SHARE("tilemap_regs.2" ) // tilemap regs3 |
| 763 | AM_RANGE(0x400160, 0x400177) AM_WRITEONLY AM_SHARE("tilemap_regs.3" ) // tilemap regs4 |
| 764 | AM_RANGE(0x400200, 0x40021b) AM_WRITEONLY AM_SHARE("spriteregs" ) // sprregs? |
| 756 | 765 | AM_RANGE(0x400300, 0x400303) AM_WRITE(rabbit_rombank_w) // used during rom testing, rombank/area select + something else? |
| 757 | | AM_RANGE(0x400400, 0x400413) AM_WRITEONLY AM_BASE(m_viewregs6 ) // some global controls? (brightness etc.?) |
| 758 | | AM_RANGE(0x400500, 0x400503) AM_WRITEONLY AM_BASE(m_viewregs7 ) |
| 759 | | AM_RANGE(0x400700, 0x40070f) AM_WRITE(rabbit_blitter_w) AM_BASE(m_blitterregs ) |
| 760 | | AM_RANGE(0x400800, 0x40080f) AM_WRITEONLY AM_BASE(m_viewregs9 ) // never changes? |
| 766 | AM_RANGE(0x400400, 0x400413) AM_WRITEONLY AM_SHARE("viewregs6" ) // some global controls? (brightness etc.?) |
| 767 | AM_RANGE(0x400500, 0x400503) AM_WRITEONLY AM_SHARE("viewregs7" ) |
| 768 | AM_RANGE(0x400700, 0x40070f) AM_WRITE(rabbit_blitter_w) AM_SHARE("blitterregs" ) |
| 769 | AM_RANGE(0x400800, 0x40080f) AM_WRITEONLY AM_SHARE("viewregs9" ) // never changes? |
| 761 | 770 | AM_RANGE(0x400900, 0x40098f) AM_WRITE(rabbit_audio_w) |
| 762 | 771 | /* hmm */ |
| 763 | | AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_BASE(m_viewregs10 ) |
| 772 | AM_RANGE(0x479700, 0x479713) AM_WRITEONLY AM_SHARE("viewregs10" ) |
| 764 | 773 | |
| 765 | 774 | AM_RANGE(0x440000, 0x47ffff) AM_ROMBANK("bank1") // data (gfx / sound) rom readback for ROM testing |
| 766 | 775 | /* tilemaps */ |
| r14899 | r14900 | |
| 768 | 777 | AM_RANGE(0x484000, 0x487fff) AM_READWRITE(rabbit_tilemap1_r,rabbit_tilemap1_w) |
| 769 | 778 | AM_RANGE(0x488000, 0x48bfff) AM_READWRITE(rabbit_tilemap2_r,rabbit_tilemap2_w) |
| 770 | 779 | AM_RANGE(0x48c000, 0x48ffff) AM_READWRITE(rabbit_tilemap3_r,rabbit_tilemap3_w) |
| 771 | | AM_RANGE(0x494000, 0x497fff) AM_RAM AM_BASE(m_spriteram) // sprites? |
| 780 | AM_RANGE(0x494000, 0x497fff) AM_RAM AM_SHARE("spriteram") // sprites? |
| 772 | 781 | AM_RANGE(0x4a0000, 0x4affff) AM_RAM_WRITE(rabbit_paletteram_dword_w) AM_SHARE("paletteram") |
| 773 | 782 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 774 | 783 | ADDRESS_MAP_END |
src/emu/device.h
| r14899 | r14900 | |
| 124 | 124 | typedef void (*write_line_device_func)(device_t *device, int state); |
| 125 | 125 | |
| 126 | 126 | |
| 127 | | |
| 128 | 127 | // ======================> device_t |
| 129 | 128 | |
| 130 | 129 | // device_t represents a device |
| r14899 | r14900 | |
| 228 | 227 | device_debug *debug() const { return m_debug; } |
| 229 | 228 | |
| 230 | 229 | protected: |
| 230 | // internal helper classes (defined below) |
| 231 | class finder_base; |
| 232 | template<class _DeviceClass, bool _Required> class device_finder; |
| 233 | template<class _DeviceClass> class optional_device; |
| 234 | template<class _DeviceClass> class required_device; |
| 235 | template<typename _PointerType, bool _Required> class shared_ptr_finder; |
| 236 | template<typename _PointerType> class optional_shared_ptr; |
| 237 | template<typename _PointerType> class required_shared_ptr; |
| 238 | template<typename _PointerType, int _Count, bool _Required> class shared_ptr_array_finder; |
| 239 | template<typename _PointerType, int _Count> class optional_shared_ptr_array; |
| 240 | template<typename _PointerType, int _Count> class required_shared_ptr_array; |
| 241 | |
| 231 | 242 | // miscellaneous helpers |
| 232 | 243 | void set_machine(running_machine &machine); |
| 233 | 244 | void start(); |
| r14899 | r14900 | |
| 236 | 247 | void pre_save(); |
| 237 | 248 | void post_load(); |
| 238 | 249 | void notify_clock_changed(); |
| 250 | finder_base *register_auto_finder(finder_base &autodev); |
| 239 | 251 | |
| 240 | 252 | //------------------- begin derived class overrides |
| 241 | 253 | |
| r14899 | r14900 | |
| 288 | 300 | const void * m_static_config; // static device configuration |
| 289 | 301 | const input_device_default *m_input_defaults; // devices input ports default overrides |
| 290 | 302 | |
| 291 | | // helper class to request auto-object discovery in the constructor of a derived class |
| 292 | | class finder_base |
| 293 | | { |
| 294 | | friend class device_t; |
| 303 | private: |
| 304 | // private helpers |
| 305 | device_t *add_subdevice(device_type type, const char *tag, UINT32 clock); |
| 306 | device_t *replace_subdevice(device_t &old, device_type type, const char *tag, UINT32 clock); |
| 307 | void remove_subdevice(device_t &device); |
| 308 | device_t *subdevice_slow(const char *tag) const; |
| 295 | 309 | |
| 296 | | public: |
| 297 | | // construction/destruction |
| 298 | | finder_base(device_t &base, const char *tag); |
| 299 | | virtual ~finder_base(); |
| 310 | // private state; accessor use required |
| 311 | running_machine * m_machine; |
| 312 | save_manager * m_save; |
| 313 | astring m_tag; // full tag for this instance |
| 314 | astring m_basetag; // base part of the tag |
| 315 | bool m_config_complete; // have we completed our configuration? |
| 316 | bool m_started; // true if the start function has succeeded |
| 317 | finder_base * m_auto_finder_list; // list of objects to auto-find |
| 318 | }; |
| 300 | 319 | |
| 301 | | // getters |
| 302 | | virtual void findit() = 0; |
| 303 | 320 | |
| 304 | | protected: |
| 305 | | // static helpers |
| 306 | | void *find_memory(UINT8 width, size_t &bytes, bool required); |
| 321 | // ======================> finder_base |
| 307 | 322 | |
| 308 | | // internal state |
| 309 | | finder_base *m_next; |
| 310 | | device_t &m_base; |
| 311 | | const char *m_tag; |
| 312 | | }; |
| 323 | // helper class to request auto-object discovery in the constructor of a derived class |
| 324 | class device_t::finder_base |
| 325 | { |
| 326 | friend class device_t; |
| 313 | 327 | |
| 314 | | // device finder template |
| 315 | | template<typename _DeviceClass, bool _Required> |
| 316 | | class device_finder : public finder_base |
| 317 | | { |
| 318 | | public: |
| 319 | | // construction/destruction |
| 320 | | device_finder(device_t &base, const char *tag) |
| 321 | | : finder_base(base, tag), |
| 322 | | m_target(0) { } |
| 328 | public: |
| 329 | // construction/destruction |
| 330 | finder_base(device_t &base, const char *tag); |
| 331 | virtual ~finder_base(); |
| 323 | 332 | |
| 324 | | // operators to make use transparent |
| 325 | | operator _DeviceClass *() { return m_target; } |
| 326 | | operator _DeviceClass *() const { return m_target; } |
| 327 | | _DeviceClass *operator->() { return m_target; } |
| 333 | // getters |
| 334 | virtual void findit() = 0; |
| 328 | 335 | |
| 329 | | // getter for explicit fetching |
| 330 | | _DeviceClass *target() const { return m_target; } |
| 336 | protected: |
| 337 | // helpers |
| 338 | void *find_memory(UINT8 width, size_t &bytes, bool required); |
| 331 | 339 | |
| 332 | | // setter for setting the object |
| 333 | | void set_target(_DeviceClass *target) |
| 334 | | { |
| 335 | | m_target = target; |
| 336 | | if (target == 0 && _Required) |
| 337 | | throw emu_fatalerror("Unable to find required device '%s'", this->m_tag); |
| 338 | | } |
| 340 | // internal state |
| 341 | finder_base *m_next; |
| 342 | device_t &m_base; |
| 343 | const char *m_tag; |
| 344 | }; |
| 339 | 345 | |
| 340 | | // finder |
| 341 | | virtual void findit() { set_target(m_base.subdevice<_DeviceClass>(m_tag)); } |
| 342 | 346 | |
| 343 | | protected: |
| 344 | | // internal state |
| 345 | | _DeviceClass *m_target; |
| 346 | | }; |
| 347 | // ======================> device_finder |
| 347 | 348 | |
| 348 | | // optional device finder |
| 349 | | template<class _DeviceClass> |
| 350 | | class optional_device : public device_finder<_DeviceClass, false> |
| 351 | | { |
| 352 | | public: |
| 353 | | optional_device(device_t &base, const char *tag) : device_finder<_DeviceClass, false>(base, tag) { } |
| 354 | | }; |
| 349 | // device finder template |
| 350 | template<class _DeviceClass, bool _Required> |
| 351 | class device_t::device_finder : public device_t::finder_base |
| 352 | { |
| 353 | public: |
| 354 | // construction/destruction |
| 355 | device_finder(device_t &base, const char *tag) |
| 356 | : finder_base(base, tag), |
| 357 | m_target(0) { } |
| 355 | 358 | |
| 356 | | // required devices are similar but throw an error if they are not found |
| 357 | | template<class _DeviceClass> |
| 358 | | class required_device : public device_finder<_DeviceClass, true> |
| 359 | | { |
| 360 | | public: |
| 361 | | required_device(device_t &base, const char *tag) : device_finder<_DeviceClass, true>(base, tag) { } |
| 362 | | }; |
| 359 | // operators to make use transparent |
| 360 | operator _DeviceClass *() { return m_target; } |
| 361 | operator _DeviceClass *() const { return m_target; } |
| 362 | _DeviceClass *operator->() { assert(m_target != NULL); return m_target; } |
| 363 | 363 | |
| 364 | | // shared pointer finder template |
| 365 | | template<typename _PointerType, bool _Required> |
| 366 | | class shared_ptr_finder : public finder_base |
| 364 | // getter for explicit fetching |
| 365 | _DeviceClass *target() const { return m_target; } |
| 366 | |
| 367 | // setter for setting the object |
| 368 | void set_target(_DeviceClass *target) |
| 367 | 369 | { |
| 368 | | public: |
| 369 | | // construction/destruction |
| 370 | | shared_ptr_finder(device_t &base, const char *tag, UINT8 width = 0) |
| 371 | | : finder_base(base, tag), |
| 372 | | m_target(0), |
| 373 | | m_bytes(0), |
| 374 | | m_allocated(false), |
| 375 | | m_width((width != 0) ? width : sizeof(_PointerType) * 8) { } |
| 370 | m_target = target; |
| 371 | if (target == 0 && _Required) |
| 372 | throw emu_fatalerror("Unable to find required device '%s'", this->m_tag); |
| 373 | } |
| 376 | 374 | |
| 377 | | virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); } |
| 375 | // finder |
| 376 | virtual void findit() { set_target(m_base.subdevice<_DeviceClass>(m_tag)); } |
| 378 | 377 | |
| 379 | | // operators to make use transparent |
| 380 | | operator _PointerType *() const { return m_target; } |
| 381 | | _PointerType operator[](int index) const { return m_target[index]; } |
| 382 | | _PointerType &operator[](int index) { return m_target[index]; } |
| 383 | | _PointerType *operator->() { return m_target; } |
| 378 | protected: |
| 379 | // internal state |
| 380 | _DeviceClass *m_target; |
| 381 | }; |
| 384 | 382 | |
| 385 | | // getter for explicit fetching |
| 386 | | _PointerType *target() const { return m_target; } |
| 387 | | UINT32 bytes() const { return m_bytes; } |
| 383 | // optional device finder |
| 384 | template<class _DeviceClass> |
| 385 | class device_t::optional_device : public device_t::device_finder<_DeviceClass, false> |
| 386 | { |
| 387 | public: |
| 388 | optional_device(device_t &base, const char *tag) : device_finder<_DeviceClass, false>(base, tag) { } |
| 389 | }; |
| 388 | 390 | |
| 389 | | // setter for setting the object |
| 390 | | void set_target(_PointerType *target, size_t bytes) |
| 391 | | { |
| 392 | | m_target = target; |
| 393 | | m_bytes = bytes; |
| 394 | | if (target == 0 && _Required) |
| 395 | | throw emu_fatalerror("Unable to find required shared pointer '%s'", this->m_tag); |
| 396 | | } |
| 391 | // required devices are similar but throw an error if they are not found |
| 392 | template<class _DeviceClass> |
| 393 | class device_t::required_device : public device_t::device_finder<_DeviceClass, true> |
| 394 | { |
| 395 | public: |
| 396 | required_device(device_t &base, const char *tag) : device_finder<_DeviceClass, true>(base, tag) { } |
| 397 | }; |
| 397 | 398 | |
| 398 | | // dynamic allocation of a shared pointer |
| 399 | | void allocate(UINT32 entries) |
| 400 | | { |
| 401 | | assert(!m_allocated); |
| 402 | | m_allocated = true; |
| 403 | | m_target = global_alloc_array_clear(_PointerType, entries); |
| 404 | | m_bytes = entries * sizeof(_PointerType); |
| 405 | | m_base.save_pointer(m_target, m_tag, entries); |
| 406 | | } |
| 407 | 399 | |
| 408 | | // finder |
| 409 | | virtual void findit() { m_target = reinterpret_cast<_PointerType *>(find_memory(m_width, m_bytes, _Required)); } |
| 400 | // ======================> shared_ptr_finder |
| 410 | 401 | |
| 411 | | protected: |
| 412 | | // internal state |
| 413 | | _PointerType *m_target; |
| 414 | | size_t m_bytes; |
| 415 | | bool m_allocated; |
| 416 | | UINT8 m_width; |
| 417 | | }; |
| 402 | // shared pointer finder template |
| 403 | template<typename _PointerType, bool _Required> |
| 404 | class device_t::shared_ptr_finder : public device_t::finder_base |
| 405 | { |
| 406 | public: |
| 407 | // construction/destruction |
| 408 | shared_ptr_finder(device_t &base, const char *tag, UINT8 width = 0) |
| 409 | : finder_base(base, tag), |
| 410 | m_target(0), |
| 411 | m_bytes(0), |
| 412 | m_allocated(false), |
| 413 | m_width((width != 0) ? width : sizeof(_PointerType) * 8) { } |
| 418 | 414 | |
| 419 | | // optional device finder |
| 420 | | template<class _PointerType> |
| 421 | | class optional_shared_ptr : public shared_ptr_finder<_PointerType, false> |
| 415 | virtual ~shared_ptr_finder() { if (m_allocated) global_free(m_target); } |
| 416 | |
| 417 | // operators to make use transparent |
| 418 | operator _PointerType *() const { return m_target; } |
| 419 | _PointerType operator[](int index) const { return m_target[index]; } |
| 420 | _PointerType &operator[](int index) { return m_target[index]; } |
| 421 | _PointerType *operator->() { return m_target; } |
| 422 | |
| 423 | // getter for explicit fetching |
| 424 | _PointerType *target() const { return m_target; } |
| 425 | UINT32 bytes() const { return m_bytes; } |
| 426 | |
| 427 | // setter for setting the object |
| 428 | void set_target(_PointerType *target, size_t bytes) |
| 422 | 429 | { |
| 423 | | public: |
| 424 | | optional_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, false>(base, tag, width) { } |
| 425 | | }; |
| 430 | m_target = target; |
| 431 | m_bytes = bytes; |
| 432 | if (target == 0 && _Required) |
| 433 | throw emu_fatalerror("Unable to find required shared pointer '%s'", this->m_tag); |
| 434 | } |
| 426 | 435 | |
| 427 | | // required devices are similar but throw an error if they are not found |
| 428 | | template<class _PointerType> |
| 429 | | class required_shared_ptr : public shared_ptr_finder<_PointerType, true> |
| 436 | // dynamic allocation of a shared pointer |
| 437 | void allocate(UINT32 entries) |
| 430 | 438 | { |
| 431 | | public: |
| 432 | | required_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, true>(base, tag, width) { } |
| 433 | | }; |
| 439 | assert(!m_allocated); |
| 440 | m_allocated = true; |
| 441 | m_target = global_alloc_array_clear(_PointerType, entries); |
| 442 | m_bytes = entries * sizeof(_PointerType); |
| 443 | m_base.save_pointer(m_target, m_tag, entries); |
| 444 | } |
| 434 | 445 | |
| 435 | | // internal helpers |
| 436 | | finder_base *register_auto_finder(finder_base &autodev); |
| 446 | // finder |
| 447 | virtual void findit() { m_target = reinterpret_cast<_PointerType *>(find_memory(m_width, m_bytes, _Required)); } |
| 437 | 448 | |
| 438 | | finder_base * m_auto_finder_list; |
| 449 | protected: |
| 450 | // internal state |
| 451 | _PointerType *m_target; |
| 452 | size_t m_bytes; |
| 453 | bool m_allocated; |
| 454 | UINT8 m_width; |
| 455 | }; |
| 439 | 456 | |
| 440 | | private: |
| 441 | | // private helpers |
| 442 | | device_t *add_subdevice(device_type type, const char *tag, UINT32 clock); |
| 443 | | device_t *replace_subdevice(device_t &old, device_type type, const char *tag, UINT32 clock); |
| 444 | | void remove_subdevice(device_t &device); |
| 445 | | device_t *subdevice_slow(const char *tag) const; |
| 457 | // optional shared pointer finder |
| 458 | template<class _PointerType> |
| 459 | class device_t::optional_shared_ptr : public device_t::shared_ptr_finder<_PointerType, false> |
| 460 | { |
| 461 | public: |
| 462 | optional_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, false>(base, tag, width) { } |
| 463 | }; |
| 446 | 464 | |
| 447 | | // private state; accessor use required |
| 448 | | running_machine * m_machine; |
| 449 | | save_manager * m_save; |
| 450 | | astring m_tag; // full tag for this instance |
| 451 | | astring m_basetag; // base part of the tag |
| 452 | | bool m_config_complete; // have we completed our configuration? |
| 453 | | bool m_started; // true if the start function has succeeded |
| 465 | // required shared pointer finder |
| 466 | template<class _PointerType> |
| 467 | class device_t::required_shared_ptr : public device_t::shared_ptr_finder<_PointerType, true> |
| 468 | { |
| 469 | public: |
| 470 | required_shared_ptr(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_finder<_PointerType, true>(base, tag, width) { } |
| 454 | 471 | }; |
| 455 | 472 | |
| 456 | 473 | |
| 474 | // ======================> shared_ptr_array_finder |
| 457 | 475 | |
| 476 | // shared pointer array finder template |
| 477 | template<typename _PointerType, int _Count, bool _Required> |
| 478 | class device_t::shared_ptr_array_finder |
| 479 | { |
| 480 | typedef shared_ptr_finder<_PointerType, _Required> shared_ptr_type; |
| 481 | |
| 482 | public: |
| 483 | // construction/destruction |
| 484 | shared_ptr_array_finder(device_t &base, const char *basetag, UINT8 width = 0) |
| 485 | { |
| 486 | for (int index = 0; index < _Count; index++) |
| 487 | m_array[index] = global_alloc(shared_ptr_type(base, m_tag[index].format("%s.%d", basetag, index), width)); |
| 488 | } |
| 489 | |
| 490 | virtual ~shared_ptr_array_finder() |
| 491 | { |
| 492 | for (int index = 0; index < _Count; index++) |
| 493 | global_free(m_array[index]); |
| 494 | } |
| 495 | |
| 496 | // array accessors |
| 497 | const shared_ptr_type &operator[](int index) const { assert(index < _Count); return *m_array[index]; } |
| 498 | shared_ptr_type &operator[](int index) { assert(index < _Count); return *m_array[index]; } |
| 499 | |
| 500 | protected: |
| 501 | // internal state |
| 502 | shared_ptr_type *m_array[_Count]; |
| 503 | astring m_tag[_Count]; |
| 504 | }; |
| 505 | |
| 506 | // optional shared pointer array finder |
| 507 | template<class _PointerType, int _Count> |
| 508 | class device_t::optional_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, false> |
| 509 | { |
| 510 | public: |
| 511 | optional_shared_ptr_array(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_array_finder<_PointerType, _Count, false>(base, tag, width) { } |
| 512 | }; |
| 513 | |
| 514 | // required shared pointer array finder |
| 515 | template<class _PointerType, int _Count> |
| 516 | class device_t::required_shared_ptr_array : public device_t::shared_ptr_array_finder<_PointerType, _Count, true> |
| 517 | { |
| 518 | public: |
| 519 | required_shared_ptr_array(device_t &base, const char *tag, UINT8 width = 0) : shared_ptr_array_finder<_PointerType, _Count, true>(base, tag, width) { } |
| 520 | }; |
| 521 | |
| 522 | |
| 458 | 523 | // ======================> device_interface |
| 459 | 524 | |
| 460 | 525 | // device_interface represents runtime information for a particular device interface |
src/mess/drivers/psion.c
| r14899 | r14900 | |
| 239 | 239 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w) |
| 240 | 240 | AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register) |
| 241 | 241 | AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w) |
| 242 | | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size) |
| 242 | AM_RANGE(0x2000, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size) |
| 243 | 243 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 244 | 244 | ADDRESS_MAP_END |
| 245 | 245 | |
| r14899 | r14900 | |
| 248 | 248 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w) |
| 249 | 249 | AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register) |
| 250 | 250 | AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w) |
| 251 | | AM_RANGE(0x0400, 0x5fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size) |
| 251 | AM_RANGE(0x0400, 0x5fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size) |
| 252 | 252 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 253 | 253 | ADDRESS_MAP_END |
| 254 | 254 | |
| r14899 | r14900 | |
| 257 | 257 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w) |
| 258 | 258 | AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register) |
| 259 | 259 | AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w) |
| 260 | | AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size) |
| 260 | AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size) |
| 261 | 261 | AM_RANGE(0x4000, 0x7fff) AM_RAMBANK("rambank") |
| 262 | 262 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 263 | 263 | ADDRESS_MAP_END |
| r14899 | r14900 | |
| 267 | 267 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w) |
| 268 | 268 | AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register) |
| 269 | 269 | AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w) |
| 270 | | AM_RANGE(0x0400, 0x7fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size) |
| 270 | AM_RANGE(0x0400, 0x7fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size) |
| 271 | 271 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("rombank") |
| 272 | 272 | AM_RANGE(0xc000, 0xffff) AM_ROM |
| 273 | 273 | ADDRESS_MAP_END |
| r14899 | r14900 | |
| 277 | 277 | AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_int_reg_r, hd63701_int_reg_w) |
| 278 | 278 | AM_RANGE(0x0040, 0x00ff) AM_RAM AM_BASE(m_sys_register) |
| 279 | 279 | AM_RANGE(0x0100, 0x03ff) AM_READWRITE(io_r, io_w) |
| 280 | | AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE(m_ram) AM_SIZE(m_ram_size) |
| 280 | AM_RANGE(0x0400, 0x3fff) AM_RAM AM_BASE_SIZE(m_ram,m_ram_size) |
| 281 | 281 | AM_RANGE(0x4000, 0x7fff) AM_RAMBANK("rambank") |
| 282 | 282 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("rombank") |
| 283 | 283 | AM_RANGE(0xc000, 0xffff) AM_ROM |