trunk/src/mame/drivers/tecmosys.c
| r243678 | r243679 | |
| 309 | 309 | AM_RANGE(0xa00000, 0xa00001) AM_WRITE(eeprom_w ) |
| 310 | 310 | AM_RANGE(0xa80000, 0xa80005) AM_WRITEONLY AM_SHARE("a80000regs") // a80000-3 scroll? a80004 inverted ? 3 : 0 |
| 311 | 311 | AM_RANGE(0xb00000, 0xb00005) AM_WRITEONLY AM_SHARE("b00000regs") // b00000-3 scrool?, b00004 inverted ? 3 : 0 |
| 312 | | AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(tecmosys_prot_status_r, tecmosys_prot_status_w) |
| 312 | AM_RANGE(0xb80000, 0xb80001) AM_READWRITE(prot_status_r, prot_status_w) |
| 313 | 313 | AM_RANGE(0xc00000, 0xc00005) AM_WRITEONLY AM_SHARE("c00000regs") // c00000-3 scroll? c00004 inverted ? 13 : 10 |
| 314 | 314 | AM_RANGE(0xc80000, 0xc80005) AM_WRITEONLY AM_SHARE("c80000regs") // c80000-3 scrool? c80004 inverted ? 3 : 0 |
| 315 | 315 | AM_RANGE(0xd00000, 0xd00001) AM_READ_PORT("P1") |
| 316 | 316 | AM_RANGE(0xd00002, 0xd00003) AM_READ_PORT("P2") |
| 317 | 317 | AM_RANGE(0xd80000, 0xd80001) AM_READ(eeprom_r) |
| 318 | 318 | AM_RANGE(0xe00000, 0xe00001) AM_WRITE(sound_w ) |
| 319 | | AM_RANGE(0xe80000, 0xe80001) AM_WRITE(tecmosys_prot_data_w) |
| 319 | AM_RANGE(0xe80000, 0xe80001) AM_WRITE(prot_data_w) |
| 320 | 320 | AM_RANGE(0xf00000, 0xf00001) AM_READ(sound_r) |
| 321 | | AM_RANGE(0xf80000, 0xf80001) AM_READ(tecmosys_prot_data_r) |
| 321 | AM_RANGE(0xf80000, 0xf80001) AM_READ(prot_data_r) |
| 322 | 322 | ADDRESS_MAP_END |
| 323 | 323 | |
| 324 | 324 | |
| 325 | | WRITE8_MEMBER(tecmosys_state::tecmosys_z80_bank_w) |
| 325 | WRITE8_MEMBER(tecmosys_state::z80_bank_w) |
| 326 | 326 | { |
| 327 | 327 | membank("bank1")->set_entry(data); |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | | WRITE8_MEMBER(tecmosys_state::tecmosys_oki_bank_w) |
| 330 | WRITE8_MEMBER(tecmosys_state::oki_bank_w) |
| 331 | 331 | { |
| 332 | 332 | UINT8 upperbank = (data & 0x30) >> 4; |
| 333 | 333 | UINT8 lowerbank = (data & 0x03) >> 0; |
| r243678 | r243679 | |
| 347 | 347 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 348 | 348 | AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ymf", ymf262_device, read, write) |
| 349 | 349 | AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| 350 | | AM_RANGE(0x20, 0x20) AM_WRITE(tecmosys_oki_bank_w) |
| 351 | | AM_RANGE(0x30, 0x30) AM_WRITE(tecmosys_z80_bank_w) |
| 350 | AM_RANGE(0x20, 0x20) AM_WRITE(oki_bank_w) |
| 351 | AM_RANGE(0x30, 0x30) AM_WRITE(z80_bank_w) |
| 352 | 352 | AM_RANGE(0x40, 0x40) AM_READ(soundlatch_byte_r) |
| 353 | 353 | AM_RANGE(0x50, 0x50) AM_WRITE(soundlatch2_byte_w) |
| 354 | 354 | AM_RANGE(0x60, 0x61) AM_DEVREADWRITE("ymz", ymz280b_device, read, write) |
| r243678 | r243679 | |
| 441 | 441 | void tecmosys_state::machine_start() |
| 442 | 442 | { |
| 443 | 443 | membank("bank1")->configure_entries(0, 16, memregion("audiocpu")->base(), 0x4000); |
| 444 | |
| 445 | save_item(NAME(m_device_read_ptr)); |
| 446 | save_item(NAME(m_device_status)); |
| 447 | save_item(NAME(m_device_value)); |
| 444 | 448 | } |
| 445 | 449 | |
| 446 | 450 | static MACHINE_CONFIG_START( deroon, tecmosys_state ) |
| r243678 | r243679 | |
| 465 | 469 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(3000)) |
| 466 | 470 | MCFG_SCREEN_SIZE(64*8, 64*8) |
| 467 | 471 | MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 0*8, 30*8-1) |
| 468 | | MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update_tecmosys) |
| 472 | MCFG_SCREEN_UPDATE_DRIVER(tecmosys_state, screen_update) |
| 469 | 473 | |
| 470 | 474 | MCFG_PALETTE_ADD("palette", 0x4000+0x800) |
| 471 | 475 | MCFG_PALETTE_FORMAT(xGGGGGRRRRRBBBBB) |
| r243678 | r243679 | |
| 620 | 624 | ROM_LOAD( "ae500w07.ad1", 0x080000, 0x080000, CRC(3734f92c) SHA1(048555b5aa89eaf983305c439ba08d32b4a1bb80) ) |
| 621 | 625 | ROM_END |
| 622 | 626 | |
| 623 | | void tecmosys_state::tecmosys_descramble() |
| 627 | void tecmosys_state::descramble() |
| 624 | 628 | { |
| 625 | 629 | UINT8 *gfxsrc = memregion( "gfx1" )->base(); |
| 626 | 630 | size_t srcsize = memregion( "gfx1" )->bytes(); |
| r243678 | r243679 | |
| 644 | 648 | |
| 645 | 649 | DRIVER_INIT_MEMBER(tecmosys_state,deroon) |
| 646 | 650 | { |
| 647 | | tecmosys_descramble(); |
| 648 | | tecmosys_prot_init(0); // machine/tecmosys.c |
| 651 | descramble(); |
| 652 | prot_init(0); // machine/tecmosys.c |
| 649 | 653 | } |
| 650 | 654 | |
| 651 | 655 | DRIVER_INIT_MEMBER(tecmosys_state,tkdensho) |
| 652 | 656 | { |
| 653 | | tecmosys_descramble(); |
| 654 | | tecmosys_prot_init(1); |
| 657 | descramble(); |
| 658 | prot_init(1); |
| 655 | 659 | } |
| 656 | 660 | |
| 657 | 661 | DRIVER_INIT_MEMBER(tecmosys_state,tkdensha) |
| 658 | 662 | { |
| 659 | | tecmosys_descramble(); |
| 660 | | tecmosys_prot_init(2); |
| 663 | descramble(); |
| 664 | prot_init(2); |
| 661 | 665 | } |
| 662 | 666 | |
| 663 | | GAME( 1995, deroon, 0, deroon, deroon, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", 0 ) |
| 664 | | GAME( 1996, tkdensho, 0, deroon, deroon, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", 0 ) |
| 665 | | GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", 0 ) |
| 667 | GAME( 1995, deroon, 0, deroon, deroon, tecmosys_state, deroon, ROT0, "Tecmo", "Deroon DeroDero", GAME_SUPPORTS_SAVE ) |
| 668 | GAME( 1996, tkdensho, 0, deroon, deroon, tecmosys_state, tkdensho, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960614)", GAME_SUPPORTS_SAVE ) |
| 669 | GAME( 1996, tkdenshoa, tkdensho, deroon, deroon, tecmosys_state, tkdensha, ROT0, "Tecmo", "Toukidenshou - Angel Eyes (VER. 960427)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/tecmosys.h
| r243678 | r243679 | |
| 10 | 10 | public: |
| 11 | 11 | tecmosys_state(const machine_config &mconfig, device_type type, const char *tag) |
| 12 | 12 | : driver_device(mconfig, type, tag), |
| 13 | m_maincpu(*this, "maincpu"), |
| 14 | m_audiocpu(*this, "audiocpu"), |
| 15 | m_eeprom(*this, "eeprom"), |
| 16 | m_gfxdecode(*this, "gfxdecode"), |
| 17 | m_screen(*this, "screen"), |
| 18 | m_palette(*this, "palette"), |
| 13 | 19 | m_spriteram(*this, "spriteram"), |
| 14 | 20 | m_tilemap_paletteram16(*this, "tmap_palette"), |
| 15 | 21 | m_bg2tilemap_ram(*this, "bg2tilemap_ram"), |
| r243678 | r243679 | |
| 23 | 29 | m_b00000regs(*this, "b00000regs"), |
| 24 | 30 | m_c00000regs(*this, "c00000regs"), |
| 25 | 31 | m_c80000regs(*this, "c80000regs"), |
| 26 | | m_880000regs(*this, "880000regs"), |
| 27 | | m_maincpu(*this, "maincpu"), |
| 28 | | m_audiocpu(*this, "audiocpu"), |
| 29 | | m_eeprom(*this, "eeprom"), |
| 30 | | m_gfxdecode(*this, "gfxdecode"), |
| 31 | | m_screen(*this, "screen"), |
| 32 | | m_palette(*this, "palette") { } |
| 32 | m_880000regs(*this, "880000regs") { } |
| 33 | 33 | |
| 34 | required_device<cpu_device> m_maincpu; |
| 35 | required_device<cpu_device> m_audiocpu; |
| 36 | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 37 | required_device<gfxdecode_device> m_gfxdecode; |
| 38 | required_device<screen_device> m_screen; |
| 39 | required_device<palette_device> m_palette; |
| 40 | |
| 34 | 41 | required_shared_ptr<UINT16> m_spriteram; |
| 35 | 42 | required_shared_ptr<UINT16> m_tilemap_paletteram16; |
| 36 | 43 | required_shared_ptr<UINT16> m_bg2tilemap_ram; |
| r243678 | r243679 | |
| 45 | 52 | required_shared_ptr<UINT16> m_c00000regs; |
| 46 | 53 | required_shared_ptr<UINT16> m_c80000regs; |
| 47 | 54 | required_shared_ptr<UINT16> m_880000regs; |
| 55 | |
| 48 | 56 | int m_spritelist; |
| 49 | 57 | bitmap_ind16 m_sprite_bitmap; |
| 50 | 58 | bitmap_ind16 m_tmp_tilemap_composebitmap; |
| r243678 | r243679 | |
| 57 | 65 | UINT8 m_device_status; |
| 58 | 66 | const struct prot_data* m_device_data; |
| 59 | 67 | UINT8 m_device_value; |
| 68 | |
| 60 | 69 | DECLARE_READ16_MEMBER(sound_r); |
| 61 | 70 | DECLARE_WRITE16_MEMBER(sound_w); |
| 62 | 71 | DECLARE_WRITE16_MEMBER(unk880000_w); |
| 63 | 72 | DECLARE_READ16_MEMBER(unk880000_r); |
| 64 | | DECLARE_WRITE8_MEMBER(tecmosys_z80_bank_w); |
| 65 | | DECLARE_WRITE8_MEMBER(tecmosys_oki_bank_w); |
| 66 | | DECLARE_READ16_MEMBER(tecmosys_prot_status_r); |
| 67 | | DECLARE_WRITE16_MEMBER(tecmosys_prot_status_w); |
| 68 | | DECLARE_READ16_MEMBER(tecmosys_prot_data_r); |
| 69 | | DECLARE_WRITE16_MEMBER(tecmosys_prot_data_w); |
| 73 | DECLARE_WRITE8_MEMBER(z80_bank_w); |
| 74 | DECLARE_WRITE8_MEMBER(oki_bank_w); |
| 75 | DECLARE_READ16_MEMBER(prot_status_r); |
| 76 | DECLARE_WRITE16_MEMBER(prot_status_w); |
| 77 | DECLARE_READ16_MEMBER(prot_data_r); |
| 78 | DECLARE_WRITE16_MEMBER(prot_data_w); |
| 70 | 79 | DECLARE_WRITE16_MEMBER(bg0_tilemap_w); |
| 71 | 80 | DECLARE_WRITE16_MEMBER(bg1_tilemap_w); |
| 72 | 81 | DECLARE_WRITE16_MEMBER(bg2_tilemap_w); |
| r243678 | r243679 | |
| 77 | 86 | DECLARE_WRITE16_MEMBER(bg2_tilemap_lineram_w); |
| 78 | 87 | DECLARE_READ16_MEMBER(eeprom_r); |
| 79 | 88 | DECLARE_WRITE16_MEMBER(eeprom_w); |
| 89 | DECLARE_WRITE_LINE_MEMBER(sound_irq); |
| 90 | |
| 80 | 91 | DECLARE_DRIVER_INIT(tkdensha); |
| 81 | 92 | DECLARE_DRIVER_INIT(deroon); |
| 82 | 93 | DECLARE_DRIVER_INIT(tkdensho); |
| 94 | virtual void machine_start(); |
| 95 | virtual void video_start(); |
| 96 | |
| 83 | 97 | TILE_GET_INFO_MEMBER(get_bg0tile_info); |
| 84 | 98 | TILE_GET_INFO_MEMBER(get_bg1tile_info); |
| 85 | 99 | TILE_GET_INFO_MEMBER(get_bg2tile_info); |
| 86 | 100 | TILE_GET_INFO_MEMBER(get_fg_tile_info); |
| 87 | | virtual void machine_start(); |
| 88 | | virtual void video_start(); |
| 89 | | UINT32 screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 90 | | void tecmosys_prot_init(int which); |
| 91 | | void tecmosys_prot_reset(); |
| 92 | | inline void set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data); |
| 93 | | void tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ); |
| 94 | | void tecmosys_tilemap_copy_to_compose(UINT16 pri); |
| 95 | | void tecmosys_do_final_mix(bitmap_rgb32 &bitmap); |
| 96 | | void tecmosys_descramble(); |
| 97 | | DECLARE_WRITE_LINE_MEMBER(sound_irq); |
| 98 | | required_device<cpu_device> m_maincpu; |
| 99 | | required_device<cpu_device> m_audiocpu; |
| 100 | | required_device<eeprom_serial_93cxx_device> m_eeprom; |
| 101 | | required_device<gfxdecode_device> m_gfxdecode; |
| 102 | | required_device<screen_device> m_screen; |
| 103 | | required_device<palette_device> m_palette; |
| 101 | |
| 102 | UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 103 | void prot_init(int which); |
| 104 | void prot_reset(); |
| 105 | inline void set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data); |
| 106 | void render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ); |
| 107 | void tilemap_copy_to_compose(UINT16 pri); |
| 108 | void do_final_mix(bitmap_rgb32 &bitmap); |
| 109 | void descramble(); |
| 104 | 110 | }; |
trunk/src/mame/video/tecmosys.c
| r243678 | r243679 | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | | inline void tecmosys_state::set_color_555_tecmo(pen_t color, int rshift, int gshift, int bshift, UINT16 data) |
| 69 | inline void tecmosys_state::set_color_555(pen_t color, int rshift, int gshift, int bshift, UINT16 data) |
| 70 | 70 | { |
| 71 | 71 | m_palette->set_pen_color(color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift)); |
| 72 | 72 | } |
| r243678 | r243679 | |
| 74 | 74 | WRITE16_MEMBER(tecmosys_state::tilemap_paletteram16_xGGGGGRRRRRBBBBB_word_w) |
| 75 | 75 | { |
| 76 | 76 | COMBINE_DATA(&m_tilemap_paletteram16[offset]); |
| 77 | | set_color_555_tecmo(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]); |
| 77 | set_color_555(offset+0x4000, 5, 10, 0, m_tilemap_paletteram16[offset]); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | WRITE16_MEMBER(tecmosys_state::bg0_tilemap_lineram_w) |
| r243678 | r243679 | |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | | void tecmosys_state::tecmosys_render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ) |
| 100 | void tecmosys_state::render_sprites_to_bitmap(bitmap_rgb32 &bitmap, UINT16 extrax, UINT16 extray ) |
| 101 | 101 | { |
| 102 | 102 | UINT8 *gfxsrc = memregion ( "gfx1" )->base(); |
| 103 | 103 | int i; |
| r243678 | r243679 | |
| 188 | 188 | } |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | | void tecmosys_state::tecmosys_tilemap_copy_to_compose(UINT16 pri) |
| 191 | void tecmosys_state::tilemap_copy_to_compose(UINT16 pri) |
| 192 | 192 | { |
| 193 | 193 | int y,x; |
| 194 | 194 | UINT16 *srcptr; |
| r243678 | r243679 | |
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | | void tecmosys_state::tecmosys_do_final_mix(bitmap_rgb32 &bitmap) |
| 208 | void tecmosys_state::do_final_mix(bitmap_rgb32 &bitmap) |
| 209 | 209 | { |
| 210 | 210 | const pen_t *paldata = m_palette->pens(); |
| 211 | 211 | int y,x; |
| r243678 | r243679 | |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | 277 | |
| 278 | | UINT32 tecmosys_state::screen_update_tecmosys(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 278 | UINT32 tecmosys_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 279 | 279 | { |
| 280 | 280 | bitmap.fill(m_palette->pen(0x4000), cliprect); |
| 281 | 281 | |
| r243678 | r243679 | |
| 293 | 293 | |
| 294 | 294 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 295 | 295 | m_bg0tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 296 | | tecmosys_tilemap_copy_to_compose(0x0000); |
| 296 | tilemap_copy_to_compose(0x0000); |
| 297 | 297 | |
| 298 | 298 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 299 | 299 | m_bg1tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 300 | | tecmosys_tilemap_copy_to_compose(0x4000); |
| 300 | tilemap_copy_to_compose(0x4000); |
| 301 | 301 | |
| 302 | 302 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 303 | 303 | m_bg2tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 304 | | tecmosys_tilemap_copy_to_compose(0x8000); |
| 304 | tilemap_copy_to_compose(0x8000); |
| 305 | 305 | |
| 306 | 306 | m_tmp_tilemap_renderbitmap.fill(0, cliprect); |
| 307 | 307 | m_txt_tilemap->draw(screen, m_tmp_tilemap_renderbitmap, cliprect, 0,0); |
| 308 | | tecmosys_tilemap_copy_to_compose(0xc000); |
| 308 | tilemap_copy_to_compose(0xc000); |
| 309 | 309 | |
| 310 | 310 | |
| 311 | | tecmosys_do_final_mix(bitmap); |
| 311 | do_final_mix(bitmap); |
| 312 | 312 | |
| 313 | 313 | // prepare sprites for NEXT frame - causes 1 frame palette errors, but prevents sprite lag in tkdensho, which is correct? |
| 314 | | tecmosys_render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]); |
| 314 | render_sprites_to_bitmap(bitmap, m_880000regs[0x0], m_880000regs[0x1]); |
| 315 | 315 | |
| 316 | 316 | return 0; |
| 317 | 317 | } |
| r243678 | r243679 | |
| 339 | 339 | |
| 340 | 340 | m_bg2tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(tecmosys_state::get_bg2tile_info),this),TILEMAP_SCAN_ROWS,16,16,32,32); |
| 341 | 341 | m_bg2tilemap->set_transparent_pen(0); |
| 342 | |
| 343 | save_item(NAME(m_spritelist)); |
| 342 | 344 | } |