Previous 199869 Revisions Next

r17535 Tuesday 28th August, 2012 at 14:11:34 UTC by hap
cleanup
[src/mame/drivers]btime.c scregg.c
[src/mame/includes]btime.h

trunk/src/mame/includes/btime.h
r17534r17535
1/***************************************************************************
12
3    Burger Time hardware
4
5***************************************************************************/
6
27class btime_state : public driver_device
38{
49public:
510   btime_state(const machine_config &mconfig, device_type type, const char *tag)
6      : driver_device(mconfig, type, tag) ,
11      : driver_device(mconfig, type, tag),
712      m_rambase(*this, "rambase"),
813      m_videoram(*this, "videoram"),
914      m_colorram(*this, "colorram"),
r17534r17535
1217      m_lnc_charbank(*this, "lnc_charbank"),
1318      m_deco_charram(*this, "deco_charram"),
1419      m_spriteram(*this, "spriteram"),
15      m_audio_rambase(*this, "audio_rambase"){ }
20      m_audio_rambase(*this, "audio_rambase")
21   { }
1622
1723   /* memory pointers */
1824   optional_shared_ptr<UINT8> m_rambase;
r17534r17535
4854   /* devices */
4955   device_t *m_maincpu;
5056   device_t *m_audiocpu;
57
5158   DECLARE_WRITE8_MEMBER(audio_nmi_enable_w);
5259   DECLARE_WRITE8_MEMBER(lnc_w);
5360   DECLARE_WRITE8_MEMBER(mmonkey_w);
r17534r17535
8087   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted_irq_lo);
8188   DECLARE_INPUT_CHANGED_MEMBER(coin_inserted_nmi_lo);
8289   DECLARE_WRITE8_MEMBER(ay_audio_nmi_enable_w);
90
8391   DECLARE_DRIVER_INIT(btime);
8492   DECLARE_DRIVER_INIT(tisland);
8593   DECLARE_DRIVER_INIT(cookrace);
r17534r17535
9098   DECLARE_DRIVER_INIT(protennb);
9199   DECLARE_DRIVER_INIT(disco);
92100   DECLARE_DRIVER_INIT(lnc);
93   DECLARE_DRIVER_INIT(rockduck);
94101};
95102
96103
r17534r17535
114121SCREEN_UPDATE_IND16( disco );
115122SCREEN_UPDATE_IND16( eggs );
116123
117
trunk/src/mame/drivers/btime.c
r17534r17535
159159
160160
161161
162static UINT8 *decrypted; // TODO: put me in btime class
162163
163
164
165static UINT8 *decrypted;
166
167164WRITE8_MEMBER(btime_state::audio_nmi_enable_w)
168165{
169
170166   /* for most games, this serves as the NMI enable for the audio CPU; however,
171167       lnc and disco use bit 0 of the first AY-8910's port A instead; many other
172168       games also write there in addition to this address */
r17534r17535
179175
180176WRITE8_MEMBER(btime_state::ay_audio_nmi_enable_w)
181177{
182
183178   /* port A bit 0, when 1, inhibits the NMI */
184179   if (m_audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
185180   {
r17534r17535
210205   UINT8 *src, *src1;
211206   int addr, addr1;
212207
213
214208   /* the encryption is a simple bit rotation: 76543210 -> 65342710, but */
215209   /* with a catch: it is only applied if the previous instruction did a */
216210   /* memory write. Also, only opcodes at addresses with this bit pattern: */
r17534r17535
237231
238232WRITE8_MEMBER(btime_state::lnc_w)
239233{
240
241234   if      (offset <= 0x3bff)                       ;
242235   else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
243236   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; }
r17534r17535
257250
258251WRITE8_MEMBER(btime_state::mmonkey_w)
259252{
260
261253   if      (offset <= 0x3bff)                       ;
262254   else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
263255   else if (offset >= 0x7c00 && offset <= 0x7fff) { lnc_mirrorvideoram_w(space, offset - 0x7c00, data); return; }
r17534r17535
276268
277269WRITE8_MEMBER(btime_state::btime_w)
278270{
279
280271   if      (offset <= 0x07ff)                     ;
281272   else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
282273   else if (offset >= 0x1000 && offset <= 0x17ff) ;
r17534r17535
294285
295286WRITE8_MEMBER(btime_state::tisland_w)
296287{
297
298288   if      (offset <= 0x07ff)                     ;
299289   else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
300290   else if (offset >= 0x1000 && offset <= 0x17ff) ;
r17534r17535
314304
315305WRITE8_MEMBER(btime_state::zoar_w)
316306{
317
318307   if      (offset <= 0x07ff)                  ;
319308   else if (offset >= 0x8000 && offset <= 0x87ff) ;
320309   else if (offset >= 0x8800 && offset <= 0x8bff) btime_mirrorvideoram_w(space, offset - 0x8800, data);
r17534r17535
333322
334323WRITE8_MEMBER(btime_state::disco_w)
335324{
336
337325   if      (offset <= 0x04ff)                     ;
338326   else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data);
339327   else if (offset >= 0x8000 && offset <= 0x881f) ;
r17534r17535
517505
518506INPUT_CHANGED_MEMBER(btime_state::coin_inserted_irq_hi)
519507{
520
521508   if (newval)
522509      device_set_input_line(m_maincpu, 0, HOLD_LINE);
523510}
524511
525512INPUT_CHANGED_MEMBER(btime_state::coin_inserted_irq_lo)
526513{
527
528514   if (!newval)
529515      device_set_input_line(m_maincpu, 0, HOLD_LINE);
530516}
trunk/src/mame/drivers/scregg.c
r17534r17535
77driver by Nicola Salmoria
88
99To Do:
10Sprite Priorities in Dommy
10- Sprite Priorities in dommy
11- Where is IRQ ack in dommy?
1112
1213
1314Rock Duck
r17534r17535
5455#include "sound/ay8910.h"
5556#include "includes/btime.h"
5657
58class scregg_state : public btime_state
59{
60public:
61   scregg_state(const machine_config &mconfig, device_type type, const char *tag)
62      : btime_state(mconfig, type, tag) { }
5763
64   DECLARE_WRITE8_MEMBER(dommy_coincounter_w);
65
66   DECLARE_DRIVER_INIT(rockduck);
67};
68
69
70
5871static TIMER_DEVICE_CALLBACK( scregg_interrupt )
5972{
60   btime_state *state = timer.machine().driver_data<btime_state>();
73   scregg_state *state = timer.machine().driver_data<scregg_state>();
6174   device_set_input_line(state->m_maincpu, 0, (param & 8) ? HOLD_LINE : CLEAR_LINE);
6275}
6376
64static WRITE8_HANDLER( dommy_coincounter_w )
77WRITE8_MEMBER(scregg_state::dommy_coincounter_w)
6578{
66   coin_counter_w(space->machine(), 0, data & 0x40);
67   coin_counter_w(space->machine(), 1, data & 0x80);
79   coin_counter_w(machine(), 0, data & 0x40);
80   coin_counter_w(machine(), 1, data & 0x80);
6881}
6982
7083
71static ADDRESS_MAP_START( dommy_map, AS_PROGRAM, 8, btime_state )
84static ADDRESS_MAP_START( dommy_map, AS_PROGRAM, 8, scregg_state )
7285   AM_RANGE(0x0000, 0x07ff) AM_RAM
7386   AM_RANGE(0x2000, 0x23ff) AM_RAM AM_SHARE("videoram")
7487   AM_RANGE(0x2400, 0x27ff) AM_RAM AM_SHARE("colorram")
7588   AM_RANGE(0x2800, 0x2bff) AM_READWRITE(btime_mirrorvideoram_r, btime_mirrorvideoram_w)
76   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") AM_WRITE_LEGACY(dommy_coincounter_w)
89   AM_RANGE(0x4000, 0x4000) AM_READ_PORT("DSW1") AM_WRITE(dommy_coincounter_w)
7790   AM_RANGE(0x4001, 0x4001) AM_READ_PORT("DSW2") AM_WRITE(btime_video_control_w)
7891/*  AM_RANGE(0x4004, 0x4004)  */ /* this is read */
7992   AM_RANGE(0x4002, 0x4002) AM_READ_PORT("P1")
r17534r17535
8497ADDRESS_MAP_END
8598
8699
87static ADDRESS_MAP_START( eggs_map, AS_PROGRAM, 8, btime_state )
100static ADDRESS_MAP_START( eggs_map, AS_PROGRAM, 8, scregg_state )
88101   AM_RANGE(0x0000, 0x07ff) AM_RAM
89102   AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("videoram")
90103   AM_RANGE(0x1400, 0x17ff) AM_RAM AM_SHARE("colorram")
r17534r17535
215228
216229static MACHINE_START( scregg )
217230{
218   btime_state *state = machine.driver_data<btime_state>();
231   scregg_state *state = machine.driver_data<scregg_state>();
219232
220233   state->m_maincpu = machine.device("maincpu");
221234   state->m_audiocpu = NULL;
r17534r17535
228241
229242static MACHINE_RESET( scregg )
230243{
231   btime_state *state = machine.driver_data<btime_state>();
244   scregg_state *state = machine.driver_data<scregg_state>();
232245
233246   state->m_btime_palette = 0;
234247   state->m_bnj_scroll1 = 0;
r17534r17535
239252   state->m_btime_tilemap[3] = 0;
240253}
241254
242static MACHINE_CONFIG_START( dommy, btime_state )
255static MACHINE_CONFIG_START( dommy, scregg_state )
243256
244257   /* basic machine hardware */
245258   MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8)
r17534r17535
271284MACHINE_CONFIG_END
272285
273286
274static MACHINE_CONFIG_START( scregg, btime_state )
287static MACHINE_CONFIG_START( scregg, scregg_state )
275288
276289   /* basic machine hardware */
277290   MCFG_CPU_ADD("maincpu", M6502, XTAL_12MHz/8)
r17534r17535
392405ROM_END
393406
394407
395DRIVER_INIT_MEMBER(btime_state,rockduck)
408DRIVER_INIT_MEMBER(scregg_state,rockduck)
396409{
397410   // rd2.rdh and rd1.rdj are bitswapped, but not rd3.rdg .. are they really from the same board?
398411   int x;
r17534r17535
406419}
407420
408421
409GAME( 1983, dommy,    0,        dommy,  scregg, driver_device, 0, ROT270, "Technos Japan", "Dommy", GAME_SUPPORTS_SAVE )
410GAME( 1983, scregg,   0,        scregg, scregg, driver_device, 0, ROT270, "Technos Japan", "Scrambled Egg", GAME_SUPPORTS_SAVE )
411GAME( 1983, eggs,     scregg,   scregg, scregg, driver_device, 0, ROT270, "Technos Japan / Universal USA", "Eggs", GAME_SUPPORTS_SAVE )
412GAME( 1983, rockduck, 0,        scregg, rockduck, btime_state, rockduck, ROT270, "Datel SAS", "Rock Duck (prototype?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )
422GAME( 1983, dommy,    0,        dommy,  scregg,   driver_device, 0,        ROT270, "Technos Japan", "Dommy", GAME_SUPPORTS_SAVE )
423GAME( 1983, scregg,   0,        scregg, scregg,   driver_device, 0,        ROT270, "Technos Japan", "Scrambled Egg", GAME_SUPPORTS_SAVE )
424GAME( 1983, eggs,     scregg,   scregg, scregg,   driver_device, 0,        ROT270, "Technos Japan (Universal USA license)", "Eggs (USA)", GAME_SUPPORTS_SAVE )
425GAME( 1983, rockduck, 0,        scregg, rockduck, scregg_state,  rockduck, ROT270, "Datel SAS", "Rock Duck (prototype?)", GAME_WRONG_COLORS | GAME_SUPPORTS_SAVE )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team