trunk/src/mame/drivers/stuntair.c
r22887 | r22888 | |
66 | 66 | Note: no table-upright mode sw,upright fixed.No picture flip sw too |
67 | 67 | |
68 | 68 | |
69 | | Eprom dump,hw and dip info by tirino73 >isolani1973@libero.it< |
| 69 | Eprom dump,hw and dip info by tirino73 |
70 | 70 | Bprom dump by f205v |
71 | 71 | |
72 | 72 | */ |
r22887 | r22888 | |
79 | 79 | public: |
80 | 80 | stuntair_state(const machine_config &mconfig, device_type type, const char *tag) |
81 | 81 | : driver_device(mconfig, type, tag), |
82 | | m_maincpu(*this, "maincpu") { } |
| 82 | m_maincpu(*this, "maincpu"), |
| 83 | m_fgram(*this, "fgram") |
| 84 | { } |
83 | 85 | |
84 | 86 | required_device<cpu_device> m_maincpu; |
| 87 | required_shared_ptr<UINT8> m_fgram; |
85 | 88 | |
| 89 | tilemap_t *m_fg_tilemap; |
| 90 | |
| 91 | DECLARE_WRITE8_MEMBER(stuntair_fgram_w); |
| 92 | TILE_GET_INFO_MEMBER(get_stuntair_fg_tile_info); |
| 93 | |
| 94 | DECLARE_READ8_MEMBER(stuntair_unk_r) |
| 95 | { |
| 96 | return 0xff; |
| 97 | } |
| 98 | |
| 99 | INTERRUPT_GEN_MEMBER(stuntair_irq); |
| 100 | |
| 101 | |
86 | 102 | virtual void machine_start(); |
87 | 103 | virtual void machine_reset(); |
88 | 104 | virtual void video_start(); |
r22887 | r22888 | |
92 | 108 | |
93 | 109 | static ADDRESS_MAP_START( stuntair_map, AS_PROGRAM, 8, stuntair_state ) |
94 | 110 | AM_RANGE(0x0000, 0x9fff) AM_ROM |
| 111 | AM_RANGE(0xc000, 0xc7ff) AM_RAM // bg |
| 112 | AM_RANGE(0xc800, 0xcfff) AM_RAM // bg attr |
| 113 | AM_RANGE(0xd000, 0xd3ff) AM_RAM |
| 114 | AM_RANGE(0xd800, 0xdfff) AM_RAM |
| 115 | |
| 116 | AM_RANGE(0xe000, 0xe000) AM_READ(stuntair_unk_r) AM_WRITENOP |
| 117 | AM_RANGE(0xe800, 0xe800) AM_READ(stuntair_unk_r) AM_WRITENOP |
| 118 | |
| 119 | AM_RANGE(0xf000, 0xf000) AM_READ(stuntair_unk_r) AM_WRITENOP |
| 120 | AM_RANGE(0xf001, 0xf001) AM_WRITENOP // might be nmi enable |
| 121 | AM_RANGE(0xf002, 0xf002) AM_READ(stuntair_unk_r) AM_WRITENOP |
| 122 | AM_RANGE(0xf003, 0xf003) AM_READ(stuntair_unk_r) AM_WRITENOP |
| 123 | AM_RANGE(0xf004, 0xf004) AM_WRITENOP |
| 124 | AM_RANGE(0xf005, 0xf005) AM_WRITENOP |
| 125 | AM_RANGE(0xf006, 0xf006) AM_WRITENOP |
| 126 | AM_RANGE(0xf007, 0xf007) AM_WRITENOP |
| 127 | |
| 128 | |
| 129 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(stuntair_fgram_w) AM_SHARE("fgram") |
| 130 | |
| 131 | |
| 132 | AM_RANGE(0xfc03, 0xfc03) AM_WRITENOP //? register or overrun? |
| 133 | |
95 | 134 | ADDRESS_MAP_END |
96 | 135 | |
97 | 136 | static ADDRESS_MAP_START( stuntair_soound_map, AS_PROGRAM, 8, stuntair_state ) |
r22887 | r22888 | |
140 | 179 | { |
141 | 180 | } |
142 | 181 | |
| 182 | |
| 183 | TILE_GET_INFO_MEMBER(stuntair_state::get_stuntair_fg_tile_info) |
| 184 | { |
| 185 | int tileno = m_fgram[tile_index]; |
| 186 | SET_TILE_INFO_MEMBER(0, tileno&0x7f, 0, 0); |
| 187 | } |
| 188 | |
| 189 | WRITE8_MEMBER(stuntair_state::stuntair_fgram_w) |
| 190 | { |
| 191 | m_fgram[offset] = data; |
| 192 | m_fg_tilemap->mark_tile_dirty(offset); |
| 193 | } |
| 194 | |
| 195 | |
143 | 196 | void stuntair_state::video_start() |
144 | 197 | { |
| 198 | m_fg_tilemap = &machine().tilemap().create(tilemap_get_info_delegate(FUNC(stuntair_state::get_stuntair_fg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
145 | 199 | } |
146 | 200 | |
147 | 201 | UINT32 stuntair_state::screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
148 | 202 | { |
| 203 | m_fg_tilemap->draw(bitmap, cliprect, 0, 0); |
149 | 204 | return 0; |
150 | 205 | } |
151 | 206 | |
| 207 | INTERRUPT_GEN_MEMBER(stuntair_state::stuntair_irq) |
| 208 | { |
| 209 | // if(m_nmi_enable) |
| 210 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 211 | } |
152 | 212 | |
153 | | |
154 | 213 | static MACHINE_CONFIG_START( stuntair, stuntair_state ) |
155 | 214 | |
156 | 215 | /* basic machine hardware */ |
157 | 216 | MCFG_CPU_ADD("maincpu", Z80, 18432000/4) /* ? MHz */ |
158 | 217 | MCFG_CPU_PROGRAM_MAP(stuntair_map) |
159 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", stuntair_state, irq0_line_hold) |
| 218 | MCFG_CPU_VBLANK_INT_DRIVER("screen", stuntair_state, stuntair_irq) |
160 | 219 | |
161 | 220 | MCFG_CPU_ADD("audiocpu", Z80, 18432000/4) /* ? MHz */ |
162 | 221 | MCFG_CPU_PROGRAM_MAP(stuntair_soound_map) |