Previous 199869 Revisions Next

r18026 Wednesday 19th September, 2012 at 18:35:00 UTC by hap
considering the sprite hw is like on NES, IN0 d6 looks like it is sprite-0 collision detection
[src/mame/drivers]homerun.c
[src/mame/includes]homerun.h
[src/mame/video]homerun.c

trunk/src/mame/video/homerun.c
r18025r18026
1010
1111/**************************************************************************/
1212
13CUSTOM_INPUT_MEMBER(homerun_state::homerun_sprite0_r)
14{
15   // sprite-0 vs background collision status, similar to NES
16   return (machine().primary_screen->vpos() > (m_spriteram[0] - 15)) ? 1 : 0;
17}
18
1319WRITE8_MEMBER(homerun_state::homerun_scrollhi_w)
1420{
1521   // d0: scroll y high bit
r18025r18026
113119   for (offs = state->m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
114120   {
115121      int sx = spriteram[offs + 3];
116      int sy = spriteram[offs + 0] - 16;
122      int sy = spriteram[offs + 0] - 15;
117123      int code = (spriteram[offs + 1]) | ((spriteram[offs + 2] & 0x8) << 5) | ((state->m_gfx_ctrl & 3) << 9);
118124      int color = (spriteram[offs + 2] & 0x07) | 8;
119125      int flipx = (spriteram[offs + 2] & 0x40) >> 6;
trunk/src/mame/includes/homerun.h
r18025r18026
4343   DECLARE_WRITE8_MEMBER(homerun_scrolly_w);
4444   DECLARE_WRITE8_MEMBER(homerun_scrollx_w);
4545
46   DECLARE_CUSTOM_INPUT_MEMBER(homerun_40_r);
46   DECLARE_CUSTOM_INPUT_MEMBER(homerun_sprite0_r);
4747   DECLARE_CUSTOM_INPUT_MEMBER(homerun_d7756_busy_r);
4848   DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_d7756_busy_r);
4949   DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_hopper_status_r);
trunk/src/mame/drivers/homerun.c
r18025r18026
121121ADDRESS_MAP_END
122122
123123
124CUSTOM_INPUT_MEMBER(homerun_state::homerun_40_r)
125{
126   // screen split location is a guess, but works in homerun
127   UINT8 ret = (machine().primary_screen->vpos() > 116) ? 1 : 0;
128
129   return ret;
130}
131
132124CUSTOM_INPUT_MEMBER(homerun_state::homerun_d7756_busy_r)
133125{
134126   return m_samples->playing(0) ? 0 : 1;
r18025r18026
155147static INPUT_PORTS_START( homerun )
156148   PORT_START("IN0")
157149   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN1 )
158   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_40_r, NULL)
150   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_sprite0_r, NULL)
159151   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_d7756_busy_r, NULL)
160152   PORT_BIT( 0x37, IP_ACTIVE_HIGH, IPT_UNKNOWN )
161153
r18025r18026
192184static INPUT_PORTS_START( dynashot )
193185   PORT_START("IN0")
194186   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN1 )
195   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_40_r, NULL)
196   PORT_BIT( 0xb7, IP_ACTIVE_HIGH, IPT_UNKNOWN )
187   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_sprite0_r, NULL)
188   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) // doesn't have d7756
189   PORT_BIT( 0x37, IP_ACTIVE_HIGH, IPT_UNKNOWN )
197190
198191   PORT_START("IN1")
199192   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
r18025r18026
229222   PORT_START("IN0")
230223   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ?
231224   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN1 )
225   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_sprite0_r, NULL)
232226   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, ganjaja_d7756_busy_r, NULL)
233   PORT_BIT( 0x76, IP_ACTIVE_HIGH, IPT_UNKNOWN )
227   PORT_BIT( 0x36, IP_ACTIVE_HIGH, IPT_UNKNOWN )
234228
235229   PORT_START("IN1")
236230   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP    ) PORT_NAME("P1 Up / Rock")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team