trunk/src/mame/drivers/xyonix.c
| r242904 | r242905 | |
| 25 | 25 | #include "includes/xyonix.h" |
| 26 | 26 | |
| 27 | 27 | |
| 28 | | WRITE8_MEMBER(xyonix_state::xyonix_irqack_w) |
| 28 | void xyonix_state::machine_start() |
| 29 | 29 | { |
| 30 | save_item(NAME(m_e0_data)); |
| 31 | save_item(NAME(m_credits)); |
| 32 | save_item(NAME(m_coins)); |
| 33 | save_item(NAME(m_prev_coin)); |
| 34 | } |
| 35 | |
| 36 | WRITE8_MEMBER(xyonix_state::irqack_w) |
| 37 | { |
| 30 | 38 | m_maincpu->set_input_line(0, CLEAR_LINE); |
| 31 | 39 | } |
| 32 | 40 | |
| r242904 | r242905 | |
| 71 | 79 | } |
| 72 | 80 | |
| 73 | 81 | |
| 74 | | READ8_MEMBER(xyonix_state::xyonix_io_r) |
| 82 | READ8_MEMBER(xyonix_state::io_r) |
| 75 | 83 | { |
| 76 | 84 | int regPC = space.device().safe_pc(); |
| 77 | 85 | |
| r242904 | r242905 | |
| 122 | 130 | return 0xff; |
| 123 | 131 | } |
| 124 | 132 | |
| 125 | | WRITE8_MEMBER(xyonix_state::xyonix_io_w) |
| 133 | WRITE8_MEMBER(xyonix_state::io_w) |
| 126 | 134 | { |
| 127 | 135 | //logerror ("xyonix_port_e0_w %02x - PC = %04x\n", data, space.device().safe_pc()); |
| 128 | 136 | m_e0_data = data; |
| r242904 | r242905 | |
| 133 | 141 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, xyonix_state ) |
| 134 | 142 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 135 | 143 | AM_RANGE(0xc000, 0xdfff) AM_RAM |
| 136 | | AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(xyonix_vidram_w) AM_SHARE("vidram") |
| 144 | AM_RANGE(0xe000, 0xffff) AM_RAM_WRITE(vidram_w) AM_SHARE("vidram") |
| 137 | 145 | ADDRESS_MAP_END |
| 138 | 146 | |
| 139 | 147 | static ADDRESS_MAP_START( port_map, AS_IO, 8, xyonix_state ) |
| r242904 | r242905 | |
| 141 | 149 | AM_RANGE(0x20, 0x20) AM_READNOP AM_DEVWRITE("sn1", sn76496_device, write) /* SN76496 ready signal */ |
| 142 | 150 | AM_RANGE(0x21, 0x21) AM_READNOP AM_DEVWRITE("sn2", sn76496_device, write) |
| 143 | 151 | AM_RANGE(0x40, 0x40) AM_WRITENOP /* NMI ack? */ |
| 144 | | AM_RANGE(0x50, 0x50) AM_WRITE(xyonix_irqack_w) |
| 152 | AM_RANGE(0x50, 0x50) AM_WRITE(irqack_w) |
| 145 | 153 | AM_RANGE(0x60, 0x61) AM_WRITENOP /* mc6845 */ |
| 146 | | AM_RANGE(0xe0, 0xe0) AM_READWRITE(xyonix_io_r, xyonix_io_w) |
| 154 | AM_RANGE(0xe0, 0xe0) AM_READWRITE(io_r, io_w) |
| 147 | 155 | ADDRESS_MAP_END |
| 148 | 156 | |
| 149 | 157 | /* Inputs Ports **************************************************************/ |
| r242904 | r242905 | |
| 226 | 234 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 227 | 235 | MCFG_SCREEN_SIZE(80*4, 32*8) |
| 228 | 236 | MCFG_SCREEN_VISIBLE_AREA(0, 80*4-1, 0, 28*8-1) |
| 229 | | MCFG_SCREEN_UPDATE_DRIVER(xyonix_state, screen_update_xyonix) |
| 237 | MCFG_SCREEN_UPDATE_DRIVER(xyonix_state, screen_update) |
| 230 | 238 | MCFG_SCREEN_PALETTE("palette") |
| 231 | 239 | |
| 232 | 240 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", xyonix) |
| r242904 | r242905 | |
| 259 | 267 | |
| 260 | 268 | /* GAME drivers **************************************************************/ |
| 261 | 269 | |
| 262 | | GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", 0 ) |
| 270 | GAME( 1989, xyonix, 0, xyonix, xyonix, driver_device, 0, ROT0, "Philko", "Xyonix", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/xyonix.h
| r242904 | r242905 | |
| 3 | 3 | public: |
| 4 | 4 | xyonix_state(const machine_config &mconfig, device_type type, const char *tag) |
| 5 | 5 | : driver_device(mconfig, type, tag), |
| 6 | | m_vidram(*this, "vidram"), |
| 7 | 6 | m_maincpu(*this, "maincpu"), |
| 8 | | m_gfxdecode(*this, "gfxdecode") { } |
| 7 | m_gfxdecode(*this, "gfxdecode"), |
| 8 | m_vidram(*this, "vidram") { } |
| 9 | 9 | |
| 10 | required_device<cpu_device> m_maincpu; |
| 11 | required_device<gfxdecode_device> m_gfxdecode; |
| 12 | |
| 10 | 13 | required_shared_ptr<UINT8> m_vidram; |
| 14 | |
| 11 | 15 | tilemap_t *m_tilemap; |
| 12 | 16 | |
| 13 | 17 | int m_e0_data; |
| 14 | 18 | int m_credits; |
| 15 | 19 | int m_coins; |
| 16 | 20 | int m_prev_coin; |
| 17 | | DECLARE_WRITE8_MEMBER(xyonix_irqack_w); |
| 18 | | DECLARE_READ8_MEMBER(xyonix_io_r); |
| 19 | | DECLARE_WRITE8_MEMBER(xyonix_io_w); |
| 20 | | DECLARE_WRITE8_MEMBER(xyonix_vidram_w); |
| 21 | | TILE_GET_INFO_MEMBER(get_xyonix_tile_info); |
| 21 | |
| 22 | DECLARE_WRITE8_MEMBER(irqack_w); |
| 23 | DECLARE_READ8_MEMBER(io_r); |
| 24 | DECLARE_WRITE8_MEMBER(io_w); |
| 25 | DECLARE_WRITE8_MEMBER(vidram_w); |
| 26 | |
| 27 | virtual void machine_start(); |
| 22 | 28 | virtual void video_start(); |
| 29 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 23 | 30 | DECLARE_PALETTE_INIT(xyonix); |
| 24 | | UINT32 screen_update_xyonix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 31 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 32 | |
| 25 | 33 | void handle_coins(int coin); |
| 26 | | required_device<cpu_device> m_maincpu; |
| 27 | | required_device<gfxdecode_device> m_gfxdecode; |
| 28 | 34 | }; |
trunk/src/mame/video/xyonix.c
| r242904 | r242905 | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | | TILE_GET_INFO_MEMBER(xyonix_state::get_xyonix_tile_info) |
| 34 | TILE_GET_INFO_MEMBER(xyonix_state::get_tile_info) |
| 35 | 35 | { |
| 36 | 36 | int tileno; |
| 37 | 37 | int attr = m_vidram[tile_index+0x1000+1]; |
| r242904 | r242905 | |
| 41 | 41 | SET_TILE_INFO_MEMBER(0,tileno,attr >> 4,0); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | | WRITE8_MEMBER(xyonix_state::xyonix_vidram_w) |
| 44 | WRITE8_MEMBER(xyonix_state::vidram_w) |
| 45 | 45 | { |
| 46 | 46 | m_vidram[offset] = data; |
| 47 | 47 | m_tilemap->mark_tile_dirty((offset-1)&0x0fff); |
| r242904 | r242905 | |
| 49 | 49 | |
| 50 | 50 | void xyonix_state::video_start() |
| 51 | 51 | { |
| 52 | | m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(xyonix_state::get_xyonix_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 80, 32); |
| 52 | m_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(xyonix_state::get_tile_info),this), TILEMAP_SCAN_ROWS, 4, 8, 80, 32); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | | UINT32 xyonix_state::screen_update_xyonix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 55 | UINT32 xyonix_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 56 | 56 | { |
| 57 | 57 | m_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 58 | 58 | return 0; |