trunk/src/mame/includes/mario.h
r32740 | r32741 | |
102 | 102 | DECLARE_WRITE8_MEMBER(mario_sh2_w); |
103 | 103 | DECLARE_READ8_MEMBER(memory_read_byte); |
104 | 104 | DECLARE_WRITE8_MEMBER(memory_write_byte); |
105 | | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr); |
| 105 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy); |
106 | 106 | required_device<cpu_device> m_maincpu; |
107 | 107 | optional_device<cpu_device> m_audiocpu; |
108 | 108 | required_device<gfxdecode_device> m_gfxdecode; |
trunk/src/mame/video/mario.c
r32740 | r32741 | |
147 | 147 | * confirmed on mametests.org as being present on real PCB as well. |
148 | 148 | */ |
149 | 149 | |
150 | | void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr) |
| 150 | void mario_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int yaddr, int xaddr, int dx, int dy) |
151 | 151 | { |
152 | 152 | /* TODO: draw_sprites should adopt the scanline logic from dkong.c |
153 | 153 | * The schematics have the same logic for sprite buffering. |
r32740 | r32741 | |
177 | 177 | m_spriteram[offs + 2], |
178 | 178 | (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor, |
179 | 179 | !(m_spriteram[offs + 1] & 0x80),!(m_spriteram[offs + 1] & 0x40), |
180 | | x, y,0); |
| 180 | x+dx, y+dy,0); |
181 | 181 | } |
182 | 182 | else |
183 | 183 | { |
r32740 | r32741 | |
187 | 187 | m_spriteram[offs + 2], |
188 | 188 | (m_spriteram[offs + 1] & 0x0f) + 16 * m_palette_bank + 32 * m_monitor, |
189 | 189 | (m_spriteram[offs + 1] & 0x80),(m_spriteram[offs + 1] & 0x40), |
190 | | x, y,0); |
| 190 | x+dx, y+dy,0); |
191 | 191 | } |
192 | 192 | } |
193 | 193 | } |
r32740 | r32741 | |
214 | 214 | UINT32 mario_state::screen_update_mario(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
215 | 215 | { |
216 | 216 | screen_update_common(screen, bitmap, cliprect); |
217 | | draw_sprites(bitmap, cliprect, 0, 3); |
| 217 | draw_sprites(bitmap, cliprect, 0, 3, 0, 0); |
218 | 218 | return 0; |
219 | 219 | } |
220 | 220 | |
221 | 221 | UINT32 mario_state::screen_update_mariobl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
222 | 222 | { |
| 223 | // not sure |
| 224 | m_palette_bank = m_gfx_bank; // might be the 'attr' ram |
| 225 | machine().tilemap().mark_all_dirty(); |
| 226 | |
| 227 | |
223 | 228 | screen_update_common(screen, bitmap, cliprect); |
224 | | draw_sprites(bitmap, cliprect, 3, 0); |
| 229 | draw_sprites(bitmap, cliprect, 3, 0, 8, -8); |
225 | 230 | return 0; |
226 | 231 | } |
trunk/src/mame/drivers/mario.c
r32740 | r32741 | |
177 | 177 | static ADDRESS_MAP_START( mariobl_map, AS_PROGRAM, 8, mario_state) |
178 | 178 | AM_RANGE(0x0000, 0x5fff) AM_ROM |
179 | 179 | AM_RANGE(0x6000, 0x6fff) AM_RAM |
180 | | AM_RANGE(0x7000, 0x73ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ |
| 180 | AM_RANGE(0x7000, 0x71ff) AM_RAM AM_SHARE("spriteram") /* physical sprite ram */ |
| 181 | AM_RANGE(0x7200, 0x73ff) AM_RAM // attrram? |
181 | 182 | AM_RANGE(0x7400, 0x77ff) AM_RAM_WRITE(mario_videoram_w) AM_SHARE("videoram") |
182 | 183 | //AM_RANGE(0xa000, 0xa000) AM_READ_PORT("IN1") |
| 184 | AM_RANGE(0xa000, 0xa000) AM_READNOP /* watchdog? */ |
183 | 185 | AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") /* DSW */ |
| 186 | AM_RANGE(0xa206, 0xa206) AM_WRITE(mario_gfxbank_w) |
184 | 187 | AM_RANGE(0xe000, 0xffff) AM_ROM |
185 | 188 | ADDRESS_MAP_END |
186 | 189 | |
r32740 | r32741 | |
501 | 504 | |
502 | 505 | MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ |
503 | 506 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("SYSTEM")) |
| 507 | // MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay1_outputb_w)) |
| 508 | |
504 | 509 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
505 | 510 | |
506 | 511 | MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/6/2) /* XTAL confirmed, divisor guessed */ |
507 | 512 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("INPUTS")) |
| 513 | // MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(mario_state, ay2_outputb_w)) |
| 514 | |
508 | 515 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.33) |
509 | 516 | |
510 | 517 | MACHINE_CONFIG_END |