Previous 199869 Revisions Next

r33391 Saturday 15th November, 2014 at 14:42:37 UTC by Angelo Salese
Added f/f mechanism for irq, game works (lol?), added information about a very crude protection mechanism.
[src/mame/drivers]alinvade.c

trunk/src/mame/drivers/alinvade.c
r241902r241903
44 
55 does it use any off-the shelf chips in addition to the 6502?
66
7
7 TODO:
8 - 16 bytes are protected in the c*** range. I'm guessing they used a PROM to protect a
9 simple sub-routine because just after that the program has a left-over located at 0xe000-0xe00f (yup, NOPs + a RTS)
10 It's unknown at current stage what it really protects tho ...
11 
812*/
913
1014#include "emu.h"
r241902r241903
2024   { }
2125   
2226   UINT8 irqmask;
27   UINT8 irqff;
28   DECLARE_READ8_MEMBER(irqmask_r);
2329   DECLARE_WRITE8_MEMBER(irqmask_w);
2430   INTERRUPT_GEN_MEMBER(vblank_irq);
2531   required_device<cpu_device> m_maincpu;
r241902r241903
3137   UINT32 screen_update_alinvade(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3238};
3339
40READ8_MEMBER(alinvade_state::irqmask_r)
41{
42   return 0; // TODO: might be anything
43}
44
45
3446WRITE8_MEMBER(alinvade_state::irqmask_w)
3547{
36      irqmask = data;
48   if((!(irqff & 1)) && (data & 1)) // f/f, active high? If the above actually returns 0xff this could be active low ...
49      irqmask^= 1;
50     
51   irqff = data;
3752}
3853
3954static ADDRESS_MAP_START( alinvade_map, AS_PROGRAM, 8, alinvade_state )
r241902r241903
4964    AM_RANGE(0x8003, 0x8003) AM_READ_PORT("IN3")
5065    AM_RANGE(0x8004, 0x8004) AM_READ_PORT("IN4")
5166    AM_RANGE(0xa000, 0xa000) AM_WRITENOP //??
52    AM_RANGE(0xc400, 0xc7ff) AM_ROM
53    AM_RANGE(0xc800, 0xcbff) AM_ROM
67    AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0xff0) AM_ROM AM_REGION("proms",0)
5468    AM_RANGE(0xe000, 0xe3ff) AM_ROM
55    AM_RANGE(0xe400, 0xe400) AM_WRITE(irqmask_w) //??
56    AM_RANGE(0xe800, 0xe800) AM_READNOP AM_WRITENOP //??
69    AM_RANGE(0xe400, 0xe400) AM_WRITENOP //??
70    AM_RANGE(0xe800, 0xe800) AM_READWRITE(irqmask_r,irqmask_w) //??
5771    AM_RANGE(0xec00, 0xffff) AM_ROM
5872ADDRESS_MAP_END
5973
r241902r241903
102116
103117void alinvade_state::machine_reset()
104118{
119   irqmask = 1;
105120}
106121
107122UINT32 alinvade_state::screen_update_alinvade(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
r241902r241903
136151      m_maincpu->set_input_line(0,HOLD_LINE);
137152}
138153
139
140
141
142154static MACHINE_CONFIG_START( alinvade, alinvade_state )
143155
144156   /* basic machine hardware */
r241902r241903
154166   MCFG_SCREEN_VISIBLE_AREA(0, 128-1, 0, 128-1)
155167   MCFG_SCREEN_UPDATE_DRIVER(alinvade_state, screen_update_alinvade)
156168
169   // TODO: MCFG_DEFAULT_LAYOUT for square pixels
170   
157171   /* sound hardware */
158172   MCFG_SPEAKER_STANDARD_MONO("mono")
159173MACHINE_CONFIG_END
r241902r241903
162176
163177ROM_START( alinvade )
164178   ROM_REGION( 0x10000, "maincpu", 0 ) // todo, check mapping
165
166   ROM_FILL( 0xc400, 0x800, 0x60 )    // rts for whole area, interrupt code jumps to various addresses here
167
168179    ROM_LOAD( "alien28.708", 0xe000, 0x0400, CRC(de376295) SHA1(e8eddbb1be1f8661c6b5b39c0d78a65bded65db2) )
169180    ROM_LOAD( "alien29.708", 0xec00, 0x0400, CRC(20212977) SHA1(9d24a6b403d968267079fa6241545bd5a01afebb) )
170181    ROM_LOAD( "alien30.708", 0xf000, 0x0400, CRC(734b691c) SHA1(9e562159061eecf4b1dee4ea0ee4752c901a54aa) )
171182    ROM_LOAD( "alien31.708", 0xf400, 0x0400, CRC(5a70535c) SHA1(2827e7d4bffca78bd035da04481e1e972ee2da39) )
172183    ROM_LOAD( "alien32.708", 0xf800, 0x0400, CRC(332dd234) SHA1(9974668344a2a351868a9e7757d1c3a497dc5621) )
173184    ROM_LOAD( "alien33.708", 0xfc00, 0x0400, CRC(e0d57fc7) SHA1(7b8ddcb4a86811592d2d0bbc61b2f19e5caa9ccc) )
185
186   ROM_REGION( 0x20, "proms", 0 )
187   ROM_LOAD( "prom", 0, 0x20, NO_DUMP )
188   ROM_FILL( 0x00, 0x0f, 0xea )   
189   ROM_FILL( 0x0f, 0x01, 0x60 )    // rts for whole area, interrupt code jumps to various addresses here, check note on top.   
174190ROM_END
175191
176192
177GAME( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_NOT_WORKING )
193GAME( 198?, alinvade,  0,    alinvade, alinvade, driver_device,  0, ROT90, "Forbes?", "Alien Invaders", GAME_UNEMULATED_PROTECTION )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team