Previous 199869 Revisions Next

r22888 Saturday 18th May, 2013 at 09:55:40 UTC by David Haywood
stuntair - give it an fg layer
[src/mame/drivers]stuntair.c

trunk/src/mame/drivers/stuntair.c
r22887r22888
6666Note: no table-upright mode sw,upright fixed.No picture flip sw too
6767   
6868
69Eprom dump,hw and dip info by tirino73 >isolani1973@libero.it<
69Eprom dump,hw and dip info by tirino73
7070Bprom dump by f205v
7171
7272*/
r22887r22888
7979public:
8080   stuntair_state(const machine_config &mconfig, device_type type, const char *tag)
8181      : driver_device(mconfig, type, tag),
82      m_maincpu(*this, "maincpu") { }
82      m_maincpu(*this, "maincpu"),
83      m_fgram(*this, "fgram")
84   { }
8385
8486   required_device<cpu_device> m_maincpu;
87   required_shared_ptr<UINT8> m_fgram;
8588
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
86102   virtual void machine_start();
87103   virtual void machine_reset();
88104   virtual void video_start();
r22887r22888
92108
93109static ADDRESS_MAP_START( stuntair_map, AS_PROGRAM, 8, stuntair_state )
94110   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
95134ADDRESS_MAP_END
96135
97136static ADDRESS_MAP_START( stuntair_soound_map, AS_PROGRAM, 8, stuntair_state )
r22887r22888
140179{
141180}
142181
182
183TILE_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
189WRITE8_MEMBER(stuntair_state::stuntair_fgram_w)
190{
191   m_fgram[offset] = data;
192   m_fg_tilemap->mark_tile_dirty(offset);
193}
194
195
143196void stuntair_state::video_start()
144197{
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);
145199}
146200
147201UINT32 stuntair_state::screen_update_stuntair(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
148202{
203   m_fg_tilemap->draw(bitmap, cliprect, 0, 0);
149204   return 0;
150205}
151206
207INTERRUPT_GEN_MEMBER(stuntair_state::stuntair_irq)
208{
209//   if(m_nmi_enable)
210      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
211}
152212
153
154213static MACHINE_CONFIG_START( stuntair, stuntair_state )
155214
156215   /* basic machine hardware */
157216   MCFG_CPU_ADD("maincpu", Z80,  18432000/4)         /* ? MHz */
158217   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)
160219
161220   MCFG_CPU_ADD("audiocpu", Z80,  18432000/4)         /* ? MHz */
162221   MCFG_CPU_PROGRAM_MAP(stuntair_soound_map)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team