Previous 199869 Revisions Next

r17736 Saturday 8th September, 2012 at 23:39:39 UTC by hap
WIP stuff
[src/mame]mame.lst
[src/mame/drivers]homerun.c
[src/mame/includes]homerun.h
[src/mame/video]homerun.c

trunk/src/mame/mame.lst
r17735r17736
79187918exerizerb      // bootleg
79197919homerun         // (c) 1988 Jaleco
79207920dynashot      // (c) 1988 Jaleco
7921ganjaja         // (c) 1990 Jaleco
79217922bigrun         // (c) 1989 Jaleco
79227923cischeat      // (c) 1990 Jaleco
79237924f1gpstar      // (c) 1991 Jaleco
trunk/src/mame/includes/homerun.h
r17735r17736
11/*************************************************************************
22
3    Moero Pro Yakyuu Homerun & Dynamic Shooting
3    Jaleco Moero Pro Yakyuu Homerun hardware
44
55*************************************************************************/
66
r17735r17736
88{
99public:
1010   homerun_state(const machine_config &mconfig, device_type type, const char *tag)
11      : driver_device(mconfig, type, tag) ,
11      : driver_device(mconfig, type, tag),
12      m_maincpu(*this,"maincpu"),
1213      m_videoram(*this, "videoram"),
13      m_spriteram(*this, "spriteram"){ }
14      m_spriteram(*this, "spriteram")
15   { }
1416
15   /* memory pointers */
17   required_device<cpu_device> m_maincpu;
1618   required_shared_ptr<UINT8> m_videoram;
1719   required_shared_ptr<UINT8> m_spriteram;
1820
19   /* video-related */
20   tilemap_t    *m_tilemap;
21   int        m_gfx_ctrl;
21   tilemap_t *m_tilemap;
22   int m_gfx_ctrl;
23   int m_gc_up;
24   int m_gc_down;
25   int m_scrollx;
26   int m_scrolly;
2227
23   /* misc */
24   int        m_xpa;
25   int        m_xpb;
26   int        m_xpc;
27   int        m_gc_up;
28   int        m_gc_down;
2928   DECLARE_WRITE8_MEMBER(homerun_videoram_w);
3029   DECLARE_WRITE8_MEMBER(homerun_color_w);
30   DECLARE_WRITE8_MEMBER(homerun_scrollhi_w);
31   DECLARE_WRITE8_MEMBER(homerun_scrolly_w);
32   DECLARE_WRITE8_MEMBER(homerun_scrollx_w);
33
3134   DECLARE_CUSTOM_INPUT_MEMBER(homerun_40_r);
32   DECLARE_WRITE8_MEMBER(pa_w);
33   DECLARE_WRITE8_MEMBER(pb_w);
34   DECLARE_WRITE8_MEMBER(pc_w);
35   DECLARE_CUSTOM_INPUT_MEMBER(ganjaja_hopper_status_r);
36
3537   TILE_GET_INFO_MEMBER(get_homerun_tile_info);
3638};
3739
trunk/src/mame/video/homerun.c
r17735r17736
1/*************************************************************************
2
3    Jaleco Moero Pro Yakyuu Homerun hardware
4
5*************************************************************************/
6
17#include "emu.h"
28#include "includes/homerun.h"
39
r17735r17736
410
511#define half_screen 116
612
13WRITE8_MEMBER(homerun_state::homerun_scrollhi_w)
14{
15   // d0: scroll y high bit
16   // d1: scroll x high bit
17   // other bits: ?
18   m_scrolly = (m_scrolly & 0xff) | (data << 8 & 0x100);
19   m_scrollx = (m_scrollx & 0xff) | (data << 7 & 0x100);
20}
21
22WRITE8_MEMBER(homerun_state::homerun_scrolly_w)
23{
24   m_scrolly = (m_scrolly & 0xff00) | data;
25}
26
27WRITE8_MEMBER(homerun_state::homerun_scrollx_w)
28{
29   m_scrollx = (m_scrollx & 0xff00) | data;
30}
31
732WRITE8_DEVICE_HANDLER(homerun_banking_w)
833{
934   homerun_state *state = device->machine().driver_data<homerun_state>();
r17735r17736
86111   rectangle myclip = cliprect;
87112
88113   /* upper part */
89   state->m_tilemap->set_scrollx(0, state->m_xpc + ((state->m_xpa & 2) << 7) );
90   state->m_tilemap->set_scrolly(0, state->m_xpb + ((state->m_xpa & 1) << 8) );
114   state->m_tilemap->set_scrolly(0, state->m_scrolly);
115   state->m_tilemap->set_scrollx(0, state->m_scrollx);
91116
92117   myclip.max_y /= 2;
93118   state->m_gfx_ctrl = state->m_gc_up;
trunk/src/mame/drivers/homerun.c
r17735r17736
5151#include "includes/homerun.h"
5252
5353
54WRITE8_MEMBER(homerun_state::pa_w)
55{
56   m_xpa = data;
57}
5854
59WRITE8_MEMBER(homerun_state::pb_w)
60{
61   m_xpb = data;
62}
6355
64WRITE8_MEMBER(homerun_state::pc_w)
65{
66   m_xpc = data;
67}
68
69
7056static I8255A_INTERFACE( ppi8255_intf )
7157{
7258   // all ports are outputs
7359   DEVCB_NULL,            /* Port A read */
74   DEVCB_DRIVER_MEMBER(homerun_state,pa_w),   /* Port A write */
60   DEVCB_DRIVER_MEMBER(homerun_state, homerun_scrollhi_w),   /* Port A write */
7561   DEVCB_NULL,            /* Port B read */
76   DEVCB_DRIVER_MEMBER(homerun_state,pb_w),   /* Port B write */
62   DEVCB_DRIVER_MEMBER(homerun_state, homerun_scrolly_w),   /* Port B write */
7763   DEVCB_NULL,            /* Port C read */
78   DEVCB_DRIVER_MEMBER(homerun_state,pc_w)      /* Port C write */
64   DEVCB_DRIVER_MEMBER(homerun_state, homerun_scrollx_w)   /* Port C write */
7965};
8066
8167
r17735r17736
9581   return ret;
9682}
9783
84CUSTOM_INPUT_MEMBER(homerun_state::ganjaja_hopper_status_r)
85{
86   // gives hopper error if not 0
87   return 0;
88}
89
90
9891static ADDRESS_MAP_START( homerun_iomap, AS_IO, 8, homerun_state )
9992   ADDRESS_MAP_GLOBAL_MASK(0xff)
10093   AM_RANGE(0x10, 0x10) AM_WRITENOP // D7756C sample number
r17735r17736
122115
123116static INPUT_PORTS_START( homerun )
124117   PORT_START("IN0")
125   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
126   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state,homerun_40_r, NULL)
127   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
128   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
129   PORT_DIPSETTING(   0x80, DEF_STR( On ) )
118   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN1 )
119   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_40_r, NULL)
120   PORT_BIT( 0x80, IP_ACTIVE_LOW,  IPT_UNKNOWN ) // ?
130121
131122   PORT_START("IN1")
132123   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )
r17735r17736
140131   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
141132
142133   PORT_START("DSW")
143   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_B ) )
134   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("DIPSW:1,2")
144135   PORT_DIPSETTING(   0x00, DEF_STR( 5C_1C ) )
145136   PORT_DIPSETTING(   0x01, DEF_STR( 3C_1C ) )
146137   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
147138   PORT_DIPSETTING(   0x03, DEF_STR( Free_Play ) )
148   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )
139   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DIPSW:3" )
140   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DIPSW:4" )
141   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DIPSW:5" )
142   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIPSW:6" )
143   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIPSW:7" )
144   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("DIPSW:8")
149145   PORT_DIPSETTING(   0x80, DEF_STR( 1C_1C ) )
150146   PORT_DIPSETTING(   0x00, DEF_STR( 1C_2C ) )
151147INPUT_PORTS_END
152148
153149static INPUT_PORTS_START( dynashot )
154150   PORT_START("IN0")
155   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 )
156   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state,homerun_40_r, NULL)
151   PORT_BIT( 0x08, IP_ACTIVE_LOW,  IPT_COIN1 )
152   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_40_r, NULL)
157153   PORT_BIT( 0xb7, IP_ACTIVE_HIGH, IPT_UNUSED )
158154
159155   PORT_START("IN1")
r17735r17736
167163   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_BUTTON1 )
168164
169165   PORT_START("IN2")
170   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
166   PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
171167   PORT_BIT( 0xdf, IP_ACTIVE_HIGH, IPT_UNUSED )
172168
173169   PORT_START("DSW")
174   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_B ) )
170   PORT_DIPNAME( 0x03, 0x02, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("DIPSW:1,2")
175171   PORT_DIPSETTING(   0x00, DEF_STR( 5C_1C ) )
176172   PORT_DIPSETTING(   0x01, DEF_STR( 3C_1C ) )
177173   PORT_DIPSETTING(   0x02, DEF_STR( 2C_1C ) )
178174   PORT_DIPSETTING(   0x03, DEF_STR( Free_Play ) )
179   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )
175   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DIPSW:3" ) // collisions? (not all bits)
176   PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "DIPSW:4" ) // "
177   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DIPSW:5" ) // "
178   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIPSW:6" ) // "
179   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIPSW:7" ) // "
180   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("DIPSW:8")
180181   PORT_DIPSETTING(   0x80, DEF_STR( 1C_1C ) )
181182   PORT_DIPSETTING(   0x00, DEF_STR( 1C_2C ) )
182
183   PORT_DIPNAME( 0x7c, 0x7c, "Collisions ?" ) //not all bits
184   PORT_DIPSETTING(   0x00, DEF_STR( Off ) )
185   PORT_DIPSETTING(   0x7c, DEF_STR( On ) )
186183INPUT_PORTS_END
187184
188185static INPUT_PORTS_START( ganjaja )
r17735r17736
197194   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN  ) PORT_NAME("P1 Down / Paper")
198195   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT ) PORT_NAME("P1 Right / Scissors")
199196   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT  ) // unused?
200   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) // TODO: hopper status
197   PORT_BIT( 0x30, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, ganjaja_hopper_status_r, NULL)
201198   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
202199
203200   PORT_START("IN2")
r17735r17736
206203   PORT_BIT( 0xcf, IP_ACTIVE_HIGH, IPT_UNKNOWN )
207204
208205   PORT_START("DSW")
209   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("DIPSW:1")
206   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Coin_B ) )      PORT_DIPLOCATION("DIPSW:1")
210207   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
211208   PORT_DIPSETTING(   0x01, DEF_STR( 1C_1C ) )
212   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("DIPSW:2")
209   PORT_DIPNAME( 0x02, 0x02, DEF_STR( Coin_A ) )      PORT_DIPLOCATION("DIPSW:2")
213210   PORT_DIPSETTING(   0x00, DEF_STR( 2C_1C ) )
214211   PORT_DIPSETTING(   0x02, DEF_STR( 1C_1C ) )
215212   PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "DIPSW:3" )
r17735r17736
217214   PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "DIPSW:5" )
218215   PORT_DIPUNKNOWN_DIPLOC( 0x20, 0x20, "DIPSW:6" ) // chance to win?
219216   PORT_DIPUNKNOWN_DIPLOC( 0x40, 0x40, "DIPSW:7" ) // "
220   PORT_DIPNAME( 0x80, 0x80, "Game" ) PORT_DIPLOCATION("DIPSW:8")
217   PORT_DIPNAME( 0x80, 0x80, "Game" )               PORT_DIPLOCATION("DIPSW:8")
221218   PORT_DIPSETTING(   0x80, "Saisho wa Goo" )
222219   PORT_DIPSETTING(   0x00, "Hop Step & Jump" )
223220INPUT_PORTS_END
r17735r17736
264261   state->save_item(NAME(state->m_gfx_ctrl));
265262   state->save_item(NAME(state->m_gc_up));
266263   state->save_item(NAME(state->m_gc_down));
267   state->save_item(NAME(state->m_xpa));
268   state->save_item(NAME(state->m_xpb));
269   state->save_item(NAME(state->m_xpc));
264   state->save_item(NAME(state->m_scrolly));
265   state->save_item(NAME(state->m_scrollx));
270266}
271267
272268static MACHINE_RESET( homerun )
r17735r17736
276272   state->m_gfx_ctrl = 0;
277273   state->m_gc_up = 0;
278274   state->m_gc_down = 0;
279   state->m_xpa = 0;
280   state->m_xpb = 0;
281   state->m_xpc = 0;
275   state->m_scrolly = 0;
276   state->m_scrollx = 0;
282277}
283278
284279static MACHINE_CONFIG_START( homerun, homerun_state )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team