Previous 199869 Revisions Next

r20183 Thursday 10th January, 2013 at 18:28:41 UTC by Angelo Salese
Added OKI and RTC to ggconnie [Angelo Salese]
[src/mame/drivers]ggconnie.c

trunk/src/mame/drivers/ggconnie.c
r20182r20183
2121#include "video/vdc.h"
2222#include "cpu/h6280/h6280.h"
2323#include "sound/c6280.h"
24#include "sound/okim6295.h"
2425
2526
2627class ggconnie_state : public pce_common_state
2728{
2829public:
2930   ggconnie_state(const machine_config &mconfig, device_type type, const char *tag)
30      : pce_common_state(mconfig, type, tag) { }
31      : pce_common_state(mconfig, type, tag),
32      m_oki(*this, "oki")
33      { }
3134
35   required_device <okim6295_device> m_oki;
3236   DECLARE_WRITE8_MEMBER(lamp_w);
3337   DECLARE_WRITE8_MEMBER(output_w);
38   DECLARE_READ8_MEMBER(rtc_r);
39   DECLARE_WRITE8_MEMBER(rtc_w);
40   DECLARE_WRITE8_MEMBER(oki_bank_w);
3441};
3542
3643
r20182r20183
125132   // written in "Output Test" in test mode
126133}
127134
135/* TODO: unknown type */
136READ8_MEMBER(ggconnie_state::rtc_r)
137{
138   system_time systime;
139   machine().base_datetime(systime);
140
141   switch(offset)
142   {
143      case 0x00:  return (systime.local_time.second % 10) & 0xf;
144      case 0x01:   return (systime.local_time.second / 10) & 0xf;
145      case 0x02:   return (systime.local_time.minute % 10) & 0xf;
146      case 0x03:   return (systime.local_time.minute / 10) & 0xf;
147      case 0x04:  return (systime.local_time.hour % 10) & 0xf;
148      case 0x05:   return (systime.local_time.hour / 10) & 0xf;
149      case 0x07:   return ((systime.local_time.day+1) % 10) & 0xf;
150      case 0x08:   return ((systime.local_time.day+1) / 10) & 0xf;
151      case 0x09:   return ((systime.local_time.month+1) % 10) & 0xf;
152      case 0x0a:   return ((systime.local_time.month+1) / 10) & 0xf;
153      case 0x0b:   return ((systime.local_time.year-1996) % 10) & 0xf;
154      case 0x0c:   return (((systime.local_time.year-1996) % 100) / 10) & 0xf;
155   }
156
157   return 0;
158}
159
160WRITE8_MEMBER(ggconnie_state::rtc_w)
161{
162
163}
164
165/* TODO: banking not understood (is the ROM dumped correctly btw?) */
166WRITE8_MEMBER(ggconnie_state::oki_bank_w)
167{
168   m_oki->set_bank_base((data) ? 0x40000 : 0x00000);
169}
170
171
128172static ADDRESS_MAP_START( sgx_mem , AS_PROGRAM, 8, ggconnie_state )
129173   AM_RANGE( 0x000000, 0x0fffff) AM_ROM
130174   AM_RANGE( 0x110000, 0x1edfff) AM_NOP
r20182r20183
141185   AM_RANGE( 0x1fe400, 0x1fe7ff) AM_READWRITE_LEGACY(vce_r, vce_w)
142186   AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w)
143187   AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w)
188   AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write)
189   AM_RANGE( 0x1f7400, 0x1f74ff) AM_WRITE(oki_bank_w)
190   AM_RANGE( 0x1f7500, 0x1f750f) AM_READWRITE(rtc_r,rtc_w)
144191   AM_RANGE( 0x1ff000, 0x1ff000) AM_READ_PORT("IN0") AM_WRITE(lamp_w)
145192   AM_RANGE( 0x1ff400, 0x1ff7ff) AM_DEVREADWRITE("maincpu", h6280_device, irq_status_r, irq_status_w )
146193ADDRESS_MAP_END
r20182r20183
181228   MCFG_SOUND_ROUTE(0, "lspeaker", 1.00)
182229   MCFG_SOUND_ROUTE(1, "rspeaker", 1.00)
183230
231   MCFG_OKIM6295_ADD("oki", PCE_MAIN_CLOCK/12, OKIM6295_PIN7_HIGH) /* unknown clock / pin 7 */
232   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.00)
233   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.00)
184234MACHINE_CONFIG_END
185235
186236ROM_START(ggconnie)
r20182r20183
189239   ROM_LOAD( "prg1_u4.bin", 0x80000, 0x80000, CRC(513f0b18) SHA1(44c61dc1a06bb4c8b4840ea6a372f92114888490) )
190240
191241   ROM_REGION( 0x80000, "oki", 0 )
192   ROM_LOAD( "adpcm_u31.bin", 0x0000, 0x80000, CRC(de514c2b) SHA1(da73aa825d73646f556f6d4dbb46f43acf7c3357) )
242   ROM_LOAD( "adpcm_u31.bin", 0x00000, 0x80000, CRC(de514c2b) SHA1(da73aa825d73646f556f6d4dbb46f43acf7c3357) )
193243ROM_END
194244
195245GAME( 1996, ggconnie, 0, ggconnie, ggconnie, pce_common_state, pce_common, ROT0, "Eighting", "Go! Go! Connie chan Jaka Jaka Janken", GAME_NO_SOUND | GAME_NOT_WORKING )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team