trunk/src/mame/drivers/sidearms.c
| r32356 | r32357 | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | | |
| 56 | | |
| 57 | 55 | /* Turtle Ship input ports are rotated 90 degrees */ |
| 56 | IOPORT_ARRAY_MEMBER(sidearms_state::ports) { "SYSTEM", "P1", "P2", "DSW0", "DSW1" }; |
| 57 | |
| 58 | 58 | READ8_MEMBER(sidearms_state::turtship_ports_r) |
| 59 | 59 | { |
| 60 | | int i,res; |
| 61 | | static const char *const portnames[] = { "SYSTEM", "P1", "P2", "DSW0", "DSW1", "NOT_PRESENT", "NOT_PRESENT", "NOT_PRESENT" }; // only inputs 0-4 are present |
| 60 | int res = 0; |
| 61 | for (int i = 0; i < 5;i++) |
| 62 | res |= ((m_ports[i]->read_safe(0) >> offset) & 1) << i; |
| 62 | 63 | |
| 63 | | res = 0; |
| 64 | | for (i = 0;i < 8;i++) |
| 65 | | res |= ((ioport(portnames[i])->read_safe(0) >> offset) & 1) << i; |
| 66 | | |
| 67 | 64 | return res; |
| 68 | 65 | } |
| 69 | 66 | |
trunk/src/mame/includes/sidearms.h
| r32356 | r32357 | |
| 5 | 5 | public: |
| 6 | 6 | sidearms_state(const machine_config &mconfig, device_type type, const char *tag) |
| 7 | 7 | : driver_device(mconfig, type, tag), |
| 8 | | m_spriteram(*this, "spriteram") , |
| 8 | m_maincpu(*this, "maincpu"), |
| 9 | m_audiocpu(*this, "audiocpu"), |
| 10 | m_gfxdecode(*this, "gfxdecode"), |
| 11 | m_palette(*this, "palette"), |
| 12 | m_spriteram(*this, "spriteram") , |
| 9 | 13 | m_bg_scrollx(*this, "bg_scrollx"), |
| 10 | 14 | m_bg_scrolly(*this, "bg_scrolly"), |
| 11 | 15 | m_videoram(*this, "videoram"), |
| 12 | 16 | m_colorram(*this, "colorram"), |
| 13 | | m_maincpu(*this, "maincpu"), |
| 14 | | m_audiocpu(*this, "audiocpu"), |
| 15 | | m_gfxdecode(*this, "gfxdecode"), |
| 16 | | m_palette(*this, "palette") { } |
| 17 | m_ports(*this, ports) { } |
| 17 | 18 | |
| 18 | 19 | int m_gameid; |
| 19 | 20 | |
| 21 | required_device<cpu_device> m_maincpu; |
| 22 | required_device<cpu_device> m_audiocpu; |
| 23 | required_device<gfxdecode_device> m_gfxdecode; |
| 24 | required_device<palette_device> m_palette; |
| 20 | 25 | required_device<buffered_spriteram8_device> m_spriteram; |
| 26 | |
| 21 | 27 | required_shared_ptr<UINT8> m_bg_scrollx; |
| 22 | 28 | required_shared_ptr<UINT8> m_bg_scrolly; |
| 23 | 29 | required_shared_ptr<UINT8> m_videoram; |
| 24 | 30 | required_shared_ptr<UINT8> m_colorram; |
| 31 | |
| 32 | DECLARE_IOPORT_ARRAY(ports); |
| 33 | required_ioport_array<5> m_ports; |
| 34 | |
| 25 | 35 | UINT8 *m_tilerom; |
| 26 | 36 | tilemap_t *m_bg_tilemap; |
| 27 | 37 | tilemap_t *m_fg_tilemap; |
| r32356 | r32357 | |
| 60 | 70 | void draw_sprites_region(bitmap_ind16 &bitmap, const rectangle &cliprect, int start_offset, int end_offset ); |
| 61 | 71 | void sidearms_draw_starfield( bitmap_ind16 &bitmap ); |
| 62 | 72 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 63 | | required_device<cpu_device> m_maincpu; |
| 64 | | required_device<cpu_device> m_audiocpu; |
| 65 | | required_device<gfxdecode_device> m_gfxdecode; |
| 66 | | required_device<palette_device> m_palette; |
| 67 | 73 | }; |