Previous 199869 Revisions Next

r32204 Friday 19th September, 2014 at 13:53:03 UTC by Robbbert
spinb.c : fixed colours in jolypark.
[src/mame/drivers]spinb.c

trunk/src/mame/drivers/spinb.c
r32203r32204
1515  soundcard.
1616
1717Status
18- Bushido: If you quickly press 5 you get a sound.
19- Mach 2: Makes a sound if 5 pressed
20- Jolly Park: Display flashes. After a few moments it plays music
18- Bushido: Displays Bushido logo. If you quickly press 5 you get a sound.
19- Mach 2: Displays Mach2 logo. Makes a sound if 5 pressed
20- Jolly Park: Displays the Spinball logo. After a few moments it plays music
2121- Verne's World: Display flashes for a second then goes blank. After a few moments music plays.
2222
2323ToDo:
24- Inputs and outputs (copied from inder.c)
24- Inputs and outputs (currently a copy of inder.c)
2525- DMD doesn't act on commands
2626- Electronic volume control on the music card
27- Display on jolypark and vrnwrld has dots of 2 intensities
2827
28
2929****************************************************************************************************/
3030
3131#include "machine/genpin.h"
r32203r32204
6767   DECLARE_WRITE8_MEMBER(ppi60b_w);
6868   DECLARE_WRITE8_MEMBER(ppi64c_w);
6969   DECLARE_READ8_MEMBER(sw_r);
70   DECLARE_WRITE8_MEMBER(sw_w);
7170   DECLARE_WRITE8_MEMBER(dmdram_w);
7271   DECLARE_READ8_MEMBER(dmdram_r);
7372   DECLARE_READ8_MEMBER(sndcmd_r);
r32203r32204
8584   DECLARE_DRIVER_INIT(game0);
8685   DECLARE_DRIVER_INIT(game1);
8786   DECLARE_DRIVER_INIT(game2);
87   DECLARE_PALETTE_INIT(spinb);
8888   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
89   //UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9089private:
9190   bool m_pc0a;
9291   bool m_pc0m;
r32203r32204
109108   UINT8 *m_p_music;
110109   UINT8 *m_p_dmdcpu;
111110   virtual void machine_reset();
111   virtual void machine_start();
112112   required_device<cpu_device> m_maincpu;
113113   required_device<cpu_device> m_audiocpu;
114114   required_device<cpu_device> m_musiccpu;
r32203r32204
304304            break;
305305      }
306306   }
307
308   if (m_dmdbank==3)
309   {
310      m_p32 = 4;
311      m_dmdcpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE);
312   }
313307}
314308
315309READ8_MEMBER( spinb_state::p3_r )
r32203r32204
341335   return m_switches[m_row]->read();
342336}
343337
344WRITE8_MEMBER( spinb_state::sw_w )
345{
346   m_row = offset;
347}
348
349338WRITE8_MEMBER( spinb_state::sndcmd_w )
350339{
351340   m_sndcmd = data;
r32203r32204
373362         return m_p_dmdcpu[0x80000 + offset + (m_dmdextaddr << 16)];
374363   }
375364
365   m_p32 = 4;
366   m_dmdcpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE);
376367   return m_dmdcmd;
377368}
378369
r32203r32204
537528   m_row = 0;
538529}
539530
531void spinb_state::machine_start()
532{
533   save_item(NAME(m_dmdram)); // make it visible in the debugger
534}
535
540536DRIVER_INIT_MEMBER( spinb_state, game0 )
541537{
542538   m_p_audio = memregion("audiorom")->base();
r32203r32204
560556   m_game = 2;
561557}
562558
559PALETTE_INIT_MEMBER( spinb_state, spinb )
560{
561   palette.set_pen_color(0, rgb_t(0x00, 0x00, 0x00));
562   palette.set_pen_color(1, rgb_t(0xf7, 0xaa, 0x00));
563   palette.set_pen_color(2, rgb_t(0x7c, 0x55, 0x00));
564}
565
563566UINT32 spinb_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
564567{
565   UINT8 y,gfx;
568   UINT8 y,gfx,gfx1;
566569   UINT16 sy=0,ma,x;
567570   address_space &internal = m_dmdcpu->space(AS_DATA);
568571   ma = internal.read_byte(0x05) << 8; // find where display memory is
569   ma &= 0xfe00;
570572
571   for(y=0; y<32; y++)
573   if (m_game)
572574   {
573      UINT16 *p = &bitmap.pix16(sy++);
574      for(x = 0; x < 16; x++)
575      ma = ((ma - 0x200) & 0x1c00) + 0x200;
576
577      for(y=0; y<32; y++)
575578      {
576         gfx = m_dmdram[ma++];
579         UINT16 *p = &bitmap.pix16(sy++);
580         for(x = 0; x < 16; x++)
581         {
582            gfx = m_dmdram[ma+0x200];
583            gfx1 = m_dmdram[ma++];
577584
578         *p++ = BIT(gfx, 0);
579         *p++ = BIT(gfx, 1);
580         *p++ = BIT(gfx, 2);
581         *p++ = BIT(gfx, 3);
582         *p++ = BIT(gfx, 4);
583         *p++ = BIT(gfx, 5);
584         *p++ = BIT(gfx, 6);
585         *p++ = BIT(gfx, 7);
585            *p++ = BIT(gfx1, 0) ? 1 : BIT(gfx, 0) ? 2 : 0;
586            *p++ = BIT(gfx1, 1) ? 1 : BIT(gfx, 1) ? 2 : 0;
587            *p++ = BIT(gfx1, 2) ? 1 : BIT(gfx, 2) ? 2 : 0;
588            *p++ = BIT(gfx1, 3) ? 1 : BIT(gfx, 3) ? 2 : 0;
589            *p++ = BIT(gfx1, 4) ? 1 : BIT(gfx, 4) ? 2 : 0;
590            *p++ = BIT(gfx1, 5) ? 1 : BIT(gfx, 5) ? 2 : 0;
591            *p++ = BIT(gfx1, 6) ? 1 : BIT(gfx, 6) ? 2 : 0;
592            *p++ = BIT(gfx1, 7) ? 1 : BIT(gfx, 7) ? 2 : 0;
593         }
586594      }
587595   }
596   else
597   {
598      ma &= 0x1e00;
599
600      for(y=0; y<32; y++)
601      {
602         UINT16 *p = &bitmap.pix16(sy++);
603         for(x = 0; x < 16; x++)
604         {
605            gfx = m_dmdram[ma++];
606
607            *p++ = BIT(gfx, 0);
608            *p++ = BIT(gfx, 1);
609            *p++ = BIT(gfx, 2);
610            *p++ = BIT(gfx, 3);
611            *p++ = BIT(gfx, 4);
612            *p++ = BIT(gfx, 5);
613            *p++ = BIT(gfx, 6);
614            *p++ = BIT(gfx, 7);
615         }
616      }
617   }
588618   return 0;
589619}
590620
r32203r32204
611641   MCFG_SCREEN_SIZE(128, 32)
612642   MCFG_SCREEN_VISIBLE_AREA(0, 127, 0, 31)
613643   MCFG_SCREEN_PALETTE("palette")
614   MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette")
644   MCFG_PALETTE_ADD( "palette", 3 )
645   MCFG_PALETTE_INIT_OWNER(spinb_state, spinb)
615646
616647   /* Sound */
617648   MCFG_FRAGMENT_ADD( genpin_audio )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team