Previous 199869 Revisions Next

r20283 Tuesday 15th January, 2013 at 20:17:22 UTC by Angelo Salese
ggconnie RTC is a MSM6242
[src/mame/drivers]ggconnie.c

trunk/src/mame/drivers/ggconnie.c
r20282r20283
2424#include "cpu/h6280/h6280.h"
2525#include "sound/c6280.h"
2626#include "sound/okim6295.h"
27#include "machine/msm6242.h"
2728
2829
2930class ggconnie_state : public pce_common_state
r20282r20283
3233   ggconnie_state(const machine_config &mconfig, device_type type, const char *tag)
3334      : pce_common_state(mconfig, type, tag),
3435      m_huc6260(*this, "huc6260"),
36      m_rtc(*this, "rtc"),
3537      m_oki(*this, "oki")
3638      { }
3739
3840   required_device <huc6260_device> m_huc6260;
41   required_device <msm6242_device> m_rtc;
3942   required_device <okim6295_device> m_oki;
4043   DECLARE_WRITE8_MEMBER(lamp_w);
4144   DECLARE_WRITE8_MEMBER(output_w);
r20282r20283
4750   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4851};
4952
53UINT32 ggconnie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
54{
55   m_huc6260->video_update( bitmap, cliprect );
56   return 0;
57}
5058
59WRITE8_MEMBER(ggconnie_state::lamp_w)
60{
61   output_set_value("lamp", !BIT(data,0));
62}
63
64WRITE8_MEMBER(ggconnie_state::output_w)
65{
66   // written in "Output Test" in test mode
67}
68
69/* TODO: banking not understood (is the ROM dumped correctly btw?) */
70WRITE8_MEMBER(ggconnie_state::oki_bank_w)
71{
72   m_oki->set_bank_base((data) ? 0x40000 : 0x00000);
73}
74
75
76static ADDRESS_MAP_START( sgx_mem , AS_PROGRAM, 8, ggconnie_state )
77   AM_RANGE( 0x000000, 0x0fffff) AM_ROM
78   AM_RANGE( 0x110000, 0x1edfff) AM_NOP
79   AM_RANGE( 0x1ee800, 0x1effff) AM_NOP
80   AM_RANGE( 0x1f0000, 0x1f5fff) AM_RAM
81   AM_RANGE( 0x1f7000, 0x1f7000) AM_READ_PORT("SWA")
82   AM_RANGE( 0x1f7100, 0x1f7100) AM_READ_PORT("SWB")
83   AM_RANGE( 0x1f7200, 0x1f7200) AM_READ_PORT("SWC")
84   AM_RANGE( 0x1f7700, 0x1f7700) AM_READ_PORT("IN1")
85   AM_RANGE( 0x1f7800, 0x1f7800) AM_WRITE(output_w)
86   AM_RANGE( 0x1fe000, 0x1fe007) AM_DEVREADWRITE( "huc6270_0", huc6270_device, read, write ) AM_MIRROR(0x03E0)
87   AM_RANGE( 0x1fe008, 0x1fe00f) AM_DEVREADWRITE( "huc6202", huc6202_device, read, write ) AM_MIRROR(0x03E0)
88   AM_RANGE( 0x1fe010, 0x1fe017) AM_DEVREADWRITE( "huc6270_1", huc6270_device, read, write ) AM_MIRROR(0x03E0)
89   AM_RANGE( 0x1fe400, 0x1fe7ff) AM_DEVREADWRITE( "huc6260", huc6260_device, read, write )
90   AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w)
91   AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w)
92   AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write)
93   AM_RANGE( 0x1f7400, 0x1f74ff) AM_WRITE(oki_bank_w)
94   AM_RANGE( 0x1f7500, 0x1f750f) AM_DEVREADWRITE("rtc", msm6242_device, read, write)
95   AM_RANGE( 0x1ff000, 0x1ff000) AM_READ_PORT("IN0") AM_WRITE(lamp_w)
96   AM_RANGE( 0x1ff400, 0x1ff7ff) AM_DEVREADWRITE("maincpu", h6280_device, irq_status_r, irq_status_w )
97ADDRESS_MAP_END
98
99static ADDRESS_MAP_START( sgx_io , AS_IO, 8, ggconnie_state )
100   AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6202", huc6202_device, io_read, io_write )
101ADDRESS_MAP_END
102
103
51104static INPUT_PORTS_START(ggconnie)
52105   PORT_START("IN0")
53106   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME( "Medal" )
r20282r20283
125178   PORT_DIPNAME(0x40, 0x00, "RAM Clear" )  PORT_DIPLOCATION("SWC:7")
126179   PORT_DIPSETTING(0x40, DEF_STR(Off) )
127180   PORT_DIPSETTING(0x00, DEF_STR(On) )
128   PORT_SERVICE(0x80, IP_ACTIVE_LOW)  PORT_DIPLOCATION("SWC:8")
129
181   PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_LOW)  PORT_DIPLOCATION("SWC:8")
130182INPUT_PORTS_END
131183
132WRITE8_MEMBER(ggconnie_state::lamp_w)
133{
134   output_set_value("lamp", !BIT(data,0));
135}
136
137WRITE8_MEMBER(ggconnie_state::output_w)
138{
139   // written in "Output Test" in test mode
140}
141
142/* TODO: unknown type */
143READ8_MEMBER(ggconnie_state::rtc_r)
144{
145   system_time systime;
146   machine().base_datetime(systime);
147
148   switch(offset)
149   {
150      case 0x00:  return (systime.local_time.second % 10) & 0xf;
151      case 0x01:  return (systime.local_time.second / 10) & 0xf;
152      case 0x02:  return (systime.local_time.minute % 10) & 0xf;
153      case 0x03:  return (systime.local_time.minute / 10) & 0xf;
154      case 0x04:  return (systime.local_time.hour % 10) & 0xf;
155      case 0x05:  return (systime.local_time.hour / 10) & 0xf;
156      case 0x07:  return ((systime.local_time.day+1) % 10) & 0xf;
157      case 0x08:  return ((systime.local_time.day+1) / 10) & 0xf;
158      case 0x09:  return ((systime.local_time.month+1) % 10) & 0xf;
159      case 0x0a:  return ((systime.local_time.month+1) / 10) & 0xf;
160      case 0x0b:  return ((systime.local_time.year-1996) % 10) & 0xf;
161      case 0x0c:  return (((systime.local_time.year-1996) % 100) / 10) & 0xf;
162   }
163
164   return 0;
165}
166
167WRITE8_MEMBER(ggconnie_state::rtc_w)
168{
169}
170
171/* TODO: banking not understood (is the ROM dumped correctly btw?) */
172WRITE8_MEMBER(ggconnie_state::oki_bank_w)
173{
174   m_oki->set_bank_base((data) ? 0x40000 : 0x00000);
175}
176
177
178static ADDRESS_MAP_START( sgx_mem , AS_PROGRAM, 8, ggconnie_state )
179   AM_RANGE( 0x000000, 0x0fffff) AM_ROM
180   AM_RANGE( 0x110000, 0x1edfff) AM_NOP
181   AM_RANGE( 0x1ee800, 0x1effff) AM_NOP
182   AM_RANGE( 0x1f0000, 0x1f5fff) AM_RAM
183   AM_RANGE( 0x1f7000, 0x1f7000) AM_READ_PORT("SWA")
184   AM_RANGE( 0x1f7100, 0x1f7100) AM_READ_PORT("SWB")
185   AM_RANGE( 0x1f7200, 0x1f7200) AM_READ_PORT("SWC")
186   AM_RANGE( 0x1f7700, 0x1f7700) AM_READ_PORT("IN1")
187   AM_RANGE( 0x1f7800, 0x1f7800) AM_WRITE(output_w)
188   AM_RANGE( 0x1fe000, 0x1fe007) AM_DEVREADWRITE( "huc6270_0", huc6270_device, read, write ) AM_MIRROR(0x03E0)
189   AM_RANGE( 0x1fe008, 0x1fe00f) AM_DEVREADWRITE( "huc6202", huc6202_device, read, write ) AM_MIRROR(0x03E0)
190   AM_RANGE( 0x1fe010, 0x1fe017) AM_DEVREADWRITE( "huc6270_1", huc6270_device, read, write ) AM_MIRROR(0x03E0)
191   AM_RANGE( 0x1fe400, 0x1fe7ff) AM_DEVREADWRITE( "huc6260", huc6260_device, read, write )
192   AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w)
193   AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w)
194   AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write)
195   AM_RANGE( 0x1f7400, 0x1f74ff) AM_WRITE(oki_bank_w)
196   AM_RANGE( 0x1f7500, 0x1f750f) AM_READWRITE(rtc_r,rtc_w)
197   AM_RANGE( 0x1ff000, 0x1ff000) AM_READ_PORT("IN0") AM_WRITE(lamp_w)
198   AM_RANGE( 0x1ff400, 0x1ff7ff) AM_DEVREADWRITE("maincpu", h6280_device, irq_status_r, irq_status_w )
199ADDRESS_MAP_END
200
201static ADDRESS_MAP_START( sgx_io , AS_IO, 8, ggconnie_state )
202   AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6202", huc6202_device, io_read, io_write )
203ADDRESS_MAP_END
204
205184static const c6280_interface c6280_config =
206185{
207186   "maincpu"
208187};
209188
210UINT32 ggconnie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
211{
212   m_huc6260->video_update( bitmap, cliprect );
213   return 0;
214}
215
216
217189WRITE_LINE_MEMBER(ggconnie_state::pce_irq_changed)
218190{
219191   machine().device("maincpu")->execute().set_input_line(0, state);
r20282r20283
277249   DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, hsync_changed )
278250};
279251
252static MSM6242_INTERFACE( ggconnie_rtc_intf )
253{
254   DEVCB_NULL
255};
280256
257
281258static MACHINE_CONFIG_START( ggconnie, ggconnie_state )
282259   /* basic machine hardware */
283260   MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
284261   MCFG_CPU_PROGRAM_MAP(sgx_mem)
285262   MCFG_CPU_IO_MAP(sgx_io)
286263
287//  MCFG_QUANTUM_TIME(attotime::from_hz(60))
288
289264   /* video hardware */
290265   MCFG_SCREEN_ADD("screen", RASTER)
291266   MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/3, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242)
r20282r20283
299274   MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config )
300275   MCFG_HUC6202_ADD( "huc6202", sgx_huc6202_config )
301276
277   MCFG_MSM6242_ADD("rtc", ggconnie_rtc_intf)
278
302279   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
303280   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)
304281   MCFG_SOUND_CONFIG(c6280_config)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team