trunk/src/mame/drivers/bloodbro.c
| r243358 | r243359 | |
| 131 | 131 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 132 | 132 | AM_RANGE(0x080000, 0x08afff) AM_RAM |
| 133 | 133 | AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_SHARE("spriteram") |
| 134 | | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram") |
| 134 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bloodbro_bgvideoram_w) AM_SHARE("bgvideoram") |
| 135 | 135 | AM_RANGE(0x08c400, 0x08cfff) AM_RAM |
| 136 | | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") |
| 136 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(bloodbro_fgvideoram_w) AM_SHARE("fgvideoram") |
| 137 | 137 | AM_RANGE(0x08d400, 0x08d7ff) AM_RAM |
| 138 | | AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 138 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(bloodbro_txvideoram_w) AM_SHARE("txvideoram") |
| 139 | 139 | AM_RANGE(0x08e000, 0x08e7ff) AM_RAM |
| 140 | 140 | AM_RANGE(0x08e800, 0x08f7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 141 | 141 | AM_RANGE(0x08f800, 0x08ffff) AM_RAM |
| r243358 | r243359 | |
| 163 | 163 | AM_RANGE(0x000000, 0x07ffff) AM_ROM |
| 164 | 164 | AM_RANGE(0x080000, 0x08afff) AM_RAM |
| 165 | 165 | AM_RANGE(0x08b000, 0x08bfff) AM_RAM AM_SHARE("spriteram") |
| 166 | | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bgvideoram_w) AM_SHARE("bgvideoram") |
| 166 | AM_RANGE(0x08c000, 0x08c3ff) AM_RAM_WRITE(bloodbro_bgvideoram_w) AM_SHARE("bgvideoram") |
| 167 | 167 | AM_RANGE(0x08c400, 0x08cfff) AM_RAM |
| 168 | | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(fgvideoram_w) AM_SHARE("fgvideoram") |
| 168 | AM_RANGE(0x08d000, 0x08d3ff) AM_RAM_WRITE(bloodbro_fgvideoram_w) AM_SHARE("fgvideoram") |
| 169 | 169 | AM_RANGE(0x08d400, 0x08d7ff) AM_RAM |
| 170 | | AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(txvideoram_w) AM_SHARE("txvideoram") |
| 170 | AM_RANGE(0x08d800, 0x08dfff) AM_RAM_WRITE(bloodbro_txvideoram_w) AM_SHARE("txvideoram") |
| 171 | 171 | AM_RANGE(0x08e000, 0x08ffff) AM_RAM |
| 172 | 172 | AM_RANGE(0x0c1000, 0x0c1001) AM_READ_PORT("DSW") |
| 173 | 173 | AM_RANGE(0x0c1002, 0x0c1003) AM_READ_PORT("IN0") |
| r243358 | r243359 | |
| 663 | 663 | |
| 664 | 664 | /* Game Drivers */ |
| 665 | 665 | |
| 666 | | GAME( 1990, bloodbro, 0, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 667 | | GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 668 | | GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL | GAME_SUPPORTS_SAVE ) |
| 669 | | GAME( 1990, weststry, bloodbro, weststry, weststry, driver_device, 0, ROT0, "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) |
| 670 | | GAME( 1990, skysmash, 0, skysmash, skysmash, driver_device, 0, ROT270, "Nihon System", "Sky Smasher", 0 | GAME_SUPPORTS_SAVE ) |
| 666 | GAME( 1990, bloodbro, 0, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 1)", GAME_NO_COCKTAIL ) |
| 667 | GAME( 1990, bloodbroa,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 2)", GAME_NO_COCKTAIL ) |
| 668 | GAME( 1990, bloodbrob,bloodbro, bloodbro, bloodbro, driver_device, 0, ROT0, "TAD Corporation", "Blood Bros. (set 3)", GAME_NO_COCKTAIL ) |
| 669 | GAME( 1990, weststry, bloodbro, weststry, weststry, driver_device, 0, ROT0, "bootleg (Datsu)", "West Story (bootleg of Blood Bros.)", GAME_NO_COCKTAIL | GAME_NO_SOUND ) |
| 670 | GAME( 1990, skysmash, 0, skysmash, skysmash, driver_device, 0, ROT270, "Nihon System", "Sky Smasher", 0 ) |
trunk/src/mame/drivers/goodejan.c
| r243358 | r243359 | |
| 78 | 78 | public: |
| 79 | 79 | goodejan_state(const machine_config &mconfig, device_type type, const char *tag) |
| 80 | 80 | : driver_device(mconfig, type, tag), |
| 81 | | m_maincpu(*this, "maincpu"), |
| 82 | | m_gfxdecode(*this, "gfxdecode"), |
| 83 | | m_palette(*this, "palette"), |
| 84 | 81 | m_sc0_vram(*this, "sc0_vram"), |
| 85 | 82 | m_sc1_vram(*this, "sc1_vram"), |
| 86 | 83 | m_sc2_vram(*this, "sc2_vram"), |
| 87 | 84 | m_sc3_vram(*this, "sc3_vram"), |
| 88 | | m_spriteram16(*this, "sprite_ram") { } |
| 85 | m_spriteram16(*this, "sprite_ram"), |
| 86 | m_maincpu(*this, "maincpu"), |
| 87 | m_gfxdecode(*this, "gfxdecode"), |
| 88 | m_palette(*this, "palette") { } |
| 89 | 89 | |
| 90 | | required_device<cpu_device> m_maincpu; |
| 91 | | required_device<gfxdecode_device> m_gfxdecode; |
| 92 | | required_device<palette_device> m_palette; |
| 93 | | |
| 94 | 90 | required_shared_ptr<UINT16> m_sc0_vram; |
| 95 | 91 | required_shared_ptr<UINT16> m_sc1_vram; |
| 96 | 92 | required_shared_ptr<UINT16> m_sc2_vram; |
| 97 | 93 | required_shared_ptr<UINT16> m_sc3_vram; |
| 98 | 94 | required_shared_ptr<UINT16> m_spriteram16; |
| 99 | | |
| 95 | required_device<cpu_device> m_maincpu; |
| 96 | required_device<gfxdecode_device> m_gfxdecode; |
| 97 | required_device<palette_device> m_palette; |
| 100 | 98 | tilemap_t *m_sc0_tilemap; |
| 101 | 99 | tilemap_t *m_sc1_tilemap; |
| 102 | 100 | tilemap_t *m_sc2_tilemap; |
| 103 | 101 | tilemap_t *m_sc3_tilemap; |
| 104 | | |
| 105 | 102 | UINT16 m_mux_data; |
| 106 | 103 | UINT16 m_seibucrtc_sc0bank; |
| 107 | | UINT16 m_layer_en; |
| 108 | | UINT16 m_scrollram[6]; |
| 109 | | |
| 110 | | DECLARE_WRITE16_MEMBER(gfxbank_w); |
| 104 | DECLARE_WRITE16_MEMBER(goodejan_gfxbank_w); |
| 111 | 105 | DECLARE_READ16_MEMBER(mahjong_panel_r); |
| 112 | 106 | DECLARE_WRITE16_MEMBER(mahjong_panel_w); |
| 113 | 107 | DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w); |
| 114 | 108 | DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w); |
| 115 | 109 | DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w); |
| 116 | 110 | DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w); |
| 117 | | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 118 | | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 119 | | |
| 120 | 111 | TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info); |
| 121 | 112 | TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info); |
| 122 | 113 | TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info); |
| 123 | 114 | TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info); |
| 124 | | |
| 125 | | INTERRUPT_GEN_MEMBER(irq); |
| 126 | | |
| 115 | INTERRUPT_GEN_MEMBER(goodejan_irq); |
| 116 | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 117 | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 118 | UINT16 m_layer_en; |
| 119 | UINT16 m_scrollram[6]; |
| 127 | 120 | void seibucrtc_sc0bank_w(UINT16 data); |
| 128 | 121 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); |
| 129 | 122 | virtual void video_start(); |
| 130 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 123 | UINT32 screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 131 | 124 | }; |
| 132 | 125 | |
| 133 | 126 | /******************************* |
| r243358 | r243359 | |
| 355 | 348 | m_sc3_tilemap->set_transparent_pen(15); |
| 356 | 349 | |
| 357 | 350 | m_seibucrtc_sc0bank = 0; |
| 358 | | |
| 359 | | save_item(NAME(m_mux_data)); |
| 360 | | save_item(NAME(m_seibucrtc_sc0bank)); |
| 361 | | save_item(NAME(m_layer_en)); |
| 362 | | save_item(NAME(m_scrollram)); |
| 363 | 351 | } |
| 364 | 352 | |
| 365 | | UINT32 goodejan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 353 | UINT32 goodejan_state::screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 366 | 354 | { |
| 367 | 355 | bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen |
| 368 | 356 | |
| r243358 | r243359 | |
| 393 | 381 | #define GOODEJAN_MHZ3 12000000 |
| 394 | 382 | |
| 395 | 383 | |
| 396 | | WRITE16_MEMBER(goodejan_state::gfxbank_w) |
| 384 | WRITE16_MEMBER(goodejan_state::goodejan_gfxbank_w) |
| 397 | 385 | { |
| 398 | 386 | seibucrtc_sc0bank_w((data & 0x100)>>8); |
| 399 | 387 | } |
| r243358 | r243359 | |
| 435 | 423 | |
| 436 | 424 | /* totmejan CRTC is at 8000-804f,goodejan is at 8000-807f */ |
| 437 | 425 | static ADDRESS_MAP_START( common_io_map, AS_IO, 16, goodejan_state ) |
| 438 | | AM_RANGE(0x9000, 0x9001) AM_WRITE(gfxbank_w) |
| 426 | AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w) |
| 439 | 427 | AM_RANGE(0xb000, 0xb003) AM_WRITENOP |
| 440 | 428 | AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w) |
| 441 | 429 | |
| r243358 | r243359 | |
| 604 | 592 | GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x100, 0x10 ) /* Text */ |
| 605 | 593 | GFXDECODE_END |
| 606 | 594 | |
| 607 | | INTERRUPT_GEN_MEMBER(goodejan_state::irq) |
| 595 | INTERRUPT_GEN_MEMBER(goodejan_state::goodejan_irq) |
| 608 | 596 | { |
| 609 | 597 | device.execute().set_input_line_and_vector(0,HOLD_LINE,0x208/4); |
| 610 | 598 | /* vector 0x00c is just a reti */ |
| r243358 | r243359 | |
| 628 | 616 | MCFG_CPU_ADD("maincpu", V30, GOODEJAN_MHZ2/2) |
| 629 | 617 | MCFG_CPU_PROGRAM_MAP(goodejan_map) |
| 630 | 618 | MCFG_CPU_IO_MAP(goodejan_io_map) |
| 631 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, irq) |
| 619 | MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, goodejan_irq) |
| 632 | 620 | |
| 633 | 621 | SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2) |
| 634 | 622 | |
| r243358 | r243359 | |
| 638 | 626 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 639 | 627 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 640 | 628 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) //TODO: dynamic resolution |
| 641 | | MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update) |
| 629 | MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update_goodejan) |
| 642 | 630 | MCFG_SCREEN_PALETTE("palette") |
| 643 | 631 | |
| 644 | 632 | MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) |
| r243358 | r243359 | |
| 754 | 742 | ROM_LOAD( "fmj08.083", 0x000, 0x100, CRC(9657b7ad) SHA1(e9b469c2b3534593f7fe0ea19cbbf93b55957e42) ) |
| 755 | 743 | ROM_END |
| 756 | 744 | |
| 757 | | GAME( 1991, totmejan, 0, totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 758 | | GAME( 1991, goodejan, 0, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 759 | | GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 745 | GAME( 1991, totmejan, 0, totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS ) |
| 746 | GAME( 1991, goodejan, 0, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS ) |
| 747 | GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS ) |
trunk/src/mame/drivers/naomi.c
| r243358 | r243359 | |
| 3466 | 3466 | |
| 3467 | 3467 | // 840-0016 1999 317-0262-JPN Naomi |
| 3468 | 3468 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "280fee35" ) |
| 3469 | | /* |
| 3470 | | 838-13661 RS422/RS232C BD DOC |
| 3471 | | IC1 - Toshiba TMPZ84C015BF-10 Z80-based MCU |
| 3472 | | IC6 - Toshiba TC551001CF-70L 128k x8 SRAM |
| 3473 | | IC8 - Sega 315-5338A |
| 3474 | | OSC1 - 19.680MHz OSC2 - 32.000MHz |
| 3475 | | |
| 3476 | | connected between Naomi motherboard and card reader/printer, accessed via MIE MCU ports 0x09-0x0d |
| 3477 | | */ |
| 3478 | | ROM_REGION( 0x10000, "rs422_io", 0 ) |
| 3479 | | ROM_LOAD( "epr-22083.ic7", 0x0000, 0x10000, CRC(c70b0de9) SHA1(329c924b4d29017482b1ecca839fb610ca20b2af) ) |
| 3480 | 3469 | ROM_END |
| 3481 | 3470 | |
| 3482 | 3471 | ROM_START( derbyocw ) |
| r243358 | r243359 | |
| 3944 | 3933 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 not populated |
| 3945 | 3934 | ROM_END |
| 3946 | 3935 | |
| 3947 | | // IC22 shown in ROM TEST as BAD, but its byte summ matches written on label, verified on 2 cartridges |
| 3948 | 3936 | ROM_START( hotd2p ) |
| 3949 | 3937 | HOTD2_BIOS |
| 3950 | 3938 | NAOMI_DEFAULT_EEPROM |
| r243358 | r243359 | |
| 3976 | 3964 | ROM_LOAD( "mpr-21404.ic19s", 0x9800000, 0x800000, CRC(6cf6e705) SHA1(68d7e9becefe27b556e0c5d7ba00efd2d1fb71ca) ) |
| 3977 | 3965 | ROM_LOAD( "mpr-21405.ic20s", 0xa000000, 0x800000, CRC(495e6265) SHA1(57936367fec0000691641525682fb8aefc4e4f56) ) |
| 3978 | 3966 | |
| 3979 | | // 315-5881 populated, have no 317-xxxx label, key unknown |
| 3980 | | ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") |
| 3967 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "-1") // 315-5881 not populated |
| 3981 | 3968 | ROM_END |
| 3982 | 3969 | |
| 3983 | 3970 | /* |
| r243358 | r243359 | |
| 5170 | 5157 | ROM_PARAMETER( ":rom_board:segam2crypt:key", "280a8b5d" ) |
| 5171 | 5158 | ROM_END |
| 5172 | 5159 | |
| 5173 | | // !!! partial dump, only IC22 dumped. without correct flashroms contents game crashes at certain points. |
| 5174 | 5160 | // prototype - only works with US BIOS |
| 5175 | 5161 | ROM_START( sambap ) |
| 5176 | 5162 | NAOMI_BIOS |
| r243358 | r243359 | |
| 7785 | 7771 | ROM_REGION( 0x4000, "pic", ROMREGION_ERASEFF) |
| 7786 | 7772 | //PIC16C621A (317-0567-EXP) |
| 7787 | 7773 | //(sticker 253-5508-0567) |
| 7788 | | ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, CRC(cd1d2b2d) SHA1(78203ee0339f76eb76da08d7de43e7e44e4b7d32) ) |
| 7774 | ROM_LOAD("317-0567-exp.pic", 0x00, 0x4000, NO_DUMP ) |
| 7789 | 7775 | ROM_END |
| 7790 | 7776 | |
| 7791 | 7777 | |
| r243358 | r243359 | |
| 8571 | 8557 | ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE) |
| 8572 | 8558 | ROM_LOAD( "610-0752.u3", 0x0000000, 0x1000000, CRC(bab6182e) SHA1(4d25256c81941316887cbb4524a203922f5b7104) ) |
| 8573 | 8559 | ROM_LOAD( "610-0752.u1", 0x1000000, 0x1000000, CRC(3086bc47) SHA1(eb7b04db90d296985528f0cfdd4545f184c40b64) ) |
| 8574 | | ROM_LOAD( "610-0752.u4", 0x2000000, 0x1000000, CRC(9787f145) SHA1(8445ede0477f70fbdc113810b80356945ce498d2) ) |
| 8575 | | ROM_LOAD( "610-0752.u2", 0x3000000, 0x1000000, CRC(d3a88b31) SHA1(ccf14367e4e7efbc2cc835f3b001fd6d64302a5e) ) |
| 8576 | | ROM_LOAD( "610-0752.u15", 0x4000000, 0x1000000, CRC(864a6342) SHA1(fb97532d5dd00f8520fdaf68dfcd1ea627bdf90a) ) |
| 8577 | | ROM_LOAD( "610-0752.u17", 0x5000000, 0x1000000, CRC(a79fb1fa) SHA1(f75c5b574fd79677b926c595b369e95605a3c848) ) |
| 8578 | | ROM_LOAD( "610-0752.u14", 0x6000000, 0x1000000, CRC(ce83bcc7) SHA1(e2d324a5a7eacbec7b0df9a4b9e276521bb9ab80) ) |
| 8579 | | ROM_LOAD( "610-0752.u16", 0x7000000, 0x1000000, CRC(8ac71c76) SHA1(080e41e633bf082fc536781541c6031d1ac81939) ) |
| 8560 | ROM_LOAD( "610-0752.u2", 0x2000000, 0x1000000, CRC(d3a88b31) SHA1(ccf14367e4e7efbc2cc835f3b001fd6d64302a5e) ) |
| 8561 | ROM_LOAD( "610-0752.u4", 0x3000000, 0x1000000, CRC(9787f145) SHA1(8445ede0477f70fbdc113810b80356945ce498d2) ) |
| 8562 | ROM_LOAD( "610-0752.u14", 0x4000000, 0x1000000, CRC(ce83bcc7) SHA1(e2d324a5a7eacbec7b0df9a4b9e276521bb9ab80) ) |
| 8563 | ROM_LOAD( "610-0752.u15", 0x5000000, 0x1000000, CRC(864a6342) SHA1(fb97532d5dd00f8520fdaf68dfcd1ea627bdf90a) ) |
| 8564 | ROM_LOAD( "610-0752.u16", 0x6000000, 0x1000000, CRC(8ac71c76) SHA1(080e41e633bf082fc536781541c6031d1ac81939) ) |
| 8565 | ROM_LOAD( "610-0752.u17", 0x7000000, 0x1000000, CRC(a79fb1fa) SHA1(f75c5b574fd79677b926c595b369e95605a3c848) ) |
| 8580 | 8566 | |
| 8581 | 8567 | ROM_REGION( 4, "rom_key", 0 ) |
| 8582 | 8568 | ROM_LOAD( "315-6248.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) ) |
| r243358 | r243359 | |
| 8826 | 8812 | ROM_REGION( 0x8000000, "rom_board", ROMREGION_ERASE) |
| 8827 | 8813 | ROM_LOAD( "695-0014.u3", 0x0000000, 0x1000000, CRC(9fdd7d07) SHA1(56d580dda116823ea5dc5e1bd5154463a476866a) ) |
| 8828 | 8814 | ROM_LOAD( "695-0014.u1", 0x1000000, 0x1000000, CRC(a91d2fcb) SHA1(8414386c09ba36ea581c8161f6cf2a13cc5ae516) ) |
| 8829 | | ROM_LOAD( "695-0014.u4", 0x2000000, 0x1000000, CRC(3342f237) SHA1(e617b0e1f8d8da9783c58ab98eb91de2363ec36f) ) |
| 8830 | | ROM_LOAD( "695-0014.u2", 0x3000000, 0x1000000, CRC(4d82152f) SHA1(a448983d4e81eb6485b62f23a6c99d1112a20c21) ) |
| 8831 | | ROM_LOAD( "695-0014.u15", 0x4000000, 0x1000000, CRC(d239a549) SHA1(71f3c1c2ae2a9b6f09f30e7be3bb11ba111276ae) ) |
| 8832 | | ROM_LOAD( "695-0014.u17", 0x5000000, 0x1000000, CRC(16bb5992) SHA1(18772587272aba1d50a48d384f472276c3b48d96) ) |
| 8833 | | ROM_LOAD( "695-0014.u14", 0x6000000, 0x1000000, CRC(55470242) SHA1(789036189ae5488a9da565774bdf91b49cd8264e) ) |
| 8834 | | ROM_LOAD( "695-0014.u16", 0x7000000, 0x1000000, CRC(730180a4) SHA1(017b82e2d2744695e3e521d35a8511ecc1c8ab43) ) |
| 8815 | ROM_LOAD( "695-0014.u2", 0x2000000, 0x1000000, CRC(4d82152f) SHA1(a448983d4e81eb6485b62f23a6c99d1112a20c21) ) |
| 8816 | ROM_LOAD( "695-0014.u4", 0x3000000, 0x1000000, CRC(3342f237) SHA1(e617b0e1f8d8da9783c58ab98eb91de2363ec36f) ) |
| 8817 | ROM_LOAD( "695-0014.u14", 0x4000000, 0x1000000, CRC(55470242) SHA1(789036189ae5488a9da565774bdf91b49cd8264e) ) |
| 8818 | ROM_LOAD( "695-0014.u15", 0x5000000, 0x1000000, CRC(d239a549) SHA1(71f3c1c2ae2a9b6f09f30e7be3bb11ba111276ae) ) |
| 8819 | ROM_LOAD( "695-0014.u16", 0x6000000, 0x1000000, CRC(730180a4) SHA1(017b82e2d2744695e3e521d35a8511ecc1c8ab43) ) |
| 8820 | ROM_LOAD( "695-0014.u17", 0x7000000, 0x1000000, CRC(16bb5992) SHA1(18772587272aba1d50a48d384f472276c3b48d96) ) |
| 8835 | 8821 | |
| 8836 | 8822 | ROM_REGION( 4, "rom_key", 0 ) |
| 8837 | 8823 | ROM_LOAD( "695-0014.bin", 0, 4, CRC(553dd361) SHA1(a60a26b5ee786cf0bb3d09bb6f00374598fbd7cc) ) |
trunk/src/mame/drivers/sengokmj.c
| r243358 | r243359 | |
| 66 | 66 | public: |
| 67 | 67 | sengokmj_state(const machine_config &mconfig, device_type type, const char *tag) |
| 68 | 68 | : driver_device(mconfig, type, tag), |
| 69 | | m_maincpu(*this, "maincpu"), |
| 70 | | m_gfxdecode(*this, "gfxdecode"), |
| 71 | | m_palette(*this, "palette"), |
| 72 | 69 | m_sc0_vram(*this, "sc0_vram"), |
| 73 | 70 | m_sc1_vram(*this, "sc1_vram"), |
| 74 | 71 | m_sc2_vram(*this, "sc2_vram"), |
| 75 | 72 | m_sc3_vram(*this, "sc3_vram"), |
| 76 | | m_spriteram16(*this, "sprite_ram") { } |
| 73 | m_spriteram16(*this, "sprite_ram"), |
| 74 | m_maincpu(*this, "maincpu"), |
| 75 | m_gfxdecode(*this, "gfxdecode"), |
| 76 | m_palette(*this, "palette") { } |
| 77 | 77 | |
| 78 | | required_device<cpu_device> m_maincpu; |
| 79 | | required_device<gfxdecode_device> m_gfxdecode; |
| 80 | | required_device<palette_device> m_palette; |
| 81 | | |
| 82 | 78 | required_shared_ptr<UINT16> m_sc0_vram; |
| 83 | 79 | required_shared_ptr<UINT16> m_sc1_vram; |
| 84 | 80 | required_shared_ptr<UINT16> m_sc2_vram; |
| 85 | 81 | required_shared_ptr<UINT16> m_sc3_vram; |
| 86 | 82 | required_shared_ptr<UINT16> m_spriteram16; |
| 87 | | |
| 83 | required_device<cpu_device> m_maincpu; |
| 84 | required_device<gfxdecode_device> m_gfxdecode; |
| 85 | required_device<palette_device> m_palette; |
| 88 | 86 | tilemap_t *m_sc0_tilemap; |
| 89 | 87 | tilemap_t *m_sc1_tilemap; |
| 90 | 88 | tilemap_t *m_sc2_tilemap; |
| 91 | 89 | tilemap_t *m_sc3_tilemap; |
| 92 | | |
| 93 | | UINT16 m_mux_data; |
| 90 | UINT16 m_sengokumj_mux_data; |
| 94 | 91 | UINT8 m_hopper_io; |
| 95 | 92 | UINT16 m_layer_en; |
| 96 | 93 | UINT16 m_scrollram[6]; |
| 97 | | |
| 98 | 94 | DECLARE_READ16_MEMBER(mahjong_panel_r); |
| 99 | 95 | DECLARE_WRITE16_MEMBER(mahjong_panel_w); |
| 100 | | DECLARE_WRITE16_MEMBER(out_w); |
| 101 | | DECLARE_READ16_MEMBER(system_r); |
| 96 | DECLARE_WRITE16_MEMBER(sengokmj_out_w); |
| 97 | DECLARE_READ16_MEMBER(sengokmj_system_r); |
| 102 | 98 | DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w); |
| 103 | 99 | DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w); |
| 104 | 100 | DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w); |
| 105 | 101 | DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w); |
| 106 | | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 107 | | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 108 | | |
| 109 | 102 | TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info); |
| 110 | 103 | TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info); |
| 111 | 104 | TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info); |
| 112 | 105 | TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info); |
| 113 | | |
| 114 | | INTERRUPT_GEN_MEMBER(interrupt); |
| 106 | INTERRUPT_GEN_MEMBER(sengokmj_interrupt); |
| 107 | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 108 | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 115 | 109 | |
| 116 | | virtual void machine_start(); |
| 117 | | virtual void video_start(); |
| 118 | | |
| 119 | 110 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); |
| 120 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 111 | virtual void video_start(); |
| 112 | UINT32 screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 121 | 113 | }; |
| 122 | 114 | |
| 123 | 115 | |
| r243358 | r243359 | |
| 302 | 294 | m_sc2_tilemap->set_transparent_pen(15); |
| 303 | 295 | m_sc1_tilemap->set_transparent_pen(15); |
| 304 | 296 | m_sc3_tilemap->set_transparent_pen(15); |
| 305 | | |
| 306 | | save_item(NAME(m_layer_en)); |
| 307 | | save_item(NAME(m_scrollram)); |
| 308 | 297 | } |
| 309 | 298 | |
| 310 | | UINT32 sengokmj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 299 | UINT32 sengokmj_state::screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 311 | 300 | { |
| 312 | 301 | bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen |
| 313 | 302 | |
| r243358 | r243359 | |
| 334 | 323 | } |
| 335 | 324 | |
| 336 | 325 | |
| 337 | | void sengokmj_state::machine_start() |
| 338 | | { |
| 339 | | save_item(NAME(m_mux_data)); |
| 340 | | save_item(NAME(m_hopper_io)); |
| 341 | | } |
| 342 | 326 | |
| 343 | 327 | |
| 344 | 328 | /* Multiplexer device for the mahjong panel */ |
| r243358 | r243359 | |
| 350 | 334 | |
| 351 | 335 | for(i=0;i<5;i++) |
| 352 | 336 | { |
| 353 | | if(m_mux_data & 1 << i) |
| 337 | if(m_sengokumj_mux_data & 1 << i) |
| 354 | 338 | res = ioport(mpnames[i])->read(); |
| 355 | 339 | } |
| 356 | 340 | |
| r243358 | r243359 | |
| 359 | 343 | |
| 360 | 344 | WRITE16_MEMBER(sengokmj_state::mahjong_panel_w) |
| 361 | 345 | { |
| 362 | | m_mux_data = (data & 0x3f00) >> 8; |
| 346 | m_sengokumj_mux_data = (data & 0x3f00) >> 8; |
| 363 | 347 | |
| 364 | 348 | if(data & 0xc0ff) |
| 365 | 349 | logerror("Write to mux %04x\n",data); |
| 366 | 350 | } |
| 367 | 351 | |
| 368 | | WRITE16_MEMBER(sengokmj_state::out_w) |
| 352 | WRITE16_MEMBER(sengokmj_state::sengokmj_out_w) |
| 369 | 353 | { |
| 370 | 354 | /* ---- ---- ---x ---- J.P. Signal (?)*/ |
| 371 | 355 | /* ---- ---- ---- -x-- Coin counter (done AFTER you press start)*/ |
| r243358 | r243359 | |
| 378 | 362 | // popmessage("%02x",m_hopper_io); |
| 379 | 363 | } |
| 380 | 364 | |
| 381 | | READ16_MEMBER(sengokmj_state::system_r) |
| 365 | READ16_MEMBER(sengokmj_state::sengokmj_system_r) |
| 382 | 366 | { |
| 383 | 367 | return (ioport("SYSTEM")->read() & 0xffbf) | m_hopper_io; |
| 384 | 368 | } |
| r243358 | r243359 | |
| 403 | 387 | // AM_RANGE(0x8080, 0x8081) CRTC extra register? |
| 404 | 388 | // AM_RANGE(0x80c0, 0x80c1) CRTC extra register? |
| 405 | 389 | // AM_RANGE(0x8100, 0x8101) AM_WRITENOP // always 0 |
| 406 | | AM_RANGE(0x8180, 0x8181) AM_WRITE(out_w) |
| 390 | AM_RANGE(0x8180, 0x8181) AM_WRITE(sengokmj_out_w) |
| 407 | 391 | AM_RANGE(0x8140, 0x8141) AM_WRITE(mahjong_panel_w) |
| 408 | 392 | AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1") |
| 409 | 393 | AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r) |
| 410 | | AM_RANGE(0xc004, 0xc005) AM_READ(system_r) //switches |
| 394 | AM_RANGE(0xc004, 0xc005) AM_READ(sengokmj_system_r) //switches |
| 411 | 395 | ADDRESS_MAP_END |
| 412 | 396 | |
| 413 | 397 | |
| r243358 | r243359 | |
| 554 | 538 | GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x700, 0x10 ) /* Text */ |
| 555 | 539 | GFXDECODE_END |
| 556 | 540 | |
| 557 | | INTERRUPT_GEN_MEMBER(sengokmj_state::interrupt) |
| 541 | INTERRUPT_GEN_MEMBER(sengokmj_state::sengokmj_interrupt) |
| 558 | 542 | { |
| 559 | 543 | device.execute().set_input_line_and_vector(0,HOLD_LINE,0xc8/4); |
| 560 | 544 | } |
| r243358 | r243359 | |
| 576 | 560 | MCFG_CPU_ADD("maincpu", V30, 16000000/2) /* V30-8 */ |
| 577 | 561 | MCFG_CPU_PROGRAM_MAP(sengokmj_map) |
| 578 | 562 | MCFG_CPU_IO_MAP(sengokmj_io_map) |
| 579 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state, interrupt) |
| 563 | MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state, sengokmj_interrupt) |
| 580 | 564 | |
| 581 | 565 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 582 | 566 | |
| r243358 | r243359 | |
| 588 | 572 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 589 | 573 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 590 | 574 | MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1) //TODO: dynamic resolution |
| 591 | | MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update) |
| 575 | MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update_sengokmj) |
| 592 | 576 | MCFG_SCREEN_PALETTE("palette") |
| 593 | 577 | |
| 594 | 578 | MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) |
| r243358 | r243359 | |
| 640 | 624 | ROM_LOAD( "rs006.89", 0x000, 0x200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */ |
| 641 | 625 | ROM_END |
| 642 | 626 | |
| 643 | | GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 627 | GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 644 | 628 | /*Non-Bet Version?*/ |
trunk/src/mame/drivers/silvmil.c
| r243358 | r243359 | |
| 261 | 261 | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW2:8" ) /* Verified */ |
| 262 | 262 | INPUT_PORTS_END |
| 263 | 263 | |
| 264 | | |
| 265 | | static INPUT_PORTS_START( puzzlove ) |
| 266 | | PORT_START("P1_P2") |
| 267 | | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) |
| 268 | | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) |
| 269 | | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| 270 | | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) |
| 271 | | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) |
| 272 | | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) |
| 273 | | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) |
| 274 | | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) |
| 275 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 276 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 277 | | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 278 | | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 279 | | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 280 | | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 281 | | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) |
| 282 | | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_START2 ) |
| 283 | | |
| 284 | | PORT_START("COIN") |
| 285 | | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 286 | | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 287 | | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 288 | | PORT_BIT( 0xfc00, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 289 | | |
| 290 | | PORT_START("DSW") |
| 291 | | PORT_DIPNAME( 0x0001, 0x0001, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:1") |
| 292 | | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 293 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 294 | | PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") |
| 295 | | PORT_DIPSETTING( 0x0002, DEF_STR( Off ) ) |
| 296 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 297 | | PORT_DIPNAME( 0x0004, 0x0004, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") |
| 298 | | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 299 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 300 | | PORT_DIPNAME( 0x0008, 0x0008, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") |
| 301 | | PORT_DIPSETTING( 0x0008, DEF_STR( Off ) ) |
| 302 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 303 | | PORT_DIPNAME( 0x0010, 0x0010, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") |
| 304 | | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 305 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 306 | | PORT_DIPNAME( 0x0020, 0x0020, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") |
| 307 | | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 308 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 309 | | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") |
| 310 | | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 311 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 312 | | PORT_DIPNAME( 0x0080, 0x0080, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") |
| 313 | | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 314 | | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 315 | | PORT_DIPNAME( 0x0300, 0x0300, "Game Level" ) PORT_DIPLOCATION("SW1:1,2") /* Difficulty?? - Not sure how this works for Easy --> Very Hard */ |
| 316 | | PORT_DIPSETTING( 0x0300, "1" ) /* Initial start time 40 secs */ |
| 317 | | PORT_DIPSETTING( 0x0200, "2" ) /* Initial start time 30 secs - Other in game effects?? */ |
| 318 | | PORT_DIPSETTING( 0x0100, "3" ) /* Initial start time 30 secs - Other in game effects?? */ |
| 319 | | PORT_DIPSETTING( 0x0000, "4" ) /* Initial start time 30 secs - Other in game effects?? */ |
| 320 | | PORT_DIPNAME( 0x1c00, 0x1c00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4,5") |
| 321 | | PORT_DIPSETTING( 0x1000, DEF_STR( 4C_1C ) ) |
| 322 | | PORT_DIPSETTING( 0x1400, DEF_STR( 3C_1C ) ) |
| 323 | | PORT_DIPSETTING( 0x0000, DEF_STR( 4C_2C ) ) /* Works the same as 2C/1C */ |
| 324 | | PORT_DIPSETTING( 0x1800, DEF_STR( 2C_1C ) ) |
| 325 | | PORT_DIPSETTING( 0x0400, DEF_STR( 3C_2C ) ) /* Works like 2C/1C then 1C/1C repeat */ |
| 326 | | PORT_DIPSETTING( 0x0800, DEF_STR( 2C_2C ) ) /* Works the same as 1C/1C */ |
| 327 | | PORT_DIPSETTING( 0x1c00, DEF_STR( 1C_1C ) ) |
| 328 | | PORT_DIPSETTING( 0x0c00, DEF_STR( 1C_2C ) ) |
| 329 | | PORT_DIPNAME( 0x2000, 0x2000, "Coin Box" ) PORT_DIPLOCATION("SW1:6") /* Always displays total credits - No separate Credit display per player */ |
| 330 | | PORT_DIPSETTING( 0x2000, "1" ) /* Both players use coins from either Coin 1 or Coin 2 */ |
| 331 | | PORT_DIPSETTING( 0x0000, "2" ) /* Players use coins from own coin chute. IE: Player 1 -> Coin 1, Player 2 -> Coin 2 but shows only total credits */ |
| 332 | | PORT_DIPNAME( 0x4000, 0x4000, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:7") |
| 333 | | PORT_DIPSETTING( 0x0000, "2" ) |
| 334 | | PORT_DIPSETTING( 0x4000, "3" ) |
| 335 | | PORT_SERVICE_DIPLOC( 0x8000, IP_ACTIVE_LOW, "SW1:8" ) /* Verified */ |
| 336 | | INPUT_PORTS_END |
| 337 | | |
| 338 | | |
| 339 | | |
| 340 | 264 | static const gfx_layout tlayout = |
| 341 | 265 | { |
| 342 | 266 | 16,16, |
| r243358 | r243359 | |
| 428 | 352 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.2) |
| 429 | 353 | MACHINE_CONFIG_END |
| 430 | 354 | |
| 431 | | static MACHINE_CONFIG_DERIVED( puzzlove, silvmil ) |
| 432 | | MCFG_DEVICE_MODIFY("spritegen") |
| 433 | | MCFG_DECO_SPRITE_BOOTLEG_TYPE(1) |
| 434 | | MACHINE_CONFIG_END |
| 435 | 355 | |
| 436 | 356 | ROM_START( silvmil ) |
| 437 | 357 | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ |
| r243358 | r243359 | |
| 485 | 405 | ROM_LOAD16_BYTE( "d-20_u56.bin", 0x100001, 0x80000, CRC(e67c2c7d) SHA1(cddfd6a3d934e71853af62e3d2bf312618c9b4ff) ) |
| 486 | 406 | ROM_END |
| 487 | 407 | |
| 488 | | ROM_START( puzzlove ) |
| 489 | | ROM_REGION( 0x100000, "maincpu", 0 ) /* 68k */ |
| 490 | | ROM_LOAD16_BYTE( "3.u3", 0x00000, 0x40000, CRC(826c8472) SHA1(54f1a9fa0431de840d6fce466e09098a8d601660) ) |
| 491 | | ROM_LOAD16_BYTE( "4.u2", 0x00001, 0x40000, CRC(64ddc708) SHA1(60b29f8cd5dd654be34452fd197a77abc872e63d) ) |
| 492 | 408 | |
| 493 | | ROM_REGION( 0x20000, "audiocpu", 0 ) /* z80 */ |
| 494 | | ROM_LOAD( "1.uz02", 0x00000, 0x20000, CRC(3077e7f3) SHA1(e2bf634a2166e1851486a801e74a7ec0d4599c28) ) |
| 495 | | |
| 496 | | ROM_REGION( 0x40000, "oki", 0 ) /* samples */ |
| 497 | | ROM_LOAD( "2.uz11", 0x00000, 0x40000, CRC(4c06ec68) SHA1(3cfca1c98e73c65a45b65d43e012c5529572c057) ) |
| 498 | | |
| 499 | | ROM_REGION( 0x100000, "gfx1", 0 ) |
| 500 | | ROM_LOAD16_BYTE( "10.u41", 0x000000, 0x20000, CRC(7200f878) SHA1(27c6389f802f6e0af0210e2b01788914c0eb1d04) ) |
| 501 | | ROM_CONTINUE ( 0x080000,0x20000 ) |
| 502 | | ROM_CONTINUE ( 0x040000,0x20000 ) |
| 503 | | ROM_CONTINUE ( 0x0c0000,0x20000 ) |
| 504 | | ROM_LOAD16_BYTE( "9.u42", 0x000001, 0x20000, CRC(21b1b297) SHA1(0f589d1c62d0f79b1379e4444b119bdc4cc70cfb) ) |
| 505 | | ROM_CONTINUE ( 0x080001,0x20000 ) |
| 506 | | ROM_CONTINUE ( 0x040001,0x20000 ) |
| 507 | | ROM_CONTINUE ( 0x0c0001,0x20000 ) |
| 508 | | |
| 509 | | ROM_REGION( 0x200000, "gfx2", 0 ) /* sprites */ |
| 510 | | ROM_LOAD16_BYTE( "5.u53", 0x000000, 0x80000, CRC(8707d5a0) SHA1(05480ac34982a4e4768b7f3fccd2e557ca4b2545) ) |
| 511 | | ROM_LOAD16_BYTE( "6.u54", 0x000001, 0x80000, CRC(60a6d614) SHA1(0693c08c51d6b3a05373c9999f01b0b8d23a1c89) ) |
| 512 | | ROM_LOAD16_BYTE( "7.u55", 0x100000, 0x80000, CRC(0f2ea5c4) SHA1(4cb46fc6272e3cc14dfdcd7831157433ee7cf247) ) |
| 513 | | ROM_LOAD16_BYTE( "8.u56", 0x100001, 0x80000, CRC(037dcd3d) SHA1(fcdf604710518982e0b4acc81a56fa703d0c9407) ) |
| 514 | | ROM_END |
| 515 | | |
| 516 | 409 | void silvmil_state::tumblepb_gfx1_rearrange() |
| 517 | 410 | { |
| 518 | 411 | UINT8 *rom = memregion("gfx1")->base(); |
| r243358 | r243359 | |
| 539 | 432 | tumblepb_gfx1_rearrange(); |
| 540 | 433 | } |
| 541 | 434 | |
| 542 | | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) |
| 543 | | GAME( 1994, puzzlove, 0, puzzlove,puzzlove,silvmil_state, silvmil, ROT0, "Para", "PuzzLove", GAME_SUPPORTS_SAVE ) |
| 435 | GAME( 1995, silvmil, 0, silvmil, silvmil, silvmil_state, silvmil, ROT270, "Para", "Silver Millennium", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/toki.c
| r243358 | r243359 | |
| 91 | 91 | AM_RANGE(0x060000, 0x06d7ff) AM_RAM |
| 92 | 92 | AM_RANGE(0x06d800, 0x06dfff) AM_RAM AM_SHARE("spriteram") |
| 93 | 93 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 94 | | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram") |
| 95 | | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram") |
| 96 | | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram") |
| 94 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16") |
| 95 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16") |
| 96 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram") |
| 97 | 97 | AM_RANGE(0x080000, 0x08000d) AM_DEVREADWRITE("seibu_sound", seibu_sound_device, main_word_r, main_word_w) |
| 98 | | AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram") |
| 98 | AM_RANGE(0x0a0000, 0x0a005f) AM_WRITE(toki_control_w) AM_SHARE("scrollram16") |
| 99 | 99 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW") |
| 100 | 100 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS") |
| 101 | 101 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM") |
| r243358 | r243359 | |
| 106 | 106 | AM_RANGE(0x000000, 0x05ffff) AM_ROM |
| 107 | 107 | AM_RANGE(0x060000, 0x06dfff) AM_RAM |
| 108 | 108 | AM_RANGE(0x06e000, 0x06e7ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 109 | | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(background1_videoram_w) AM_SHARE("bg1_vram") |
| 110 | | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(background2_videoram_w) AM_SHARE("bg2_vram") |
| 111 | | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(foreground_videoram_w) AM_SHARE("videoram") |
| 109 | AM_RANGE(0x06e800, 0x06efff) AM_RAM_WRITE(toki_background1_videoram16_w) AM_SHARE("bg1_vram16") |
| 110 | AM_RANGE(0x06f000, 0x06f7ff) AM_RAM_WRITE(toki_background2_videoram16_w) AM_SHARE("bg2_vram16") |
| 111 | AM_RANGE(0x06f800, 0x06ffff) AM_RAM_WRITE(toki_foreground_videoram16_w) AM_SHARE("videoram") |
| 112 | 112 | AM_RANGE(0x071000, 0x071001) AM_WRITENOP /* sprite related? seems another scroll register */ |
| 113 | 113 | /* gets written the same value as 75000a (bg2 scrollx) */ |
| 114 | 114 | AM_RANGE(0x071804, 0x071807) AM_WRITENOP /* sprite related, always 01be0100 */ |
| 115 | 115 | AM_RANGE(0x07180e, 0x071e45) AM_WRITEONLY AM_SHARE("spriteram") |
| 116 | 116 | AM_RANGE(0x072000, 0x072001) AM_READ(watchdog_reset16_r) /* probably */ |
| 117 | 117 | AM_RANGE(0x075000, 0x075001) AM_WRITE(tokib_soundcommand16_w) |
| 118 | | AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram") |
| 118 | AM_RANGE(0x075004, 0x07500b) AM_WRITEONLY AM_SHARE("scrollram16") |
| 119 | 119 | AM_RANGE(0x0c0000, 0x0c0001) AM_READ_PORT("DSW") |
| 120 | 120 | AM_RANGE(0x0c0002, 0x0c0003) AM_READ_PORT("INPUTS") |
| 121 | 121 | AM_RANGE(0x0c0004, 0x0c0005) AM_READ_PORT("SYSTEM") |
| r243358 | r243359 | |
| 826 | 826 | memcpy (&base[0x18000 + i * 0x800], &temp[0x1800 + i * 0x2000], 0x800); |
| 827 | 827 | } |
| 828 | 828 | } |
| 829 | | |
| 830 | | save_item(NAME(m_msm5205next)); |
| 831 | | save_item(NAME(m_toggle)); |
| 832 | 829 | } |
| 833 | 830 | |
| 834 | 831 | DRIVER_INIT_MEMBER(toki_state,jujuba) |
| r243358 | r243359 | |
| 880 | 877 | |
| 881 | 878 | |
| 882 | 879 | // these 2 are both unique revisions |
| 883 | | GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", GAME_SUPPORTS_SAVE ) |
| 884 | | GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", GAME_SUPPORTS_SAVE ) |
| 880 | GAME( 1989, toki, 0, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 1)", 0 ) |
| 881 | GAME( 1989, tokiu, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 1)", 0 ) |
| 885 | 882 | |
| 886 | 883 | // these 3 are all the same revision, only the region byte differs |
| 887 | | GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", GAME_SUPPORTS_SAVE ) |
| 888 | | GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", GAME_SUPPORTS_SAVE ) |
| 889 | | GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", GAME_SUPPORTS_SAVE ) |
| 884 | GAME( 1989, tokia, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "Toki (World, set 2)", 0 ) |
| 885 | GAME( 1989, tokiua,toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation (Fabtek license)", "Toki (US, set 2)", 0 ) |
| 886 | GAME( 1989, juju, toki, toki, toki, toki_state, toki, ROT0, "TAD Corporation", "JuJu Densetsu (Japan)", 0 ) |
| 890 | 887 | |
| 891 | | GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", GAME_SUPPORTS_SAVE ) |
| 892 | | GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", GAME_SUPPORTS_SAVE ) |
| 888 | GAME( 1990, tokib, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Datsu)", "Toki (Datsu bootleg)", 0 ) |
| 889 | GAME( 1990, jujub, toki, tokib, tokib, toki_state, tokib, ROT0, "bootleg (Playmark)", "JuJu Densetsu (Playmark bootleg)", 0 ) |
| 893 | 890 | /* Sound hardware seems to have been slightly modified, the coins are handled ok, but there is no music and bad sfx. Program roms have a slight bitswap, Flipscreen also seems to be ignored */ |
| 894 | | GAME( 1989, jujuba, toki, toki, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // bootleg of tokia/juju revison |
| 891 | GAME( 1989, jujuba, toki, toki, toki, toki_state, jujuba, ROT180, "bootleg", "JuJu Densetsu (Japan, bootleg)", GAME_IMPERFECT_SOUND ) // bootleg of tokia/juju revison |
trunk/src/mame/includes/toki.h
| r243358 | r243359 | |
| 7 | 7 | public: |
| 8 | 8 | toki_state(const machine_config &mconfig, device_type type, const char *tag) |
| 9 | 9 | : driver_device(mconfig, type, tag), |
| 10 | m_spriteram(*this, "spriteram") , |
| 11 | m_background1_videoram16(*this, "bg1_vram16"), |
| 12 | m_background2_videoram16(*this, "bg2_vram16"), |
| 13 | m_videoram(*this, "videoram"), |
| 14 | m_scrollram16(*this, "scrollram16"), |
| 10 | 15 | m_maincpu(*this, "maincpu"), |
| 11 | 16 | m_audiocpu(*this, "audiocpu"), |
| 12 | 17 | m_seibu_sound(*this, "seibu_sound"), |
| 13 | 18 | m_msm(*this, "msm"), |
| 14 | 19 | m_gfxdecode(*this, "gfxdecode"), |
| 15 | 20 | m_screen(*this, "screen"), |
| 16 | | m_palette(*this, "palette"), |
| 17 | | m_spriteram(*this, "spriteram") , |
| 18 | | m_background1_videoram(*this, "bg1_vram"), |
| 19 | | m_background2_videoram(*this, "bg2_vram"), |
| 20 | | m_videoram(*this, "videoram"), |
| 21 | | m_scrollram(*this, "scrollram") { } |
| 21 | m_palette(*this, "palette") { } |
| 22 | 22 | |
| 23 | required_device<buffered_spriteram16_device> m_spriteram; |
| 24 | required_shared_ptr<UINT16> m_background1_videoram16; |
| 25 | required_shared_ptr<UINT16> m_background2_videoram16; |
| 26 | required_shared_ptr<UINT16> m_videoram; |
| 27 | required_shared_ptr<UINT16> m_scrollram16; |
| 28 | |
| 23 | 29 | required_device<cpu_device> m_maincpu; |
| 24 | 30 | required_device<cpu_device> m_audiocpu; |
| 25 | 31 | optional_device<seibu_sound_device> m_seibu_sound; |
| r243358 | r243359 | |
| 28 | 34 | required_device<screen_device> m_screen; |
| 29 | 35 | required_device<palette_device> m_palette; |
| 30 | 36 | |
| 31 | | required_device<buffered_spriteram16_device> m_spriteram; |
| 32 | | required_shared_ptr<UINT16> m_background1_videoram; |
| 33 | | required_shared_ptr<UINT16> m_background2_videoram; |
| 34 | | required_shared_ptr<UINT16> m_videoram; |
| 35 | | required_shared_ptr<UINT16> m_scrollram; |
| 36 | | |
| 37 | 37 | int m_msm5205next; |
| 38 | 38 | int m_toggle; |
| 39 | | |
| 40 | 39 | tilemap_t *m_background_layer; |
| 41 | 40 | tilemap_t *m_foreground_layer; |
| 42 | 41 | tilemap_t *m_text_layer; |
| 43 | 42 | |
| 44 | 43 | DECLARE_WRITE16_MEMBER(tokib_soundcommand16_w); |
| 45 | 44 | DECLARE_READ16_MEMBER(pip16_r); |
| 45 | DECLARE_WRITE8_MEMBER(toki_adpcm_data_w); |
| 46 | 46 | DECLARE_WRITE16_MEMBER(toki_control_w); |
| 47 | | DECLARE_WRITE16_MEMBER(foreground_videoram_w); |
| 48 | | DECLARE_WRITE16_MEMBER(background1_videoram_w); |
| 49 | | DECLARE_WRITE16_MEMBER(background2_videoram_w); |
| 47 | DECLARE_WRITE16_MEMBER(toki_foreground_videoram16_w); |
| 48 | DECLARE_WRITE16_MEMBER(toki_background1_videoram16_w); |
| 49 | DECLARE_WRITE16_MEMBER(toki_background2_videoram16_w); |
| 50 | 50 | DECLARE_WRITE8_MEMBER(toki_adpcm_control_w); |
| 51 | | DECLARE_WRITE8_MEMBER(toki_adpcm_data_w); |
| 52 | | DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); |
| 53 | | |
| 54 | 51 | DECLARE_DRIVER_INIT(tokib); |
| 55 | 52 | DECLARE_DRIVER_INIT(jujuba); |
| 56 | 53 | DECLARE_DRIVER_INIT(toki); |
| 57 | | |
| 58 | 54 | TILE_GET_INFO_MEMBER(get_text_tile_info); |
| 59 | 55 | TILE_GET_INFO_MEMBER(get_back_tile_info); |
| 60 | 56 | TILE_GET_INFO_MEMBER(get_fore_tile_info); |
| 61 | | |
| 62 | 57 | virtual void video_start(); |
| 63 | | |
| 64 | 58 | UINT32 screen_update_toki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 65 | 59 | UINT32 screen_update_tokib(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 66 | 60 | void toki_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 67 | 61 | void tokib_draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect); |
| 62 | DECLARE_WRITE_LINE_MEMBER(toki_adpcm_int); |
| 68 | 63 | }; |
trunk/src/mame/video/toki.c
| r243358 | r243359 | |
| 29 | 29 | WRITE16_MEMBER(toki_state::toki_control_w) |
| 30 | 30 | { |
| 31 | 31 | m_screen->update_partial(m_screen->vpos() - 1); |
| 32 | | COMBINE_DATA(&m_scrollram[offset]); |
| 32 | COMBINE_DATA(&m_scrollram16[offset]); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | TILE_GET_INFO_MEMBER(toki_state::get_text_tile_info) |
| r243358 | r243359 | |
| 48 | 48 | |
| 49 | 49 | TILE_GET_INFO_MEMBER(toki_state::get_back_tile_info) |
| 50 | 50 | { |
| 51 | | int tile = m_background1_videoram[tile_index]; |
| 51 | int tile = m_background1_videoram16[tile_index]; |
| 52 | 52 | int color = (tile >> 12) & 0xf; |
| 53 | 53 | |
| 54 | 54 | tile &= 0xfff; |
| r243358 | r243359 | |
| 61 | 61 | |
| 62 | 62 | TILE_GET_INFO_MEMBER(toki_state::get_fore_tile_info) |
| 63 | 63 | { |
| 64 | | int tile = m_background2_videoram[tile_index]; |
| 64 | int tile = m_background2_videoram16[tile_index]; |
| 65 | 65 | int color = (tile >> 12) & 0xf; |
| 66 | 66 | |
| 67 | 67 | tile &= 0xfff; |
| r243358 | r243359 | |
| 92 | 92 | |
| 93 | 93 | /*************************************/ |
| 94 | 94 | |
| 95 | | WRITE16_MEMBER(toki_state::foreground_videoram_w) |
| 95 | WRITE16_MEMBER(toki_state::toki_foreground_videoram16_w) |
| 96 | 96 | { |
| 97 | 97 | UINT16 *videoram = m_videoram; |
| 98 | 98 | COMBINE_DATA(&videoram[offset]); |
| 99 | 99 | m_text_layer->mark_tile_dirty(offset); |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | | WRITE16_MEMBER(toki_state::background1_videoram_w) |
| 102 | WRITE16_MEMBER(toki_state::toki_background1_videoram16_w) |
| 103 | 103 | { |
| 104 | | COMBINE_DATA(&m_background1_videoram[offset]); |
| 104 | COMBINE_DATA(&m_background1_videoram16[offset]); |
| 105 | 105 | m_background_layer->mark_tile_dirty(offset); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | | WRITE16_MEMBER(toki_state::background2_videoram_w) |
| 108 | WRITE16_MEMBER(toki_state::toki_background2_videoram16_w) |
| 109 | 109 | { |
| 110 | | COMBINE_DATA(&m_background2_videoram[offset]); |
| 110 | COMBINE_DATA(&m_background2_videoram16[offset]); |
| 111 | 111 | m_foreground_layer->mark_tile_dirty(offset); |
| 112 | 112 | } |
| 113 | 113 | |
| r243358 | r243359 | |
| 249 | 249 | { |
| 250 | 250 | int background_y_scroll,foreground_y_scroll,background_x_scroll,foreground_x_scroll; |
| 251 | 251 | |
| 252 | | background_x_scroll=((m_scrollram[0x06] &0x7f) << 1) |
| 253 | | |((m_scrollram[0x06] &0x80) >> 7) |
| 254 | | |((m_scrollram[0x05] &0x10) << 4); |
| 255 | | background_y_scroll=((m_scrollram[0x0d]&0x10)<<4)+((m_scrollram[0x0e]&0x7f)<<1)+((m_scrollram[0x0e]&0x80)>>7); |
| 252 | background_x_scroll=((m_scrollram16[0x06] &0x7f) << 1) |
| 253 | |((m_scrollram16[0x06] &0x80) >> 7) |
| 254 | |((m_scrollram16[0x05] &0x10) << 4); |
| 255 | background_y_scroll=((m_scrollram16[0x0d]&0x10)<<4)+((m_scrollram16[0x0e]&0x7f)<<1)+((m_scrollram16[0x0e]&0x80)>>7); |
| 256 | 256 | |
| 257 | 257 | m_background_layer->set_scrollx(0, background_x_scroll ); |
| 258 | 258 | m_background_layer->set_scrolly(0, background_y_scroll ); |
| 259 | 259 | |
| 260 | | foreground_x_scroll= ((m_scrollram[0x16] &0x7f) << 1) |
| 261 | | |((m_scrollram[0x16] &0x80) >> 7) |
| 262 | | |((m_scrollram[0x15] &0x10) << 4); |
| 263 | | foreground_y_scroll=((m_scrollram[0x1d]&0x10)<<4)+((m_scrollram[0x1e]&0x7f)<<1)+((m_scrollram[0x1e]&0x80)>>7); |
| 260 | foreground_x_scroll= ((m_scrollram16[0x16] &0x7f) << 1) |
| 261 | |((m_scrollram16[0x16] &0x80) >> 7) |
| 262 | |((m_scrollram16[0x15] &0x10) << 4); |
| 263 | foreground_y_scroll=((m_scrollram16[0x1d]&0x10)<<4)+((m_scrollram16[0x1e]&0x7f)<<1)+((m_scrollram16[0x1e]&0x80)>>7); |
| 264 | 264 | |
| 265 | 265 | m_foreground_layer->set_scrollx(0, foreground_x_scroll ); |
| 266 | 266 | m_foreground_layer->set_scrolly(0, foreground_y_scroll ); |
| 267 | 267 | |
| 268 | | flip_screen_set((m_scrollram[0x28]&0x8000)==0); |
| 268 | flip_screen_set((m_scrollram16[0x28]&0x8000)==0); |
| 269 | 269 | |
| 270 | | if (m_scrollram[0x28]&0x100) { |
| 270 | if (m_scrollram16[0x28]&0x100) { |
| 271 | 271 | m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 272 | 272 | m_foreground_layer->draw(screen, bitmap, cliprect, 0,0); |
| 273 | 273 | } else { |
| r243358 | r243359 | |
| 283 | 283 | { |
| 284 | 284 | m_foreground_layer->set_scroll_rows(1); |
| 285 | 285 | m_background_layer->set_scroll_rows(1); |
| 286 | | m_background_layer->set_scrolly(0, m_scrollram[0]+1 ); |
| 287 | | m_background_layer->set_scrollx(0, m_scrollram[1]-0x103 ); |
| 288 | | m_foreground_layer->set_scrolly(0, m_scrollram[2]+1 ); |
| 289 | | m_foreground_layer->set_scrollx(0, m_scrollram[3]-0x101 ); |
| 286 | m_background_layer->set_scrolly(0, m_scrollram16[0]+1 ); |
| 287 | m_background_layer->set_scrollx(0, m_scrollram16[1]-0x103 ); |
| 288 | m_foreground_layer->set_scrolly(0, m_scrollram16[2]+1 ); |
| 289 | m_foreground_layer->set_scrollx(0, m_scrollram16[3]-0x101 ); |
| 290 | 290 | |
| 291 | | if (m_scrollram[3]&0x2000) { |
| 291 | if (m_scrollram16[3]&0x2000) { |
| 292 | 292 | m_background_layer->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE,0); |
| 293 | 293 | m_foreground_layer->draw(screen, bitmap, cliprect, 0,0); |
| 294 | 294 | } else { |
trunk/src/mess/drivers/c65.c
| r243358 | r243359 | |
| 20 | 20 | |
| 21 | 21 | #include "emu.h" |
| 22 | 22 | #include "cpu/m6502/m4510.h" |
| 23 | | #include "machine/mos6526.h" |
| 24 | 23 | |
| 25 | 24 | #define MAIN_CLOCK XTAL_3_5MHz |
| 26 | 25 | |
| r243358 | r243359 | |
| 30 | 29 | c65_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | 30 | : driver_device(mconfig, type, tag), |
| 32 | 31 | m_maincpu(*this, "maincpu"), |
| 33 | | m_cia0(*this, "cia_0"), |
| 34 | | m_cia1(*this, "cia_1"), |
| 35 | 32 | m_screen(*this, "screen"), |
| 36 | 33 | m_palette(*this, "palette"), |
| 37 | 34 | m_workram(*this, "wram"), |
| r243358 | r243359 | |
| 45 | 42 | |
| 46 | 43 | // devices |
| 47 | 44 | required_device<m4510_device> m_maincpu; |
| 48 | | required_device<mos6526_device> m_cia0; |
| 49 | | required_device<mos6526_device> m_cia1; |
| 50 | 45 | required_device<screen_device> m_screen; |
| 51 | 46 | required_device<palette_device> m_palette; |
| 52 | 47 | required_shared_ptr<UINT8> m_workram; |
| r243358 | r243359 | |
| 58 | 53 | required_device<gfxdecode_device> m_gfxdecode; |
| 59 | 54 | |
| 60 | 55 | UINT8 *m_iplrom; |
| 61 | | UINT8 m_keyb_input[10]; |
| 62 | | UINT8 m_keyb_mux; |
| 56 | |
| 63 | 57 | |
| 64 | 58 | DECLARE_READ8_MEMBER(vic4567_dummy_r); |
| 65 | 59 | DECLARE_WRITE8_MEMBER(vic4567_dummy_w); |
| r243358 | r243359 | |
| 69 | 63 | DECLARE_WRITE8_MEMBER(DMAgic_w); |
| 70 | 64 | DECLARE_READ8_MEMBER(CIASelect_r); |
| 71 | 65 | DECLARE_WRITE8_MEMBER(CIASelect_w); |
| 72 | | DECLARE_READ8_MEMBER(cia0_porta_r); |
| 73 | | DECLARE_WRITE8_MEMBER(cia0_porta_w); |
| 74 | | DECLARE_READ8_MEMBER(cia0_portb_r); |
| 75 | | DECLARE_WRITE8_MEMBER(cia0_portb_w); |
| 76 | | DECLARE_WRITE_LINE_MEMBER(cia0_irq); |
| 77 | 66 | |
| 78 | 67 | DECLARE_READ8_MEMBER(dummy_r); |
| 79 | | |
| 68 | |
| 80 | 69 | // screen updates |
| 81 | 70 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 82 | 71 | DECLARE_PALETTE_INIT(c65); |
| r243358 | r243359 | |
| 100 | 89 | UINT8 m_VIC3_ControlB; |
| 101 | 90 | void PalEntryFlush(UINT8 offset); |
| 102 | 91 | void DMAgicExecute(address_space &space,UINT32 address); |
| 103 | | void IRQCheck(UINT8 irq_cause); |
| 104 | 92 | int inner_x_char(int xoffs); |
| 105 | 93 | int inner_y_char(int yoffs); |
| 106 | 94 | }; |
| r243358 | r243359 | |
| 166 | 154 | case 0x12: |
| 167 | 155 | res = (m_screen->vpos() & 0xff); |
| 168 | 156 | return res; |
| 169 | | case 0x15: |
| 170 | | return 0xff; // silence log for now |
| 171 | | case 0x19: |
| 172 | | return m_VIC2_IRQPend; |
| 173 | | |
| 174 | | case 0x1a: |
| 175 | | return m_VIC2_IRQMask; |
| 176 | | |
| 177 | 157 | case 0x20: |
| 178 | 158 | return m_VIC2_EXTColor; |
| 179 | | |
| 159 | case 0x19: |
| 160 | return m_VIC2_IRQPend; |
| 180 | 161 | case 0x30: |
| 181 | 162 | return m_VIC3_ControlA; |
| 182 | 163 | case 0x31: |
| r243358 | r243359 | |
| 193 | 174 | switch(offset) |
| 194 | 175 | { |
| 195 | 176 | case 0x19: |
| 196 | | m_VIC2_IRQPend &= ~data; |
| 197 | | IRQCheck(0); |
| 177 | m_VIC2_IRQPend = data & 0x8f; |
| 198 | 178 | break; |
| 199 | 179 | case 0x1a: |
| 200 | 180 | m_VIC2_IRQMask = data & 0xf; |
| 201 | | IRQCheck(0); |
| 202 | 181 | break; |
| 203 | 182 | case 0x20: |
| 204 | 183 | m_VIC2_EXTColor = data & 0xf; |
| r243358 | r243359 | |
| 328 | 307 | else |
| 329 | 308 | { |
| 330 | 309 | // CIA at 0xdc00 |
| 331 | | switch((offset & 0x700) | 0x800) |
| 332 | | { |
| 333 | | case 0xc00: |
| 334 | | return m_cia0->read(space,offset); |
| 335 | | case 0xd00: |
| 336 | | return m_cia1->read(space,offset); |
| 337 | | default: |
| 338 | | printf("Unknown I/O access read to offset %04x\n",offset); |
| 339 | | break; |
| 340 | | } |
| 341 | | |
| 342 | 310 | } |
| 343 | 311 | |
| 344 | 312 | return 0xff; |
| r243358 | r243359 | |
| 351 | 319 | else |
| 352 | 320 | { |
| 353 | 321 | // CIA at 0xdc00 |
| 354 | | switch((offset & 0x700) | 0x800) |
| 355 | | { |
| 356 | | case 0xc00: |
| 357 | | m_cia0->write(space,offset,data); |
| 358 | | break; |
| 359 | | |
| 360 | | case 0xd00: |
| 361 | | m_cia1->write(space,offset,data); |
| 362 | | break; |
| 363 | | default: |
| 364 | | printf("Unknown I/O access write to offset %04x data = %02x\n",offset,data); |
| 365 | | break; |
| 366 | | } |
| 367 | 322 | } |
| 368 | 323 | |
| 369 | 324 | } |
| 370 | 325 | |
| 371 | | READ8_MEMBER(c65_state::cia0_porta_r) |
| 372 | | { |
| 373 | | |
| 374 | | return 0xff; |
| 375 | | } |
| 376 | | |
| 377 | | READ8_MEMBER(c65_state::cia0_portb_r) |
| 378 | | { |
| 379 | | static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; |
| 380 | | UINT8 res; |
| 381 | | |
| 382 | | res = 0xff; |
| 383 | | for(int i=0;i<8;i++) |
| 384 | | { |
| 385 | | |
| 386 | | m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read(); |
| 387 | | |
| 388 | | if(m_keyb_mux & 1 << (i)) |
| 389 | | res &= m_keyb_input[i]; |
| 390 | | } |
| 391 | | |
| 392 | | return res; |
| 393 | | } |
| 394 | | |
| 395 | | WRITE8_MEMBER(c65_state::cia0_porta_w) |
| 396 | | { |
| 397 | | m_keyb_mux = ~data; |
| 398 | | printf("%02x\n",m_keyb_mux); |
| 399 | | } |
| 400 | | |
| 401 | | WRITE8_MEMBER(c65_state::cia0_portb_w) |
| 402 | | { |
| 403 | | } |
| 404 | | |
| 405 | 326 | READ8_MEMBER(c65_state::dummy_r) |
| 406 | 327 | { |
| 407 | 328 | return 0; |
| r243358 | r243359 | |
| 436 | 357 | |
| 437 | 358 | |
| 438 | 359 | static INPUT_PORTS_START( c65 ) |
| 439 | | PORT_START( "ROW0" ) |
| 440 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Down Up") PORT_CODE(KEYCODE_RALT) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 441 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 442 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 443 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 444 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 445 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Crsr Right Left") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 446 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 447 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INST DEL") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 360 | /* dummy active high structure */ |
| 361 | PORT_START("SYSA") |
| 362 | PORT_DIPNAME( 0x01, 0x00, "SYSA" ) |
| 363 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 364 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 365 | PORT_DIPNAME( 0x02, 0x00, DEF_STR( Unknown ) ) |
| 366 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 367 | PORT_DIPSETTING( 0x02, DEF_STR( On ) ) |
| 368 | PORT_DIPNAME( 0x04, 0x00, DEF_STR( Unknown ) ) |
| 369 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 370 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 371 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Unknown ) ) |
| 372 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 373 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 374 | PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unknown ) ) |
| 375 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 376 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 377 | PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unknown ) ) |
| 378 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 379 | PORT_DIPSETTING( 0x20, DEF_STR( On ) ) |
| 380 | PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unknown ) ) |
| 381 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 382 | PORT_DIPSETTING( 0x40, DEF_STR( On ) ) |
| 383 | PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unknown ) ) |
| 384 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 385 | PORT_DIPSETTING( 0x80, DEF_STR( On ) ) |
| 448 | 386 | |
| 449 | | PORT_START( "ROW1" ) |
| 450 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Left)") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 451 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 452 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 453 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 454 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 455 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 456 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 457 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 458 | | |
| 459 | | PORT_START( "ROW2" ) |
| 460 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 461 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 462 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 463 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 464 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') |
| 465 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 466 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 467 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 468 | | |
| 469 | | PORT_START( "ROW3" ) |
| 470 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 471 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 472 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 473 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 474 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') |
| 475 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 476 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 477 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') |
| 478 | | |
| 479 | | PORT_START( "ROW4" ) |
| 480 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 481 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 482 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 483 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 484 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 485 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 486 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 487 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') |
| 488 | | |
| 489 | | PORT_START( "ROW5" ) |
| 490 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') |
| 491 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 492 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(':') PORT_CHAR('[') |
| 493 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') |
| 494 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('-') |
| 495 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 496 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 497 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('+') |
| 498 | | |
| 499 | | PORT_START( "ROW6" ) |
| 500 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 501 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x91 Pi") PORT_CODE(KEYCODE_DEL) PORT_CHAR(0x2191) PORT_CHAR(0x03C0) |
| 502 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('=') |
| 503 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Shift (Right)") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 504 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CLR HOME") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(HOME)) |
| 505 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR(']') |
| 506 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('*') |
| 507 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH2) PORT_CHAR('\xA3') |
| 508 | | |
| 509 | | PORT_START( "ROW7" ) |
| 510 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RUN STOP") PORT_CODE(KEYCODE_HOME) |
| 511 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 512 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CBM") PORT_CODE(KEYCODE_LALT) |
| 513 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 514 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') |
| 515 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_SHIFT_2) |
| 516 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\xE2\x86\x90") PORT_CODE(KEYCODE_TILDE) PORT_CHAR(0x2190) |
| 517 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 518 | | |
| 387 | /* dummy active low structure */ |
| 388 | PORT_START("DSWA") |
| 389 | PORT_DIPNAME( 0x01, 0x01, "DSWA" ) |
| 390 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 391 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 392 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 393 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 394 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 395 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 396 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 397 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 398 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 399 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 400 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 401 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 402 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 403 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 404 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 405 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 406 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 407 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 408 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 409 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 410 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) |
| 411 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 412 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 519 | 413 | INPUT_PORTS_END |
| 520 | 414 | |
| 521 | 415 | |
| r243358 | r243359 | |
| 551 | 445 | GFXDECODE_ENTRY( "maincpu", 0xd000, charlayout, 0, 16 ) // another identical copy is at 0x9000 |
| 552 | 446 | GFXDECODE_END |
| 553 | 447 | |
| 554 | | void c65_state::IRQCheck(UINT8 irq_cause) |
| 555 | | { |
| 556 | | m_VIC2_IRQPend |= (irq_cause != 0) ? 0x80 : 0x00; |
| 557 | | m_VIC2_IRQPend |= irq_cause; |
| 558 | | |
| 559 | | m_maincpu->set_input_line(M4510_IRQ_LINE,m_VIC2_IRQMask & m_VIC2_IRQPend ? ASSERT_LINE : CLEAR_LINE); |
| 560 | | } |
| 561 | | |
| 562 | 448 | INTERRUPT_GEN_MEMBER(c65_state::vic3_vblank_irq) |
| 563 | 449 | { |
| 564 | | IRQCheck(1); |
| 565 | 450 | //if(m_VIC2_IRQMask & 1) |
| 566 | 451 | // m_maincpu->set_input_line(M4510_IRQ_LINE,HOLD_LINE); |
| 567 | 452 | } |
| 568 | 453 | |
| 569 | | WRITE_LINE_MEMBER(c65_state::cia0_irq) |
| 570 | | { |
| 571 | | printf("%d IRQ\n",state); |
| 572 | | |
| 573 | | #if 0 |
| 574 | | if(state) |
| 575 | | { |
| 576 | | static const char *const c64ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" }; |
| 577 | | for(int i=0;i<8;i++) |
| 578 | | m_keyb_input[i] = machine().root_device().ioport(c64ports[i])->read(); |
| 579 | | } |
| 580 | | #endif |
| 581 | | // m_cia0_irq = state; |
| 582 | | // c65_irq(state || m_vicirq); |
| 583 | | } |
| 584 | | |
| 585 | 454 | static MACHINE_CONFIG_START( c65, c65_state ) |
| 586 | 455 | |
| 587 | 456 | /* basic machine hardware */ |
| r243358 | r243359 | |
| 589 | 458 | MCFG_CPU_PROGRAM_MAP(c65_map) |
| 590 | 459 | MCFG_CPU_VBLANK_INT_DRIVER("screen",c65_state,vic3_vblank_irq) |
| 591 | 460 | |
| 592 | | MCFG_DEVICE_ADD("cia_0", MOS6526, MAIN_CLOCK) |
| 593 | | MCFG_MOS6526_TOD(60) |
| 594 | | MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, cia0_irq)) |
| 595 | | MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, cia0_porta_r)) |
| 596 | | MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_porta_w)) |
| 597 | | MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(c65_state, cia0_portb_r)) |
| 598 | | MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(c65_state, cia0_portb_w)) |
| 599 | | |
| 600 | | MCFG_DEVICE_ADD("cia_1", MOS6526, MAIN_CLOCK) |
| 601 | | MCFG_MOS6526_TOD(60) |
| 602 | | // MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(c65_state, c65_cia1_interrupt)) |
| 603 | | // MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(c65_state, c65_cia1_port_a_r)) |
| 604 | | // MCFG_MOS6526_PA_OUTPUT_CALLBACK(WRITE8(c65_state, c65_cia1_port_a_w)) |
| 605 | | |
| 606 | | |
| 607 | 461 | /* video hardware */ |
| 608 | 462 | MCFG_SCREEN_ADD("screen", RASTER) |
| 609 | 463 | // MCFG_SCREEN_REFRESH_RATE(60) |
trunk/src/mess/drivers/mbee.c
| r243358 | r243359 | |
| 22 | 22 | The unemulated Matilda is a IBM XT clone fitted with a NEC V40, and has the |
| 23 | 23 | ability to emulate the 256TC as mentioned above. |
| 24 | 24 | |
| 25 | | Floppy formats: |
| 26 | | - All disks are the standard CPCEMU 'dsk' format. |
| 27 | | - Types are 9cm 80 track, and 13cm 40 track (single or double sided) |
| 28 | | - 13cm has been specified as QD to prevent a nasty crash if an 80-track disk was mounted |
| 29 | | - The tracks/sector layout is the same regardless of size |
| 30 | | - Although certain models came with particular drives as standard, users could add |
| 31 | | the other size if they wished. We support both sizes on any model. |
| 25 | Floppy Disk types (as used by ubee512) |
| 26 | - ss80 - single sided 80 track |
| 27 | - ds40 - double-sided 40 track - 400KB |
| 28 | - ds80, ds82, ds84 - double sided 80 track - 800KB |
| 29 | - dsk - various - 211KB, 421KB, 841KB |
| 32 | 30 | |
| 33 | 31 | Microbee Standard / Plus memory map |
| 34 | 32 | |
| r243358 | r243359 | |
| 84 | 82 | |
| 85 | 83 | - Fix Paste (it loses most of the characters) |
| 86 | 84 | |
| 87 | | - all except 256tc: RTC is optional, but it is being totally ignored. |
| 85 | - RTC for 256TC works, but it is supposed to be an option on other |
| 86 | models. It is being completely ignored. |
| 88 | 87 | |
| 89 | 88 | - Most early models have a clock in Telcom, and in the menu. It doesn't |
| 90 | 89 | work. |
| 91 | 90 | |
| 92 | | - various fdc issues: |
| 93 | | - only some ds40 disks can be used. All 80-track disks fail. |
| 94 | | - some disks show no or partial directory listing. |
| 95 | | - some disks cause MESS to freeze. |
| 96 | | - ENMF pin missing from wd_fdc. |
| 97 | | - incorrect timing for track register causes 256tc failure to boot a disk. |
| 98 | | - 56k model takes about 2 minutes to boot a disk if loaded via command line. |
| 99 | | |
| 100 | | - 256tc: At the menu, if F2 pressed to activate the Monitor, the emulated machine |
| 101 | | crashes due to a bug in z80pio emulation. |
| 102 | | |
| 103 | | - 256tc: Keyboard ROM U60 needs to be dumped. |
| 104 | | - 128k: PROM PAL needs to be dumped, so that the bankswitching can be fixed. |
| 91 | - The Monitor program on 256TC crashes the system. This appears |
| 92 | to be a MAME core bug involving the z80pio. |
| 105 | 93 | |
| 94 | - The 256TC corrupts itself when a floppy disk is detected. |
| 95 | |
| 96 | - Disk system doesn't work because of fdc problems. |
| 97 | |
| 106 | 98 | - Teleterm: keyboard is problematic, and cursor doesn't show. |
| 107 | 99 | |
| 108 | 100 | |
| r243358 | r243359 | |
| 121 | 113 | in the emulator for some years. Conversion to the new modern |
| 122 | 114 | implementation (2013-07-05) has not resolved the issue. |
| 123 | 115 | |
| 116 | There are 3 types of microbee disks available in the wild. |
| 117 | |
| 118 | - CPCEMU-format "dsk" disks, which has an already-working |
| 119 | format "dsk_dsk". |
| 120 | |
| 121 | - ubee512-format disks, such as "ds80,ds82,ds84,ss80", etc. |
| 122 | These are described in "mbee_dsk", but it's not known if it |
| 123 | works as yet. |
| 124 | |
| 125 | - There a "img" format for the 128k boot disk. The internal |
| 126 | layout is not known and no work has been done. |
| 127 | |
| 128 | |
| 124 | 129 | ****************************************************************************/ |
| 125 | 130 | |
| 126 | 131 | |
| 127 | 132 | #include "includes/mbee.h" |
| 133 | #include "formats/mbee_dsk.h" |
| 128 | 134 | #include "formats/mbee_cas.h" |
| 129 | 135 | |
| 130 | 136 | |
| r243358 | r243359 | |
| 213 | 219 | AM_RANGE(0xf800, 0xffff) AM_RAMBANK("bankfh") |
| 214 | 220 | ADDRESS_MAP_END |
| 215 | 221 | |
| 216 | | static ADDRESS_MAP_START(mbee256_mem, AS_PROGRAM, 8, mbee_state) |
| 217 | | AM_RANGE(0x0000, 0x0fff) AM_READ_BANK("bankr0") AM_WRITE_BANK("bankw0") |
| 218 | | AM_RANGE(0x1000, 0x1fff) AM_READ_BANK("bankr1") AM_WRITE_BANK("bankw1") |
| 219 | | AM_RANGE(0x2000, 0x2fff) AM_READ_BANK("bankr2") AM_WRITE_BANK("bankw2") |
| 220 | | AM_RANGE(0x3000, 0x3fff) AM_READ_BANK("bankr3") AM_WRITE_BANK("bankw3") |
| 221 | | AM_RANGE(0x4000, 0x4fff) AM_READ_BANK("bankr4") AM_WRITE_BANK("bankw4") |
| 222 | | AM_RANGE(0x5000, 0x5fff) AM_READ_BANK("bankr5") AM_WRITE_BANK("bankw5") |
| 223 | | AM_RANGE(0x6000, 0x6fff) AM_READ_BANK("bankr6") AM_WRITE_BANK("bankw6") |
| 224 | | AM_RANGE(0x7000, 0x7fff) AM_READ_BANK("bankr7") AM_WRITE_BANK("bankw7") |
| 225 | | AM_RANGE(0x8000, 0x8fff) AM_READ_BANK("bankr8") AM_WRITE_BANK("bankw8") |
| 226 | | AM_RANGE(0x9000, 0x9fff) AM_READ_BANK("bankr9") AM_WRITE_BANK("bankw9") |
| 227 | | AM_RANGE(0xa000, 0xafff) AM_READ_BANK("bankr10") AM_WRITE_BANK("bankw10") |
| 228 | | AM_RANGE(0xb000, 0xbfff) AM_READ_BANK("bankr11") AM_WRITE_BANK("bankw11") |
| 229 | | AM_RANGE(0xc000, 0xcfff) AM_READ_BANK("bankr12") AM_WRITE_BANK("bankw12") |
| 230 | | AM_RANGE(0xd000, 0xdfff) AM_READ_BANK("bankr13") AM_WRITE_BANK("bankw13") |
| 231 | | AM_RANGE(0xe000, 0xefff) AM_READ_BANK("bankr14") AM_WRITE_BANK("bankw14") |
| 232 | | AM_RANGE(0xf000, 0xffff) AM_READ_BANK("bankr15") AM_WRITE_BANK("bankw15") |
| 233 | | ADDRESS_MAP_END |
| 234 | | |
| 235 | 222 | static ADDRESS_MAP_START(mbeett_mem, AS_PROGRAM, 8, mbee_state) |
| 236 | 223 | AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot") |
| 237 | 224 | AM_RANGE(0x1000, 0x7fff) AM_RAM |
| r243358 | r243359 | |
| 627 | 614 | static GFXDECODE_START( mbeeppc ) |
| 628 | 615 | GFXDECODE_ENTRY( "gfx", 0x0000, mbee_charlayout, 0, 8 ) |
| 629 | 616 | GFXDECODE_END |
| 617 | #if 0 |
| 618 | static LEGACY_FLOPPY_OPTIONS_START(mbee) |
| 619 | LEGACY_FLOPPY_OPTION(ss80, "ss80", "SS80 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 620 | HEADS([1]) |
| 621 | TRACKS([80]) |
| 622 | SECTORS([10]) |
| 623 | SECTOR_LENGTH([512]) |
| 624 | FIRST_SECTOR_ID([1])) |
| 625 | LEGACY_FLOPPY_OPTION(ds40, "ds40", "DS40 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 626 | HEADS([2]) |
| 627 | TRACKS([40]) |
| 628 | SECTORS([10]) |
| 629 | SECTOR_LENGTH([512]) |
| 630 | FIRST_SECTOR_ID([1])) |
| 631 | LEGACY_FLOPPY_OPTION(ds80, "ds80", "DS80 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 632 | HEADS([2]) |
| 633 | TRACKS([80]) |
| 634 | SECTORS([10]) |
| 635 | SECTOR_LENGTH([512]) |
| 636 | FIRST_SECTOR_ID([21])) |
| 637 | LEGACY_FLOPPY_OPTION(ds84, "ds82,ds84", "DS84 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 638 | HEADS([2]) |
| 639 | TRACKS([80]) |
| 640 | SECTORS([10]) |
| 641 | SECTOR_LENGTH([512]) |
| 642 | FIRST_SECTOR_ID([1])) |
| 643 | LEGACY_FLOPPY_OPTIONS_END |
| 630 | 644 | |
| 645 | static const floppy_interface mbee_floppy_interface = |
| 646 | { |
| 647 | FLOPPY_STANDARD_5_25_DSHD, |
| 648 | LEGACY_FLOPPY_OPTIONS_NAME(mbee), |
| 649 | NULL |
| 650 | }; |
| 651 | #endif |
| 652 | |
| 653 | FLOPPY_FORMATS_MEMBER( mbee_state::floppy_formats ) |
| 654 | FLOPPY_MBEE_FORMAT |
| 655 | FLOPPY_FORMATS_END |
| 656 | |
| 631 | 657 | static SLOT_INTERFACE_START( mbee_floppies ) |
| 632 | | SLOT_INTERFACE( "drive3a", FLOPPY_35_DD ) |
| 633 | | SLOT_INTERFACE( "drive3b", FLOPPY_35_DD ) |
| 634 | | SLOT_INTERFACE( "drive5a", FLOPPY_525_QD ) |
| 635 | | SLOT_INTERFACE( "drive5b", FLOPPY_525_QD ) |
| 658 | SLOT_INTERFACE( "35dd", FLOPPY_35_DD ) |
| 659 | SLOT_INTERFACE( "525dd", FLOPPY_525_QD ) |
| 636 | 660 | SLOT_INTERFACE_END |
| 637 | 661 | |
| 638 | 662 | |
| r243358 | r243359 | |
| 662 | 686 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", mbee) |
| 663 | 687 | MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") // usually sold with amber or green monitor |
| 664 | 688 | |
| 665 | | MCFG_VIDEO_START_OVERRIDE(mbee_state, mbee) |
| 689 | MCFG_VIDEO_START_OVERRIDE(mbee_state,mbee) |
| 666 | 690 | |
| 667 | 691 | /* sound hardware */ |
| 668 | 692 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r243358 | r243359 | |
| 789 | 813 | MCFG_CPU_IO_MAP(mbee56_io) |
| 790 | 814 | MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee56 ) |
| 791 | 815 | MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4) // divided by 2 externally, then divided by 2 internally (/ENMF pin not emulated) |
| 792 | | MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w)) |
| 793 | | MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w)) |
| 794 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats) |
| 795 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats) |
| 816 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "525dd", mbee_state::floppy_formats) |
| 817 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "35dd", mbee_state::floppy_formats) |
| 796 | 818 | MACHINE_CONFIG_END |
| 797 | 819 | |
| 798 | 820 | static MACHINE_CONFIG_DERIVED( mbee64, mbee56 ) |
| r243358 | r243359 | |
| 808 | 830 | MCFG_CPU_IO_MAP(mbee128_io) |
| 809 | 831 | MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee128 ) |
| 810 | 832 | MCFG_WD2793x_ADD("fdc", XTAL_4MHz / 4) |
| 811 | | MCFG_WD_FDC_INTRQ_CALLBACK(WRITELINE(mbee_state, fdc_intrq_w)) |
| 812 | | MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(mbee_state, fdc_drq_w)) |
| 813 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive5a", floppy_image_device::default_floppy_formats) |
| 814 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive5b", floppy_image_device::default_floppy_formats) |
| 833 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "35dd", mbee_state::floppy_formats) |
| 834 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "525dd", mbee_state::floppy_formats) |
| 815 | 835 | MACHINE_CONFIG_END |
| 816 | 836 | |
| 817 | 837 | static MACHINE_CONFIG_DERIVED( mbee256, mbee128 ) |
| 818 | 838 | MCFG_CPU_MODIFY( "maincpu" ) |
| 819 | | MCFG_CPU_PROGRAM_MAP(mbee256_mem) |
| 820 | 839 | MCFG_CPU_IO_MAP(mbee256_io) |
| 821 | 840 | MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee256 ) |
| 822 | 841 | MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz ) |
| r243358 | r243359 | |
| 827 | 846 | MCFG_MC6845_CHAR_WIDTH(8) |
| 828 | 847 | MCFG_MC6845_UPDATE_ROW_CB(mbee_state, mbeeppc_update_row) |
| 829 | 848 | MCFG_MC6845_ADDR_CHANGED_CB(mbee_state, mbee256_update_addr) |
| 830 | | MCFG_DEVICE_REMOVE("fdc:0") |
| 831 | | MCFG_DEVICE_REMOVE("fdc:1") |
| 832 | | MCFG_FLOPPY_DRIVE_ADD("fdc:0", mbee_floppies, "drive3a", floppy_image_device::default_floppy_formats) |
| 833 | | MCFG_FLOPPY_DRIVE_ADD("fdc:1", mbee_floppies, "drive3b", floppy_image_device::default_floppy_formats) |
| 834 | 849 | MACHINE_CONFIG_END |
| 835 | 850 | |
| 836 | 851 | static MACHINE_CONFIG_DERIVED( mbeett, mbeeppc ) |
| r243358 | r243359 | |
| 1145 | 1160 | ROM_END |
| 1146 | 1161 | |
| 1147 | 1162 | ROM_START( mbee256 ) // 256tc |
| 1148 | | ROM_REGION(0x40000, "rams", ROMREGION_ERASEFF) |
| 1163 | ROM_REGION(0x40000,"maincpu", ROMREGION_ERASEFF) |
| 1149 | 1164 | |
| 1150 | | ROM_REGION(0x5000, "roms", 0) // rom plus dummy area |
| 1165 | ROM_REGION(0x7000,"bootrom", ROMREGION_ERASEFF) |
| 1151 | 1166 | ROM_SYSTEM_BIOS( 0, "1.20", "Version 1.20" ) |
| 1152 | | ROMX_LOAD("256tc_boot_1.20.u38", 0x0000, 0x4000, CRC(fe8d6a84) SHA1(a037a1b90b18a2180e9f5f216b829fcd480449a4), ROM_BIOS(1) ) |
| 1167 | ROMX_LOAD("256tc_boot_1.20.rom", 0x0000, 0x4000, CRC(fe8d6a84) SHA1(a037a1b90b18a2180e9f5f216b829fcd480449a4), ROM_BIOS(1) ) |
| 1153 | 1168 | ROM_SYSTEM_BIOS( 1, "1.15", "Version 1.15" ) |
| 1154 | | ROMX_LOAD("256tc_boot_1.15.u38", 0x0000, 0x4000, CRC(1902062d) SHA1(e4a1c0b3f4996e313da0bac0edb6d34e3270723e), ROM_BIOS(2) ) |
| 1169 | ROMX_LOAD("256tc_boot_1.15.rom", 0x0000, 0x4000, CRC(1902062d) SHA1(e4a1c0b3f4996e313da0bac0edb6d34e3270723e), ROM_BIOS(2) ) |
| 1155 | 1170 | |
| 1156 | | ROM_REGION(0x4000, "proms", 0) |
| 1157 | | ROM_LOAD( "silver.u39", 0x0000, 0x4000, CRC(c34aab64) SHA1(781fe648488dec90185760f8e081e488b73b68bf) ) |
| 1158 | | |
| 1159 | 1171 | ROM_REGION(0x9800, "gfx", 0) |
| 1160 | | ROM_LOAD("char256.u53", 0x1000, 0x1000, CRC(9372af3c) SHA1(a63591822c0504de2fed52e88d64e1dbd6124b74) ) |
| 1172 | ROM_LOAD("char256.bin", 0x1000, 0x1000, CRC(9372af3c) SHA1(a63591822c0504de2fed52e88d64e1dbd6124b74) ) |
| 1161 | 1173 | ROM_IGNORE( 0x1000 ) // throw away swedish characters for now |
| 1162 | 1174 | ROM_COPY( "gfx", 0x1000, 0x0000, 0x1000 ) |
| 1163 | 1175 | |
| r243358 | r243359 | |
| 1172 | 1184 | |
| 1173 | 1185 | ***************************************************************************/ |
| 1174 | 1186 | |
| 1175 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME */ |
| 1176 | | COMP( 1982, mbee, 0, 0, mbee, mbee, mbee_state, mbee, "Applied Technology", "Microbee 16 Standard" , 0 ) |
| 1177 | | COMP( 1982, mbeeic, mbee, 0, mbeeic, mbee, mbee_state, mbeeic, "Applied Technology", "Microbee 32 IC" , 0 ) |
| 1178 | | COMP( 1982, mbeepc, mbee, 0, mbeepc, mbee, mbee_state, mbeepc, "Applied Technology", "Microbee Personal Communicator" , 0 ) |
| 1179 | | COMP( 1985, mbeepc85, mbee, 0, mbeepc85, mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85" , 0 ) |
| 1180 | | COMP( 1985, mbeepc85b,mbee, 0, mbeepc85b,mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85 (New version)" , 0 ) |
| 1181 | | COMP( 1985, mbeepc85s,mbee, 0, mbeepc85, mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85 (Swedish)" , 0 ) |
| 1182 | | COMP( 1986, mbeeppc, mbee, 0, mbeeppc, mbee, mbee_state, mbeeppc, "Applied Technology", "Microbee Premium PC85" , 0 ) |
| 1183 | | COMP( 1986, mbeett, mbee, 0, mbeett, mbee256, mbee_state, mbeett, "Applied Technology", "Microbee Teleterm" , GAME_NOT_WORKING ) |
| 1184 | | COMP( 1986, mbee56, mbee, 0, mbee56, mbee, mbee_state, mbee56, "Applied Technology", "Microbee 56k" , GAME_NOT_WORKING ) |
| 1185 | | COMP( 1986, mbee64, mbee, 0, mbee64, mbee, mbee_state, mbee64, "Applied Technology", "Microbee 64k" , GAME_NOT_WORKING ) |
| 1186 | | COMP( 1986, mbee128, mbee, 0, mbee128, mbee, mbee_state, mbee128, "Applied Technology", "Microbee 128k" , GAME_NOT_WORKING ) |
| 1187 | | COMP( 1987, mbee256, mbee, 0, mbee256, mbee256, mbee_state, mbee256, "Applied Technology", "Microbee 256TC" , GAME_NOT_WORKING ) |
| 1187 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 1188 | COMP( 1982, mbee, 0, 0, mbee, mbee, mbee_state, mbee, "Applied Technology", "Microbee 16 Standard" , 0 ) |
| 1189 | COMP( 1982, mbeeic, mbee, 0, mbeeic, mbee, mbee_state, mbeeic, "Applied Technology", "Microbee 32 IC" , 0 ) |
| 1190 | COMP( 1982, mbeepc, mbee, 0, mbeepc, mbee, mbee_state, mbeepc, "Applied Technology", "Microbee Personal Communicator" , 0 ) |
| 1191 | COMP( 1985, mbeepc85, mbee, 0, mbeepc85, mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85" , 0 ) |
| 1192 | COMP( 1985, mbeepc85b,mbee, 0, mbeepc85b,mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85 (New version)" , 0 ) |
| 1193 | COMP( 1985, mbeepc85s,mbee, 0, mbeepc85, mbee, mbee_state, mbeepc85, "Applied Technology", "Microbee PC85 (Swedish)" , 0 ) |
| 1194 | COMP( 1986, mbeeppc, mbee, 0, mbeeppc, mbee, mbee_state, mbeeppc, "Applied Technology", "Microbee Premium PC85" , 0 ) |
| 1195 | COMP( 1986, mbeett, mbee, 0, mbeett, mbee256, mbee_state, mbeett, "Applied Technology", "Microbee Teleterm" , GAME_NOT_WORKING ) |
| 1196 | COMP( 1986, mbee56, mbee, 0, mbee56, mbee, mbee_state, mbee56, "Applied Technology", "Microbee 56k" , GAME_NOT_WORKING ) |
| 1197 | COMP( 1986, mbee64, mbee, 0, mbee64, mbee, mbee_state, mbee64, "Applied Technology", "Microbee 64k" , GAME_NOT_WORKING ) |
| 1198 | COMP( 1986, mbee128, mbee, 0, mbee128, mbee, mbee_state, mbee128, "Applied Technology", "Microbee 128k" , GAME_NOT_WORKING ) |
| 1199 | COMP( 1987, mbee256, mbee, 0, mbee256, mbee256, mbee_state, mbee256, "Applied Technology", "Microbee 256TC" , GAME_NOT_WORKING ) |
trunk/src/mess/includes/mbee.h
| r243358 | r243359 | |
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | 36 | mbee_state(const machine_config &mconfig, device_type type, const char *tag) |
| 37 | | : driver_device(mconfig, type, tag) |
| 38 | | , m_palette(*this, "palette") |
| 39 | | , m_maincpu(*this, "maincpu") |
| 40 | | , m_pio(*this, "z80pio") |
| 41 | | , m_cassette(*this, "cassette") |
| 42 | | , m_wave(*this, WAVE_TAG) |
| 43 | | , m_speaker(*this, "speaker") |
| 44 | | , m_centronics(*this, "centronics") |
| 45 | | , m_cent_data_out(*this, "cent_data_out") |
| 46 | | , m_crtc(*this, "crtc") |
| 47 | | , m_fdc(*this, "fdc") |
| 48 | | , m_floppy0(*this, "fdc:0") |
| 49 | | , m_floppy1(*this, "fdc:1") |
| 50 | | , m_rtc(*this, "rtc") |
| 51 | | , m_boot(*this, "boot") |
| 52 | | , m_pak(*this, "pak") |
| 53 | | , m_telcom(*this, "telcom") |
| 54 | | , m_basic(*this, "basic") |
| 55 | | , m_bankl(*this, "bankl") |
| 56 | | , m_bankh(*this, "bankh") |
| 57 | | , m_bank1(*this, "bank1") |
| 58 | | , m_bank8l(*this, "bank8l") |
| 59 | | , m_bank8h(*this, "bank8h") |
| 60 | | , m_bank9(*this, "bank9") |
| 61 | | , m_bankfl(*this, "bankfl") |
| 62 | | , m_bankfh(*this, "bankfh") |
| 63 | | , m_io_x0(*this, "X0") |
| 64 | | , m_io_x1(*this, "X1") |
| 65 | | , m_io_x2(*this, "X2") |
| 66 | | , m_io_x3(*this, "X3") |
| 67 | | , m_io_x4(*this, "X4") |
| 68 | | , m_io_x5(*this, "X5") |
| 69 | | , m_io_x6(*this, "X6") |
| 70 | | , m_io_x7(*this, "X7") |
| 71 | | , m_io_extra(*this, "EXTRA") |
| 72 | | , m_io_config(*this, "CONFIG") |
| 73 | | , m_io_x8(*this, "X8") |
| 74 | | , m_io_x9(*this, "X9") |
| 75 | | , m_io_x10(*this, "X10") |
| 76 | | , m_io_x11(*this, "X11") |
| 77 | | , m_io_x12(*this, "X12") |
| 78 | | , m_io_x13(*this, "X13") |
| 79 | | , m_io_x14(*this, "X14") |
| 80 | | , m_screen(*this, "screen") |
| 81 | | { } |
| 37 | : driver_device(mconfig, type, tag), |
| 38 | m_maincpu(*this, "maincpu"), |
| 39 | m_pio(*this, "z80pio"), |
| 40 | m_cassette(*this, "cassette"), |
| 41 | m_wave(*this, WAVE_TAG), |
| 42 | m_speaker(*this, "speaker"), |
| 43 | m_centronics(*this, "centronics"), |
| 44 | m_cent_data_out(*this, "cent_data_out"), |
| 45 | m_crtc(*this, "crtc"), |
| 46 | m_fdc(*this, "fdc"), |
| 47 | m_floppy0(*this, "fdc:0"), |
| 48 | m_floppy1(*this, "fdc:1"), |
| 49 | m_rtc(*this, "rtc"), |
| 50 | m_boot(*this, "boot"), |
| 51 | m_pak(*this, "pak"), |
| 52 | m_telcom(*this, "telcom"), |
| 53 | m_basic(*this, "basic"), |
| 54 | m_bankl(*this, "bankl"), |
| 55 | m_bankh(*this, "bankh"), |
| 56 | m_bank1(*this, "bank1"), |
| 57 | m_bank8l(*this, "bank8l"), |
| 58 | m_bank8h(*this, "bank8h"), |
| 59 | m_bank9(*this, "bank9"), |
| 60 | m_bankfl(*this, "bankfl"), |
| 61 | m_bankfh(*this, "bankfh"), |
| 62 | m_io_x0(*this, "X0"), |
| 63 | m_io_x1(*this, "X1"), |
| 64 | m_io_x2(*this, "X2"), |
| 65 | m_io_x3(*this, "X3"), |
| 66 | m_io_x4(*this, "X4"), |
| 67 | m_io_x5(*this, "X5"), |
| 68 | m_io_x6(*this, "X6"), |
| 69 | m_io_x7(*this, "X7"), |
| 70 | m_io_extra(*this, "EXTRA"), |
| 71 | m_io_config(*this, "CONFIG"), |
| 72 | m_io_x8(*this, "X8"), |
| 73 | m_io_x9(*this, "X9"), |
| 74 | m_io_x10(*this, "X10"), |
| 75 | m_io_x11(*this, "X11"), |
| 76 | m_io_x12(*this, "X12"), |
| 77 | m_io_x13(*this, "X13"), |
| 78 | m_io_x14(*this, "X14"), |
| 79 | m_screen(*this, "screen"), |
| 80 | m_palette(*this, "palette") { } |
| 82 | 81 | |
| 83 | 82 | DECLARE_WRITE8_MEMBER( mbee_04_w ); |
| 84 | 83 | DECLARE_WRITE8_MEMBER( mbee_06_w ); |
| r243358 | r243359 | |
| 149 | 148 | TIMER_CALLBACK_MEMBER(mbee_reset); |
| 150 | 149 | DECLARE_QUICKLOAD_LOAD_MEMBER( mbee ); |
| 151 | 150 | DECLARE_QUICKLOAD_LOAD_MEMBER( mbee_z80bin ); |
| 152 | | WRITE_LINE_MEMBER(fdc_intrq_w); |
| 153 | | WRITE_LINE_MEMBER(fdc_drq_w); |
| 154 | 151 | DECLARE_FLOPPY_FORMATS(floppy_formats); |
| 155 | 152 | UINT8 *m_p_videoram; |
| 156 | 153 | UINT8 *m_p_gfxram; |
| r243358 | r243359 | |
| 168 | 165 | MC6845_ON_UPDATE_ADDR_CHANGED(mbee_update_addr); |
| 169 | 166 | MC6845_ON_UPDATE_ADDR_CHANGED(mbee256_update_addr); |
| 170 | 167 | |
| 171 | | required_device<palette_device> m_palette; |
| 172 | 168 | private: |
| 173 | 169 | size_t m_size; |
| 174 | 170 | UINT8 m_clock_pulse; |
| r243358 | r243359 | |
| 182 | 178 | UINT8 m_sy6545_status; |
| 183 | 179 | UINT8 m_sy6545_reg[32]; |
| 184 | 180 | UINT8 m_sy6545_ind; |
| 185 | | UINT8 m_fdc_rq; |
| 186 | | void mbee256_setup_banks(UINT8 data); |
| 187 | 181 | void sy6545_cursor_configure(); |
| 188 | 182 | void keyboard_matrix_r(int offs); |
| 189 | | void machine_reset_common_disk(); |
| 190 | | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 191 | 183 | required_device<cpu_device> m_maincpu; |
| 192 | 184 | required_device<z80pio_device> m_pio; |
| 193 | 185 | required_device<cassette_image_device> m_cassette; |
| r243358 | r243359 | |
| 200 | 192 | optional_device<floppy_connector> m_floppy0; |
| 201 | 193 | optional_device<floppy_connector> m_floppy1; |
| 202 | 194 | optional_device<mc146818_device> m_rtc; |
| 203 | | optional_memory_bank m_boot; |
| 195 | required_memory_bank m_boot; |
| 204 | 196 | optional_memory_bank m_pak; |
| 205 | 197 | optional_memory_bank m_telcom; |
| 206 | 198 | optional_memory_bank m_basic; |
| r243358 | r243359 | |
| 230 | 222 | optional_ioport m_io_x13; |
| 231 | 223 | optional_ioport m_io_x14; |
| 232 | 224 | required_device<screen_device> m_screen; |
| 225 | public: |
| 226 | required_device<palette_device> m_palette; |
| 227 | |
| 228 | void machine_reset_common_disk(); |
| 229 | virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); |
| 233 | 230 | }; |
| 234 | 231 | |
| 235 | 232 | #endif /* MBEE_H_ */ |
trunk/src/mess/machine/mbee.c
| r243358 | r243359 | |
| 89 | 89 | |
| 90 | 90 | *************************************************************************************/ |
| 91 | 91 | |
| 92 | | WRITE_LINE_MEMBER( mbee_state::fdc_intrq_w ) |
| 93 | | { |
| 94 | | m_fdc_rq = (m_fdc_rq & 2) | state; |
| 95 | | } |
| 96 | | |
| 97 | | WRITE_LINE_MEMBER( mbee_state::fdc_drq_w ) |
| 98 | | { |
| 99 | | m_fdc_rq = (m_fdc_rq & 1) | (state << 1); |
| 100 | | } |
| 101 | | |
| 102 | 92 | READ8_MEMBER( mbee_state::mbee_fdc_status_r ) |
| 103 | 93 | { |
| 104 | 94 | /* d7 indicate if IRQ or DRQ is occuring (1=happening) |
| 105 | 95 | d6..d0 not used */ |
| 106 | 96 | |
| 107 | | return m_fdc_rq ? 0xff : 0x7f; |
| 97 | return 0x7f | ((m_fdc->intrq_r() || m_fdc->drq_r()) ? 0x80 : 0); |
| 108 | 98 | } |
| 109 | 99 | |
| 110 | 100 | WRITE8_MEMBER( mbee_state::mbee_fdc_motor_w ) |
| r243358 | r243359 | |
| 141 | 131 | TIMER_CALLBACK_MEMBER(mbee_state::mbee256_kbd) |
| 142 | 132 | { |
| 143 | 133 | /* Keyboard scanner is a Mostek M3870 chip. Its speed of operation is determined by a 15k resistor on |
| 144 | | pin 2 (XTL2) and is therefore 2MHz. If a key change is detected (up or down), the /strobe |
| 134 | pin 2 (XTL2) and is therefore unknown. If a key change is detected (up or down), the /strobe |
| 145 | 135 | line activates, sending a high to bit 1 of port 2 (one of the pio input lines). The next read of |
| 146 | 136 | port 18 will clear this line, and read the key scancode. It will also signal the 3870 that the key |
| 147 | 137 | data has been read, on pin 38 (/extint). The 3870 can cache up to 9 keys. With no rom dump |
| r243358 | r243359 | |
| 266 | 256 | |
| 267 | 257 | 256TC Memory Banking |
| 268 | 258 | |
| 269 | | Selection of ROM, RAM, and video access by the CPU is controlled by U39, |
| 270 | | a PAL14L8. When read as an ordinary rom it is 16k in size. The dumper has |
| 271 | | arranged the pins as (bit0,1,..) (input = 1,23,2,3,4,5,6,7,8,9,10,11,14,13) |
| 272 | | and (output = 22,21,20,19,18,17,16,15). The prom is also used to control |
| 273 | | the refresh required by the dynamic rams, however we ignore this function. |
| 259 | Bits 0, 1 and 5 select which bank goes into 0000-7FFF. |
| 260 | Bit 2 disables ROM, replacing it with RAM. |
| 261 | Bit 3 disables Video, replacing it with RAM. |
| 262 | Bit 4 switches the video circuits between F000-FFFF and |
| 263 | 8000-8FFF. |
| 274 | 264 | |
| 265 | In case of a clash, video overrides ROM which overrides RAM. |
| 266 | |
| 275 | 267 | ************************************************************/ |
| 276 | 268 | |
| 277 | | void mbee_state::mbee256_setup_banks(UINT8 data) |
| 269 | WRITE8_MEMBER( mbee_state::mbee256_50_w ) |
| 278 | 270 | { |
| 279 | | data &= 0x3f; // U28 (bits 0-5 are referred to as S0-S5) |
| 280 | 271 | address_space &mem = m_maincpu->space(AS_PROGRAM); |
| 281 | | UINT8 *prom = memregion("proms")->base(); |
| 282 | | UINT8 b_data = BITSWAP8(data, 7,5,3,2,4,6,1,0) & 0x3b; // arrange data bits to S0,S1,-,S4,S2,S3 |
| 283 | | UINT8 b_bank, b_byte, b_byte_t, b_addr; |
| 284 | | UINT16 b_vid; |
| 285 | | char banktag[10]; |
| 286 | 272 | |
| 287 | | for (b_bank = 0; b_bank < 16; b_bank++) |
| 288 | | { |
| 289 | | b_vid = b_bank << 12; |
| 290 | | mem.unmap_readwrite (b_vid, b_vid + 0xfff); |
| 291 | | b_addr = BITSWAP8(b_bank, 7,4,5,3,1,2,6,0) & 0x1f; // arrange address bits to A12,-,A14,A13,A15 |
| 273 | // primary low banks |
| 274 | m_boot->set_entry((data & 3) | ((data & 0x20) >> 3)); |
| 275 | m_bank1->set_entry((data & 3) | ((data & 0x20) >> 3)); |
| 292 | 276 | |
| 293 | | // Calculate read-bank |
| 294 | | b_byte_t = prom[b_addr | (b_data << 8) | 0x82]; // read-bank (RDS and MREQ are low, RFSH is high) |
| 295 | | b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used |
| 296 | | if (!BIT(data, 5)) |
| 297 | | b_byte &= 0xfb; // U42/1 - S17 only valid if S5 is on |
| 298 | | if (!BIT(b_byte, 4)) |
| 299 | | { |
| 300 | | // select video |
| 301 | | mem.install_read_handler (b_vid, b_vid + 0x7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this)); |
| 302 | | mem.install_read_handler (b_vid + 0x800, b_vid + 0xfff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this)); |
| 303 | | } |
| 304 | | else |
| 305 | | { |
| 306 | | sprintf(banktag, "bankr%d", b_bank); |
| 307 | | mem.install_read_bank( b_vid, b_vid+0xfff, banktag ); |
| 277 | // 9000-EFFF |
| 278 | m_bank9->set_entry((data & 4) ? 1 : 0); |
| 308 | 279 | |
| 309 | | if (!BIT(b_byte, 3)) |
| 310 | | membank(banktag)->set_entry(64 + (b_bank & 3)); // read from rom |
| 311 | | else |
| 312 | | membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram |
| 313 | | } |
| 280 | // 8000-8FFF, F000-FFFF |
| 281 | mem.unmap_readwrite (0x8000, 0x87ff); |
| 282 | mem.unmap_readwrite (0x8800, 0x8fff); |
| 283 | mem.unmap_readwrite (0xf000, 0xf7ff); |
| 284 | mem.unmap_readwrite (0xf800, 0xffff); |
| 314 | 285 | |
| 315 | | // Calculate write-bank |
| 316 | | b_byte_t = prom[b_addr | (b_data << 8) | 0xc0]; // write-bank (XWR and MREQ are low, RFSH is high) |
| 317 | | b_byte = BITSWAP8(b_byte_t, 7,5,0,3,6,2,1,4); // rearrange so that bits 0-2 are rambank, bit 3 = rom select, bit 4 = video select, others not used |
| 318 | | if (!BIT(data, 5)) |
| 319 | | b_byte &= 0xfb; // U42/1 - S17 only valid if S5 is on |
| 320 | | if (!BIT(b_byte, 4)) |
| 321 | | { |
| 322 | | // select video |
| 323 | | mem.install_write_handler (b_vid, b_vid + 0x7ff, write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); |
| 324 | | mem.install_write_handler (b_vid + 0x800, b_vid + 0xfff, write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); |
| 325 | | } |
| 326 | | else |
| 327 | | { |
| 328 | | sprintf(banktag, "bankw%d", b_bank); |
| 329 | | mem.install_write_bank( b_vid, b_vid+0xfff, banktag ); |
| 330 | | |
| 331 | | if (!BIT(b_byte, 3)) |
| 332 | | membank(banktag)->set_entry(64); // write to rom dummy area |
| 333 | | else |
| 334 | | membank(banktag)->set_entry((b_bank & 7) | ((b_byte & 7) << 3)); // ram |
| 335 | | } |
| 286 | switch (data & 0x1c) |
| 287 | { |
| 288 | case 0x00: |
| 289 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); |
| 290 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); |
| 291 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); |
| 292 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); |
| 293 | m_bank8l->set_entry(0); // rom |
| 294 | m_bank8h->set_entry(0); // rom |
| 295 | break; |
| 296 | case 0x04: |
| 297 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); |
| 298 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); |
| 299 | mem.install_readwrite_handler (0xf000, 0xf7ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); |
| 300 | mem.install_readwrite_handler (0xf800, 0xffff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); |
| 301 | m_bank8l->set_entry(1); // ram |
| 302 | m_bank8h->set_entry(1); // ram |
| 303 | break; |
| 304 | case 0x08: |
| 305 | case 0x18: |
| 306 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); |
| 307 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); |
| 308 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); |
| 309 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); |
| 310 | m_bank8l->set_entry(0); // rom |
| 311 | m_bank8h->set_entry(0); // rom |
| 312 | m_bankfl->set_entry(0); // ram |
| 313 | m_bankfh->set_entry(0); // ram |
| 314 | break; |
| 315 | case 0x0c: |
| 316 | case 0x1c: |
| 317 | mem.install_read_bank (0x8000, 0x87ff, "bank8l"); |
| 318 | mem.install_read_bank (0x8800, 0x8fff, "bank8h"); |
| 319 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); |
| 320 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); |
| 321 | m_bank8l->set_entry(1); // ram |
| 322 | m_bank8h->set_entry(1); // ram |
| 323 | m_bankfl->set_entry(0); // ram |
| 324 | m_bankfh->set_entry(0); // ram |
| 325 | break; |
| 326 | case 0x10: |
| 327 | case 0x14: |
| 328 | mem.install_readwrite_handler (0x8000, 0x87ff, read8_delegate(FUNC(mbee_state::mbeeppc_low_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_low_w), this)); |
| 329 | mem.install_readwrite_handler (0x8800, 0x8fff, read8_delegate(FUNC(mbee_state::mbeeppc_high_r), this), write8_delegate(FUNC(mbee_state::mbeeppc_high_w), this)); |
| 330 | mem.install_read_bank (0xf000, 0xf7ff, "bankfl"); |
| 331 | mem.install_read_bank (0xf800, 0xffff, "bankfh"); |
| 332 | m_bankfl->set_entry(0); // ram |
| 333 | m_bankfh->set_entry(0); // ram |
| 334 | break; |
| 336 | 335 | } |
| 337 | 336 | } |
| 338 | 337 | |
| 339 | | WRITE8_MEMBER( mbee_state::mbee256_50_w ) |
| 340 | | { |
| 341 | | mbee256_setup_banks(data); |
| 342 | | } |
| 343 | | |
| 344 | 338 | /*********************************************************** |
| 345 | 339 | |
| 346 | 340 | 128k Memory Banking |
| r243358 | r243359 | |
| 514 | 508 | |
| 515 | 509 | void mbee_state::machine_reset_common_disk() |
| 516 | 510 | { |
| 517 | | m_fdc_rq = 0; |
| 518 | 511 | } |
| 519 | 512 | |
| 520 | 513 | MACHINE_RESET_MEMBER(mbee_state,mbee) |
| r243358 | r243359 | |
| 540 | 533 | |
| 541 | 534 | MACHINE_RESET_MEMBER(mbee_state,mbee128) |
| 542 | 535 | { |
| 543 | | address_space &mem = m_maincpu->space(AS_IO); |
| 536 | address_space &mem = m_maincpu->space(AS_PROGRAM); |
| 544 | 537 | machine_reset_common_disk(); |
| 545 | 538 | mbee128_50_w(mem,0,0); // set banks to default |
| 546 | | m_boot->set_entry(8); // boot time |
| 539 | m_boot->set_entry(4); // boot time |
| 547 | 540 | } |
| 548 | 541 | |
| 549 | 542 | MACHINE_RESET_MEMBER(mbee_state,mbee256) |
| 550 | 543 | { |
| 551 | 544 | UINT8 i; |
| 545 | address_space &mem = m_maincpu->space(AS_PROGRAM); |
| 552 | 546 | machine_reset_common_disk(); |
| 553 | 547 | for (i = 0; i < 15; i++) m_mbee256_was_pressed[i] = 0; |
| 554 | 548 | m_mbee256_q_pos = 0; |
| 555 | | mbee256_setup_banks(0); // set banks to default |
| 556 | | m_maincpu->set_pc(0x8000); |
| 549 | mbee256_50_w(mem,0,0); // set banks to default |
| 550 | m_boot->set_entry(8); // boot time |
| 551 | timer_set(attotime::from_usec(4), TIMER_MBEE_RESET); |
| 557 | 552 | } |
| 558 | 553 | |
| 559 | 554 | MACHINE_RESET_MEMBER(mbee_state,mbeett) |
| r243358 | r243359 | |
| 695 | 690 | |
| 696 | 691 | RAM = memregion("bootrom")->base(); |
| 697 | 692 | m_bank9->configure_entry(0, &RAM[0x1000]); // rom |
| 698 | | m_boot->configure_entry(8, &RAM[0x0000]); // rom at boot for 4usec |
| 693 | m_boot->configure_entry(4, &RAM[0x0000]); // rom at boot for 4usec |
| 699 | 694 | m_bank8l->configure_entry(0, &RAM[0x0000]); // rom |
| 700 | 695 | m_bank8h->configure_entry(0, &RAM[0x0800]); // rom |
| 701 | 696 | |
| r243358 | r243359 | |
| 704 | 699 | |
| 705 | 700 | DRIVER_INIT_MEMBER(mbee_state,mbee256) |
| 706 | 701 | { |
| 707 | | UINT8 *RAM = memregion("rams")->base(); |
| 708 | | UINT8 *ROM = memregion("roms")->base(); |
| 709 | | char banktag[10]; |
| 702 | UINT8 *RAM = memregion("maincpu")->base(); |
| 703 | m_boot->configure_entries(0, 8, &RAM[0x0000], 0x8000); // standard banks 0000 |
| 704 | m_bank1->configure_entries(0, 8, &RAM[0x1000], 0x8000); // standard banks 1000 |
| 705 | m_bank8l->configure_entry(1, &RAM[0x0000]); // shadow ram |
| 706 | m_bank8h->configure_entry(1, &RAM[0x0800]); // shadow ram |
| 707 | m_bank9->configure_entry(1, &RAM[0x1000]); // shadow ram |
| 708 | m_bankfl->configure_entry(0, &RAM[0xf000]); // shadow ram |
| 709 | m_bankfh->configure_entry(0, &RAM[0xf800]); // shadow ram |
| 710 | 710 | |
| 711 | | for (UINT8 b_bank = 0; b_bank < 16; b_bank++) |
| 712 | | { |
| 713 | | sprintf(banktag, "bankr%d", b_bank); |
| 714 | | membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks |
| 715 | | membank(banktag)->configure_entries(64, 4, &ROM[0x0000], 0x1000); // rom |
| 711 | RAM = memregion("bootrom")->base(); |
| 712 | m_bank9->configure_entry(0, &RAM[0x1000]); // rom |
| 713 | m_boot->configure_entry(8, &RAM[0x0000]); // rom at boot for 4usec |
| 714 | m_bank8l->configure_entry(0, &RAM[0x0000]); // rom |
| 715 | m_bank8h->configure_entry(0, &RAM[0x0800]); // rom |
| 716 | 716 | |
| 717 | | sprintf(banktag, "bankw%d", b_bank); |
| 718 | | membank(banktag)->configure_entries(0, 64, &RAM[0x0000], 0x1000); // RAM banks |
| 719 | | membank(banktag)->configure_entries(64, 1, &ROM[0x4000], 0x1000); // dummy rom |
| 720 | | } |
| 721 | | |
| 722 | 717 | timer_set(attotime::from_hz(1), TIMER_MBEE_RTC_IRQ); /* timer for rtc */ |
| 723 | | timer_set(attotime::from_hz(50), TIMER_MBEE256_KBD); /* timer for kbd */ |
| 718 | timer_set(attotime::from_hz(25), TIMER_MBEE256_KBD); /* timer for kbd */ |
| 724 | 719 | |
| 725 | 720 | m_size = 0x8000; |
| 726 | 721 | } |
trunk/src/osd/sdl/draw13.c
| r243358 | r243359 | |
| 143 | 143 | { |
| 144 | 144 | public: |
| 145 | 145 | sdl_info13(sdl_window_info *w) |
| 146 | | : osd_renderer(w), m_blittimer(0), m_renderer(NULL), |
| 146 | : osd_renderer(w, FLAG_NONE), m_blittimer(0), m_renderer(NULL), |
| 147 | 147 | m_last_hofs(0), m_last_vofs(0), |
| 148 | 148 | m_resize_pending(0), m_resize_width(0), m_resize_height(0), |
| 149 | 149 | m_last_blit_time(0), m_last_blit_pixels(0) |
| 150 | 150 | {} |
| 151 | 151 | |
| 152 | | /* virtual */ int create(int width, int height); |
| 153 | | /* virtual */ void resize(int width, int height); |
| 154 | | /* virtual */ int draw(UINT32 dc, int update); |
| 155 | | /* virtual */ void set_target_bounds(); |
| 156 | | /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt); |
| 152 | /* virtual */ int create(const int width, const int height); |
| 153 | /* virtual */ void resize(const int width, const int height); |
| 154 | /* virtual */ int draw(const UINT32 dc, const int update); |
| 155 | /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt); |
| 157 | 156 | /* virtual */ void destroy_all_textures(); |
| 158 | 157 | /* virtual */ void destroy(); |
| 159 | 158 | /* virtual */ void clear(); |
| r243358 | r243359 | |
| 594 | 593 | * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0 |
| 595 | 594 | * |
| 596 | 595 | */ |
| 596 | osd_printf_verbose("Enter sdl_info::create\n"); |
| 597 | 597 | |
| 598 | | osd_printf_verbose("Enter sdl_info13::create\n"); |
| 598 | #if (SDLMAME_SDL2) |
| 599 | 599 | |
| 600 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 601 | { |
| 602 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 603 | |
| 604 | /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to |
| 605 | * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. |
| 606 | * |
| 607 | * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); |
| 608 | * |
| 609 | */ |
| 610 | m_extra_flags = SDL_WINDOW_OPENGL; |
| 611 | } |
| 612 | else |
| 613 | m_extra_flags = 0; |
| 614 | |
| 600 | 615 | // create the SDL window |
| 601 | | m_extra_flags = (window().fullscreen() ? |
| 616 | // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS |
| 617 | m_extra_flags |= (window().fullscreen() ? |
| 602 | 618 | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE); |
| 603 | 619 | |
| 604 | 620 | #if defined(SDLMAME_WIN32) |
| r243358 | r243359 | |
| 608 | 624 | window().m_sdl_window = SDL_CreateWindow(window().m_title, |
| 609 | 625 | window().monitor()->position_size().x, window().monitor()->position_size().y, |
| 610 | 626 | width, height, m_extra_flags); |
| 627 | //window().m_sdl_window = SDL_CreateWindow(window().m_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, |
| 628 | // width, height, m_extra_flags); |
| 611 | 629 | |
| 612 | 630 | if (!window().m_sdl_window ) |
| 613 | 631 | { |
| 632 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 633 | osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError()); |
| 634 | else |
| 614 | 635 | osd_printf_error("Window creation failed: %s\n", SDL_GetError()); |
| 615 | 636 | return 1; |
| 616 | 637 | } |
| r243358 | r243359 | |
| 639 | 660 | { |
| 640 | 661 | //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop |
| 641 | 662 | } |
| 663 | |
| 664 | // show window |
| 665 | |
| 666 | SDL_ShowWindow(window().m_sdl_window); |
| 667 | //SDL_SetWindowFullscreen(window().m_sdl_window, window().fullscreen); |
| 668 | SDL_RaiseWindow(window().m_sdl_window); |
| 669 | |
| 670 | SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height); |
| 671 | |
| 642 | 672 | // create renderer |
| 643 | 673 | |
| 644 | 674 | if (video_config.waitvsync) |
| r243358 | r243359 | |
| 653 | 683 | |
| 654 | 684 | //SDL_SelectRenderer(window().sdl_window); |
| 655 | 685 | |
| 656 | | // show window |
| 686 | m_blittimer = 3; |
| 657 | 687 | |
| 658 | | SDL_ShowWindow(window().m_sdl_window); |
| 659 | | //SDL_SetWindowFullscreen(window().sdl_window, window().fullscreen); |
| 660 | | SDL_RaiseWindow(window().m_sdl_window); |
| 688 | SDL_RenderPresent(m_renderer); |
| 689 | osd_printf_verbose("Leave sdl_info13::create\n"); |
| 661 | 690 | |
| 662 | | SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height); |
| 691 | #else |
| 692 | m_extra_flags = (window().fullscreen() ? SDL_FULLSCREEN : SDL_RESIZABLE); |
| 693 | m_extra_flags |= SDL_DOUBLEBUF; |
| 663 | 694 | |
| 664 | | m_blittimer = 3; |
| 695 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 696 | { |
| 697 | m_extra_flags |= SDL_OPENGL; |
| 698 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 699 | #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 700 | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); |
| 701 | #endif |
| 702 | //load_gl_lib(window().machine()); |
| 703 | } |
| 665 | 704 | |
| 666 | | SDL_RenderPresent(m_renderer); |
| 667 | | osd_printf_verbose("Leave sdl_info13::create\n"); |
| 705 | // create the SDL surface (which creates the window in windowed mode) |
| 706 | m_sdlsurf = SDL_SetVideoMode(width, height, |
| 707 | 0, SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags); |
| 708 | |
| 709 | if (!m_sdlsurf) |
| 710 | return 1; |
| 711 | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) ) |
| 712 | { |
| 713 | osd_printf_error("OpenGL not supported on this driver!\n"); |
| 714 | return 1; |
| 715 | } |
| 716 | |
| 717 | window().m_width = m_sdlsurf->w; |
| 718 | window().m_height = m_sdlsurf->h; |
| 719 | |
| 720 | window().m_screen_width = 0; |
| 721 | window().m_screen_height = 0; |
| 722 | |
| 723 | |
| 724 | // set the window title |
| 725 | SDL_WM_SetCaption(window().m_title, "SDLMAME"); |
| 726 | |
| 727 | #endif |
| 668 | 728 | return 0; |
| 669 | 729 | } |
| 670 | 730 | |
| r243358 | r243359 | |
| 685 | 745 | |
| 686 | 746 | } |
| 687 | 747 | |
| 748 | |
| 688 | 749 | //============================================================ |
| 750 | // sdl_info::destroy |
| 751 | //============================================================ |
| 752 | |
| 753 | void sdl_info13::destroy() |
| 754 | { |
| 755 | // free the memory in the window |
| 756 | |
| 757 | destroy_all_textures(); |
| 758 | |
| 759 | if (window().fullscreen() && video_config.switchres) |
| 760 | { |
| 761 | SDL_SetWindowFullscreen(window().m_sdl_window, 0); // Try to set mode |
| 762 | SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode); // Try to set mode |
| 763 | SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode |
| 764 | } |
| 765 | |
| 766 | SDL_DestroyWindow(window().m_sdl_window); |
| 767 | |
| 768 | } |
| 769 | |
| 770 | //============================================================ |
| 771 | // sdl_info::clear |
| 772 | //============================================================ |
| 773 | |
| 774 | void sdl_info13::clear() |
| 775 | { |
| 776 | m_blittimer = 2; |
| 777 | } |
| 778 | |
| 779 | |
| 780 | //============================================================ |
| 689 | 781 | // drawsdl_xy_to_render_target |
| 690 | 782 | //============================================================ |
| 691 | 783 | |
| r243358 | r243359 | |
| 702 | 794 | } |
| 703 | 795 | |
| 704 | 796 | //============================================================ |
| 705 | | // sdl_info::get_primitives |
| 706 | | //============================================================ |
| 707 | | |
| 708 | | void sdl_info13::set_target_bounds() |
| 709 | | { |
| 710 | | window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); |
| 711 | | } |
| 712 | | |
| 713 | | //============================================================ |
| 714 | 797 | // sdl_info::draw |
| 715 | 798 | //============================================================ |
| 716 | 799 | |
| r243358 | r243359 | |
| 824 | 907 | |
| 825 | 908 | |
| 826 | 909 | //============================================================ |
| 827 | | // sdl_info13::clear |
| 828 | | //============================================================ |
| 829 | | |
| 830 | | void sdl_info13::clear() |
| 831 | | { |
| 832 | | m_blittimer = 2; |
| 833 | | } |
| 834 | | |
| 835 | | |
| 836 | | //============================================================ |
| 837 | | // sdl_info13::destroy |
| 838 | | //============================================================ |
| 839 | | |
| 840 | | void sdl_info13::destroy() |
| 841 | | { |
| 842 | | // free the memory in the window |
| 843 | | |
| 844 | | destroy_all_textures(); |
| 845 | | |
| 846 | | if (window().fullscreen() && video_config.switchres) |
| 847 | | { |
| 848 | | SDL_SetWindowFullscreen(window().m_sdl_window, 0); // Try to set mode |
| 849 | | SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode); // Try to set mode |
| 850 | | SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode |
| 851 | | } |
| 852 | | |
| 853 | | SDL_DestroyWindow(window().m_sdl_window); |
| 854 | | |
| 855 | | } |
| 856 | | |
| 857 | | //============================================================ |
| 858 | 910 | // texture handling |
| 859 | 911 | //============================================================ |
| 860 | 912 | |
trunk/src/osd/sdl/drawogl.c
| r243358 | r243359 | |
| 156 | 156 | // TYPES |
| 157 | 157 | //============================================================ |
| 158 | 158 | |
| 159 | | struct texture_info; |
| 159 | //============================================================ |
| 160 | // Textures |
| 161 | //============================================================ |
| 160 | 162 | |
| 161 | 163 | /* texture_info holds information about a texture */ |
| 162 | | struct texture_info |
| 164 | class texture_info |
| 163 | 165 | { |
| 166 | public: |
| 164 | 167 | texture_info() |
| 165 | 168 | : hash(0), flags(0), rawwidth(0), rawheight(0), |
| 166 | 169 | rawwidth_create(0), rawheight_create(0), |
| r243358 | r243359 | |
| 219 | 222 | { |
| 220 | 223 | public: |
| 221 | 224 | sdl_info_ogl(sdl_window_info *window) |
| 222 | | : osd_renderer(window), m_blittimer(0), m_extra_flags(0), |
| 225 | : osd_renderer(window, FLAG_NEEDS_OPENGL), m_blittimer(0), m_extra_flags(0), |
| 223 | 226 | #if (SDLMAME_SDL2) |
| 224 | 227 | m_gl_context_id(0), |
| 225 | 228 | #else |
| r243358 | r243359 | |
| 248 | 251 | m_texVerticex[i] = 0.0f; |
| 249 | 252 | } |
| 250 | 253 | |
| 251 | | /* virtual */ int create(int width, int height); |
| 252 | | /* virtual */ void resize(int width, int height); |
| 253 | | /* virtual */ int draw(UINT32 dc, int update); |
| 254 | | /* virtual */ void set_target_bounds(); |
| 255 | | /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt); |
| 254 | /* virtual */ int create(const int width, const int height); |
| 255 | /* virtual */ void resize(const int width, int const height); |
| 256 | /* virtual */ int draw(const UINT32 dc, const int update); |
| 257 | /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt); |
| 256 | 258 | /* virtual */ void destroy_all_textures(); |
| 257 | 259 | /* virtual */ void destroy(); |
| 258 | 260 | /* virtual */ void clear(); |
| r243358 | r243359 | |
| 393 | 395 | |
| 394 | 396 | // core functions |
| 395 | 397 | |
| 398 | //============================================================ |
| 399 | // STATIC VARIABLES |
| 400 | //============================================================ |
| 401 | |
| 396 | 402 | static void drawogl_exit(void); |
| 397 | 403 | static void load_gl_lib(running_machine &machine); |
| 398 | 404 | |
| r243358 | r243359 | |
| 440 | 446 | static int dll_loaded = 0; |
| 441 | 447 | |
| 442 | 448 | //============================================================ |
| 443 | | // drawogl_init |
| 449 | // drawsdl_init |
| 444 | 450 | //============================================================ |
| 445 | 451 | |
| 446 | 452 | static osd_renderer *drawogl_create(sdl_window_info *window) |
| r243358 | r243359 | |
| 456 | 462 | |
| 457 | 463 | dll_loaded = 0; |
| 458 | 464 | |
| 465 | load_gl_lib(machine); |
| 459 | 466 | if (SDLMAME_SDL2) |
| 460 | 467 | { |
| 461 | 468 | osd_printf_verbose("Using SDL multi-window OpenGL driver (SDL 2.0+)\n"); |
| 462 | | load_gl_lib(machine); |
| 463 | 469 | } |
| 464 | 470 | else |
| 465 | 471 | osd_printf_verbose("Using SDL single-window OpenGL driver (SDL 1.2)\n"); |
| r243358 | r243359 | |
| 710 | 716 | |
| 711 | 717 | int sdl_info_ogl::create(int width, int height) |
| 712 | 718 | { |
| 713 | | #if (SDLMAME_SDL2) |
| 714 | | |
| 715 | | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 716 | | |
| 717 | | /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to |
| 718 | | * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. |
| 719 | /* FIXME: On Ubuntu and potentially other Linux OS you should use |
| 720 | * to disable panning. This has to be done before every invocation of mame. |
| 719 | 721 | * |
| 720 | | * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); |
| 722 | * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0 |
| 721 | 723 | * |
| 722 | 724 | */ |
| 725 | osd_printf_verbose("Enter sdl_info::create\n"); |
| 723 | 726 | |
| 724 | | osd_printf_verbose("Enter sdl_info_ogl::create\n"); |
| 727 | #if (SDLMAME_SDL2) |
| 725 | 728 | |
| 729 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 730 | { |
| 731 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 732 | |
| 733 | /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to |
| 734 | * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. |
| 735 | * |
| 736 | * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); |
| 737 | * |
| 738 | */ |
| 739 | m_extra_flags = SDL_WINDOW_OPENGL; |
| 740 | } |
| 741 | else |
| 742 | m_extra_flags = 0; |
| 743 | |
| 726 | 744 | // create the SDL window |
| 727 | 745 | // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS |
| 728 | | m_extra_flags = (window().fullscreen() ? |
| 746 | m_extra_flags |= (window().fullscreen() ? |
| 729 | 747 | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE); |
| 730 | 748 | |
| 731 | | m_extra_flags |= SDL_WINDOW_OPENGL; |
| 732 | | |
| 733 | | |
| 734 | 749 | #if defined(SDLMAME_WIN32) |
| 735 | 750 | SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); |
| 736 | 751 | #endif |
| r243358 | r243359 | |
| 743 | 758 | |
| 744 | 759 | if (!window().m_sdl_window ) |
| 745 | 760 | { |
| 746 | | osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError()); |
| 761 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 762 | osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError()); |
| 763 | else |
| 764 | osd_printf_error("Window creation failed: %s\n", SDL_GetError()); |
| 747 | 765 | return 1; |
| 748 | 766 | } |
| 749 | 767 | |
| r243358 | r243359 | |
| 771 | 789 | { |
| 772 | 790 | //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop |
| 773 | 791 | } |
| 774 | | // create renderer |
| 775 | 792 | |
| 776 | | //SDL_SelectRenderer(window().sdl_window); |
| 777 | | |
| 778 | 793 | // show window |
| 779 | 794 | |
| 780 | 795 | SDL_ShowWindow(window().m_sdl_window); |
| r243358 | r243359 | |
| 783 | 798 | |
| 784 | 799 | SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height); |
| 785 | 800 | |
| 801 | // create renderer |
| 786 | 802 | |
| 787 | 803 | m_gl_context_id = SDL_GL_CreateContext(window().m_sdl_window); |
| 788 | 804 | if (!m_gl_context_id) |
| r243358 | r243359 | |
| 795 | 811 | |
| 796 | 812 | #else |
| 797 | 813 | m_extra_flags = (window().fullscreen() ? SDL_FULLSCREEN : SDL_RESIZABLE); |
| 798 | | m_extra_flags |= SDL_OPENGL | SDL_DOUBLEBUF; |
| 814 | m_extra_flags |= SDL_DOUBLEBUF; |
| 799 | 815 | |
| 800 | | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 801 | | #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 802 | | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); |
| 803 | | #endif |
| 816 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 817 | { |
| 818 | m_extra_flags |= SDL_OPENGL; |
| 819 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 820 | #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 821 | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); |
| 822 | #endif |
| 823 | //load_gl_lib(window().machine()); |
| 824 | } |
| 804 | 825 | |
| 805 | | load_gl_lib(window().machine()); |
| 806 | | |
| 807 | 826 | // create the SDL surface (which creates the window in windowed mode) |
| 808 | 827 | m_sdlsurf = SDL_SetVideoMode(width, height, |
| 809 | 828 | 0, SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags); |
| 810 | 829 | |
| 811 | 830 | if (!m_sdlsurf) |
| 812 | 831 | return 1; |
| 832 | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) ) |
| 833 | { |
| 834 | osd_printf_error("OpenGL not supported on this driver!\n"); |
| 835 | return 1; |
| 836 | } |
| 813 | 837 | |
| 814 | 838 | window().m_width = m_sdlsurf->w; |
| 815 | 839 | window().m_height = m_sdlsurf->h; |
| r243358 | r243359 | |
| 817 | 841 | window().m_screen_width = 0; |
| 818 | 842 | window().m_screen_height = 0; |
| 819 | 843 | |
| 820 | | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) ) |
| 821 | | { |
| 822 | | osd_printf_error("OpenGL not supported on this driver!\n"); |
| 823 | | return 1; |
| 824 | | } |
| 825 | 844 | |
| 826 | 845 | // set the window title |
| 827 | 846 | SDL_WM_SetCaption(window().m_title, "SDLMAME"); |
| r243358 | r243359 | |
| 876 | 895 | |
| 877 | 896 | } |
| 878 | 897 | |
| 898 | |
| 879 | 899 | //============================================================ |
| 900 | // sdl_info::destroy |
| 901 | //============================================================ |
| 902 | |
| 903 | void sdl_info_ogl::destroy() |
| 904 | { |
| 905 | |
| 906 | // free the memory in the window |
| 907 | |
| 908 | destroy_all_textures(); |
| 909 | |
| 910 | #if (SDLMAME_SDL2) |
| 911 | SDL_GL_DeleteContext(m_gl_context_id); |
| 912 | if (window().fullscreen() && video_config.switchres) |
| 913 | { |
| 914 | SDL_SetWindowFullscreen(window().m_sdl_window, 0); // Try to set mode |
| 915 | SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode); // Try to set mode |
| 916 | SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode |
| 917 | } |
| 918 | |
| 919 | SDL_DestroyWindow(window().m_sdl_window); |
| 920 | #else |
| 921 | if (m_sdlsurf) |
| 922 | { |
| 923 | SDL_FreeSurface(m_sdlsurf); |
| 924 | m_sdlsurf = NULL; |
| 925 | } |
| 926 | #endif |
| 927 | } |
| 928 | |
| 929 | //============================================================ |
| 930 | // sdl_info::clear |
| 931 | //============================================================ |
| 932 | |
| 933 | void sdl_info_ogl::clear() |
| 934 | { |
| 935 | //FIXME: Handled in sdl_info::draw as well |
| 936 | m_blittimer = 3; |
| 937 | } |
| 938 | |
| 939 | //============================================================ |
| 880 | 940 | // drawsdl_xy_to_render_target |
| 881 | 941 | //============================================================ |
| 882 | 942 | |
| r243358 | r243359 | |
| 892 | 952 | } |
| 893 | 953 | |
| 894 | 954 | //============================================================ |
| 895 | | // sdl_info::get_primitives |
| 896 | | //============================================================ |
| 897 | | |
| 898 | | void sdl_info_ogl::set_target_bounds() |
| 899 | | { |
| 900 | | window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); |
| 901 | | } |
| 902 | | |
| 903 | | //============================================================ |
| 904 | 955 | // loadGLExtensions |
| 905 | 956 | //============================================================ |
| 906 | 957 | |
| r243358 | r243359 | |
| 1211 | 1262 | } |
| 1212 | 1263 | |
| 1213 | 1264 | //============================================================ |
| 1214 | | // sdl_info::destroy |
| 1215 | | //============================================================ |
| 1216 | | |
| 1217 | | void sdl_info_ogl::destroy() |
| 1218 | | { |
| 1219 | | |
| 1220 | | // free the memory in the window |
| 1221 | | |
| 1222 | | destroy_all_textures(); |
| 1223 | | |
| 1224 | | #if (SDLMAME_SDL2) |
| 1225 | | SDL_GL_DeleteContext(m_gl_context_id); |
| 1226 | | if (window().fullscreen() && video_config.switchres) |
| 1227 | | { |
| 1228 | | SDL_SetWindowFullscreen(window().m_sdl_window, 0); // Try to set mode |
| 1229 | | SDL_SetWindowDisplayMode(window().m_sdl_window, &m_original_mode); // Try to set mode |
| 1230 | | SDL_SetWindowFullscreen(window().m_sdl_window, SDL_WINDOW_FULLSCREEN); // Try to set mode |
| 1231 | | } |
| 1232 | | |
| 1233 | | SDL_DestroyWindow(window().m_sdl_window); |
| 1234 | | #else |
| 1235 | | if (m_sdlsurf) |
| 1236 | | { |
| 1237 | | SDL_FreeSurface(m_sdlsurf); |
| 1238 | | m_sdlsurf = NULL; |
| 1239 | | } |
| 1240 | | #endif |
| 1241 | | } |
| 1242 | | |
| 1243 | | //============================================================ |
| 1244 | 1265 | // sdl_info::draw |
| 1245 | 1266 | //============================================================ |
| 1246 | 1267 | |
| r243358 | r243359 | |
| 3167 | 3188 | window().m_primlist->release_lock(); |
| 3168 | 3189 | } |
| 3169 | 3190 | |
| 3170 | | //============================================================ |
| 3171 | | // TEXCOPY FUNCS |
| 3172 | | //============================================================ |
| 3173 | | |
| 3174 | | void sdl_info_ogl::clear() |
| 3175 | | { |
| 3176 | | //FIXME: Handled in sdl_info::draw as well |
| 3177 | | m_blittimer = 3; |
| 3178 | | } |
trunk/src/osd/sdl/drawsdl.c
| r243358 | r243359 | |
| 51 | 51 | public: |
| 52 | 52 | |
| 53 | 53 | sdl_info(sdl_window_info *w) |
| 54 | | : osd_renderer(w), |
| 54 | : osd_renderer(w, FLAG_NONE), |
| 55 | 55 | m_blittimer(0), |
| 56 | 56 | m_extra_flags(0), |
| 57 | 57 | |
| r243358 | r243359 | |
| 72 | 72 | m_old_blitheight(0) |
| 73 | 73 | { } |
| 74 | 74 | |
| 75 | | /* virtual */ int create(int width, int height); |
| 76 | | /* virtual */ void resize(int width, int height); |
| 77 | | /* virtual */ int draw(UINT32 dc, int update); |
| 78 | | /* virtual */ void set_target_bounds(); |
| 79 | | /* virtual */ int xy_to_render_target(int x, int y, int *xt, int *yt); |
| 75 | /* virtual */ int create(const int width, const int height); |
| 76 | /* virtual */ void resize(const int width, const int height); |
| 77 | /* virtual */ int draw(const UINT32 dc, const int update); |
| 78 | /* virtual */ int xy_to_render_target(const int x, const int y, int *xt, int *yt); |
| 80 | 79 | /* virtual */ void destroy_all_textures(); |
| 81 | 80 | /* virtual */ void destroy(); |
| 82 | 81 | /* virtual */ void clear(); |
| r243358 | r243359 | |
| 431 | 430 | |
| 432 | 431 | int sdl_info::create(int width, int height) |
| 433 | 432 | { |
| 433 | /* FIXME: On Ubuntu and potentially other Linux OS you should use |
| 434 | * to disable panning. This has to be done before every invocation of mame. |
| 435 | * |
| 436 | * xrandr --output HDMI-0 --panning 0x0+0+0 --fb 0x0 |
| 437 | * |
| 438 | */ |
| 434 | 439 | const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |
| 435 | 440 | |
| 441 | osd_printf_verbose("Enter sdl_info::create\n"); |
| 442 | |
| 436 | 443 | #if (SDLMAME_SDL2) |
| 437 | 444 | |
| 438 | | osd_printf_verbose("Enter sdl_info::create\n"); |
| 445 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 446 | { |
| 447 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 439 | 448 | |
| 449 | /* FIXME: A reminder that gamma is wrong throughout MAME. Currently, SDL2.0 doesn't seem to |
| 450 | * support the following attribute although my hardware lists GL_ARB_framebuffer_sRGB as an extension. |
| 451 | * |
| 452 | * SDL_GL_SetAttribute( SDL_GL_FRAMEBUFFER_SRGB_CAPABLE, 1 ); |
| 453 | * |
| 454 | */ |
| 455 | m_extra_flags = SDL_WINDOW_OPENGL; |
| 456 | } |
| 457 | else |
| 458 | m_extra_flags = 0; |
| 459 | |
| 440 | 460 | /* set hints ... */ |
| 441 | 461 | SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, sm->sdl_scale_mode); |
| 442 | 462 | |
| 443 | 463 | // create the SDL window |
| 444 | 464 | // soft driver also used | SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_MOUSE_FOCUS |
| 445 | | m_extra_flags = (window().fullscreen() ? |
| 465 | m_extra_flags |= (window().fullscreen() ? |
| 446 | 466 | SDL_WINDOW_BORDERLESS | SDL_WINDOW_INPUT_FOCUS | SDL_WINDOW_FULLSCREEN : SDL_WINDOW_RESIZABLE); |
| 447 | 467 | |
| 448 | 468 | #if defined(SDLMAME_WIN32) |
| 449 | 469 | SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); |
| 450 | 470 | #endif |
| 471 | // create the SDL window |
| 451 | 472 | window().m_sdl_window = SDL_CreateWindow(window().m_title, |
| 452 | 473 | window().monitor()->position_size().x, window().monitor()->position_size().y, |
| 453 | 474 | width, height, m_extra_flags); |
| r243358 | r243359 | |
| 456 | 477 | |
| 457 | 478 | if (!window().m_sdl_window ) |
| 458 | 479 | { |
| 459 | | osd_printf_error("Unable to create window: %s\n", SDL_GetError()); |
| 480 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 481 | osd_printf_error("OpenGL not supported on this driver: %s\n", SDL_GetError()); |
| 482 | else |
| 483 | osd_printf_error("Window creation failed: %s\n", SDL_GetError()); |
| 460 | 484 | return 1; |
| 461 | 485 | } |
| 462 | 486 | |
| r243358 | r243359 | |
| 484 | 508 | { |
| 485 | 509 | //SDL_SetWindowDisplayMode(window().m_sdl_window, NULL); // Use desktop |
| 486 | 510 | } |
| 487 | | // create renderer |
| 488 | 511 | |
| 489 | | //SDL_SelectRenderer(window().sdl_window); |
| 490 | | |
| 491 | 512 | // show window |
| 492 | 513 | |
| 493 | 514 | SDL_ShowWindow(window().m_sdl_window); |
| r243358 | r243359 | |
| 496 | 517 | |
| 497 | 518 | SDL_GetWindowSize(window().m_sdl_window, &window().m_width, &window().m_height); |
| 498 | 519 | |
| 499 | | /* FIXME: Bug in SDL 1.3 */ |
| 500 | | if (window().fullscreen()) |
| 501 | | SDL_SetWindowGrab(window().m_sdl_window, SDL_TRUE); |
| 520 | // create renderer |
| 502 | 521 | |
| 503 | | // create a texture |
| 504 | | |
| 505 | 522 | if (video_config.waitvsync) |
| 506 | | m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, /*SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD |*/ SDL_RENDERER_PRESENTVSYNC); |
| 523 | m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_ACCELERATED); |
| 507 | 524 | else |
| 508 | | m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, /*SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTDISCARD*/ 0); |
| 525 | m_sdl_renderer = SDL_CreateRenderer(window().m_sdl_window, -1, SDL_RENDERER_ACCELERATED); |
| 509 | 526 | |
| 510 | | //SDL_SelectRenderer(window().sdl_window); |
| 527 | if (!m_sdl_renderer) |
| 528 | { |
| 529 | fatalerror("Error on creating renderer: %s\n", SDL_GetError()); |
| 530 | } |
| 511 | 531 | |
| 512 | 532 | { |
| 513 | 533 | struct SDL_RendererInfo render_info; |
| r243358 | r243359 | |
| 539 | 559 | |
| 540 | 560 | m_extra_flags |= sm->m_extra_flags; |
| 541 | 561 | |
| 562 | if (check_flag(FLAG_NEEDS_OPENGL)) |
| 563 | { |
| 564 | m_extra_flags |= SDL_DOUBLEBUF | SDL_OPENGL; |
| 565 | SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 ); |
| 566 | #if (SDL_VERSION_ATLEAST(1,2,10)) && (!defined(SDLMAME_EMSCRIPTEN)) |
| 567 | SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, video_config.waitvsync ? 1 : 0); |
| 568 | #endif |
| 569 | //load_gl_lib(window().machine()); |
| 570 | } |
| 571 | |
| 572 | // create the SDL surface (which creates the window in windowed mode) |
| 542 | 573 | m_sdlsurf = SDL_SetVideoMode(width, height, |
| 543 | 574 | 0, SDL_SWSURFACE | SDL_ANYFORMAT | m_extra_flags); |
| 544 | 575 | |
| 545 | 576 | if (!m_sdlsurf) |
| 546 | 577 | return 1; |
| 578 | if ( (video_config.mode == VIDEO_MODE_OPENGL) && !(m_sdlsurf->flags & SDL_OPENGL) ) |
| 579 | { |
| 580 | osd_printf_error("OpenGL not supported on this driver!\n"); |
| 581 | return 1; |
| 582 | } |
| 583 | |
| 547 | 584 | window().m_width = m_sdlsurf->w; |
| 548 | 585 | window().m_height = m_sdlsurf->h; |
| 549 | 586 | if (sm->is_yuv) |
| r243358 | r243359 | |
| 645 | 682 | } |
| 646 | 683 | |
| 647 | 684 | //============================================================ |
| 648 | | // sdl_info::draw |
| 685 | // sdl_info::clear |
| 649 | 686 | //============================================================ |
| 650 | 687 | |
| 651 | 688 | void sdl_info::clear() |
| 652 | 689 | { |
| 690 | //FIXME: Handled in sdl_info::draw as well |
| 653 | 691 | m_blittimer = 3; |
| 654 | 692 | } |
| 655 | 693 | |
| r243358 | r243359 | |
| 659 | 697 | |
| 660 | 698 | int sdl_info::xy_to_render_target(int x, int y, int *xt, int *yt) |
| 661 | 699 | { |
| 662 | | // const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |
| 663 | | |
| 664 | 700 | *xt = x - m_last_hofs; |
| 665 | 701 | *yt = y - m_last_vofs; |
| 666 | 702 | if (*xt<0 || *xt >= window().m_blitwidth) |
| 667 | 703 | return 0; |
| 668 | | if (*yt<0 || *xt >= window().m_blitheight) |
| 704 | if (*yt<0 || *yt >= window().m_blitheight) |
| 669 | 705 | return 0; |
| 670 | 706 | return 1; |
| 671 | 707 | } |
| 672 | 708 | |
| 673 | 709 | //============================================================ |
| 674 | | // drawsdl_window_get_primitives |
| 710 | // sdl_info::draw |
| 675 | 711 | //============================================================ |
| 676 | 712 | |
| 677 | | void sdl_info::set_target_bounds() |
| 678 | | { |
| 679 | | window().m_target->set_bounds(window().m_blitwidth, window().m_blitheight, window().monitor()->aspect()); |
| 680 | | } |
| 681 | | |
| 682 | | //============================================================ |
| 683 | | // drawsdl_window_draw |
| 684 | | //============================================================ |
| 685 | | |
| 686 | 713 | int sdl_info::draw(UINT32 dc, int update) |
| 687 | 714 | { |
| 688 | 715 | const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |