Previous 199869 Revisions Next

r17586 Sunday 2nd September, 2012 at 10:36:56 UTC by hap
panicr update, trying to understand bg collision
[src/mame/drivers]panicr.c

trunk/src/mame/drivers/panicr.c
r17585r17586
33----------
44
55TODO:
6- there are 3 more bitplanes of tile graphics, but colors are correct as they are...
7  what are they, priority info? Should they be mapped at 8000-bfff in memory?
8- problems with bg tilemaps reading (USER3 region)
6- problems with bg collision
7- high priority tiles
98
109--
1110
r17585r17586
6968{
7069public:
7170   panicr_state(const machine_config &mconfig, device_type type, const char *tag)
72      : driver_device(mconfig, type, tag) ,
71      : driver_device(mconfig, type, tag),
7372      m_mainram(*this, "mainram"),
7473      m_spriteram(*this, "spriteram"),
75      m_videoram(*this, "videoram"),
76      m_scrollram(*this, "scrollram")
74      m_textram(*this, "textram"),
75      m_spritebank(*this, "spritebank")
7776   { }
7877
7978   required_shared_ptr<UINT8> m_mainram;
8079   required_shared_ptr<UINT8> m_spriteram;
81   required_shared_ptr<UINT8> m_videoram;
82   required_shared_ptr<UINT8> m_scrollram;
80   required_shared_ptr<UINT8> m_textram;
81   required_shared_ptr<UINT8> m_spritebank;
82
8383   tilemap_t *m_bgtilemap;
84   tilemap_t *m_infotilemap;
8485   tilemap_t *m_txttilemap;
86   int m_scrollx;
87
88   DECLARE_READ8_MEMBER(panicr_collision_r);
89   DECLARE_WRITE8_MEMBER(panicr_scrollx_lo_w);
90   DECLARE_WRITE8_MEMBER(panicr_scrollx_hi_w);
91   DECLARE_WRITE8_MEMBER(panicr_output_w);
8592   DECLARE_READ8_MEMBER(t5182shared_r);
8693   DECLARE_WRITE8_MEMBER(t5182shared_w);
94
8795   DECLARE_DRIVER_INIT(panicr);
8896};
8997
r17585r17586
93101#define TC15_CLOCK      XTAL_12MHz
94102
95103
104/***************************************************************************
105
106  Video
107
108***************************************************************************/
109
96110static PALETTE_INIT( panicr )
97111{
98112   const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
r17585r17586
149163   }
150164}
151165
166
152167static TILE_GET_INFO( get_bgtile_info )
153168{
154169   int code,attr;
r17585r17586
163178        0);
164179}
165180
181static TILE_GET_INFO( get_infotile_info )
182{
183   int code,attr;
184
185   code=machine.root_device().memregion("user1")->base()[tile_index];
186   attr=machine.root_device().memregion("user2")->base()[tile_index];
187   code+=((attr&7)<<8);
188   SET_TILE_INFO(
189      2,
190        code,
191      (attr & 0xf0) >> 4,
192        0);
193}
194
166195static TILE_GET_INFO( get_txttile_info )
167196{
168197   panicr_state *state = machine.driver_data<panicr_state>();
169   UINT8 *videoram = state->m_videoram;
170   int code=videoram[tile_index*4];
171   int attr=videoram[tile_index*4+2];
198   int code=state->m_textram[tile_index*4];
199   int attr=state->m_textram[tile_index*4+2];
172200   int color = attr & 0x07;
173201
174202   tileinfo.group = color;
r17585r17586
180208      0);
181209}
182210
183READ8_MEMBER(panicr_state::t5182shared_r)
184{
185   if ((offset & 1) == 0)
186      return t5182_sharedram_r(&space, offset/2);
187   else
188      return 0;
189}
190211
191WRITE8_MEMBER(panicr_state::t5182shared_w)
192{
193   if ((offset & 1) == 0)
194      t5182_sharedram_w(&space, offset/2, data);
195}
196
197
198static ADDRESS_MAP_START( panicr_map, AS_PROGRAM, 8, panicr_state )
199   AM_RANGE(0x00000, 0x01fff) AM_RAM AM_SHARE("mainram")
200   AM_RANGE(0x02000, 0x02fff) AM_RAM AM_SHARE("spriteram")
201   AM_RANGE(0x03000, 0x03fff) AM_RAM
202   AM_RANGE(0x08000, 0x0bfff) AM_RAM AM_REGION("user3", 0) //attribue map ?
203   AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_SHARE("videoram")
204   AM_RANGE(0x0d000, 0x0d000) AM_WRITE_LEGACY(t5182_sound_irq_w)
205   AM_RANGE(0x0d002, 0x0d002) AM_READ_LEGACY(t5182_sharedram_semaphore_snd_r)
206   AM_RANGE(0x0d004, 0x0d004) AM_WRITE_LEGACY(t5182_sharedram_semaphore_main_acquire_w)
207   AM_RANGE(0x0d006, 0x0d006) AM_WRITE_LEGACY(t5182_sharedram_semaphore_main_release_w)
208   AM_RANGE(0x0d200, 0x0d2ff) AM_READWRITE(t5182shared_r, t5182shared_w)
209   AM_RANGE(0x0d400, 0x0d400) AM_READ_PORT("P1")
210   AM_RANGE(0x0d402, 0x0d402) AM_READ_PORT("P2")
211   AM_RANGE(0x0d404, 0x0d404) AM_READ_PORT("START")
212   AM_RANGE(0x0d406, 0x0d406) AM_READ_PORT("DSW1")
213   AM_RANGE(0x0d407, 0x0d407) AM_READ_PORT("DSW2")
214   AM_RANGE(0x0d800, 0x0d81f) AM_RAM AM_SHARE("scrollram")
215   AM_RANGE(0xf0000, 0xfffff) AM_ROM
216ADDRESS_MAP_END
217
218212static VIDEO_START( panicr )
219213{
220214   panicr_state *state = machine.driver_data<panicr_state>();
215
221216   state->m_bgtilemap = tilemap_create( machine, get_bgtile_info,tilemap_scan_rows,16,16,1024,16 );
217   state->m_infotilemap = tilemap_create( machine, get_infotile_info,tilemap_scan_rows,16,16,1024,16 ); // 3 more bitplanes, contains collision and priority data
222218
223219   state->m_txttilemap = tilemap_create( machine, get_txttile_info,tilemap_scan_rows,8,8,32,32 );
224220   colortable_configure_tilemap_groups(machine.colortable, state->m_txttilemap, machine.gfx[0], 0);
r17585r17586
239235      if (spriteram[offs+1] & 0x40) x -= 0x100;
240236
241237      color = spriteram[offs+1] & 0x0f;
242      sprite = spriteram[offs+0]+(state->m_scrollram[0x0c]<<8);
238      sprite = spriteram[offs+0] | (*state->m_spritebank << 8);
243239
244      drawgfx_transmask(bitmap,cliprect,machine.gfx[2],
240      drawgfx_transmask(bitmap,cliprect,machine.gfx[3],
245241            sprite,
246242            color,flipx,flipy,x,y,
247            colortable_get_transpen_mask(machine.colortable, machine.gfx[2], color, 0));
243            colortable_get_transpen_mask(machine.colortable, machine.gfx[3], color, 0));
248244   }
249245}
250246
r17585r17586
252248{
253249   panicr_state *state = screen.machine().driver_data<panicr_state>();
254250   bitmap.fill(get_black_pen(screen.machine()), cliprect);
255   state->m_txttilemap ->mark_all_dirty();
256   state->m_bgtilemap->set_scrollx(0, ((state->m_scrollram[0x02]&0x0f)<<12)+((state->m_scrollram[0x02]&0xf0)<<4)+((state->m_scrollram[0x04]&0x7f)<<1)+((state->m_scrollram[0x04]&0x80)>>7) );
251   state->m_txttilemap->mark_all_dirty();
252   state->m_bgtilemap->set_scrollx(0, state->m_scrollx);
257253   state->m_bgtilemap->draw(bitmap, cliprect, 0,0);
258254   draw_sprites(screen.machine(),bitmap,cliprect);
259255   state->m_txttilemap->draw(bitmap, cliprect, 0,0);
r17585r17586
261257   return 0;
262258}
263259
264static TIMER_DEVICE_CALLBACK( panicr_scanline )
260
261/***************************************************************************
262
263  I/O
264
265***************************************************************************/
266
267READ8_MEMBER(panicr_state::panicr_collision_r)
265268{
266   int scanline = param;
269   // 0x40 bytes per line, 2 bits per x
270   // implementation is still wrong though :(
271   const bitmap_ind16 &src_bitmap = m_infotilemap->pixmap();
272   int width_mask = src_bitmap.width() - 1;
273   int height_mask = src_bitmap.height() - 1;
274   int y = offset >> 6;
275   int x = (offset & 0x3f) * 4;
276   UINT8 data = 0;
267277
268   if(scanline == 240) // vblank-out irq
269      cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xc4/4);
278   for (int i = 0; i < 4; i++)
279   {
280      int p = src_bitmap.pix16(y & height_mask, (i + x + m_scrollx) & width_mask);
281      data <<= 2;
282      data |= p&3;
283   }
270284
271   if(scanline == 0) // <unknown>
272      cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xc8/4);
285   return data;
273286}
274287
288
289
290WRITE8_MEMBER(panicr_state::panicr_scrollx_lo_w)
291{
292   m_scrollx = (m_scrollx & 0xff00) | (data << 1 & 0xfe) | (data >> 7 & 0x01);
293}
294
295WRITE8_MEMBER(panicr_state::panicr_scrollx_hi_w)
296{
297   m_scrollx = (m_scrollx & 0xff) | (data << 4 & 0x0f00) | (data << 12 & 0xf000);
298}
299
300WRITE8_MEMBER(panicr_state::panicr_output_w)
301{
302   // d6, d7: play counter? (it only triggers on 1st coin)
303   coin_counter_w(machine(), 0, (data & 0x40) ? 1 : 0);
304   coin_counter_w(machine(), 1, (data & 0x80) ? 1 : 0);
305   
306   // other bits: ?
307}
308
309READ8_MEMBER(panicr_state::t5182shared_r)
310{
311   if ((offset & 1) == 0)
312      return t5182_sharedram_r(&space, offset/2);
313   else
314      return 0;
315}
316
317WRITE8_MEMBER(panicr_state::t5182shared_w)
318{
319   if ((offset & 1) == 0)
320      t5182_sharedram_w(&space, offset/2, data);
321}
322
323
324static ADDRESS_MAP_START( panicr_map, AS_PROGRAM, 8, panicr_state )
325   AM_RANGE(0x00000, 0x01fff) AM_RAM AM_SHARE("mainram")
326   AM_RANGE(0x02000, 0x02fff) AM_RAM AM_SHARE("spriteram")
327   AM_RANGE(0x03000, 0x03fff) AM_RAM
328   AM_RANGE(0x08000, 0x0bfff) AM_READ(panicr_collision_r)
329   AM_RANGE(0x0c000, 0x0cfff) AM_RAM AM_SHARE("textram")
330   AM_RANGE(0x0d000, 0x0d000) AM_WRITE_LEGACY(t5182_sound_irq_w)
331   AM_RANGE(0x0d002, 0x0d002) AM_WRITE_LEGACY(t5182_sharedram_semaphore_main_acquire_w)
332   AM_RANGE(0x0d004, 0x0d004) AM_READ_LEGACY(t5182_sharedram_semaphore_snd_r)
333   AM_RANGE(0x0d006, 0x0d006) AM_WRITE_LEGACY(t5182_sharedram_semaphore_main_release_w)
334   AM_RANGE(0x0d200, 0x0d2ff) AM_READWRITE(t5182shared_r, t5182shared_w)
335   AM_RANGE(0x0d400, 0x0d400) AM_READ_PORT("P1")
336   AM_RANGE(0x0d402, 0x0d402) AM_READ_PORT("P2")
337   AM_RANGE(0x0d404, 0x0d404) AM_READ_PORT("START")
338   AM_RANGE(0x0d406, 0x0d406) AM_READ_PORT("DSW1")
339   AM_RANGE(0x0d407, 0x0d407) AM_READ_PORT("DSW2")
340   AM_RANGE(0x0d802, 0x0d802) AM_WRITE(panicr_scrollx_hi_w)
341   AM_RANGE(0x0d804, 0x0d804) AM_WRITE(panicr_scrollx_lo_w)
342   AM_RANGE(0x0d80a, 0x0d80a) AM_WRITE(panicr_output_w)
343   AM_RANGE(0x0d80c, 0x0d80c) AM_WRITEONLY AM_SHARE("spritebank")
344   AM_RANGE(0x0d818, 0x0d818) AM_WRITENOP // watchdog?
345   AM_RANGE(0xf0000, 0xfffff) AM_ROM
346ADDRESS_MAP_END
347
348
349/***************************************************************************
350
351  Inputs
352
353***************************************************************************/
354
275355static INPUT_PORTS_START( panicr )
276356   PORT_START("P1")
277   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) //left
278   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) //right
279   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) //shake 1
280   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) //shake 2
281   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
357   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_NAME("P1 Left Flipper")
358   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_NAME("P1 Right Flipper")
359   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_NAME("P1 Left Shake")
360   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_NAME("P1 Right Shake")
361   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
282362
283363   PORT_START("P2")
284   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) //left
285   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) //right
286   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) //shake 1
287   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) //shake 2
288   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNKNOWN )
364   PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_NAME("P1 Left Flipper")
365   PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("P1 Right Flipper")
366   PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_NAME("P1 Left Shake")
367   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_NAME("P1 Right Shake")
368   PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
289369
290370   PORT_START("START")
291371   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
r17585r17586
293373   PORT_BIT( 0xe7, IP_ACTIVE_LOW, IPT_UNKNOWN )
294374
295375   PORT_START("DSW1")
296   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )   PORT_DIPLOCATION("SW1:8,7,6")
376   PORT_DIPNAME( 0x07, 0x07, DEF_STR( Coin_A ) )         PORT_DIPLOCATION("SW1:1,2,3")
297377   PORT_DIPSETTING(    0x00, DEF_STR( 5C_1C ) )
298378   PORT_DIPSETTING(    0x04, DEF_STR( 4C_1C ) )
299379   PORT_DIPSETTING(    0x02, DEF_STR( 3C_1C ) )
r17585r17586
302382   PORT_DIPSETTING(    0x03, DEF_STR( 1C_2C ) )
303383   PORT_DIPSETTING(    0x05, DEF_STR( 1C_3C ) )
304384   PORT_DIPSETTING(    0x01, DEF_STR( 1C_5C ) )
305   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )   PORT_DIPLOCATION("SW1:5,4")
385   PORT_DIPNAME( 0x18, 0x18, DEF_STR( Coin_B ) )         PORT_DIPLOCATION("SW1:4,5")
306386   PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
307387   PORT_DIPSETTING(    0x18, DEF_STR( 1C_1C ) )
308388   PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
309389   PORT_DIPSETTING(    0x08, DEF_STR( 1C_2C ) )
310   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:3" )
311   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW1:2")
390   PORT_SERVICE_DIPLOC( 0x20, IP_ACTIVE_LOW, "SW1:6" )
391   PORT_DIPNAME( 0x40, 0x00, DEF_STR( Allow_Continue ) )   PORT_DIPLOCATION("SW1:7")
312392   PORT_DIPSETTING(    0x40, DEF_STR( No ) )
313393   PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
314   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )   PORT_DIPLOCATION("SW1:1")
394   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )         PORT_DIPLOCATION("SW1:8")
315395   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
316396   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
317397
318398   PORT_START("DSW2")
319   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW2:8")
399   PORT_DIPNAME( 0x01, 0x00, DEF_STR( Demo_Sounds ) )      PORT_DIPLOCATION("SW2:1")
320400   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
321401   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
322   PORT_DIPNAME( 0x06, 0x04, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW2:7,6")
402   PORT_DIPNAME( 0x06, 0x06, DEF_STR( Difficulty ) )      PORT_DIPLOCATION("SW2:2,3")
323403   PORT_DIPSETTING(    0x06, DEF_STR( Easy ) )
324404   PORT_DIPSETTING(    0x04, DEF_STR( Medium ) )
325405   PORT_DIPSETTING(    0x02, DEF_STR( Hard ) )
326406   PORT_DIPSETTING(    0x00, DEF_STR( Hardest ) )
327   PORT_DIPNAME( 0x18, 0x18, "Bonus" )      PORT_DIPLOCATION("SW2:5,4")
328   PORT_DIPSETTING(    0x18, "50k & every 1OOk" )
329   PORT_DIPSETTING(    0x10, "1Ok 20k" )
407   PORT_DIPNAME( 0x18, 0x18, "Bonus Points" )            PORT_DIPLOCATION("SW2:4,5")
408   PORT_DIPSETTING(    0x18, "5k 10k" )
409   PORT_DIPSETTING(    0x10, "10k 20k" )
330410   PORT_DIPSETTING(    0x08, "20k 40k" )
331411   PORT_DIPSETTING(    0x00, "50k 100k" )
332   PORT_DIPNAME( 0x60, 0x40, "Balls" )      PORT_DIPLOCATION("SW2:3,2")
412   PORT_DIPNAME( 0x60, 0x40, DEF_STR( Lives ) )         PORT_DIPLOCATION("SW2:6,7")
333413   PORT_DIPSETTING(    0x00, "4" )
334414   PORT_DIPSETTING(    0x20, "2" )
335415   PORT_DIPSETTING(    0x40, "3" )
336416   PORT_DIPSETTING(    0x60, "1" )
337   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )   PORT_DIPLOCATION("SW2:1")
417   PORT_DIPNAME( 0x80, 0x80, DEF_STR( Cabinet ) )         PORT_DIPLOCATION("SW2:8")
338418   PORT_DIPSETTING(    0x80, DEF_STR( Upright ) )
339419   PORT_DIPSETTING(    0x00, DEF_STR( Cocktail ) )
340420
r17585r17586
343423   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_IMPULSE(2)
344424INPUT_PORTS_END
345425
426
427/***************************************************************************
428
429  Machine Config
430
431***************************************************************************/
432
346433static const gfx_layout charlayout =
347434{
348435   8,8,
r17585r17586
354441   16*8
355442};
356443
357static const gfx_layout tilelayout =
444static const gfx_layout bgtilelayout =
358445{
359446   16,16,
360447   RGN_FRAC(1,4),
361//  8,
362//  { 0, 4, RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+4, RGN_FRAC(2,4)+0, RGN_FRAC(2,4)+4, RGN_FRAC(3,4)+0, RGN_FRAC(3,4)+4 },
363448   4,
364449   { RGN_FRAC(2,4)+0, RGN_FRAC(2,4)+4, RGN_FRAC(3,4)+0, RGN_FRAC(3,4)+4 },
365450   { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
r17585r17586
369454   32*16
370455};
371456
457static const gfx_layout infotilelayout =
458{
459   16,16,
460   RGN_FRAC(1,4),
461   4,
462   { 0, 4, RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+4 },
463   { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3,
464         16+0, 16+1, 16+2, 16+3, 24+0, 24+1, 24+2, 24+3 },
465   { 0*32, 1*32, 2*32, 3*32, 4*32, 5*32, 6*32, 7*32,
466         8*32, 9*32, 10*32, 11*32, 12*32, 13*32, 14*32, 15*32 },
467   32*16
468};
372469
373470static const gfx_layout spritelayout =
374471{
r17585r17586
384481};
385482
386483static GFXDECODE_START( panicr )
387   GFXDECODE_ENTRY( "gfx1", 0, charlayout,   0x000,  8 )
388   GFXDECODE_ENTRY( "gfx2", 0, tilelayout,   0x100, 16 )
389   GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 0x200, 16 )
484   GFXDECODE_ENTRY( "gfx1", 0, charlayout,     0x000,  8 )
485   GFXDECODE_ENTRY( "gfx2", 0, bgtilelayout,   0x100, 16 )
486   GFXDECODE_ENTRY( "gfx2", 0, infotilelayout, 0x100, 16 ) // palette is just to make it viewable with F4
487   GFXDECODE_ENTRY( "gfx3", 0, spritelayout,   0x200, 16 )
390488GFXDECODE_END
391489
490
491static TIMER_DEVICE_CALLBACK( panicr_scanline )
492{
493   int scanline = param;
494
495   if(scanline == 240) // vblank-out irq
496      cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xc4/4);
497
498   if(scanline == 0) // <unknown>
499      cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xc8/4);
500}
501
392502static MACHINE_CONFIG_START( panicr, panicr_state )
393503   MCFG_CPU_ADD("maincpu", V20,MASTER_CLOCK/2) /* Sony 8623h9 CXQ70116D-8 (V20 compatible) */
394504   MCFG_CPU_PROGRAM_MAP(panicr_map)
r17585r17586
421531
422532MACHINE_CONFIG_END
423533
534
424535ROM_START( panicr )
425536   ROM_REGION( 0x200000, "maincpu", 0 ) /* v20 main cpu */
426537   ROM_LOAD16_BYTE("2.19m",   0x0f0000, 0x08000, CRC(3d48b0b5) SHA1(a6e8b38971a8964af463c16f32bb7dbd301dd314) )
r17585r17586
449560   ROM_REGION( 0x04000, "user2", 0 )
450561   ROM_LOAD( "7d.bin", 0x00000, 0x4000, CRC(8032c1e9) SHA1(fcc8579c0117ebe9271cff31e14a30f61a9cf031) ) //attribute maps
451562
452   ROM_REGION( 0x04000, "user3", 0 )
453   ROM_COPY( "user2", 0x0000, 0x0000, 0x4000 )
454
455563   ROM_REGION( 0x0800,  "proms", 0 )
456564   ROM_LOAD( "b.14c",   0x00000, 0x100, CRC(145d1e0d) SHA1(8073fd176a1805552a5ac00ca0d9189e6e8936b1) )   // red
457565   ROM_LOAD( "a.15c",   0x00100, 0x100, CRC(c75772bc) SHA1(ec84052aedc1d53f9caba3232ffff17de69561b2) )   // green
r17585r17586
491599   ROM_REGION( 0x04000, "user2", 0 )
492600   ROM_LOAD( "7d.bin", 0x00000, 0x4000, CRC(8032c1e9) SHA1(fcc8579c0117ebe9271cff31e14a30f61a9cf031) ) //attribute maps
493601
494   ROM_REGION( 0x04000, "user3", 0 )
495   ROM_COPY( "user2", 0x0000, 0x0000, 0x4000 )
496
497602   ROM_REGION( 0x0800,  "proms", 0 )
498603   ROM_LOAD( "b.14c",   0x00000, 0x100, CRC(145d1e0d) SHA1(8073fd176a1805552a5ac00ca0d9189e6e8936b1) )   // red
499604   ROM_LOAD( "a.15c",   0x00100, 0x100, CRC(c75772bc) SHA1(ec84052aedc1d53f9caba3232ffff17de69561b2) )   // green
r17585r17586
511616   UINT8 *buf = auto_alloc_array(machine(), UINT8, 0x80000);
512617   UINT8 *rom;
513618   int size;
514   int i;
619   int i,j;
515620
516621   rom = machine().root_device().memregion("gfx1")->base();
517622   size = machine().root_device().memregion("gfx1")->bytes();
r17585r17586
588693   }
589694
590695   //rearrange  bg tilemaps a bit....
591
592696   rom = machine().root_device().memregion("user1")->base();
593697   size = machine().root_device().memregion("user1")->bytes();
594698   memcpy(buf,rom, size);
595699
700   for(j=0;j<16;j++)
596701   {
597      int j;
598      for(j=0;j<16;j++)
599         for (i = 0;i < size/16;i+=8)
600         {
601            memcpy(&rom[i+(size/16)*j],&buf[i*16+8*j],8);
602         }
702      for (i = 0;i < size/16;i+=8)
703      {
704         memcpy(&rom[i+(size/16)*j],&buf[i*16+8*j],8);
705      }
603706   }
604707
605708   rom = machine().root_device().memregion("user2")->base();
606709   size = machine().root_device().memregion("user2")->bytes();
710   memcpy(buf,rom, size);
607711
608   memcpy(buf,rom, size);
712   for(j=0;j<16;j++)
609713   {
610      int j;
611      for(j=0;j<16;j++)
612         for (i = 0;i < size/16;i+=8)
613         {
614            memcpy(&rom[i+(size/16)*j],&buf[i*16+8*j],8);
615         }
714      for (i = 0;i < size/16;i+=8)
715      {
716         memcpy(&rom[i+(size/16)*j],&buf[i*16+8*j],8);
717      }
616718   }
617719
618720   auto_free(machine(), buf);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team